edit comments
This commit is contained in:
18
src/body.rs
18
src/body.rs
@ -526,8 +526,7 @@ impl PhysicsState {
|
|||||||
let (p,v,a)=(self.body.position,self.body.velocity,self.body.acceleration);
|
let (p,v,a)=(self.body.position,self.body.velocity,self.body.acceleration);
|
||||||
//collect x
|
//collect x
|
||||||
for t in zeroes2(mesh0.max.x-mesh1.min.x,v.x,a.x) {
|
for t in zeroes2(mesh0.max.x-mesh1.min.x,v.x,a.x) {
|
||||||
//negative t = back in time
|
//must collide now or in the future
|
||||||
//must be moving towards surface to collide
|
|
||||||
//must beat the current soonest collision time
|
//must beat the current soonest collision time
|
||||||
//must be moving towards surface
|
//must be moving towards surface
|
||||||
let t_time=self.body.time+((t as f64)*1_000_000_000f64) as TIME;
|
let t_time=self.body.time+((t as f64)*1_000_000_000f64) as TIME;
|
||||||
@ -542,8 +541,7 @@ impl PhysicsState {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
for t in zeroes2(mesh0.min.x-mesh1.max.x,v.x,a.x) {
|
for t in zeroes2(mesh0.min.x-mesh1.max.x,v.x,a.x) {
|
||||||
//negative t = back in time
|
//must collide now or in the future
|
||||||
//must be moving towards surface to collide
|
|
||||||
//must beat the current soonest collision time
|
//must beat the current soonest collision time
|
||||||
//must be moving towards surface
|
//must be moving towards surface
|
||||||
let t_time=self.body.time+((t as f64)*1_000_000_000f64) as TIME;
|
let t_time=self.body.time+((t as f64)*1_000_000_000f64) as TIME;
|
||||||
@ -559,8 +557,7 @@ impl PhysicsState {
|
|||||||
}
|
}
|
||||||
//collect y
|
//collect y
|
||||||
for t in zeroes2(mesh0.max.y-mesh1.min.y,v.y,a.y) {
|
for t in zeroes2(mesh0.max.y-mesh1.min.y,v.y,a.y) {
|
||||||
//negative t = back in time
|
//must collide now or in the future
|
||||||
//must be moving towards surface to collide
|
|
||||||
//must beat the current soonest collision time
|
//must beat the current soonest collision time
|
||||||
//must be moving towards surface
|
//must be moving towards surface
|
||||||
let t_time=self.body.time+((t as f64)*1_000_000_000f64) as TIME;
|
let t_time=self.body.time+((t as f64)*1_000_000_000f64) as TIME;
|
||||||
@ -575,8 +572,7 @@ impl PhysicsState {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
for t in zeroes2(mesh0.min.y-mesh1.max.y,v.y,a.y) {
|
for t in zeroes2(mesh0.min.y-mesh1.max.y,v.y,a.y) {
|
||||||
//negative t = back in time
|
//must collide now or in the future
|
||||||
//must be moving towards surface to collide
|
|
||||||
//must beat the current soonest collision time
|
//must beat the current soonest collision time
|
||||||
//must be moving towards surface
|
//must be moving towards surface
|
||||||
let t_time=self.body.time+((t as f64)*1_000_000_000f64) as TIME;
|
let t_time=self.body.time+((t as f64)*1_000_000_000f64) as TIME;
|
||||||
@ -592,8 +588,7 @@ impl PhysicsState {
|
|||||||
}
|
}
|
||||||
//collect z
|
//collect z
|
||||||
for t in zeroes2(mesh0.max.z-mesh1.min.z,v.z,a.z) {
|
for t in zeroes2(mesh0.max.z-mesh1.min.z,v.z,a.z) {
|
||||||
//negative t = back in time
|
//must collide now or in the future
|
||||||
//must be moving towards surface to collide
|
|
||||||
//must beat the current soonest collision time
|
//must beat the current soonest collision time
|
||||||
//must be moving towards surface
|
//must be moving towards surface
|
||||||
let t_time=self.body.time+((t as f64)*1_000_000_000f64) as TIME;
|
let t_time=self.body.time+((t as f64)*1_000_000_000f64) as TIME;
|
||||||
@ -608,8 +603,7 @@ impl PhysicsState {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
for t in zeroes2(mesh0.min.z-mesh1.max.z,v.z,a.z) {
|
for t in zeroes2(mesh0.min.z-mesh1.max.z,v.z,a.z) {
|
||||||
//negative t = back in time
|
//must collide now or in the future
|
||||||
//must be moving towards surface to collide
|
|
||||||
//must beat the current soonest collision time
|
//must beat the current soonest collision time
|
||||||
//must be moving towards surface
|
//must be moving towards surface
|
||||||
let t_time=self.body.time+((t as f64)*1_000_000_000f64) as TIME;
|
let t_time=self.body.time+((t as f64)*1_000_000_000f64) as TIME;
|
||||||
|
Reference in New Issue
Block a user