101 if ((use_render_params &&
187 int totpart, totsaved = 0;
189 if (new_totpart < 0) {
192 totpart *= totpart * totpart;
199 totpart = new_totpart;
202 if (totpart != psys->
totpart) {
211 if (newpars ==
NULL) {
218 if (newboids ==
NULL) {
247 for (p = 0, pa = newpars; p < totsaved; p++, pa++) {
254 for (p = totsaved, pa = psys->
particles + totsaved; p < psys->totpart; p++, pa++) {
270 pa->boid = newboids++;
290 if (use_render_params) {
325 int totdmelem, totelem, i;
326 const int *origindex;
327 const int *origindex_poly =
NULL;
329 totdmelem = mesh_final->
totvert;
331 if (use_modifier_stack) {
341 totdmelem = mesh_final->
totface;
343 if (use_modifier_stack) {
346 origindex_poly =
NULL;
349 totelem = mesh_original->
totface;
354 if (origindex_poly ==
NULL) {
363 for (i = 0,
node = nodedmelem; i < totdmelem; i++,
node++) {
368 if (use_modifier_stack) {
376 origindex_final = origindex_poly[origindex_final];
380 if (origindex_final !=
ORIGINDEX_NONE && origindex_final < totelem) {
381 if (nodearray[origindex_final]) {
383 node->next = nodearray[origindex_final];
384 nodearray[origindex_final] =
node;
387 nodearray[origindex_final] =
node;
400 if (use_modifier_stack) {
401 if (pa->num < totelem) {
410 if (pa->num < totelem && nodearray[pa->num]) {
419 mesh_final, mesh_original, pa->num, pa->fuv, nodearray);
455 int particles_per_task = numtasks > 0 ? (endpart - startpart) / numtasks : 0;
456 int remainder = numtasks > 0 ? (endpart - startpart) - particles_per_task * numtasks : 0;
459 *r_numtasks = numtasks;
463 for (
int i = 0; i < numtasks; i++) {
466 p = p + particles_per_task + (i < remainder ? 1 : 0);
472 BLI_assert(tasks[numtasks - 1].end == endpart);
481 for (i = 0; i < numtasks; i++) {
485 if (tasks[i].rng_path) {
537 BLI_kdtree_3d_free(ctx->
tree);
558 switch (part->
type) {
607 if (!(emit_from_volume_grid && (pa->flag &
PARS_UNEXIST) != 0)) {
643 for (p = 0, pa = psys->
particles; p < newtotpart; p++, pa++, npa++) {
663 pa->boid = newboids++;
677 zvec[0] = zvec[1] = 0;
683 float zvec[3], temp[3];
684 zvec[0] = zvec[1] = 0;
712 float fac, phasefac,
nor[3] = {0, 0, 0}, loc[3], vel[3] = {0.0, 0.0, 0.0},
rot[4], q2[4];
713 float r_vel[3], r_ave[3], r_rot[4], vec[3], p_vel[3] = {0.0, 0.0, 0.0};
714 float x_vec[3] = {1.0, 0.0, 0.0}, utan[3] = {0.0, 1.0, 0.0}, vtan[3] = {0.0, 0.0, 1.0},
715 rot_vec[3] = {0.0, 0.0, 0.0};
719 const bool use_tangents = ((use_boids ==
false) &&
740 sim->
psmd, part->
from, pa->
num, pa->
num_dmcache, pa->
fuv, pa->
foffset, loc,
nor, 0, 0, 0);
758 float phase = vg_rot ?
781 r_vel[0] = 2.0f * (
psys_frand(psys, p + 10) - 0.5f);
782 r_vel[1] = 2.0f * (
psys_frand(psys, p + 11) - 0.5f);
783 r_vel[2] = 2.0f * (
psys_frand(psys, p + 12) - 0.5f);
791 r_ave[0] = 2.0f * (
psys_frand(psys, p + 13) - 0.5f);
792 r_ave[1] = 2.0f * (
psys_frand(psys, p + 14) - 0.5f);
793 r_ave[2] = 2.0f * (
psys_frand(psys, p + 15) - 0.5f);
801 r_rot[0] = 2.0f * (
psys_frand(psys, p + 16) - 0.5f);
802 r_rot[1] = 2.0f * (
psys_frand(psys, p + 17) - 0.5f);
803 r_rot[2] = 2.0f * (
psys_frand(psys, p + 18) - 0.5f);
804 r_rot[3] = 2.0f * (
psys_frand(psys, p + 19) - 0.5f);
812 float dvec[3], q[4], mat[3][3];
850 if (dtime != 0.0f && part->
obfac != 0.0f) {
866 if (part->
ob_vel[0] != 0.0f) {
870 if (part->
ob_vel[1] != 0.0f) {
874 if (part->
ob_vel[2] != 0.0f) {
901 bool use_global_space;
908 use_global_space =
false;
912 use_global_space =
true;
918 use_global_space =
true;
924 use_global_space =
false;
927 use_global_space =
true;
933 if (use_global_space) {
954 float rot_vec_local[3];
971 float *rot_vec_local = tmat[0];
972 float *vtan_local = tmat[1];
973 float *utan_local = tmat[2];
1117 if (pa->
time > cfra) {
1120 else if (pa->
dietime <= cfra) {
1175 for (; pt; pt = pt->
next) {
1178 if (kpsys && kpsys->totpart) {
1220 pa->totkey = totkeys;
1228 for (k = 0; k < totkeys; k++) {
1229 ksim.
ob = pt->
ob ? pt->
ob : sim->
ob;
1244 if (pt->
duration != 0.0f && k + 1 < totkeys) {
1249 else if (totkeys > 1) {
1250 key->
time = pa->time + (
float)k / (
float)(totkeys - 1) * pa->lifetime;
1253 key->
time = pa->time;
1336 if (pa->state.time == cfra) {
1365 BLI_kdtree_3d_free(psys->
tree);
1371 if (pa->state.time == cfra) {
1372 BLI_kdtree_3d_insert(psys->
tree, p, pa->prev_state.co);
1375 BLI_kdtree_3d_insert(psys->
tree, p, pa->state.co);
1379 BLI_kdtree_3d_balance(psys->
tree);
1399 float *external_acceleration,
1400 void (*force_func)(
void *forcedata,
ParticleKey *
state,
float *force,
float *impulse),
1405 {0.0f, 0.0f, 0.0f}, {0.0f, 0.0f, 0.0f}, {0.0f, 0.0f, 0.0f}, \
1412 float force[3], acceleration[3], impulse[3], dx[4][3] =
ZERO_F43, dv[4][3] =
ZERO_F43, oldpos[3];
1426 switch (integrator) {
1441 for (i = 0; i <
steps; i++) {
1445 states->
time = 0.0f;
1447 for (i = 0; i <
steps; i++) {
1451 force_func(forcedata, states + i, force, impulse);
1456 if (external_acceleration) {
1457 add_v3_v3(acceleration, external_acceleration);
1463 switch (integrator) {
1472 states[1].
time = dtime * 0.5f;
1490 states[1].
time = dtime * 0.5f;
1501 states[2].
time = dtime * 0.5f;
1511 states[3].
time = dtime;
1558 #define PSYS_FLUID_SPRINGS_INITIAL_SIZE 256
1600 float h, d, Rij[3], rij, Lij;
1606 float timefix = 25.0f * dtime;
1622 d = yield_ratio * timefix * Lij;
1624 if (rij > Lij + d) {
1625 spring->
rest_length += plasticity * (rij - Lij - d) * timefix;
1627 else if (rij < Lij - d) {
1628 spring->
rest_length -= plasticity * (Lij - d - rij) * timefix;
1631 h = 4.0f * pa1->
size;
1653 for (i = 0, spring = psys->
fluid_springs; i < psys->tot_fluidsprings; i++, spring++) {
1661 #define SPH_NEIGHBORS 512
1686 float interaction_radius,
1693 for (i = 0; i < 10 && psys[i]; i++) {
1694 pfr->
npsys = psys[i];
1719 if (npa == pfr->
pa || squared_dist < FLT_EPSILON) {
1737 dist =
sqrtf(squared_dist);
1738 q = (1.0f - dist / pfr->
h) * pfr->
massfac;
1744 pfr->
data[0] += q * q;
1745 pfr->
data[1] += q * q * q;
1755 float flow[3],
offset[3], dist;
1786 float *gravity = sphdata->
gravity;
1789 float q, u, rij, dv[3];
1790 float pressure, near_pressure;
1796 float inv_mass = 1.0f / sphdata->
mass;
1797 float spring_constant = fluid->
spring_k;
1800 float interaction_radius = fluid->
radius *
1802 float h = interaction_radius * sphdata->
hfac;
1819 int i, spring_index, index = pa - psys[0]->
particles;
1830 near_density =
data[1];
1832 pressure = stiffness * (
density - rest_density);
1833 near_pressure = stiffness_near_fac * near_density;
1844 q = (1.0f - rij / h) * pfn->
psys->
part->
mass * inv_mass;
1853 madd_v3_v3fl(force, vec, -(pressure + near_pressure * q) * q);
1856 if (visc > 0.0f || stiff_visc > 0.0f) {
1860 if (u < 0.0f && visc > 0.0f) {
1864 if (u > 0.0f && stiff_visc > 0.0f) {
1869 if (spring_constant > 0.0f) {
1880 -10.0f * spring_constant * (1.0f - rij / h) * (spring->
rest_length - rij));
1895 force, vec, -10.0f * spring_constant * (1.0f - rij / h) * (rest_length - rij));
1901 if (fluid->
buoyancy > 0.0f && gravity) {
1914 float UNUSED(squared_dist))
1919 float qfac = 21.0f / (256.0f * (
float)
M_PI);
1928 rij_h = rij / pfr->
h;
1936 q = qfac /
pow3f(pfr->
h) *
pow4f(2.0f - rij_h) * (1.0f + 2.0f * rij_h);
1950 float UNUSED(squared_dist))
1966 rij_h = rij / pfr->
h;
1986 float *gravity = sphdata->
gravity;
1988 float dq, u, rij, dv[3];
1989 float pressure, npressure;
1993 float interaction_radius;
2008 float qfac2 = 42.0f / (256.0f * (
float)
M_PI);
2013 h = interaction_radius * sphdata->
hfac;
2041 rij_h = rij / pfr.
h;
2046 npressure = stiffness * (
pow7f(npa->
sphdensity / rest_density) - 1.0f);
2053 dq = qfac2 * (2.0f *
pow4f(2.0f - rij_h) - 4.0f *
pow3f(2.0f - rij_h) * (1.0f + 2.0f * rij_h));
2076 if (fluid->
buoyancy > 0.0f && gravity) {
2091 float interaction_radius = fluid->
radius *
2099 pfr.
h = interaction_radius * sphdata->
hfac;
2132 sphdata->
mass = 1.0f;
2137 sphdata->
hfac = 1.0f;
2143 sphdata->
hfac = 0.5f;
2172 float interaction_radius = fluid->
radius *
2179 pfr.
h = interaction_radius * sphdata->
hfac;
2184 vars[0] = pfr.
data[0];
2185 vars[1] = pfr.
data[1];
2198 float effector_acceleration[3];
2201 sphdata->
mass = pa_mass;
2207 mul_v3_fl(effector_acceleration, 1.0f / dtime);
2272 float *gravity =
NULL, gr[3];
2323 float rotfac, rot1[4], rot2[4] = {1.0, 0.0, 0.0, 0.0}, dtime = dfra * timestep, extrotfac;
2344 if (len1 == 0.0f || len2 == 0.0f) {
2359 if (rotfac == 0.0f || (part->
flag &
PART_ROT_DYN) == 0 || extrotfac == 0.0f) {
2381 #define COLLISION_MIN_RADIUS 0.001f
2382 #define COLLISION_MIN_DISTANCE 0.0001f
2383 #define COLLISION_ZERO 0.00001f
2384 #define COLLISION_INIT_STEP 0.00008f
2391 float p0[3], e1[3], e2[3], d;
2423 float v0[3],
v1[3],
v2[3],
c[3];
2449 float f = fac +
t * (1.0f - fac);
2492 float u,
e[3], vec[3];
2518 float u,
e[3], vec[3],
nor[3];
2531 float p0[3], e1[3], e2[3],
nor[3];
2557 float t0, t1, dt_init, d0, d1, dd, n[3];
2562 if (
col->inv_total_time > 0.0f) {
2574 d0 = distance_func(
col->co1, radius, pce, n);
2578 for (iter = 0; iter < 10; iter++) {
2583 d1 = distance_func(pce->
p, radius, pce, n);
2586 if (iter == 0 && d0 < 0.0f && d0 > -radius) {
2601 d0 = distance_func(
col->co2, radius, pce, n);
2602 t1 = 1.0f - dt_init;
2610 dd = (t1 - t0) / (d1 - d0);
2619 if (iter == 0 && t1 < 0.0f) {
2622 d0 = distance_func(
col->co2, radius, pce, n);
2623 t1 = 1.0f - dt_init;
2627 if (iter == 1 && (t1 < -COLLISION_ZERO || t1 > 1.0f)) {
2637 CLAMP(t1, 0.0f, 1.0f);
2660 if (ct >= 0.0f && ct < *
t && (
result->inside == 0 || pce->
inside == 1)) {
2661 float e1[3], e2[3], p0[3];
2662 float e1e1, e1e2, e1p0, e2e2, e2p0, inv;
2675 inv = 1.0f / (e1e1 * e2e2 - e1e2 * e1e2);
2676 u = (e2e2 * e1p0 - e1e2 * e2p0) * inv;
2677 v = (e1e1 * e2p0 - e1e2 * e1p0) * inv;
2679 if (u >= 0.0f && u <= 1.0f && v >= 0.0f && u +
v <= 1.0f) {
2704 for (i = 0; i < 3; i++) {
2706 cur->
x[0] = pce->
x[i];
2707 cur->
x[1] = pce->
x[(i + 1) % 3];
2708 cur->
v[0] = pce->
v[i];
2709 cur->
v[1] = pce->
v[(i + 1) % 3];
2715 if (ct >= 0.0f && ct < *
t) {
2716 float u,
e[3], vec[3];
2722 if (u < 0.0f || u > 1.0f) {
2751 for (i = 0; i < 3; i++) {
2753 cur->
x[0] = pce->
x[i];
2754 cur->
v[0] = pce->
v[i];
2760 if (ct >= 0.0f && ct < *
t) {
2783 float t = hit->
dist /
col->original_ray_length;
2786 pce.
x[0] =
x[vt->
tri[0]].co;
2787 pce.
x[1] =
x[vt->
tri[1]].co;
2788 pce.
x[2] =
x[vt->
tri[2]].co;
2799 if (
col->pce.inside == 0) {
2805 hit->
dist =
col->original_ray_length *
t;
2829 col->pce.inside = 0;
2833 if (hit->
dist == 0.0f) {
2834 hit->
dist =
col->original_ray_length = 0.000001f;
2837 for (coll = colliders->
first; coll; coll = coll->
next) {
2841 for (
int i = 0; i <
col->skip_count; i++) {
2842 if (coll->
ob ==
col->skip[i]) {
2857 col->current = coll->
ob;
2864 if (
col->md &&
col->md->bvhtree) {
2876 return hit->
index >= 0;
2883 int dynamic_rotation)
2891 float x = hit->
dist /
col->original_ray_length;
2893 float f =
col->f +
x * (1.0f -
col->f);
2895 float dt1 = (f -
col->f) *
col->total_time;
2897 float dt2 = (1.0f - f) *
col->total_time;
2927 float v0_dot, vc_dot;
2932 CLAMP(damp, 0.0f, 1.0f);
2933 CLAMP(frict, 0.0f, 1.0f);
2953 if (dynamic_rotation) {
2954 float vr_tan[3], v1_tan[3], ave[3];
2972 mul_v3_fl(v1_tan, 1.0f - 0.01f * frict);
2998 if (v0_dot < 0.0f) {
3000 if (v0_dot > 0.0f) {
3006 v0_dot *= 1.0f - damp;
3007 vc_dot *= through ? damp : 1.0f;
3011 if (through == 0 && ((vc_dot > 0.0f && v0_dot > 0.0f && vc_dot > v0_dot) ||
3012 (vc_dot < 0.0f && v0_dot < 0.0f && vc_dot < v0_dot))) {
3015 else if (v0_dot > 0.0f) {
3019 mul_v3_v3fl(v0_nor, pce->
nor, vc_dot + (through ? 1.0f : -1.0f) * v0_dot);
3029 co[2] =
col->boid_z;
3078 col->skip[
col->skip_count++] =
col->hit;
3109 int collision_count = 0;
3115 col.total_time = timestep * dfra;
3116 col.inv_total_time = 1.0f /
col.total_time;
3117 col.inv_timestep = 1.0f / timestep;
3174 const bool use_render_params)
3179 int distr = 0, alloc = 0, skip = 0;
3268 const float min_length = 0.1f * max_length;
3277 for (k = 1, key = pa->
hair + 1; k < pa->totkey; k++, key++) {
3279 if (
length < min_length) {
3315 float hairmat[4][4];
3338 for (k = 1, key = pa->
hair + 1; k < pa->totkey; k++, key++) {
3340 if (max_length <
length) {
3350 hair_radius = part->
size;
3357 float root_mat[4][4];
3358 float bending_stiffness;
3371 for (k = 0, key = pa->
hair; k < pa->totkey; k++, key++) {
3373 float *co, *co_next;
3376 co_next = (key + 1)->co;
3384 hair->
radius = hair_radius;
3405 hair->
radius = hair_radius;
3430 hair_index += pa->
totkey + 1;
3442 float(*deformedVerts)[3];
3460 totpoint += pa->
totkey + 1;
3465 realloc_roots =
false;
3471 realloc_roots =
true;
3573 key = root = pa->
hair;
3617 float relative_vel[3];
3655 if (dt_target > psys->
dt_frac) {
3666 if (t_frac == 1.0f) {
3670 return 1.0f - t_frac;
3691 void *__restrict join_v,
3692 void *__restrict chunk_v)
3695 SPHData *sphdata_from = chunk_v;
3716 SPHData *sphdata = tls->userdata_chunk;
3720 if ((pa = psys->
particles + p)->state.time <= 0.0f) {
3752 if ((pa = psys->
particles + p)->state.time <= 0.0f) {
3760 void *__restrict userdata,
const int p,
const TaskParallelTLS *__restrict tls)
3766 SPHData *sphdata = tls->userdata_chunk;
3770 if ((pa = psys->
particles + p)->state.time <= 0.0f) {
3786 SPHData *sphdata = tls->userdata_chunk;
3790 if ((pa = psys->
particles + p)->state.time <= 0.0f) {
3821 float birthtime, dietime;
3824 dfra = cfra - psys->
cfra;
3827 dtime = dfra * timestep;
3867 for (; pt; pt = pt->
next) {
3869 if (psys_target && psys_target != psys) {
3900 birthtime = pa->
time;
3906 if (dietime <= cfra && psys->cfra < dietime) {
3911 else if (birthtime <= cfra && birthtime >= psys->
cfra) {
3917 else if (dietime < cfra) {
3978 .timestep = timestep,
4096 float disp, dietime;
4115 if (pa->
time > cfra) {
4121 else if (dietime <= cfra) {
4166 const bool use_render_params)
4189 int p, totpart = 0, tottypepart = 0;
4190 int flagActivePart, activeParts = 0;
4191 float posX, posY, posZ, velX, velY, velZ;
4192 float resX, resY, resZ;
4194 char debugStrBuffer[256];
4195 float tmp[3] = {0}, tmp2[3] = {0};
4198 float min[3],
max[3],
size[3], cell_size_scaled[3], max_size;
4212 sizeof(debugStrBuffer),
4213 "particles_fluid_step::error - found particle system that is not enabled in "
4227 for (p = 0; p < totpart; p++) {
4244 if (!totpart || !tottypepart) {
4249 tottypepart = (use_render_params) ? tottypepart : (part->
disp * tottypepart) / 100;
4252 part->
sta = part->
end = 1.0f;
4263 for (p = 0, pa = psys->
particles; p < totpart; p++) {
4309 sizeof(debugStrBuffer),
4310 "particles_fluid_step::error - unknown particle system type\n");
4315 printf(
"system type is %d and particle type is %d\n", part->
type, flagActivePart);
4334 printf(
"system type is %d and particle type is %d\n", part->
type, flagActivePart);
4338 if (activeParts >= tottypepart) {
4361 max_size =
MAX3(
size[0] / (
float)upres,
size[1] / (
float)upres,
size[2] / (
float)upres);
4364 const float posParticle[3] = {posX, posY, posZ};
4368 float resDomain[3] = {resX, resY, resZ};
4374 float scaleAbs[3] = {
4393 printf(
"pa->state.co[0]: %f, pa->state.co[1]: %f, pa->state.co[2]: %f\n",
4397 const float velParticle[3] = {velX, velY, velZ};
4402 printf(
"pa->state.vel[0]: %f, pa->state.vel[1]: %f, pa->state.vel[2]: %f\n",
4420 printf(
"active parts: %d\n", activeParts);
4435 int oldtotpart = psys->
totpart;
4438 if (totpart != oldtotpart) {
4442 return totpart - oldtotpart;
4462 float disp, cache_cfra = cfra;
4463 int startframe = 0, endframe = 100, oldtotpart = 0;
4486 CLAMP(cache_cfra, startframe, endframe);
4559 int dframe, totframesback = 0;
4560 float t_frac, dt_frac;
4564 if ((
int)cfra == startframe && part->
sta < startframe) {
4565 totframesback = (startframe - (int)part->
sta);
4572 else if ((
int)cfra == startframe) {
4581 for (dframe = -totframesback; dframe <= 0; dframe++) {
4584 for (t_frac = dt_frac; t_frac <= 1.0f; t_frac += dt_frac) {
4587 psys->
cfra = cfra + dframe + t_frac - 1.0f;
4601 if ((
int)cache_cfra != startframe) {
4671 else if (pa->
boid) {
4738 return particle_settings_local;
4753 const bool use_render_params)
4782 if (psys->
cfra == cfra) {
4815 int i, recalc = psys->
recalc;
4831 psys->
part = part_local;
4834 for (i = 0; i <= part->
hair_step; i++) {
4848 if (part_local != part) {
4861 hair_step(&sim, cfra, use_render_params);
4875 bool free_unexisting =
false;
4886 free_unexisting =
true;
4913 if (free_unexisting) {
4938 if (psys_orig->
edit) {
4946 if (psys_orig != psys) {
4982 data->func(
data->psys, id_pointer,
data->userdata, cb_flag);
5013 for (p = 0, pa = psys->
particles; p < psys->totpart; p++, pa++) {
typedef float(TangentPoint)[2]
AnimationEvalContext BKE_animsys_eval_context_construct(struct Depsgraph *depsgraph, float eval_time)
void BKE_animsys_evaluate_animdata(struct ID *id, struct AnimData *adt, const struct AnimationEvalContext *anim_eval_context, eAnimData_Recalc recalc, bool flush_to_original)
void boid_brain(BoidBrainData *bbd, int p, struct ParticleData *pa)
void boid_body(BoidBrainData *bbd, struct ParticleData *pa)
void boids_precalc_rules(struct ParticleSettings *part, float cfra)
void cloth_free_modifier(struct ClothModifierData *clmd)
void clothModifier_do(struct ClothModifierData *clmd, struct Depsgraph *depsgraph, struct Scene *scene, struct Object *ob, struct Mesh *me, float(*vertexCos)[3])
void BKE_collider_cache_free(struct ListBase **colliders)
struct ListBase * BKE_collider_cache_create(struct Depsgraph *depsgraph, struct Object *self, struct Collection *collection)
void * CustomData_get_layer(const struct CustomData *data, int type)
void * CustomData_add_layer(struct CustomData *data, int type, eCDAllocType alloctype, void *layer, int totelem)
void BKE_effectors_free(struct ListBase *lb)
void BKE_effectors_apply(struct ListBase *effectors, struct ListBase *colliders, struct EffectorWeights *weights, struct EffectedPoint *point, float *force, float *wind_force, float *impulse)
void pd_point_from_particle(struct ParticleSimulationData *sim, struct ParticleData *pa, struct ParticleKey *state, struct EffectedPoint *point)
struct ListBase * BKE_effectors_create(struct Depsgraph *depsgraph, struct Object *ob_src, struct ParticleSystem *psys_src, struct EffectorWeights *weights, bool use_rotation)
void BKE_libblock_free_data(struct ID *id, bool do_id_user) ATTR_NONNULL()
struct ID * BKE_id_copy_ex(struct Main *bmain, const struct ID *id, struct ID **r_newid, int flag)
void BKE_id_free(struct Main *bmain, void *idv)
void BKE_libblock_free_datablock(struct ID *id, int flag) ATTR_NONNULL()
General operations, lookup, etc. for materials.
struct Material * BKE_object_material_get(struct Object *ob, short act)
void BKE_mesh_vert_coords_apply(struct Mesh *mesh, const float(*vert_coords)[3])
struct Mesh * BKE_mesh_new_nomain(int verts_len, int edges_len, int tessface_len, int loops_len, int polys_len)
void BKE_mesh_update_customdata_pointers(struct Mesh *me, bool do_ensure_tess_cd)
float(* BKE_mesh_vert_coords_alloc(const struct Mesh *mesh, int *r_vert_len))[3]
void BKE_mesh_tessface_ensure(struct Mesh *mesh)
const ModifierTypeInfo * BKE_modifier_get_info(ModifierType type)
struct ModifierData * BKE_modifiers_findby_type(const struct Object *ob, ModifierType type)
struct ModifierData * BKE_modifier_new(int type)
General operations, lookup, etc. for blender objects.
void BKE_object_where_is_calc_time(struct Depsgraph *depsgraph, struct Scene *scene, struct Object *ob, float ctime)
void distribute_particles(struct ParticleSimulationData *sim, int from)
bool do_guides(struct Depsgraph *depsgraph, struct ParticleSettings *part, struct ListBase *effectors, ParticleKey *state, int index, float time)
#define PARTICLE_DRAW_DATA_UPDATED
void psys_vec_rot_to_face(struct Mesh *mesh, struct ParticleData *pa, float vec[3])
void psys_cache_paths(struct ParticleSimulationData *sim, float cfra, bool use_render_params)
void precalc_guides(struct ParticleSimulationData *sim, struct ListBase *effectors)
#define LOOP_SHOWN_PARTICLES
bool psys_check_enabled(struct Object *ob, struct ParticleSystem *psys, bool use_render_params)
struct ParticleSystem * psys_orig_get(struct ParticleSystem *psys)
void copy_particle_key(struct ParticleKey *to, struct ParticleKey *from, int time)
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)
float psys_get_timestep(struct ParticleSimulationData *sim)
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])
float psys_get_dietime_from_cache(struct PointCache *cache, int index)
void psys_free_particles(struct ParticleSystem *psys)
void psys_free_children(struct ParticleSystem *psys)
void free_keyed_keys(struct ParticleSystem *psys)
#define PSYS_RESET_CACHE_MISS
int psys_uses_gravity(struct ParticleSimulationData *sim)
float psys_particle_value_from_verts(struct Mesh *mesh, short from, struct ParticleData *pa, float *values)
void psys_sim_data_free(struct ParticleSimulationData *sim)
#define LOOP_DYNAMIC_PARTICLES
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)
@ 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)
void psys_get_texture(struct ParticleSimulationData *sim, struct ParticleData *pa, struct ParticleTexture *ptex, int event, float cfra)
#define LOOP_EXISTING_PARTICLES
void free_hair(struct Object *ob, struct ParticleSystem *psys, int dynamics)
void BKE_particle_batch_cache_dirty_tag(struct ParticleSystem *psys, int mode)
#define PSYS_RESET_DEPSGRAPH
void(* ParticleSystemIDFunc)(struct ParticleSystem *psys, struct ID **idpoin, void *userdata, int cb_flag)
void psys_find_parents(struct ParticleSimulationData *sim, bool use_render_params)
void psys_cache_child_paths(struct ParticleSimulationData *sim, float cfra, bool editupdate, bool use_render_params)
void psys_sim_data_init(struct ParticleSimulationData *sim)
BLI_INLINE float psys_frand(ParticleSystem *psys, unsigned int seed)
bool psys_get_particle_state(struct ParticleSimulationData *sim, int p, struct ParticleKey *state, bool always)
void BKE_ptcache_free_mem(struct ListBase *mem_cache)
void BKE_ptcache_id_time(PTCacheID *pid, struct Scene *scene, float cfra, int *startframe, int *endframe, float *timescale)
#define PTCACHE_CLEAR_AFTER
void BKE_ptcache_id_from_particles(PTCacheID *pid, struct Object *ob, struct ParticleSystem *psys)
void BKE_ptcache_validate(struct PointCache *cache, int framenr)
void BKE_ptcache_id_clear(PTCacheID *id, int mode, unsigned int cfra)
void BKE_ptcache_disk_to_mem(struct PTCacheID *pid)
#define PTCACHE_CLEAR_ALL
#define PTCACHE_READ_INTERPOLATED
int BKE_ptcache_id_reset(struct Scene *scene, PTCacheID *id, int mode)
@ PT_CACHE_EDIT_UPDATE_PARTICLE_FROM_EVAL
int BKE_ptcache_read(PTCacheID *pid, float cfra, bool no_extrapolate_old)
int BKE_ptcache_write(PTCacheID *pid, unsigned int cfra)
#define PTCACHE_RESET_OUTDATED
void BKE_ptcache_invalidate(struct PointCache *cache)
#define PTCACHE_READ_EXACT
int get_render_child_particle_number(const struct RenderData *r, int child_num, bool for_render)
#define BLI_buffer_append(buffer_, type_, val_)
#define BLI_buffer_field_init(name_, type_)
#define BLI_buffer_append_array(buffer_, type_, data_, count_)
#define BLI_buffer_at(buffer_, type_, index_)
#define BLI_buffer_field_free(name_)
void BLI_edgehash_free(EdgeHash *eh, EdgeHashFreeFP free_value)
void BLI_edgehash_insert(EdgeHash *eh, unsigned int v0, unsigned int v1, void *val)
EdgeHash * BLI_edgehash_new_ex(const char *info, unsigned int nentries_reserve)
void * BLI_edgehash_lookup(const EdgeHash *eh, unsigned int v0, unsigned int v1) ATTR_WARN_UNUSED_RESULT
int BLI_bvhtree_range_query(BVHTree *tree, const float co[3], float radius, BVHTree_RangeQuery callback, void *userdata)
#define BVH_RAYCAST_DEFAULT
void BLI_bvhtree_balance(BVHTree *tree)
BVHTree * BLI_bvhtree_new(int maxsize, float epsilon, char tree_type, char axis)
int BLI_bvhtree_ray_cast_ex(BVHTree *tree, const float co[3], const float dir[3], float radius, BVHTreeRayHit *hit, BVHTree_RayCastCallback callback, void *userdata, int flag)
void BLI_bvhtree_free(BVHTree *tree)
void BLI_bvhtree_insert(BVHTree *tree, int index, const float co[3], int numpoints)
void(* BVHTree_RangeQuery)(void *userdata, int index, const float co[3], float dist_sq)
A KD-tree for nearest neighbor search.
BLI_INLINE bool BLI_listbase_is_empty(const struct ListBase *lb)
void * BLI_findlink(const struct ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
MINLINE float saacos(float fac)
MINLINE float max_ff(float a, float b)
MINLINE int min_ii(int a, int b)
MINLINE float pow2f(float x)
MINLINE float min_ff(float a, float b)
MINLINE int max_ii(int a, int b)
MINLINE float interpf(float a, float b, float t)
MINLINE float pow3f(float x)
MINLINE float pow4f(float x)
MINLINE float pow7f(float x)
void mul_m4_m4m4(float R[4][4], const float A[4][4], const float B[4][4])
void copy_m3_m4(float m1[3][3], const float m2[4][4])
void mul_mat3_m4_v3(const float M[4][4], float r[3])
bool invert_m4_m4(float R[4][4], const float A[4][4])
void mul_m4_v3(const float M[4][4], float r[3])
void normalize_m4(float R[4][4]) ATTR_NONNULL()
void interp_qt_qtqt(float q[4], const float a[4], const float b[4], float t)
void axis_angle_to_quat(float r[4], const float axis[3], float angle)
void mat3_to_quat(float q[4], const float mat[3][3])
void vec_to_quat(float q[4], const float vec[3], short axis, short upflag)
float normalize_qt(float q[4])
void mul_qt_v3(const float q[4], float r[3])
void invert_qt_qt_normalized(float q1[4], const float q2[4])
void mul_qt_qtqt(float q[4], const float a[4], const float b[4])
void mat4_to_quat(float q[4], const float mat[4][4])
void mat3_to_quat_is_ok(float q[4], const float mat[3][3])
void copy_qt_qt(float q[4], const float a[4])
MINLINE float len_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void madd_v3_v3fl(float r[3], const float a[3], float f)
MINLINE void madd_v3fl_v3fl_v3fl_v3i(float r[3], const float a[3], const float b[3], const int c[3])
MINLINE float normalize_v3(float r[3])
MINLINE void mul_v3_v3(float r[3], const float a[3])
MINLINE void sub_v3_v3(float r[3], const float a[3])
MINLINE void sub_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void mul_v3_fl(float r[3], float f)
MINLINE void copy_v3_v3(float r[3], const float a[3])
MINLINE void negate_v3_v3(float r[3], const float a[3])
void project_v3_v3v3(float out[3], const float p[3], const float v_proj[3])
MINLINE float dot_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
void interp_v3_v3v3(float r[3], const float a[3], const float b[3], float t)
MINLINE void add_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void cross_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void negate_v3(float r[3])
MINLINE float normalize_v3_v3(float r[3], const float a[3])
MINLINE void madd_v3_v3v3fl(float r[3], const float a[3], const float b[3], float f)
MINLINE void zero_v3(float r[3])
MINLINE void mul_v3_v3fl(float r[3], const float a[3], float f)
MINLINE void add_v3_v3(float r[3], const float a[3])
MINLINE float len_v3(const float a[3]) ATTR_WARN_UNUSED_RESULT
void BLI_rng_free(struct RNG *rng) ATTR_NONNULL(1)
double BLI_rng_get_double(struct RNG *rng) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
struct RNG * BLI_rng_new_srandom(unsigned int seed)
float BLI_rng_get_float(struct RNG *rng) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
size_t BLI_snprintf(char *__restrict dst, size_t maxncpy, const char *__restrict format,...) ATTR_NONNULL(1
bool BLI_uniquename(struct ListBase *list, void *vlink, const char *defname, char delim, int name_offset, size_t name_len)
void BLI_task_isolate(void(*func)(void *userdata), void *userdata)
void BLI_task_parallel_range(int start, int stop, void *userdata, TaskParallelRangeFunc func, const TaskParallelSettings *settings)
BLI_INLINE void BLI_parallel_range_settings_defaults(TaskParallelSettings *settings)
pthread_spinlock_t SpinLock
pthread_rwlock_t ThreadRWMutex
#define THREAD_LOCK_WRITE
#define BLI_RWLOCK_INITIALIZER
int BLI_system_thread_count(void)
void BLI_rw_mutex_lock(ThreadRWMutex *mutex, int mode)
void BLI_spin_init(SpinLock *spin)
void BLI_spin_unlock(SpinLock *spin)
void BLI_spin_lock(SpinLock *spin)
void BLI_rw_mutex_unlock(ThreadRWMutex *mutex)
void BLI_spin_end(SpinLock *spin)
#define POINTER_FROM_INT(i)
#define POINTER_AS_INT(i)
typedef double(DMatrix)[4][4]
struct Depsgraph Depsgraph
bool DEG_is_active(const struct Depsgraph *depsgraph)
void DEG_debug_print_eval(struct Depsgraph *depsgraph, const char *function_name, const char *object_name, const void *object_address)
float DEG_get_ctime(const Depsgraph *graph)
eEvaluationMode DEG_get_mode(const Depsgraph *graph)
@ CLOTH_COLLSETTINGS_FLAG_SELF
@ CLOTH_SIMSETTINGS_FLAG_RESIST_SPRING_COMPRESS
@ FLUID_DOMAIN_PARTICLE_SPRAY
@ FLUID_DOMAIN_PARTICLE_FOAM
@ FLUID_DOMAIN_PARTICLE_TRACER
@ FLUID_DOMAIN_PARTICLE_FLIP
@ FLUID_DOMAIN_PARTICLE_BUBBLE
These structs are the foundation for all linked lists in the library system.
@ eParticleSystemFlag_Pars
@ eParticleSystemFlag_psys_updated
@ eModifierType_ParticleSystem
#define EFF_WEIGHT_DO_HAIR
Object is a sort of wrapper for general info.
#define PSYS_OB_ANIM_RESTORE
#define PART_INT_MIDPOINT
#define SPH_CURRENT_REST_LENGTH
#define SPH_VISCOELASTIC_SPRINGS
#define PART_AVE_GLOBAL_X
#define PSYS_HAIR_DYNAMICS
#define SPH_FAC_VISCOSITY
@ PART_FLUID_SPRAYFOAMBUBBLE
#define PSYS_SHARED_CACHES
#define SPH_FAC_REPULSION
#define SPH_FAC_REST_LENGTH
#define PART_AVE_VELOCITY
#define PART_AVE_GLOBAL_Y
#define PART_AVE_HORIZONTAL
#define PART_AVE_VERTICAL
#define PART_AVE_GLOBAL_Z
#define PSYS_HAIR_UPDATED
#define PSYS_KEYED_TIMING
#define PHYS_GLOBAL_GRAVITY
_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 const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble w _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat w _GL_VOID_RET _GL_VOID GLint GLint GLint w _GL_VOID_RET _GL_VOID GLshort GLshort GLshort w _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble y2 _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat y2 _GL_VOID_RET _GL_VOID GLint GLint GLint y2 _GL_VOID_RET _GL_VOID GLshort GLshort GLshort y2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLuint *buffer _GL_VOID_RET _GL_VOID GLdouble t _GL_VOID_RET _GL_VOID GLfloat t _GL_VOID_RET _GL_VOID GLint t _GL_VOID_RET _GL_VOID GLshort t _GL_VOID_RET _GL_VOID GLdouble GLdouble r _GL_VOID_RET _GL_VOID GLfloat GLfloat r _GL_VOID_RET _GL_VOID GLint GLint r _GL_VOID_RET _GL_VOID GLshort GLshort r _GL_VOID_RET _GL_VOID GLdouble GLdouble r
_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 const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble w _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat w _GL_VOID_RET _GL_VOID GLint GLint GLint w _GL_VOID_RET _GL_VOID GLshort GLshort GLshort w _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble y2 _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat y2 _GL_VOID_RET _GL_VOID GLint GLint GLint y2 _GL_VOID_RET _GL_VOID GLshort GLshort GLshort y2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLuint *buffer _GL_VOID_RET _GL_VOID GLdouble t _GL_VOID_RET _GL_VOID GLfloat t _GL_VOID_RET _GL_VOID GLint t _GL_VOID_RET _GL_VOID GLshort t _GL_VOID_RET _GL_VOID GLdouble t
_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 const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble v1
Read Guarded memory(de)allocation.
#define MEM_reallocN(vmemh, len)
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Bright Control the brightness and contrast of the input color Vector Map an input vectors to used to fine tune the interpolation of the input Camera Retrieve information about the camera and how it relates to the current shading point s position CLAMP
Platform independent time functions.
ATTR_WARN_UNUSED_RESULT const BMVert * v2
ATTR_WARN_UNUSED_RESULT const BMVert const BMEdge * e
ATTR_WARN_UNUSED_RESULT const BMVert * v
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
static void mul(btAlignedObjectArray< T > &items, const Q &value)
SIMD_FORCE_INLINE btScalar angle(const btVector3 &v) const
Return the angle between this and another vector.
const Depsgraph * depsgraph
DEGForeachIDComponentCallback callback
ccl_gpu_kernel_postfix ccl_global float int int int int float bool int offset
void(* MEM_freeN)(void *vmemh)
void *(* MEM_callocN)(size_t len, const char *str)
void *(* MEM_mallocN)(size_t len, const char *str)
int manta_liquid_get_flip_particle_flag_at(struct MANTA *liquid, int i)
int manta_liquid_get_snd_particle_flag_at(struct MANTA *liquid, int i)
float manta_liquid_get_flip_particle_velocity_z_at(struct MANTA *liquid, int i)
float manta_liquid_get_snd_particle_velocity_z_at(struct MANTA *liquid, int i)
float manta_liquid_get_flip_particle_velocity_y_at(struct MANTA *liquid, int i)
float manta_liquid_get_flip_particle_position_y_at(struct MANTA *liquid, int i)
int manta_liquid_get_particle_res_y(struct MANTA *liquid)
int manta_liquid_get_particle_upres(struct MANTA *liquid)
float manta_liquid_get_flip_particle_position_z_at(struct MANTA *liquid, int i)
int manta_get_res_x(struct MANTA *fluid)
int manta_get_res_z(struct MANTA *fluid)
int manta_get_res_y(struct MANTA *fluid)
float manta_liquid_get_snd_particle_position_z_at(struct MANTA *liquid, int i)
float manta_liquid_get_snd_particle_velocity_y_at(struct MANTA *liquid, int i)
int manta_liquid_get_num_flip_particles(struct MANTA *liquid)
int manta_liquid_get_particle_res_x(struct MANTA *liquid)
float manta_liquid_get_flip_particle_position_x_at(struct MANTA *liquid, int i)
float manta_liquid_get_snd_particle_position_x_at(struct MANTA *liquid, int i)
float manta_liquid_get_snd_particle_position_y_at(struct MANTA *liquid, int i)
float manta_liquid_get_snd_particle_velocity_x_at(struct MANTA *liquid, int i)
int manta_liquid_get_particle_res_z(struct MANTA *liquid)
int manta_liquid_get_num_snd_particles(struct MANTA *liquid)
float manta_liquid_get_flip_particle_velocity_x_at(struct MANTA *liquid, int i)
T dot(const vec_base< T, Size > &a, const vec_base< T, Size > &b)
T length(const vec_base< T, Size > &a)
T distance(const T &a, const T &b)
static const pxr::TfToken density("density", pxr::TfToken::Immortal)
void BKE_particlesettings_fluid_default_settings(ParticleSettings *part)
static void dynamics_step_sph_classical_calc_density_task_cb_ex(void *__restrict userdata, const int p, const TaskParallelTLS *__restrict tls)
static void get_angular_velocity_vector(short avemode, ParticleKey *state, float vec[3])
static float nr_distance_to_vert(float *p, float radius, ParticleCollisionElement *pce, float *UNUSED(nor))
static float collision_point_distance_with_normal(float p[3], ParticleCollisionElement *pce, float fac, ParticleCollision *col, float *nor)
static void save_hair(ParticleSimulationData *sim, float UNUSED(cfra))
static float nr_distance_to_edge(float *p, float radius, ParticleCollisionElement *pce, float *UNUSED(nor))
static void sphclassical_calc_dens(ParticleData *pa, float UNUSED(dfra), SPHData *sphdata)
void psys_calc_dmcache(Object *ob, Mesh *mesh_final, Mesh *mesh_original, ParticleSystem *psys)
static void dynamics_step_sphdata_reduce(const void *__restrict UNUSED(userdata), void *__restrict join_v, void *__restrict chunk_v)
static float collision_newton_rhapson(ParticleCollision *col, float radius, ParticleCollisionElement *pce, NRDistanceFunc distance_func)
static void dynamics_step(ParticleSimulationData *sim, float cfra)
static ThreadRWMutex psys_bvhtree_rwlock
struct ParticleSystemIDLoopForModifier ParticleSystemIDLoopForModifier
static void sph_force_cb(void *sphdata_v, ParticleKey *state, float *force, float *UNUSED(impulse))
static void collision_point_on_surface(const float p[3], ParticleCollisionElement *pce, float fac, ParticleCollision *col, float *co)
static const float MIN_TIMESTEP
static void psys_prepare_physics(ParticleSimulationData *sim)
static bool particles_has_bubble(short parttype)
void BKE_particlesystem_id_loop(ParticleSystem *psys, ParticleSystemIDFunc func, void *userdata)
static int collision_response(ParticleSimulationData *sim, ParticleData *pa, ParticleCollision *col, BVHTreeRayHit *hit, int kill, int dynamic_rotation)
static void dynamics_step_sph_ddr_task_cb_ex(void *__restrict userdata, const int p, const TaskParallelTLS *__restrict tls)
static void sph_evaluate_func(BVHTree *tree, ParticleSystem **psys, const float co[3], SPHRangeData *pfr, float interaction_radius, BVHTree_RangeQuery callback)
static void update_timestep(ParticleSystem *psys, ParticleSimulationData *sim)
static void basic_integrate(ParticleSimulationData *sim, int p, float dfra, float cfra)
static void init_particle_texture(ParticleSimulationData *sim, ParticleData *pa, int p)
static void sphclassical_density_accum_cb(void *userdata, int index, const float co[3], float UNUSED(squared_dist))
static float sync_timestep(ParticleSystem *psys, float t_frac)
static void sph_particle_courant(SPHData *sphdata, SPHRangeData *pfr)
static void psys_sph_flush_springs(SPHData *sphdata)
static void integrate_particle(ParticleSettings *part, ParticleData *pa, float dtime, float *external_acceleration, void(*force_func)(void *forcedata, ParticleKey *state, float *force, float *impulse), void *forcedata)
static int tot_particles(ParticleSystem *psys, PTCacheID *pid)
static const float TIMESTEP_EXPANSION_FACTOR
static void bvhtree_balance_isolated(void *userdata)
float psys_get_current_display_percentage(ParticleSystem *psys, const bool use_render_params)
static bool particles_has_tracer(short parttype)
void psys_count_keyed_targets(ParticleSimulationData *sim)
void psys_unique_name(Object *object, ParticleSystem *psys, const char *defname)
float(* NRDistanceFunc)(float *p, float radius, ParticleCollisionElement *pce, float *nor)
static void collision_interpolate_element(ParticleCollisionElement *pce, float t, float fac, ParticleCollision *col)
static bool particles_has_foam(short parttype)
void psys_thread_context_init(ParticleThreadContext *ctx, ParticleSimulationData *sim)
void psys_get_pointcache_start_end(Scene *scene, ParticleSystem *psys, int *sfra, int *efra)
static void sph_spring_delete(ParticleSystem *psys, int j)
static void basic_rotate(ParticleSettings *part, ParticleData *pa, float dfra, float timestep)
static void dynamics_step_sph_classical_basic_integrate_task_cb_ex(void *__restrict userdata, const int p, const TaskParallelTLS *__restrict UNUSED(tls))
static void free_unexisting_particles(ParticleSimulationData *sim)
void psys_sph_init(ParticleSimulationData *sim, SPHData *sphdata)
static void sph_density_accum_cb(void *userdata, int index, const float co[3], float squared_dist)
void psys_get_birth_coords(ParticleSimulationData *sim, ParticleData *pa, ParticleKey *state, float dtime, float cfra)
static float nr_signed_distance_to_plane(float *p, float radius, ParticleCollisionElement *pce, float *nor)
void BKE_particlesystem_reset_all(struct Object *object)
static EdgeHash * sph_springhash_build(ParticleSystem *psys)
static void cached_step(ParticleSimulationData *sim, float cfra, const bool use_render_params)
int psys_get_tot_child(Scene *scene, ParticleSystem *psys, const bool use_render_params)
static bool particles_has_flip(short parttype)
static const float TIMESTEP_EXPANSION_TOLERANCE
static bool particles_has_spray(short parttype)
void psys_tasks_create(ParticleThreadContext *ctx, int startpart, int endpart, ParticleTask **r_tasks, int *r_numtasks)
void psys_reset(ParticleSystem *psys, int mode)
static void system_step(ParticleSimulationData *sim, float cfra, const bool use_render_params)
struct SPHNeighbor SPHNeighbor
static void hair_step(ParticleSimulationData *sim, float cfra, const bool use_render_params)
static ParticleSpring * sph_spring_add(ParticleSystem *psys, ParticleSpring *spring)
static void collision_check(ParticleSimulationData *sim, int p, float dfra, float cfra)
#define PSYS_FLUID_SPRINGS_INITIAL_SIZE
void psys_changed_type(Object *ob, ParticleSystem *psys)
void psys_sph_finalize(SPHData *sphdata)
static void set_keyed_keys(ParticleSimulationData *sim)
static void sph_springs_modify(ParticleSystem *psys, float dtime)
void particle_system_update(struct Depsgraph *depsgraph, Scene *scene, Object *ob, ParticleSystem *psys, const bool use_render_params)
static float get_base_time_step(ParticleSettings *part)
static void update_courant_num(ParticleSimulationData *sim, ParticleData *pa, float dtime, SPHData *sphdata, SpinLock *spin)
static void psys_update_effectors(ParticleSimulationData *sim)
static void collision_fail(ParticleData *pa, ParticleCollision *col)
static void reset_all_particles(ParticleSimulationData *sim, float dtime, float cfra, int from)
static ParticleSettings * particle_settings_localize(ParticleSettings *particle_settings)
static void sphclassical_force_cb(void *sphdata_v, ParticleKey *state, float *force, float *UNUSED(impulse))
static void basic_force_cb(void *efdata_v, ParticleKey *state, float *force, float *impulse)
static void sph_integrate(ParticleSimulationData *sim, ParticleData *pa, float dfra, SPHData *sphdata)
int psys_get_child_number(Scene *scene, ParticleSystem *psys, const bool use_render_params)
void psys_update_particle_tree(ParticleSystem *psys, float cfra)
static void psys_update_particle_bvhtree(ParticleSystem *psys, float cfra)
struct SPHRangeData SPHRangeData
static int particles_are_dynamic(ParticleSystem *psys)
struct DynamicStepSolverTaskData DynamicStepSolverTaskData
static int collision_sphere_to_verts(ParticleCollision *col, float radius, ParticleCollisionElement *pce, float *t)
static void particle_settings_free_local(ParticleSettings *particle_settings)
void init_particle(ParticleSimulationData *sim, ParticleData *pa)
void psys_sph_density(BVHTree *tree, SPHData *sphdata, float co[3], float vars[2])
static void particles_fluid_step(ParticleSimulationData *sim, int cfra, const bool use_render_params)
static void do_hair_dynamics(ParticleSimulationData *sim)
static void sphclassical_neighbor_accum_cb(void *userdata, int index, const float co[3], float UNUSED(squared_dist))
void psys_make_temp_pointcache(Object *ob, ParticleSystem *psys)
static void psys_clear_temp_pointcache(ParticleSystem *psys)
void BKE_particle_settings_eval_reset(struct Depsgraph *depsgraph, ParticleSettings *particle_settings)
static int collision_sphere_to_edges(ParticleCollision *col, float radius, ParticleCollisionElement *pce, float *t)
#define COLLISION_MIN_RADIUS
static int emit_particles(ParticleSimulationData *sim, PTCacheID *pid, float UNUSED(cfra))
static void initialize_all_particles(ParticleSimulationData *sim)
static int hair_needs_recalc(ParticleSystem *psys)
static void particlesystem_modifiersForeachIDLink(void *user_data, Object *UNUSED(object), ID **id_pointer, int cb_flag)
static void update_children(ParticleSimulationData *sim, const bool use_render_params)
static int collision_sphere_to_tri(ParticleCollision *col, float radius, ParticleCollisionElement *pce, float *t)
static MDeformVert * hair_set_pinning(MDeformVert *dvert, float weight)
static void collision_point_velocity(ParticleCollisionElement *pce)
void BKE_psys_collision_neartest_cb(void *userdata, int index, const BVHTreeRay *ray, BVHTreeRayHit *hit)
static void dynamics_step_sph_classical_integrate_task_cb_ex(void *__restrict userdata, const int p, const TaskParallelTLS *__restrict tls)
void psys_check_boid_data(ParticleSystem *psys)
void BKE_particle_system_eval_init(struct Depsgraph *depsgraph, Object *object)
#define COLLISION_INIT_STEP
void psys_thread_context_free(ParticleThreadContext *ctx)
static void psys_update_path_cache(ParticleSimulationData *sim, float cfra, const bool use_render_params)
static void realloc_particles(ParticleSimulationData *sim, int new_totpart)
static int collision_detect(ParticleData *pa, ParticleCollision *col, BVHTreeRayHit *hit, ListBase *colliders)
static void evaluate_emitter_anim(struct Depsgraph *depsgraph, Scene *scene, Object *ob, float cfra)
static bool psys_hair_use_simulation(ParticleData *pa, float max_length)
static void hair_create_input_mesh(ParticleSimulationData *sim, int totpoint, int totedge, Mesh **r_mesh)
void psys_tasks_free(ParticleTask *tasks, int numtasks)
void reset_particle(ParticleSimulationData *sim, ParticleData *pa, float dtime, float cfra)
ParticleSystem * psys_get_target_system(Object *ob, ParticleTarget *pt)
#define COLLISION_MIN_DISTANCE
struct ParticleSettings * part
struct ParticleSimulationData * sim
struct ClothHairData * hairdata
struct PointCache * point_cache
struct ClothSimSettings * sim_parms
struct ClothCollSettings * coll_parms
struct EffectorWeights * effector_weights
struct CollisionModifierData * collmd
struct ColliderCache * next
ParticleSimulationData * sim
ParticleSimulationData * sim
struct FluidDomainSettings * domain
struct MDeformVert * dvert
void(* foreachIDLink)(struct ModifierData *md, struct Object *ob, IDWalkFunc walk, void *userData)
struct ParticleSystem * psys
struct ParticleSystemModifierData * psmd_eval
struct ParticleSystem * psys_eval
struct PointCache * cache
struct Collection * collision_group
struct BoidSettings * boids
struct EffectorWeights * effector_weights
struct SPHFluidSettings * fluid
struct Depsgraph * depsgraph
struct ParticleSystemModifierData * psmd
struct ParticleSystem * psys
struct ListBase * colliders
unsigned int particle_index[2]
ParticleSystemIDFunc func
struct ParticleSystem * psys
struct Mesh * mesh_original
ParticleSpring * fluid_springs
struct PTCacheEdit * edit
struct ListBase * effectors
struct PointCache * pointcache
struct ClothModifierData * clmd
struct Object * target_ob
struct Mesh * hair_in_mesh
struct Mesh * hair_out_mesh
struct ParticleDrawData * pdd
struct ParticleCacheKey ** pathcache
void(* free_edit)(struct PTCacheEdit *edit)
struct ParticleTarget * next
ParticleThreadContext * ctx
struct CurveMapping * roughcurve
struct CurveMapping * twistcurve
struct CurveMapping * clumpcurve
struct ParticleSeam * seams
struct ParticleSimulationData sim
struct ListBase mem_cache
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)
float plasticity_constant
SPHNeighbor neighbors[SPH_NEIGHBORS]
struct PhysicsSettings physics_settings
struct ToolSettings * toolsettings
TaskParallelReduceFunc func_reduce
size_t userdata_chunk_size