Skip to content

Commit

Permalink
Link to educational material and fixes on comments (#198)
Browse files Browse the repository at this point in the history
* Fix comments in point_composite_shape test

* Add a link to educational material
  • Loading branch information
wlinna committed May 17, 2024
1 parent b8b0f64 commit 5f9bfb0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/parry2d/tests/query/point_composite_shape.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ fn project_local_point_and_get_feature_projects_correctly_from_outside() {
let mesh = TriMesh::new(vertices, vec![[0, 1, 2], [3, 0, 2]]);

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

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

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

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

Expand Down
3 changes: 3 additions & 0 deletions src/query/point/point_triangle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ impl PointQueryWithLocation for Triangle {
pt: &Point<Real>,
solid: bool,
) -> (PointProjection, Self::Location) {
// To understand the ideas, consider reading the slides below
// https://box2d.org/files/ErinCatto_GJK_GDC2010.pdf

let a = self.a;
let b = self.b;
let c = self.c;
Expand Down

0 comments on commit 5f9bfb0

Please sign in to comment.