Hopefully a working merge with trunk (could be one error left in raytrace.c - will...
[blender.git] / source / blender / blenkernel / intern / effect.c
index cca5d68167e74084b2fe0aed94a02a938cb2a822..0614e4a387f1cbdc102d04d571579db0e6c09ea9 100644 (file)
@@ -419,6 +419,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);