From 32d9c0e1b84f3ee1b6e57e92356e4966dfef94cd Mon Sep 17 00:00:00 2001 From: Daniel Chappuis Date: Mon, 16 Nov 2015 07:05:07 +0100 Subject: [PATCH] Fix issue in convex vs concave mesh collision --- src/collision/narrowphase/ConcaveVsConvexAlgorithm.cpp | 3 +-- src/collision/shapes/ConcaveMeshShape.cpp | 1 - src/collision/shapes/ConcaveMeshShape.h | 4 ++++ 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/collision/narrowphase/ConcaveVsConvexAlgorithm.cpp b/src/collision/narrowphase/ConcaveVsConvexAlgorithm.cpp index f2877a54..f7efa16e 100644 --- a/src/collision/narrowphase/ConcaveVsConvexAlgorithm.cpp +++ b/src/collision/narrowphase/ConcaveVsConvexAlgorithm.cpp @@ -73,10 +73,9 @@ bool ConcaveVsConvexAlgorithm::testCollision(const CollisionShapeInfo& shape1Inf mConvexVsTriangleCallback.setProxyShapes(convexProxyShape, concaveProxyShape); mConvexVsTriangleCallback.setOverlappingPair(shape1Info.overlappingPair); - // Compute the convex shape AABB in the local-space of the concave shape + // Compute the convex shape AABB in the local-space of the convex shape AABB aabb; convexShape->computeAABB(aabb, convexProxyShape->getLocalToWorldTransform()); - concaveShape->computeAABB(aabb, concaveProxyShape->getLocalToWorldTransform().getInverse()); // Call the convex vs triangle callback for each triangle of the concave shape concaveShape->testAllTriangles(mConvexVsTriangleCallback, aabb); diff --git a/src/collision/shapes/ConcaveMeshShape.cpp b/src/collision/shapes/ConcaveMeshShape.cpp index 81268307..6cf152d8 100644 --- a/src/collision/shapes/ConcaveMeshShape.cpp +++ b/src/collision/shapes/ConcaveMeshShape.cpp @@ -25,7 +25,6 @@ // Libraries #include "ConcaveMeshShape.h" -#include using namespace reactphysics3d; diff --git a/src/collision/shapes/ConcaveMeshShape.h b/src/collision/shapes/ConcaveMeshShape.h index 07699d98..c7154942 100644 --- a/src/collision/shapes/ConcaveMeshShape.h +++ b/src/collision/shapes/ConcaveMeshShape.h @@ -30,6 +30,7 @@ #include "ConcaveShape.h" #include "collision/broadphase/DynamicAABBTree.h" #include "collision/TriangleMesh.h" +#include namespace reactphysics3d { @@ -212,6 +213,9 @@ inline void ConvexTriangleAABBOverlapCallback::notifyOverlappingNode(int nodeId) // Call the callback to test narrow-phase collision with this triangle mTriangleTestCallback.testTriangle(trianglePoints); + + // TODO : Delete this + std::cout << "Notify triangle test" << std::endl; } }