mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
[libgdx] Fixed physics when there is no translation.
This commit is contained in:
parent
2a52efd437
commit
82ad1691c3
@ -157,8 +157,7 @@ public class PhysicsConstraint extends Constraint<PhysicsConstraint, PhysicsCons
|
|||||||
z = Math.max(0, 1 - a / t);
|
z = Math.max(0, 1 - a / t);
|
||||||
if (x) bone.worldX += (xOffset - xLag * z) * mix * data.x;
|
if (x) bone.worldX += (xOffset - xLag * z) * mix * data.x;
|
||||||
if (y) bone.worldY += (yOffset - yLag * z) * mix * data.y;
|
if (y) bone.worldY += (yOffset - yLag * z) * mix * data.y;
|
||||||
} else
|
}
|
||||||
z = Math.max(0, 1 - a / t);
|
|
||||||
if (rotateOrShearX || scaleX) {
|
if (rotateOrShearX || scaleX) {
|
||||||
float ca = atan2(bone.c, bone.a), c, s, mr = 0, dx = cx - bone.worldX, dy = cy - bone.worldY;
|
float ca = atan2(bone.c, bone.a), c, s, mr = 0, dx = cx - bone.worldX, dy = cy - bone.worldY;
|
||||||
if (dx > qx)
|
if (dx > qx)
|
||||||
@ -212,6 +211,7 @@ public class PhysicsConstraint extends Constraint<PhysicsConstraint, PhysicsCons
|
|||||||
rotateLag = rotateOffset - rs;
|
rotateLag = rotateOffset - rs;
|
||||||
scaleLag = scaleOffset - ss;
|
scaleLag = scaleOffset - ss;
|
||||||
}
|
}
|
||||||
|
z = Math.max(0, 1 - a / t);
|
||||||
}
|
}
|
||||||
remaining = a;
|
remaining = a;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user