[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [34617] trunk/blender/source/blender/ blenkernel/intern/object.c: bugfix for setting the worldspace matrix of an object which used quaternion rotation and deltas , was subtracting the values rather then multiplying by the inverse.

Campbell Barton ideasman42 at gmail.com
Wed Feb 2 02:01:03 CET 2011


Revision: 34617
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=34617
Author:   campbellbarton
Date:     2011-02-02 01:01:01 +0000 (Wed, 02 Feb 2011)
Log Message:
-----------
bugfix for setting the worldspace matrix of an object which used quaternion rotation and deltas, was subtracting the values rather then multiplying by the inverse.
effected 'Apply Visual Transform' & pythons obj.matrix_world = mat

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	2011-02-02 00:40:55 UTC (rev 34616)
+++ trunk/blender/source/blender/blenkernel/intern/object.c	2011-02-02 01:01:01 UTC (rev 34617)
@@ -1704,8 +1704,13 @@
 {
 	switch(ob->rotmode) {
 	case ROT_MODE_QUAT:
-		mat3_to_quat(ob->quat, mat);
-		sub_v4_v4(ob->quat, ob->dquat);
+		{
+			float dquat[4];
+			mat3_to_quat(ob->quat, mat);
+			normalize_qt_qt(dquat, ob->dquat);
+			invert_qt(dquat);
+			mul_qt_qtqt(ob->quat, dquat, ob->quat);
+		}
 		break;
 	case ROT_MODE_AXISANGLE:
 		mat3_to_axis_angle(ob->rotAxis, &ob->rotAngle, mat);




More information about the Bf-blender-cvs mailing list