From dd0ac7cc7ea0034297be10ceff115b4d98d3c419 Mon Sep 17 00:00:00 2001 From: Quaternions <krakow20@gmail.com> Date: Tue, 10 Oct 2023 16:05:47 -0700 Subject: [PATCH] overshadowed value by mistake --- src/physics.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/physics.rs b/src/physics.rs index 77ce97e7..0e3ff535 100644 --- a/src/physics.rs +++ b/src/physics.rs @@ -913,7 +913,7 @@ impl PhysicsState { fn predict_collision_start(&self,time:TIME,time_limit:TIME,model_id:u32) -> Option<TimedInstruction<PhysicsInstruction>> { let mesh0=self.mesh(); let mesh1=self.models.get(model_id as usize).unwrap().mesh(); - let (p,v,a,time)=(self.body.position,self.body.velocity,self.body.acceleration,self.body.time); + let (p,v,a,body_time)=(self.body.position,self.body.velocity,self.body.acceleration,self.body.time); //find best t let mut best_time=time_limit; let mut best_face:Option<TreyMeshFace>=None; @@ -922,7 +922,7 @@ impl PhysicsState { //must collide now or in the future //must beat the current soonest collision time //must be moving towards surface - let t_time=time+((t as f64)*1_000_000_000f64) as TIME; + let t_time=body_time+((t as f64)*1_000_000_000f64) as TIME; if time<=t_time&&t_time<best_time&&0f32<v.x+a.x*t{ let dp=self.body.extrapolated_position(t_time)-p; //faces must be overlapping @@ -938,7 +938,7 @@ impl PhysicsState { //must collide now or in the future //must beat the current soonest collision time //must be moving towards surface - let t_time=time+((t as f64)*1_000_000_000f64) as TIME; + let t_time=body_time+((t as f64)*1_000_000_000f64) as TIME; if time<=t_time&&t_time<best_time&&v.x+a.x*t<0f32{ let dp=self.body.extrapolated_position(t_time)-p; //faces must be overlapping @@ -955,7 +955,7 @@ impl PhysicsState { //must collide now or in the future //must beat the current soonest collision time //must be moving towards surface - let t_time=time+((t as f64)*1_000_000_000f64) as TIME; + let t_time=body_time+((t as f64)*1_000_000_000f64) as TIME; if time<=t_time&&t_time<best_time&&0f32<v.y+a.y*t{ let dp=self.body.extrapolated_position(t_time)-p; //faces must be overlapping @@ -971,7 +971,7 @@ impl PhysicsState { //must collide now or in the future //must beat the current soonest collision time //must be moving towards surface - let t_time=time+((t as f64)*1_000_000_000f64) as TIME; + let t_time=body_time+((t as f64)*1_000_000_000f64) as TIME; if time<=t_time&&t_time<best_time&&v.y+a.y*t<0f32{ let dp=self.body.extrapolated_position(t_time)-p; //faces must be overlapping @@ -988,7 +988,7 @@ impl PhysicsState { //must collide now or in the future //must beat the current soonest collision time //must be moving towards surface - let t_time=time+((t as f64)*1_000_000_000f64) as TIME; + let t_time=body_time+((t as f64)*1_000_000_000f64) as TIME; if time<=t_time&&t_time<best_time&&0f32<v.z+a.z*t{ let dp=self.body.extrapolated_position(t_time)-p; //faces must be overlapping @@ -1004,7 +1004,7 @@ impl PhysicsState { //must collide now or in the future //must beat the current soonest collision time //must be moving towards surface - let t_time=time+((t as f64)*1_000_000_000f64) as TIME; + let t_time=body_time+((t as f64)*1_000_000_000f64) as TIME; if time<=t_time&&t_time<best_time&&v.z+a.z*t<0f32{ let dp=self.body.extrapolated_position(t_time)-p; //faces must be overlapping