浏览代码

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

Davide Tantillo 7 月之前
父节点
当前提交
7e1de838d2
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      spine-ts/spine-core/src/PhysicsConstraint.ts

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

@@ -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, 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 {
 								if (x) {
 									this.xVelocity += (w - this.xOffset * e) * m;