Use two SI solvers as blocks in block solver.
In the btBlockSolver we are experimenting with, we have SI for both multibody and rigid body. I'm currently replacing rigid body SI solver with two smaller SI solvers. The two examples provided by RigidBodyBoxes.h should have the same behavior.
This commit is contained in:
@@ -132,14 +132,13 @@ void CollisionShape2TriangleMesh(btCollisionShape* collisionShape, const btTrans
|
||||
{
|
||||
btConvexShape* convex = (btConvexShape*)collisionShape;
|
||||
{
|
||||
|
||||
const btConvexPolyhedron* pol = 0;
|
||||
if (convex->isPolyhedral())
|
||||
{
|
||||
btPolyhedralConvexShape* poly = (btPolyhedralConvexShape*)convex;
|
||||
pol = poly->getConvexPolyhedron();
|
||||
}
|
||||
|
||||
|
||||
if (pol)
|
||||
{
|
||||
for (int v = 0; v < pol->m_vertices.size(); v++)
|
||||
@@ -151,19 +150,16 @@ void CollisionShape2TriangleMesh(btCollisionShape* collisionShape, const btTrans
|
||||
}
|
||||
for (int f = 0; f < pol->m_faces.size(); f++)
|
||||
{
|
||||
|
||||
for (int ii = 2; ii < pol->m_faces[f].m_indices.size(); ii++)
|
||||
{
|
||||
indicesOut.push_back(pol->m_faces[f].m_indices[0]);
|
||||
indicesOut.push_back(pol->m_faces[f].m_indices[ii-1]);
|
||||
indicesOut.push_back(pol->m_faces[f].m_indices[ii - 1]);
|
||||
indicesOut.push_back(pol->m_faces[f].m_indices[ii]);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
btShapeHull* hull = new btShapeHull(convex);
|
||||
hull->buildHull(0.0, 1);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user