From a6225d4cd0ae939240b0f388c0a66f8d78d4832b Mon Sep 17 00:00:00 2001 From: erwin coumans Date: Sun, 9 Oct 2016 21:48:56 -0700 Subject: [PATCH] add check for #dof of KUKA in VR demo disable debug drawing again in VR demo --- examples/SharedMemory/PhysicsServerCommandProcessor.cpp | 4 ++-- examples/StandaloneMain/hellovr_opengl_main.cpp | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/SharedMemory/PhysicsServerCommandProcessor.cpp b/examples/SharedMemory/PhysicsServerCommandProcessor.cpp index b577a3b53..5ba9e9490 100644 --- a/examples/SharedMemory/PhysicsServerCommandProcessor.cpp +++ b/examples/SharedMemory/PhysicsServerCommandProcessor.cpp @@ -3068,7 +3068,7 @@ void PhysicsServerCommandProcessor::stepSimulationRealTime(double dtInSec) m_data->m_dynamicsWorld->addMultiBodyConstraint(m_data->m_kukaGripperRevolute1); m_data->m_dynamicsWorld->addMultiBodyConstraint(m_data->m_kukaGripperRevolute2); - if (kukaBody->m_multiBody) + if (kukaBody->m_multiBody && kukaBody->m_multiBody->getNumDofs()==7) { gripperBody->m_multiBody->setHasSelfCollision(0); btVector3 pivotInParent(0, 0, 0.05); @@ -3204,7 +3204,7 @@ void PhysicsServerCommandProcessor::stepSimulationRealTime(double dtInSec) //if (0) { InternalBodyHandle* bodyHandle = m_data->getHandle(m_data->m_KukaId); - if (bodyHandle && bodyHandle->m_multiBody) + if (bodyHandle && bodyHandle->m_multiBody && bodyHandle->m_multiBody->getNumDofs()==7) { btMultiBody* mb = bodyHandle->m_multiBody; btScalar sqLen = (mb->getBaseWorldTransform().getOrigin() - gVRController2Pos).length2(); diff --git a/examples/StandaloneMain/hellovr_opengl_main.cpp b/examples/StandaloneMain/hellovr_opengl_main.cpp index dba2b635c..448ac094a 100644 --- a/examples/StandaloneMain/hellovr_opengl_main.cpp +++ b/examples/StandaloneMain/hellovr_opengl_main.cpp @@ -703,13 +703,13 @@ bool CMainApplication::HandleInput() { glPolygonMode( GL_FRONT_AND_BACK, GL_LINE ); ///todo(erwincoumans) can't use reguar debug drawer, because physics/graphics are not in sync - //so it can (and likely will) cause crashes - //add a special debug drawer that deals with this + ///so it can (and likely will) cause crashes + ///add a special debug drawer that deals with this //gDebugDrawFlags = btIDebugDraw::DBG_DrawWireframe+btIDebugDraw::DBG_DrawContactPoints+ //btIDebugDraw::DBG_DrawConstraintLimits+ //btIDebugDraw::DBG_DrawConstraints //; - gDebugDrawFlags = btIDebugDraw::DBG_DrawConstraintLimits+ btIDebugDraw::DBG_DrawConstraints+btIDebugDraw::DBG_DrawContactPoints+btIDebugDraw::DBG_DrawFrames; + //gDebugDrawFlags = btIDebugDraw::DBG_DrawFrames;