Disable a concave overlapping pair (because both bodies of the pair are disabled)
| 371 | |
| 372 | // Disable a concave overlapping pair (because both bodies of the pair are disabled) |
| 373 | void OverlappingPairs::disableConcavePairWithIndex(uint64 pairIndex) { |
| 374 | |
| 375 | RP3D_PROFILE("OverlappingPairs::disableConcavePairWithIndex()", mProfiler); |
| 376 | |
| 377 | ConcaveOverlappingPair* pair = &(mConcavePairs[static_cast<uint32>(pairIndex)]); |
| 378 | |
| 379 | assert(pair->isEnabled); |
| 380 | |
| 381 | const uint64 newPairIndex = mDisabledConcavePairs.size(); |
| 382 | |
| 383 | // Map the entity with the new pair lookup index |
| 384 | mMapDisabledConcavePairIdToPairIndex.add(Pair<uint64, uint64>(pair->pairID, newPairIndex)); |
| 385 | |
| 386 | // Create a new pair to be added into the array of disable pairs |
| 387 | mDisabledConcavePairs.emplace(pair->pairID, pair->broadPhaseId1, pair->broadPhaseId2, pair->collider1, pair->collider2, |
| 388 | pair->narrowPhaseAlgorithmType, pair->isShape1Convex, mPoolAllocator, mHeapAllocator, false, false); |
| 389 | mDisabledConcavePairs[newPairIndex].collidingInCurrentFrame = pair->collidingInCurrentFrame; |
| 390 | mDisabledConcavePairs[newPairIndex].collidingInPreviousFrame = pair->collidingInPreviousFrame; |
| 391 | |
| 392 | // Remove the previous overlapping pair from the concave array |
| 393 | removeConcavePairWithIndex(pairIndex, false); |
| 394 | } |
| 395 | |
| 396 | // Add an overlapping pair |
| 397 | uint64 OverlappingPairs::addPair(uint32 collider1Index, uint32 collider2Index, bool isConvexVsConvex) { |