From 148715426f2da7fdc0632bce6529a716dd39da1e Mon Sep 17 00:00:00 2001 From: NathanSweet Date: Wed, 23 Jul 2014 00:23:37 +0200 Subject: [PATCH] Fixed single bone IK when rotation inheritance is off. --- spine-libgdx/src/com/esotericsoftware/spine/IkConstraint.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spine-libgdx/src/com/esotericsoftware/spine/IkConstraint.java b/spine-libgdx/src/com/esotericsoftware/spine/IkConstraint.java index 7296d67aa..8950495c3 100644 --- a/spine-libgdx/src/com/esotericsoftware/spine/IkConstraint.java +++ b/spine-libgdx/src/com/esotericsoftware/spine/IkConstraint.java @@ -89,7 +89,7 @@ public class IkConstraint { /** Adjusts the bone rotation so the tip is as close to the target position as possible. The target is specified in the world * coordinate system. */ static public void apply (Bone bone, float targetX, float targetY, float alpha) { - float parentRotation = bone.parent == null ? 0 : bone.parent.worldRotation; + float parentRotation = (!bone.data.inheritRotation || bone.parent == null) ? 0 : bone.parent.worldRotation; float rotation = bone.rotation; float rotationIK = (float)Math.atan2(targetY - bone.getWorldY(), targetX - bone.getWorldX()) * radDeg - parentRotation; bone.rotationIK = rotation + (rotationIK - rotation) * alpha;