[ts] Port: Scale physics constraint limits with skeleton scale. See #2576.

This commit is contained in:
Davide Tantillo 2024-07-12 10:18:03 +02:00
parent 884af914a2
commit 520c0750f5

View File

@ -148,8 +148,8 @@ export class PhysicsConstraint implements Updatable {
this.uy = by; this.uy = by;
} else { } else {
let a = this.remaining, i = this.inertia, t = this.data.step, f = this.skeleton.data.referenceScale, d = -1; let a = this.remaining, i = this.inertia, t = this.data.step, f = this.skeleton.data.referenceScale, d = -1;
let qx = this.data.limit * delta, qy = qx * skeleton.scaleY; let qx = this.data.limit * delta, qy = qx * Math.abs(skeleton.scaleY);
qx *= skeleton.scaleX; qx *= Math.abs(skeleton.scaleX);
if (x || y) { if (x || y) {
if (x) { if (x) {
const u = (this.ux - bx) * i; const u = (this.ux - bx) * i;