From 2180dff6f8dc493c4fe919c9c947b71392a6994b Mon Sep 17 00:00:00 2001 From: hyzboy Date: Thu, 10 Jun 2021 18:55:40 +0800 Subject: [PATCH] add new construct function of SceneOrient --- inc/hgl/graph/SceneOrient.h | 1 + src/SceneGraph/SceneOrient.cpp | 10 ++++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) 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;