ncollide icon indicating copy to clipboard operation
ncollide copied to clipboard

is_point_in_triangle is broken

Open EmbersArc opened this issue 5 years ago • 0 comments

This returns true, even though (0., 0.) is not inside the triangle:

is_point_in_triangle(
        &Point2d::new(0., 0.),
        &Point2d::new(1., 0.),
        &Point2d::new(0., 1.),
        &Point2d::new(1., 1.),
);

This seems to be independent of the triangle vertex order.

Same issue for the 3D case, this returns true:

is_point_in_triangle(
        &Point3d::new(0., 0., 0.),
        &Point3d::new(1., 0., 0.),
        &Point3d::new(0., 1., 0.),
        &Point3d::new(1., 1., 0.),
);

EmbersArc avatar Nov 10 '20 16:11 EmbersArc