2025-03-20 02:09:50 +08:00
|
|
|
|
#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>
|
2025-03-20 02:09:50 +08:00
|
|
|
|
|
2021-06-10 18:56:23 +08:00
|
|
|
|
namespace hgl
|
|
|
|
|
{
|
|
|
|
|
namespace graph
|
|
|
|
|
{
|
2025-05-18 02:03:16 +08:00
|
|
|
|
class Mesh;
|
2023-06-01 21:25:50 +08:00
|
|
|
|
class MaterialInstance;
|
2025-06-15 17:53:15 +08:00
|
|
|
|
class MeshComponent;
|
2021-06-10 18:56:23 +08:00
|
|
|
|
|
2025-01-15 02:42:04 +08:00
|
|
|
|
struct RenderNode:public Comparator<RenderNode>
|
2023-04-25 18:08:26 +08:00
|
|
|
|
{
|
2025-01-15 02:42:04 +08:00
|
|
|
|
uint index; ///<在MaterialRenderList中的索引
|
2023-05-07 01:07:26 +08:00
|
|
|
|
|
2025-06-15 17:53:15 +08:00
|
|
|
|
MeshComponent *sm_component; ///<静态网格组件
|
2024-08-04 22:35:31 +08:00
|
|
|
|
|
2024-08-30 03:36:01 +08:00
|
|
|
|
uint32 l2w_version;
|
|
|
|
|
uint32 l2w_index;
|
|
|
|
|
|
|
|
|
|
Vector3f world_position;
|
|
|
|
|
float to_camera_distance;
|
2025-01-15 02:42:04 +08:00
|
|
|
|
|
|
|
|
|
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 *>;
|
2023-09-20 15:55:14 +08:00
|
|
|
|
|
2024-11-21 01:30:42 +08:00
|
|
|
|
using MaterialInstanceSets=SortedSet<MaterialInstance *>; ///<材质实例集合
|
2023-05-07 01:07:26 +08:00
|
|
|
|
}//namespace graph
|
2025-01-15 02:42:04 +08:00
|
|
|
|
|
|
|
|
|
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
|