Merge pull request #82593 from smix8/navobstacle_debug_transform_4.x

Fix NavigationObstacle3D debug being affected by rotation and scale
This commit is contained in:
Rémi Verschelde 2023-10-21 15:51:02 +02:00
commit 918da63797
No known key found for this signature in database
GPG key ID: C3336907360768E1

View file

@ -148,10 +148,14 @@ void NavigationObstacle3D::_notification(int p_what) {
}
#ifdef DEBUG_ENABLED
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) {
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
}