Skip to content

Commit 5f9bfb0

Browse files
authored
Link to educational material and fixes on comments (#198)
* Fix comments in point_composite_shape test * Add a link to educational material
1 parent b8b0f64 commit 5f9bfb0

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

crates/parry2d/tests/query/point_composite_shape.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ fn project_local_point_and_get_feature_projects_correctly_from_outside() {
3737
let mesh = TriMesh::new(vertices, vec![[0, 1, 2], [3, 0, 2]]);
3838

3939
{
40-
let query_pt = Point2::new(-1.0, 0.0); // Inside the top-right triangle (index 1)
40+
let query_pt = Point2::new(-1.0, 0.0); // Left from the bottom-left triangle (index 0)
4141

4242
let (proj, feat) = mesh.project_local_point_and_get_feature(&query_pt);
4343

@@ -52,7 +52,7 @@ fn project_local_point_and_get_feature_projects_correctly_from_outside() {
5252
assert_eq!(feat.unwrap_face(), correct_tri_idx);
5353
}
5454
{
55-
let query_pt = Point2::new(0.5, 2.0); // Inside the top-right triangle (index 1)
55+
let query_pt = Point2::new(0.5, 2.0); // Above the top-right triangle (index 1)
5656

5757
let (proj, feat) = mesh.project_local_point_and_get_feature(&query_pt);
5858

src/query/point/point_triangle.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@ impl PointQueryWithLocation for Triangle {
6060
pt: &Point<Real>,
6161
solid: bool,
6262
) -> (PointProjection, Self::Location) {
63+
// To understand the ideas, consider reading the slides below
64+
// https://box2d.org/files/ErinCatto_GJK_GDC2010.pdf
65+
6366
let a = self.a;
6467
let b = self.b;
6568
let c = self.c;

0 commit comments

Comments
 (0)