Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJanne Karhu <jhkarh@gmail.com>2010-11-18 22:12:36 +0300
committerJanne Karhu <jhkarh@gmail.com>2010-11-18 22:12:36 +0300
commit71721f02fc8ae1cfab254bfe575fdf27f849c5c1 (patch)
treee80b16ed451e7c45a892917af4435c23248c23bc /source/blender/blenkernel/BKE_particle.h
parentaef3e99eab6db507bf852adf9aa269a76158d991 (diff)
Algorithm fix for fluid particles:
* The SPH fluid particle algorithm was implemented a bit wrong. This problem could for example result in the fluid moving sideways after being dropped straight to a horizontal collision surface, a very big no-no as far as real world physics are concerned! * After some extensive code shuffling the algorithm is now much more true to the paper it was implemented from, and more importantly now the physics should be correct too! * The main thing was that fluids calculations can effect many particles simultaneously, so just a single loop through all particles can't work properly. As a side note this also means that the actual fluid algorithm can't be made threaded :( * To make things work I also had to reshuffle some general particle physics code, but there should be no functional changes what so ever to other physics types, so poke me immediately if something strange happens. Note to users: these changes will most probably effect the way previously done sph fluid simulations look, so some parameter tweaking will be needed to get things back looking the way they were.
Diffstat (limited to 'source/blender/blenkernel/BKE_particle.h')
-rw-r--r--source/blender/blenkernel/BKE_particle.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_particle.h b/source/blender/blenkernel/BKE_particle.h
index 038b05f8e15..f072a942216 100644
--- a/source/blender/blenkernel/BKE_particle.h
+++ b/source/blender/blenkernel/BKE_particle.h
@@ -63,6 +63,7 @@ struct BVHTreeRayHit;
#define LOOP_PARTICLES for(p=0, pa=psys->particles; p<psys->totpart; p++, pa++)
#define LOOP_EXISTING_PARTICLES for(p=0, pa=psys->particles; p<psys->totpart; p++, pa++) if(!(pa->flag & PARS_UNEXIST))
#define LOOP_SHOWN_PARTICLES for(p=0, pa=psys->particles; p<psys->totpart; p++, pa++) if(!(pa->flag & (PARS_UNEXIST|PARS_NO_DISP)))
+#define LOOP_DYNAMIC_PARTICLES for(p=0, pa=psys->particles; p<psys->totpart; p++, pa++) if(pa->state.time > 0.f)
#define PSYS_FRAND_COUNT 1024
#define PSYS_FRAND(seed) psys->frand[(seed) % PSYS_FRAND_COUNT]