From fd2e6f123940734ecba2924a1a49fd99a0d89c76 Mon Sep 17 00:00:00 2001 From: Robin Gruenke Date: Wed, 25 Dec 2024 17:17:00 +0100 Subject: [PATCH 1/2] make it possible to actually use overriden virtual _get_aabb in MeshInstance3D --- scene/3d/mesh_instance_3d.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scene/3d/mesh_instance_3d.cpp b/scene/3d/mesh_instance_3d.cpp index 15bd8a18b9fc..601fd3781a8d 100644 --- a/scene/3d/mesh_instance_3d.cpp +++ b/scene/3d/mesh_instance_3d.cpp @@ -218,6 +218,10 @@ NodePath MeshInstance3D::get_skeleton_path() { AABB MeshInstance3D::get_aabb() const { if (!mesh.is_null()) { return mesh->get_aabb(); + } else { + AABB ret; + GDVIRTUAL_CALL(_get_aabb, ret); + return ret; } return AABB(); From f5a1cf14caf0ce627c8dddd73bbc887541a7f8bc Mon Sep 17 00:00:00 2001 From: Robin Gruenke Date: Thu, 26 Dec 2024 14:23:45 +0100 Subject: [PATCH 2/2] Refactor control flow --- scene/3d/mesh_instance_3d.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/scene/3d/mesh_instance_3d.cpp b/scene/3d/mesh_instance_3d.cpp index 601fd3781a8d..946b172094f6 100644 --- a/scene/3d/mesh_instance_3d.cpp +++ b/scene/3d/mesh_instance_3d.cpp @@ -218,13 +218,11 @@ NodePath MeshInstance3D::get_skeleton_path() { AABB MeshInstance3D::get_aabb() const { if (!mesh.is_null()) { return mesh->get_aabb(); - } else { - AABB ret; - GDVIRTUAL_CALL(_get_aabb, ret); - return ret; } - return AABB(); + AABB aabb; + GDVIRTUAL_CALL(_get_aabb, aabb); + return aabb; } Node *MeshInstance3D::create_trimesh_collision_node() {