[Bf-blender-cvs] [0414ed1] master: Fix for mat3_to_rot_size modifying input matrix
Campbell Barton
noreply at git.blender.org
Thu Oct 30 10:37:45 CET 2014
Commit: 0414ed1c480fa53a057a0b2077122e27ffd058fd
Author: Campbell Barton
Date: Thu Oct 30 10:37:27 2014 +0100
Branches: master
https://developer.blender.org/rB0414ed1c480fa53a057a0b2077122e27ffd058fd
Fix for mat3_to_rot_size modifying input matrix
===================================================================
M source/blender/blenlib/intern/math_matrix.c
===================================================================
diff --git a/source/blender/blenlib/intern/math_matrix.c b/source/blender/blenlib/intern/math_matrix.c
index 6b40f0c..115980c 100644
--- a/source/blender/blenlib/intern/math_matrix.c
+++ b/source/blender/blenlib/intern/math_matrix.c
@@ -1425,11 +1425,19 @@ void mat3_to_rot_size(float rot[3][3], float size[3], float mat3[3][3])
/* scale */
/* note: mat4_to_size(ob->size, mat) fails for negative scale */
invert_m3_m3(imat3_n, mat3_n);
+
+ /* better not edit mat3 */
+#if 0
mul_m3_m3m3(mat3, imat3_n, mat3);
size[0] = mat3[0][0];
size[1] = mat3[1][1];
size[2] = mat3[2][2];
+#else
+ size[0] = dot_m3_v3_row_x(imat3_n, mat3[0]);
+ size[1] = dot_m3_v3_row_y(imat3_n, mat3[1]);
+ size[2] = dot_m3_v3_row_z(imat3_n, mat3[2]);
+#endif
}
void mat4_to_loc_rot_size(float loc[3], float rot[3][3], float size[3], float wmat[4][4])
More information about the Bf-blender-cvs
mailing list