diff --git a/src/body.rs b/src/body.rs index db6ef5d..bebe3d4 100644 --- a/src/body.rs +++ b/src/body.rs @@ -367,7 +367,7 @@ impl PhysicsState { //RelativeCollsion must reference the full model instead of a particular face //this is Ctrl+C Ctrl+V of predict_collision_start but with v=-v before the calc and t=-t after the calc //find best t - let mut best_time=time_limit; + let mut best_delta_time=time_limit-self.body.time; let mut best_face:Option=None; let mesh0=self.mesh(); let mesh1=model.mesh(); @@ -379,12 +379,12 @@ impl PhysicsState { //must beat the current soonest collision time //must be moving towards surface let t_time=((-t as f64)*1_000_000_000f64) as TIME; - if 0<=t_time&&t_time Option> { //find best t - let mut best_time=time_limit; + let mut best_delta_time=time_limit-self.body.time; let mut best_face:Option=None; let mesh0=self.mesh(); let mesh1=model.mesh(); @@ -497,12 +497,12 @@ impl PhysicsState { //must beat the current soonest collision time //must be moving towards surface let t_time=((t as f64)*1_000_000_000f64) as TIME; - if 0<=t_time&&t_time