From ca70bd04e678437dac2158118a42525913b065b5 Mon Sep 17 00:00:00 2001 From: NathanSweet Date: Sun, 14 Feb 2016 19:45:10 +0100 Subject: [PATCH] Fixed single bone IK when a parent is scaled negatively. --- .../src/com/esotericsoftware/spine/IkConstraint.java | 1 + 1 file changed, 1 insertion(+) diff --git a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/IkConstraint.java b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/IkConstraint.java index 00ad082fe..12e4dcbc4 100644 --- a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/IkConstraint.java +++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/IkConstraint.java @@ -125,6 +125,7 @@ public class IkConstraint implements Updatable { float parentRotation = bone.parent == null ? 0 : bone.parent.getWorldRotationX(); float rotation = bone.rotation; float rotationIK = atan2(targetY - bone.worldY, targetX - bone.worldX) * radDeg - parentRotation; + if (bone.worldSignX != bone.worldSignY) rotationIK = 360 - rotationIK; if (rotationIK > 180) rotationIK -= 360; else if (rotationIK < -180) rotationIK += 360;