minor fixes

This commit is contained in:
RandomityGuy 2023-05-14 14:03:01 +05:30
parent 3e5d53161b
commit f08bfaf7d7
3 changed files with 10 additions and 7 deletions

View file

@ -696,14 +696,14 @@ class Marble extends GameObject {
done = true;
for (contact in contacts) {
contact.velocity = new Vector();
contact.velocity.set(0, 0, 0);
}
for (interior in pi) {
interior.setStopped();
}
}
} while (!done);
} while (!done && itersIn < 1e4); // Maximum limit pls
// if (this.velocity.lengthSq() < 625) {
var gotOne = false;
var dir = new Vector(0, 0, 0);
@ -1710,6 +1710,9 @@ class Marble extends GameObject {
contactTime += timeStep;
timeRemaining -= timeStep;
if (tdiff == 0 || it > 10)
break;
} while (true);
this.queuedContacts = [];

View file

@ -171,7 +171,7 @@ class PathedInterior extends InteriorObject {
// if (!stopped)
// this.currentTime = timeState.currentAttemptTime;
velocity = position.sub(this.prevPosition).multiply(1 / timeState.dt);
velocity.set((position.x - prevPosition.x) / timeState.dt, (position.y - prevPosition.y) / timeState.dt, (position.z - prevPosition.z) / timeState.dt);
this.updatePosition();
}
@ -187,7 +187,7 @@ class PathedInterior extends InteriorObject {
var transform = this.getTransformAtTime(this.getInternalTime(thisTime));
var position = transform.getPosition();
velocity = position.sub(this.currentPosition).multiply(1 / dt);
velocity.set((position.x - currentPosition.x) / dt, (position.y - currentPosition.y) / dt, (position.z - currentPosition.z) / dt);
this.collider.velocity = velocity;
}
@ -198,7 +198,7 @@ class PathedInterior extends InteriorObject {
changeTime: changeTime,
prevPosition: prevPosition,
currentPosition: currentPosition,
velocity: velocity
velocity: velocity.clone()
};
}
@ -208,7 +208,7 @@ class PathedInterior extends InteriorObject {
this.changeTime = this.previousState.changeTime;
this.prevPosition = this.previousState.prevPosition;
this.currentPosition = this.previousState.currentPosition;
this.velocity = this.previousState.velocity;
this.velocity = this.previousState.velocity.clone();
this.collider.velocity = this.velocity;
// this.updatePosition();
}

View file

@ -888,7 +888,7 @@ class PlayMissionGui extends GuiImage {
}
pmPreview.addChild(pmEgg);
pmEgg.render(MarbleGame.canvas.scene2d);
pmEgg.render(MarbleGame.canvas.scene2d, @:privateAccess pmPreview._flow);
}
// if (currentCategory != "custom"