From 72c48870b01e3c28867eff3c9b05057e77bd394c Mon Sep 17 00:00:00 2001 From: Erwin Coumans Date: Sun, 26 Aug 2018 18:07:28 -0700 Subject: [PATCH] after picking in a multibody demo, allow sleeping for rigid bodies --- examples/CommonInterfaces/CommonMultiBodyBase.h | 6 ++++++ examples/SharedMemory/PhysicsServerCommandProcessor.cpp | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/examples/CommonInterfaces/CommonMultiBodyBase.h b/examples/CommonInterfaces/CommonMultiBodyBase.h index 7e3129477..f18896566 100644 --- a/examples/CommonInterfaces/CommonMultiBodyBase.h +++ b/examples/CommonInterfaces/CommonMultiBodyBase.h @@ -478,6 +478,12 @@ struct CommonMultiBodyBase : public CommonExampleInterface if (m_pickedConstraint) { m_dynamicsWorld->removeConstraint(m_pickedConstraint); + + if (m_pickedBody) + { + m_pickedBody->forceActivationState(ACTIVE_TAG); + m_pickedBody->activate(true); + } delete m_pickedConstraint; m_pickedConstraint = 0; m_pickedBody = 0; diff --git a/examples/SharedMemory/PhysicsServerCommandProcessor.cpp b/examples/SharedMemory/PhysicsServerCommandProcessor.cpp index 2ed79fc08..7c6be5775 100644 --- a/examples/SharedMemory/PhysicsServerCommandProcessor.cpp +++ b/examples/SharedMemory/PhysicsServerCommandProcessor.cpp @@ -2365,7 +2365,7 @@ void PhysicsServerCommandProcessor::createEmptyDynamicsWorld() m_data->m_pairCache->setOverlapFilterCallback(m_data->m_broadphaseCollisionFilterCallback); - int maxProxies = 32768; + //int maxProxies = 32768; //m_data->m_broadphase = new btSimpleBroadphase(maxProxies, m_data->m_pairCache); btDbvtBroadphase* bv = new btDbvtBroadphase(m_data->m_pairCache); bv->setVelocityPrediction(0);