diff --git a/tesseract_collision/bullet/src/tesseract_compound_collision_algorithm.cpp b/tesseract_collision/bullet/src/tesseract_compound_collision_algorithm.cpp index a957185e6e6..4ba7e3c72f7 100644 --- a/tesseract_collision/bullet/src/tesseract_compound_collision_algorithm.cpp +++ b/tesseract_collision/bullet/src/tesseract_compound_collision_algorithm.cpp @@ -164,13 +164,12 @@ struct TesseractCompoundLeafCallback : btDbvt::ICollide if (TestAabbAgainstAabb2(aabbMin0, aabbMax0, aabbMin1, aabbMax1)) { - btTransform preTransform = childTrans; #if BT_BULLET_VERSION >= 300 + btTransform preTransform = childTrans; if (this->m_compoundColObjWrap->m_preTransform != nullptr) { preTransform = preTransform * (*(this->m_compoundColObjWrap->m_preTransform)); } -#endif btCollisionObjectWrapper compoundWrap(this->m_compoundColObjWrap, childShape, m_compoundColObjWrap->getCollisionObject(), @@ -178,6 +177,14 @@ struct TesseractCompoundLeafCallback : btDbvt::ICollide preTransform, -1, index); +#else + btCollisionObjectWrapper compoundWrap(this->m_compoundColObjWrap, + childShape, + m_compoundColObjWrap->getCollisionObject(), + newChildWorldTrans, + -1, + index); +#endif btCollisionAlgorithm* algo = nullptr; bool allocatedAlgorithm = false;