@@ -697,12 +697,16 @@ TEST_SUITE("[Navigation]") {
697
697
CHECK_NE (navigation_server->map_get_closest_point (map, Vector3 (0 , 0 , 0 )), Vector3 (0 , 0 , 0 ));
698
698
CHECK_NE (navigation_server->map_get_closest_point_normal (map, Vector3 (0 , 0 , 0 )), Vector3 ());
699
699
CHECK (navigation_server->map_get_closest_point_owner (map, Vector3 (0 , 0 , 0 )).is_valid ());
700
- // TODO: Test map_get_closest_point_to_segment() with p_use_collision=true as well.
701
700
CHECK_NE (navigation_server->map_get_closest_point_to_segment (map, Vector3 (0 , 0 , 0 ), Vector3 (1 , 1 , 1 ), false ), Vector3 ());
701
+ CHECK_NE (navigation_server->map_get_closest_point_to_segment (map, Vector3 (0 , 0 , 0 ), Vector3 (1 , 1 , 1 ), true ), Vector3 ());
702
702
CHECK_NE (navigation_server->map_get_path (map, Vector3 (0 , 0 , 0 ), Vector3 (10 , 0 , 10 ), true ).size (), 0 );
703
703
CHECK_NE (navigation_server->map_get_path (map, Vector3 (0 , 0 , 0 ), Vector3 (10 , 0 , 10 ), false ).size (), 0 );
704
704
}
705
705
706
+ SUBCASE (" 'map_get_closest_point_to_segment' with 'use_collision' should return default if segment doesn't intersect map" ) {
707
+ CHECK_EQ (navigation_server->map_get_closest_point_to_segment (map, Vector3 (1 , 2 , 1 ), Vector3 (1 , 1 , 1 ), true ), Vector3 ());
708
+ }
709
+
706
710
SUBCASE (" Elaborate query with 'CORRIDORFUNNEL' post-processing should yield non-empty result" ) {
707
711
Ref<NavigationPathQueryParameters3D> query_parameters = memnew (NavigationPathQueryParameters3D);
708
712
query_parameters->set_map (map);
0 commit comments