2021-05-24 20:44:20 +08:00
|
|
|
|
#ifndef HGL_GRAPH_SCENE_INFO_INCLUDE
|
|
|
|
|
#define HGL_GRAPH_SCENE_INFO_INCLUDE
|
2021-04-26 20:36:56 +08:00
|
|
|
|
|
|
|
|
|
#include<hgl/math/Matrix.h>
|
|
|
|
|
#include<hgl/CompOperator.h>
|
|
|
|
|
namespace hgl
|
|
|
|
|
{
|
|
|
|
|
namespace graph
|
|
|
|
|
{
|
|
|
|
|
/**
|
|
|
|
|
* MVP<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
*/
|
|
|
|
|
struct MVPMatrix
|
|
|
|
|
{
|
|
|
|
|
Matrix4f l2w; ///< Local to World
|
|
|
|
|
Matrix4f inverse_l2w;
|
|
|
|
|
|
|
|
|
|
Matrix4f mvp; ///< projection * view * local_to_world
|
|
|
|
|
Matrix4f inverse_mvp;
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
void Set(const Matrix4f &w,const Matrix4f &vp)
|
|
|
|
|
{
|
|
|
|
|
l2w=w;
|
|
|
|
|
inverse_l2w=l2w.Inverted();
|
|
|
|
|
|
|
|
|
|
mvp=vp*l2w;
|
|
|
|
|
inverse_mvp=mvp.Inverted();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CompOperatorMemcmp(const MVPMatrix &);
|
|
|
|
|
};//struct MVPMatrix
|
|
|
|
|
}//namespace graph
|
2021-04-30 18:56:20 +08:00
|
|
|
|
}//namespace hgl
|
2021-05-24 20:44:20 +08:00
|
|
|
|
#endif//HGL_GRAPH_SCENE_INFO_INCLUDE
|