ULRE/inc/hgl/graph/SceneOrient.h

61 lines
2.5 KiB
C
Raw Normal View History

2019-05-21 21:28:33 +08:00
#ifndef HGL_GRAPH_SCENE_ORIENT_INCLUDE
#define HGL_GRAPH_SCENE_ORIENT_INCLUDE
#include<hgl/graph/VK.h>
2024-08-25 04:03:57 +08:00
#include<hgl/math/Transform.h>
2019-05-21 21:28:33 +08:00
namespace hgl
{
namespace graph
{
/**
*
*/
class SceneOrient ///场景定位类
2019-05-21 21:28:33 +08:00
{
protected:
2024-08-25 04:03:57 +08:00
Matrix4f parent_matrix;
bool parent_matrix_dirty;
Matrix4f local_matrix;
bool local_matrix_dirty;
2019-05-21 21:28:33 +08:00
2024-08-24 03:08:14 +08:00
TransformManager transform_manager;
2024-08-25 04:03:57 +08:00
uint32 transform_version;
uint32 local_to_world_matrix_version;
2019-05-21 21:28:33 +08:00
2024-08-25 04:03:57 +08:00
// LocalToWorld = ParentMatrix * LocalMatrix * TransformMatrix
2024-08-25 04:03:57 +08:00
Matrix4f local_to_world_matrix; ///<本地到世界矩阵
Matrix4f inverse_local_to_world_matrix; ///<世界到本地矩阵
Matrix4f inverse_transpose_local_to_world_matrix; ///<世界到本地矩阵的转置矩阵
2019-05-21 21:28:33 +08:00
2024-08-24 03:08:14 +08:00
virtual void SetWorldMatrix(const Matrix4f &);
2019-05-21 21:28:33 +08:00
public:
SceneOrient();
2024-07-31 00:11:04 +08:00
SceneOrient(const SceneOrient &);
2024-08-24 03:08:14 +08:00
SceneOrient(const Matrix4f &);
2019-05-21 21:28:33 +08:00
virtual ~SceneOrient()=default;
2024-08-25 04:03:57 +08:00
void SetLocalMatrix(const Matrix4f &); ///<设置本地矩阵
public:
2024-08-25 04:03:57 +08:00
const Matrix4f & GetLocalMatrix ()const{return local_matrix;}
2024-08-25 04:03:57 +08:00
TransformManager & GetTransform () {return transform_manager;} ///<取得变换管理器
2019-05-21 21:28:33 +08:00
2024-08-25 04:03:57 +08:00
const Matrix4f & GetLocalToWorldMatrix ()const{return local_to_world_matrix;}
const Matrix4f & GetInverseLocalToWorldMatrix ()const{return inverse_local_to_world_matrix;}
const Matrix4f & GetInverseTransposeLocalToWorldMatrix ()const{return inverse_transpose_local_to_world_matrix;}
2019-05-21 21:28:33 +08:00
public:
2024-08-25 04:03:57 +08:00
virtual bool RefreshMatrix (const Matrix4f &); ///<刷新到世界空间变换
2019-05-21 21:28:33 +08:00
};//class SceneOrient
}//namespace graph
}//namespace hgl
#endif//HGL_GRAPH_SCENE_ORIENT_INCLUDE