svn merge -r 17502:18705 https://svn.blender.org/svnroot/bf-blender/trunk/blender
[blender.git] / source / blender / blenkernel / intern / effect.c
index 0338ec92414ab4f4ba5c4b1770df87f5bc8d532c..b5d3213ac0adccc971856560343e9ef4c6a1521f 100644 (file)
@@ -421,6 +421,28 @@ void do_physical_effector(Object *ob, float *opco, short type, float force_val,
                        VecAddf(field,field,mag_vec);
 
                        break;
+               case PFIELD_SPIN:
+               {
+                       float inward[3];
+
+                       Projf(temp, velocity, eff_vel);
+                       Crossf(mag_vec,eff_vel,vec_to_part);
+                       Crossf(inward, mag_vec, eff_vel);
+
+                       Normalize(mag_vec);
+                       Normalize(inward);
+
+                       VecSubf(mag_vec, mag_vec, inward);
+                       VecMulf(mag_vec,force_val*distance*falloff);
+
+                       VecAddf(mag_vec, mag_vec, temp);
+                       
+                       //VecCopyf(velocity, mag_vec);
+                       VecSubf(mag_vec, mag_vec, velocity);
+                       VecAddf(field, field, mag_vec);
+                       
+                       break;
+               }
                case PFIELD_MAGNET:
                        if(planar)
                                VecCopyf(temp,eff_vel);