TEMP: disallow 0 time collisions

This commit is contained in:
Quaternions 2023-11-22 19:27:23 -08:00
parent 096284ea60
commit c971ab24e2

View File

@ -22,7 +22,7 @@ enum Transition<F,E:DirectedEdge,V>{
let (n,d)=mesh.face_nd(face_id); let (n,d)=mesh.face_nd(face_id);
for t in zeroes2((n.dot(body.position)-d)*2,n.dot(body.velocity)*2,n.dot(body.acceleration)){ for t in zeroes2((n.dot(body.position)-d)*2,n.dot(body.velocity)*2,n.dot(body.acceleration)){
let t=body.time+Time::from(t); let t=body.time+Time::from(t);
if time<=t&&t<best_time&&n.dot(body.extrapolated_velocity(t))<Planar64::ZERO{ if time<t&&t<best_time&&n.dot(body.extrapolated_velocity(t))<Planar64::ZERO{
best_time=t; best_time=t;
best_transtition=Transition::Hit(face_id,t); best_transtition=Transition::Hit(face_id,t);
break; break;