126 #define MID_PRESERVE 1
128 #define SOFTGOALSNAP 0.999f
132 #define HEUNWARNLIMIT 1
134 #define BSF_INTERSECT 1
137 #define SBF_DOFUZZY 1
138 #define SBF_OUTOFCOLLISION 2
140 #define BFF_INTERSECT 1
141 #define BFF_CLOSEVERT 2
213 if (bp->
goal < 0.0f) {
302 for (i = 0; i < pccd_M->
mvert_num; i++) {
322 for (i = 0, mima = pccd_M->
mima, vt = pccd_M->
tri; i < pccd_M->tri_num; i++, mima++, vt++) {
392 for (i = 0; i < pccd_M->
mvert_num; i++) {
417 for (i = 0, mima = pccd_M->
mima, vt = pccd_M->
tri; i < pccd_M->tri_num; i++, mima++, vt++) {
513 unsigned int numobjects;
517 for (
int i = 0; i < numobjects; i++) {
546 if ((!
hash) || (!vertexowner)) {
550 unsigned int numobjects;
554 for (
int i = 0; i < numobjects; i++) {
631 int a,
b,
c, notthis = 0, v0;
664 if ((bs2->
v1 != notthis) && (bs2->
v1 > v0)) {
673 if ((bs2->
v2 != notthis) && (bs2->
v2 > v0)) {
693 stiffness *= stiffness;
768 int a,
b, akku_count;
792 if (akku_count > 0) {
840 for (i = 0; i < totpoint; i++) {
872 for (k = 0; k < sb->
totkey; k++) {
873 key = *(sb->
keys + k);
966 unsigned int numobjects;
971 return (numobjects != 0);
977 struct Object *vertexowner,
984 float aabbmin[3], aabbmax[3];
1006 if ((aabbmax[0] < ccdm->
bbmin[0]) || (aabbmax[1] < ccdm->
bbmin[1]) ||
1007 (aabbmax[2] < ccdm->
bbmin[2]) || (aabbmin[0] > ccdm->
bbmax[0]) ||
1008 (aabbmin[1] > ccdm->
bbmax[1]) || (aabbmin[2] > ccdm->
bbmax[2])) {
1035 const float face_v2[3],
1036 const float face_v3[3],
1039 struct Object *vertexowner,
1045 float nv1[3], edge1[3], edge2[3], d_nvect[3], aabbmin[3], aabbmax[3];
1046 float facedist, outerfacethickness, tune = 10.0f;
1047 int a, deflected = 0;
1049 aabbmin[0] =
min_fff(face_v1[0], face_v2[0], face_v3[0]);
1050 aabbmin[1] =
min_fff(face_v1[1], face_v2[1], face_v3[1]);
1051 aabbmin[2] =
min_fff(face_v1[2], face_v2[2], face_v3[2]);
1052 aabbmax[0] =
max_fff(face_v1[0], face_v2[0], face_v3[0]);
1053 aabbmax[1] =
max_fff(face_v1[1], face_v2[1], face_v3[1]);
1054 aabbmax[2] =
max_fff(face_v1[2], face_v2[2], face_v3[2]);
1074 mvert = ccdm->
mvert;
1078 if ((aabbmax[0] < ccdm->
bbmin[0]) || (aabbmax[1] < ccdm->
bbmin[1]) ||
1079 (aabbmax[2] < ccdm->
bbmin[2]) || (aabbmin[0] > ccdm->
bbmax[0]) ||
1080 (aabbmin[1] > ccdm->
bbmax[1]) || (aabbmin[2] > ccdm->
bbmax[2])) {
1104 if (
fabsf(facedist) < outerfacethickness) {
1108 df = (outerfacethickness - facedist) / outerfacethickness;
1111 df = (outerfacethickness + facedist) / outerfacethickness;
1116 df = 0.01f *
expf(-100.0f * df);
1133 const float face_v2[3],
1134 const float face_v3[3],
1137 struct Object *vertexowner,
1143 float nv1[3], nv2[3], nv3[3], edge1[3], edge2[3], d_nvect[3], aabbmin[3], aabbmax[3];
1144 float t, tune = 10.0f;
1145 int a, deflected = 0;
1147 aabbmin[0] =
min_fff(face_v1[0], face_v2[0], face_v3[0]);
1148 aabbmin[1] =
min_fff(face_v1[1], face_v2[1], face_v3[1]);
1149 aabbmin[2] =
min_fff(face_v1[2], face_v2[2], face_v3[2]);
1150 aabbmax[0] =
max_fff(face_v1[0], face_v2[0], face_v3[0]);
1151 aabbmax[1] =
max_fff(face_v1[1], face_v2[1], face_v3[1]);
1152 aabbmax[2] =
max_fff(face_v1[2], face_v2[2], face_v3[2]);
1169 mvert = ccdm->
mvert;
1175 if ((aabbmax[0] < ccdm->
bbmin[0]) || (aabbmax[1] < ccdm->
bbmin[1]) ||
1176 (aabbmax[2] < ccdm->
bbmin[2]) || (aabbmin[0] > ccdm->
bbmax[0]) ||
1177 (aabbmin[1] > ccdm->
bbmax[1]) || (aabbmin[2] > ccdm->
bbmax[2])) {
1192 if ((aabbmax[0] < mima->
minx) || (aabbmin[0] > mima->
maxx) ||
1193 (aabbmax[1] < mima->
miny) || (aabbmin[1] > mima->
maxy) ||
1194 (aabbmax[2] < mima->
minz) || (aabbmin[2] > mima->
maxz)) {
1246 float damp = 0.0f, choke = 1.0f;
1247 float tune = -10.0f;
1312 const float edge_v2[3],
1315 struct Object *vertexowner,
1321 float nv1[3], nv2[3], nv3[3], edge1[3], edge2[3], d_nvect[3], aabbmin[3], aabbmax[3];
1323 int a, deflected = 0;
1345 mvert = ccdm->
mvert;
1351 if ((aabbmax[0] < ccdm->
bbmin[0]) || (aabbmax[1] < ccdm->
bbmin[1]) ||
1352 (aabbmax[2] < ccdm->
bbmin[2]) || (aabbmin[0] > ccdm->
bbmax[0]) ||
1353 (aabbmin[1] > ccdm->
bbmax[1]) || (aabbmin[2] > ccdm->
bbmax[2])) {
1368 if ((aabbmax[0] < mima->
minx) || (aabbmin[0] > mima->
maxx) ||
1369 (aabbmax[1] < mima->
miny) || (aabbmin[1] > mima->
maxy) ||
1370 (aabbmax[2] < mima->
minz) || (aabbmin[2] > mima->
maxz)) {
1402 float intrusiondepth,
i1, i2;
1407 intrusiondepth = -
min_ff(
i1, i2) / el;
1433 for (
a = ifirst;
a < ilast;
a++) {
1436 feedback[0] = feedback[1] = feedback[2] = 0.0f;
1455 float vel[3], sp[3], pr[3], force[3];
1456 float f, windfactor = 0.25f;
1460 float speed[3] = {0.0f, 0.0f, 0.0f};
1476 f = -0.0001f * f * f * sb->
aeroedge;
1511 int *
UNUSED(ptr_to_break_func(
void)))
1515 int i, totthread,
left, dec;
1519 int lowsprings = 100;
1527 while ((totsprings / totthread < lowsprings) && (totthread > 1)) {
1534 dec = totsprings / totthread + 1;
1535 for (i = 0; i < totthread; i++) {
1537 sb_threads[i].
ob = ob;
1539 sb_threads[i].
timenow = timenow;
1546 sb_threads[i].
ifirst = 0;
1552 sb_threads[i].
nr = i;
1553 sb_threads[i].
tot = totthread;
1555 if (totthread > 1) {
1558 for (i = 0; i < totthread; i++) {
1576 float *
w,
float *
pos,
float *
a,
float *
b,
float *
c,
float *ca,
float *cb,
float *cc)
1607 float facenormal[3],
1610 struct Object *vertexowner,
1618 float nv1[3], nv2[3], nv3[3], edge1[3], edge2[3], d_nvect[3], dv1[3], ve[3],
1619 avel[3] = {0.0, 0.0, 0.0}, vv1[3], vv2[3], vv3[3], coledge[3] = {0.0f, 0.0f, 0.0f},
1620 mindistedge = 1000.0f, outerforceaccu[3], innerforceaccu[3], facedist,
1621 force_mag_norm, minx, miny, minz, maxx, maxy, maxz,
1622 innerfacethickness = -0.5f, outerfacethickness = 0.2f, ee = 5.0f, ff = 0.1f, fa = 1;
1623 int a, deflected = 0, cavel = 0, ci = 0;
1628 outerforceaccu[0] = outerforceaccu[1] = outerforceaccu[2] = 0.0f;
1629 innerforceaccu[0] = innerforceaccu[1] = innerforceaccu[2] = 0.0f;
1644 mvert = ccdm->
mvert;
1650 minx = ccdm->
bbmin[0];
1651 miny = ccdm->
bbmin[1];
1652 minz = ccdm->
bbmin[2];
1654 maxx = ccdm->
bbmax[0];
1655 maxy = ccdm->
bbmax[1];
1656 maxz = ccdm->
bbmax[2];
1658 if ((opco[0] < minx) || (opco[1] < miny) || (opco[2] < minz) || (opco[0] > maxx) ||
1659 (opco[1] > maxy) || (opco[2] > maxz)) {
1676 fa = (ff * outerfacethickness - outerfacethickness);
1679 avel[0] = avel[1] = avel[2] = 0.0f;
1682 if ((opco[0] < mima->
minx) || (opco[0] > mima->
maxx) || (opco[1] < mima->
miny) ||
1683 (opco[1] > mima->
maxy) || (opco[2] < mima->
minz) || (opco[2] > mima->
maxz)) {
1727 if ((facedist > innerfacethickness) && (facedist < outerfacethickness)) {
1729 force_mag_norm = (
float)
exp(-ee * facedist);
1730 if (facedist > outerfacethickness * ff) {
1731 force_mag_norm = (
float)force_mag_norm * fa * (facedist - outerfacethickness) *
1732 (facedist - outerfacethickness);
1735 if (facedist > 0.0f) {
1736 *damp *= (1.0f - facedist / outerfacethickness);
1742 if (deflected < 2) {
1746 if ((mprevvert) && (*damp > 0.0f)) {
1751 *intrusion += facedist;
1764 if (deflected == 1) {
1765 force_mag_norm = (
float)
exp(-ee * mindistedge);
1766 if (mindistedge > outerfacethickness * ff) {
1767 force_mag_norm = (
float)force_mag_norm * fa * (mindistedge - outerfacethickness) *
1768 (mindistedge - outerfacethickness);
1772 if (mindistedge > 0.0f) {
1773 *damp *= (1.0f - mindistedge / outerfacethickness);
1776 if (deflected == 2) {
1779 if (deflected == 3) {
1811 s_actpos, facenormal, cf, force, ob,
time, vel, intrusion);
1813 deflected = sb_detect_vertex_collisionCachedEx(
1814 s_actpos, facenormal, cf, force, ob,
time, vel, intrusion);
1821 static void dfdx_spring(
int ia,
int ic,
int op,
float dir[3],
float L,
float len,
float factor)
1826 for (i = 0; i < 3; i++) {
1827 for (j = 0; j < 3; j++) {
1828 delta_ij = (i == j ? (1.0f) : (0.0f));
1829 m = factor * (dir[i] * dir[j] + (1 -
L /
len) * (delta_ij - dir[i] * dir[j]));
1835 for (i = 0; i < 3; i++) {
1836 for (j = 0; j < 3; j++) {
1837 m = factor * dir[i] * dir[j];
1844 static void dfdx_goal(
int ia,
int ic,
int op,
float factor)
1847 for (i = 0; i < 3; i++) {
1852 static void dfdv_goal(
int ia,
int ic,
float factor)
1855 for (i = 0; i < 3; i++) {
1867 float dir[3], dvel[3];
1868 float distance, forcefactor, kd, absvel, projvel, kw;
1873 if (bpi == bs->
v1) {
1881 else if (bpi == bs->
v2) {
1891 CLOG_WARN(&
LOG,
"bodypoint <bpi> is not attached to spring <*bs>");
1899 iks = 1.0f / (1.0f - sb->
inspring) - 1.0f;
1902 iks = 1.0f / (1.0f - sb->
inpush) - 1.0f;
1905 if (bs->
len > 0.0f) {
1906 forcefactor = iks / bs->
len;
1936 kd *= absvel * projvel;
1949 int *
UNUSED(ptr_to_break_func(
void)),
1956 int bb, do_selfcollision, do_springcollision, do_aero;
1957 int number_of_points_here = ilast - ifirst;
1984 bp = &sb->
bpoint[ifirst];
1985 for (bb = number_of_points_here; bb > 0; bb--, bp++) {
1990 if (do_selfcollision) {
1995 float velcenter[3], dvel[3], def[3];
2007 if ((
fabsf(def[0]) > compare) || (
fabsf(def[1]) > compare) || (
fabsf(def[2]) > compare)) {
2016 if (
ELEM(ilast - bb, bs->
v2, bs->
v1)) {
2023 2.0f * bstune / compare;
2047 bp->
force[0] += -ks * (auxvect[0]);
2048 bp->
force[1] += -ks * (auxvect[1]);
2049 bp->
force[2] += -ks * (auxvect[2]);
2058 bp->
force[0] -= kd * (auxvect[0]);
2059 bp->
force[1] -= kd * (auxvect[1]);
2060 bp->
force[2] -= kd * (auxvect[2]);
2063 bp->
force[0] -= kd * (velgoal[0] - bp->
vec[0]);
2064 bp->
force[1] -= kd * (velgoal[1] - bp->
vec[1]);
2065 bp->
force[2] -= kd * (velgoal[2] - bp->
vec[2]);
2087 float force[3] = {0.0f, 0.0f, 0.0f};
2088 float speed[3] = {0.0f, 0.0f, 0.0f};
2097 mul_v3_fl(force, fieldfactor * eval_sb_fric_force_scale);
2101 kd = sb->
mediafrict * eval_sb_fric_force_scale;
2102 bp->
force[0] -= kd * (bp->
vec[0] + windfactor * speed[0] / eval_sb_fric_force_scale);
2103 bp->
force[1] -= kd * (bp->
vec[1] + windfactor * speed[1] / eval_sb_fric_force_scale);
2104 bp->
force[2] -= kd * (bp->
vec[2] + windfactor * speed[2] / eval_sb_fric_force_scale);
2121 float cfforce[3], defforce[3] = {0.0f, 0.0f, 0.0f}, vel[3] = {0.0f, 0.0f, 0.0f},
2122 facenormal[3], cf = 1.0f, intrusion;
2125 if (
sb_deflect_face(ob, bp->
pos, facenormal, defforce, &cf, timenow, vel, &intrusion)) {
2126 if (intrusion < 0.0f) {
2141 iks = 1.0f / (1.0f - sb->
inspring) - 1.0f;
2148 if (do_springcollision || do_aero) {
2187 int *
UNUSED(ptr_to_break_func(
void)),
2195 int i, totthread,
left, dec;
2199 int lowpoints = 100;
2204 while ((totpoint / totthread < lowpoints) && (totthread > 1)) {
2213 dec = totpoint / totthread + 1;
2214 for (i = 0; i < totthread; i++) {
2216 sb_threads[i].
ob = ob;
2218 sb_threads[i].
timenow = timenow;
2225 sb_threads[i].
ifirst = 0;
2231 sb_threads[i].
nr = i;
2232 sb_threads[i].
tot = totthread;
2235 if (totthread > 1) {
2238 for (i = 0; i < totthread; i++) {
2261 float fieldfactor = -1.0f, windfactor = 0.25;
2262 int do_deflector , do_springcollision, do_aero;
2278 if (do_springcollision || do_aero) {
2317 float dx[3] = {0}, dv[3], aabbmin[3], aabbmax[3], cm[3] = {0.0f, 0.0f, 0.0f};
2318 float timeovermass ;
2319 float maxerrpos = 0.0f, maxerrvel = 0.0f;
2324 aabbmin[0] = aabbmin[1] = aabbmin[2] = 1e20f;
2325 aabbmax[0] = aabbmax[1] = aabbmax[2] = -1e20f;
2331 timeovermass = forcetime / sb->
nodemass;
2334 timeovermass = forcetime / 0.009999f;
2345 timeovermass = forcetime / 0.009999f;
2432 if (bp->
choke > 0.0f) {
2483 static void softbody_store_step(
Object *ob)
2496 static void softbody_store_state(
Object *ob,
float *ppos,
float *pvel)
2501 float *pp = ppos, *pv = pvel;
2514 static void softbody_retrieve_state(
Object *ob,
float *ppos,
float *pvel)
2519 float *pp = ppos, *pv = pvel;
2532 static void softbody_swap_state(
Object *ob,
float *ppos,
float *pvel)
2537 float *pp = ppos, *pv = pvel;
2591 if ((
r > 1.05f) || (
r < 0.95f)) {
2592 bs->
len = ((100.0f -
b) * bs->
len +
b *
l) / 100.0f;
2670 int defgroup_index, defgroup_index_mass, defgroup_index_spring;
2709 if (defgroup_index_mass != -1) {
2713 if (defgroup_index_spring != -1) {
2722 for (
a = me->
totedge;
a > 0;
a--, medge++, bs++) {
2781 float accu_pos[3] = {0.0f, 0.0f, 0.0f};
2782 float accu_mass = 0.0f;
2815 int u,
v,
w, dv, dw, bpc = 0, bpuc;
2818 dw = dv * lt->
pntsv;
2824 for (u = 0, bpuc = 0, bpu =
NULL; u < lt->
pntsu; u++, bp++, bpc++) {
2853 bs->
v2 = bpc - dw - dv - 1;
2855 bs->
len =
globallen((bp - dw - dv - 1)->vec, bp->vec, ob);
2858 if ((v < lt->pntsv - 1) && (u != 0)) {
2860 bs->
v2 = bpc - dw + dv - 1;
2862 bs->
len =
globallen((bp - dw + dv - 1)->vec, bp->vec, ob);
2867 if (w < lt->pntsw - 1) {
2870 bs->
v2 = bpc + dw - dv - 1;
2872 bs->
len =
globallen((bp + dw - dv - 1)->vec, bp->vec, ob);
2875 if ((v < lt->pntsv - 1) && (u != 0)) {
2877 bs->
v2 = bpc + dw + dv - 1;
2879 bs->
len =
globallen((bp + dw + dv - 1)->vec, bp->vec, ob);
2896 int totvert, totspring = 0,
a;
2899 int defgroup_index, defgroup_index_mass, defgroup_index_spring;
2922 for (
a = 0;
a < totvert;
a++, bp++, bpnt++) {
2935 if (defgroup_index_mass != -1) {
2939 if (defgroup_index_spring != -1) {
2964 int a, curindex = 0;
2965 int totvert, totspring = 0, setgoal = 0;
3001 for (bezt = nu->
bezt,
a = 0; a < nu->pntsu;
a++, bezt++, bp += 3, curindex += 3) {
3006 (bp + 1)->goal = bp->
goal;
3007 (bp + 2)->goal = bp->
goal;
3015 bs->
v1 = curindex - 3;
3022 bs->
v2 = curindex + 1;
3027 bs->
v1 = curindex + 1;
3028 bs->
v2 = curindex + 2;
3036 for (bpnt = nu->
bp,
a = 0; a < nu->pntsu * nu->
pntsv;
a++, bpnt++, bp++, curindex++) {
3040 if (totspring &&
a > 0) {
3041 bs->
v1 = curindex - 1;
3072 for (
a = 0;
a < numVerts;
a++, bp++) {
3188 return ((
Mesh *)ob->
data)->totedge;
3204 float (*vertexCos)[3],
3210 if (!sb || !sb->
bpoint) {
3214 for (
a = 0, bp = sb->
bpoint;
a < numVerts;
a++, bp++) {
3234 float com[3], rcom[3];
3237 if (!ob || !ob->
soft) {
3241 if (!sb || !sb->
bpoint) {
3274 for (
a = 0, bp = sb->
bpoint;
a < numVerts;
a++, bp++) {
3280 bp->
vec[0] = bp->
vec[1] = bp->
vec[2] = 0.0f;
3343 if (dtime < 0 || dtime > 10.5f) {
3359 float forcetimemax = 1.0f;
3361 float forcetimemin = 0.01f;
3363 float timedone = 0.0;
3370 forcetimemax = dtime / sb->
minloops;
3373 forcetimemin = dtime / sb->
maxloops;
3380 forcetime = forcetimemax;
3381 while ((
fabsf(timedone) <
fabsf(dtime)) && (loops < 2000)) {
3399 if (forcetime > forcetimemin) {
3400 forcetime =
max_ff(forcetime / 2.0f, forcetimemin);
3405 timedone += forcetime;
3409 float newtime = forcetime * 1.1f;
3414 newtime = forcetime;
3419 newtime = forcetime;
3422 timedone += forcetime;
3423 newtime =
min_ff(forcetimemax,
max_ff(newtime, forcetimemin));
3425 if (forcetime > 0.0f) {
3426 forcetime =
min_ff(dtime - timedone, newtime);
3429 forcetime =
max_ff(dtime - timedone, newtime);
3435 if (sct - sst > 0.5) {
3436 printf(
"%3.0f%% \r", 100.0f * timedone / dtime);
3451 printf(
"\r needed %d steps/frame", loops);
3476 if ((sct - sst > 0.5) || (
G.debug &
G_DEBUG)) {
3477 printf(
" solver time %f sec %s\n", sct - sst, ob->
id.
name);
3488 object->soft->last_frame = framenr;
3496 float (*vertexCos)[3],
3502 float dtime, timescale;
3503 int framedelta, framenr, startframe, endframe;
3507 framenr = (int)cfra;
3508 framedelta = framenr - cache->
simframe;
3521 if (framenr < startframe) {
3525 if (framenr > endframe) {
3557 if (framenr == startframe) {
3600 if (can_write_cache) {
3606 if (!can_simulate) {
3611 if (cache->
simframe == startframe &&
3619 dtime = framedelta * timescale;
typedef float(TangentPoint)[2]
struct Object ** BKE_collision_objects_create(struct Depsgraph *depsgraph, struct Object *self, struct Collection *collection, unsigned int *numcollobj, unsigned int modifier_type)
void BKE_collision_objects_free(struct Object **objects)
int BKE_nurbList_verts_count(const struct ListBase *nurb)
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_soft(struct Scene *scene, float *loc, float *vel, int index, struct EffectedPoint *point)
struct EffectorWeights * BKE_effector_add_weights(struct Collection *collection)
struct ListBase * BKE_effectors_create(struct Depsgraph *depsgraph, struct Object *ob_src, struct ParticleSystem *psys_src, struct EffectorWeights *weights, bool use_rotation)
void BKE_mesh_recalc_looptri(const struct MLoop *mloop, const struct MPoly *mpoly, const struct MVert *mvert, int totloop, int totpoly, struct MLoopTri *mlooptri)
struct ModifierData * BKE_modifiers_findby_type(const struct Object *ob, ModifierType type)
void BKE_ptcache_id_time(PTCacheID *pid, struct Scene *scene, float cfra, int *startframe, int *endframe, float *timescale)
void BKE_ptcache_validate(struct PointCache *cache, int framenr)
void BKE_ptcache_id_from_softbody(PTCacheID *pid, struct Object *ob, struct SoftBody *sb)
#define PTCACHE_READ_INTERPOLATED
int BKE_ptcache_id_reset(struct Scene *scene, PTCacheID *id, int mode)
struct PointCache * BKE_ptcache_add(struct ListBase *ptcaches)
int BKE_ptcache_read(PTCacheID *pid, float cfra, bool no_extrapolate_old)
int BKE_ptcache_write(PTCacheID *pid, unsigned int cfra)
void BKE_ptcache_free_list(struct ListBase *ptcaches)
#define PTCACHE_RESET_OUTDATED
void BKE_ptcache_invalidate(struct PointCache *cache)
#define PTCACHE_READ_EXACT
int BKE_scene_num_threads(const struct Scene *scene)
BLI_INLINE void * BLI_ghashIterator_getKey(GHashIterator *ghi) ATTR_WARN_UNUSED_RESULT
void BLI_ghashIterator_step(GHashIterator *ghi)
void BLI_ghashIterator_free(GHashIterator *ghi)
BLI_INLINE void * BLI_ghashIterator_getValue(GHashIterator *ghi) ATTR_WARN_UNUSED_RESULT
void(* GHashValFreeFP)(void *val)
void * BLI_ghash_lookup(const GHash *gh, const void *key) ATTR_WARN_UNUSED_RESULT
GHashIterator * BLI_ghashIterator_new(GHash *gh) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT
void BLI_ghash_free(GHash *gh, GHashKeyFreeFP keyfreefp, GHashValFreeFP valfreefp)
GHash * BLI_ghash_ptr_new(const char *info) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT
bool BLI_ghash_ensure_p(GHash *gh, void *key, void ***r_val) ATTR_WARN_UNUSED_RESULT
BLI_INLINE bool BLI_ghashIterator_done(const GHashIterator *ghi) ATTR_WARN_UNUSED_RESULT
int BLI_listbase_count(const struct ListBase *listbase) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
MINLINE float max_fff(float a, float b, float c)
MINLINE float max_ff(float a, float b)
MINLINE float min_ff(float a, float b)
MINLINE float min_fff(float a, float b, float c)
MINLINE int poly_to_tri_count(int poly_count, int corner_count)
void vcloud_estimate_transform_v3(int list_size, const float(*pos)[3], const float *weight, const float(*rpos)[3], const float *rweight, float lloc[3], float rloc[3], float lrot[3][3], float lscale[3][3])
bool isect_line_segment_tri_v3(const float p1[3], const float p2[3], const float v0[3], const float v1[3], const float v2[3], float *r_lambda, float r_uv[2])
bool isect_point_tri_prism_v3(const float p[3], const float v1[3], const float v2[3], const float v3[3])
void copy_m3_m3(float m1[3][3], const float m2[3][3])
void unit_m3(float m[3][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])
MINLINE float len_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
void minmax_v3v3_v3(float min[3], float max[3], const float vec[3])
MINLINE void madd_v3_v3fl(float r[3], const float a[3], float f)
MINLINE float normalize_v3(float r[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])
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 float normalize_v3_v3(float r[3], const float a[3])
void mid_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void zero_v3(float r[3])
MINLINE void add_v3_v3(float r[3], const float a[3])
void BLI_threadpool_init(struct ListBase *threadbase, void *(*do_thread)(void *), int tot)
void BLI_threadpool_end(struct ListBase *threadbase)
void BLI_threadpool_insert(struct ListBase *threadbase, void *callerdata)
#define CLOG_ERROR(clg_ref,...)
#define CLOG_WARN(clg_ref,...)
struct Depsgraph Depsgraph
bool DEG_is_active(const struct Depsgraph *depsgraph)
struct Object * DEG_get_original_object(struct Object *object)
@ LIB_TAG_COPIED_ON_WRITE
Object groups, one object can be in many groups at once.
@ eModifierType_Collision
#define SBC_MODE_AVGMINMAX
Object is a sort of wrapper for general info.
#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 i1
_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_recallocN(vmemh, len)
Platform independent time functions.
ATTR_WARN_UNUSED_RESULT const BMVert * v2
ATTR_WARN_UNUSED_RESULT const BMLoop * l
ATTR_WARN_UNUSED_RESULT const BMVert * v
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
const Depsgraph * depsgraph
SyclQueue void void size_t num_bytes void
BLI_INLINE void dfdx_spring(float to[3][3], const float dir[3], float length, float L, float k)
ccl_gpu_kernel_postfix ccl_global int * counter
void EIG_linear_solver_matrix_add(LinearSolver *solver, int row, int col, double value)
void(* MEM_freeN)(void *vmemh)
void *(* MEM_dupallocN)(const void *vmemh)
void *(* MEM_callocN)(size_t len, const char *str)
void *(* MEM_mallocN)(size_t len, const char *str)
ccl_device_inline float3 exp(float3 v)
ccl_device_inline float3 pow(float3 v, float e)
ListBase threads
list of all thread for every CPUDevice in cpudevices a thread exists.
T distance(const T &a, const T &b)
static const pxr::TfToken b("b", pxr::TfToken::Immortal)
static void add_mesh_quad_diag_springs(Object *ob)
struct BodySpring BodySpring
static int count_mesh_quads(Mesh *me)
static int sb_detect_edge_collisionCached(const float edge_v1[3], const float edge_v2[3], float *damp, float force[3], struct Object *vertexowner, float time)
static void sb_cf_threads_run(Scene *scene, Object *ob, float forcetime, float timenow, int totpoint, int *UNUSED(ptr_to_break_func(void)), struct ListBase *effectors, int do_deflector, float fieldfactor, float windfactor)
static int query_external_colliders(Depsgraph *depsgraph, Collection *collection)
static void softbody_step(struct Depsgraph *depsgraph, Scene *scene, Object *ob, SoftBody *sb, float dtime)
#define SBF_OUTOFCOLLISION
static ccd_Mesh * ccd_mesh_make(Object *ob)
static int sb_deflect_face(Object *ob, float *actpos, float *facenormal, float *force, float *cf, float time, float *vel, float *intrusion)
void sbObjectStep(struct Depsgraph *depsgraph, Scene *scene, Object *ob, float cfra, float(*vertexCos)[3], int numVerts)
struct ReferenceVert ReferenceVert
static int _softbody_calc_forces_slice_in_a_thread(Scene *scene, Object *ob, float forcetime, float timenow, int ifirst, int ilast, int *UNUSED(ptr_to_break_func(void)), ListBase *effectors, int do_deflector, float fieldfactor, float windfactor)
static void ccd_mesh_free(ccd_Mesh *ccdm)
static int sb_detect_face_pointCached(const float face_v1[3], const float face_v2[3], const float face_v3[3], float *damp, float force[3], struct Object *vertexowner, float time)
static void _scan_for_ext_spring_forces(Scene *scene, Object *ob, float timenow, int ifirst, int ilast, struct ListBase *effectors)
static float _final_mass(Object *ob, BodyPoint *bp)
static void mesh_faces_to_scratch(Object *ob)
static void springs_from_mesh(Object *ob)
static float _final_goal(Object *ob, BodyPoint *bp)
void sbObjectToSoftbody(Object *ob)
static void ccd_build_deflector_hash_single(GHash *hash, Object *ob)
static void softbody_restore_prev_step(Object *ob)
static float sb_grav_force_scale(Object *UNUSED(ob))
static void mesh_to_softbody(Object *ob)
static void add_2nd_order_roller(Object *ob, float UNUSED(stiffness), int *counter, int addsprings)
static int(* SB_localInterruptCallBack)(void)
struct SBScratch SBScratch
static void curve_surf_to_softbody(Object *ob)
static void softbody_apply_goalsnap(Object *ob)
static void softbody_apply_forces(Object *ob, float forcetime, int mode, float *err, int mid_flags)
static void ccd_build_deflector_hash(Depsgraph *depsgraph, Collection *collection, Object *vertexowner, GHash *hash)
struct SB_thread_context SB_thread_context
static void sb_spring_force(Object *ob, int bpi, BodySpring *bs, float iks, float UNUSED(forcetime))
static void calculate_collision_balls(Object *ob)
static void build_bps_springlist(Object *ob)
static void add_bp_springlist(BodyPoint *bp, int springID)
static const int CCD_SAFETY
static void softbody_calc_forces(struct Depsgraph *depsgraph, Scene *scene, Object *ob, float forcetime, float timenow)
static int sb_detect_aabb_collisionCached(float UNUSED(force[3]), struct Object *vertexowner, float UNUSED(time))
static void * exec_scan_for_ext_spring_forces(void *data)
static void softbody_reset(Object *ob, SoftBody *sb, float(*vertexCos)[3], int numVerts)
static void renew_softbody(Object *ob, int totpoint, int totspring)
static float globallen(float *v1, float *v2, Object *ob)
static void softbody_to_object(Object *ob, float(*vertexCos)[3], int numVerts, int local)
static void add_2nd_order_springs(Object *ob, float stiffness)
static void ccd_update_deflector_hash_single(GHash *hash, Object *ob)
static void free_softbody_intern(SoftBody *sb)
void sbFreeSimulation(SoftBody *sb)
static float sb_fric_force_scale(Object *UNUSED(ob))
static void sb_new_scratch(SoftBody *sb)
static float sb_time_scale(Object *ob)
static void free_scratch(SoftBody *sb)
static void interpolate_exciter(Object *ob, int timescale, int time)
void SB_estimate_transform(Object *ob, float lloc[3], float lrot[3][3], float lscale[3][3])
void sbSetInterruptCallBack(int(*f)(void))
static void * exec_softbody_calc_forces(void *data)
static int choose_winner(float *w, float *pos, float *a, float *b, float *c, float *ca, float *cb, float *cc)
static void makelatticesprings(Lattice *lt, BodySpring *bs, int dostiff, Object *ob)
static void reference_to_scratch(Object *ob)
static bool object_has_edges(const Object *ob)
static void free_softbody_baked(SoftBody *sb)
struct ReferenceState ReferenceState
struct ccdf_minmax ccdf_minmax
static void sbStoreLastFrame(struct Depsgraph *depsgraph, Object *object, float framenr)
static void sb_sfesf_threads_run(struct Depsgraph *depsgraph, Scene *scene, struct Object *ob, float timenow, int totsprings, int *UNUSED(ptr_to_break_func(void)))
static int sb_detect_face_collisionCached(const float face_v1[3], const float face_v2[3], const float face_v3[3], float *damp, float force[3], struct Object *vertexowner, float time)
static void lattice_to_softbody(Object *ob)
static void ccd_update_deflector_hash(Depsgraph *depsgraph, Collection *collection, Object *vertexowner, GHash *hash)
static void scan_for_ext_face_forces(Object *ob, float timenow)
static void apply_spring_memory(Object *ob)
static int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3], float *damp, float force[3], struct Object *vertexowner, float time, float vel[3], float *intrusion)
static void ccd_mesh_update(Object *ob, ccd_Mesh *pccd_M)
static void softbody_update_positions(Object *ob, SoftBody *sb, float(*vertexCos)[3], int numVerts)
struct MDeformVert * dvert
struct MDeformVert * dvert
short needstobuildcollider
struct PhysicsSettings physics_settings
struct PointCache * pointcache
struct SoftBody_Shared * shared
struct Collection * collision_group
struct EffectorWeights * effector_weights
char namedVG_Spring_K[64]
struct BodySpring * bspring
struct SBScratch * scratch
struct BodyPoint * bpoint
double PIL_check_seconds_timer(void)