Fix for btCapsuleShape, m_localScaling is already applied to the radius/halfExtents so don't apply it again in the localGetSupportVertex(NonVirtual)

Make sure SerializeDemo compiles fine without DESERIALIZE_SOFT_BODIES defined
This commit is contained in:
erwin.coumans
2011-12-14 11:18:11 +00:00
parent dacb24e968
commit 3035ee69c4
3 changed files with 24 additions and 16 deletions

View File

@@ -84,11 +84,14 @@ void SerializeDemo::clientMoveAndDisplay()
m_dynamicsWorld->stepSimulation(ms / 1000000.f);
#ifdef DESERIALIZE_SOFT_BODIES
if (fSoftBodySolver)
fSoftBodySolver->copyBackToSoftBodies();
#endif
m_dynamicsWorld->debugDrawWorld();
#ifdef DESERIALIZE_SOFT_BODIES
if (m_dynamicsWorld->getWorldType()==BT_SOFT_RIGID_DYNAMICS_WORLD)
{
//optional but useful: debug drawing
@@ -104,6 +107,8 @@ void SerializeDemo::clientMoveAndDisplay()
}
}
}
#endif //DESERIALIZE_SOFT_BODIES
}
renderme();
@@ -121,20 +126,23 @@ void SerializeDemo::displayCallback(void) {
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
if (m_dynamicsWorld->getWorldType()==BT_SOFT_RIGID_DYNAMICS_WORLD)
{
//optional but useful: debug drawing
btSoftRigidDynamicsWorld* softWorld = (btSoftRigidDynamicsWorld*)m_dynamicsWorld;
{
#ifdef DESERIALIZE_SOFT_BODIES
for ( int i=0;i<softWorld->getSoftBodyArray().size();i++)
//optional but useful: debug drawing
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)))
{
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());
}
btSoftBodyHelpers::DrawFrame(psb,softWorld->getDebugDrawer());
btSoftBodyHelpers::Draw(psb,softWorld->getDebugDrawer(),softWorld->getDrawFlags());
}
}
#endif //DESERIALIZE_SOFT_BODIES
}
renderme();