Added Owner in SceneNode, and then have few other change.

This commit is contained in:
2024-10-20 23:17:04 +08:00
parent 0df9d64dcf
commit 83c1a067fe
5 changed files with 26 additions and 60 deletions

View File

@@ -44,7 +44,7 @@ public:
};//struct RenderPipelineIndex
/**
* 同一材质的对象渲染列表
* 同一材质与管线的渲染列表
*/
class MaterialRenderList
{
@@ -113,15 +113,9 @@ public:
void Add(SceneNode *);
void SetCameraInfo(CameraInfo *ci)
{
camera_info=ci;
}
void SetCameraInfo(CameraInfo *ci){camera_info=ci;}
void Clear()
{
rn_list.Clear();
}
void Clear(){rn_list.Clear();}
void End();

View File

@@ -19,6 +19,8 @@ namespace hgl
*/
class SceneNode:public SceneOrient ///场景节点类
{
SceneNode *Owner; ///<上级节点
SceneNodeID NodeID; ///<节点ID
SceneNodeName NodeName; ///<节点名称
@@ -59,6 +61,8 @@ namespace hgl
{
SceneOrient::Clear();
Owner=nullptr;
BoundingBox.SetZero();
LocalBoundingBox.SetZero();
@@ -74,8 +78,13 @@ namespace hgl
return(true);
}
Renderable *GetRenderable(){return render_obj;}
void SetRenderable(Renderable *);
void SetOwner(SceneNode *sn) {Owner=sn;}
SceneNode * GetOwner() noexcept{return Owner;}
const SceneNode * GetOwner()const noexcept{return Owner;}
void SetRenderable(Renderable *);
Renderable *GetRenderable() noexcept{return render_obj;}
const Renderable *GetRenderable()const noexcept{return render_obj;}
SceneNode *Add(SceneNode *sn)
{
@@ -83,6 +92,7 @@ namespace hgl
return(nullptr);
ChildNode.Add(sn);
sn->SetOwner(this);
return sn;
}

View File

@@ -1,39 +0,0 @@
#pragma once
#include<hgl/type/TypeInfo.h>
#include<hgl/graph/VK.h>
VK_NAMESPACE_BEGIN
class SceneNode;
class SceneComponentData
{
};//class SceneComponentData
class SceneComponentManager;
class SceneComponent
{
SceneComponentManager *manager;
SceneNode *owner;
public:
SceneComponentManager *GetManager()const{return manager;}
SceneNode *GetOwner()const{return owner;}
virtual const size_t GetTypeHash()=0;
public:
};//class SceneComponent
class SceneComponentManager
{
};//class SceneComponentManager
VK_NAMESPACE_END