don't crash when no debugdrawer is available, added some damping for the constraint demo
This commit is contained in:
@@ -73,6 +73,7 @@ void ConstraintDemo::initPhysics()
|
|||||||
trans.setOrigin(btVector3(2*CUBE_HALF_EXTENTS,20,0));
|
trans.setOrigin(btVector3(2*CUBE_HALF_EXTENTS,20,0));
|
||||||
isDynamic = true;
|
isDynamic = true;
|
||||||
btRigidBody* body1 = localCreateRigidBody( isDynamic,mass,trans,shape);
|
btRigidBody* body1 = localCreateRigidBody( isDynamic,mass,trans,shape);
|
||||||
|
body1->setDamping(0.3,0.3);
|
||||||
getDynamicsWorld()->addCollisionObject(body1);
|
getDynamicsWorld()->addCollisionObject(body1);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -335,7 +335,8 @@ void DemoApplication::keyboardCallback(unsigned char key, int x, int y)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
getDynamicsWorld()->getDebugDrawer()->setDebugMode(m_debugMode);
|
if (getDynamicsWorld()->getDebugDrawer())
|
||||||
|
getDynamicsWorld()->getDebugDrawer()->setDebugMode(m_debugMode);
|
||||||
|
|
||||||
glutPostRedisplay();
|
glutPostRedisplay();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user