142 #define MID_PRESERVE 1
144 #define SOFTGOALSNAP 0.999f
148 #define HEUNWARNLIMIT 1
150 #define BSF_INTERSECT 1
153 #define SBF_DOFUZZY 1
154 #define SBF_OUTOFCOLLISION 2
156 #define BFF_INTERSECT 1
157 #define BFF_CLOSEVERT 2
229 if (bp->
goal < 0.0f) {
318 for (i = 0; i < pccd_M->
mvert_num; i++) {
338 for (i = 0, mima = pccd_M->
mima, vt = pccd_M->
tri; i < pccd_M->tri_num; i++, mima++, vt++) {
408 for (i = 0; i < pccd_M->
mvert_num; i++) {
433 for (i = 0, mima = pccd_M->
mima, vt = pccd_M->
tri; i < pccd_M->tri_num; i++, mima++, vt++) {
530 unsigned int numobjects;
534 for (
int i = 0; i < numobjects; i++) {
563 if ((!
hash) || (!vertexowner)) {
567 unsigned int numobjects;
571 for (
int i = 0; i < numobjects; i++) {
648 int a, b,
c, notthis = 0, v0;
681 if ((bs2->
v1 != notthis) && (bs2->
v1 > v0)) {
690 if ((bs2->
v2 != notthis) && (bs2->
v2 > v0)) {
710 stiffness *= stiffness;
785 int a, b, akku_count;
809 if (akku_count > 0) {
857 for (i = 0; i < totpoint; i++) {
889 for (k = 0; k < sb->
totkey; k++) {
890 key = *(sb->
keys + k);
987 unsigned int numobjects;
992 return (numobjects != 0);
998 struct Object *vertexowner,
1005 float aabbmin[3], aabbmax[3];
1027 if ((aabbmax[0] < ccdm->
bbmin[0]) || (aabbmax[1] < ccdm->
bbmin[1]) ||
1028 (aabbmax[2] < ccdm->
bbmin[2]) || (aabbmin[0] > ccdm->
bbmax[0]) ||
1029 (aabbmin[1] > ccdm->
bbmax[1]) || (aabbmin[2] > ccdm->
bbmax[2])) {
1056 const float face_v2[3],
1057 const float face_v3[3],
1060 struct Object *vertexowner,
1066 float nv1[3], edge1[3], edge2[3], d_nvect[3], aabbmin[3], aabbmax[3];
1067 float facedist, outerfacethickness, tune = 10.0f;
1068 int a, deflected = 0;
1070 aabbmin[0] =
min_fff(face_v1[0], face_v2[0], face_v3[0]);
1071 aabbmin[1] =
min_fff(face_v1[1], face_v2[1], face_v3[1]);
1072 aabbmin[2] =
min_fff(face_v1[2], face_v2[2], face_v3[2]);
1073 aabbmax[0] =
max_fff(face_v1[0], face_v2[0], face_v3[0]);
1074 aabbmax[1] =
max_fff(face_v1[1], face_v2[1], face_v3[1]);
1075 aabbmax[2] =
max_fff(face_v1[2], face_v2[2], face_v3[2]);
1095 mvert = ccdm->
mvert;
1099 if ((aabbmax[0] < ccdm->
bbmin[0]) || (aabbmax[1] < ccdm->
bbmin[1]) ||
1100 (aabbmax[2] < ccdm->
bbmin[2]) || (aabbmin[0] > ccdm->
bbmax[0]) ||
1101 (aabbmin[1] > ccdm->
bbmax[1]) || (aabbmin[2] > ccdm->
bbmax[2])) {
1125 if (
fabsf(facedist) < outerfacethickness) {
1129 df = (outerfacethickness - facedist) / outerfacethickness;
1132 df = (outerfacethickness + facedist) / outerfacethickness;
1137 df = 0.01f *
expf(-100.0f * df);
1154 const float face_v2[3],
1155 const float face_v3[3],
1158 struct Object *vertexowner,
1164 float nv1[3], nv2[3], nv3[3], edge1[3], edge2[3], d_nvect[3], aabbmin[3], aabbmax[3];
1165 float t, tune = 10.0f;
1166 int a, deflected = 0;
1168 aabbmin[0] =
min_fff(face_v1[0], face_v2[0], face_v3[0]);
1169 aabbmin[1] =
min_fff(face_v1[1], face_v2[1], face_v3[1]);
1170 aabbmin[2] =
min_fff(face_v1[2], face_v2[2], face_v3[2]);
1171 aabbmax[0] =
max_fff(face_v1[0], face_v2[0], face_v3[0]);
1172 aabbmax[1] =
max_fff(face_v1[1], face_v2[1], face_v3[1]);
1173 aabbmax[2] =
max_fff(face_v1[2], face_v2[2], face_v3[2]);
1190 mvert = ccdm->
mvert;
1196 if ((aabbmax[0] < ccdm->
bbmin[0]) || (aabbmax[1] < ccdm->
bbmin[1]) ||
1197 (aabbmax[2] < ccdm->
bbmin[2]) || (aabbmin[0] > ccdm->
bbmax[0]) ||
1198 (aabbmin[1] > ccdm->
bbmax[1]) || (aabbmin[2] > ccdm->
bbmax[2])) {
1213 if ((aabbmax[0] < mima->
minx) || (aabbmin[0] > mima->
maxx) ||
1214 (aabbmax[1] < mima->
miny) || (aabbmin[1] > mima->
maxy) ||
1215 (aabbmax[2] < mima->
minz) || (aabbmin[2] > mima->
maxz)) {
1267 float damp = 0.0f, choke = 1.0f;
1268 float tune = -10.0f;
1333 const float edge_v2[3],
1336 struct Object *vertexowner,
1342 float nv1[3], nv2[3], nv3[3], edge1[3], edge2[3], d_nvect[3], aabbmin[3], aabbmax[3];
1344 int a, deflected = 0;
1366 mvert = ccdm->
mvert;
1372 if ((aabbmax[0] < ccdm->
bbmin[0]) || (aabbmax[1] < ccdm->
bbmin[1]) ||
1373 (aabbmax[2] < ccdm->
bbmin[2]) || (aabbmin[0] > ccdm->
bbmax[0]) ||
1374 (aabbmin[1] > ccdm->
bbmax[1]) || (aabbmin[2] > ccdm->
bbmax[2])) {
1389 if ((aabbmax[0] < mima->
minx) || (aabbmin[0] > mima->
maxx) ||
1390 (aabbmax[1] < mima->
miny) || (aabbmin[1] > mima->
maxy) ||
1391 (aabbmax[2] < mima->
minz) || (aabbmin[2] > mima->
maxz)) {
1423 float intrusiondepth,
i1, i2;
1428 intrusiondepth = -
min_ff(
i1, i2) / el;
1454 for (
a = ifirst;
a < ilast;
a++) {
1457 feedback[0] = feedback[1] = feedback[2] = 0.0f;
1476 float vel[3], sp[3], pr[3], force[3];
1477 float f, windfactor = 0.25f;
1481 float speed[3] = {0.0f, 0.0f, 0.0f};
1497 f = -0.0001f * f * f * sb->
aeroedge;
1532 int *
UNUSED(ptr_to_break_func(
void)))
1536 int i, totthread,
left, dec;
1540 int lowsprings = 100;
1548 while ((totsprings / totthread < lowsprings) && (totthread > 1)) {
1555 dec = totsprings / totthread + 1;
1556 for (i = 0; i < totthread; i++) {
1558 sb_threads[i].
ob = ob;
1560 sb_threads[i].
timenow = timenow;
1567 sb_threads[i].
ifirst = 0;
1573 sb_threads[i].
nr = i;
1574 sb_threads[i].
tot = totthread;
1576 if (totthread > 1) {
1579 for (i = 0; i < totthread; i++) {
1597 float *
w,
float *
pos,
float *
a,
float *b,
float *
c,
float *ca,
float *cb,
float *cc)
1628 float facenormal[3],
1631 struct Object *vertexowner,
1639 float nv1[3], nv2[3], nv3[3], edge1[3], edge2[3], d_nvect[3], dv1[3], ve[3],
1640 avel[3] = {0.0, 0.0, 0.0}, vv1[3], vv2[3], vv3[3], coledge[3] = {0.0f, 0.0f, 0.0f},
1641 mindistedge = 1000.0f, outerforceaccu[3], innerforceaccu[3], facedist,
1642 force_mag_norm, minx, miny, minz, maxx, maxy, maxz,
1643 innerfacethickness = -0.5f, outerfacethickness = 0.2f, ee = 5.0f, ff = 0.1f, fa = 1;
1644 int a, deflected = 0, cavel = 0, ci = 0;
1649 outerforceaccu[0] = outerforceaccu[1] = outerforceaccu[2] = 0.0f;
1650 innerforceaccu[0] = innerforceaccu[1] = innerforceaccu[2] = 0.0f;
1665 mvert = ccdm->
mvert;
1671 minx = ccdm->
bbmin[0];
1672 miny = ccdm->
bbmin[1];
1673 minz = ccdm->
bbmin[2];
1675 maxx = ccdm->
bbmax[0];
1676 maxy = ccdm->
bbmax[1];
1677 maxz = ccdm->
bbmax[2];
1679 if ((opco[0] < minx) || (opco[1] < miny) || (opco[2] < minz) || (opco[0] > maxx) ||
1680 (opco[1] > maxy) || (opco[2] > maxz)) {
1697 fa = (ff * outerfacethickness - outerfacethickness);
1700 avel[0] = avel[1] = avel[2] = 0.0f;
1703 if ((opco[0] < mima->
minx) || (opco[0] > mima->
maxx) || (opco[1] < mima->
miny) ||
1704 (opco[1] > mima->
maxy) || (opco[2] < mima->
minz) || (opco[2] > mima->
maxz)) {
1748 if ((facedist > innerfacethickness) && (facedist < outerfacethickness)) {
1750 force_mag_norm = (
float)
exp(-ee * facedist);
1751 if (facedist > outerfacethickness * ff) {
1752 force_mag_norm = (
float)force_mag_norm * fa * (facedist - outerfacethickness) *
1753 (facedist - outerfacethickness);
1756 if (facedist > 0.0f) {
1757 *damp *= (1.0f - facedist / outerfacethickness);
1763 if (deflected < 2) {
1767 if ((mprevvert) && (*damp > 0.0f)) {
1772 *intrusion += facedist;
1785 if (deflected == 1) {
1786 force_mag_norm = (
float)
exp(-ee * mindistedge);
1787 if (mindistedge > outerfacethickness * ff) {
1788 force_mag_norm = (
float)force_mag_norm * fa * (mindistedge - outerfacethickness) *
1789 (mindistedge - outerfacethickness);
1793 if (mindistedge > 0.0f) {
1794 *damp *= (1.0f - mindistedge / outerfacethickness);
1797 if (deflected == 2) {
1800 if (deflected == 3) {
1832 s_actpos, facenormal, cf, force, ob,
time, vel, intrusion);
1834 deflected = sb_detect_vertex_collisionCachedEx(
1835 s_actpos, facenormal, cf, force, ob,
time, vel, intrusion);
1842 static void dfdx_spring(
int ia,
int ic,
int op,
float dir[3],
float L,
float len,
float factor)
1847 for (i = 0; i < 3; i++) {
1848 for (j = 0; j < 3; j++) {
1849 delta_ij = (i == j ? (1.0f) : (0.0f));
1850 m = factor * (dir[i] * dir[j] + (1 -
L /
len) * (delta_ij - dir[i] * dir[j]));
1856 for (i = 0; i < 3; i++) {
1857 for (j = 0; j < 3; j++) {
1858 m = factor * dir[i] * dir[j];
1865 static void dfdx_goal(
int ia,
int ic,
int op,
float factor)
1868 for (i = 0; i < 3; i++) {
1873 static void dfdv_goal(
int ia,
int ic,
float factor)
1876 for (i = 0; i < 3; i++) {
1888 float dir[3], dvel[3];
1889 float distance, forcefactor, kd, absvel, projvel, kw;
1894 if (bpi == bs->
v1) {
1902 else if (bpi == bs->
v2) {
1912 CLOG_WARN(&
LOG,
"bodypoint <bpi> is not attached to spring <*bs>");
1920 iks = 1.0f / (1.0f - sb->
inspring) - 1.0f;
1923 iks = 1.0f / (1.0f - sb->
inpush) - 1.0f;
1926 if (bs->
len > 0.0f) {
1927 forcefactor = iks / bs->
len;
1957 kd *= absvel * projvel;
1970 int *
UNUSED(ptr_to_break_func(
void)),
1977 int bb, do_selfcollision, do_springcollision, do_aero;
1978 int number_of_points_here = ilast - ifirst;
2005 bp = &sb->
bpoint[ifirst];
2006 for (bb = number_of_points_here; bb > 0; bb--, bp++) {
2011 if (do_selfcollision) {
2016 float velcenter[3], dvel[3], def[3];
2028 if ((
fabsf(def[0]) > compare) || (
fabsf(def[1]) > compare) || (
fabsf(def[2]) > compare)) {
2037 if (
ELEM(ilast - bb, bs->
v2, bs->
v1)) {
2044 2.0f * bstune / compare;
2068 bp->
force[0] += -ks * (auxvect[0]);
2069 bp->
force[1] += -ks * (auxvect[1]);
2070 bp->
force[2] += -ks * (auxvect[2]);
2079 bp->
force[0] -= kd * (auxvect[0]);
2080 bp->
force[1] -= kd * (auxvect[1]);
2081 bp->
force[2] -= kd * (auxvect[2]);
2084 bp->
force[0] -= kd * (velgoal[0] - bp->
vec[0]);
2085 bp->
force[1] -= kd * (velgoal[1] - bp->
vec[1]);
2086 bp->
force[2] -= kd * (velgoal[2] - bp->
vec[2]);
2108 float force[3] = {0.0f, 0.0f, 0.0f};
2109 float speed[3] = {0.0f, 0.0f, 0.0f};
2118 mul_v3_fl(force, fieldfactor * eval_sb_fric_force_scale);
2122 kd = sb->
mediafrict * eval_sb_fric_force_scale;
2123 bp->
force[0] -= kd * (bp->
vec[0] + windfactor * speed[0] / eval_sb_fric_force_scale);
2124 bp->
force[1] -= kd * (bp->
vec[1] + windfactor * speed[1] / eval_sb_fric_force_scale);
2125 bp->
force[2] -= kd * (bp->
vec[2] + windfactor * speed[2] / eval_sb_fric_force_scale);
2142 float cfforce[3], defforce[3] = {0.0f, 0.0f, 0.0f}, vel[3] = {0.0f, 0.0f, 0.0f},
2143 facenormal[3], cf = 1.0f, intrusion;
2146 if (
sb_deflect_face(ob, bp->
pos, facenormal, defforce, &cf, timenow, vel, &intrusion)) {
2147 if (intrusion < 0.0f) {
2162 iks = 1.0f / (1.0f - sb->
inspring) - 1.0f;
2169 if (do_springcollision || do_aero) {
2208 int *
UNUSED(ptr_to_break_func(
void)),
2216 int i, totthread,
left, dec;
2220 int lowpoints = 100;
2225 while ((totpoint / totthread < lowpoints) && (totthread > 1)) {
2234 dec = totpoint / totthread + 1;
2235 for (i = 0; i < totthread; i++) {
2237 sb_threads[i].
ob = ob;
2239 sb_threads[i].
timenow = timenow;
2246 sb_threads[i].
ifirst = 0;
2252 sb_threads[i].
nr = i;
2253 sb_threads[i].
tot = totthread;
2256 if (totthread > 1) {
2259 for (i = 0; i < totthread; i++) {
2282 float fieldfactor = -1.0f, windfactor = 0.25;
2283 int do_deflector , do_springcollision, do_aero;
2299 if (do_springcollision || do_aero) {
2338 float dx[3] = {0}, dv[3], aabbmin[3], aabbmax[3], cm[3] = {0.0f, 0.0f, 0.0f};
2339 float timeovermass ;
2340 float maxerrpos = 0.0f, maxerrvel = 0.0f;
2345 aabbmin[0] = aabbmin[1] = aabbmin[2] = 1e20f;
2346 aabbmax[0] = aabbmax[1] = aabbmax[2] = -1e20f;
2352 timeovermass = forcetime / sb->
nodemass;
2355 timeovermass = forcetime / 0.009999f;
2366 timeovermass = forcetime / 0.009999f;
2453 if (bp->
choke > 0.0f) {
2504 static void softbody_store_step(
Object *ob)
2517 static void softbody_store_state(
Object *ob,
float *ppos,
float *pvel)
2522 float *pp = ppos, *pv = pvel;
2535 static void softbody_retrieve_state(
Object *ob,
float *ppos,
float *pvel)
2540 float *pp = ppos, *pv = pvel;
2553 static void softbody_swap_state(
Object *ob,
float *ppos,
float *pvel)
2558 float *pp = ppos, *pv = pvel;
2612 if ((
r > 1.05f) || (
r < 0.95f)) {
2613 bs->
len = ((100.0f - b) * bs->
len + b *
l) / 100.0f;
2691 int defgroup_index, defgroup_index_mass, defgroup_index_spring;
2730 if (defgroup_index_mass != -1) {
2734 if (defgroup_index_spring != -1) {
2743 for (
a = me->
totedge;
a > 0;
a--, medge++, bs++) {
2802 float accu_pos[3] = {0.0f, 0.0f, 0.0f};
2803 float accu_mass = 0.0f;
2836 int u,
v,
w, dv, dw, bpc = 0, bpuc;
2839 dw = dv * lt->
pntsv;
2845 for (u = 0, bpuc = 0, bpu =
NULL; u < lt->
pntsu; u++, bp++, bpc++) {
2874 bs->
v2 = bpc - dw - dv - 1;
2876 bs->
len =
globallen((bp - dw - dv - 1)->vec, bp->vec, ob);
2879 if ((v < lt->pntsv - 1) && (u != 0)) {
2881 bs->
v2 = bpc - dw + dv - 1;
2883 bs->
len =
globallen((bp - dw + dv - 1)->vec, bp->vec, ob);
2888 if (w < lt->pntsw - 1) {
2891 bs->
v2 = bpc + dw - dv - 1;
2893 bs->
len =
globallen((bp + dw - dv - 1)->vec, bp->vec, ob);
2896 if ((v < lt->pntsv - 1) && (u != 0)) {
2898 bs->
v2 = bpc + dw + dv - 1;
2900 bs->
len =
globallen((bp + dw + dv - 1)->vec, bp->vec, ob);
2917 int totvert, totspring = 0,
a;
2920 int defgroup_index, defgroup_index_mass, defgroup_index_spring;
2943 for (
a = 0;
a < totvert;
a++, bp++, bpnt++) {
2956 if (defgroup_index_mass != -1) {
2960 if (defgroup_index_spring != -1) {
2985 int a, curindex = 0;
2986 int totvert, totspring = 0, setgoal = 0;
3022 for (bezt = nu->
bezt,
a = 0; a < nu->pntsu;
a++, bezt++, bp += 3, curindex += 3) {
3027 (bp + 1)->goal = bp->
goal;
3028 (bp + 2)->goal = bp->
goal;
3036 bs->
v1 = curindex - 3;
3043 bs->
v2 = curindex + 1;
3048 bs->
v1 = curindex + 1;
3049 bs->
v2 = curindex + 2;
3057 for (bpnt = nu->
bp,
a = 0; a < nu->pntsu * nu->
pntsv;
a++, bpnt++, bp++, curindex++) {
3061 if (totspring &&
a > 0) {
3062 bs->
v1 = curindex - 1;
3093 for (
a = 0;
a < numVerts;
a++, bp++) {
3218 return ((
Mesh *)ob->
data)->totedge;
3235 float (*vertexCos)[3],
3241 if (!sb || !sb->
bpoint) {
3245 for (
a = 0, bp = sb->
bpoint;
a < numVerts;
a++, bp++) {
3279 float com[3], rcom[3];
3282 if (!ob || !ob->
soft) {
3286 if (!sb || !sb->
bpoint) {
3319 for (
a = 0, bp = sb->
bpoint;
a < numVerts;
a++, bp++) {
3325 bp->
vec[0] = bp->
vec[1] = bp->
vec[2] = 0.0f;
3388 if (dtime < 0 || dtime > 10.5f) {
3404 float forcetimemax = 1.0f;
3406 float forcetimemin = 0.01f;
3408 float timedone = 0.0;
3415 forcetimemax = dtime / sb->
minloops;
3418 forcetimemin = dtime / sb->
maxloops;
3425 forcetime = forcetimemax;
3426 while ((
fabsf(timedone) <
fabsf(dtime)) && (loops < 2000)) {
3444 if (forcetime > forcetimemin) {
3445 forcetime =
max_ff(forcetime / 2.0f, forcetimemin);
3450 timedone += forcetime;
3454 float newtime = forcetime * 1.1f;
3459 newtime = forcetime;
3464 newtime = forcetime;
3467 timedone += forcetime;
3468 newtime =
min_ff(forcetimemax,
max_ff(newtime, forcetimemin));
3470 if (forcetime > 0.0f) {
3471 forcetime =
min_ff(dtime - timedone, newtime);
3474 forcetime =
max_ff(dtime - timedone, newtime);
3480 if (sct - sst > 0.5) {
3481 printf(
"%3.0f%% \r", 100.0f * timedone / dtime);
3496 printf(
"\r needed %d steps/frame", loops);
3521 if ((sct - sst > 0.5) || (
G.debug &
G_DEBUG)) {
3522 printf(
" solver time %f sec %s\n", sct - sst, ob->
id.
name);
3533 object->soft->last_frame = framenr;
3542 float (*vertexCos)[3],
3548 float dtime, timescale;
3549 int framedelta, framenr, startframe, endframe;
3553 framenr = (int)cfra;
3554 framedelta = framenr - cache->
simframe;
3567 if (framenr < startframe) {
3571 if (framenr > endframe) {
3603 if (framenr == startframe) {
3646 if (can_write_cache) {
3652 if (!can_simulate) {
3657 if (cache->
simframe == startframe &&
3665 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)
BLI_INLINE bool BLI_ghashIterator_done(GHashIterator *ghi) ATTR_WARN_UNUSED_RESULT
void BLI_ghashIterator_free(GHashIterator *ghi)
BLI_INLINE void * BLI_ghashIterator_getValue(GHashIterator *ghi) ATTR_WARN_UNUSED_RESULT
void(* GHashValFreeFP)(void *val)
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
void * BLI_ghash_lookup(GHash *gh, const void *key) 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(const int poly_count, const int corner_count)
void vcloud_estimate_transform_v3(const 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 PTCACHE_REDO_NEEDED
#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
BLI_INLINE void dfdx_spring(float to[3][3], const float dir[3], float length, float L, float k)
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)
INLINE Rall1d< T, V, S > pow(const Rall1d< T, V, S > &arg, double m)
INLINE Rall1d< T, V, S > exp(const Rall1d< T, V, S > &arg)
ListBase threads
list of all thread for every CPUDevice in cpudevices a thread exists.
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 void mesh_to_softbody(Scene *scene, Object *ob)
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)
SoftBody * sbNew(Scene *scene)
static void curve_surf_to_softbody(Scene *scene, Object *ob)
static float sb_grav_force_scale(Object *UNUSED(ob))
static void add_2nd_order_roller(Object *ob, float UNUSED(stiffness), int *counter, int addsprings)
static void renew_softbody(Scene *scene, Object *ob, int totpoint, int totspring)
static int(* SB_localInterruptCallBack)(void)
struct SBScratch SBScratch
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 bool object_has_edges(Object *ob)
static void * exec_scan_for_ext_spring_forces(void *data)
static void softbody_reset(Object *ob, SoftBody *sb, float(*vertexCos)[3], int numVerts)
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 lattice_to_softbody(Scene *scene, Object *ob)
static void reference_to_scratch(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 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)
ccl_device_inline float distance(const float2 &a, const float2 &b)