From 589fa376b3a0075b970a9376891e8e4a4ac76fc4 Mon Sep 17 00:00:00 2001 From: Erwin Coumans Date: Sat, 16 Jul 2016 17:58:06 -0700 Subject: [PATCH] only add compound child shapes to 'allocated' list once --- .../ImportURDFDemo/BulletUrdfImporter.cpp | 2 +- .../PhysicsServerCommandProcessor.cpp | 18 ------------------ 2 files changed, 1 insertion(+), 19 deletions(-) diff --git a/examples/Importers/ImportURDFDemo/BulletUrdfImporter.cpp b/examples/Importers/ImportURDFDemo/BulletUrdfImporter.cpp index 628d99bc2..f081325b3 100644 --- a/examples/Importers/ImportURDFDemo/BulletUrdfImporter.cpp +++ b/examples/Importers/ImportURDFDemo/BulletUrdfImporter.cpp @@ -1065,7 +1065,7 @@ btCollisionShape* BulletURDFImporter::getAllocatedCollisionShape(int index) btTransform childTrans = col.m_linkLocalFrame; compoundShape->addChildShape(localInertiaFrame.inverse()*childTrans,childShape); - } + } } } diff --git a/examples/SharedMemory/PhysicsServerCommandProcessor.cpp b/examples/SharedMemory/PhysicsServerCommandProcessor.cpp index cce14de16..3f08f88e2 100644 --- a/examples/SharedMemory/PhysicsServerCommandProcessor.cpp +++ b/examples/SharedMemory/PhysicsServerCommandProcessor.cpp @@ -701,15 +701,6 @@ bool PhysicsServerCommandProcessor::loadSdf(const char* fileName, char* bufferSe { btCollisionShape* shape =u2b.getAllocatedCollisionShape(i); m_data->m_collisionShapes.push_back(shape); - if (shape->isCompound()) - { - btCompoundShape* compound = (btCompoundShape*) shape; - for (int childIndex=0;childIndexgetNumChildShapes();childIndex++) - { - m_data->m_collisionShapes.push_back(compound->getChildShape(childIndex)); - } - } - } btTransform rootTrans; @@ -851,15 +842,6 @@ bool PhysicsServerCommandProcessor::loadUrdf(const char* fileName, const btVecto { btCollisionShape* shape =u2b.getAllocatedCollisionShape(i); m_data->m_collisionShapes.push_back(shape); - if (shape->isCompound()) - { - btCompoundShape* compound = (btCompoundShape*) shape; - for (int childIndex=0;childIndexgetNumChildShapes();childIndex++) - { - m_data->m_collisionShapes.push_back(compound->getChildShape(childIndex)); - } - } - } btMultiBody* mb = creation.getBulletMultiBody();