31 int N = leafNodes.
size();
43 for (
int i = 0; i <
N; ++i)
47 for (
int i = 0; i <
N; ++i)
52 for (
int j = 0; j < adj[i].size(); ++j)
55 if (!marked[adj[i][j]])
59 node->childs[0] = leafNodes[i];
60 node->childs[1] = leafNodes[n];
61 leafNodes[i]->parent =
node;
62 leafNodes[n]->parent =
node;
73 childIds.
push_back(std::make_pair(i, -1));
79 for (
int i = 0; i < newLeafNodes.
size(); ++i)
81 for (
int j = i + 1; j < newLeafNodes.
size(); ++j)
83 bool neighbor =
false;
85 for (
int k = 0; k < leftChildNeighbors.
size(); ++k)
87 if (leftChildNeighbors[k] == childIds[j].first || leftChildNeighbors[k] == childIds[j].second)
93 if (!neighbor && childIds[i].second != -1)
96 for (
int k = 0; k < rightChildNeighbors.
size(); ++k)
98 if (rightChildNeighbors[k] == childIds[j].first || rightChildNeighbors[k] == childIds[j].second)
112 leafNodes = newLeafNodes;
116 adj.resize(newAdj.
size());
117 for (
int i = 0; i < newAdj.
size(); i++)
119 for (
int j = 0; j < newAdj[i].
size(); j++)
121 adj[i].push_back(newAdj[i][j]);
124 N = leafNodes.
size();
131 : m_softBodySolver(0), m_worldInfo(worldInfo)
147 for (
int i = 0, ni = node_count; i < ni; ++i)
153 n.
m_im = m ? *m++ : 1;
165 : m_worldInfo(worldInfo)
260 const Node* n[] = {node0, node1};
264 if ((
l.m_n[0] == n[0] &&
l.m_n[1] == n[1]) ||
265 (
l.m_n[0] == n[1] &&
l.m_n[1] == n[0]))
283 for (
int j = 0; j < 3; ++j)
285 if ((f.
m_n[j] == n[0]) ||
286 (f.
m_n[j] == n[1]) ||
292 if (
c == 7)
return (
true);
382 n.
m_im = m > 0 ? 1 / m : 0;
416 if ((!bcheckexist) || (!
checkLink(node0, node1)))
422 l.m_rl = (
l.m_n[0]->m_x -
l.m_n[1]->m_x).
length();
494 t.m_rv =
VolumeOf(
t.m_n[0]->m_x,
t.m_n[1]->m_x,
t.m_n[2]->m_x,
t.m_n[3]->m_x);
503 appendAnchor(
node, body, local, disableCollisionBetweenLinkedBodies, influence);
509 if (disableCollisionBetweenLinkedBodies)
520 a.m_local = localPivot;
521 a.m_node->m_battach = 1;
522 a.m_influence = influence;
535 const btTransform& wtr = body->getWorldTransform();
543 c.m_cti.m_colObj = body;
544 c.m_cti.m_normal = wtr.getBasis() * nrm;
545 c.m_cti.m_offset = dst;
551 static const btMatrix3x3 iwiStatic(0, 0, 0, 0, 0, 0, 0, 0, 0);
557 c.m_local = body->getWorldTransform().inverse() *
m_nodes[
node].m_x;
558 c.m_node->m_battach = 1;
587 const btTransform& wtr = link->getWorldTransform();
594 c.m_cti.m_colObj = link;
595 c.m_cti.m_normal = wtr.getBasis() * nrm;
596 c.m_cti.m_offset = dst;
619 t1.getX(), t1.getY(), t1.getZ(),
620 t2.getX(), t2.getY(), t2.getZ());
621 const int ndof = link->
m_multiBody->getNumDofs() + 6;
623 c.m_c0 =
rot.transpose() * local_impulse_matrix *
rot;
624 c.jacobianData_normal = jacobianData_normal;
625 c.jacobianData_t1 = jacobianData_t1;
626 c.jacobianData_t2 = jacobianData_t2;
631 c.m_local = link->getWorldTransform().inverse() *
m_nodes[
node].m_x;
632 c.m_node->m_battach = 1;
713 const bool as_lift = kLF > 0;
714 const bool as_drag = kDG > 0;
715 const bool as_aero = as_lift || as_drag;
732 const btScalar rel_v_len = rel_v.length();
733 const btScalar rel_v2 = rel_v.length2();
737 const btVector3 rel_v_nrm = rel_v.normalized();
746 btScalar n_dot_v = nrm.dot(rel_v_nrm);
747 btScalar tri_area = 0.5f * n.m_area;
749 fDrag = 0.5f * kDG * medium.
m_density * rel_v2 * tri_area * n_dot_v * (-rel_v_nrm);
753 if (0 < n_dot_v && n_dot_v < 0.98480f)
754 fLift = 0.5f * kLF * medium.
m_density * rel_v_len * tri_area *
btSqrt(1.0f - n_dot_v * n_dot_v) * (nrm.cross(rel_v_nrm).cross(rel_v_nrm));
758 btScalar del_v_by_fDrag_len2 = del_v_by_fDrag.length2();
761 if (del_v_by_fDrag_len2 >= v_len2 && del_v_by_fDrag_len2 > 0)
763 btScalar del_v_by_fDrag_len = del_v_by_fDrag.length();
765 fDrag *=
btScalar(0.8) * (v_len / del_v_by_fDrag_len);
781 const btScalar c0 = n.m_area * dvn * rel_v2 / 2;
783 force += nrm * (-c1 * kLF);
784 force += rel_v.normalized() * (-c1 * kDG);
800 const bool as_lift = kLF > 0;
801 const bool as_drag = kDG > 0;
802 const bool as_aero = as_lift || as_drag;
817 const btScalar rel_v_len = rel_v.length();
818 const btScalar rel_v2 = rel_v.length2();
822 const btVector3 rel_v_nrm = rel_v.normalized();
832 btScalar n_dot_v = nrm.dot(rel_v_nrm);
835 fDrag = 0.5f * kDG * medium.
m_density * rel_v2 * tri_area * n_dot_v * (-rel_v_nrm);
839 if (0 < n_dot_v && n_dot_v < 0.98480f)
840 fLift = 0.5f * kLF * medium.
m_density * rel_v_len * tri_area *
btSqrt(1.0f - n_dot_v * n_dot_v) * (nrm.cross(rel_v_nrm).cross(rel_v_nrm));
845 for (
int j = 0; j < 3; ++j)
851 btScalar del_v_by_fDrag_len2 = del_v_by_fDrag.length2();
854 if (del_v_by_fDrag_len2 >= v_len2 && del_v_by_fDrag_len2 > 0)
856 btScalar del_v_by_fDrag_len = del_v_by_fDrag.length();
858 fDrag *=
btScalar(0.8) * (v_len / del_v_by_fDrag_len);
878 force += nrm * (-c1 * kLF);
879 force += rel_v.normalized() * (-c1 * kDG);
959 for (
int j = 0; j < 3; ++j)
998 for (
int j = 0; j < 4; ++j)
1001 ranks[int(
t.m_n[j] - &
m_nodes[0])] += 1;
1021 for (
int j = 0; j < 4; ++j)
1036 total_momentum += mass *
m_nodes[i].m_v;
1039 return total_mass == 0 ? total_momentum : total_momentum / total_mass;
1094 btTransform new_transform = trs * current_transform.inverse();
1110 n.
m_n = trs.getBasis() * n.
m_n;
1172 l.m_c1 =
l.m_rl *
l.m_rl;
1194 if (
m_nodes[i].m_im <= 0) tmass += kmass;
1234 l.m_rl = (
l.m_n[0]->m_x -
l.m_n[1]->m_x).
length();
1235 l.m_c1 =
l.m_rl *
l.m_rl;
1268 for (
int i = 0, ni = cluster->
m_nodes.size(); i < ni; ++i)
1272 return (com * cluster->
m_imass);
1293 cluster->
m_lv += li;
1295 cluster->
m_av += ai;
1321 cluster->
m_av += ai;
1361 const unsigned inf = (~(unsigned)0) >> 1;
1362 unsigned* adj =
new unsigned[n * n];
1364 #define IDX(_x_, _y_) ((_y_)*n + (_x_))
1365 for (j = 0; j < n; ++j)
1367 for (i = 0; i < n; ++i)
1371 adj[
IDX(i, j)] = adj[
IDX(j, i)] = inf;
1375 adj[
IDX(i, j)] = adj[
IDX(j, i)] = 0;
1383 adj[
IDX(ia, ib)] = 1;
1384 adj[
IDX(ib, ia)] = 1;
1405 for (
int ii = 0; ii < nodeLinks.
size(); ii++)
1409 for (
int jj = 0; jj < nodeLinks[ii].m_links.
size(); jj++)
1411 int k = nodeLinks[ii].m_links[jj];
1412 for (
int kk = 0; kk < nodeLinks[k].m_links.
size(); kk++)
1414 int j = nodeLinks[k].m_links[kk];
1417 const unsigned sum = adj[
IDX(i, k)] + adj[
IDX(k, j)];
1419 if (adj[
IDX(i, j)] >
sum)
1431 for (
int k = 0; k < n; ++k)
1433 for (j = 0; j < n; ++j)
1435 for (i = j + 1; i < n; ++i)
1437 const unsigned sum = adj[
IDX(i, k)] + adj[
IDX(k, j)];
1438 if (adj[
IDX(i, j)] >
sum)
1449 for (j = 0; j < n; ++j)
1451 for (i = j + 1; i < n; ++i)
1470 unsigned long seed = 243703;
1471 #define NEXTRAND (seed = (1664525L * seed + 1013904223L) & 0xffffffff)
1532 const btScalar w = 2 - btMin<btScalar>(1, iterations / slope);
1537 for (i = 0; i < k; ++i)
1547 c = centers[i] + (
c - centers[i]) *
w;
1558 for (
int j = 1; j < k; ++j)
1569 }
while (changed && (iterations < maxiterations));
1585 for (
int j = 0; j < 3; ++j)
1587 const int cid = cids[idx[j]];
1588 for (
int q = 1; q < 3; ++q)
1590 const int kid = idx[(j + q) % 3];
1591 if (cids[kid] != cid)
1633 for (
int j = 0; j < 4; j++)
1650 for (
int j = 0; j < 3; ++j)
1671 bool connected =
false;
1674 for (
int i = 0; !connected && i < cla->
m_nodes.size(); i++)
1676 for (
int j = 0; j < clb->
m_nodes.size(); j++)
1721 edges(
int(
l.m_n[0] - nbase),
int(
l.m_n[1] - nbase)) = -1;
1726 edges(
int(f.
m_n[0] - nbase),
int(f.
m_n[1] - nbase)) = -1;
1727 edges(
int(f.
m_n[1] - nbase),
int(f.
m_n[2] - nbase)) = -1;
1728 edges(
int(f.
m_n[2] - nbase),
int(f.
m_n[0] - nbase)) = -1;
1731 for (i = 0; i < ncount; ++i)
1733 for (j = i + 1; j < ncount; ++j)
1735 if (edges(i, j) == -1)
1752 const btScalar f = (ma + mb) / (ma + mb + mc);
1753 a.m_im = 1 / (ma * f);
1754 b.
m_im = 1 / (mb * f);
1786 const int idx[] = {int(feat.m_n[0] - nbase),
1787 int(feat.m_n[1] - nbase)};
1788 if ((idx[0] < ncount) && (idx[1] < ncount))
1790 const int ni = edges(idx[0], idx[1]);
1796 pft[0]->m_n[0] = &
m_nodes[idx[0]];
1797 pft[0]->m_n[1] = &
m_nodes[ni];
1798 pft[1]->m_n[0] = &
m_nodes[ni];
1799 pft[1]->m_n[1] = &
m_nodes[idx[1]];
1807 const int idx[] = {int(feat.
m_n[0] - nbase),
1808 int(feat.
m_n[1] - nbase),
1809 int(feat.
m_n[2] - nbase)};
1810 for (j = 2, k = 0; k < 3; j = k++)
1812 if ((idx[j] < ncount) && (idx[k] < ncount))
1814 const int ni = edges(idx[j], idx[k]);
1818 const int l = (k + 1) % 3;
1838 const int pcount = ncount;
1841 cnodes.
resize(ncount, 0);
1843 for (i = 0; i < ncount; ++i)
1846 if ((i >= pcount) || (
btFabs(ifn->
Eval(
x)) < accurary))
1864 const int id[] = {int(
m_links[i].
m_n[0] - nbase),
1867 if (cnodes[
id[0]] && cnodes[
id[1]])
1874 if (((ifn->
Eval(
m_nodes[
id[0]].m_x) < accurary) &&
1881 for (
int j = 0; j < 2; ++j)
1883 int cn = cnodes[int(
l.m_n[j] - nbase)];
1892 if ((ifn->
Eval(n[0]->
m_x) < accurary) &&
1893 (ifn->
Eval(n[1]->
m_x) < accurary) &&
1894 (ifn->
Eval(n[2]->
m_x) < accurary))
1896 for (
int j = 0; j < 3; ++j)
1898 int cn = cnodes[int(n[j] - nbase)];
1910 for (
int j = 0; j < 2; ++j) ranks[
int(
m_links[i].
m_n[j] - nbase)]++;
1914 for (
int j = 0; j < 3; ++j) ranks[
int(
m_faces[i].
m_n[j] - nbase)]++;
1918 const int id[] = {int(
m_links[i].
m_n[0] - nbase),
1920 const bool sg[] = {ranks[
id[0]] == 1,
1932 for(i=nnodes-1;i>=0;--i)
1939 for(
int i=0;i<nnodes;++i) map[i]=i;
1940 PointersToIndices(
this);
1941 for(
int i=0,ni=todelete.
size();i<ni;++i)
1945 int& b=map[--nnodes];
1950 IndicesToPointers(
this,&map[0]);
1988 pft[0]->m_n[1] = pn[mtch];
1989 pft[1]->m_n[0] = pn[1 - mtch];
1995 for (
int k = 2,
l = 0;
l < 3; k =
l++)
2002 pft[0]->
m_n[
l] = pn[mtch];
2003 pft[1]->
m_n[k] = pn[1 - mtch];
2004 appendLink(pn[0], pft[0]->
m_n[(
l + 1) % 3], pft[0]->m_material,
true);
2005 appendLink(pn[1], pft[0]->
m_n[(
l + 1) % 3], pft[0]->m_material,
true);
2027 results.
body =
this;
2047 results.
body =
this;
2114 for (
int c = 0;
c < 3;
c++)
2116 if (deltaV[
c] > clampDeltaV)
2118 deltaV[
c] = clampDeltaV;
2120 if (deltaV[
c] < -clampDeltaV)
2122 deltaV[
c] = -clampDeltaV;
2200 l.m_c3 =
l.m_n[1]->m_q -
l.m_n[0]->m_q;
2201 l.m_c2 = 1 / (
l.m_c3.length2() *
l.m_c0);
2207 const btVector3 ra =
a.m_body->getWorldTransform().getBasis() *
a.m_local;
2210 a.m_body->getInvMass(),
2211 a.m_body->getInvInertiaTensorWorld(),
2215 a.m_body->activate();
2284 for (
int isolve = 0; isolve < iterations; ++isolve)
2302 const int nb = bodies.
size();
2306 for (i = 0; i < nb; ++i)
2310 for (i = 0; i < nb; ++i)
2312 bodies[i]->prepareClusters(iterations);
2314 for (i = 0; i < iterations; ++i)
2317 for (
int j = 0; j < nb; ++j)
2319 bodies[j]->solveClusters(sor);
2322 for (i = 0; i < nb; ++i)
2324 bodies[i]->cleanupClusters();
2350 const btScalar t = rayFromToTriangle(m_rayFrom, m_rayTo, m_rayNormalizedDirection,
2355 if ((
t > 0) && (
t < m_mint))
2366 const btVector3& rayNormalizedDirection,
2382 if ((
t > teps) && (
t < maxt))
2384 const btVector3 hit = rayFrom + rayNormalizedDirection *
t;
2399 #define PTR2IDX(_p_, _b_) reinterpret_cast<btSoftBody::Node*>((_p_) - (_b_))
2407 m_nodes[i].m_leaf->data = *(
void**)&i;
2422 m_faces[i].m_leaf->data = *(
void**)&i;
2431 for (
int j = 0; j <
m_notes[i].m_rank; ++j)
2442 #define IDX2PTR(_p_, _b_) map ? (&(_b_)[map[(((char*)_p_) - (char*)0)]]) : (&(_b_)[(((char*)_p_) - (char*)0)])
2474 for (
int j = 0; j <
m_notes[i].m_rank; ++j)
2530 int tetfaces[4][3] = {{0, 1, 2}, {0, 1, 3}, {1, 2, 3}, {0, 2, 3}};
2531 for (
int f = 0; f < 4; f++)
2533 int index0 = tetfaces[f][0];
2534 int index1 = tetfaces[f][1];
2535 int index2 = tetfaces[f][2];
2625 BT_PROFILE(
"btSoftBody::initializeFaceTree");
2638 node->childs[1] = 0;
2640 leafNodes[i] =
node;
2646 for (
int i = 0; i < adj.
size(); ++i)
2648 for (
int j = i + 1; j < adj.
size(); ++j)
2651 for (
int k = 0; k < 3; ++k)
2653 for (
int l = 0;
l < 3; ++
l)
2691 node->childs[1] = 0;
2693 leafNodes[i] =
node;
2750 cti.
m_normal = wtr.getBasis() * nrm;
2780 cti.
m_normal = wtr.getBasis() * nrm;
2799 btScalar denom = d00 * d11 - d01 * d01;
2800 bary.setY((d11 * d20 - d01 * d21) / denom);
2801 bary.setZ((d00 * d21 - d01 * d20) / denom);
2802 bary.setX(
btScalar(1) - bary.getY() - bary.getZ());
2827 #ifdef USE_QUADRATURE
2843 if (local_dst < dst)
2845 if (local_dst < 0 && predict)
2855 cti.
m_normal = wtr.getBasis() * nrm;
2865 triangle_transform.setIdentity();
2866 triangle_transform.setOrigin(f.
m_n[0]->
m_q);
2871 dst = results.
distance - 2.0 * csh->getMargin() - margin;
2876 #ifdef CACHE_PREV_COLLISION
2879 for (
int i = 0; i < 3; ++i)
2892 triangle_transform.setOrigin(f.
m_n[0]->
m_x);
2895 dst = results.
distance - csh->getMargin() - margin;
2903 triangle_transform.setOrigin(f.
m_n[0]->
m_x);
2908 for (
int i = 0; i < 3; ++i)
2911 dst = results.
distance - csh->getMargin() - margin;
2991 for (
int d = 0; d < 3; ++d)
2993 if (
m_nodes[i].m_x[d] > maxs[d])
2995 if (
m_nodes[i].m_x[d] < mins[d])
3032 Apq[0] = Apq[1] = Apq[2] =
btVector3(0, 0, 0);
3034 Apq[1].setY(
eps * 2);
3035 Apq[2].setZ(
eps * 3);
3040 Apq[0] +=
a.x() * b;
3041 Apq[1] +=
a.y() * b;
3042 Apq[2] +=
a.z() * b;
3050 const btScalar idet = Clamp<btScalar>(1 / pose.
m_scl.determinant(),
3082 for (
int j = 0; j < 3; ++j)
3084 const int index = (int)(f.
m_n[j] - &
m_nodes[0]);
3109 for (
int j = 0; j < 3; ++j)
3117 m_nodes[i].m_area *= 0.3333333f;
3131 l.m_c0 = (
l.m_n[0]->m_im +
l.m_n[1]->m_im) / m.
m_kLST;
3151 c.m_masses.resize(
c.m_nodes.size());
3152 for (
int j = 0; j <
c.m_nodes.size(); ++j)
3154 if (
c.m_nodes[j]->m_im == 0)
3156 c.m_containsAnchor =
true;
3161 c.m_masses[j] =
btScalar(1.) /
c.m_nodes[j]->m_im;
3163 c.m_imass +=
c.m_masses[j];
3172 ii[0] = ii[1] = ii[2] =
btVector3(0, 0, 0);
3176 for (i = 0, ni =
c.m_nodes.size(); i < ni; ++i)
3181 ii[0][0] += m * (q[1] + q[2]);
3182 ii[1][1] += m * (q[0] + q[2]);
3183 ii[2][2] += m * (q[0] + q[1]);
3184 ii[0][1] -= m * k[0] * k[1];
3185 ii[0][2] -= m * k[0] * k[2];
3186 ii[1][2] -= m * k[1] * k[2];
3189 ii[1][0] = ii[0][1];
3190 ii[2][0] = ii[0][2];
3191 ii[2][1] = ii[1][2];
3196 c.m_framexform.setIdentity();
3197 c.m_framexform.setOrigin(
c.m_com);
3198 c.m_framerefs.resize(
c.m_nodes.size());
3201 for (i = 0; i <
c.m_framerefs.size(); ++i)
3203 c.m_framerefs[i] =
c.m_nodes[i]->m_x -
c.m_com;
3218 const int n =
c.m_nodes.size();
3225 m[0] = m[1] = m[2] =
btVector3(0, 0, 0);
3230 for (
int i = 0; i <
c.m_nodes.size(); ++i)
3239 c.m_framexform.setOrigin(
c.m_com);
3240 c.m_framexform.setBasis(
r);
3243 c.m_invwi =
c.m_framexform.getBasis() *
c.m_locii *
c.m_framexform.getBasis().transpose();
3246 const btScalar rk=(2*
c.m_extents.length2())/(5*
c.m_imass);
3252 c.m_invwi=
c.m_xform.getBasis().scaled(iin)*
c.m_xform.getBasis().transpose();
3254 c.m_invwi[0] =
c.m_invwi[1] =
c.m_invwi[2] =
btVector3(0, 0, 0);
3255 for (
int i = 0; i < n; ++i)
3259 const btScalar m = 1 /
c.m_nodes[i]->m_im;
3260 c.m_invwi[0][0] += m * (q[1] + q[2]);
3261 c.m_invwi[1][1] += m * (q[0] + q[2]);
3262 c.m_invwi[2][2] += m * (q[0] + q[1]);
3263 c.m_invwi[0][1] -= m * k[0] * k[1];
3264 c.m_invwi[0][2] -= m * k[0] * k[2];
3265 c.m_invwi[1][2] -= m * k[1] * k[2];
3267 c.m_invwi[1][0] =
c.m_invwi[0][1];
3268 c.m_invwi[2][0] =
c.m_invwi[0][2];
3269 c.m_invwi[2][1] =
c.m_invwi[1][2];
3270 c.m_invwi =
c.m_invwi.inverse();
3279 for (i = 0; i < n; ++i)
3283 c.m_av +=
btCross(
c.m_nodes[i]->m_x -
c.m_com,
v);
3286 c.m_lv =
c.m_imass *
c.m_lv * (1 -
c.m_ldamping);
3287 c.m_av =
c.m_invwi *
c.m_av * (1 -
c.m_adamping);
3295 if (
c.m_matching > 0)
3297 for (
int j = 0; j <
c.m_nodes.size(); ++j)
3299 Node& n = *
c.m_nodes[j];
3309 for (
int j = 1; j < n; ++j)
3311 mi.setMin(
c.m_nodes[j]->m_x);
3312 mx.setMax(
c.m_nodes[j]->m_x);
3376 c.m_dimpulses[0] /= (
btScalar)
c.m_ndimpulses;
3377 c.m_dimpulses[1] /= (
btScalar)
c.m_ndimpulses;
3385 if (0 < (drift ?
c.m_ndimpulses :
c.m_nvimpulses))
3389 for (
int j = 0; j <
c.m_nodes.size(); ++j)
3391 const int idx = int(
c.m_nodes[j] - &
m_nodes[0]);
3399 for (i = 0; i < deltas.
size(); ++i)
3403 m_nodes[i].m_x += deltas[i] / weights[i];
3416 if (
c.m_ndamping > 0)
3418 for (
int j = 0; j <
c.m_nodes.size(); ++j)
3420 Node& n = *
c.m_nodes[j];
3424 if (vx.length2() <= n.
m_v.length2())
3426 n.
m_v +=
c.m_ndamping * (vx - n.
m_v);
3438 m_links[i].Feature::m_material->m_kLST = k;
3450 btScalar unit_simplex_measure = 1. / 6.;
3459 c1.getY(), c2.getY(), c3.getY(),
3460 c1.getZ(), c2.getZ(), c3.getZ());
3461 t.m_element_measure = Dm.determinant() * unit_simplex_measure;
3462 t.m_Dm_inverse = Dm.inverse();
3470 btScalar det = 1 / (
a[0] * b[1] *
c[2] -
a[0] * b[1] * d[2] -
a[0] * b[2] *
c[1] +
a[0] * b[2] * d[1] +
a[0] *
c[1] * d[2] -
a[0] *
c[2] * d[1] +
a[1] * (-b[0] *
c[2] + b[0] * d[2] + b[2] *
c[0] - b[2] * d[0] -
c[0] * d[2] +
c[2] * d[0]) +
a[2] * (b[0] *
c[1] - b[0] * d[1] + b[1] * (d[0] -
c[0]) +
c[0] * d[1] -
c[1] * d[0]) - b[0] *
c[1] * d[2] + b[0] *
c[2] * d[1] + b[1] *
c[0] * d[2] - b[1] *
c[2] * d[0] - b[2] *
c[0] * d[1] + b[2] *
c[1] * d[0]);
3472 btScalar P11 = -b[2] *
c[1] + d[2] *
c[1] + b[1] *
c[2] + b[2] * d[1] -
c[2] * d[1] - b[1] * d[2];
3473 btScalar P12 = b[2] *
c[0] - d[2] *
c[0] - b[0] *
c[2] - b[2] * d[0] +
c[2] * d[0] + b[0] * d[2];
3474 btScalar P13 = -b[1] *
c[0] + d[1] *
c[0] + b[0] *
c[1] + b[1] * d[0] -
c[1] * d[0] - b[0] * d[1];
3475 btScalar P21 =
a[2] *
c[1] - d[2] *
c[1] -
a[1] *
c[2] -
a[2] * d[1] +
c[2] * d[1] +
a[1] * d[2];
3476 btScalar P22 = -
a[2] *
c[0] + d[2] *
c[0] +
a[0] *
c[2] +
a[2] * d[0] -
c[2] * d[0] -
a[0] * d[2];
3477 btScalar P23 =
a[1] *
c[0] - d[1] *
c[0] -
a[0] *
c[1] -
a[1] * d[0] +
c[1] * d[0] +
a[0] * d[1];
3478 btScalar P31 = -
a[2] * b[1] + d[2] * b[1] +
a[1] * b[2] +
a[2] * d[1] - b[2] * d[1] -
a[1] * d[2];
3479 btScalar P32 =
a[2] * b[0] - d[2] * b[0] -
a[0] * b[2] -
a[2] * d[0] + b[2] * d[0] +
a[0] * d[2];
3480 btScalar P33 = -
a[1] * b[0] + d[1] * b[0] +
a[0] * b[1] +
a[1] * d[0] - b[1] * d[0] -
a[0] * d[1];
3481 btScalar P41 =
a[2] * b[1] -
c[2] * b[1] -
a[1] * b[2] -
a[2] *
c[1] + b[2] *
c[1] +
a[1] *
c[2];
3482 btScalar P42 = -
a[2] * b[0] +
c[2] * b[0] +
a[0] * b[2] +
a[2] *
c[0] - b[2] *
c[0] -
a[0] *
c[2];
3483 btScalar P43 =
a[1] * b[0] -
c[1] * b[0] -
a[0] * b[1] -
a[1] *
c[0] + b[1] *
c[0] +
a[0] *
c[1];
3485 btVector4 p1(P11 * det, P21 * det, P31 * det, P41 * det);
3486 btVector4 p2(P12 * det, P22 * det, P32 * det, P42 * det);
3487 btVector4 p3(P13 * det, P23 * det, P33 * det, P43 * det);
3497 return a[0] * b[0] +
a[1] * b[1] +
a[2] * b[2] +
a[3] * b[3];
3510 c1.getY(), c2.getY(), c3.getY(),
3511 c1.getZ(), c2.getZ(), c3.getZ());
3512 t.m_F = Ds *
t.m_Dm_inverse;
3516 s.
m_J =
t.m_F.determinant();
3518 s.
m_trace =
C[0].getX() +
C[1].getY() +
C[2].getZ();
3519 s.
m_cofF =
t.m_F.adjoint().transpose();
3529 Dot4(q2,
t.m_P_inv[0]),
Dot4(q2,
t.m_P_inv[1]),
Dot4(q2,
t.m_P_inv[2]),
3530 Dot4(q3,
t.m_P_inv[0]),
Dot4(q3,
t.m_P_inv[1]),
Dot4(q3,
t.m_P_inv[2]));
3532 B.extractRotation(q, 0.01);
3549 m_bodies[0].activate();
3550 m_bodies[1].activate();
3556 static const btScalar maxdrift = 4;
3558 m_rpos[0] = m_bodies[0].xform() * m_refs[0];
3559 m_rpos[1] = m_bodies[1].xform() * m_refs[1];
3560 m_drift =
Clamp(m_rpos[0] - m_rpos[1], maxdrift) *
m_erp / dt;
3561 m_rpos[0] -= m_bodies[0].xform().getOrigin();
3562 m_rpos[1] -= m_bodies[1].xform().getOrigin();
3563 m_massmatrix =
ImpulseMatrix(m_bodies[0].invMass(), m_bodies[0].invWorldInertia(), m_rpos[0],
3564 m_bodies[1].invMass(), m_bodies[1].invWorldInertia(), m_rpos[1]);
3567 m_sdrift = m_massmatrix * (m_drift * m_split);
3568 m_drift *= 1 - m_split;
3576 const btVector3 va = m_bodies[0].velocity(m_rpos[0]);
3577 const btVector3 vb = m_bodies[1].velocity(m_rpos[1]);
3582 m_bodies[0].applyImpulse(-impulse, m_rpos[0]);
3583 m_bodies[1].applyImpulse(impulse, m_rpos[1]);
3591 m_bodies[0].applyDImpulse(-m_sdrift, m_rpos[0]);
3592 m_bodies[1].applyDImpulse(m_sdrift, m_rpos[1]);
3600 m_icontrol->Prepare(
this);
3602 m_axis[0] = m_bodies[0].xform().getBasis() * m_refs[0];
3603 m_axis[1] = m_bodies[1].xform().getBasis() * m_refs[1];
3605 m_drift *=
btMin(maxdrift,
btAcos(Clamp<btScalar>(
btDot(m_axis[0], m_axis[1]), -1, +1)));
3606 m_drift *=
m_erp / dt;
3607 m_massmatrix =
AngularImpulseMatrix(m_bodies[0].invWorldInertia(), m_bodies[1].invWorldInertia());
3610 m_sdrift = m_massmatrix * (m_drift * m_split);
3611 m_drift *= 1 - m_split;
3619 const btVector3 va = m_bodies[0].angularVelocity();
3620 const btVector3 vb = m_bodies[1].angularVelocity();
3623 const btVector3 vc = vr - m_axis[0] * m_icontrol->Speed(
this, sp);
3627 m_bodies[0].applyAImpulse(-impulse);
3628 m_bodies[1].applyAImpulse(impulse);
3636 m_bodies[0].applyDAImpulse(-m_sdrift);
3637 m_bodies[1].applyDAImpulse(m_sdrift);
3645 const bool dodrift = (m_life == 0);
3646 m_delete = (++m_life) > m_maxlife;
3649 m_drift = m_drift *
m_erp / dt;
3652 m_sdrift = m_massmatrix * (m_drift * m_split);
3653 m_drift *= 1 - m_split;
3659 m_drift = m_sdrift =
btVector3(0, 0, 0);
3666 const btVector3 va = m_bodies[0].velocity(m_rpos[0]);
3667 const btVector3 vb = m_bodies[1].velocity(m_rpos[1]);
3681 if (m_bodies[0].m_soft == m_bodies[1].m_soft)
3688 if (impulse.
m_velocity.length() < m_bodies[0].m_soft->m_maxSelfCollisionImpulse)
3693 m_bodies[0].applyImpulse(-impulse * m_bodies[0].m_soft->m_selfCollisionImpulseFactor, m_rpos[0]);
3694 m_bodies[1].applyImpulse(impulse * m_bodies[0].m_soft->m_selfCollisionImpulseFactor, m_rpos[1]);
3701 m_bodies[0].applyImpulse(-impulse, m_rpos[0]);
3702 m_bodies[1].applyImpulse(impulse, m_rpos[1]);
3711 m_bodies[0].applyDImpulse(-m_sdrift, m_rpos[0]);
3712 m_bodies[1].applyDImpulse(m_sdrift, m_rpos[1]);
3725 const bool as_lift = kLF > 0;
3726 const bool as_drag = kDG > 0;
3727 const bool as_pressure = kPR != 0;
3728 const bool as_volume = kVC > 0;
3729 const bool as_aero = as_lift ||
3735 const bool use_medium = as_aero;
3736 const bool use_volume = as_pressure ||
3745 ivolumetp = 1 /
btFabs(volume) * kPR;
3804 for (
int j = 0; j < 3; ++j)
3808 n.
m_x +=
m_z[i] * unit_normal;
3817 for (
int j = 0; j < 4; ++j)
3830 for (
int i = 0; i <=
N; ++i)
3832 for (
int j = 0; i + j <=
N; ++j)
3849 Node& n = *
a.m_node;
3851 const btVector3 va =
a.m_body->getVelocityInLocalPoint(
a.m_c1) * dt;
3854 const btVector3 impulse =
a.m_c0 * vr *
a.m_influence;
3855 n.
m_x += impulse *
a.m_c2;
3856 a.m_body->applyImpulse(-impulse,
a.m_c1);
3865 const btScalar mrg = psb->getCollisionShape()->getMargin();
3870 const sCti& cti =
c.m_cti;
3871 if (cti.
m_colObj->hasContactResponse())
3886 if (multibodyLinkCol)
3888 const int ndof = multibodyLinkCol->
m_multiBody->getNumDofs() + 6;
3898 for (
int j = 0; j < ndof; ++j)
3900 vel += multibodyLinkCol->
m_multiBody->getVelocityVector()[j] * jac[j];
3906 const btVector3 vb =
c.m_node->m_x -
c.m_node->m_q;
3914 const btVector3 impulse =
c.m_c0 * ((vr - (fv *
c.m_c3) + (cti.
m_normal * (dp *
c.m_c4))) * kst);
3915 c.m_node->m_x -= impulse *
c.m_c2;
3924 if (multibodyLinkCol)
3926 double multiplier = 0.5;
3927 multibodyLinkCol->
m_multiBody->applyDeltaVeeMultiDof(deltaV, -impulse.length() * multiplier);
3944 Node& n = *
c.m_node;
3945 Face& f = *
c.m_face;
3960 corr +=
c.m_normal * j;
3963 n.
m_x += corr *
c.m_cfm[0];
3964 f.
m_n[0]->
m_x -= corr * (
c.m_cfm[1] *
c.m_weights.x());
3965 f.
m_n[1]->
m_x -= corr * (
c.m_cfm[1] *
c.m_weights.y());
3966 f.
m_n[2]->
m_x -= corr * (
c.m_cfm[1] *
c.m_weights.z());
3974 for (
int i = 0, ni = psb->
m_links.
size(); i < ni; ++i)
3980 Node& b = *
l.m_n[1];
3986 a.m_x -= del * (k *
a.m_im);
3997 for (
int i = 0, ni = psb->
m_links.
size(); i < ni; ++i)
4002 n[0]->
m_v +=
l.m_c3 * (j * n[0]->
m_im);
4003 n[1]->
m_v -=
l.m_c3 * (j * n[1]->
m_im);
4063 const btScalar timemargin = (wtr.getOrigin() - ctr.getOrigin()).
length();
4073 volume.Expand(
btVector3(basemargin, basemargin, basemargin));
4074 docollide.
psb =
this;
4078 docollide.
dynmargin = basemargin + timemargin;
4105 volume.Expand(
btVector3(basemargin, basemargin, basemargin));
4109 docollideNode.
psb =
this;
4112 docollideNode.
dynmargin = basemargin + timemargin;
4120 docollideFace.
psb =
this;
4123 docollideFace.
dynmargin = basemargin + timemargin;
4158 psb->getCollisionShape()->getMargin();
4160 docollide.
psb[0] =
this;
4161 docollide.
psb[1] = psb;
4166 docollide.
psb[0] = psb;
4167 docollide.
psb[1] =
this;
4178 if (psb->isActive() || this->isActive())
4185 psb->getCollisionShape()->getMargin();
4191 docollide.
psb[0] =
this;
4192 docollide.
psb[1] = psb;
4202 docollide.
psb[0] = psb;
4203 docollide.
psb[1] =
this;
4214 docollide.
psb[0] =
this;
4215 docollide.
psb[1] = psb;
4236 if (psb->isActive() || this->isActive())
4249 docollide.
psb[0] =
this;
4250 docollide.
psb[1] = psb;
4259 docollide.
psb[0] = psb;
4260 docollide.
psb[1] =
this;
4271 docollide.
psb[0] =
this;
4272 docollide.
psb[1] = psb;
4314 if (sbd->m_materials)
4317 int numElem = sbd->m_numMaterials;
4321 for (
int i = 0; i < numElem; i++, memPtr++)
4345 int numElem = sbd->m_numNodes;
4348 for (
int i = 0; i < numElem; i++, memPtr++)
4369 int numElem = sbd->m_numLinks;
4372 for (
int i = 0; i < numElem; i++, memPtr++)
4390 int numElem = sbd->m_numFaces;
4393 for (
int i = 0; i < numElem; i++, memPtr++)
4397 for (
int j = 0; j < 3; j++)
4408 if (sbd->m_tetrahedra)
4411 int numElem = sbd->m_numTetrahedra;
4414 for (
int i = 0; i < numElem; i++, memPtr++)
4416 for (
int j = 0; j < 4; j++)
4434 int numElem = sbd->m_numAnchors;
4437 for (
int i = 0; i < numElem; i++, memPtr++)
4451 sbd->m_config.m_dynamicFriction =
m_cfg.
kDF;
4453 sbd->m_config.m_pressure =
m_cfg.
kPR;
4462 sbd->m_config.m_damping =
m_cfg.
kDP;
4463 sbd->m_config.m_poseMatch =
m_cfg.
kMT;
4465 sbd->m_config.m_volume =
m_cfg.
kVC;
4466 sbd->m_config.m_rigidContactHardness =
m_cfg.
kCHR;
4467 sbd->m_config.m_kineticContactHardness =
m_cfg.
kKHR;
4468 sbd->m_config.m_softContactHardness =
m_cfg.
kSHR;
4469 sbd->m_config.m_anchorHardness =
m_cfg.
kAHR;
4473 sbd->m_config.m_softKineticClusterHardness =
m_cfg.
kSKHR_CL;
4500 for (
int i = 0; i < numElem; i++, memPtr++)
4515 int sz =
sizeof(
float);
4517 float* memPtr = (
float*)chunk->
m_oldPtr;
4518 for (
int i = 0; i < numElem; i++, memPtr++)
4532 if (sbd->m_numClusters)
4534 int numElem = sbd->m_numClusters;
4538 for (
int i = 0; i < numElem; i++, memPtr++)
4578 for (
int j = 0; j < numElem; j++, memPtr++)
4580 m_clusters[i]->m_framerefs[j].serializeFloat(*memPtr);
4589 int sz =
sizeof(
float);
4591 float* memPtr = (
float*)chunk->
m_oldPtr;
4592 for (
int j = 0; j < numElem; j++, memPtr++)
4603 int sz =
sizeof(int);
4605 int* memPtr = (
int*)chunk->
m_oldPtr;
4606 for (
int j = 0; j < numElem; j++, memPtr++)
4610 *memPtr = *indexPtr;
4628 for (
int i = 0; i < numElem; i++, memPtr++)
4638 for (
int j = 0; j < 4; j++)
4645 if (
m_joints[i]->m_bodies[0].m_soft)
4650 if (
m_joints[i]->m_bodies[0].m_collisionObject)
4655 if (
m_joints[i]->m_bodies[0].m_rigid)
4661 if (
m_joints[i]->m_bodies[1].m_soft)
4666 if (
m_joints[i]->m_bodies[1].m_collisionObject)
4671 if (
m_joints[i]->m_bodies[1].m_rigid)
typedef float(TangentPoint)[2]
_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
Group RGB to Bright Vector Camera Clamp
ATTR_WARN_UNUSED_RESULT const BMVert * v2
ATTR_WARN_UNUSED_RESULT const BMLoop * l
ATTR_WARN_UNUSED_RESULT const BMVert * v
#define btAlignedFree(ptr)
#define btAlignedAlloc(size, alignment)
SIMD_FORCE_INLINE btBroadphaseProxy * getBroadphaseHandle()
void activate(bool forceActivation=false) const
#define DISABLE_DEACTIVATION
btScalar m_deactivationTime
void setActivationState(int newState) const
SIMD_FORCE_INLINE int getActivationState() const
#define WANTS_DEACTIVATION
SIMD_FORCE_INLINE bool isActive() const
SIMD_FORCE_INLINE const btCollisionShape * getCollisionShape() const
btCollisionShape * m_collisionShape
btCollisionShape
The btCollisionShape class provides an interface for collision shapes that can be shared among btColl...
struct btDbvtNode * m_node
btConvexShape()
not supported on IBM SDK, until we fix the alignment of btVector3
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
static btDbvtVolume bounds(btDbvtNode **leaves, int count)
void singularValueDecomposition(const btMatrix2x2 &A, GivensRotation &U, const btMatrix2x2 &Sigma, GivensRotation &V, const btScalar tol=64 *std::numeric_limits< btScalar >::epsilon())
2x2 SVD (singular value decomposition) A=USV'
btMatrix3x3 inverse() const
Return the inverse of the matrix.
btMatrix3x3
The btMatrix3x3 class implements a 3x3 rotation matrix, to perform linear algebra in combination with...
SIMD_FORCE_INLINE const T & btMin(const T &a, const T &b)
SIMD_FORCE_INLINE const T & btMax(const T &a, const T &b)
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
virtual bool serialize(void *o_alignedDataBuffer, unsigned i_dataBufferSize, bool i_swapEndian) const
Data buffer MUST be 16 byte aligned.
SIMD_FORCE_INLINE btScalar length(const btQuaternion &q)
Return the length of a quaternion.
SIMD_FORCE_INLINE btScalar btAngle(const btQuaternion &q1, const btQuaternion &q2)
Return the angle between two quaternions.
bool gDisableDeactivation
btScalar gDeactivationTime
SIMD_FORCE_INLINE btScalar btAcos(btScalar x)
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
#define ATTRIBUTE_ALIGNED16(a)
SIMD_FORCE_INLINE btScalar btFabs(btScalar x)
SIMD_FORCE_INLINE bool btFuzzyZero(btScalar x)
SIMD_FORCE_INLINE btScalar btSqrt(btScalar y)
SIMD_FORCE_INLINE void btSwap(T &a, T &b)
#define BT_SBMATERIAL_CODE
@ BT_JOINT_SOFT_BODY_CLUSTER
@ BT_JOINT_COLLISION_OBJECT
static T sum(const btAlignedObjectArray< T > &items)
static btMatrix3x3 OuterProduct(const btScalar *v1, const btScalar *v2, const btScalar *v3, const btScalar *u1, const btScalar *u2, const btScalar *u3, int ndof)
static btMatrix3x3 Mul(const btMatrix3x3 &a, btScalar b)
static btScalar ImplicitSolve(btSoftBody::ImplicitFn *fn, const btVector3 &a, const btVector3 &b, const btScalar accuracy, const int maxiterations=256)
static btDbvtVolume VolumeOf(const btSoftBody::Face &f, btScalar margin)
static T Lerp(const T &a, const T &b, btScalar t)
static btMatrix3x3 AngularImpulseMatrix(const btMatrix3x3 &iia, const btMatrix3x3 &iib)
static btScalar AreaOf(const btVector3 &x0, const btVector3 &x1, const btVector3 &x2)
static btVector3 NormalizeAny(const btVector3 &v)
static int PolarDecompose(const btMatrix3x3 &m, btMatrix3x3 &q, btMatrix3x3 &s)
static int MatchEdge(const btSoftBody::Node *a, const btSoftBody::Node *b, const btSoftBody::Node *ma, const btSoftBody::Node *mb)
static SIMD_FORCE_INLINE btVector3 generateUnitOrthogonalVector(const btVector3 &u)
static bool SameSign(const T &x, const T &y)
static void EvaluateMedium(const btSoftBodyWorldInfo *wfi, const btVector3 &x, btSoftBody::sMedium &medium)
static void ZeroInitialize(T &value)
static btVector3 ProjectOnPlane(const btVector3 &v, const btVector3 &a)
static btScalar ClusterMetric(const btVector3 &x, const btVector3 &y)
static btMatrix3x3 ImpulseMatrix(btScalar dt, btScalar ima, btScalar imb, const btMatrix3x3 &iwi, const btVector3 &r)
static void ApplyClampedForce(btSoftBody::Node &n, const btVector3 &f, btScalar dt)
static SIMD_FORCE_INLINE void findJacobian(const btMultiBodyLinkCollider *multibodyLinkCol, btMultiBodyJacobianData &jacobianData, const btVector3 &contact_point, const btVector3 &dir)
btSoftBody implementation by Nathanael Presson
static btMatrix3x3 Diagonal(btScalar x)
static void calculateNormalCone(btDbvntNode *root)
#define IDX2PTR(_p_, _b_)
#define PTR2IDX(_p_, _b_)
static void getBarycentric(const btVector3 &p, btVector3 &a, btVector3 &b, btVector3 &c, btVector3 &bary)
static btDbvtNode * buildTreeBottomUp(btAlignedObjectArray< btDbvtNode * > &leafNodes, btAlignedObjectArray< btAlignedObjectArray< int > > &adj)
btSoftBody implementation by Nathanael Presson
static btDbvntNode * copyToDbvnt(const btDbvtNode *n)
static btScalar Dot4(const btVector4 &a, const btVector4 &b)
static unsigned long seed
#define btSoftBodyDataName
#define btSoftBodyData
btSoftBody implementation by Nathanael Presson
btTransform m_worldTransform
SIMD_FORCE_INLINE btScalar length2() const
Return the length of the vector squared.
SIMD_FORCE_INLINE btScalar btDot(const btVector3 &v1, const btVector3 &v2)
Return the dot product between two vectors.
btVector3
btVector3 can be used to represent 3D points and vectors. It has an un-used w component to suit 16-by...
SIMD_FORCE_INLINE btVector3 & safeNormalize()
SIMD_FORCE_INLINE btVector3 btCross(const btVector3 &v1, const btVector3 &v2)
Return the cross product of two vectors.
SIMD_FORCE_INLINE void reserve(int _Count)
SIMD_FORCE_INLINE void clear()
clear the array, deallocated memory. Generally it is better to use array.resize(0),...
SIMD_FORCE_INLINE int capacity() const
return the pre-allocated (reserved) elements, this is at least as large as the total number of elemen...
int findLinearSearch(const T &key) const
SIMD_FORCE_INLINE int size() const
return the number of elements in the array
SIMD_FORCE_INLINE void pop_back()
void remove(const T &key)
SIMD_FORCE_INLINE void resize(int newsize, const T &fillData=T())
SIMD_FORCE_INLINE void push_back(const T &_Val)
virtual void setAabb(btBroadphaseProxy *proxy, const btVector3 &aabbMin, const btVector3 &aabbMax, btDispatcher *dispatcher)=0
void insert(const Key &key, const Value &value)
const Value * find(const Key &key) const
btMultiBody * m_multiBody
static btMultiBodyLinkCollider * upcast(btCollisionObject *colObj)
The btQuaternion implements quaternion to perform linear algebra rotations in combination with btMatr...
void setRotation(const btVector3 &axis, const btScalar &_angle)
Set the rotation using axis angle notation.
SIMD_FORCE_INLINE const btCollisionShape * getCollisionShape() const
btVector3 getVelocityInLocalPoint(const btVector3 &rel_pos) const
btScalar getInvMass() const
static const btRigidBody * upcast(const btCollisionObject *colObj)
void applyImpulse(const btVector3 &impulse, const btVector3 &rel_pos)
const btMatrix3x3 & getInvInertiaTensorWorld() const
virtual btChunk * allocate(size_t size, int numElements)=0
virtual void * findPointer(void *oldPtr)=0
virtual void * getUniquePointer(void *oldPtr)=0
virtual void finalizeChunk(btChunk *chunk, const char *structType, int chunkCode, void *oldPtr)=0
static void PSolve_Links(btSoftBody *psb, btScalar kst, btScalar ti)
static void PSolve_SContacts(btSoftBody *psb, btScalar, btScalar ti)
bool checkLink(int node0, int node1) const
btScalar m_sleepingThreshold
void transformTo(const btTransform &trs)
btVector3 getLinearVelocity()
bool checkFace(int node0, int node1, int node2) const
void advanceDeformation()
void setGravityFactor(btScalar gravFactor)
void setPose(bool bvolume, bool bframe)
bool cutLink(int node0, int node1, btScalar position)
void appendFace(int model=-1, Material *mat=0)
void setMass(int node, btScalar mass)
void interpolateRenderMesh()
btScalar m_dampingCoefficient
btAlignedObjectArray< TetraScratch > m_tetraScratchesTn
bool rayFaceTest(const btVector3 &rayFrom, const btVector3 &rayTo, sRayCast &results)
void appendLinearJoint(const LJoint::Specs &specs, Cluster *body0, Body body1)
void scale(const btVector3 &scl)
btAlignedObjectArray< bool > m_clusterConnectivity
void updateFaceTree(bool use_velocity, bool margin)
void defaultCollisionHandler(const btCollisionObjectWrapper *pcoWrap)
btScalar getVolume() const
bool rayTest(const btVector3 &rayFrom, const btVector3 &rayTo, sRayCast &results)
Ray casting using rayFrom and rayTo in worldspace, (not direction!)
void addVelocity(const btVector3 &velocity)
void predictMotion(btScalar dt)
void setSelfCollision(bool useSelfCollision)
void setLinearVelocity(const btVector3 &linVel)
void appendTetra(int model, Material *mat)
void setRestLengthScale(btScalar restLength)
void rotate(const btQuaternion &rot)
void applyClusters(bool drift)
static void PSolve_Anchors(btSoftBody *psb, btScalar kst, btScalar ti)
btSoftBodyWorldInfo * m_worldInfo
void updateArea(bool averageArea=true)
void addForce(const btVector3 &force)
void prepareClusters(int iterations)
void setCollisionQuadrature(int N)
static void clusterVImpulse(Cluster *cluster, const btVector3 &rpos, const btVector3 &impulse)
virtual const char * serialize(void *dataBuffer, class btSerializer *serializer) const
fills the dataBuffer and returns the struct name (and 0 on failure)
static void VSolve_Links(btSoftBody *psb, btScalar kst)
btVector3 evaluateCom() const
void setTotalDensity(btScalar density)
btAlignedObjectArray< const class btCollisionObject * > m_collisionDisabledObjects
static void clusterDAImpulse(Cluster *cluster, const btVector3 &impulse)
void appendNode(const btVector3 &x, btScalar m)
void staticSolve(int iterations)
void setVolumeMass(btScalar mass)
btScalar m_restLengthScale
bool checkDeformableContact(const btCollisionObjectWrapper *colObjWrap, const btVector3 &x, btScalar margin, btSoftBody::sCti &cti, bool predict=false) const
void updateDeactivation(btScalar timeStep)
btAlignedObjectArray< TetraScratch > m_tetraScratches
const btVector3 & getWindVelocity()
void addAeroForceToFace(const btVector3 &windVelocity, int faceIndex)
btAlignedObjectArray< btVector4 > m_renderNodesInterpolationWeights
void appendAngularJoint(const AJoint::Specs &specs, Cluster *body0, Body body1)
void setAngularVelocity(const btVector3 &angVel)
void setVolumeDensity(btScalar density)
static void clusterDCImpulse(Cluster *cluster, const btVector3 &impulse)
void transform(const btTransform &trs)
static void clusterVAImpulse(Cluster *cluster, const btVector3 &impulse)
btScalar getMass(int node) const
tMaterialArray m_materials
void setMaxStress(btScalar maxStress)
btSoftBody(btSoftBodyWorldInfo *worldInfo, int node_count, const btVector3 *x, const btScalar *m)
btAlignedObjectArray< btScalar > m_z
void addAeroForceToNode(const btVector3 &windVelocity, int nodeIndex)
static btVector3 clusterCom(const Cluster *cluster)
tRContactArray m_rcontacts
void appendAnchor(int node, btRigidBody *body, bool disableCollisionBetweenLinkedBodies=false, btScalar influence=1)
btScalar m_maxSpeedSquared
void releaseCluster(int index)
btScalar m_repulsionStiffness
void setVelocity(const btVector3 &velocity)
int generateClusters(int k, int maxiterations=8192)
void geometricCollisionHandler(btSoftBody *psb)
void refine(ImplicitFn *ifn, btScalar accurary, bool cut)
void setSolver(eSolverPresets::_ preset)
static T BaryEval(const T &a, const T &b, const T &c, const btVector3 &coord)
Material * appendMaterial()
void removeAnchor(int node)
btAlignedObjectArray< DeformableNodeRigidAnchor > m_deformableAnchors
static void solveClusters(const btAlignedObjectArray< btSoftBody * > &bodies)
void appendNote(const char *text, const btVector3 &o, const btVector4 &c=btVector4(1, 0, 0, 0), Node *n0=0, Node *n1=0, Node *n2=0, Node *n3=0)
bool checkDeformableFaceContact(const btCollisionObjectWrapper *colObjWrap, Face &f, btVector3 &contact_point, btVector3 &bary, btScalar margin, btSoftBody::sCti &cti, bool predict=false) const
virtual int calculateSerializeBufferSize() const
static void PSolve_RContacts(btSoftBody *psb, btScalar kst, btScalar ti)
static void clusterImpulse(Cluster *cluster, const btVector3 &rpos, const Impulse &impulse)
btAlignedObjectArray< btAlignedObjectArray< const btSoftBody::Node * > > m_renderNodesParents
static void clusterDImpulse(Cluster *cluster, const btVector3 &rpos, const btVector3 &impulse)
static btVector3 clusterVelocity(const Cluster *cluster, const btVector3 &rpos)
btTransform getRigidTransform()
tSContactArray m_scontacts
void(* psolver_t)(btSoftBody *, btScalar, btScalar)
void initializeClusters()
btScalar getRestLengthScale()
void randomizeConstraints()
btScalar getTotalMass() const
void appendLink(int model=-1, Material *mat=0)
void setSpringStiffness(btScalar k)
void initializeDmInverse()
void setTotalMass(btScalar mass, bool fromfaces=false)
void appendDeformableAnchor(int node, btRigidBody *body)
void updateLinkConstants()
void(* vsolver_t)(btSoftBody *, btScalar)
btAlignedObjectArray< btVector3 > m_quads
static psolver_t getSolver(ePSolver::_ solver)
bool checkContact(const btCollisionObjectWrapper *colObjWrap, const btVector3 &x, btScalar margin, btSoftBody::sCti &cti) const
void indicesToPointers(const int *map=0)
static void solveCommonConstraints(btSoftBody **bodies, int count, int iterations)
void setWindVelocity(const btVector3 &velocity)
int generateBendingConstraints(int distance, Material *mat=0)
btAlignedObjectArray< btVector3 > m_X
void translate(const btVector3 &trs)
btVector3 getCenterOfMass() const
void initializeFaceTree()
void resetLinkRestLengths()
static void clusterAImpulse(Cluster *cluster, const Impulse &impulse)
IconTextureDrawCall normal
IMETHOD Vector diff(const Vector &a, const Vector &b, double dt=1)
btAlignedObjectArray< int > m_links
btMatrix3x3FloatData m_invwi
btVector3FloatData m_vimpulses[2]
btVector3FloatData * m_framerefs
btVector3FloatData m_dimpulses[2]
btMatrix3x3FloatData m_locii
float m_maxSelfCollisionImpulse
btTransformFloatData m_framexform
float m_selfCollisionImpulseFactor
btVector3FloatData m_normal
SoftBodyMaterialData * m_material
SoftBodyMaterialData * m_material
btVector3FloatData m_accumulatedForce
btVector3FloatData m_normal
btVector3FloatData m_previousPosition
btVector3FloatData m_velocity
btVector3FloatData m_position
SoftBodyMaterialData * m_material
btMatrix3x3FloatData m_rot
btVector3FloatData * m_positions
btMatrix3x3FloatData m_aqq
btMatrix3x3FloatData m_scale
btVector3FloatData m_c0[4]
SoftBodyMaterialData * m_material
btMatrix3x3FloatData m_c0
btVector3FloatData m_localFrame
btRigidBodyData * m_rigidBody
SIMD_FORCE_INLINE const btCollisionShape * getCollisionShape() const
SIMD_FORCE_INLINE const btTransform & getWorldTransform() const
const btTransform * m_preTransform
SIMD_FORCE_INLINE const btCollisionObject * getCollisionObject() const
DBVT_INLINE bool isleaf() const
static btDbvtAabbMm FromMM(const btVector3 &mi, const btVector3 &mx)
static btDbvtAabbMm FromCR(const btVector3 &c, btScalar r)
DBVT_INLINE bool isinternal() const
btDbvtNode * insert(const btDbvtVolume &box, void *data)
void optimizeIncremental(int passes)
void update(btDbvtNode *leaf, int lookahead=-1)
DBVT_PREFIX void collideTV(const btDbvtNode *root, const btDbvtVolume &volume, DBVT_IPOLICY) const
static DBVT_PREFIX void rayTest(const btDbvtNode *root, const btVector3 &rayFrom, const btVector3 &rayTo, DBVT_IPOLICY)
void remove(btDbvtNode *leaf)
DBVT_PREFIX void collideTT(const btDbvtNode *root0, const btDbvtNode *root1, DBVT_IPOLICY)
DBVT_PREFIX void selfCollideT(const btDbvntNode *root, DBVT_IPOLICY)
static btScalar SignedDistance(const btVector3 &position, btScalar margin, const btConvexShape *shape, const btTransform &wtrs, sResults &results)
btAlignedObjectArray< btScalar > m_deltaVelocitiesUnitImpulse
btAlignedObjectArray< btScalar > m_jacobians
btAlignedObjectArray< btScalar > scratch_r
btAlignedObjectArray< btMatrix3x3 > scratch_m
btAlignedObjectArray< btVector3 > scratch_v
btVector3FloatData m_refs[2]
btVector3FloatData m_relPosition[2]
btDispatcher * m_dispatcher
btSparseSdf< 3 > m_sparsesdf
btScalar m_maxDisplacement
btBroadphaseInterface * m_broadphase
void Prepare(btScalar dt, int iterations)
void Solve(btScalar dt, btScalar sor)
void Terminate(btScalar dt)
const btTransform & xform() const
void Terminate(btScalar dt)
void Prepare(btScalar dt, int iterations)
void Solve(btScalar dt, btScalar sor)
btAlignedObjectArray< Node * > m_nodes
tPSolverArray m_psequence
tPSolverArray m_dsequence
tVSolverArray m_vsequence
virtual btScalar Eval(const btVector3 &x)=0
virtual void Prepare(btScalar dt, int iterations)
void Solve(btScalar dt, btScalar sor)
void Prepare(btScalar dt, int iterations)
void Terminate(btScalar dt)
RayFromToCaster takes a ray from, ray to (instead of direction!)
RayFromToCaster(const btVector3 &rayFrom, const btVector3 &rayTo, btScalar mxt)
void Process(const btDbvtNode *leaf)
static btScalar rayFromToTriangle(const btVector3 &rayFrom, const btVector3 &rayTo, const btVector3 &rayNormalizedDirection, const btVector3 &a, const btVector3 &b, const btVector3 &c, btScalar maxt=SIMD_INFINITY)
btVector3 m_rayNormalizedDirection
@ V_TwoSided
Vertex normals are oriented toward velocity.
@ V_OneSided
Vertex normals are flipped to match velocity and lift and drag forces are applied.
@ V_TwoSidedLiftDrag
Vertex normals are flipped to match velocity.
@ F_OneSided
Face normals are flipped to match velocity and lift and drag forces are applied.
@ F_TwoSided
Vertex normals are taken as it is.
@ F_TwoSidedLiftDrag
Face normals are flipped to match velocity.
@ RContacts
Anchor solver.
@ SContacts
Rigid contacts solver.
@ SDF_RDN
GJK based Multibody vs. deformable face.
@ VF_SS
Rigid versus soft mask.
@ Default
SDF based Rigid vs. deformable node.
@ VF_DD
Cluster soft body self collision.
@ CL_SS
Vertex vs face soft vs soft handling.
@ CL_SELF
Cluster vs cluster soft vs soft handling.
@ SVSmask
rigid vs deformable
@ SDF_RS
Rigid versus soft mask.
@ SDF_RD
Cluster vs convex rigid vs soft.
@ SDF_RDF
Rigid versus deformable face mask.
@ SDF_MDF
GJK based Rigid vs. deformable face.
@ CL_RS
SDF based rigid vs soft.
@ Default
Enable debug draw.
const btCollisionObject * m_colObj
eFeature::_ feature
soft body
btScalar fraction
feature index
void ProcessColObj(btSoftBody *ps, const btCollisionObjectWrapper *colObWrap)
void ProcessSoftSoft(btSoftBody *psa, btSoftBody *psb)
btRigidBody * m_rigidBody
const btCollisionObjectWrapper * m_colObj1Wrap
btRigidBody * m_rigidBody
const btCollisionObjectWrapper * m_colObj1Wrap
btRigidBody * m_rigidBody
const btCollisionObjectWrapper * m_colObj1Wrap
btScalar Evaluate(const btVector3 &x, const btCollisionShape *shape, btVector3 &normal, btScalar margin)
ccl_device_inline float distance(const float2 &a, const float2 &b)
CCL_NAMESPACE_BEGIN struct View V