118 if ((use_render_params &&
210 int totpart, totsaved = 0;
212 if (new_totpart < 0) {
215 totpart *= totpart * totpart;
222 totpart = new_totpart;
225 if (totpart != psys->
totpart) {
234 if (newpars ==
NULL) {
241 if (newboids ==
NULL) {
270 for (p = 0, pa = newpars; p < totsaved; p++, pa++) {
277 for (p = totsaved, pa = psys->
particles + totsaved; p < psys->totpart; p++, pa++) {
293 pa->boid = newboids++;
313 if (use_render_params) {
348 int totdmelem, totelem, i, *origindex, *origindex_poly =
NULL;
351 totdmelem = mesh_final->
totvert;
353 if (use_modifier_stack) {
363 totdmelem = mesh_final->
totface;
365 if (use_modifier_stack) {
368 origindex_poly =
NULL;
371 totelem = mesh_original->
totface;
376 if (origindex_poly ==
NULL) {
385 for (i = 0,
node = nodedmelem; i < totdmelem; i++,
node++) {
390 if (use_modifier_stack) {
398 origindex_final = origindex_poly[origindex_final];
402 if (origindex_final !=
ORIGINDEX_NONE && origindex_final < totelem) {
403 if (nodearray[origindex_final]) {
405 node->next = nodearray[origindex_final];
406 nodearray[origindex_final] =
node;
409 nodearray[origindex_final] =
node;
422 if (use_modifier_stack) {
423 if (pa->num < totelem) {
432 if (pa->num < totelem && nodearray[pa->num]) {
441 mesh_final, mesh_original, pa->num, pa->fuv, nodearray);
478 int particles_per_task = numtasks > 0 ? (endpart - startpart) / numtasks : 0;
479 int remainder = numtasks > 0 ? (endpart - startpart) - particles_per_task * numtasks : 0;
482 *r_numtasks = numtasks;
486 for (
int i = 0; i < numtasks; i++) {
489 p = p + particles_per_task + (i < remainder ? 1 : 0);
495 BLI_assert(tasks[numtasks - 1].end == endpart);
504 for (i = 0; i < numtasks; i++) {
508 if (tasks[i].rng_path) {
563 BLI_kdtree_3d_free(ctx->
tree);
584 switch (part->
type) {
634 if (!(emit_from_volume_grid && (pa->flag &
PARS_UNEXIST) != 0)) {
670 for (p = 0, pa = psys->
particles; p < newtotpart; p++, pa++, npa++) {
690 pa->boid = newboids++;
704 zvec[0] = zvec[1] = 0;
710 float zvec[3], temp[3];
711 zvec[0] = zvec[1] = 0;
739 float fac, phasefac,
nor[3] = {0, 0, 0}, loc[3], vel[3] = {0.0, 0.0, 0.0},
rot[4], q2[4];
740 float r_vel[3], r_ave[3], r_rot[4], vec[3], p_vel[3] = {0.0, 0.0, 0.0};
741 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},
742 rot_vec[3] = {0.0, 0.0, 0.0};
746 const bool use_tangents = ((use_boids ==
false) &&
767 sim->
psmd, part->
from, pa->
num, pa->
num_dmcache, pa->
fuv, pa->
foffset, loc,
nor, 0, 0, 0);
785 float phase = vg_rot ?
808 r_vel[0] = 2.0f * (
psys_frand(psys, p + 10) - 0.5f);
809 r_vel[1] = 2.0f * (
psys_frand(psys, p + 11) - 0.5f);
810 r_vel[2] = 2.0f * (
psys_frand(psys, p + 12) - 0.5f);
818 r_ave[0] = 2.0f * (
psys_frand(psys, p + 13) - 0.5f);
819 r_ave[1] = 2.0f * (
psys_frand(psys, p + 14) - 0.5f);
820 r_ave[2] = 2.0f * (
psys_frand(psys, p + 15) - 0.5f);
828 r_rot[0] = 2.0f * (
psys_frand(psys, p + 16) - 0.5f);
829 r_rot[1] = 2.0f * (
psys_frand(psys, p + 17) - 0.5f);
830 r_rot[2] = 2.0f * (
psys_frand(psys, p + 18) - 0.5f);
831 r_rot[3] = 2.0f * (
psys_frand(psys, p + 19) - 0.5f);
839 float dvec[3], q[4], mat[3][3];
877 if (dtime != 0.0f && part->
obfac != 0.0f) {
893 if (part->
ob_vel[0] != 0.0f) {
897 if (part->
ob_vel[1] != 0.0f) {
901 if (part->
ob_vel[2] != 0.0f) {
928 bool use_global_space;
935 use_global_space =
false;
939 use_global_space =
true;
945 use_global_space =
true;
951 use_global_space =
false;
954 use_global_space =
true;
960 if (use_global_space) {
981 float rot_vec_local[3];
998 float *rot_vec_local = tmat[0];
999 float *vtan_local = tmat[1];
1000 float *utan_local = tmat[2];
1145 if (pa->
time > cfra) {
1148 else if (pa->
dietime <= cfra) {
1200 for (; pt; pt = pt->
next) {
1203 if (kpsys && kpsys->totpart) {
1245 pa->totkey = totkeys;
1253 for (k = 0; k < totkeys; k++) {
1254 ksim.
ob = pt->
ob ? pt->
ob : sim->
ob;
1269 if (pt->
duration != 0.0f && k + 1 < totkeys) {
1274 else if (totkeys > 1) {
1275 key->
time = pa->time + (
float)k / (
float)(totkeys - 1) * pa->lifetime;
1278 key->
time = pa->time;
1351 if (pa->state.time == cfra) {
1379 BLI_kdtree_3d_free(psys->
tree);
1385 if (pa->state.time == cfra) {
1386 BLI_kdtree_3d_insert(psys->
tree, p, pa->prev_state.co);
1389 BLI_kdtree_3d_insert(psys->
tree, p, pa->state.co);
1393 BLI_kdtree_3d_balance(psys->
tree);
1413 float *external_acceleration,
1414 void (*force_func)(
void *forcedata,
ParticleKey *
state,
float *force,
float *impulse),
1419 {0.0f, 0.0f, 0.0f}, {0.0f, 0.0f, 0.0f}, {0.0f, 0.0f, 0.0f}, \
1426 float force[3], acceleration[3], impulse[3], dx[4][3] =
ZERO_F43, dv[4][3] =
ZERO_F43, oldpos[3];
1440 switch (integrator) {
1455 for (i = 0; i <
steps; i++) {
1459 states->
time = 0.0f;
1461 for (i = 0; i <
steps; i++) {
1465 force_func(forcedata, states + i, force, impulse);
1470 if (external_acceleration) {
1471 add_v3_v3(acceleration, external_acceleration);
1477 switch (integrator) {
1486 states[1].
time = dtime * 0.5f;
1504 states[1].
time = dtime * 0.5f;
1515 states[2].
time = dtime * 0.5f;
1525 states[3].
time = dtime;
1572 #define PSYS_FLUID_SPRINGS_INITIAL_SIZE 256
1614 float h, d, Rij[3], rij, Lij;
1620 float timefix = 25.0f * dtime;
1636 d = yield_ratio * timefix * Lij;
1638 if (rij > Lij + d) {
1639 spring->
rest_length += plasticity * (rij - Lij - d) * timefix;
1641 else if (rij < Lij - d) {
1642 spring->
rest_length -= plasticity * (Lij - d - rij) * timefix;
1645 h = 4.0f * pa1->
size;
1667 for (i = 0, spring = psys->
fluid_springs; i < psys->tot_fluidsprings; i++, spring++) {
1675 #define SPH_NEIGHBORS 512
1700 float interaction_radius,
1707 for (i = 0; i < 10 && psys[i]; i++) {
1708 pfr->
npsys = psys[i];
1733 if (npa == pfr->
pa || squared_dist < FLT_EPSILON) {
1751 dist =
sqrtf(squared_dist);
1752 q = (1.0f - dist / pfr->
h) * pfr->
massfac;
1758 pfr->
data[0] += q * q;
1759 pfr->
data[1] += q * q * q;
1769 float flow[3], offset[3], dist;
1800 float *gravity = sphdata->
gravity;
1803 float q, u, rij, dv[3];
1804 float pressure, near_pressure;
1810 float inv_mass = 1.0f / sphdata->
mass;
1811 float spring_constant = fluid->
spring_k;
1814 float interaction_radius = fluid->
radius *
1816 float h = interaction_radius * sphdata->
hfac;
1831 float density, near_density;
1833 int i, spring_index, index = pa - psys[0]->
particles;
1844 near_density =
data[1];
1846 pressure = stiffness * (density - rest_density);
1847 near_pressure = stiffness_near_fac * near_density;
1858 q = (1.0f - rij / h) * pfn->
psys->
part->
mass * inv_mass;
1867 madd_v3_v3fl(force, vec, -(pressure + near_pressure * q) * q);
1870 if (visc > 0.0f || stiff_visc > 0.0f) {
1874 if (u < 0.0f && visc > 0.0f) {
1878 if (u > 0.0f && stiff_visc > 0.0f) {
1883 if (spring_constant > 0.0f) {
1894 -10.0f * spring_constant * (1.0f - rij / h) * (spring->
rest_length - rij));
1909 force, vec, -10.0f * spring_constant * (1.0f - rij / h) * (rest_length - rij));
1915 if (fluid->
buoyancy > 0.0f && gravity) {
1928 float UNUSED(squared_dist))
1933 float qfac = 21.0f / (256.0f * (
float)
M_PI);
1942 rij_h = rij / pfr->
h;
1950 q = qfac /
pow3f(pfr->
h) *
pow4f(2.0f - rij_h) * (1.0f + 2.0f * rij_h);
1964 float UNUSED(squared_dist))
1980 rij_h = rij / pfr->
h;
2000 float *gravity = sphdata->
gravity;
2002 float dq, u, rij, dv[3];
2003 float pressure, npressure;
2007 float interaction_radius;
2022 float qfac2 = 42.0f / (256.0f * (
float)
M_PI);
2027 h = interaction_radius * sphdata->
hfac;
2055 rij_h = rij / pfr.
h;
2060 npressure = stiffness * (
pow7f(npa->
sphdensity / rest_density) - 1.0f);
2067 dq = qfac2 * (2.0f *
pow4f(2.0f - rij_h) - 4.0f *
pow3f(2.0f - rij_h) * (1.0f + 2.0f * rij_h));
2090 if (fluid->
buoyancy > 0.0f && gravity) {
2105 float interaction_radius = fluid->
radius *
2113 pfr.
h = interaction_radius * sphdata->
hfac;
2146 sphdata->
mass = 1.0f;
2151 sphdata->
hfac = 1.0f;
2157 sphdata->
hfac = 0.5f;
2187 float interaction_radius = fluid->
radius *
2192 density[0] = density[1] = 0.0f;
2194 pfr.
h = interaction_radius * sphdata->
hfac;
2199 vars[0] = pfr.
data[0];
2200 vars[1] = pfr.
data[1];
2213 float effector_acceleration[3];
2216 sphdata->
mass = pa_mass;
2222 mul_v3_fl(effector_acceleration, 1.0f / dtime);
2286 float *gravity =
NULL, gr[3];
2337 float rotfac, rot1[4], rot2[4] = {1.0, 0.0, 0.0, 0.0}, dtime = dfra * timestep, extrotfac;
2358 if (len1 == 0.0f || len2 == 0.0f) {
2373 if (rotfac == 0.0f || (part->
flag &
PART_ROT_DYN) == 0 || extrotfac == 0.0f) {
2395 #define COLLISION_MIN_RADIUS 0.001f
2396 #define COLLISION_MIN_DISTANCE 0.0001f
2397 #define COLLISION_ZERO 0.00001f
2398 #define COLLISION_INIT_STEP 0.00008f
2405 float p0[3], e1[3], e2[3], d;
2437 float v0[3],
v1[3],
v2[3],
c[3];
2463 float f = fac +
t * (1.0f - fac);
2506 float u,
e[3], vec[3];
2532 float u,
e[3], vec[3],
nor[3];
2545 float p0[3], e1[3], e2[3],
nor[3];
2571 float t0, t1, dt_init, d0, d1, dd, n[3];
2576 if (
col->inv_total_time > 0.0f) {
2588 d0 = distance_func(
col->co1, radius, pce, n);
2592 for (iter = 0; iter < 10; iter++) {
2597 d1 = distance_func(pce->
p, radius, pce, n);
2600 if (iter == 0 && d0 < 0.0f && d0 > -radius) {
2615 d0 = distance_func(
col->co2, radius, pce, n);
2616 t1 = 1.0f - dt_init;
2624 dd = (t1 - t0) / (d1 - d0);
2633 if (iter == 0 && t1 < 0.0f) {
2636 d0 = distance_func(
col->co2, radius, pce, n);
2637 t1 = 1.0f - dt_init;
2641 if (iter == 1 && (t1 < -COLLISION_ZERO || t1 > 1.0f)) {
2651 CLAMP(t1, 0.0f, 1.0f);
2674 if (ct >= 0.0f && ct < *
t && (
result->inside == 0 || pce->
inside == 1)) {
2675 float e1[3], e2[3], p0[3];
2676 float e1e1, e1e2, e1p0, e2e2, e2p0, inv;
2689 inv = 1.0f / (e1e1 * e2e2 - e1e2 * e1e2);
2690 u = (e2e2 * e1p0 - e1e2 * e2p0) * inv;
2691 v = (e1e1 * e2p0 - e1e2 * e1p0) * inv;
2693 if (u >= 0.0f && u <= 1.0f && v >= 0.0f && u +
v <= 1.0f) {
2718 for (i = 0; i < 3; i++) {
2720 cur->
x[0] = pce->
x[i];
2721 cur->
x[1] = pce->
x[(i + 1) % 3];
2722 cur->
v[0] = pce->
v[i];
2723 cur->
v[1] = pce->
v[(i + 1) % 3];
2729 if (ct >= 0.0f && ct < *
t) {
2730 float u,
e[3], vec[3];
2736 if (u < 0.0f || u > 1.0f) {
2765 for (i = 0; i < 3; i++) {
2767 cur->
x[0] = pce->
x[i];
2768 cur->
v[0] = pce->
v[i];
2774 if (ct >= 0.0f && ct < *
t) {
2798 float t = hit->
dist /
col->original_ray_length;
2801 pce.
x[0] =
x[vt->
tri[0]].co;
2802 pce.
x[1] =
x[vt->
tri[1]].co;
2803 pce.
x[2] =
x[vt->
tri[2]].co;
2814 if (
col->pce.inside == 0) {
2820 hit->
dist =
col->original_ray_length *
t;
2844 col->pce.inside = 0;
2848 if (hit->
dist == 0.0f) {
2849 hit->
dist =
col->original_ray_length = 0.000001f;
2852 for (coll = colliders->
first; coll; coll = coll->
next) {
2856 for (
int i = 0; i <
col->skip_count; i++) {
2857 if (coll->
ob ==
col->skip[i]) {
2872 col->current = coll->
ob;
2879 if (
col->md &&
col->md->bvhtree) {
2891 return hit->
index >= 0;
2898 int dynamic_rotation)
2906 float x = hit->
dist /
col->original_ray_length;
2908 float f =
col->f +
x * (1.0f -
col->f);
2910 float dt1 = (f -
col->f) *
col->total_time;
2912 float dt2 = (1.0f - f) *
col->total_time;
2942 float v0_dot, vc_dot;
2947 CLAMP(damp, 0.0f, 1.0f);
2948 CLAMP(frict, 0.0f, 1.0f);
2968 if (dynamic_rotation) {
2969 float vr_tan[3], v1_tan[3], ave[3];
2987 mul_v3_fl(v1_tan, 1.0f - 0.01f * frict);
3013 if (v0_dot < 0.0f) {
3015 if (v0_dot > 0.0f) {
3021 v0_dot *= 1.0f - damp;
3022 vc_dot *= through ? damp : 1.0f;
3026 if (through == 0 && ((vc_dot > 0.0f && v0_dot > 0.0f && vc_dot > v0_dot) ||
3027 (vc_dot < 0.0f && v0_dot < 0.0f && vc_dot < v0_dot))) {
3030 else if (v0_dot > 0.0f) {
3034 mul_v3_v3fl(v0_nor, pce->
nor, vc_dot + (through ? 1.0f : -1.0f) * v0_dot);
3044 co[2] =
col->boid_z;
3093 col->skip[
col->skip_count++] =
col->hit;
3124 int collision_count = 0;
3130 col.total_time = timestep * dfra;
3131 col.inv_total_time = 1.0f /
col.total_time;
3132 col.inv_timestep = 1.0f / timestep;
3185 const bool use_render_params)
3190 int distr = 0, alloc = 0, skip = 0;
3279 const float min_length = 0.1f * max_length;
3288 for (k = 1, key = pa->
hair + 1; k < pa->totkey; k++, key++) {
3290 if (
length < min_length) {
3328 float hairmat[4][4];
3342 hairdata = *r_hairdata;
3352 for (k = 1, key = pa->
hair + 1; k < pa->totkey; k++, key++) {
3354 if (max_length <
length) {
3364 hair_radius = part->
size;
3371 float root_mat[4][4];
3372 float bending_stiffness;
3385 for (k = 0, key = pa->
hair; k < pa->totkey; k++, key++) {
3387 float *co, *co_next;
3390 co_next = (key + 1)->co;
3398 hair->
radius = hair_radius;
3419 hair->
radius = hair_radius;
3444 hair_index += pa->
totkey + 1;
3456 float(*deformedVerts)[3];
3474 totpoint += pa->
totkey + 1;
3479 realloc_roots =
false;
3485 realloc_roots =
true;
3587 key = root = pa->
hair;
3629 float relative_vel[3];
3667 if (dt_target > psys->
dt_frac) {
3678 if (t_frac == 1.0f) {
3682 return 1.0f - t_frac;
3703 void *__restrict join_v,
3704 void *__restrict chunk_v)
3707 SPHData *sphdata_from = chunk_v;
3728 SPHData *sphdata = tls->userdata_chunk;
3732 if ((pa = psys->
particles + p)->state.time <= 0.0f) {
3764 if ((pa = psys->
particles + p)->state.time <= 0.0f) {
3772 void *__restrict userdata,
const int p,
const TaskParallelTLS *__restrict tls)
3778 SPHData *sphdata = tls->userdata_chunk;
3782 if ((pa = psys->
particles + p)->state.time <= 0.0f) {
3798 SPHData *sphdata = tls->userdata_chunk;
3802 if ((pa = psys->
particles + p)->state.time <= 0.0f) {
3833 float birthtime, dietime;
3836 dfra = cfra - psys->
cfra;
3839 dtime = dfra * timestep;
3879 for (; pt; pt = pt->
next) {
3881 if (psys_target && psys_target != psys) {
3912 birthtime = pa->
time;
3918 if (dietime <= cfra && psys->cfra < dietime) {
3923 else if (birthtime <= cfra && birthtime >= psys->
cfra) {
3929 else if (dietime < cfra) {
3990 .timestep = timestep,
4108 float disp, dietime;
4127 if (pa->
time > cfra) {
4133 else if (dietime <= cfra) {
4181 const bool use_render_params)
4204 int p, totpart = 0, tottypepart = 0;
4205 int flagActivePart, activeParts = 0;
4206 float posX, posY, posZ, velX, velY, velZ;
4207 float resX, resY, resZ;
4209 char debugStrBuffer[256];
4210 float tmp[3] = {0}, tmp2[3] = {0};
4213 float min[3],
max[3],
size[3], cell_size_scaled[3], max_size;
4227 sizeof(debugStrBuffer),
4228 "particles_fluid_step::error - found particle system that is not enabled in "
4242 for (p = 0; p < totpart; p++) {
4259 if (!totpart || !tottypepart) {
4264 tottypepart = (use_render_params) ? tottypepart : (part->
disp * tottypepart) / 100;
4267 part->
sta = part->
end = 1.0f;
4278 for (p = 0, pa = psys->
particles; p < totpart; p++) {
4324 sizeof(debugStrBuffer),
4325 "particles_fluid_step::error - unknown particle system type\n");
4330 printf(
"system type is %d and particle type is %d\n", part->
type, flagActivePart);
4349 printf(
"system type is %d and particle type is %d\n", part->
type, flagActivePart);
4353 if (activeParts >= tottypepart) {
4376 max_size =
MAX3(
size[0] / (
float)upres,
size[1] / (
float)upres,
size[2] / (
float)upres);
4379 const float posParticle[3] = {posX, posY, posZ};
4383 float resDomain[3] = {resX, resY, resZ};
4389 float scaleAbs[3] = {
4408 printf(
"pa->state.co[0]: %f, pa->state.co[1]: %f, pa->state.co[2]: %f\n",
4412 const float velParticle[3] = {velX, velY, velZ};
4417 printf(
"pa->state.vel[0]: %f, pa->state.vel[1]: %f, pa->state.vel[2]: %f\n",
4435 printf(
"active parts: %d\n", activeParts);
4450 int oldtotpart = psys->
totpart;
4453 if (totpart != oldtotpart) {
4457 return totpart - oldtotpart;
4477 float disp, cache_cfra = cfra;
4478 int startframe = 0, endframe = 100, oldtotpart = 0;
4501 CLAMP(cache_cfra, startframe, endframe);
4577 int dframe, totframesback = 0;
4578 float t_frac, dt_frac;
4582 if ((
int)cfra == startframe && part->
sta < startframe) {
4583 totframesback = (startframe - (int)part->
sta);
4590 else if ((
int)cfra == startframe) {
4599 for (dframe = -totframesback; dframe <= 0; dframe++) {
4602 for (t_frac = dt_frac; t_frac <= 1.0f; t_frac += dt_frac) {
4605 psys->
cfra = cfra + dframe + t_frac - 1.0f;
4619 if ((
int)cache_cfra != startframe) {
4693 else if (pa->
boid) {
4760 return particle_settings_local;
4777 const bool use_render_params)
4806 if (psys->
cfra == cfra) {
4839 int i, recalc = psys->
recalc;
4855 psys->
part = part_local;
4858 for (i = 0; i <= part->
hair_step; i++) {
4872 if (part_local != part) {
4885 hair_step(&sim, cfra, use_render_params);
4899 bool free_unexisting =
false;
4910 free_unexisting =
true;
4934 if (free_unexisting) {
4959 if (psys_orig->
edit) {
4967 if (psys_orig != psys) {
5003 data->func(
data->psys, id_pointer,
data->userdata, cb_flag);
5034 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, const 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_lattice_deform_data_destroy(struct LatticeDeformData *lattice_deform_data)
void BKE_libblock_free_data(struct ID *id, const bool do_id_user) ATTR_NONNULL()
struct ID * BKE_id_copy_ex(struct Main *bmain, const struct ID *id, struct ID **r_newid, const int flag)
void BKE_id_free(struct Main *bmain, void *idv)
void BKE_libblock_free_datablock(struct ID *id, const 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])
void BKE_mesh_tessface_ensure(struct Mesh *mesh)
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, const bool do_ensure_tess_cd)
float(* BKE_mesh_vert_coords_alloc(const struct Mesh *mesh, int *r_vert_len))[3]
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)
#define PARTICLE_DRAW_DATA_UPDATED
void psys_vec_rot_to_face(struct Mesh *mesh, struct ParticleData *pa, float vec[3])
void precalc_guides(struct ParticleSimulationData *sim, struct ListBase *effectors)
struct LatticeDeformData * psys_create_lattice_deform_data(struct ParticleSimulationData *sim)
#define LOOP_SHOWN_PARTICLES
int do_guides(struct Depsgraph *depsgraph, struct ParticleSettings *part, struct ListBase *effectors, ParticleKey *state, int index, float time)
struct ParticleSystem * psys_orig_get(struct ParticleSystem *psys)
void copy_particle_key(struct ParticleKey *to, struct ParticleKey *from, int time)
void psys_cache_paths(struct ParticleSimulationData *sim, float cfra, const bool use_render_params)
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_particle_dm_face_lookup(struct Mesh *mesh_final, struct Mesh *mesh_original, int findex, const float fw[4], struct LinkNode **poly_nodes)
int psys_uses_gravity(struct ParticleSimulationData *sim)
int psys_get_particle_state(struct ParticleSimulationData *sim, int p, struct ParticleKey *state, int always)
float psys_particle_value_from_verts(struct Mesh *mesh, short from, struct ParticleData *pa, float *values)
#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_find_parents(struct ParticleSimulationData *sim, const bool use_render_params)
void psys_free_pdd(struct ParticleSystem *psys)
#define PARTICLE_COLLISION_MAX_COLLISIONS
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)
bool psys_check_enabled(struct Object *ob, struct ParticleSystem *psys, const bool use_render_params)
void psys_cache_child_paths(struct ParticleSimulationData *sim, float cfra, const bool editupdate, const bool use_render_params)
BLI_INLINE float psys_frand(ParticleSystem *psys, unsigned int seed)
@ BKE_PARTICLE_BATCH_DIRTY_ALL
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)
@ PT_CACHE_EDIT_UPDATE_PARTICLE_FROM_EVAL
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)
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 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)
EdgeHash * BLI_edgehash_new_ex(const char *info, const unsigned int nentries_reserve)
void BLI_edgehash_insert(EdgeHash *eh, unsigned int v0, unsigned int v1, void *val)
void * BLI_edgehash_lookup(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 mat3_to_quat(float q[4], const float mat[3][3])
void axis_angle_to_quat(float r[4], const float axis[3], const float angle)
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 interp_qt_qtqt(float q[4], const float a[4], const float b[4], const float t)
void copy_qt_qt(float q[4], const float a[4])
void vec_to_quat(float q[4], const float vec[3], short axis, const short upflag)
void interp_v3_v3v3(float r[3], const float a[3], const float b[3], const float t)
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
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 len)
void BLI_task_parallel_range(const int start, const 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
#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
@ PART_FLUID_SPRAYFOAMBUBBLE
#define PTCACHE_REDO_NEEDED
#define PTCACHE_DISK_CACHE
#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 RGB to Bright Vector Camera 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)
SIMD_FORCE_INLINE btScalar length(const btQuaternion &q)
Return the length of a quaternion.
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
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)
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
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)
static void hair_create_input_mesh(ParticleSimulationData *sim, int totpoint, int totedge, Mesh **r_mesh, ClothHairData **r_hairdata)
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)
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
struct CustomData vdata edata fdata
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 LatticeDeformData * lattice_deform_data
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
ccl_device_inline float distance(const float2 &a, const float2 &b)
ccl_device_inline float dot(const float2 &a, const float2 &b)