diff --git a/src/Marble.hx b/src/Marble.hx index e16025dd..99a4e075 100644 --- a/src/Marble.hx +++ b/src/Marble.hx @@ -2172,6 +2172,10 @@ class Marble extends GameObject { playedSounds = []; advancePhysics(timeState, move, collisionWorld, pathedInteriors); + for (pi in pathedInteriors) { + pi.update(timeState); + } + // physicsAccumulator += timeState.dt; // while (physicsAccumulator > 0.032) { diff --git a/src/PathedInterior.hx b/src/PathedInterior.hx index 8dc68c16..c6068163 100644 --- a/src/PathedInterior.hx +++ b/src/PathedInterior.hx @@ -139,6 +139,7 @@ class PathedInterior extends InteriorObject { public function computeNextPathStep(timeDelta:Float) { stopped = false; + prevPosition = this.position.clone(); if (currentTime == targetTime) { velocity.set(0, 0, 0); this.collider.velocity.set(0, 0, 0); @@ -177,6 +178,7 @@ class PathedInterior extends InteriorObject { return; if (this.velocity.length() == 0) return; + velocity.w = 0; var newp = position.add(velocity.multiply(timeDelta)); var tform = this.getAbsPos().clone(); tform.setPosition(newp); diff --git a/src/collision/CollisionEntity.hx b/src/collision/CollisionEntity.hx index 3ff96ab4..ac2f277a 100644 --- a/src/collision/CollisionEntity.hx +++ b/src/collision/CollisionEntity.hx @@ -96,26 +96,26 @@ class CollisionEntity implements IOctreeObject implements IBVHObject { if (this.transform.equal(transform)) return; // Speedup - if (this.fastTransform && Util.mat3x3equal(this.transform, transform)) { - var oldPos = this.transform.getPosition(); - var newPos = transform.getPosition(); - this.transform.setPosition(newPos); - this.invTransform = this.transform.getInverse(); - if (this.boundingBox == null) - generateBoundingBox(); - else { - this.boundingBox.xMin += newPos.x - oldPos.x; - this.boundingBox.xMax += newPos.x - oldPos.x; - this.boundingBox.yMin += newPos.y - oldPos.y; - this.boundingBox.yMax += newPos.y - oldPos.y; - this.boundingBox.zMin += newPos.z - oldPos.z; - this.boundingBox.zMax += newPos.z - oldPos.z; - } - } else { - this.transform.load(transform); - this.invTransform = transform.getInverse(); - generateBoundingBox(); - } + // if (this.fastTransform && Util.mat3x3equal(this.transform, transform)) { + // var oldPos = this.transform.getPosition(); + // var newPos = transform.getPosition(); + // this.transform.setPosition(newPos); + // this.invTransform = this.transform.getInverse(); + // if (this.boundingBox == null) + // generateBoundingBox(); + // else { + // this.boundingBox.xMin += newPos.x - oldPos.x; + // this.boundingBox.xMax += newPos.x - oldPos.x; + // this.boundingBox.yMin += newPos.y - oldPos.y; + // this.boundingBox.yMax += newPos.y - oldPos.y; + // this.boundingBox.zMin += newPos.z - oldPos.z; + // this.boundingBox.zMax += newPos.z - oldPos.z; + // } + // } else { + this.transform.load(transform); + this.invTransform = transform.getInverse(); + generateBoundingBox(); + // } _transformKey++; } diff --git a/src/rewind/RewindFrame.hx b/src/rewind/RewindFrame.hx index a120c5f9..d2ad48ae 100644 --- a/src/rewind/RewindFrame.hx +++ b/src/rewind/RewindFrame.hx @@ -326,6 +326,7 @@ class RewindFrame { currentUp.z = br.readDouble(); lastContactNormal.x = br.readDouble(); lastContactNormal.y = br.readDouble(); + lastContactNormal.z = br.readDouble(); mpStates = []; var mpStates_len = br.readInt16(); for (i in 0...mpStates_len) {