ULRE/inc/hgl/graph/RenderNode.h

42 lines
974 B
C
Raw Normal View History

#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>
#include<hgl/graph/SceneInfo.h>
2021-06-10 18:56:23 +08:00
namespace hgl
{
namespace graph
{
class Renderable;
2021-06-10 18:56:23 +08:00
2023-03-23 21:43:10 +08:00
constexpr double RenderNode3DDistanceFactor=100.0;
struct RenderNode3D
2021-06-10 18:56:23 +08:00
{
MVPMatrix matrix;
Vector3f WorldCenter;
2021-06-10 18:56:23 +08:00
2023-03-23 21:43:10 +08:00
double distance_to_camera_square;
double distance_to_camera;
2021-06-10 18:56:23 +08:00
Renderable *ri;
public:
/**
* ubo独占区大小
*/
virtual const uint32 GetUBOBytes()const{return sizeof(MVPMatrix);}
2021-06-10 18:56:23 +08:00
};//struct RenderNode
2023-03-23 21:43:10 +08:00
using RenderNode3DList=List<RenderNode3D *>;
2021-06-10 18:56:23 +08:00
}//namespace graph
}//namespace hgl
2023-03-23 21:43:10 +08:00
using RenderNode3DPointer=hgl::graph::RenderNode3D *;
using RenderNode3DComparator=Comparator<RenderNode3DPointer>;
2021-06-10 18:56:23 +08:00
#endif//HGL_GRAPH_RENDER_NODE_INCLUDE