Skip to content

Commit

Permalink
fix single bone IK constraint with negative scale
Browse files Browse the repository at this point in the history
  • Loading branch information
flyover committed Apr 25, 2016
1 parent f1d7481 commit 0228095
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion spine.js
Original file line number Diff line number Diff line change
Expand Up @@ -3330,7 +3330,11 @@ spine.Pose.prototype.strike = function() {
var bone_parent = pose.bones[bone.parent_key];
if (bone_parent) {
spine.Bone.flatten(bone_parent, pose.bones);
a1 -= bone_parent.world_space.rotation.rad;
if (spine.Matrix.determinant(bone_parent.world_space.scale) < 0) {
a1 += bone_parent.world_space.rotation.rad;
} else {
a1 -= bone_parent.world_space.rotation.rad;
}
}
bone.local_space.rotation.rad = spine.tweenAngle(bone.local_space.rotation.rad, a1, alpha);
break;
Expand Down

0 comments on commit 0228095

Please sign in to comment.