2021-06-15 15:04:17 +08:00
|
|
|
|
#ifndef HGL_GRAPH_RENDER_NODE_INCLUDE
|
2021-06-10 18:56:23 +08:00
|
|
|
|
#define HGL_GRAPH_RENDER_NODE_INCLUDE
|
|
|
|
|
|
|
|
|
|
#include<hgl/math/Vector.h>
|
|
|
|
|
#include<hgl/type/List.h>
|
2021-06-15 15:04:17 +08:00
|
|
|
|
#include<hgl/graph/SceneInfo.h>
|
2021-06-10 18:56:23 +08:00
|
|
|
|
namespace hgl
|
|
|
|
|
{
|
|
|
|
|
namespace graph
|
|
|
|
|
{
|
|
|
|
|
class RenderableInstance;
|
|
|
|
|
|
|
|
|
|
struct RenderNode
|
|
|
|
|
{
|
2021-06-15 15:04:17 +08:00
|
|
|
|
MVPMatrix matrix;
|
|
|
|
|
|
2022-01-18 12:10:02 +08:00
|
|
|
|
Vector3f WorldCenter;
|
2021-06-10 18:56:23 +08:00
|
|
|
|
|
|
|
|
|
float distance_to_camera_square;
|
|
|
|
|
// float distance_to_camera;
|
|
|
|
|
|
|
|
|
|
RenderableInstance *ri;
|
2021-06-15 15:04:17 +08:00
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 取得渲染对象ubo独占区大小
|
|
|
|
|
*/
|
|
|
|
|
virtual const uint32 GetUBOBytes()const{return sizeof(MVPMatrix);}
|
2021-06-10 18:56:23 +08:00
|
|
|
|
};//struct RenderNode
|
|
|
|
|
|
|
|
|
|
using RenderNodeList=List<RenderNode *>;
|
|
|
|
|
}//namespace graph
|
|
|
|
|
}//namespace hgl
|
2021-06-19 20:31:07 +08:00
|
|
|
|
|
|
|
|
|
using RenderNodePointer=hgl::graph::RenderNode *;
|
|
|
|
|
using RenderNodeComparator=Comparator<RenderNodePointer>;
|
|
|
|
|
|
2021-06-10 18:56:23 +08:00
|
|
|
|
#endif//HGL_GRAPH_RENDER_NODE_INCLUDE
|