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

Method disableConcavePairWithIndex

src/engine/OverlappingPairs.cpp:373–394  ·  view source on GitHub ↗

Disable a concave overlapping pair (because both bodies of the pair are disabled)

Source from the content-addressed store, hash-verified

371
372// Disable a concave overlapping pair (because both bodies of the pair are disabled)
373void 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
397uint64 OverlappingPairs::addPair(uint32 collider1Index, uint32 collider2Index, bool isConvexVsConvex) {

Callers

nothing calls this directly

Calls 3

emplaceMethod · 0.80
sizeMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected