ULRE/src/SceneGraph/SceneOrient.cpp

35 lines
927 B
C++
Raw Normal View History

2019-05-21 21:28:33 +08:00
#include<hgl/graph/SceneOrient.h>
namespace hgl
{
namespace graph
{
2024-07-31 00:11:04 +08:00
SceneOrient::SceneOrient(const SceneOrient &so)
{
scene_matrix=so.scene_matrix;
WorldPosition=so.WorldPosition;
scene_matrix.UpdateNewestData();
2024-07-31 00:11:04 +08:00
}
2019-05-21 21:28:33 +08:00
2024-08-25 04:03:57 +08:00
SceneOrient::SceneOrient(const Matrix4f &mat):SceneOrient()
{
scene_matrix.SetLocalMatrix(mat);
scene_matrix.UpdateNewestData();
WorldPosition=TransformPosition(GetLocalToWorldMatrix(),ZeroVector3f);
2019-05-21 21:28:33 +08:00
}
void SceneOrient::RefreshMatrix()
2019-05-21 21:28:33 +08:00
{
if (scene_matrix.IsNewestVersion())
{
//是最新版本,证明没有更新,那不用刷新了
return;
}
2024-08-25 04:03:57 +08:00
WorldPosition=TransformPosition(GetLocalToWorldMatrix(),ZeroVector3f);
2019-05-21 21:28:33 +08:00
}
}//namespace graph
}//namespace hgl