[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [35753] trunk/blender/source/blender/ editors/physics/physics_fluid.c: Bug fix: Fluidsim didn' t take parent objects into account when calculating the inflow velocity in local coordinates .

Janne Karhu jhkarh at gmail.com
Thu Mar 24 15:19:13 CET 2011


Revision: 35753
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=35753
Author:   jhk
Date:     2011-03-24 14:19:12 +0000 (Thu, 24 Mar 2011)
Log Message:
-----------
Bug fix: Fluidsim didn't take parent objects into account when calculating the inflow velocity in local coordinates.
* The object rotation was based on ob->rot (which only includes object's own rotation) instead of ob->obmat, which includes parent rotations as well.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/physics/physics_fluid.c

Modified: trunk/blender/source/blender/editors/physics/physics_fluid.c
===================================================================
--- trunk/blender/source/blender/editors/physics/physics_fluid.c	2011-03-24 13:25:29 UTC (rev 35752)
+++ trunk/blender/source/blender/editors/physics/physics_fluid.c	2011-03-24 14:19:12 UTC (rev 35753)
@@ -449,8 +449,9 @@
 				continue;
 			
 			/* init euler rotation values and convert to elbeem format */
-			BKE_rotMode_change_values(ob->quat, ob->rot, ob->rotAxis, &ob->rotAngle, ob->rotmode, ROT_MODE_EUL);
-			mul_v3_v3fl(rot_d, ob->rot, 180.f/M_PI);
+			/* get the rotation from ob->obmat rather than ob->rot to account for parent animations */
+			mat4_to_eul(rot_d, ob->obmat);
+			mul_v3_fl(rot_d, 180.f/M_PI);
 			sub_v3_v3v3(rot_d, rot_360, rot_d);
 			
 			set_channel(fobj->Translation, timeAtFrame, ob->loc, i, CHANNEL_VEC);




More information about the Bf-blender-cvs mailing list