Revision: 14814 http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=14814 Author: blendix Date: 2008-05-12 19:30:32 +0200 (Mon, 12 May 2008)
Log Message: ----------- Fix for bug #11114: boids physics went wrong when the distance between particles was exactly 0.0, for example with emission from verts. Modified Paths: -------------- trunk/blender/source/blender/blenkernel/intern/particle_system.c Modified: trunk/blender/source/blender/blenkernel/intern/particle_system.c =================================================================== --- trunk/blender/source/blender/blenkernel/intern/particle_system.c 2008-05-12 17:16:54 UTC (rev 14813) +++ trunk/blender/source/blender/blenkernel/intern/particle_system.c 2008-05-12 17:30:32 UTC (rev 14814) @@ -3770,10 +3770,12 @@ near=0; for(n=1; n<neighbours; n++){ if(ptn[n].dist<2.0f*pa->size){ - bvf->Subf(dvec,pa->state.co,pars[ptn[n].index].state.co); - bvf->Mulf(dvec,(2.0f*pa->size-ptn[n].dist)/ptn[n].dist); - bvf->Addf(avoid,avoid,dvec); - near++; + if(ptn[n].dist!=0.0f) { + bvf->Subf(dvec,pa->state.co,pars[ptn[n].index].state.co); + bvf->Mulf(dvec,(2.0f*pa->size-ptn[n].dist)/ptn[n].dist); + bvf->Addf(avoid,avoid,dvec); + near++; + } } /* ptn[] is distance ordered so no need to check others */ else break; _______________________________________________ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs