加入 Node节点类 还未测试新框架
This commit is contained in:
26
source/EngineFrame/Attribute/Y_Transform.h
Normal file
26
source/EngineFrame/Attribute/Y_Transform.h
Normal file
@@ -0,0 +1,26 @@
|
||||
#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;
|
||||
};
|
||||
Reference in New Issue
Block a user