diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-02-01 18:27:06 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-02-01 19:24:47 +0400 |
commit | 798e684c7c4d8b7c0c31a5f892ae43189e8d1b8c (patch) | |
tree | 9c24c491b0344b87b54c0690ea047ba6d4efa1e4 /source/blender/blenkernel/intern | |
parent | 5fce3457b79bccbbcfe9fad0ed6f1a04643cf71b (diff) |
Math lib: simplify size_to_mat4 and use in b_bone_spline_setup
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r-- | source/blender/blenkernel/intern/armature.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/source/blender/blenkernel/intern/armature.c b/source/blender/blenkernel/intern/armature.c index 829c0c7dd00..c44479a4b08 100644 --- a/source/blender/blenkernel/intern/armature.c +++ b/source/blender/blenkernel/intern/armature.c @@ -431,21 +431,17 @@ void b_bone_spline_setup(bPoseChannel *pchan, int rest, Mat4 result_array[MAX_BB float h1[3], h2[3], scale[3], length, hlength1, hlength2, roll1 = 0.0f, roll2; float mat3[3][3], imat[4][4], posemat[4][4], scalemat[4][4], iscalemat[4][4]; float data[MAX_BBONE_SUBDIV + 1][4], *fp; - int a, do_scale = 0; + int a; + bool do_scale = false; length = bone->length; if (!rest) { /* check if we need to take non-uniform bone scaling into account */ - scale[0] = len_v3(pchan->pose_mat[0]); - scale[1] = len_v3(pchan->pose_mat[1]); - scale[2] = len_v3(pchan->pose_mat[2]); + mat4_to_size(scale, pchan->pose_mat); if (fabsf(scale[0] - scale[1]) > 1e-6f || fabsf(scale[1] - scale[2]) > 1e-6f) { - unit_m4(scalemat); - scalemat[0][0] = scale[0]; - scalemat[1][1] = scale[1]; - scalemat[2][2] = scale[2]; + size_to_mat4(scalemat, scale); invert_m4_m4(iscalemat, scalemat); length *= scale[1]; |