2 Commits

Author SHA1 Message Date
8c7ed92b14 WorldBoundingBox改为OBB 2025-07-27 07:42:24 +08:00
69ed5eb859 Scene::GetEventDispatcher()改为返回引用而非指针 2025-07-27 07:41:48 +08:00
6 changed files with 12 additions and 10 deletions

2
CMCore

Submodule CMCore updated: 7139219855...0ed44f0531

2
CMUtil

Submodule CMUtil updated: d67a309f94...7a72b077e8

View File

@@ -40,9 +40,9 @@ namespace hgl::graph
SAFE_CLEAR(root_node);
}
io::EventDispatcher *GetEventDispatcher() ///<获取事件分发器
io::EventDispatcher &GetEventDispatcher() ///<获取事件分发器
{
return &event_dispatcher;
return event_dispatcher;
}
};//class Scene

View File

@@ -4,6 +4,7 @@
#include<hgl/type/IDName.h>
#include<hgl/graph/SceneOrient.h>
#include<hgl/graph/AABB.h>
#include<hgl/graph/OBB.h>
#include<hgl/component/Component.h>
namespace hgl::io
@@ -45,7 +46,7 @@ namespace hgl::graph
AABB bounding_box; ///<绑定盒
AABB local_bounding_box; ///<本地坐标绑定盒
//AABB WorldBoundingBox; ///<世界坐标绑定盒
OBB world_bounding_box; ///<世界坐标绑定盒
protected:
@@ -115,8 +116,9 @@ namespace hgl::graph
{
SetParent(nullptr); //清除父节点
bounding_box.SetZero();
local_bounding_box.SetZero();
bounding_box.Clear();
local_bounding_box.Clear();
world_bounding_box.Clear();
child_nodes.Clear();
component_set.Clear();

View File

@@ -132,12 +132,12 @@ namespace hgl::graph
{
if(main_scene)
{
main_scene->GetEventDispatcher()->RemoveChildDispatcher(self_ep); //从旧的场景中移除事件分发器
main_scene->GetEventDispatcher().RemoveChildDispatcher(self_ep); //从旧的场景中移除事件分发器
}
if(new_scene)
{
new_scene->GetEventDispatcher()->AddChildDispatcher(self_ep); //添加到新的场景中
new_scene->GetEventDispatcher().AddChildDispatcher(self_ep); //添加到新的场景中
}
}