From b2fd9a492daeaf61741339217551c09834c2889b Mon Sep 17 00:00:00 2001 From: notrabs Date: Sun, 8 Aug 2021 01:11:04 +0200 Subject: [PATCH] Fix crash when btSoftBody collides with btBvhTriangleMeshShape inside a btCompoundShape - The triBody->getCollisionShape() returns the btCompoundShape again, which does not implement the btConcaveShape interface required - The crash happens when processAllTriangles is called below --- src/BulletSoftBody/btSoftBodyConcaveCollisionAlgorithm.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/BulletSoftBody/btSoftBodyConcaveCollisionAlgorithm.cpp b/src/BulletSoftBody/btSoftBodyConcaveCollisionAlgorithm.cpp index 750718f57..e44fc4e8b 100644 --- a/src/BulletSoftBody/btSoftBodyConcaveCollisionAlgorithm.cpp +++ b/src/BulletSoftBody/btSoftBodyConcaveCollisionAlgorithm.cpp @@ -195,8 +195,7 @@ void btSoftBodyConcaveCollisionAlgorithm::processCollision(const btCollisionObje if (triBody->getCollisionShape()->isConcave()) { - const btCollisionObject* triOb = triBody->getCollisionObject(); - const btConcaveShape* concaveShape = static_cast(triOb->getCollisionShape()); + const btConcaveShape* concaveShape = static_cast(triBody->getCollisionShape()); // if (convexBody->getCollisionShape()->isConvex()) {