Fix issue in convex vs concave mesh collision
This commit is contained in:
parent
568f03461f
commit
32d9c0e1b8
|
@ -73,10 +73,9 @@ bool ConcaveVsConvexAlgorithm::testCollision(const CollisionShapeInfo& shape1Inf
|
||||||
mConvexVsTriangleCallback.setProxyShapes(convexProxyShape, concaveProxyShape);
|
mConvexVsTriangleCallback.setProxyShapes(convexProxyShape, concaveProxyShape);
|
||||||
mConvexVsTriangleCallback.setOverlappingPair(shape1Info.overlappingPair);
|
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;
|
AABB aabb;
|
||||||
convexShape->computeAABB(aabb, convexProxyShape->getLocalToWorldTransform());
|
convexShape->computeAABB(aabb, convexProxyShape->getLocalToWorldTransform());
|
||||||
concaveShape->computeAABB(aabb, concaveProxyShape->getLocalToWorldTransform().getInverse());
|
|
||||||
|
|
||||||
// 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(mConvexVsTriangleCallback, aabb);
|
concaveShape->testAllTriangles(mConvexVsTriangleCallback, aabb);
|
||||||
|
|
|
@ -25,7 +25,6 @@
|
||||||
|
|
||||||
// Libraries
|
// Libraries
|
||||||
#include "ConcaveMeshShape.h"
|
#include "ConcaveMeshShape.h"
|
||||||
#include <iostream>
|
|
||||||
|
|
||||||
using namespace reactphysics3d;
|
using namespace reactphysics3d;
|
||||||
|
|
||||||
|
|
|
@ -30,6 +30,7 @@
|
||||||
#include "ConcaveShape.h"
|
#include "ConcaveShape.h"
|
||||||
#include "collision/broadphase/DynamicAABBTree.h"
|
#include "collision/broadphase/DynamicAABBTree.h"
|
||||||
#include "collision/TriangleMesh.h"
|
#include "collision/TriangleMesh.h"
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
namespace reactphysics3d {
|
namespace reactphysics3d {
|
||||||
|
|
||||||
|
@ -212,6 +213,9 @@ inline void ConvexTriangleAABBOverlapCallback::notifyOverlappingNode(int nodeId)
|
||||||
|
|
||||||
// Call the callback to test narrow-phase collision with this triangle
|
// Call the callback to test narrow-phase collision with this triangle
|
||||||
mTriangleTestCallback.testTriangle(trianglePoints);
|
mTriangleTestCallback.testTriangle(trianglePoints);
|
||||||
|
|
||||||
|
// TODO : Delete this
|
||||||
|
std::cout << "Notify triangle test" << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user