From 63784dab5fdf7fe84fd93f2caeef43b8524f7389 Mon Sep 17 00:00:00 2001 From: erwincoumans Date: Wed, 17 Oct 2018 20:08:06 -0700 Subject: [PATCH 1/2] Update NN3DWalkersTimeWarpBase.h Fix issue #1940, see https://github.com/bulletphysics/bullet3/issues/1940 --- examples/Evolution/NN3DWalkersTimeWarpBase.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/Evolution/NN3DWalkersTimeWarpBase.h b/examples/Evolution/NN3DWalkersTimeWarpBase.h index c134ac606..0a237ee98 100644 --- a/examples/Evolution/NN3DWalkersTimeWarpBase.h +++ b/examples/Evolution/NN3DWalkersTimeWarpBase.h @@ -52,7 +52,7 @@ static double /*7*/ CENTUPLE_SPEED = 100; static double /*8*/ QUINCENTUPLE_SPEED = 500; static double /*9*/ MILLITUPLE_SPEED = 1000; static double /*0*/ MAX_SPEED = MILLITUPLE_SPEED; -static double /**/ NUM_SPEEDS = 11; +static double /**/ NUM_SPEEDS = 10; }; // namespace SimulationSpeeds // add speeds from the namespace here From 6512a67422c688372899cb9ac2834e8dbcf2fc6d Mon Sep 17 00:00:00 2001 From: Tigran Gasparian Date: Mon, 22 Oct 2018 14:06:58 +0200 Subject: [PATCH 2/2] Uses btCollisionBody::isActive instead of btMultiBody::isAwake to determine whether to send transform changed notifications. --- .../SharedMemory/PhysicsServerCommandProcessor.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/examples/SharedMemory/PhysicsServerCommandProcessor.cpp b/examples/SharedMemory/PhysicsServerCommandProcessor.cpp index 98545600a..972269b42 100644 --- a/examples/SharedMemory/PhysicsServerCommandProcessor.cpp +++ b/examples/SharedMemory/PhysicsServerCommandProcessor.cpp @@ -10999,14 +10999,19 @@ void PhysicsServerCommandProcessor::addTransformChangedNotifications() { continue; } - if (bodyData->m_multiBody && bodyData->m_multiBody->isAwake()) + if (bodyData->m_multiBody) { btMultiBody* mb = bodyData->m_multiBody; - m_data->m_pluginManager.addNotification(createTransformChangedNotification(bodyUniqueId, -1, mb->getBaseCollider())); - + if (mb->getBaseCollider()->isActive()) + { + m_data->m_pluginManager.addNotification(createTransformChangedNotification(bodyUniqueId, -1, mb->getBaseCollider())); + } for (int linkIndex = 0; linkIndex < mb->getNumLinks(); linkIndex++) { - m_data->m_pluginManager.addNotification(createTransformChangedNotification(bodyUniqueId, linkIndex, mb->getLinkCollider(linkIndex))); + if (mb->getLinkCollider(linkIndex)->isActive()) + { + m_data->m_pluginManager.addNotification(createTransformChangedNotification(bodyUniqueId, linkIndex, mb->getLinkCollider(linkIndex))); + } } } else if (bodyData->m_rigidBody && bodyData->m_rigidBody->isActive())