Skip to content

Commit

Permalink
Make use of NavigationObstacle3D's transform
Browse files Browse the repository at this point in the history
  • Loading branch information
tracefree committed Sep 8, 2024
1 parent 5675c76 commit e413357
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion modules/navigation/3d/nav_mesh_generator_3d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,7 @@ void NavMeshGenerator3D::generator_parse_navigationobstacle_node(const Ref<Navig
return;
}

const Transform3D node_xform = p_source_geometry_data->root_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();

Expand Down
4 changes: 1 addition & 3 deletions scene/3d/navigation_obstacle_3d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit e413357

Please sign in to comment.