Blender V5.3
BKE_particle.h
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2007 Janne Karhu. All rights reserved.
2 * SPDX-FileCopyrightText: 2011-2012 AutoCRC (adaptive time step, Classical SPH).
3 *
4 * SPDX-License-Identifier: GPL-2.0-or-later */
5
6#pragma once
7
11
12#include <optional>
13
14#include "BLI_compiler_attrs.hh"
15#include "BLI_map.hh"
16#include "BLI_ordered_edge.hh"
17#include "BLI_vector.hh"
18
19#include "BKE_lib_query.hh" /* For LibraryForeachIDCallbackFlag. */
20
21#include "DNA_particle_types.h"
22
23namespace blender {
24
25struct ParticleKey;
26struct ParticleSettings;
27struct ParticleSystem;
29struct ColliderCache;
30struct EffectorCache;
31
32struct BVHTreeRay;
33struct BVHTreeRayHit;
34struct BlendDataReader;
35struct BlendLibReader;
36struct BlendWriter;
38struct Depsgraph;
39struct LinkNode;
40struct MCol;
41struct MFace;
42struct MTFace;
43struct Main;
44struct ModifierData;
45struct Object;
46struct ReportList;
47struct RNG;
48struct Scene;
49
50#define PARTICLE_COLLISION_MAX_COLLISIONS 10
51
52#define PARTICLE_P \
53 ParticleData *pa; \
54 int p
55#define LOOP_PARTICLES for (p = 0, pa = psys->particles; p < psys->totpart; p++, pa++)
56#define LOOP_EXISTING_PARTICLES \
57 for (p = 0, pa = psys->particles; p < psys->totpart; p++, pa++) \
58 if (!(pa->flag & PARS_UNEXIST))
59#define LOOP_SHOWN_PARTICLES \
60 for (p = 0, pa = psys->particles; p < psys->totpart; p++, pa++) \
61 if (!(pa->flag & (PARS_UNEXIST | PARS_NO_DISP)))
62#define LOOP_DYNAMIC_PARTICLES \
63 for (p = 0; p < psys->totpart; p++) \
64 if ((pa = psys->particles + p)->state.time > 0.0f)
65
66/* Fast but sure way to get the modifier. */
67#define PARTICLE_PSMD \
68 ParticleSystemModifierData *psmd = sim->psmd ? sim->psmd : psys_get_modifier(sim->ob, sim->psys)
69
70/* common stuff that many particle functions need */
72 struct Depsgraph *depsgraph;
73 struct Scene *scene;
74 struct Object *ob;
77 ListBaseT<ColliderCache> *colliders;
78 /* Courant number. This is used to implement an adaptive time step. Only the
79 * maximum value per time step is important. Only sph_integrate makes use of
80 * this at the moment. Other solvers could, too. */
82 /* Only valid during dynamics_step(). */
83 struct RNG *rng;
84};
85
86struct SPHData {
89 float mass;
91
93 const float *gravity;
94
95 float hfac;
96 /* Average distance to neighbors (other particles in the support domain),
97 * for calculating the Courant number (adaptive time step). */
98 int pass;
100 float flow[3];
101
102 /* Temporary thread-local buffer for springs created during this step. */
104
105 /* Integrator callbacks. This allows different SPH implementations. */
106 void (*force_cb)(void *sphdata_v, ParticleKey *state, float *force, float *impulse);
107 void (*density_cb)(void *rangedata_v, int index, const float co[3], float squared_dist);
108};
109
111 float ivel; /* used in reset */
112 float time, life, exist, size; /* used in init */
113 float damp, gravity, field; /* used in physics */
114 float length, clump, kink_freq, kink_amp, effector; /* used in path caching */
115 float rough1, rough2, roughe; /* used in path caching */
116 float twist; /* used in path caching */
117};
118
120 float v0[3], v1[3];
121 float nor[3], dir[3], tan[3];
122 float length2;
123};
124
126 float co[3];
127 float vel[3];
128 float rot[4];
129 float col[3];
130 float time;
132};
133
135 /* shared */
137 struct Mesh *mesh;
138 struct Material *ma;
139
140 /* distribution */
142
145
146 float *jit, *jitoff, *weight;
149
151
153
154 /* path caching */
158
159 float cfra;
160
164 float *vg_twist;
165
169};
170
173 struct RNG *rng = nullptr, *rng_path = nullptr;
174 int begin = 0, end = 0;
175};
176
178 /* pointers to original data */
179 float *x[3], *v[3];
180
181 /* Values interpolated from original data. */
182 float x0[3], x1[3], x2[3], p[3];
183
184 /* results for found intersection point */
185 float nor[3], vel[3], uv[2];
186
187 /* count of original data (1-4) */
188 int tot;
189
190 /* index of the collision face */
191 int index;
192
193 /* flags for inversed normal / particle already inside element at start */
195};
196
200 struct Object *hit;
203
206
208 float f;
209 float fac1, fac2;
210
212
215
217
219
226
227 float radius;
228 float co1[3], co2[3];
229 float ve1[3], ve2[3];
230
231 float acc[3], boid_z;
232
233 int boid;
234};
235
237 float *vdata, *vd; /* vertex data */
238 float *ndata, *nd; /* normal data */
239 float *cdata, *cd; /* color data */
240 float *vedata, *ved; /* velocity data */
241 float *ma_col;
243 int flag;
245};
246
247#define PARTICLE_DRAW_DATA_UPDATED 1
248
249#define PSYS_FRAND_COUNT 1024
250extern unsigned int PSYS_FRAND_SEED_OFFSET[PSYS_FRAND_COUNT];
253
255
256BLI_INLINE float psys_frand(ParticleSystem *psys, unsigned int seed)
257{
258 /* XXX far from ideal, this simply scrambles particle random numbers a bit
259 * to avoid obvious correlations.
260 * Can't use previous psys->frand arrays because these require initialization
261 * inside psys_check_enabled, which wreaks havoc in multi-threaded depsgraph updates.
262 */
263 unsigned int offset = PSYS_FRAND_SEED_OFFSET[psys->seed % PSYS_FRAND_COUNT];
264 unsigned int multiplier = PSYS_FRAND_SEED_MULTIPLIER[psys->seed % PSYS_FRAND_COUNT];
265 return PSYS_FRAND_BASE[(offset + seed * multiplier) % PSYS_FRAND_COUNT];
266}
267
268BLI_INLINE void psys_frand_vec(ParticleSystem *psys, unsigned int seed, float vec[3])
269{
270 unsigned int offset = PSYS_FRAND_SEED_OFFSET[psys->seed % PSYS_FRAND_COUNT];
271 unsigned int multiplier = PSYS_FRAND_SEED_MULTIPLIER[psys->seed % PSYS_FRAND_COUNT];
272 vec[0] = PSYS_FRAND_BASE[(offset + (seed + 0) * multiplier) % PSYS_FRAND_COUNT];
273 vec[1] = PSYS_FRAND_BASE[(offset + (seed + 1) * multiplier) % PSYS_FRAND_COUNT];
274 vec[2] = PSYS_FRAND_BASE[(offset + (seed + 2) * multiplier) % PSYS_FRAND_COUNT];
275}
276
277/* ----------- functions needed outside particlesystem ---------------- */
278/* particle.cc */
279
280/* Few helpers for count-all etc. */
281
282int count_particles(struct ParticleSystem *psys);
283int count_particles_mod(struct ParticleSystem *psys, int totgr, int cur);
284
285int psys_get_child_number(struct Scene *scene,
286 struct ParticleSystem *psys,
287 bool use_render_params);
288int psys_get_tot_child(struct Scene *scene, struct ParticleSystem *psys, bool use_render_params);
289
293struct ParticleSystem *psys_get_current(struct Object *ob);
294
295/* For RNA API. */
296
297short psys_get_current_num(struct Object *ob);
298void psys_set_current_num(struct Object *ob, int index);
299/* UNUSED */
300// struct Object *psys_find_object(struct Scene *scene, struct ParticleSystem *psys);
301
305void psys_sim_data_init(struct ParticleSimulationData *sim);
306void psys_sim_data_free(struct ParticleSimulationData *sim);
307
313struct ParticleSystem *psys_orig_get(struct ParticleSystem *psys);
314
319struct ParticleSystem *psys_eval_get(struct Depsgraph *depsgraph,
320 struct Object *object,
321 struct ParticleSystem *psys);
322
323bool psys_in_edit_mode(struct Depsgraph *depsgraph, const struct ParticleSystem *psys);
324bool psys_check_enabled(struct Object *ob, struct ParticleSystem *psys, bool use_render_params);
325bool psys_check_edited(struct ParticleSystem *psys);
326
331
335void psys_free_path_cache(struct ParticleSystem *psys, struct PTCacheEdit *edit);
339void psys_free(struct Object *ob, struct ParticleSystem *psys);
343void psys_copy_particles(struct ParticleSystem *psys_dst, struct ParticleSystem *psys_src);
344
346 struct ChildParticle *cpa,
347 float *params);
348
349void psys_interpolate_uvs(const struct MTFace *tface, int quad, const float w[4], float r_uv[2]);
350void psys_interpolate_mcol(const struct MCol *mcol, int quad, const float w[4], struct MCol *mc);
351
352void copy_particle_key(struct ParticleKey *to, struct ParticleKey *from, int time);
353
355 struct CustomData_MeshMasks *r_cddata_masks);
357 int from,
358 int index,
359 int index_dmcache,
360 float fuv[4],
361 float foffset,
362 float vec[3],
363 float nor[3],
364 float utan[3],
365 float vtan[3],
366 float orco[3]);
368 struct ParticleSystem *psys);
369
371 const struct Scene *scene,
372 struct Object *ob,
373 const char *name);
375 const struct Scene *scene,
376 struct Object *ob,
377 const struct ParticleSystem *psys_orig);
378void object_remove_particle_system(struct Main *bmain,
379 struct Scene *scene,
380 struct Object *ob,
381 struct ParticleSystem *psys);
382struct ParticleSettings *BKE_particlesettings_add(struct Main *bmain, const char *name);
383void psys_reset(struct ParticleSystem *psys, int mode);
384
385void psys_find_parents(struct ParticleSimulationData *sim, bool use_render_params);
386
387void psys_unique_name(struct Object *object, struct ParticleSystem *psys, const char *defname)
388 ATTR_NONNULL(1, 2, 3);
389
396void psys_cache_paths(struct ParticleSimulationData *sim, float cfra, bool use_render_params);
397void psys_cache_edit_paths(struct Depsgraph *depsgraph,
398 struct Scene *scene,
399 struct Object *ob,
400 struct PTCacheEdit *edit,
401 float cfra,
402 bool use_render_params);
404 float cfra,
405 bool editupdate,
406 bool use_render_params);
407bool do_guides(struct Depsgraph *depsgraph,
408 struct ParticleSettings *part,
409 ListBaseT<EffectorCache> *effectors,
411 int index,
412 float time);
413void precalc_guides(struct ParticleSimulationData *sim, ListBaseT<EffectorCache> *effectors);
415float psys_get_child_time(struct ParticleSystem *psys,
416 struct ChildParticle *cpa,
417 float cfra,
418 float *birthtime,
419 float *dietime);
420float psys_get_child_size(struct ParticleSystem *psys,
421 struct ChildParticle *cpa,
422 float cfra,
423 float *pa_time);
428 int pa_num,
429 struct ParticleKey *state,
430 bool vel);
436 int p,
437 struct ParticleKey *state,
438 bool always);
439
440/* Child paths. */
441
446 ListBaseT<ModifierData> *modifiers,
447 struct ChildParticle *cpa,
448 struct ParticleTexture *ptex,
449 const float orco[3],
450 float hairmat[4][4],
451 struct ParticleCacheKey *keys,
452 struct ParticleCacheKey *parent_keys,
453 const float parent_orco[3]);
454
455void psys_sph_finalize(struct SPHData *sphdata);
459void psys_sph_density(struct BVHTree *tree, struct SPHData *data, float co[3], float vars[2]);
460
461/* For anim.c */
462
463void psys_get_dupli_texture(struct ParticleSystem *psys,
464 struct ParticleSettings *part,
465 struct ParticleSystemModifierData *psmd,
466 struct ParticleData *pa,
467 struct ChildParticle *cpa,
468 float uv[2],
469 float orco[3]);
471 struct ParticleData *pa,
472 struct ChildParticle *cpa,
473 struct ParticleCacheKey *cache,
474 float mat[4][4],
475 float *scale);
476
481 struct ParticleSimulationData *sim);
484 int startpart,
485 int endpart);
487
488void psys_apply_hair_lattice(struct Depsgraph *depsgraph,
489 struct Scene *scene,
490 struct Object *ob,
491 struct ParticleSystem *psys);
492
493/* `particle_system.cc` */
494
495struct ParticleSystem *psys_get_target_system(struct Object *ob, struct ParticleTarget *pt);
500void psys_update_particle_tree(struct ParticleSystem *psys, float cfra);
504void psys_changed_type(struct Object *ob, struct ParticleSystem *psys);
505
506void psys_make_temp_pointcache(struct Object *ob, struct ParticleSystem *psys);
507void psys_get_pointcache_start_end(struct Scene *scene,
508 ParticleSystem *psys,
509 int *sfra,
510 int *efra);
511
512void psys_check_boid_data(struct ParticleSystem *psys);
513
515 struct ParticleData *pa,
516 struct ParticleKey *state,
517 float dtime,
518 float cfra);
519
524void particle_system_update(struct Depsgraph *depsgraph,
525 struct Scene *scene,
526 struct Object *ob,
527 struct ParticleSystem *psys,
528 bool use_render_params);
529
533typedef void (*ParticleSystemIDFunc)(struct ParticleSystem *psys,
534 struct ID **idpoin,
535 void *userdata,
537
540 void *userdata);
541
545void BKE_particlesystem_reset_all(struct Object *object);
546
547/* ----------- functions needed only inside particlesystem ------------ */
548
549/* particle.cc */
550
551void psys_disable_all(struct Object *ob);
552void psys_enable_all(struct Object *ob);
553
554void free_hair(struct Object *ob, struct ParticleSystem *psys, int dynamics);
555void free_keyed_keys(struct ParticleSystem *psys);
556void psys_free_particles(struct ParticleSystem *psys);
557void psys_free_children(struct ParticleSystem *psys);
558
560 short type, struct ParticleKey keys[4], float dt, struct ParticleKey *result, bool velocity);
561void psys_vec_rot_to_face(struct Mesh *mesh, struct ParticleData *pa, float vec[3]);
562void psys_mat_hair_to_object(struct Object *ob,
563 struct Mesh *mesh,
564 short from,
565 struct ParticleData *pa,
566 float hairmat[4][4]);
567void psys_mat_hair_to_global(struct Object *ob,
568 struct Mesh *mesh,
569 short from,
570 struct ParticleData *pa,
571 float hairmat[4][4]);
572void psys_mat_hair_to_orco(struct Object *ob,
573 struct Mesh *mesh,
574 short from,
575 struct ParticleData *pa,
576 float hairmat[4][4]);
577
578float psys_get_dietime_from_cache(struct PointCache *cache, int index);
579
580void psys_free_pdd(struct ParticleSystem *psys);
581
582float *psys_cache_vgroup(struct Mesh *mesh, struct ParticleSystem *psys, int vgroup);
584 struct ParticleData *pa,
585 struct ParticleTexture *ptex,
586 int event,
587 float cfra);
592 const float (*vert_positions)[3],
593 const float (*vert_normals)[3],
594 const struct MFace *mface,
595 struct MTFace *tface,
596 const float (*orcodata)[3],
597 float w[4],
598 float vec[3],
599 float nor[3],
600 float utan[3],
601 float vtan[3],
602 float orco[3]);
604 short from,
605 struct ParticleData *pa,
606 float *values);
608 struct ParticleKey *key, float loc[3], float vel[3], float rot[4], float *time);
609
614 int index,
615 const struct BVHTreeRay *ray,
616 struct BVHTreeRayHit *hit);
620void psys_particle_on_dm(struct Mesh *mesh_final,
621 int from,
622 int index,
623 int index_dmcache,
624 const float fw[4],
625 float foffset,
626 float vec[3],
627 float nor[3],
628 float utan[3],
629 float vtan[3],
630 float orco[3]);
631
632/* `particle_system.cc` */
633
634void distribute_particles(struct ParticleSimulationData *sim, int from);
638void init_particle(struct ParticleSimulationData *sim, struct ParticleData *pa);
639void psys_calc_dmcache(struct Object *ob,
640 struct Mesh *mesh_final,
641 struct Mesh *mesh_original,
642 struct ParticleSystem *psys);
655int psys_particle_dm_face_lookup(struct Mesh *mesh_final,
656 struct Mesh *mesh_original,
657 int findex_orig,
658 const float fw[4],
659 struct LinkNode **poly_nodes);
660
665 struct ParticleData *pa,
666 float dtime,
667 float cfra);
668
669float psys_get_current_display_percentage(struct ParticleSystem *psys, bool use_render_params);
670
671void BKE_particle_co_hair(const ParticleSystem *particlesystem,
672 const Object *object,
673 int particle_no,
674 int step,
675 float n_co[3]);
676
677void BKE_particle_uv_on_emitter(ParticleSystem *particlesystem,
678 ReportList *reports,
680 ParticleData *particle,
681 int particle_no,
682 int uv_no,
683 float r_uv[2]);
684
686 ReportList *reports,
688 ParticleData *particle,
689 int particle_no,
690 int vcol_no,
691 float r_mcol[3]);
692
693/* psys_reset */
694#define PSYS_RESET_ALL 1
695#define PSYS_RESET_DEPSGRAPH 2
696// #define PSYS_RESET_CHILDREN 3 /*UNUSED*/
697#define PSYS_RESET_CACHE_MISS 4
698
699/* index_dmcache */
700#define DMCACHE_NOTFOUND -1
701#define DMCACHE_ISCHILD -2
702
703/* **** Depsgraph evaluation **** */
704
705void BKE_particle_settings_eval_reset(struct Depsgraph *depsgraph,
706 struct ParticleSettings *particle_settings);
707
708void BKE_particle_system_eval_init(struct Depsgraph *depsgraph, struct Object *object);
709
710/* Draw Cache */
711enum {
713};
714void BKE_particle_batch_cache_dirty_tag(struct ParticleSystem *psys, int mode);
716
717extern void (*BKE_particle_batch_cache_dirty_tag_cb)(struct ParticleSystem *psys, int mode);
718extern void (*BKE_particle_batch_cache_free_cb)(struct ParticleSystem *psys);
719
720/* .blend file I/O */
721
722void BKE_particle_partdeflect_blend_read_data(struct BlendDataReader *reader,
723 struct PartDeflect *pd);
724void BKE_particle_system_blend_write(struct BlendWriter *writer,
725 ListBaseT<ParticleSystem> *particles);
726void BKE_particle_system_blend_read_data(struct BlendDataReader *reader,
727 ListBaseT<ParticleSystem> *particles);
728void BKE_particle_system_blend_read_after_liblink(struct BlendLibReader *reader,
729 struct Object *ob,
730 struct ID *id,
731 ListBaseT<ParticleSystem> *particles);
732
733} // namespace blender
#define PSYS_FRAND_COUNT
#define PARTICLE_COLLISION_MAX_COLLISIONS
#define BLI_INLINE
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
Definition btQuadWord.h:119
Definition scene.h:133
#define rot(x, k)
#define index(i)
VecBase< float, D > step(VecOp< float, D >, VecOp< float, D >) RET
float3x3 scale(float3x3 mat, float2 scale)
const int state
BMesh Iterators.
void psys_free_path_cache(struct ParticleSystem *psys, struct PTCacheEdit *edit)
Definition particle.cc:938
void BKE_particle_system_eval_init(struct Depsgraph *depsgraph, struct Object *object)
void(*) ParticleSystemIDFunc(struct ParticleSystem *psys, struct ID **idpoin, void *userdata, LibraryForeachIDCallbackFlag cb_flag)
struct ModifierData * object_add_particle_system(struct Main *bmain, const struct Scene *scene, struct Object *ob, const char *name)
void object_remove_particle_system(struct Main *bmain, struct Scene *scene, struct Object *ob, struct ParticleSystem *psys)
Definition particle.cc:4031
float psys_get_current_display_percentage(struct ParticleSystem *psys, bool use_render_params)
void BKE_particle_batch_cache_dirty_tag(struct ParticleSystem *psys, int mode)
Definition particle.cc:5580
struct ParticleSystem * psys_get_target_system(struct Object *ob, struct ParticleTarget *pt)
void psys_sph_finalize(struct SPHData *sphdata)
Vector< ParticleTask > psys_tasks_create(struct ParticleThreadContext *ctx, int startpart, int endpart)
struct ParticleSystem * psys_get_current(struct Object *ob)
Definition particle.cc:571
void psys_sim_data_init(struct ParticleSimulationData *sim)
Definition particle.cc:621
void psys_get_birth_coords(struct ParticleSimulationData *sim, struct ParticleData *pa, struct ParticleKey *state, float dtime, float cfra)
void BKE_particle_mcol_on_emitter(ParticleSystem *particlesystem, ReportList *reports, ParticleSystemModifierData *modifier, ParticleData *particle, int particle_no, int vcol_no, float r_mcol[3])
Definition particle.cc:5536
float * psys_cache_vgroup(struct Mesh *mesh, struct ParticleSystem *psys, int vgroup)
Definition particle.cc:2621
void void psys_cache_paths(struct ParticleSimulationData *sim, float cfra, bool use_render_params)
Definition particle.cc:3291
void psys_find_parents(struct ParticleSimulationData *sim, bool use_render_params)
Definition particle.cc:2647
void reset_particle(struct ParticleSimulationData *sim, struct ParticleData *pa, float dtime, float cfra)
void psys_thread_context_init(struct ParticleThreadContext *ctx, struct ParticleSimulationData *sim)
struct ModifierData * object_copy_particle_system(struct Main *bmain, const struct Scene *scene, struct Object *ob, const struct ParticleSystem *psys_orig)
void BKE_particlesystem_id_loop(struct ParticleSystem *psys, ParticleSystemIDFunc func, void *userdata)
void BKE_particle_partdeflect_blend_read_data(struct BlendDataReader *reader, struct PartDeflect *pd)
Definition particle.cc:315
struct ParticleSystem * psys_orig_get(struct ParticleSystem *psys)
Definition particle.cc:689
void psys_interpolate_face(struct Mesh *mesh, const float(*vert_positions)[3], const float(*vert_normals)[3], const 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_get_dupli_path_transform(struct ParticleSimulationData *sim, struct ParticleData *pa, struct ChildParticle *cpa, struct ParticleCacheKey *cache, float mat[4][4], float *scale)
Definition particle.cc:5203
void psys_apply_child_modifiers(struct ParticleThreadContext *ctx, ListBaseT< ModifierData > *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])
struct ParticleSystemModifierData * psys_get_modifier(struct Object *ob, struct ParticleSystem *psys)
Definition particle.cc:2190
void psys_free_particles(struct ParticleSystem *psys)
Definition particle.cc:963
struct ParticleSettings * BKE_particlesettings_add(struct Main *bmain, const char *name)
Definition particle.cc:4135
float psys_get_timestep(struct ParticleSimulationData *sim)
Definition particle.cc:4518
void init_particle(struct ParticleSimulationData *sim, struct ParticleData *pa)
void BKE_particlesettings_twist_curve_init(struct ParticleSettings *part)
Definition particle.cc:4172
void BKE_particle_system_blend_write(struct BlendWriter *writer, ListBaseT< ParticleSystem > *particles)
Definition particle.cc:5593
KDTree< VecBase< float, 3 > > KDTree3d
void psys_get_particle_on_path(struct ParticleSimulationData *sim, int pa_num, struct ParticleKey *state, bool vel)
Definition particle.cc:4643
void psys_count_keyed_targets(struct ParticleSimulationData *sim)
void BKE_particle_co_hair(const ParticleSystem *particlesystem, const Object *object, int particle_no, int step, float n_co[3])
Definition particle.cc:5319
bool psys_in_edit_mode(struct Depsgraph *depsgraph, const struct ParticleSystem *psys)
float PSYS_FRAND_BASE[PSYS_FRAND_COUNT]
Definition particle.cc:447
void(*) BKE_particle_batch_cache_dirty_tag_cb(struct ParticleSystem *psys, int mode)
Definition particle.cc:5577
float psys_get_child_size(struct ParticleSystem *psys, struct ChildParticle *cpa, float cfra, float *pa_time)
Definition particle.cc:4554
void(*) BKE_particle_batch_cache_free_cb(struct ParticleSystem *psys)
Definition particle.cc:5578
unsigned int PSYS_FRAND_SEED_MULTIPLIER[PSYS_FRAND_COUNT]
Definition particle.cc:446
bool psys_get_particle_state(struct ParticleSimulationData *sim, int p, struct ParticleKey *state, bool always)
Definition particle.cc:4930
void BKE_particle_settings_eval_reset(struct Depsgraph *depsgraph, struct ParticleSettings *particle_settings)
void precalc_guides(struct ParticleSimulationData *sim, ListBaseT< EffectorCache > *effectors)
Definition particle.cc:2323
BMesh const char void * data
void free_hair(struct Object *ob, struct ParticleSystem *psys, int dynamics)
Definition particle.cc:877
void psys_emitter_customdata_mask(struct ParticleSystem *psys, struct CustomData_MeshMasks *r_cddata_masks)
Definition particle.cc:2246
void psys_make_temp_pointcache(struct Object *ob, struct ParticleSystem *psys)
void BKE_particle_system_blend_read_after_liblink(struct BlendLibReader *reader, struct Object *ob, struct ID *id, ListBaseT< ParticleSystem > *particles)
Definition particle.cc:5728
void psys_free(struct Object *ob, struct ParticleSystem *psys)
Definition particle.cc:1009
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])
Definition particle.cc:2056
bool psys_render_simplify_params(struct ParticleSystem *psys, struct ChildParticle *cpa, float *params)
void BKE_psys_collision_neartest_cb(void *userdata, int index, const struct BVHTreeRay *ray, struct BVHTreeRayHit *hit)
void free_keyed_keys(struct ParticleSystem *psys)
Definition particle.cc:912
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])
Definition particle.cc:5100
float psys_get_dietime_from_cache(struct PointCache *cache, int index)
Definition particle.cc:1307
void psys_sph_density(struct BVHTree *tree, struct SPHData *data, float co[3], float vars[2])
void psys_mat_hair_to_object(struct Object *ob, struct Mesh *mesh, short from, struct ParticleData *pa, float hairmat[4][4])
Definition particle.cc:3888
void psys_find_group_weights(struct ParticleSettings *part)
Definition particle.cc:774
void psys_get_texture(struct ParticleSimulationData *sim, struct ParticleData *pa, struct ParticleTexture *ptex, int event, float cfra)
Definition particle.cc:4380
void BKE_particlesystem_reset_all(struct Object *object)
void psys_interpolate_mcol(const struct MCol *mcol, int quad, const float w[4], struct MCol *mc)
void psys_interpolate_uvs(const struct MTFace *tface, int quad, const float w[4], float r_uv[2])
void psys_free_children(struct ParticleSystem *psys)
Definition particle.cc:953
bool psys_check_enabled(struct Object *ob, struct ParticleSystem *psys, bool use_render_params)
Definition particle.cc:739
void distribute_particles(struct ParticleSimulationData *sim, int from)
int count_particles_mod(struct ParticleSystem *psys, int totgr, int cur)
Definition particle.cc:498
void psys_apply_hair_lattice(struct Depsgraph *depsgraph, struct Scene *scene, struct Object *ob, struct ParticleSystem *psys)
Definition particle.cc:5282
int count_particles(struct ParticleSystem *psys)
Definition particle.cc:480
short psys_get_current_num(struct Object *ob)
Definition particle.cc:585
void psys_calc_dmcache(struct Object *ob, struct Mesh *mesh_final, struct Mesh *mesh_original, 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_set_current_num(struct Object *ob, int index)
Definition particle.cc:602
void psys_disable_all(struct Object *ob)
Definition particle.cc:672
void BKE_particlesettings_rough_curve_init(struct ParticleSettings *part)
Definition particle.cc:4158
void psys_free_pdd(struct ParticleSystem *psys)
Definition particle.cc:993
float psys_get_child_time(struct ParticleSystem *psys, struct ChildParticle *cpa, float cfra, float *birthtime, float *dietime)
Definition particle.cc:4522
int psys_get_tot_child(struct Scene *scene, struct ParticleSystem *psys, bool use_render_params)
void psys_vec_rot_to_face(struct Mesh *mesh, struct ParticleData *pa, float vec[3])
Definition particle.cc:3935
void psys_mat_hair_to_global(struct Object *ob, struct Mesh *mesh, short from, struct ParticleData *pa, float hairmat[4][4])
Definition particle.cc:3944
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)
Definition particle.cc:1869
void BKE_particlesettings_clump_curve_init(struct ParticleSettings *part)
Definition particle.cc:4144
void psys_update_particle_tree(struct ParticleSystem *psys, float cfra)
float psys_particle_value_from_verts(struct Mesh *mesh, short from, struct ParticleData *pa, float *values)
Definition particle.cc:2176
void psys_thread_context_free(struct ParticleThreadContext *ctx)
void psys_get_from_key(struct ParticleKey *key, float loc[3], float vel[3], float rot[4], float *time)
Definition particle.cc:3789
void BKE_particle_batch_cache_free(struct ParticleSystem *psys)
Definition particle.cc:5586
void psys_cache_edit_paths(struct Depsgraph *depsgraph, struct Scene *scene, struct Object *ob, struct PTCacheEdit *edit, float cfra, bool use_render_params)
Definition particle.cc:3697
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])
Definition particle.cc:2285
void psys_copy_particles(struct ParticleSystem *psys_dst, struct ParticleSystem *psys_src)
Definition particle.cc:1087
BLI_INLINE void psys_frand_vec(ParticleSystem *psys, unsigned int seed, float vec[3])
void psys_tasks_free(Vector< ParticleTask > &tasks)
void BKE_particle_system_blend_read_data(struct BlendDataReader *reader, ListBaseT< ParticleSystem > *particles)
Definition particle.cc:5637
void psys_reset(struct ParticleSystem *psys, int mode)
void psys_cache_child_paths(struct ParticleSimulationData *sim, float cfra, bool editupdate, bool use_render_params)
Definition particle.cc:3192
void psys_enable_all(struct Object *ob)
Definition particle.cc:680
void psys_get_pointcache_start_end(struct Scene *scene, ParticleSystem *psys, int *sfra, int *efra)
unsigned int PSYS_FRAND_SEED_OFFSET[PSYS_FRAND_COUNT]
Definition particle.cc:445
bool do_guides(struct Depsgraph *depsgraph, struct ParticleSettings *part, ListBaseT< EffectorCache > *effectors, ParticleKey *state, int index, float time)
Definition particle.cc:2378
void BKE_particle_init_rng()
Definition particle.cc:449
LibraryForeachIDCallbackFlag
void ATTR_NONNULL(1, 2)
BLI_INLINE float psys_frand(ParticleSystem *psys, unsigned int seed)
bool psys_check_edited(struct ParticleSystem *psys)
Definition particle.cc:765
void BKE_particle_uv_on_emitter(ParticleSystem *particlesystem, ReportList *reports, ParticleSystemModifierData *modifier, ParticleData *particle, int particle_no, int uv_no, float r_uv[2])
Definition particle.cc:5496
void psys_mat_hair_to_orco(struct Object *ob, struct Mesh *mesh, short from, struct ParticleData *pa, float hairmat[4][4])
Definition particle.cc:3914
int psys_uses_gravity(struct ParticleSimulationData *sim)
Definition particle.cc:858
void psys_changed_type(struct Object *ob, struct ParticleSystem *psys)
void psys_check_group_weights(struct ParticleSettings *part)
Definition particle.cc:795
void psys_interpolate_particle(short type, struct ParticleKey keys[4], float dt, struct ParticleKey *result, bool velocity)
Definition particle.cc:1173
struct ParticleSystem * psys_eval_get(struct Depsgraph *depsgraph, struct Object *object, struct ParticleSystem *psys)
Definition particle.cc:697
void BKE_particlesettings_fluid_default_settings(struct ParticleSettings *part)
void psys_check_boid_data(struct ParticleSystem *psys)
void psys_sim_data_free(struct ParticleSimulationData *sim)
Definition particle.cc:662
void copy_particle_key(struct ParticleKey *to, struct ParticleKey *from, int time)
Definition particle.cc:3778
int psys_get_child_number(struct Scene *scene, struct ParticleSystem *psys, bool use_render_params)
@ BKE_PARTICLE_BATCH_DIRTY_ALL
void psys_unique_name(struct Object *object, struct ParticleSystem *psys, const char *defname) ATTR_NONNULL(1
ParticleCollisionElement pce
struct Object * skip[PARTICLE_COLLISION_MAX_COLLISIONS+1]
struct CollisionModifierData * md
ListBaseT< ColliderCache > * colliders
struct ParticleSystem * psys
struct ParticleSystemModifierData * psmd
ParticleThreadContext * ctx
struct ParticleData * tpars
struct CurveMapping * clumpcurve
struct CurveMapping * roughcurve
struct ParticleSeam * seams
struct CurveMapping * twistcurve
struct ParticleSimulationData sim
ParticleData * pa
void(*) density_cb(void *rangedata_v, int index, const float co[3], float squared_dist)
Vector< ParticleSpring > new_springs
const Map< OrderedEdge, int > * eh
ParticleSystem * psys[10]
const float * gravity
void(*) force_cb(void *sphdata_v, ParticleKey *state, float *force, float *impulse)