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/blenlib/intern/math_matrix.c | |
parent | 5fce3457b79bccbbcfe9fad0ed6f1a04643cf71b (diff) |
Math lib: simplify size_to_mat4 and use in b_bone_spline_setup
Diffstat (limited to 'source/blender/blenlib/intern/math_matrix.c')
-rw-r--r-- | source/blender/blenlib/intern/math_matrix.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/source/blender/blenlib/intern/math_matrix.c b/source/blender/blenlib/intern/math_matrix.c index c185fe1a16d..eb5c5f4aab4 100644 --- a/source/blender/blenlib/intern/math_matrix.c +++ b/source/blender/blenlib/intern/math_matrix.c @@ -1236,11 +1236,22 @@ void size_to_mat3(float mat[3][3], const float size[3]) void size_to_mat4(float mat[4][4], const float size[3]) { - float tmat[3][3]; - - size_to_mat3(tmat, size); - unit_m4(mat); - copy_m4_m3(mat, tmat); + mat[0][0] = size[0]; + mat[0][1] = 0.0f; + mat[0][2] = 0.0f; + mat[0][3] = 0.0f; + mat[1][0] = 0.0f; + mat[1][1] = size[1]; + mat[1][2] = 0.0f; + mat[1][3] = 0.0f; + mat[2][0] = 0.0f; + mat[2][1] = 0.0f; + mat[2][2] = size[2]; + mat[2][3] = 0.0f; + mat[3][0] = 0.0f; + mat[3][1] = 0.0f; + mat[3][2] = 0.0f; + mat[3][3] = 1.0f; } void mat3_to_size(float size[3], float mat[3][3]) |