From 62bdd2bde2aa881721dc9b7baa452646b069626b Mon Sep 17 00:00:00 2001 From: ejcoumans Date: Sat, 30 Sep 2006 03:16:02 +0000 Subject: [PATCH] don't crash when no debugdrawer is available, added some damping for the constraint demo --- Demos/ConstraintDemo/ConstraintDemo.cpp | 1 + Demos/OpenGL/DemoApplication.cpp | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Demos/ConstraintDemo/ConstraintDemo.cpp b/Demos/ConstraintDemo/ConstraintDemo.cpp index 14d8bacd3..0983dacf0 100644 --- a/Demos/ConstraintDemo/ConstraintDemo.cpp +++ b/Demos/ConstraintDemo/ConstraintDemo.cpp @@ -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); diff --git a/Demos/OpenGL/DemoApplication.cpp b/Demos/OpenGL/DemoApplication.cpp index 1936d4c18..fa9ee66f6 100644 --- a/Demos/OpenGL/DemoApplication.cpp +++ b/Demos/OpenGL/DemoApplication.cpp @@ -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();