diff options
Diffstat (limited to 'source/blender/ikplugin')
-rw-r--r-- | source/blender/ikplugin/intern/iksolver_plugin.c | 29 | ||||
-rw-r--r-- | source/blender/ikplugin/intern/itasc_plugin.cpp | 25 |
2 files changed, 25 insertions, 29 deletions
diff --git a/source/blender/ikplugin/intern/iksolver_plugin.c b/source/blender/ikplugin/intern/iksolver_plugin.c index 3646686e81f..ba096653e0f 100644 --- a/source/blender/ikplugin/intern/iksolver_plugin.c +++ b/source/blender/ikplugin/intern/iksolver_plugin.c @@ -452,21 +452,20 @@ static void execute_posetree(struct Depsgraph *depsgraph, /* don't solve IK when we are setting the pole angle */ break; } - else { - mul_m4_m4m4(goal, goalinv, rootmat); - copy_v3_v3(polepos, goal[3]); - poleconstrain = 1; - - /* for pole targets, we blend the result of the ik solver - * instead of the target position, otherwise we can't get - * a smooth transition */ - resultblend = 1; - resultinf = target->con->enforce; - - if (data->flag & CONSTRAINT_IK_GETANGLE) { - poleangledata = data; - data->flag &= ~CONSTRAINT_IK_GETANGLE; - } + + mul_m4_m4m4(goal, goalinv, rootmat); + copy_v3_v3(polepos, goal[3]); + poleconstrain = 1; + + /* for pole targets, we blend the result of the ik solver + * instead of the target position, otherwise we can't get + * a smooth transition */ + resultblend = 1; + resultinf = target->con->enforce; + + if (data->flag & CONSTRAINT_IK_GETANGLE) { + poleangledata = data; + data->flag &= ~CONSTRAINT_IK_GETANGLE; } } diff --git a/source/blender/ikplugin/intern/itasc_plugin.cpp b/source/blender/ikplugin/intern/itasc_plugin.cpp index 8f84d04f602..a5fdb9ef491 100644 --- a/source/blender/ikplugin/intern/itasc_plugin.cpp +++ b/source/blender/ikplugin/intern/itasc_plugin.cpp @@ -446,24 +446,21 @@ static double EulerAngleFromMatrix(const KDL::Rotation &R, int axis) if (axis == 0) { return -KDL::atan2(R(1, 2), R(2, 2)); } - else if (axis == 1) { + if (axis == 1) { return KDL::atan2(-R(0, 2), t); } - else { - return -KDL::atan2(R(0, 1), R(0, 0)); - } + + return -KDL::atan2(R(0, 1), R(0, 0)); } - else { - if (axis == 0) { - return -KDL::atan2(-R(2, 1), R(1, 1)); - } - else if (axis == 1) { - return KDL::atan2(-R(0, 2), t); - } - else { - return 0.0f; - } + + if (axis == 0) { + return -KDL::atan2(-R(2, 1), R(1, 1)); + } + if (axis == 1) { + return KDL::atan2(-R(0, 2), t); } + + return 0.0f; } static double ComputeTwist(const KDL::Rotation &R) |