ULRE/inc/hgl/graph/RenderNode.h

48 lines
1.3 KiB
C
Raw Normal View History

#pragma once
2021-06-10 18:56:23 +08:00
2023-05-07 01:07:26 +08:00
#include<hgl/graph/VK.h>
2024-11-21 01:30:42 +08:00
#include<hgl/type/SortedSet.h>
2021-06-10 18:56:23 +08:00
namespace hgl
{
namespace graph
{
2025-05-18 02:03:16 +08:00
class Mesh;
class MaterialInstance;
2025-06-15 17:53:15 +08:00
class MeshComponent;
2021-06-10 18:56:23 +08:00
struct RenderNode:public Comparator<RenderNode>
2023-04-25 18:08:26 +08:00
{
uint index; ///<在MaterialRenderList中的索引
2023-05-07 01:07:26 +08:00
2025-06-15 17:53:15 +08:00
MeshComponent *sm_component; ///<静态网格组件
uint32 l2w_version;
uint32 l2w_index;
Vector3f world_position;
float to_camera_distance;
public:
//该函数位于MaterialRenderList.cpp
const int compare(const RenderNode &)const override;
2025-06-14 21:05:36 +08:00
public:
Mesh *GetMesh()const;
MaterialInstance *GetMaterialInstance()const;
2023-04-25 18:08:26 +08:00
};
2025-04-23 00:27:43 +08:00
using RenderNodeList=ArrayList<RenderNode>;
using RenderNodePointerList=ArrayList<RenderNode *>;
2024-11-21 01:30:42 +08:00
using MaterialInstanceSets=SortedSet<MaterialInstance *>; ///<材质实例集合
2023-05-07 01:07:26 +08:00
}//namespace graph
template<> inline const int ItemComparator<graph::RenderNode>::compare(const graph::RenderNode &a,const graph::RenderNode &b)
{
return a.compare(b);
}
2023-05-07 01:07:26 +08:00
}//namespace hgl