mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-06 07:14:55 +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;
|
||||
switch (bone.data.transformMode) {
|
||||
case onlyTranslation:
|
||||
tx = targetX - bone.worldX;
|
||||
ty = targetY - bone.worldY;
|
||||
tx = (targetX - bone.worldX) * Math.signum(bone.skeleton.scaleX);
|
||||
ty = (targetY - bone.worldY) * Math.signum(bone.skeleton.scaleY);
|
||||
break;
|
||||
case noRotationOrReflection:
|
||||
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