Fix issue in convex vs concave mesh collision

This commit is contained in:
Daniel Chappuis 2015-11-16 07:05:07 +01:00
parent 568f03461f
commit 32d9c0e1b8
3 changed files with 5 additions and 3 deletions

View File

@ -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);

View File

@ -25,7 +25,6 @@
// Libraries
#include "ConcaveMeshShape.h"
#include <iostream>
using namespace reactphysics3d;

View File

@ -30,6 +30,7 @@
#include "ConcaveShape.h"
#include "collision/broadphase/DynamicAABBTree.h"
#include "collision/TriangleMesh.h"
#include <iostream>
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;
}
}