Fix NavigationObstacle3D debug being affected by rotation and scale

Fixes NavigationObstacle3D debug being affected by rotation and scale.
This commit is contained in:
smix8 2023-09-30 22:35:38 +02:00
parent 44e399ed5f
commit cbb9d21fd0

View file

@ -148,10 +148,14 @@ void NavigationObstacle3D::_notification(int p_what) {
} }
#ifdef DEBUG_ENABLED #ifdef DEBUG_ENABLED
if (fake_agent_radius_debug_instance.is_valid() && radius > 0.0) { if (fake_agent_radius_debug_instance.is_valid() && radius > 0.0) {
RS::get_singleton()->instance_set_transform(fake_agent_radius_debug_instance, get_global_transform()); Transform3D debug_transform;
debug_transform.origin = get_global_position();
RS::get_singleton()->instance_set_transform(fake_agent_radius_debug_instance, debug_transform);
} }
if (static_obstacle_debug_instance.is_valid() && get_vertices().size() > 0) { if (static_obstacle_debug_instance.is_valid() && get_vertices().size() > 0) {
RS::get_singleton()->instance_set_transform(static_obstacle_debug_instance, get_global_transform()); Transform3D debug_transform;
debug_transform.origin = get_global_position();
RS::get_singleton()->instance_set_transform(static_obstacle_debug_instance, debug_transform);
} }
#endif // DEBUG_ENABLED #endif // DEBUG_ENABLED
} }