建立Component,第一步先将Renderable渲染迁移到这上面来

This commit is contained in:
hyzboy 2025-03-18 01:26:35 +08:00
parent d43a877be1
commit ada6a41fc6
6 changed files with 65 additions and 6 deletions

View 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

View File

View 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

View File

@ -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:

View File

@ -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:

View File

@ -296,6 +296,14 @@ SET(VK_RENDERABLE_SOURCE ${SG_INCLUDE_PATH}/VKRenderable.h
SOURCE_GROUP("Vulkan\\Renderable" FILES ${VK_RENDERABLE_SOURCE})
set(COMPONENT_INCLUDE_PATH ${ROOT_INCLUDE_PATH}/hgl/component)
SET(COMPONENT_FILES ${COMPONENT_INCLUDE_PATH}/Component.h
${COMPONENT_INCLUDE_PATH}/RenderComponent.h
${COMPONENT_INCLUDE_PATH}/PrimitiveComponent.h)
SOURCE_GROUP("Component" FILES ${COMPONENT_FILES})
IF(WIN32)
OPTION(FORCE_DISCETE_GPU "Force Discrete GPU" OFF)
@ -374,6 +382,8 @@ add_cm_library(ULRE.SceneGraph "ULRE" ${SCENE_GRAPH_FILES}
${STATIC_MESH_HEADER_FILES}
${STATIC_MESH_SOURCE_FILES}
${COMPONENT_FILES}
# ${FONT_MANAGE_SOURCE}
# ${FONT_SOURCE}
# ${FONT_SOURCE_OS}