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:
Diffstat (limited to 'source/blender/blenkernel/BKE_particle.h')
-rw-r--r--source/blender/blenkernel/BKE_particle.h41
1 files changed, 40 insertions, 1 deletions
diff --git a/source/blender/blenkernel/BKE_particle.h b/source/blender/blenkernel/BKE_particle.h
index e03789f502b..f8ddb33b0ba 100644
--- a/source/blender/blenkernel/BKE_particle.h
+++ b/source/blender/blenkernel/BKE_particle.h
@@ -63,6 +63,14 @@ struct BVHTreeRay;
struct BVHTreeRayHit;
struct EdgeHash;
+/* XXX disabled for now due to stability issues and limited usefulness */
+//#define USE_PARTICLE_PREVIEW
+/* XXX disabled because this requires sorting of children,
+ * but during render children are constantly recreated based on the deformed mesh,
+ * which leads to different indices every time and therefore different randomization values.
+ */
+//#define USE_PARTICLE_HULL_DRAWING
+
#define PARTICLE_P ParticleData * pa; int p
#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))
@@ -110,6 +118,7 @@ typedef struct ParticleTexture {
float damp, gravity, field; /* used in physics */
float length, clump, kink_freq, kink_amp, effector; /* used in path caching */
float rough1, rough2, roughe; /* used in path caching */
+ float color[3];
} ParticleTexture;
typedef struct ParticleSeam {
@@ -124,7 +133,7 @@ typedef struct ParticleCacheKey {
float rot[4];
float col[3];
float time;
- int segments;
+ int segments, hull_parent;
} ParticleCacheKey;
typedef struct ParticleThreadContext {
@@ -242,6 +251,25 @@ typedef struct ParticleDrawData {
int totpoint, totve;
} ParticleDrawData;
+typedef struct ParticleInterpolationData {
+ struct HairKey *hkey[2];
+
+ struct DerivedMesh *dm;
+ struct MVert *mvert[2];
+
+ int keyed;
+ struct ParticleKey *kkey[2];
+
+ struct PointCache *cache;
+ struct PTCacheMem *pm;
+
+ struct PTCacheEditPoint *epoint;
+ struct PTCacheEditKey *ekey[2];
+
+ float birthtime, dietime;
+ int bspline;
+} ParticleInterpolationData;
+
#define PARTICLE_DRAW_DATA_UPDATED 1
#define PSYS_FRAND_COUNT 1024
@@ -296,6 +324,8 @@ bool psys_check_edited(struct ParticleSystem *psys);
void psys_check_group_weights(struct ParticleSettings *part);
int psys_uses_gravity(struct ParticleSimulationData *sim);
+struct KeyBlock *BKE_psys_insert_shape_key(struct Scene *scene, struct Object *ob, struct ParticleSystem *psys, const char *name, const bool from_mix);
+
/* free */
void BKE_particlesettings_free(struct ParticleSettings *part);
void psys_free_path_cache(struct ParticleSystem *psys, struct PTCacheEdit *edit);
@@ -324,6 +354,7 @@ void BKE_particlesettings_make_local(struct ParticleSettings *part);
void psys_reset(struct ParticleSystem *psys, int mode);
+bool psys_hair_update_preview(struct ParticleSimulationData *sim);
void psys_find_parents(struct ParticleSimulationData *sim);
void psys_cache_paths(struct ParticleSimulationData *sim, float cfra);
@@ -337,6 +368,10 @@ float psys_get_child_size(struct ParticleSystem *psys, struct ChildParticle *cpa
void psys_get_particle_on_path(struct ParticleSimulationData *sim, int pa_num, struct ParticleKey *state, const bool vel);
int psys_get_particle_state(struct ParticleSimulationData *sim, int p, struct ParticleKey *state, int always);
+/* interpolation */
+void init_particle_interpolation(struct Object *ob, struct ParticleSystem *psys, struct ParticleData *pa, struct ParticleInterpolationData *pind);
+void do_particle_interpolation(struct ParticleSystem *psys, int p, struct ParticleData *pa, float t, struct ParticleInterpolationData *pind, struct ParticleKey *result);
+
/* child paths */
void BKE_particlesettings_clump_curve_init(struct ParticleSettings *part);
void BKE_particlesettings_rough_curve_init(struct ParticleSettings *part);
@@ -393,18 +428,22 @@ void psys_vec_rot_to_face(struct DerivedMesh *dm, struct ParticleData *pa, float
void psys_mat_hair_to_object(struct Object *ob, struct DerivedMesh *dm, short from, struct ParticleData *pa, float hairmat[4][4]);
void psys_mat_hair_to_global(struct Object *ob, struct DerivedMesh *dm, short from, struct ParticleData *pa, float hairmat[4][4]);
void psys_mat_hair_to_orco(struct Object *ob, struct DerivedMesh *dm, short from, struct ParticleData *pa, float hairmat[4][4]);
+void psys_child_mat_to_object(struct Object *ob, struct ParticleSystem *psys, struct ParticleSystemModifierData *psmd, struct ChildParticle *cpa, float hairmat[4][4]);
float psys_get_dietime_from_cache(struct PointCache *cache, int index);
void psys_free_pdd(struct ParticleSystem *psys);
float *psys_cache_vgroup(struct DerivedMesh *dm, struct ParticleSystem *psys, int vgroup);
+bool particle_mtex_eval(struct ParticleSimulationData *sim, MTex *mtex, ParticleData *pa, float cfra, float *value, float rgba[4]);
void psys_get_texture(struct ParticleSimulationData *sim, struct ParticleData *pa, struct ParticleTexture *ptex, int event, float cfra);
+float psys_get_texture_shapefac(struct ParticleSimulationData *sim, struct ParticleData *pa, float cfra, const char *shapekey);
void psys_interpolate_face(struct MVert *mvert, struct MFace *mface, struct MTFace *tface,
float (*orcodata)[3], float w[4], float vec[3], float nor[3], float utan[3], float vtan[3],
float orco[3], float ornor[3]);
float psys_particle_value_from_verts(struct DerivedMesh *dm, short from, struct ParticleData *pa, float *values);
void psys_get_from_key(struct ParticleKey *key, float loc[3], float vel[3], float rot[4], float *time);
+int psys_get_index_on_dm(struct ParticleSystem *psys, struct DerivedMesh *dm, ParticleData *pa, int *mapindex, float mapfw[4]);
/* BLI_bvhtree_ray_cast callback */
void BKE_psys_collision_neartest_cb(void *userdata, int index, const struct BVHTreeRay *ray, struct BVHTreeRayHit *hit);