[ts] Fixed yDown branch of previous commit 89441ca leading to upward gravity. See #2729.

This commit is contained in:
Davide Tantillo 2025-02-06 09:36:50 +01:00
parent 095a5d43e4
commit 2d6c5381e9

View File

@ -163,7 +163,7 @@ export class PhysicsConstraint implements Updatable {
}
if (a >= t) {
d = Math.pow(this.damping, 60 * t);
const m = this.massInverse * t, e = this.strength, w = this.wind * f * skeleton.scaleX, g = (Skeleton.yDown ? -this.gravity : this.gravity) * f * skeleton.scaleY;
const m = this.massInverse * t, e = this.strength, w = this.wind * f * skeleton.scaleX, g = this.gravity * f * skeleton.scaleY;
do {
if (x) {
this.xVelocity += (w - this.xOffset * e) * m;