Skip to content

Commit

Permalink
up epsilon for gjk
Browse files Browse the repository at this point in the history
  • Loading branch information
Vrixyz committed Dec 17, 2024
1 parent 81475f3 commit 4fe7fef
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions crates/parry2d/tests/geometry/ray_cast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,7 @@ fn convexpoly_raycast_fuzz() {
let ray_origin = Point2::new(3., 1. + (i as Real * 0.0001));
let ray_look_at = Point2::new(0., 2.);
let collision = test_raycast(ray_origin, ray_look_at);
let eps = 1.0e-5;

let eps = parry2d::query::gjk::eps_tol();
match collision {
Some(distance) if distance >= 1.0 - eps && distance < (2.0 as Real).sqrt() => (),
Some(distance) if distance >= 2.0 => panic!(
Expand Down
2 changes: 1 addition & 1 deletion src/query/gjk/gjk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ pub enum GJKResult {
/// The absolute tolerance used by the GJK algorithm.
pub fn eps_tol() -> Real {
let _eps = crate::math::DEFAULT_EPSILON;
_eps * 10.0
_eps * 10_000.0
}

/// Projects the origin on the boundary of the given shape.
Expand Down

0 comments on commit 4fe7fef

Please sign in to comment.