diff --git a/inc/hgl/graph/SceneOrient.h b/inc/hgl/graph/SceneOrient.h index 50a7b04b..eda68117 100644 --- a/inc/hgl/graph/SceneOrient.h +++ b/inc/hgl/graph/SceneOrient.h @@ -27,6 +27,7 @@ namespace hgl public: SceneOrient(); + SceneOrient(const Matrix4f &mat); virtual ~SceneOrient()=default; Matrix4f & SetLocalMatrix (const Matrix4f &); ///<设定当前节点矩阵 diff --git a/src/SceneGraph/SceneOrient.cpp b/src/SceneGraph/SceneOrient.cpp index 98047ce1..6e43aeb9 100644 --- a/src/SceneGraph/SceneOrient.cpp +++ b/src/SceneGraph/SceneOrient.cpp @@ -3,8 +3,6 @@ namespace hgl { namespace graph { - Matrix4f Ortho2DMatrix; ///<全局2D视图矩阵 - SceneOrient::SceneOrient() { LocalMatrix =Matrix4f::identity; @@ -13,6 +11,14 @@ namespace hgl InverseLocalToWorldMatrix =Matrix4f::identity; } + SceneOrient::SceneOrient(const Matrix4f &mat) + { + SetLocalMatrix(mat); + + LocalToWorldMatrix =Matrix4f::identity; + InverseLocalToWorldMatrix =Matrix4f::identity; + } + Matrix4f &SceneOrient::SetLocalMatrix(const Matrix4f &m) { LocalMatrix=m;