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

View file

@ -171,7 +171,7 @@ class PathedInterior extends InteriorObject {
// if (!stopped) // if (!stopped)
// this.currentTime = timeState.currentAttemptTime; // 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(); this.updatePosition();
} }
@ -187,7 +187,7 @@ class PathedInterior extends InteriorObject {
var transform = this.getTransformAtTime(this.getInternalTime(thisTime)); var transform = this.getTransformAtTime(this.getInternalTime(thisTime));
var position = transform.getPosition(); 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; this.collider.velocity = velocity;
} }
@ -198,7 +198,7 @@ class PathedInterior extends InteriorObject {
changeTime: changeTime, changeTime: changeTime,
prevPosition: prevPosition, prevPosition: prevPosition,
currentPosition: currentPosition, currentPosition: currentPosition,
velocity: velocity velocity: velocity.clone()
}; };
} }
@ -208,7 +208,7 @@ class PathedInterior extends InteriorObject {
this.changeTime = this.previousState.changeTime; this.changeTime = this.previousState.changeTime;
this.prevPosition = this.previousState.prevPosition; this.prevPosition = this.previousState.prevPosition;
this.currentPosition = this.previousState.currentPosition; this.currentPosition = this.previousState.currentPosition;
this.velocity = this.previousState.velocity; this.velocity = this.previousState.velocity.clone();
this.collider.velocity = this.velocity; this.collider.velocity = this.velocity;
// this.updatePosition(); // this.updatePosition();
} }

View file

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