From 35058436a73523fd3195deab192eaace6b117a6a Mon Sep 17 00:00:00 2001 From: Quaternions Date: Mon, 18 Sep 2023 14:56:52 -0700 Subject: [PATCH] whoopsie time deltas --- src/body.rs | 80 ++++++++++++++++++++++++++--------------------------- 1 file changed, 40 insertions(+), 40 deletions(-) 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