From e4133574fd8b6a6dcafe76c23820834aa957a437 Mon Sep 17 00:00:00 2001 From: Rie Date: Sun, 8 Sep 2024 21:55:15 +0200 Subject: [PATCH] Make use of NavigationObstacle3D's transform --- modules/navigation/3d/nav_mesh_generator_3d.cpp | 2 +- scene/3d/navigation_obstacle_3d.cpp | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/modules/navigation/3d/nav_mesh_generator_3d.cpp b/modules/navigation/3d/nav_mesh_generator_3d.cpp index e92a9d304b0a..9288e01192ec 100644 --- a/modules/navigation/3d/nav_mesh_generator_3d.cpp +++ b/modules/navigation/3d/nav_mesh_generator_3d.cpp @@ -595,7 +595,7 @@ void NavMeshGenerator3D::generator_parse_navigationobstacle_node(const Refroot_node_transform * Transform3D(Basis(), obstacle->get_global_position()); + const Transform3D node_xform = p_source_geometry_data->root_node_transform * obstacle->get_global_transform(); const float obstacle_radius = obstacle->get_radius(); diff --git a/scene/3d/navigation_obstacle_3d.cpp b/scene/3d/navigation_obstacle_3d.cpp index f2ac8f789c9c..f70578027c29 100644 --- a/scene/3d/navigation_obstacle_3d.cpp +++ b/scene/3d/navigation_obstacle_3d.cpp @@ -173,9 +173,7 @@ void NavigationObstacle3D::_notification(int p_what) { RS::get_singleton()->instance_set_transform(fake_agent_radius_debug_instance, debug_transform); } if (static_obstacle_debug_instance.is_valid() && get_vertices().size() > 0) { - Transform3D debug_transform; - debug_transform.origin = get_global_position(); - RS::get_singleton()->instance_set_transform(static_obstacle_debug_instance, debug_transform); + RS::get_singleton()->instance_set_transform(static_obstacle_debug_instance, get_global_transform()); } #endif // DEBUG_ENABLED }