mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +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;
|
r = rotateOffset * mix + ca;
|
||||||
c = cos(r);
|
c = cos(r);
|
||||||
s = sin(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 {
|
} else {
|
||||||
c = cos(ca);
|
c = cos(ca);
|
||||||
s = sin(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;
|
remaining = this.remaining;
|
||||||
if (remaining >= step) {
|
if (remaining >= step) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user