[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [35104] trunk/blender/source/blender/ blenkernel/intern/particle_system.c: Possible fix for [#26190] Changing particle amount crashes
Janne Karhu
jhkarh at gmail.com
Wed Feb 23 11:42:27 CET 2011
Revision: 35104
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=35104
Author: jhk
Date: 2011-02-23 10:42:27 +0000 (Wed, 23 Feb 2011)
Log Message:
-----------
Possible fix for [#26190] Changing particle amount crashes
* In some cases fluid particles could be born at the exact same locations. Now these cases are just ignored and such particles don't effect each other.
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 2011-02-23 09:12:55 UTC (rev 35103)
+++ trunk/blender/source/blender/blenkernel/intern/particle_system.c 2011-02-23 10:42:27 UTC (rev 35104)
@@ -2286,6 +2286,10 @@
/* pressure and near pressure */
for(n=own_psys?1:0; n<neighbours; n++) {
+ /* disregard particles at the exact same location */
+ if(ptn->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 @@
/* main calculations */
for(n=own_psys?1:0; n<neighbours; n++) {
+ /* disregard particles at the exact same location */
+ if(ptn->dist < FLT_EPSILON)
+ continue;
+
npa = psys->particles + ptn[n].index;
rij = ptn[n].dist;
More information about the Bf-blender-cvs
mailing list