[ts] Used yDir rather than ternary operator with yDown.

This commit is contained in:
Davide Tantillo 2025-06-20 09:16:40 +02:00
parent 13e2231628
commit 09b12f8934
2 changed files with 2 additions and 2 deletions

View File

@ -215,7 +215,7 @@ export class PhysicsConstraint extends Constraint<PhysicsConstraint, PhysicsCons
d = Math.pow(p.damping, 60 * t);
m = t * p.massInverse;
e = p.strength;
const w = f * p.wind, g = f * (Skeleton.yDown ? -p.gravity : p.gravity);
const w = f * p.wind, g = f * p.gravity * Skeleton.yDir;
ax = (w * skeleton.windX + g * skeleton.gravityX) * skeleton.scaleX;
ay = (w * skeleton.windY + g * skeleton.gravityY) * skeleton.scaleY;
}

View File

@ -93,7 +93,7 @@ export class Skeleton {
*
* Bones that do not inherit scale are still affected by this property. */
public get scaleY () {
return Skeleton.yDown ? -this._scaleY : this._scaleY;
return this._scaleY * Skeleton.yDir;
}
public set scaleY (scaleY: number) {