11use na:: Point2 ;
2- use parry2d:: { query:: PointQuery , shape:: TriMesh } ;
2+ use parry2d:: {
3+ query:: { gjk:: GjkOptions , PointQuery } ,
4+ shape:: TriMesh ,
5+ } ;
36
47#[ test]
58fn project_local_point_and_get_feature_gets_the_enclosing_triangle ( ) {
@@ -11,14 +14,15 @@ fn project_local_point_and_get_feature_gets_the_enclosing_triangle() {
1114 ] ;
1215
1316 let mesh = TriMesh :: new ( vertices, vec ! [ [ 0 , 1 , 2 ] , [ 3 , 0 , 2 ] ] ) . unwrap ( ) ;
17+ let options = & ( ) ;
1418 let query_pt = Point2 :: new ( 0.6 , 0.6 ) ; // Inside the top-right triangle (index 1)
1519
16- let ( proj, feat) = mesh. project_local_point_and_get_feature ( & query_pt) ;
20+ let ( proj, feat) = mesh. project_local_point_and_get_feature ( & query_pt, options ) ;
1721
1822 let correct_tri_idx = 1 ;
1923 let correct_tri = mesh. triangle ( correct_tri_idx) ;
2024
21- let is_inside_correct = correct_tri. contains_local_point ( & query_pt) ;
25+ let is_inside_correct = correct_tri. contains_local_point ( & query_pt, options ) ;
2226
2327 assert ! ( is_inside_correct) ;
2428 assert_eq ! ( proj. is_inside, is_inside_correct) ;
@@ -35,16 +39,16 @@ fn project_local_point_and_get_feature_projects_correctly_from_outside() {
3539 ] ;
3640
3741 let mesh = TriMesh :: new ( vertices, vec ! [ [ 0 , 1 , 2 ] , [ 3 , 0 , 2 ] ] ) . unwrap ( ) ;
38-
42+ let options = & ( ) ;
3943 {
4044 let query_pt = Point2 :: new ( -1.0 , 0.0 ) ; // Left from the bottom-left triangle (index 0)
4145
42- let ( proj, feat) = mesh. project_local_point_and_get_feature ( & query_pt) ;
46+ let ( proj, feat) = mesh. project_local_point_and_get_feature ( & query_pt, options ) ;
4347
4448 let correct_tri_idx = 0 ;
4549 let correct_tri = mesh. triangle ( correct_tri_idx) ;
4650
47- let is_inside_correct = correct_tri. contains_local_point ( & query_pt) ;
51+ let is_inside_correct = correct_tri. contains_local_point ( & query_pt, options ) ;
4852
4953 assert_eq ! ( is_inside_correct, false ) ;
5054 assert_eq ! ( proj. is_inside, is_inside_correct) ;
@@ -54,12 +58,12 @@ fn project_local_point_and_get_feature_projects_correctly_from_outside() {
5458 {
5559 let query_pt = Point2 :: new ( 0.5 , 2.0 ) ; // Above the top-right triangle (index 1)
5660
57- let ( proj, feat) = mesh. project_local_point_and_get_feature ( & query_pt) ;
61+ let ( proj, feat) = mesh. project_local_point_and_get_feature ( & query_pt, options ) ;
5862
5963 let correct_tri_idx = 1 ;
6064 let correct_tri = mesh. triangle ( correct_tri_idx) ;
6165
62- let is_inside_correct = correct_tri. contains_local_point ( & query_pt) ;
66+ let is_inside_correct = correct_tri. contains_local_point ( & query_pt, options ) ;
6367
6468 assert_eq ! ( is_inside_correct, false ) ;
6569 assert_eq ! ( proj. is_inside, is_inside_correct) ;
0 commit comments