46 #define PARTICLE_COLLISION_MAX_COLLISIONS 10
51 #define LOOP_PARTICLES for (p = 0, pa = psys->particles; p < psys->totpart; p++, pa++)
52 #define LOOP_EXISTING_PARTICLES \
53 for (p = 0, pa = psys->particles; p < psys->totpart; p++, pa++) \
54 if (!(pa->flag & PARS_UNEXIST))
55 #define LOOP_SHOWN_PARTICLES \
56 for (p = 0, pa = psys->particles; p < psys->totpart; p++, pa++) \
57 if (!(pa->flag & (PARS_UNEXIST | PARS_NO_DISP)))
59 #define LOOP_DYNAMIC_PARTICLES \
60 for (p = 0; p < psys->totpart; p++) \
61 if ((pa = psys->particles + p)->state.time > 0.0f)
64 #define PARTICLE_PSMD \
65 ParticleSystemModifierData *psmd = sim->psmd ? sim->psmd : psys_get_modifier(sim->ob, sim->psys)
101 void (*
density_cb)(
void *rangedata_v,
int index,
const float co[3],
float squared_dist);
239 #define PARTICLE_DRAW_DATA_UPDATED 1
241 #define PSYS_FRAND_COUNT 1024
279 bool use_render_params);
393 bool use_render_params);
397 bool use_render_params);
444 const float parent_orco[3]);
522 bool use_render_params);
560 float hairmat[4][4]);
565 float hairmat[4][4]);
570 float hairmat[4][4]);
587 const float (*vert_normals)[3],
590 const float (*orcodata)[3],
634 struct Mesh *mesh_final,
635 struct Mesh *mesh_original,
650 struct Mesh *mesh_original,
666 #define PSYS_RESET_ALL 1
667 #define PSYS_RESET_DEPSGRAPH 2
669 #define PSYS_RESET_CACHE_MISS 4
672 #define DMCACHE_NOTFOUND -1
673 #define DMCACHE_ISCHILD -2
void psys_get_particle_on_path(struct ParticleSimulationData *sim, int pa_num, struct ParticleKey *state, bool vel)
void BKE_particlesettings_fluid_default_settings(struct ParticleSettings *part)
void distribute_particles(struct ParticleSimulationData *sim, int from)
struct ParticleSystem * psys_eval_get(struct Depsgraph *depsgraph, struct Object *object, struct ParticleSystem *psys)
void psys_get_dupli_path_transform(struct ParticleSimulationData *sim, struct ParticleData *pa, struct ChildParticle *cpa, struct ParticleCacheKey *cache, float mat[4][4], float *scale)
void psys_get_from_key(struct ParticleKey *key, float loc[3], float vel[3], float rot[4], float *time)
bool do_guides(struct Depsgraph *depsgraph, struct ParticleSettings *part, struct ListBase *effectors, ParticleKey *state, int index, float time)
int psys_get_child_number(struct Scene *scene, struct ParticleSystem *psys, bool use_render_params)
void psys_thread_context_init(struct ParticleThreadContext *ctx, struct ParticleSimulationData *sim)
void psys_calc_dmcache(struct Object *ob, struct Mesh *mesh_final, struct Mesh *mesh_original, struct ParticleSystem *psys)
void psys_vec_rot_to_face(struct Mesh *mesh, struct ParticleData *pa, float vec[3])
void psys_get_dupli_texture(struct ParticleSystem *psys, struct ParticleSettings *part, struct ParticleSystemModifierData *psmd, struct ParticleData *pa, struct ChildParticle *cpa, float uv[2], float orco[3])
void psys_cache_paths(struct ParticleSimulationData *sim, float cfra, bool use_render_params)
float * psys_cache_vgroup(struct Mesh *mesh, struct ParticleSystem *psys, int vgroup)
void psys_tasks_free(struct ParticleTask *tasks, int numtasks)
void precalc_guides(struct ParticleSimulationData *sim, struct ListBase *effectors)
void psys_count_keyed_targets(struct ParticleSimulationData *sim)
void psys_mat_hair_to_orco(struct Object *ob, struct Mesh *mesh, short from, struct ParticleData *pa, float hairmat[4][4])
void psys_sph_finalize(struct SPHData *sphdata)
struct ParticleSystem * psys_get_target_system(struct Object *ob, struct ParticleTarget *pt)
float psys_get_current_display_percentage(struct ParticleSystem *psys, bool use_render_params)
void BKE_particlesettings_rough_curve_init(struct ParticleSettings *part)
void psys_apply_child_modifiers(struct ParticleThreadContext *ctx, struct ListBase *modifiers, struct ChildParticle *cpa, struct ParticleTexture *ptex, const float orco[3], float hairmat[4][4], struct ParticleCacheKey *keys, struct ParticleCacheKey *parent_keys, const float parent_orco[3])
void BKE_particle_system_blend_read_lib(struct BlendLibReader *reader, struct Object *ob, struct ID *id, struct ListBase *particles)
void psys_disable_all(struct Object *ob)
void psys_mat_hair_to_global(struct Object *ob, struct Mesh *mesh, short from, struct ParticleData *pa, float hairmat[4][4])
float PSYS_FRAND_BASE[PSYS_FRAND_COUNT]
void reset_particle(struct ParticleSimulationData *sim, struct ParticleData *pa, float dtime, float cfra)
bool psys_check_enabled(struct Object *ob, struct ParticleSystem *psys, bool use_render_params)
void psys_cache_edit_paths(struct Depsgraph *depsgraph, struct Scene *scene, struct Object *ob, struct PTCacheEdit *edit, float cfra, bool use_render_params)
bool psys_render_simplify_params(struct ParticleSystem *psys, struct ChildParticle *cpa, float *params)
void psys_get_pointcache_start_end(struct Scene *scene, ParticleSystem *psys, int *sfra, int *efra)
void psys_set_current_num(struct Object *ob, int index)
void psys_tasks_create(struct ParticleThreadContext *ctx, int startpart, int endpart, struct ParticleTask **r_tasks, int *r_numtasks)
struct ParticleSystem * psys_orig_get(struct ParticleSystem *psys)
struct ParticleSettings * BKE_particlesettings_add(struct Main *bmain, const char *name)
struct ParticleDrawData ParticleDrawData
bool psys_check_edited(struct ParticleSystem *psys)
void copy_particle_key(struct ParticleKey *to, struct ParticleKey *from, int time)
short psys_get_current_num(struct Object *ob)
void BKE_particlesettings_twist_curve_init(struct ParticleSettings *part)
struct ParticleThreadContext ParticleThreadContext
void psys_interpolate_uvs(const struct MTFace *tface, int quad, const float w[4], float uvco[2])
void psys_check_group_weights(struct ParticleSettings *part)
void(* BKE_particle_batch_cache_dirty_tag_cb)(struct ParticleSystem *psys, int mode)
struct ParticleCollisionElement ParticleCollisionElement
void BKE_particle_system_eval_init(struct Depsgraph *depsgraph, struct Object *object)
void psys_interpolate_particle(short type, struct ParticleKey keys[4], float dt, struct ParticleKey *result, bool velocity)
void psys_thread_context_free(struct ParticleThreadContext *ctx)
void psys_reset(struct ParticleSystem *psys, int mode)
void BKE_particlesettings_clump_curve_init(struct ParticleSettings *part)
void psys_mat_hair_to_object(struct Object *ob, struct Mesh *mesh, short from, struct ParticleData *pa, float hairmat[4][4])
bool psys_in_edit_mode(struct Depsgraph *depsgraph, const struct ParticleSystem *psys)
int psys_get_tot_child(struct Scene *scene, struct ParticleSystem *psys, bool use_render_params)
float psys_get_timestep(struct ParticleSimulationData *sim)
void BKE_psys_collision_neartest_cb(void *userdata, int index, const struct BVHTreeRay *ray, struct BVHTreeRayHit *hit)
void psys_particle_on_emitter(struct ParticleSystemModifierData *psmd, int from, int index, int index_dmcache, float fuv[4], float foffset, float vec[3], float nor[3], float utan[3], float vtan[3], float orco[3])
void BKE_particle_system_blend_read_data(struct BlendDataReader *reader, struct ListBase *particles)
void BKE_particle_partdeflect_blend_read_lib(struct BlendLibReader *reader, struct ID *id, struct PartDeflect *pd)
void psys_particle_on_dm(struct Mesh *mesh_final, int from, int index, int index_dmcache, const float fw[4], float foffset, float vec[3], float nor[3], float utan[3], float vtan[3], float orco[3])
float psys_get_dietime_from_cache(struct PointCache *cache, int index)
void BKE_particlesystem_reset_all(struct Object *object)
void psys_free_particles(struct ParticleSystem *psys)
void psys_unique_name(struct Object *object, struct ParticleSystem *psys, const char *defname)
unsigned int PSYS_FRAND_SEED_MULTIPLIER[PSYS_FRAND_COUNT]
float psys_get_child_time(struct ParticleSystem *psys, struct ChildParticle *cpa, float cfra, float *birthtime, float *dietime)
void psys_free_children(struct ParticleSystem *psys)
void free_keyed_keys(struct ParticleSystem *psys)
int psys_uses_gravity(struct ParticleSimulationData *sim)
void psys_enable_all(struct Object *ob)
void psys_emitter_customdata_mask(struct ParticleSystem *psys, struct CustomData_MeshMasks *r_cddata_masks)
float psys_particle_value_from_verts(struct Mesh *mesh, short from, struct ParticleData *pa, float *values)
int count_particles_mod(struct ParticleSystem *psys, int totgr, int cur)
struct ParticleSeam ParticleSeam
struct ParticleSystem * psys_get_current(struct Object *ob)
void psys_sph_density(struct BVHTree *tree, struct SPHData *data, float co[3], float vars[2])
void psys_sim_data_free(struct ParticleSimulationData *sim)
void psys_update_particle_tree(struct ParticleSystem *psys, float cfra)
void psys_check_boid_data(struct ParticleSystem *psys)
void psys_changed_type(struct Object *ob, struct ParticleSystem *psys)
struct ParticleTask ParticleTask
void object_remove_particle_system(struct Main *bmain, struct Scene *scene, struct Object *ob, struct ParticleSystem *psys)
void init_particle(struct ParticleSimulationData *sim, struct ParticleData *pa)
unsigned int PSYS_FRAND_SEED_OFFSET[PSYS_FRAND_COUNT]
void psys_make_temp_pointcache(struct Object *ob, struct ParticleSystem *psys)
void particle_system_update(struct Depsgraph *depsgraph, struct Scene *scene, struct Object *ob, struct ParticleSystem *psys, bool use_render_params)
void psys_sph_init(struct ParticleSimulationData *sim, struct SPHData *sphdata)
void BKE_particle_init_rng(void)
struct ParticleSystemModifierData * psys_get_modifier(struct Object *ob, struct ParticleSystem *psys)
void psys_free_path_cache(struct ParticleSystem *psys, struct PTCacheEdit *edit)
void psys_free_pdd(struct ParticleSystem *psys)
void psys_find_group_weights(struct ParticleSettings *part)
@ BKE_PARTICLE_BATCH_DIRTY_ALL
#define PARTICLE_COLLISION_MAX_COLLISIONS
int psys_particle_dm_face_lookup(struct Mesh *mesh_final, struct Mesh *mesh_original, int findex_orig, const float fw[4], struct LinkNode **poly_nodes)
int count_particles(struct ParticleSystem *psys)
float psys_get_child_size(struct ParticleSystem *psys, struct ChildParticle *cpa, float cfra, float *pa_time)
void psys_get_texture(struct ParticleSimulationData *sim, struct ParticleData *pa, struct ParticleTexture *ptex, int event, float cfra)
struct ModifierData * object_add_particle_system(struct Main *bmain, struct Scene *scene, struct Object *ob, const char *name)
void free_hair(struct Object *ob, struct ParticleSystem *psys, int dynamics)
void BKE_particle_batch_cache_dirty_tag(struct ParticleSystem *psys, int mode)
struct ParticleSimulationData ParticleSimulationData
void BKE_particle_partdeflect_blend_read_data(struct BlendDataReader *reader, struct PartDeflect *pd)
void BKE_particle_system_blend_write(struct BlendWriter *writer, struct ListBase *particles)
void psys_free(struct Object *ob, struct ParticleSystem *psys)
void BKE_particle_batch_cache_free(struct ParticleSystem *psys)
BLI_INLINE void psys_frand_vec(ParticleSystem *psys, unsigned int seed, float vec[3])
void psys_apply_hair_lattice(struct Depsgraph *depsgraph, struct Scene *scene, struct Object *ob, struct ParticleSystem *psys)
void psys_interpolate_mcol(const struct MCol *mcol, int quad, const float w[4], struct MCol *mc)
struct ParticleCollision ParticleCollision
void BKE_particle_settings_eval_reset(struct Depsgraph *depsgraph, struct ParticleSettings *particle_settings)
void(* ParticleSystemIDFunc)(struct ParticleSystem *psys, struct ID **idpoin, void *userdata, int cb_flag)
void psys_find_parents(struct ParticleSimulationData *sim, bool use_render_params)
struct ParticleTexture ParticleTexture
void psys_cache_child_paths(struct ParticleSimulationData *sim, float cfra, bool editupdate, bool use_render_params)
struct ParticleCacheKey ParticleCacheKey
void BKE_particlesystem_id_loop(struct ParticleSystem *psys, ParticleSystemIDFunc func, void *userdata)
void psys_interpolate_face(struct Mesh *mesh, struct MVert *mvert, const float(*vert_normals)[3], struct MFace *mface, struct MTFace *tface, const float(*orcodata)[3], float w[4], float vec[3], float nor[3], float utan[3], float vtan[3], float orco[3])
void psys_sim_data_init(struct ParticleSimulationData *sim)
void psys_copy_particles(struct ParticleSystem *psys_dst, struct ParticleSystem *psys_src)
struct ModifierData * object_copy_particle_system(struct Main *bmain, struct Scene *scene, struct Object *ob, const struct ParticleSystem *psys_orig)
BLI_INLINE float psys_frand(ParticleSystem *psys, unsigned int seed)
void psys_get_birth_coords(struct ParticleSimulationData *sim, struct ParticleData *pa, struct ParticleKey *state, float dtime, float cfra)
void(* BKE_particle_batch_cache_free_cb)(struct ParticleSystem *psys)
bool psys_get_particle_state(struct ParticleSimulationData *sim, int p, struct ParticleKey *state, bool always)
struct Depsgraph Depsgraph
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
static unsigned long seed
const Depsgraph * depsgraph
SyclQueue void void size_t num_bytes void
ccl_gpu_kernel_postfix ccl_global float int int int int float bool int offset
float original_ray_length
ParticleCollisionElement pce
struct CollisionModifierData * md
struct Object * skip[PARTICLE_COLLISION_MAX_COLLISIONS+1]
struct Depsgraph * depsgraph
struct ParticleSystemModifierData * psmd
struct ParticleSystem * psys
struct ListBase * colliders
struct ParticleSystem * psys
struct PTCacheEdit * edit
ParticleThreadContext * ctx
struct ParticleData * tpars
struct CurveMapping * roughcurve
struct CurveMapping * twistcurve
struct CurveMapping * clumpcurve
struct ParticleSeam * seams
struct ParticleSimulationData sim
void(* force_cb)(void *sphdata_v, ParticleKey *state, float *force, float *impulse)
ParticleSystem * psys[10]
void(* density_cb)(void *rangedata_v, int index, const float co[3], float squared_dist)