diff options
author | Campbell Barton <ideasman42@gmail.com> | 2021-10-05 02:59:49 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-10-05 03:09:31 +0300 |
commit | 2dace5f3ef54cc25ed31fe20fd33df727f10a9ac (patch) | |
tree | a733a408fb91ab861e12b2dd1a85b5708a66cb80 /source | |
parent | 92c449776db8384c6555b21b135247ec4aa84e71 (diff) |
Cleanup: use 3D dot product (not 4D) when comparing pose-bone axes
Also use more meaningful variable name.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/intern/action_mirror.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/blenkernel/intern/action_mirror.c b/source/blender/blenkernel/intern/action_mirror.c index 48472dfc9b3..cc3a15aa546 100644 --- a/source/blender/blenkernel/intern/action_mirror.c +++ b/source/blender/blenkernel/intern/action_mirror.c @@ -327,10 +327,10 @@ static void action_flip_pchan(Object *ob_arm, * the X-axis, it turns into a 180 degree rotation over the Y-axis. * This has only been observed with bones that can't be flipped, * hence the check for `pchan_flip`. */ - const float unit_x[4] = {1.0f, 0.0f, 0.0f, 0.0f}; - const bool is_problematic = pchan_flip == NULL && - fabsf(dot_v4v4(pchan->bone->arm_mat[0], unit_x)) <= 1e-6; - if (is_problematic) { + const float unit_x[3] = {1.0f, 0.0f, 0.0f}; + const bool is_x_axis_orthogonal = (pchan_flip == NULL) && + (fabsf(dot_v3v3(pchan->bone->arm_mat[0], unit_x)) <= 1e-6f); + if (is_x_axis_orthogonal) { /* Matrix needs to flip both the X and Z axes to come out right. */ float extra_mat[4][4] = { {-1.0f, 0.0f, 0.0f, 0.0f}, |