From 7df3c2290a12a85b3de8e0c0368ca2b2632593b6 Mon Sep 17 00:00:00 2001 From: Roelof Oomen Date: Fri, 31 May 2024 13:18:51 +0200 Subject: [PATCH] Fix 2 for older bullet versions (e.g. on Ubuntu Focal) --- .../src/tesseract_compound_collision_algorithm.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) 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;