Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2013-07-10 16:12:58 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-07-10 16:12:58 +0400
commit3d13f22e89bdbc72ddeb3ca58cefdec9924ed850 (patch)
treeeb4b5062d8b4bf700ece2e599aba708e97d1076c
parent9460d9f344d82dbf69ddc7a4248e14ae949a74f3 (diff)
no need to copy mat4x4 -> 3x3 in mat4_to_scale
-rw-r--r--source/blender/blenlib/intern/math_matrix.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/source/blender/blenlib/intern/math_matrix.c b/source/blender/blenlib/intern/math_matrix.c
index 298abfa8c5e..d798b55e765 100644
--- a/source/blender/blenlib/intern/math_matrix.c
+++ b/source/blender/blenlib/intern/math_matrix.c
@@ -1207,16 +1207,19 @@ void mat4_to_size(float size[3], float mat[4][4])
float mat3_to_scale(float mat[3][3])
{
/* unit length vector */
- float unit_vec[3] = {0.577350269189626f, 0.577350269189626f, 0.577350269189626f};
+ float unit_vec[3];
+ copy_v3_fl(unit_vec, 0.577350269189626f);
mul_m3_v3(mat, unit_vec);
return len_v3(unit_vec);
}
float mat4_to_scale(float mat[4][4])
{
- float tmat[3][3];
- copy_m3_m4(tmat, mat);
- return mat3_to_scale(tmat);
+ /* unit length vector */
+ float unit_vec[3];
+ copy_v3_fl(unit_vec, 0.577350269189626f);
+ mul_mat3_m4_v3(mat, unit_vec);
+ return len_v3(unit_vec);
}
void mat3_to_rot_size(float rot[3][3], float size[3], float mat3[3][3])