Fix for [#25955] Hair paths under force field influence look jagged
authorJanne Karhu <jhkarh@gmail.com>
Mon, 7 Feb 2011 10:54:55 +0000 (10:54 +0000)
committerJanne Karhu <jhkarh@gmail.com>
Mon, 7 Feb 2011 10:54:55 +0000 (10:54 +0000)
* Effectors were applied wrong for hair.

source/blender/blenkernel/intern/particle.c

index 12aa40a23d81141f14ead341b668593cebad8694..7421c43dc10bfc57864b02e14b235d1966702153 100644 (file)
@@ -2246,12 +2246,13 @@ static void do_path_effectors(ParticleSimulationData *sim, int i, ParticleCacheK
 
        normalize_v3(force);
 
-       VECADDFAC(ca->co, (ca-1)->co, force, *length);
-
-       if(k < steps) {
+       if(k < steps)
                sub_v3_v3v3(vec, (ca+1)->co, ca->co);
+
+       madd_v3_v3v3fl(ca->co, (ca-1)->co, force, *length);
+
+       if(k < steps)
                *length = len_v3(vec);
-       }
 }
 static int check_path_length(int k, ParticleCacheKey *keys, ParticleCacheKey *state, float max_length, float *cur_length, float length, float *dvec)
 {