[ts] Apply skeleton.scaleX/scaleY to wind and gravity. See #2729.

This commit is contained in:
Davide Tantillo 2025-01-24 11:34:48 +01:00
parent 9f3431e7a0
commit 7e1de838d2

View File

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