Skip to content

Commit 7e1de83

Browse files
committed
[ts] Apply skeleton.scaleX/scaleY to wind and gravity. See #2729.
1 parent 9f3431e commit 7e1de83

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

spine-ts/spine-core/src/PhysicsConstraint.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ export class PhysicsConstraint implements Updatable {
163163
}
164164
if (a >= t) {
165165
d = Math.pow(this.damping, 60 * t);
166-
const m = this.massInverse * t, e = this.strength, w = this.wind * f, g = (Skeleton.yDown ? -this.gravity : this.gravity) * f;
166+
const m = this.massInverse * t, e = this.strength, w = this.wind * f * skeleton.scaleX, g = (Skeleton.yDown ? -this.gravity : this.gravity) * f * skeleton.scaleY;
167167
do {
168168
if (x) {
169169
this.xVelocity += (w - this.xOffset * e) * m;

0 commit comments

Comments
 (0)