mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-19 00:06:42 +08:00
[ts] Used yDir rather than ternary operator with yDown.
This commit is contained in:
parent
13e2231628
commit
09b12f8934
@ -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;
|
||||
}
|
||||
|
||||
@ -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) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user