建立Component,第一步先将Renderable渲染迁移到这上面来
This commit is contained in:
21
inc/hgl/component/Component.h
Normal file
21
inc/hgl/component/Component.h
Normal file
@@ -0,0 +1,21 @@
|
||||
#pragma once
|
||||
|
||||
#include<hgl/type/DataType.h>
|
||||
|
||||
namespace hgl::graph
|
||||
{
|
||||
/**
|
||||
* 基础组件<br>
|
||||
* 是一切组件的基类
|
||||
*/
|
||||
class BaseComponent
|
||||
{
|
||||
public:
|
||||
|
||||
virtual ~BaseComponent()=default;
|
||||
|
||||
public: //序列化
|
||||
|
||||
|
||||
};//class BaseComponent
|
||||
}//namespace hgl::graph
|
0
inc/hgl/component/PrimitiveComponent.h
Normal file
0
inc/hgl/component/PrimitiveComponent.h
Normal file
19
inc/hgl/component/RenderComponent.h
Normal file
19
inc/hgl/component/RenderComponent.h
Normal file
@@ -0,0 +1,19 @@
|
||||
#pragma once
|
||||
|
||||
#include<hgl/component/Component.h>
|
||||
|
||||
namespace hgl::graph
|
||||
{
|
||||
/**
|
||||
* 可渲染组件
|
||||
*/
|
||||
class RenderComponent: public BaseComponent
|
||||
{
|
||||
public:
|
||||
|
||||
RenderComponent()=default;
|
||||
virtual ~RenderComponent()=default;
|
||||
|
||||
virtual void Render()=0;
|
||||
};//class RenderComponent
|
||||
}//namespace hgl::graph
|
@@ -34,14 +34,14 @@ namespace hgl
|
||||
|
||||
protected:
|
||||
|
||||
ObjectList<SceneNode> ChildNode; ///<子节点
|
||||
ObjectList<SceneNode> ChildNode; ///<子节点
|
||||
|
||||
public:
|
||||
|
||||
const SceneNodeID & GetNodeID ()const { return NodeID; } ///<取得节点ID
|
||||
const SceneNodeName & GetNodeName ()const { return NodeName; } ///<取得节点名称
|
||||
|
||||
const ObjectList<SceneNode> &GetChildNode()const { return ChildNode; } ///<取得子节点列表
|
||||
const ObjectList<SceneNode> &GetChildNode()const { return ChildNode; } ///<取得子节点列表
|
||||
|
||||
public:
|
||||
|
||||
|
@@ -5,17 +5,26 @@ namespace hgl
|
||||
{
|
||||
namespace graph
|
||||
{
|
||||
class CameraData
|
||||
{
|
||||
};
|
||||
|
||||
class CameraManager
|
||||
{
|
||||
public:
|
||||
};
|
||||
|
||||
/**
|
||||
* 场景管理器<Br>
|
||||
* 管理一个场景中的所有资源与场景节点
|
||||
* 世界场景管理器<Br>
|
||||
* 管理一个世界场景中的所有资源与场景节点
|
||||
*/
|
||||
class SceneWorld
|
||||
{
|
||||
SceneNode *root_node;
|
||||
SceneNode *root_node; ///<世界根节点
|
||||
|
||||
public:
|
||||
|
||||
|
||||
|
||||
|
||||
public:
|
||||
|
||||
|
Reference in New Issue
Block a user