[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [58152] trunk/blender/source/blender/ blenlib/intern/math_matrix.c: no need to copy mat4x4 -> 3x3 in mat4_to_scale
Campbell Barton
ideasman42 at gmail.com
Wed Jul 10 14:12:59 CEST 2013
Revision: 58152
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=58152
Author: campbellbarton
Date: 2013-07-10 12:12:58 +0000 (Wed, 10 Jul 2013)
Log Message:
-----------
no need to copy mat4x4 -> 3x3 in mat4_to_scale
Modified Paths:
--------------
trunk/blender/source/blender/blenlib/intern/math_matrix.c
Modified: trunk/blender/source/blender/blenlib/intern/math_matrix.c
===================================================================
--- trunk/blender/source/blender/blenlib/intern/math_matrix.c 2013-07-10 11:36:52 UTC (rev 58151)
+++ trunk/blender/source/blender/blenlib/intern/math_matrix.c 2013-07-10 12:12:58 UTC (rev 58152)
@@ -1207,16 +1207,19 @@
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])
More information about the Bf-blender-cvs
mailing list