[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [32779] trunk/blender/source/blender/ blenlib/intern/math_matrix.c: fix for own mistake with mat4_to_loc_rot_size (), flipping the scale on negative matrix isn't correct.

Campbell Barton ideasman42 at gmail.com
Sat Oct 30 21:52:40 CEST 2010


Revision: 32779
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=32779
Author:   campbellbarton
Date:     2010-10-30 21:52:40 +0200 (Sat, 30 Oct 2010)

Log Message:
-----------
fix for own mistake with mat4_to_loc_rot_size(), flipping the scale on negative matrix isn't correct.

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	2010-10-30 19:29:11 UTC (rev 32778)
+++ trunk/blender/source/blender/blenlib/intern/math_matrix.c	2010-10-30 19:52:40 UTC (rev 32779)
@@ -957,7 +957,6 @@
 	float mat3[3][3];    /* wmat -> 3x3 */
 	float mat3_n[3][3];  /* wmat -> normalized, 3x3 */
 	float imat3_n[3][3]; /* wmat -> normalized & inverted, 3x3 */
-	short is_neg;
 	/* location */
 	copy_v3_v3(loc, wmat[3]);
 
@@ -966,9 +965,8 @@
 	copy_m3_m4(mat3, wmat);
 	/* so scale doesnt interfear with rotation [#24291] */
 	/* note: this is a workaround for negative matrix not working for rotation conversion, FIXME */
-	is_neg= is_negative_m3(mat3);
 	normalize_m3_m3(mat3_n, mat3);
-	if(is_neg) {
+	if(is_negative_m3(mat3)) {
 		negate_v3(mat3_n[0]);
 		negate_v3(mat3_n[1]);
 		negate_v3(mat3_n[2]);
@@ -986,12 +984,6 @@
 	size[0]= mat3[0][0];
 	size[1]= mat3[1][1];
 	size[2]= mat3[2][2];
-
-	/* with a negative matrix, all scaled will be negative
-	 * flipping isnt needed but nicer to result in a positive scale */
-	if(is_neg) {
-		negate_v3(size);
-	}
 }
 
 void scale_m3_fl(float m[][3], float scale)





More information about the Bf-blender-cvs mailing list