mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
[ts] Gravity takes yDown in consideration.
This commit is contained in:
parent
0ac67cfbee
commit
e78095e5c6
@ -158,7 +158,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 = this.gravity * f;
|
const m = this.massInverse * t, e = this.strength, w = this.wind * f, g = (Skeleton.yDown ? -this.gravity : this.gravity) * f;
|
||||||
do {
|
do {
|
||||||
if (x) {
|
if (x) {
|
||||||
this.xVelocity += (w - this.xOffset * e) * m;
|
this.xVelocity += (w - this.xOffset * e) * m;
|
||||||
@ -207,7 +207,7 @@ export class PhysicsConstraint implements Updatable {
|
|||||||
a = this.remaining;
|
a = this.remaining;
|
||||||
if (a >= t) {
|
if (a >= t) {
|
||||||
if (d == -1) d = Math.pow(this.damping, 60 * t);
|
if (d == -1) d = Math.pow(this.damping, 60 * t);
|
||||||
const m = this.massInverse * t, e = this.strength, w = this.wind, g = this.gravity, h = l / f;
|
const m = this.massInverse * t, e = this.strength, w = this.wind, g = (Skeleton.yDown ? -this.gravity : this.gravity), h = l / f;
|
||||||
while (true) {
|
while (true) {
|
||||||
a -= t;
|
a -= t;
|
||||||
if (scaleX) {
|
if (scaleX) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user