diff options
author | Janne Karhu <jhkarh@gmail.com> | 2011-03-29 16:50:43 +0400 |
---|---|---|
committer | Janne Karhu <jhkarh@gmail.com> | 2011-03-29 16:50:43 +0400 |
commit | 74e044065b35e5444871f8f5836b221144588082 (patch) | |
tree | caf0265fc2c14dbc462782b9ea28fc6f7249bff7 /source | |
parent | e4ef822ecdb1e642012c19fa82cf5a2f796ee0f3 (diff) |
Fix for [#26665] Force field absorption does not work
* Old bug fix led to all kinds of wrong behavior with "plane" shaped effectors, now things are working properly again.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/intern/effect.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/effect.c b/source/blender/blenkernel/intern/effect.c index 216dffc1e4a..9cca5ae4982 100644 --- a/source/blender/blenkernel/intern/effect.c +++ b/source/blender/blenkernel/intern/effect.c @@ -687,13 +687,16 @@ int get_effector_data(EffectorCache *eff, EffectorData *efd, EffectedPoint *poin /* use z-axis as normal*/ normalize_v3_v3(efd->nor, ob->obmat[2]); - /* for vortex the shape chooses between old / new force */ if(eff->pd && eff->pd->shape == PFIELD_SHAPE_PLANE) { - /* efd->loc is closes point on effector xy-plane */ float temp[3], translate[3]; sub_v3_v3v3(temp, point->loc, ob->obmat[3]); project_v3_v3v3(translate, temp, efd->nor); - add_v3_v3v3(efd->loc, ob->obmat[3], translate); + + /* for vortex the shape chooses between old / new force */ + if(eff->pd->forcefield == PFIELD_VORTEX) + add_v3_v3v3(efd->loc, ob->obmat[3], translate); + else /* normally efd->loc is closest point on effector xy-plane */ + sub_v3_v3v3(efd->loc, point->loc, translate); } else { VECCOPY(efd->loc, ob->obmat[3]); |