Fix issue with middle phase collision detection (AABB not computed in correct space)

This commit is contained in:
Daniel Chappuis 2017-09-28 08:34:45 +02:00
parent b33b8e0dc5
commit 310fef1c52

View File

@ -218,10 +218,10 @@ void CollisionDetection::computeConvexVsConcaveMiddlePhase(OverlappingPair* pair
concaveShape, allocator); concaveShape, allocator);
// Compute the convex shape AABB in the local-space of the convex shape // Compute the convex shape AABB in the local-space of the convex shape
const Transform convexToConcaveTransform = concaveProxyShape->getLocalToWorldTransform().getInverse() *
convexProxyShape->getLocalToWorldTransform();
AABB aabb; AABB aabb;
convexShape->computeAABB(aabb, convexProxyShape->getLocalToWorldTransform()); convexShape->computeAABB(aabb, convexToConcaveTransform);
// TODO : Implement smooth concave mesh collision somewhere
// Call the convex vs triangle callback for each triangle of the concave shape // Call the convex vs triangle callback for each triangle of the concave shape
concaveShape->testAllTriangles(middlePhaseCallback, aabb); concaveShape->testAllTriangles(middlePhaseCallback, aabb);