Revision: 32691
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=32691
Author:   campbellbarton
Date:     2010-10-25 08:59:18 +0200 (Mon, 25 Oct 2010)

Log Message:
-----------
first part of bugfix [#24376] Fly mode disturbs the rotation or scale of the 
camera object 
object_apply_mat4 was incorrectly negating the matrix values,

This worked in most cases but even when it worked would end up with negative 
scales too often.
now when no negative scale is used they will all stay positive and from my 
tests it works in all cases now.

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/intern/object.c

Modified: trunk/blender/source/blender/blenkernel/intern/object.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/object.c     2010-10-25 
02:58:32 UTC (rev 32690)
+++ trunk/blender/source/blender/blenkernel/intern/object.c     2010-10-25 
06:59:18 UTC (rev 32691)
@@ -1709,12 +1709,14 @@
         * for these together since they are related. */
        copy_m3_m4(mat3, mat);
        /* so scale doesnt interfear with rotation [#24291] */
+       /* note: this is a workaround for negative matrix not working for 
rotation conversion, FIXME */
        normalize_m3_m3(mat3_n, (const float(*)[3])mat3);
-       if(mat3_n[0][0] < 0.0f) negate_v3(mat3_n[0]);
-       if(mat3_n[1][1] < 0.0f) negate_v3(mat3_n[1]);
-       if(mat3_n[2][2] < 0.0f) negate_v3(mat3_n[2]);
+       if(is_negative_m3(mat3_n)) {
+               negate_v3(mat3_n[0]);
+               negate_v3(mat3_n[1]);
+               negate_v3(mat3_n[2]);
+       }
 
-
        /* rotation */
        object_mat3_to_rot(ob, mat3_n, 0);
 


_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to