From f09d6054100a17cc6129d035cf3634394f5e9377 Mon Sep 17 00:00:00 2001 From: Janne Karhu Date: Fri, 4 Sep 2009 23:06:15 +0000 Subject: Some particles cleanup & fixes: - Some big refresh issues with softbody & cloth point cache usage should now be fixed. - Removed sticky objects from particles (better stuff will come back when I get to updating reactor particles). - Some initial easy memory efficiency cleanup for ParticleData struct. The ultimate goal is to get particles less memory hungry -> more particles possible in single scene. - Wrong path timing clamping caused hair particles to seem disappeared when changing between normal<->hair particles. - "Calculate to current frame" in cache buttons baked instead of the intended function. - Boids particle data is now a bit better organized. --- source/blender/makesdna/DNA_particle_types.h | 45 ++++++++++++++-------------- 1 file changed, 23 insertions(+), 22 deletions(-) (limited to 'source/blender/makesdna/DNA_particle_types.h') diff --git a/source/blender/makesdna/DNA_particle_types.h b/source/blender/makesdna/DNA_particle_types.h index 12c253a7cb8..d4dc3df0965 100644 --- a/source/blender/makesdna/DNA_particle_types.h +++ b/source/blender/makesdna/DNA_particle_types.h @@ -33,6 +33,7 @@ #define DNA_PARTICLE_TYPES_H #include "DNA_ID.h" +#include "DNA_boid_types.h" struct AnimData; @@ -52,6 +53,14 @@ typedef struct ParticleKey { /* when changed update size of struct to copy_parti float time; /* when this key happens */ } ParticleKey; +typedef struct BoidParticle { + struct Object *ground; + struct BoidData data; + float gravity[3]; + float wander[3]; + float rt; +} BoidParticle; + /* Child particles are created around or between parent particles */ typedef struct ChildParticle { int num, parent; /* num is face index on the final derived mesh */ @@ -69,42 +78,34 @@ typedef struct ParticleTarget { float time, duration; } ParticleTarget; -/* Everything that's non dynamic for a particle: */ typedef struct ParticleData { - struct Object *stick_ob;/* object that particle sticks to when dead */ - - ParticleKey state; /* normally current global coordinates or */ - /* in sticky object space if dead & sticky */ + ParticleKey state; /* current global coordinates */ ParticleKey prev_state; /* previous state */ - + HairKey *hair; /* hair vertices */ - ParticleKey *keys; /* keyed states */ + ParticleKey *keys; /* keyed keys */ - struct BoidData *boid; /* boids data */ + BoidParticle *boid; /* boids data */ - float r_rot[4]; /* random values */ - float r_ave[3],r_ve[3]; - - float fuv[4], foffset; /* coordinates on face/edge number "num" and depth along*/ - /* face normal for volume emission */ + int totkey; /* amount of hair or keyed keys*/ float time, lifetime; /* dietime is not nescessarily time+lifetime as */ float dietime; /* particles can die unnaturally (collision) */ - float size, sizemul; /* size and multiplier so that we can update size when ever */ - int num; /* index to vert/edge/face */ int num_dmcache; /* index to derived mesh data (face) to avoid slow lookups */ - int totkey; - int bpi; /* softbody body point start index */ + float fuv[4], foffset; /* coordinates on face/edge number "num" and depth along*/ + /* face normal for volume emission */ + + float size; /* size and multiplier so that we can update size when ever */ short flag; - short alive; /* the life state of a particle */ + short alive; /* the life state of a particle */ short loop; /* how many times particle life has looped */ - short rt2; + short rt; } ParticleData; typedef struct ParticleSettings { @@ -258,7 +259,7 @@ typedef struct ParticleSystem{ /* note, make sure all (runtime) are NULL's in #define PART_TRAND 128 #define PART_EDISTR 256 /* particle/face from face areas */ -#define PART_STICKY 512 /*collided particles can stick to collider*/ +//#define PART_STICKY 512 /*collided particles can stick to collider*/ #define PART_DIE_ON_COL (1<<12) #define PART_SIZE_DEFL (1<<13) /* swept sphere deflections */ #define PART_ROT_DYN (1<<14) /* dynamic rotation */ @@ -409,7 +410,7 @@ typedef struct ParticleSystem{ /* note, make sure all (runtime) are NULL's in /* psys->flag */ #define PSYS_CURRENT 1 -//#define PSYS_BAKING 2 +#define PSYS_GLOBAL_HAIR 2 //#define PSYS_BAKE_UI 4 #define PSYS_KEYED_TIMING 8 #define PSYS_ENABLED 16 /* deprecated */ @@ -426,7 +427,7 @@ typedef struct ParticleSystem{ /* note, make sure all (runtime) are NULL's in /* pars->flag */ #define PARS_UNEXIST 1 #define PARS_NO_DISP 2 -#define PARS_STICKY 4 +//#define PARS_STICKY 4 #define PARS_REKEY 8 /* pars->alive */ -- cgit v1.2.3