don't crash when no debugdrawer is available, added some damping for the constraint demo

This commit is contained in:
ejcoumans
2006-09-30 03:16:02 +00:00
parent 45386e05dc
commit 62bdd2bde2
2 changed files with 3 additions and 1 deletions

View File

@@ -73,6 +73,7 @@ void ConstraintDemo::initPhysics()
trans.setOrigin(btVector3(2*CUBE_HALF_EXTENTS,20,0));
isDynamic = true;
btRigidBody* body1 = localCreateRigidBody( isDynamic,mass,trans,shape);
body1->setDamping(0.3,0.3);
getDynamicsWorld()->addCollisionObject(body1);

View File

@@ -335,7 +335,8 @@ void DemoApplication::keyboardCallback(unsigned char key, int x, int y)
break;
}
getDynamicsWorld()->getDebugDrawer()->setDebugMode(m_debugMode);
if (getDynamicsWorld()->getDebugDrawer())
getDynamicsWorld()->getDebugDrawer()->setDebugMode(m_debugMode);
glutPostRedisplay();