Add soft body anchor 'm_influence' to control the solver.

Thanks to Gregory Jaegy, see Issue 502
Avoid using btTransform to update btSoftBody (bounds are already in worldspace)
Use btConvexHullComputer for soft body cluster debug rendering
Fix soft body demo issue of invisible soft bodies (rendering was not enabled properly)
This commit is contained in:
erwin.coumans
2011-04-05 20:32:59 +00:00
parent 624dac6128
commit 563654fb6e
5 changed files with 56 additions and 23 deletions

View File

@@ -1484,8 +1484,20 @@ void SoftDemo::renderme()
btIDebugDraw* idraw=m_dynamicsWorld->getDebugDrawer();
glDisable(GL_TEXTURE_2D);
glDisable(GL_LIGHTING);
m_dynamicsWorld->debugDrawWorld();
btSoftRigidDynamicsWorld* softWorld = (btSoftRigidDynamicsWorld*)m_dynamicsWorld;
for ( int i=0;i<softWorld->getSoftBodyArray().size();i++)
{
btSoftBody* psb=(btSoftBody*)softWorld->getSoftBodyArray()[i];
if (softWorld->getDebugDrawer() && !softWorld->getDebugDrawer()->getDebugMode() & (btIDebugDraw::DBG_DrawWireframe))
{
btSoftBodyHelpers::DrawFrame(psb,softWorld->getDebugDrawer());
btSoftBodyHelpers::Draw(psb,softWorld->getDebugDrawer(),softWorld->getDrawFlags());
}
}
/* Bodies */
btVector3 ps(0,0,0);
int nps=0;