fix algorithm

This commit is contained in:
Quaternions 2024-08-22 13:58:05 -07:00
parent 2c77a36083
commit e47b1ff6f9

View File

@ -292,7 +292,10 @@ fn get_first_touch<'a>(contacts:&'a Vec<Contact>,ray:&Ray,conts:&Conts)->Option<
pub fn push_solve(contacts:&Vec<Contact>,point:Planar64Vec3)->Option<Planar64Vec3>{ pub fn push_solve(contacts:&Vec<Contact>,point:Planar64Vec3)->Option<Planar64Vec3>{
let (mut ray,mut conts)=get_best_push_ray_and_conts_0(point)?; let (mut ray,mut conts)=get_best_push_ray_and_conts_0(point)?;
loop{ loop{
let (next_t,next_cont)=get_first_touch(contacts,&ray,&conts)?; let (next_t,next_cont)=match get_first_touch(contacts,&ray,&conts){
Some((t,conts))=>(t,conts),
None=>return Some(ray.origin),
};
if Planar64::ZERO<=next_t{ if Planar64::ZERO<=next_t{
return Some(ray.origin); return Some(ray.origin);