浏览代码

Fixed single bone IK when a parent is scaled negatively.

NathanSweet 9 年之前
父节点
当前提交
ca70bd04e6
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/IkConstraint.java

+ 1 - 0
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;