27 lines
595 B
C++
27 lines
595 B
C++
#pragma once
|
|
#include "math/Math.h"
|
|
#include <glm/glm.hpp>
|
|
#include <glm/ext/matrix_clip_space.hpp>
|
|
#include <glm/gtc/type_ptr.hpp>
|
|
class Y_Transform
|
|
{
|
|
public:
|
|
float rotation; ///< 旋转
|
|
glm::vec2 position; ///< 坐标
|
|
glm::vec2 scale; ///< 缩放
|
|
glm::vec2 skew; ///< 错切角度
|
|
|
|
public:
|
|
Y_Transform(/* args */);
|
|
|
|
bool IsFast() const
|
|
{
|
|
return skew.x == 0.f && skew.y == 0.f &&
|
|
scale.x == 1.f && scale.y == 1.f &&
|
|
rotation == 0.f;
|
|
}
|
|
|
|
Matrix3x2 ToMatrix() const;
|
|
glm::mat4 GetTransformMatrix() const;
|
|
};
|