78 if (node->
isinternal() && ((depth < maxdepth) || (maxdepth < 0)))
80 drawTree(idraw, node->
childs[0], depth + 1, ncolor, lcolor, mindepth, maxdepth);
81 drawTree(idraw, node->
childs[1], depth + 1, ncolor, lcolor, mindepth, maxdepth);
83 if (depth >= mindepth)
101 for (
int i = 1, ni = items.
size(); i < ni; ++i)
110template <
typename T,
typename Q>
113 for (
int i = 0, ni = items.
size(); i < ni; ++i)
120template <
typename T,
typename Q>
123 for (
int i = 0, ni = items.
size(); i < ni; ++i)
134 return (
sum(items) / n);
162 static const int ncolors=
sizeof(spectrum)/
sizeof(spectrum[0])-1;
164 stress=btMax<btScalar>(0,btMin<btScalar>(1,stress))*ncolors;
165 const int sel=(int)stress;
167 return(spectrum[sel]+(spectrum[sel+1]-spectrum[sel])*frc);
197 for (j = 0, nj = vertices.
size(); j < nj; ++j)
199 vertices[j] = psb->
m_clusters[i]->m_nodes[j]->m_x;
201#define USE_NEW_CONVEX_HULL_COMPUTER
202#ifdef USE_NEW_CONVEX_HULL_COMPUTER
205 int count = vertices.
size();
208 computer.
compute(&vertices[0].getX(), stride, count, shrink, shrinkClamp);
209 for (
int i = 0; i < computer.
faces.
size(); i++)
211 int face = computer.
faces[i];
218 while (edge != firstEdge)
238 for (j = 0; j < (int)hres.
mNumFaces; ++j)
315 idraw->
drawLine(o - x * nscl, o + x * nscl, ccolor);
316 idraw->
drawLine(o - y * nscl, o + y * nscl, ccolor);
331 const btVector3 c = (x[0] + x[1] + x[2]) / 3;
333 (x[1] - c) * scl + c,
334 (x[2] - c) * scl + c,
349 const btVector3 c = (x[0] + x[1] + x[2] + x[3]) / 4;
350 idraw->
drawTriangle((x[0] - c) * scl + c, (x[1] - c) * scl + c, (x[2] - c) * scl + c, col, alp);
351 idraw->
drawTriangle((x[0] - c) * scl + c, (x[1] - c) * scl + c, (x[3] - c) * scl + c, col, alp);
352 idraw->
drawTriangle((x[1] - c) * scl + c, (x[2] - c) * scl + c, (x[3] - c) * scl + c, col, alp);
353 idraw->
drawTriangle((x[2] - c) * scl + c, (x[0] - c) * scl + c, (x[3] - c) * scl + c, col, alp);
386 for (
int j = 0; j < n.
m_rank; ++j)
449 char text[2048] = {0};
453 sprintf(buff,
" M(%.2f)", 1 / n.
m_im);
458 sprintf(buff,
" A(%.2f)", n.
m_area);
471 drawTree(idraw, psb->
m_ndbvt.
m_root, 0,
btVector3(1, 0, 1),
btVector3(1, 1, 1), mindepth, maxdepth);
480 drawTree(idraw, psb->
m_fdbvt.
m_root, 0,
btVector3(0, 1, 0),
btVector3(1, 0, 0), mindepth, maxdepth);
489 drawTree(idraw, psb->
m_cdbvt.
m_root, 0,
btVector3(0, 1, 1),
btVector3(1, 0, 0), mindepth, maxdepth);
540#define REOP_NOT_DEPENDENT -1
541#define REOP_NODE_COMPLETE -2
551 int readyListHead, readyListTail, linkNum, linkDepFrees, depLink;
554 int* nodeWrittenAt =
new int[nNodes + 1];
555 int* linkDepA =
new int[nLinks];
556 int* linkDepB =
new int[nLinks];
557 int* readyList =
new int[nLinks];
566 for (i = 0; i < nNodes + 1; i++)
570 for (i = 0; i < nLinks; i++)
572 linkDepListStarts[i] = NULL;
574 readyListHead = readyListTail = linkDepFrees = 0;
577 for (i = 0; i < nLinks; i++)
581 ar = (lr->
m_n[0] - node0) / (node1 - node0);
582 br = (lr->
m_n[1] - node0) / (node1 - node0);
585 linkDepA[i] = nodeWrittenAt[ar];
586 linkDep = &linkDepFreeList[linkDepFrees++];
588 linkDep->
next = linkDepListStarts[nodeWrittenAt[ar]];
589 linkDepListStarts[nodeWrittenAt[ar]] = linkDep;
597 linkDepB[i] = nodeWrittenAt[br];
598 linkDep = &linkDepFreeList[linkDepFrees++];
599 linkDep->
value = -(i + 1);
600 linkDep->
next = linkDepListStarts[nodeWrittenAt[br]];
601 linkDepListStarts[nodeWrittenAt[br]] = linkDep;
611 readyList[readyListTail++] = i;
616 nodeWrittenAt[ar] = nodeWrittenAt[br] = i;
625 while (readyListHead != readyListTail)
628 linkNum = readyList[readyListHead++];
630 psb->
m_links[i++] = linkBuffer[linkNum];
633 linkDep = linkDepListStarts[linkNum];
636 depLink = linkDep->
value;
643 depLink = -depLink - 1;
649 readyList[readyListTail++] = depLink;
652 linkDep = linkDep->
next;
657 delete[] nodeWrittenAt;
661 delete[] linkDepFreeList;
662 delete[] linkDepListStarts;
697 const int r = res + 2;
702 for (i = 0; i < r; ++i)
705 x[i] =
lerp(from, to, t);
709 if (fixeds & 1) psb->
setMass(0, 0);
710 if (fixeds & 2) psb->
setMass(r - 1, 0);
714 for (i = 1; i < r; ++i)
733#define IDX(_x_, _y_) ((_y_)*rx + (_x_))
735 if ((resx < 2) || (resy < 2))
return (0);
738 const int tot = rx * ry;
743 for (iy = 0; iy < ry; ++iy)
748 for (
int ix = 0; ix < rx; ++ix)
755 pert = perturbation *
btScalar(rand()) / RAND_MAX;
757 x[
IDX(ix, iy)] =
lerp(temp, temp1, tx);
763 if (fixeds & 2) psb->
setMass(
IDX(rx - 1, 0), 0);
764 if (fixeds & 4) psb->
setMass(
IDX(0, ry - 1), 0);
765 if (fixeds & 8) psb->
setMass(
IDX(rx - 1, ry - 1), 0);
769 for (iy = 0; iy < ry; ++iy)
771 for (
int ix = 0; ix < rx; ++ix)
773 const int idx =
IDX(ix, iy);
774 const bool mdx = (ix + 1) < rx;
775 const bool mdy = (iy + 1) < ry;
885#define IDX(_x_, _y_) ((_y_)*rx + (_x_))
887 if ((resx < 2) || (resy < 2))
return (0);
890 const int tot = rx * ry;
896 for (iy = 0; iy < ry; ++iy)
901 for (
int ix = 0; ix < rx; ++ix)
904 x[
IDX(ix, iy)] =
lerp(py0, py1, tx);
910 if (fixeds & 2) psb->
setMass(
IDX(rx - 1, 0), 0);
911 if (fixeds & 4) psb->
setMass(
IDX(0, ry - 1), 0);
912 if (fixeds & 8) psb->
setMass(
IDX(rx - 1, ry - 1), 0);
913 if (fixeds & 16) psb->
setMass(
IDX((rx - 1) / 2, 0), 0);
914 if (fixeds & 32) psb->
setMass(
IDX(0, (ry - 1) / 2), 0);
915 if (fixeds & 64) psb->
setMass(
IDX(rx - 1, (ry - 1) / 2), 0);
916 if (fixeds & 128) psb->
setMass(
IDX((rx - 1) / 2, ry - 1), 0);
917 if (fixeds & 256) psb->
setMass(
IDX((rx - 1) / 2, (ry - 1) / 2), 0);
923 for (iy = 0; iy < ry; ++iy)
925 for (
int ix = 0; ix < rx; ++ix)
927 const bool mdx = (ix + 1) < rx;
928 const bool mdy = (iy + 1) < ry;
930 int node00 =
IDX(ix, iy);
931 int node01 =
IDX(ix + 1, iy);
932 int node10 =
IDX(ix, iy + 1);
933 int node11 =
IDX(ix + 1, iy + 1);
942 tex_coords[z + 0] =
CalculateUV(resx, resy, ix, iy, 0);
943 tex_coords[z + 1] =
CalculateUV(resx, resy, ix, iy, 1);
944 tex_coords[z + 2] =
CalculateUV(resx, resy, ix, iy, 0);
945 tex_coords[z + 3] =
CalculateUV(resx, resy, ix, iy, 2);
946 tex_coords[z + 4] =
CalculateUV(resx, resy, ix, iy, 3);
947 tex_coords[z + 5] =
CalculateUV(resx, resy, ix, iy, 2);
952 tex_coords[z + 6] =
CalculateUV(resx, resy, ix, iy, 3);
953 tex_coords[z + 7] =
CalculateUV(resx, resy, ix, iy, 2);
954 tex_coords[z + 8] =
CalculateUV(resx, resy, ix, iy, 3);
955 tex_coords[z + 9] =
CalculateUV(resx, resy, ix, iy, 1);
956 tex_coords[z + 10] =
CalculateUV(resx, resy, ix, iy, 0);
957 tex_coords[z + 11] =
CalculateUV(resx, resy, ix, iy, 1);
959 if (gendiags) psb->
appendLink(node00, node11);
999 tc = (1.0f / ((resx - 1)) * ix);
1003 tc = (1.0f / ((resy - 1)) * (resy - 1 - iy));
1007 tc = (1.0f / ((resy - 1)) * (resy - 1 - iy - 1));
1011 tc = (1.0f / ((resx - 1)) * (ix + 1));
1022 static void Generate(
btVector3* x,
int n)
1024 for (
int i = 0; i < n; i++)
1027 for (
int j = i; j; p *= 0.5, j >>= 1)
1038 Hammersley::Generate(&vtx[0], vtx.
size());
1039 for (
int i = 0; i < vtx.
size(); ++i)
1041 vtx[i] = vtx[i] * radius + center;
1048 const int* triangles,
1049 int ntriangles,
bool randomizeConstraints)
1054 for (i = 0, ni = ntriangles * 3; i < ni; ++i)
1056 maxidx =
btMax(triangles[i], maxidx);
1061 chks.
resize(maxidx * maxidx,
false);
1063 for (i = 0, j = 0, ni = maxidx * 3; i < ni; ++j, i += 3)
1065 vtx[j] =
btVector3(vertices[i], vertices[i + 1], vertices[i + 2]);
1068 for (i = 0, ni = ntriangles * 3; i < ni; i += 3)
1070 const int idx[] = {triangles[i], triangles[i + 1], triangles[i + 2]};
1071#define IDX(_x_, _y_) ((_y_)*maxidx + (_x_))
1072 for (
int j = 2, k = 0; k < 3; j = k++)
1074 if (!chks[
IDX(idx[j], idx[k])])
1076 chks[
IDX(idx[j], idx[k])] =
true;
1077 chks[
IDX(idx[k], idx[j])] =
true;
1085 if (randomizeConstraints)
1095 int nvertices,
bool randomizeConstraints)
1104 for (
int i = 0; i < (int)hres.
mNumFaces; ++i)
1106 const int idx[] = {
static_cast<int>(hres.
m_Indices[i * 3 + 0]),
1107 static_cast<int>(hres.
m_Indices[i * 3 + 1]),
1108 static_cast<int>(hres.
m_Indices[i * 3 + 2])};
1109 if (idx[0] < idx[1]) psb->
appendLink(idx[0], idx[1]);
1110 if (idx[1] < idx[2]) psb->
appendLink(idx[1], idx[2]);
1111 if (idx[2] < idx[0]) psb->
appendLink(idx[2], idx[0]);
1115 if (randomizeConstraints)
1124 int numBytesRead = 0;
1126 while (*buffer !=
'\n')
1132 if (buffer[0] == 0x0a)
1137 return numBytesRead;
1147 bool bfacesfromtetras)
1154 int result = sscanf(node,
"%d %d %d %d", &nnode, &ndims, &nattrb, &hasbounds);
1155 result = sscanf(node,
"%d %d %d %d", &nnode, &ndims, &nattrb, &hasbounds);
1159 for (
int i = 0; i < pos.
size(); ++i)
1164 sscanf(node,
"%d %f %f %f", &index, &x, &y, &z);
1185 sf>>nface;sf>>hasbounds;
1186 for(
int i=0;i<nface;++i)
1192 sf>>ni[0];sf>>ni[1];sf>>ni[2];
1210 sscanf(ele,
"%d %d %d", &ntetra, &ncorner, &neattrb);
1214 for (
int i = 0; i < ntetra; ++i)
1221 sscanf(ele,
"%d %d %d %d %d", &index, &ni[0], &ni[1], &ni[2], &ni[3]);
1258 bool reading_points =
false;
1259 bool reading_tets =
false;
1260 size_t n_points = 0;
1263 size_t indices_count = 0;
1264 while (std::getline(fs, line))
1266 std::stringstream ss(line);
1267 if (line.size() == (
size_t)(0))
1270 else if (line.substr(0, 6) ==
"POINTS")
1272 reading_points =
true;
1273 reading_tets =
false;
1274 ss.ignore(128,
' ');
1278 else if (line.substr(0, 5) ==
"CELLS")
1280 reading_points =
false;
1281 reading_tets =
true;
1282 ss.ignore(128,
' ');
1286 else if (line.substr(0, 10) ==
"CELL_TYPES")
1288 reading_points =
false;
1289 reading_tets =
false;
1291 else if (reading_points)
1301 X[x_count++] = position;
1303 else if (reading_tets)
1309 printf(
"Load deformable failed: Only Tetrahedra are supported in VTK file.\n");
1313 ss.ignore(128,
' ');
1316 for (
size_t i = 0; i < 4; i++)
1322 indices[indices_count++] = tet;
1327 for (
int i = 0; i < n_tets; ++i)
1329 const Index& ni = indices[i];
1359 psb->
m_nodes[i].index = counter++;
1364 for (
int i = 0; i < indices.
size(); ++i)
1367 index.push_back(psb->
m_tetras[i].m_n[0]->index);
1368 index.push_back(psb->
m_tetras[i].m_n[1]->index);
1369 index.push_back(psb->
m_tetras[i].m_n[2]->index);
1370 index.push_back(psb->
m_tetras[i].m_n[3]->index);
1374 std::map<std::vector<int>, std::vector<int> > dict;
1375 for (
int i = 0; i < indices.
size(); ++i)
1377 for (
int j = 0; j < 4; ++j)
1383 f.push_back(indices[i][0]);
1384 f.push_back(indices[i][2]);
1388 f.push_back(indices[i][3]);
1389 f.push_back(indices[i][0]);
1390 f.push_back(indices[i][1]);
1394 f.push_back(indices[i][3]);
1395 f.push_back(indices[i][1]);
1396 f.push_back(indices[i][2]);
1400 f.push_back(indices[i][2]);
1401 f.push_back(indices[i][0]);
1402 f.push_back(indices[i][3]);
1404 std::vector<int> f_sorted = f;
1405 std::sort(f_sorted.begin(), f_sorted.end());
1406 if (dict.find(f_sorted) != dict.end())
1408 dict.erase(f_sorted);
1412 dict.insert(std::make_pair(f_sorted, f));
1417 for (std::map<std::vector<int>, std::vector<int> >::iterator it = dict.begin(); it != dict.end(); ++it)
1419 std::vector<int> f = it->second;
1435 std::map<int, int> dict;
1438 for (
int d = 0; d < 3; d++)
1440 int index = psb->
m_faces[i].m_n[d]->index;
1441 if (dict.find(index) == dict.end())
1443 int dict_size = dict.
size();
1444 dict[index] = dict_size;
1446 for (
int k = 0; k < 3; k++)
1448 fs <<
" " << psb->
m_nodes[index].m_x[k];
1458 for (
int n = 0; n < 3; n++)
1460 fs <<
" " << dict[psb->
m_faces[i].m_n[n]->index] + 1;
1471 for (
int d = 0; d < 3; d++)
1473 fs <<
" " << psb->
m_nodes[i].m_x[d];
1481 for (
int n = 0; n < 3; n++)
1483 fs <<
" " << psb->
m_faces[i].m_n[n]->index + 1;
1497 fs << std::scientific << std::setprecision(16);
1503 for (
int d = 0; d < 3; d++)
1505 fs <<
" " << psb->
m_nodes[i].m_q[d];
1513 for (
int d = 0; d < 3; d++)
1515 fs <<
" " << psb->
m_nodes[i].m_v[d];
1524 std::ifstream fs_read;
1525 fs_read.open(filename);
1529 while (std::getline(fs_read, line))
1531 std::stringstream ss(line);
1535 else if (line[0] ==
'f')
1551 std::ofstream fs_write;
1552 fs_write.open(filename, std::ios_base::app);
1553 for (
int i = 0; i < additional_faces.
size(); ++i)
1556 for (
int n = 0; n < 3; n++)
1558 fs_write <<
" " << additional_faces[i][n];
1582 bary =
btVector4(va6 * v6, vb6 * v6, vc6 * v6, vd6 * v6);
1588 btVector3 v0 = b - a, v1 = c - a, v2 = p - a;
1594 btScalar invDenom = 1.0 / (d00 * d11 - d01 * d01);
1595 bary[1] = (d11 * d20 - d01 * d21) * invDenom;
1596 bary[2] = (d00 * d21 - d01 * d20) * invDenom;
1597 bary[0] = 1.0 - bary[1] - bary[2];
1619 btScalar new_min_bary_weight = bary[0];
1620 for (
int k = 1; k < 4; ++k)
1622 new_min_bary_weight =
btMin(new_min_bary_weight, bary[k]);
1624 if (new_min_bary_weight > min_bary_weight)
1631 optimal_parents = parents;
1632 optimal_bary = bary;
1633 min_bary_weight = new_min_bary_weight;
1635 if (bary[0] >= 0. && bary[1] >= 0. && bary[2] >= 0. && bary[3] >= 0.)
1659 btScalar dist = 0, optimal_dist = 0;
1668 btScalar new_min_bary_weight = bary[0];
1669 for (
int k = 1; k < 3; ++k)
1671 new_min_bary_weight =
btMin(new_min_bary_weight, bary[k]);
1675 bool better_than_closest_outisde = (new_min_bary_weight > min_bary_weight && min_bary_weight < 0.);
1677 bool better_than_best_inside = (new_min_bary_weight >= 0 && min_bary_weight >= 0 &&
btFabs(dist) <
btFabs(optimal_dist));
1679 if (better_than_closest_outisde || better_than_best_inside)
1685 optimal_parents = parents;
1686 optimal_bary = bary;
1687 optimal_dist = dist;
1688 min_bary_weight = new_min_bary_weight;
1693 psb->
m_z[i] = optimal_dist;
void sort(btMatrix3x3 &U, btVector3 &sigma, btMatrix3x3 &V, int t)
Helper function of 3X3 SVD for sorting singular values.
const T & btMax(const T &a, const T &b)
const T & btMin(const T &a, const T &b)
btScalar dot(const btQuaternion &q1, const btQuaternion &q2)
Calculate the dot product between two quaternions.
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
btScalar btSqrt(btScalar y)
btScalar btSin(btScalar x)
btScalar btFabs(btScalar x)
btScalar btCos(btScalar x)
static T average(const btAlignedObjectArray< T > &items)
#define REOP_NODE_COMPLETE
static void drawTree(btIDebugDraw *idraw, const btDbvtNode *node, int depth, const btVector3 &ncolor, const btVector3 &lcolor, int mindepth, int maxdepth)
static void mul(btAlignedObjectArray< T > &items, const Q &value)
static int nextLine(const char *buffer)
static void add(btAlignedObjectArray< T > &items, const Q &value)
static T sum(const btAlignedObjectArray< T > &items)
static void drawBox(btIDebugDraw *idraw, const btVector3 &mins, const btVector3 &maxs, const btVector3 &color)
#define REOP_NOT_DEPENDENT
static void drawVertex(btIDebugDraw *idraw, const btVector3 &x, btScalar s, const btVector3 &c)
btSoftBodyHelpers.cpp by Nathanael Presson
LinkDeps_t * LinkDepsPtr_t
btScalar btDot(const btVector3 &v1, const btVector3 &v2)
Return the dot product between two vectors.
btVector3 btCross(const btVector3 &v1, const btVector3 &v2)
Return the cross product of two vectors.
btVector3 lerp(const btVector3 &v1, const btVector3 &v2, const btScalar &t)
Return the linear interpolation between two vectors.
unsigned int mMaxVertices
The HullLibrary class can create a convex hull from a collection of vertices, using the ComputeHull m...
HullError ReleaseResult(HullResult &result)
HullError CreateConvexHull(const HullDesc &desc, HullResult &result)
btAlignedObjectArray< btVector3 > m_OutputVertices
btAlignedObjectArray< unsigned int > m_Indices
unsigned int mNumOutputVertices
The btAlignedObjectArray template class uses a subset of the stl::vector interface for its methods It...
int size() const
return the number of elements in the array
void resize(int newsize, const T &fillData=T())
void push_back(const T &_Val)
btTransform & getWorldTransform()
const Edge * getNextEdgeOfFace() const
int getSourceVertex() const
int getTargetVertex() const
Convex hull implementation based on Preparata and Hong See http://code.google.com/p/bullet/issues/det...
btScalar compute(const void *coords, bool doubleCoords, int stride, int count, btScalar shrink, btScalar shrinkClamp)
btAlignedObjectArray< btVector3 > vertices
btAlignedObjectArray< int > faces
btAlignedObjectArray< Edge > edges
The btIDebugDraw interface class allows hooking up a debug renderer to visually debug simulations.
virtual void drawLine(const btVector3 &from, const btVector3 &to, const btVector3 &color)=0
virtual void draw3dText(const btVector3 &location, const char *textString)=0
virtual void drawTriangle(const btVector3 &v0, const btVector3 &v1, const btVector3 &v2, const btVector3 &, const btVector3 &, const btVector3 &, const btVector3 &color, btScalar alpha)
The btMatrix3x3 class implements a 3x3 rotation matrix, to perform linear algebra in combination with...
The btSoftBody is an class to simulate cloth and volumetric soft bodies.
void appendFace(int model=-1, Material *mat=0)
void setMass(int node, btScalar mass)
btAlignedObjectArray< TetraScratch > m_tetraScratchesTn
void appendTetra(int model, Material *mat)
btAlignedObjectArray< TetraScratch > m_tetraScratches
btAlignedObjectArray< btVector4 > m_renderNodesInterpolationWeights
btAlignedObjectArray< btScalar > m_z
tRContactArray m_rcontacts
btAlignedObjectArray< btAlignedObjectArray< const btSoftBody::Node * > > m_renderNodesParents
tRenderNodeArray m_renderNodes
void randomizeConstraints()
void appendLink(int model=-1, Material *mat=0)
void initializeDmInverse()
btVector3 can be used to represent 3D points and vectors.
void setZ(btScalar _z)
Set the z value.
const btScalar & z() const
Return the z value.
btVector3 cross(const btVector3 &v) const
Return the cross product between this and another vector.
int minAxis() const
Return the axis with the smallest value Note return values are 0,1,2 for x, y, or z.
btScalar dot(const btVector3 &v) const
Return the dot product.
btVector3 normalized() const
Return a normalized version of this vector.
void setY(btScalar _y)
Set the y value.
void setX(btScalar _x)
Set the x value.
const btScalar & getY() const
Return the y value.
const btScalar & x() const
Return the x value.
const btScalar & y() const
Return the y value.
DBVT_INLINE btVector3 Extents() const
DBVT_INLINE btVector3 Center() const
DBVT_INLINE bool isinternal() const
DBVT_INLINE bool isleaf() const
static btSoftBody * CreatePatchUV(btSoftBodyWorldInfo &worldInfo, const btVector3 &corner00, const btVector3 &corner10, const btVector3 &corner01, const btVector3 &corner11, int resx, int resy, int fixeds, bool gendiags, float *tex_coords=0)
static void writeObj(const char *file, const btSoftBody *psb)
static btSoftBody * CreateFromTriMesh(btSoftBodyWorldInfo &worldInfo, const btScalar *vertices, const int *triangles, int ntriangles, bool randomizeConstraints=true)
static void extrapolateBarycentricWeights(btSoftBody *psb)
static void DrawNodeTree(btSoftBody *psb, btIDebugDraw *idraw, int mindepth=0, int maxdepth=-1)
static void getBarycentricWeights(const btVector3 &a, const btVector3 &b, const btVector3 &c, const btVector3 &d, const btVector3 &p, btVector4 &bary)
static btSoftBody * CreateFromTetGenData(btSoftBodyWorldInfo &worldInfo, const char *ele, const char *face, const char *node, bool bfacelinks, bool btetralinks, bool bfacesfromtetras)
static btSoftBody * CreateFromConvexHull(btSoftBodyWorldInfo &worldInfo, const btVector3 *vertices, int nvertices, bool randomizeConstraints=true)
static btSoftBody * CreateFromVtkFile(btSoftBodyWorldInfo &worldInfo, const char *vtk_file)
static void ReoptimizeLinkOrder(btSoftBody *psb)
Sort the list of links to move link calculations that are dependent upon earlier ones as far as possi...
static void DrawFaceTree(btSoftBody *psb, btIDebugDraw *idraw, int mindepth=0, int maxdepth=-1)
static void DrawInfos(btSoftBody *psb, btIDebugDraw *idraw, bool masses, bool areas, bool stress)
static btSoftBody * CreateEllipsoid(btSoftBodyWorldInfo &worldInfo, const btVector3 ¢er, const btVector3 &radius, int res)
static void DrawClusterTree(btSoftBody *psb, btIDebugDraw *idraw, int mindepth=0, int maxdepth=-1)
static float CalculateUV(int resx, int resy, int ix, int iy, int id)
static btSoftBody * CreatePatch(btSoftBodyWorldInfo &worldInfo, const btVector3 &corner00, const btVector3 &corner10, const btVector3 &corner01, const btVector3 &corner11, int resx, int resy, int fixeds, bool gendiags, btScalar perturbation=0.)
static void generateBoundaryFaces(btSoftBody *psb)
static void Draw(btSoftBody *psb, btIDebugDraw *idraw, int drawflags=fDrawFlags::Std)
static void duplicateFaces(const char *filename, const btSoftBody *psb)
static void DrawFrame(btSoftBody *psb, btIDebugDraw *idraw)
static void writeState(const char *file, const btSoftBody *psb)
static btSoftBody * CreateRope(btSoftBodyWorldInfo &worldInfo, const btVector3 &from, const btVector3 &to, int res, int fixeds)
static void interpolateBarycentricWeights(btSoftBody *psb)
const btTransform & xform() const
btAlignedObjectArray< Node * > m_nodes
virtual eType::_ Type() const =0