mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
[libgdx] Take skeleton scale into account when applying translation only IK constraint, see #2412
This commit is contained in:
parent
ab92e26ca8
commit
c11afb283d
@ -182,8 +182,8 @@ public class IkConstraint implements Updatable {
|
|||||||
float rotationIK = -bone.ashearX - bone.arotation, tx, ty;
|
float rotationIK = -bone.ashearX - bone.arotation, tx, ty;
|
||||||
switch (bone.data.transformMode) {
|
switch (bone.data.transformMode) {
|
||||||
case onlyTranslation:
|
case onlyTranslation:
|
||||||
tx = targetX - bone.worldX;
|
tx = (targetX - bone.worldX) * Math.signum(bone.skeleton.scaleX);
|
||||||
ty = targetY - bone.worldY;
|
ty = (targetY - bone.worldY) * Math.signum(bone.skeleton.scaleY);
|
||||||
break;
|
break;
|
||||||
case noRotationOrReflection:
|
case noRotationOrReflection:
|
||||||
float s = Math.abs(pa * pd - pb * pc) / Math.max(0.0001f, pa * pa + pc * pc);
|
float s = Math.abs(pa * pd - pb * pc) / Math.max(0.0001f, pa * pa + pc * pc);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user