diff options
-rw-r--r-- | source/blender/blenkernel/intern/particle_system.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c index c1a6558aea3..fd792168c6b 100644 --- a/source/blender/blenkernel/intern/particle_system.c +++ b/source/blender/blenkernel/intern/particle_system.c @@ -2286,6 +2286,10 @@ static void particle_fluidsim(ParticleSystem *psys, int own_psys, ParticleData * /* pressure and near pressure */ for(n=own_psys?1:0; n<neighbours; n++) { + /* disregard particles at the exact same location */ + if(ptn[n].dist < FLT_EPSILON) + continue; + sub_v3_v3(ptn[n].co, pa->prev_state.co); mul_v3_fl(ptn[n].co, 1.f/ptn[n].dist); q = ptn[n].dist/h; @@ -2305,6 +2309,10 @@ static void particle_fluidsim(ParticleSystem *psys, int own_psys, ParticleData * /* main calculations */ for(n=own_psys?1:0; n<neighbours; n++) { + /* disregard particles at the exact same location */ + if(ptn[n].dist < FLT_EPSILON) + continue; + npa = psys->particles + ptn[n].index; rij = ptn[n].dist; |