Remove workaround

This commit is contained in:
Hanno Braun 2022-02-19 11:33:23 +01:00
parent 3482a180e7
commit 8eab780835

View File

@ -1,6 +1,5 @@
use std::collections::BTreeSet; use std::collections::BTreeSet;
use decorum::R64;
use parry2d_f64::query::{Ray as Ray2, RayCast as _}; use parry2d_f64::query::{Ray as Ray2, RayCast as _};
use parry3d_f64::query::Ray as Ray3; use parry3d_f64::query::Ray as Ray3;
@ -193,11 +192,10 @@ impl Face {
let edge = let edge =
Segment::from(edge.map(|point| point.value)); Segment::from(edge.map(|point| point.value));
let intersection = edge.to_parry().cast_local_ray( let intersection = edge
&ray, .to_parry()
f64::INFINITY, .cast_local_ray(&ray, f64::INFINITY, true)
true, .map(|t| Scalar::from_f64(t));
);
if let Some(t) = intersection { if let Some(t) = intersection {
// Due to slight inaccuracies, we might get // Due to slight inaccuracies, we might get
@ -206,9 +204,8 @@ impl Face {
let eps = 1_000_000.0; let eps = 1_000_000.0;
let t = (t * eps).round() / eps; let t = (t * eps).round() / eps;
let t_r64: R64 = t.into(); if hits.insert(t) {
if hits.insert(t_r64) { check.hits.push(t.into_f64());
check.hits.push(t);
} }
} }
} }