diff options
Diffstat (limited to 'source/blender/blenkernel/intern/particle_system.c')
-rw-r--r-- | source/blender/blenkernel/intern/particle_system.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c index 809b5f2090c..dbe6fbd6dde 100644 --- a/source/blender/blenkernel/intern/particle_system.c +++ b/source/blender/blenkernel/intern/particle_system.c @@ -2267,12 +2267,13 @@ static void apply_particle_forces(ParticleSimulationData *sim, int p, float dfra EffectedPoint epoint; ParticleKey states[5], tkey; float timestep = psys_get_timestep(sim); - float force[3],impulse[3],dx[4][3],dv[4][3]; + float force[3],impulse[3],dx[4][3],dv[4][3],oldpos[3]; float dtime=dfra*timestep, time, pa_mass=part->mass, fac, fra=sim->psys->cfra; int i, steps=1; /* maintain angular velocity */ VECCOPY(pa->state.ave,pa->prev_state.ave); + VECCOPY(oldpos,pa->state.co); if(part->flag & PART_SIZEMASS) pa_mass*=pa->size; @@ -2399,7 +2400,7 @@ static void apply_particle_forces(ParticleSimulationData *sim, int p, float dfra VECADDFAC(pa->state.vel,pa->state.vel,force,dtime); VECADDFAC(pa->state.co,pa->state.co,pa->state.vel,dtime); - VECSUB(pa->state.vel,pa->state.co,pa->prev_state.co); + VECSUB(pa->state.vel,pa->state.co,oldpos); mul_v3_fl(pa->state.vel,1.0f/dtime); break; } |