fast fail fn

This commit is contained in:
2025-11-24 14:33:57 -08:00
parent 0048306236
commit d93e558678

View File

@@ -474,7 +474,7 @@ pub fn contains_point(mesh:&MinkowskiMesh,point:Planar64Vec3)->bool{
true
},
// fast_fail value
false
||false
)
}
pub fn closest_fev(mesh:&MinkowskiMesh,point:Planar64Vec3)->Topology{
@@ -489,7 +489,7 @@ pub fn closest_fev(mesh:&MinkowskiMesh,point:Planar64Vec3)->Topology{
Topology{simplex}
},
// fast_fail value is irrelevant and will never be returned!
Topology{simplex:Simplex::new_const()}
||unreachable!()
)
}
@@ -503,7 +503,7 @@ fn minimum_difference<const ENABLE_FAST_FAIL:bool,T>(
rel_pos:Planar64Vec3,
on_exact:impl Fn(Simplex)->T,
on_intersecting:impl Fn(Simplex)->T,
on_fast_fail:T,
on_fast_fail:impl FnOnce()->T,
)->T{
// local initialAxis = queryQ() - queryP()
// local new_point_p = queryP(initialAxis)
@@ -530,7 +530,7 @@ fn minimum_difference<const ENABLE_FAST_FAIL:bool,T>(
// if -direction:Dot(next_point) > (exitRadius + radiusP + radiusQ)*direction.magnitude then
if ENABLE_FAST_FAIL&&direction.dot(mesh.vert(next_point)+rel_pos).is_negative(){
return on_fast_fail;
return on_fast_fail();
}
// push_front