mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-13 18:48:44 +08:00
[libgdx] Fixed physics scaleX when the bone world scale is 0.
This commit is contained in:
parent
4b7f5b0a96
commit
a4efb66d74
@ -172,11 +172,15 @@ public class PhysicsConstraint implements Updatable {
|
||||
r = rotateOffset * mix + ca;
|
||||
c = cos(r);
|
||||
s = sin(r);
|
||||
if (scaleX) scaleOffset += (dx * c + dy * s) * i / (l * bone.getWorldScaleX());
|
||||
if (scaleX) {
|
||||
r = l * bone.getWorldScaleX();
|
||||
if (r > 0) scaleOffset += (dx * c + dy * s) * i / r;
|
||||
}
|
||||
} else {
|
||||
c = cos(ca);
|
||||
s = sin(ca);
|
||||
scaleOffset += ((cx - bone.worldX) * c + (cy - bone.worldY) * s) * i / (l * bone.getWorldScaleX());
|
||||
float r = l * bone.getWorldScaleX();
|
||||
if (r > 0) scaleOffset += ((cx - bone.worldX) * c + (cy - bone.worldY) * s) * i / r;
|
||||
}
|
||||
remaining = this.remaining;
|
||||
if (remaining >= step) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user