Bugfix: cloth crash applying effector forces to quads.
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Wed, 19 Mar 2008 13:32:16 +0000 (13:32 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Wed, 19 Mar 2008 13:32:16 +0000 (13:32 +0000)
source/blender/blenkernel/intern/implicit.c

index 21e58f88aad00f0b45f1e72db1ff29178320ec0d..f4b1a325712d899f99fce978363a05cd3ee70505 100644 (file)
@@ -1458,11 +1458,11 @@ void cloth_calc_force(ClothModifierData *clmd, lfVector *lF, lfVector *lX, lfVec
                        speed[0] = speed[1] = speed[2] = 0.0;
                        if(mfaces[i].v4)
                        {
-                               pdDoEffectors(effectors, lX[i], force, speed, (float)G.scene->r.cfra, 0.0f, PE_WIND_AS_SPEED);
+                               pdDoEffectors(effectors, lX[mfaces[i].v4], force, speed, (float)G.scene->r.cfra, 0.0f, PE_WIND_AS_SPEED);
                                VECCOPY(wind_normalized, speed);
                                Normalize(wind_normalized);
                                VecMulf(wind_normalized, -calculateVertexWindForce(speed, vertexnormal) * verts[mfaces[i].v4].mass);
-                               VECADDS(lF[i], lF[i], wind_normalized, 0.25);
+                               VECADDS(lF[mfaces[i].v4], lF[mfaces[i].v4], wind_normalized, 0.25);
                        }
                        
                }