ULRE/inc/hgl/graph/SceneWorld.h

51 lines
1.3 KiB
C
Raw Normal View History

2024-09-06 01:04:28 +08:00
#pragma once
2024-09-06 01:04:28 +08:00
#include<hgl/graph/SceneNode.h>
2025-05-22 01:42:16 +08:00
#include<hgl/type/Pool.h>
2024-09-06 01:04:28 +08:00
namespace hgl::graph
2024-09-06 01:04:28 +08:00
{
/**
* <Br>
*
*/
class SceneWorld
{
2025-05-22 01:42:16 +08:00
U8String WorldName; ///<世界名称
ObjectList<SceneNode> SceneNodePool; ///<场景节点池
SceneNode *root_node; ///<世界根节点
2025-05-22 01:42:16 +08:00
public:
const U8String & GetWorldName()const{return WorldName;} ///<获取世界名称
SceneNode * GetRootNode (){return root_node;} ///<获取世界根节点
public:
2024-09-06 01:04:28 +08:00
SceneWorld()
{
root_node=new SceneNode;
}
2024-09-06 01:04:28 +08:00
virtual ~SceneWorld()
{
SAFE_CLEAR(root_node);
}
};//class SceneWorld
2025-05-22 01:42:16 +08:00
bool RegistrySceneWorld(SceneWorld *sw); ///<注册场景世界
bool UnregistrySceneWorld(const U8String &world_name); ///<注销场景世界
inline bool UnregistrySceneWorld(SceneWorld *sw) ///<注销场景世界
{
if(!sw)return(false);
return UnregistrySceneWorld(sw->GetWorldName());
}
SceneWorld *GetSceneWorld(const U8String &world_name); ///<获取指定名称的场景世界
}//namespace hgl::graph