Cleanup: comment blocks
[blender.git] / source / blender / makesdna / DNA_particle_types.h
index b7ca3066b4f8338ef14c78193afffcedc1011acd..a96354f05c1ee6f11d73fdfd93629443f46175fb 100644 (file)
@@ -44,6 +44,7 @@ typedef struct HairKey {
        float weight;   /* softbody weight */
        short editflag; /* saved particled edit mode flags */
        short pad;
+       float world_co[3];
 } HairKey;
 
 typedef struct ParticleKey {   /* when changed update size of struct to copy_particleKey()!! */
@@ -96,7 +97,7 @@ typedef struct ParticleData {
        ParticleKey state;              /* current global coordinates */
 
        ParticleKey prev_state; /* previous state */
-       
+
        HairKey *hair;                  /* hair vertices */
 
        ParticleKey *keys;              /* keyed keys */
@@ -105,14 +106,15 @@ typedef struct ParticleData {
 
        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 time, lifetime;   /* dietime is not nescessarily time+lifetime as */
+       float dietime;                  /* particles can die unnaturally (collision). */
 
+       /* WARNING! Those two indices, when not affected to vertices, are for !!! TESSELLATED FACES !!!, not POLYGONS! */
        int num;                                /* index to vert/edge/face */
        int num_dmcache;                /* index to derived mesh data (face) to avoid slow lookups */
 
        float fuv[4], foffset;  /* coordinates on face/edge number "num" and depth along*/
-                                                       /* face normal for volume emission                                              */
+                                                       /* face normal for volume emission. */
 
        float size;                             /* size and multiplier so that we can update size when ever */
 
@@ -158,6 +160,7 @@ typedef struct ParticleSettings {
        struct SPHFluidSettings *fluid;
 
        struct EffectorWeights *effector_weights;
+       struct Group *collision_group;
 
        int flag, rt;
        short type, from, distr, texact;
@@ -207,6 +210,8 @@ typedef struct ParticleSettings {
        /* length */
        float randlength;
        /* children */
+       int child_flag;
+       int pad3;
        int child_nbr, ren_child_nbr;
        float parents, childsize, childrandsize;
        float childrad, childflat;
@@ -215,6 +220,8 @@ typedef struct ParticleSettings {
        /* kink */
        float kink_amp, kink_freq, kink_shape, kink_flat;
        float kink_amp_clump;
+       int kink_extra_steps, pad4;
+       float kink_axis_random, kink_amp_random;
        /* rough */
        float rough1, rough1_size;
        float rough2, rough2_size, rough2_thres;
@@ -232,6 +239,12 @@ typedef struct ParticleSettings {
        int trail_count;
        /* keyed particles */
        int keyed_loops;
+       struct CurveMapping *clumpcurve;
+       struct CurveMapping *roughcurve;
+       float clump_noise_size;
+
+       /* hair dynamics */
+       float bending_random;
 
        struct MTex *mtex[18];          /* MAX_MTEX */
 
@@ -246,8 +259,12 @@ typedef struct ParticleSettings {
 
        /* modified dm support */
        short use_modifier_stack;
-       short pad[3];
+       short pad5[3];
 
+       float twist;
+       float pad6;
+       struct CurveMapping *twistcurve;
+       void *pad7;
 } ParticleSettings;
 
 typedef struct ParticleSystem {
@@ -280,7 +297,7 @@ typedef struct ParticleSystem {
        struct ListBase targets;                                /* used for keyed and boid physics */
 
        char name[64];                                                  /* particle system name, MAX_NAME */
-       
+
        float imat[4][4];       /* used for duplicators */
        float cfra, tree_frame, bvhtree_frame;
        int seed, child_seed;
@@ -290,10 +307,11 @@ typedef struct ParticleSystem {
        char bb_uvname[3][64];                                  /* billboard uv name, MAX_CUSTOMDATA_LAYER_NAME */
 
        /* if you change these remember to update array lengths to PSYS_TOT_VG! */
-       short vgroup[12], vg_neg, rt3;                  /* vertex groups, 0==disable, 1==starting index */
+       short vgroup[13], vg_neg, rt3;                  /* vertex groups, 0==disable, 1==starting index */
+       char pad[6];
 
        /* temporary storage during render */
-       void *renderdata;
+       struct ParticleRenderData *renderdata;
 
        /* point cache */
        struct PointCache *pointcache;
@@ -304,17 +322,38 @@ typedef struct ParticleSystem {
        ParticleSpring *fluid_springs;
        int tot_fluidsprings, alloc_fluidsprings;
 
-       struct KDTree *tree;                                                            /* used for interactions with self and other systems */
-       struct BVHTree *bvhtree;                                                                /* used for interactions with self and other systems */
+       struct KDTree *tree;                                    /* used for interactions with self and other systems */
+       struct BVHTree *bvhtree;                                /* used for interactions with self and other systems */
 
        struct ParticleDrawData *pdd;
 
-       float *frand;                                                   /* array of 1024 random floats for fast lookups */
-
        float dt_frac;                                                  /* current time step, as a fraction of a frame */
-       float _pad;                                                             /* spare capacity */
+       float lattice_strength;                                 /* influence of the lattice modifier */
 } ParticleSystem;
 
+typedef enum eParticleDrawFlag {
+       PART_DRAW_VEL           = (1 << 0),
+       PART_DRAW_GLOBAL_OB         = (1 << 1),
+       PART_DRAW_SIZE          = (1 << 2),
+       PART_DRAW_EMITTER       = (1 << 3), /* render emitter also */
+       PART_DRAW_HEALTH        = (1 << 4),
+       PART_ABS_PATH_TIME      = (1 << 5),
+       PART_DRAW_COUNT_GR      = (1 << 6),
+       PART_DRAW_BB_LOCK       = (1 << 7), /* used with billboards */
+       PART_DRAW_ROTATE_OB     = (1 << 7), /* used with dupliobjects/groups */
+       PART_DRAW_PARENT        = (1 << 8),
+       PART_DRAW_NUM           = (1 << 9),
+       PART_DRAW_RAND_GR       = (1 << 10),
+       PART_DRAW_REN_ADAPT     = (1 << 11),
+       PART_DRAW_VEL_LENGTH    = (1 << 12),
+       PART_DRAW_MAT_COL       = (1 << 13), /* deprecated, but used in do_versions */
+       PART_DRAW_WHOLE_GR      = (1 << 14),
+       PART_DRAW_REN_STRAND    = (1 << 15),
+       PART_DRAW_NO_SCALE_OB   = (1 << 16), /* used with dupliobjects/groups */
+       PART_DRAW_GUIDE_HAIRS   = (1 << 17),
+       PART_DRAW_HAIR_GRID     = (1 << 18),
+} eParticleDrawFlag;
+
 /* part->type */
 /* hair is allways baked static in object/geometry space */
 /* other types (normal particles) are in global space and not static baked */
@@ -336,7 +375,7 @@ typedef struct ParticleSystem {
 #define PART_UNBORN                    32      /*show unborn particles*/
 #define PART_DIED                      64      /*show died particles*/
 
-#define PART_TRAND                     128     
+#define PART_TRAND                     128
 #define PART_EDISTR                    256     /* particle/face from face areas */
 
 #define PART_ROTATIONS         512     /* calculate particle rotations (and store them in pointcache) */
@@ -371,7 +410,7 @@ typedef struct ParticleSystem {
 #define PART_FROM_VERT         0
 #define PART_FROM_FACE         1
 #define PART_FROM_VOLUME       2
-/* #define PART_FROM_PARTICLE  3  deprecated! */ 
+/* #define PART_FROM_PARTICLE  3  deprecated! */
 #define PART_FROM_CHILD                4
 
 /* part->distr */
@@ -387,31 +426,22 @@ typedef struct ParticleSystem {
 #define PART_PHYS_FLUID                4
 
 /* part->kink */
-#define PART_KINK_NO           0
-#define PART_KINK_CURL         1
-#define PART_KINK_RADIAL       2
-#define PART_KINK_WAVE         3
-#define PART_KINK_BRAID                4
-
-/* part->draw */
-#define PART_DRAW_VEL          1
-#define PART_DRAW_GLOBAL_OB    2
-#define PART_DRAW_SIZE         4
-#define PART_DRAW_EMITTER      8       /* render emitter also */
-#define PART_DRAW_HEALTH       16
-#define PART_ABS_PATH_TIME  32
-#define PART_DRAW_COUNT_GR     64
-#define PART_DRAW_BB_LOCK      128     /* used with billboards */
-#define PART_DRAW_ROTATE_OB 128 /* used with dupliobjects/groups */
-#define PART_DRAW_PARENT       256
-#define PART_DRAW_NUM          512
-#define PART_DRAW_RAND_GR      1024
-#define PART_DRAW_REN_ADAPT    2048
-#define PART_DRAW_VEL_LENGTH   (1<<12)
-#define PART_DRAW_MAT_COL              (1<<13) /* deprecated, but used in do_versions */
-#define PART_DRAW_WHOLE_GR             (1<<14)
-#define PART_DRAW_REN_STRAND   (1<<15)
-#define PART_DRAW_NO_SCALE_OB  (1<<16) /* used with dupliobjects/groups */
+typedef enum eParticleKink {
+       PART_KINK_NO            = 0,
+       PART_KINK_CURL          = 1,
+       PART_KINK_RADIAL        = 2,
+       PART_KINK_WAVE          = 3,
+       PART_KINK_BRAID         = 4,
+       PART_KINK_SPIRAL        = 5,
+} eParticleKink;
+
+/* part->child_flag */
+typedef enum eParticleChildFlag {
+       PART_CHILD_USE_CLUMP_NOISE  = (1<<0),
+       PART_CHILD_USE_CLUMP_CURVE  = (1<<1),
+       PART_CHILD_USE_ROUGH_CURVE  = (1<<2),
+       PART_CHILD_USE_TWIST_CURVE  = (1<<3),
+} eParticleChildFlag;
 
 /* part->draw_col */
 #define PART_DRAW_COL_NONE             0
@@ -509,7 +539,7 @@ typedef struct ParticleSystem {
 #define PSYS_GLOBAL_HAIR       2
 #define PSYS_HAIR_DYNAMICS     4
 #define        PSYS_KEYED_TIMING       8
-#define PSYS_ENABLED           16      /* deprecated */
+//#define PSYS_ENABLED         16      /* deprecated */
 #define PSYS_HAIR_UPDATED      32  /* signal for updating hair particle mode */
 #define PSYS_DRAWING           64
 #define PSYS_USE_IMAT          128
@@ -538,7 +568,7 @@ typedef struct ParticleSystem {
 #define PART_DUPLIW_CURRENT    1
 
 /* psys->vg */
-#define PSYS_TOT_VG                    12
+#define PSYS_TOT_VG                    13
 
 #define PSYS_VG_DENSITY                0
 #define PSYS_VG_VEL                    1
@@ -552,6 +582,7 @@ typedef struct ParticleSystem {
 #define PSYS_VG_TAN                    9
 #define PSYS_VG_ROT                    10
 #define PSYS_VG_EFFECTOR       11
+#define PSYS_VG_TWIST  12
 
 /* ParticleTarget->flag */
 #define PTARGET_CURRENT                1
@@ -563,24 +594,28 @@ typedef struct ParticleSystem {
 #define PTARGET_MODE_ENEMY             2
 
 /* mapto */
-/* init */
-#define PAMAP_INIT             15
-#define PAMAP_TIME             (1<<0)  /* emission time */
-#define PAMAP_LIFE             (1<<1)  /* life time */
-#define PAMAP_DENS             (1<<2)  /* density */
-#define PAMAP_SIZE             (1<<3)  /* physical size */
-/* reset */
-#define PAMAP_IVEL             (1<<5)  /* initial velocity */
-/* physics */
-#define PAMAP_PHYSICS  3136
-#define PAMAP_FIELD            (1<<6)  /* force fields */
-#define PAMAP_GRAVITY  (1<<10)
-#define PAMAP_DAMP             (1<<11)
-/* children */
-#define PAMAP_CHILD            912
-#define PAMAP_CLUMP            (1<<7)
-#define PAMAP_KINK             (1<<8)
-#define PAMAP_ROUGH            (1<<9)
-#define PAMAP_LENGTH   (1<<4)
+typedef enum eParticleTextureInfluence {
+       /* init */
+       PAMAP_TIME              = (1<<0),       /* emission time */
+       PAMAP_LIFE              = (1<<1),       /* life time */
+       PAMAP_DENS              = (1<<2),       /* density */
+       PAMAP_SIZE              = (1<<3),       /* physical size */
+       PAMAP_INIT              = (PAMAP_TIME | PAMAP_LIFE | PAMAP_DENS | PAMAP_SIZE),
+       /* reset */
+       PAMAP_IVEL              = (1<<5),       /* initial velocity */
+       /* physics */
+       PAMAP_FIELD             = (1<<6),       /* force fields */
+       PAMAP_GRAVITY   = (1<<10),
+       PAMAP_DAMP              = (1<<11),
+       PAMAP_PHYSICS   = (PAMAP_FIELD | PAMAP_GRAVITY | PAMAP_DAMP),
+       /* children */
+       PAMAP_CLUMP             = (1<<7),
+       PAMAP_KINK_FREQ = (1<<8),
+       PAMAP_KINK_AMP  = (1<<12),
+       PAMAP_ROUGH             = (1<<9),
+       PAMAP_LENGTH    = (1<<4),
+       PAMAP_TWIST     = (1<<13),
+       PAMAP_CHILD             = (PAMAP_CLUMP | PAMAP_KINK_FREQ | PAMAP_KINK_AMP | PAMAP_ROUGH | PAMAP_LENGTH | PAMAP_TWIST),
+} eParticleTextureInfluence;
 
 #endif