mirror of
https://github.com/RandomityGuy/MBHaxe.git
synced 2025-12-25 17:32:35 +00:00
fix mps
This commit is contained in:
parent
5a8eab9aff
commit
c830d417f1
4 changed files with 27 additions and 20 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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++;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue