MCPcopy Create free account
hub / github.com/DanielChappuis/reactphysics3d / testOverlappingShapes

Method testOverlappingShapes

src/systems/BroadPhaseSystem.cpp:55–67  ·  view source on GitHub ↗

Return true if the two broad-phase collision shapes are overlapping

Source from the content-addressed store, hash-verified

53
54// Return true if the two broad-phase collision shapes are overlapping
55bool BroadPhaseSystem::testOverlappingShapes(int32 shape1BroadPhaseId, int32 shape2BroadPhaseId) const {
56
57 RP3D_PROFILE("BroadPhaseSystem::testOverlappingShapes()", mProfiler);
58
59 assert(shape1BroadPhaseId != -1 && shape2BroadPhaseId != -1);
60
61 // Get the two AABBs of the collision shapes
62 const AABB& aabb1 = mDynamicAABBTree.getFatAABB(shape1BroadPhaseId);
63 const AABB& aabb2 = mDynamicAABBTree.getFatAABB(shape2BroadPhaseId);
64
65 // Check if the two AABBs are overlapping
66 return aabb1.testCollision(aabb2);
67}
68
69// Ray casting method
70void BroadPhaseSystem::raycast(const Ray& ray, RaycastTest& raycastTest, unsigned short raycastWithCategoryMaskBits) const {

Callers 1

Calls 1

testCollisionMethod · 0.45

Tested by

no test coverage detected