Fix for [#23734] Force Fields Min/Max don't work
authorJanne Karhu <jhkarh@gmail.com>
Thu, 9 Sep 2010 07:52:35 +0000 (07:52 +0000)
committerJanne Karhu <jhkarh@gmail.com>
Thu, 9 Sep 2010 07:52:35 +0000 (07:52 +0000)
*Special case for planar vortex field

source/blender/blenkernel/intern/effect.c

index 6f6d405dd90bf51558ea53accae5e1bbc00d29f8..05fcabd371f843f9781f54e41087f5a51d69bcdb 100644 (file)
@@ -667,10 +667,10 @@ int get_effector_data(EffectorCache *eff, EffectorData *efd, EffectedPoint *poin
                /* 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];
+                       float temp[3], translate[3];
                        sub_v3_v3v3(temp, point->loc, ob->obmat[3]);
-                       project_v3_v3v3(efd->loc, temp, efd->nor);
-                       sub_v3_v3v3(efd->loc, point->loc, efd->loc);
+                       project_v3_v3v3(translate, temp, efd->nor);
+                       add_v3_v3v3(efd->loc, ob->obmat[3], translate);
                }
                else {
                        VECCOPY(efd->loc, ob->obmat[3]);