From 310fef1c523c67d34201cef43a9177789d6bac66 Mon Sep 17 00:00:00 2001 From: Daniel Chappuis Date: Thu, 28 Sep 2017 08:34:45 +0200 Subject: [PATCH] Fix issue with middle phase collision detection (AABB not computed in correct space) --- src/collision/CollisionDetection.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/collision/CollisionDetection.cpp b/src/collision/CollisionDetection.cpp index b284c034..f27b5ddf 100644 --- a/src/collision/CollisionDetection.cpp +++ b/src/collision/CollisionDetection.cpp @@ -218,10 +218,10 @@ void CollisionDetection::computeConvexVsConcaveMiddlePhase(OverlappingPair* pair concaveShape, allocator); // Compute the convex shape AABB in the local-space of the convex shape + const Transform convexToConcaveTransform = concaveProxyShape->getLocalToWorldTransform().getInverse() * + convexProxyShape->getLocalToWorldTransform(); AABB aabb; - convexShape->computeAABB(aabb, convexProxyShape->getLocalToWorldTransform()); - - // TODO : Implement smooth concave mesh collision somewhere + convexShape->computeAABB(aabb, convexToConcaveTransform); // Call the convex vs triangle callback for each triangle of the concave shape concaveShape->testAllTriangles(middlePhaseCallback, aabb);