Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJanne Karhu <jhkarh@gmail.com>2011-03-24 17:19:12 +0300
committerJanne Karhu <jhkarh@gmail.com>2011-03-24 17:19:12 +0300
commitd5e839d2abc830e2a2dd237b82bbb84873df3d88 (patch)
tree967051b0fc1ea6dfea1fd5281ebb0984f463b79b /source/blender/editors/physics
parent422f1674bb84e8f96629e8c70e90339696af68fb (diff)
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.
Diffstat (limited to 'source/blender/editors/physics')
-rw-r--r--source/blender/editors/physics/physics_fluid.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/source/blender/editors/physics/physics_fluid.c b/source/blender/editors/physics/physics_fluid.c
index 4ac794ed620..210b2480d85 100644
--- a/source/blender/editors/physics/physics_fluid.c
+++ b/source/blender/editors/physics/physics_fluid.c
@@ -449,8 +449,9 @@ static void fluid_init_all_channels(bContext *C, Object *UNUSED(fsDomain), Fluid
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);