Added several updates for btSoftBody: convex cluster collision detection, new constraints, new demos (only enabled in SoftBodyDemo, todo for AllBulletDemos) etc.

Thanks a lot to Nathanael Presson for this update.
This commit is contained in:
erwin.coumans
2008-07-22 02:22:01 +00:00
parent fe5033119b
commit d71f8d6623
9 changed files with 3223 additions and 1347 deletions

View File

@@ -24,7 +24,10 @@ subject to the following restrictions:
btSoftRigidDynamicsWorld::btSoftRigidDynamicsWorld(btDispatcher* dispatcher,btBroadphaseInterface* pairCache,btConstraintSolver* constraintSolver,btCollisionConfiguration* collisionConfiguration)
:btDiscreteDynamicsWorld(dispatcher,pairCache,constraintSolver,collisionConfiguration)
{
m_drawFlags = fDrawFlags::Std;
m_drawNodeTree = true;
m_drawFaceTree = false;
m_drawClusterTree = false;
}
btSoftRigidDynamicsWorld::~btSoftRigidDynamicsWorld()
@@ -70,7 +73,12 @@ void btSoftRigidDynamicsWorld::updateSoftBodies()
void btSoftRigidDynamicsWorld::solveSoftBodiesConstraints()
{
BT_PROFILE("solveSoftConstraints");
if(m_softBodies.size())
{
btSoftBody::solveClusters(m_softBodies);
}
for(int i=0;i<m_softBodies.size();++i)
{
btSoftBody* psb=(btSoftBody*)m_softBodies[i];
@@ -106,12 +114,13 @@ void btSoftRigidDynamicsWorld::debugDrawWorld()
{
btSoftBody* psb=(btSoftBody*)this->m_softBodies[i];
btSoftBodyHelpers::DrawFrame(psb,m_debugDrawer);
btSoftBodyHelpers::Draw(psb,m_debugDrawer,fDrawFlags::Nodes+fDrawFlags::Std);
btSoftBodyHelpers::Draw(psb,m_debugDrawer,m_drawFlags);
if (m_debugDrawer && (m_debugDrawer->getDebugMode() & btIDebugDraw::DBG_DrawAabb))
{
btSoftBodyHelpers::DrawNodeTree(psb,m_debugDrawer);
//btSoftBodyHelpers::DrawFaceTree(psb,m_debugDrawer);
if(m_drawNodeTree) btSoftBodyHelpers::DrawNodeTree(psb,m_debugDrawer);
if(m_drawFaceTree) btSoftBodyHelpers::DrawFaceTree(psb,m_debugDrawer);
if(m_drawClusterTree) btSoftBodyHelpers::DrawClusterTree(psb,m_debugDrawer);
}
}
}
}
}
}