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

Method enableConcavePairWithIndex

src/engine/OverlappingPairs.cpp:349–370  ·  view source on GitHub ↗

Enable a concave overlapping pair

Source from the content-addressed store, hash-verified

347
348// Enable a concave overlapping pair
349void OverlappingPairs::enableConcavePairWithIndex(uint64 pairIndex) {
350
351 RP3D_PROFILE("OverlappingPairs::enableConcavePairWithIndex()", mProfiler);
352
353 ConcaveOverlappingPair* pair = &(mDisabledConcavePairs[static_cast<uint32>(pairIndex)]);
354
355 assert(!pair->isEnabled);
356
357 const uint64 newPairIndex = mConcavePairs.size();
358
359 // Map the entity with the new pair lookup index
360 mMapConcavePairIdToPairIndex.add(Pair<uint64, uint64>(pair->pairID, newPairIndex));
361
362 // Create a new pair to be added into the array of disable pairs
363 mConcavePairs.emplace(pair->pairID, pair->broadPhaseId1, pair->broadPhaseId2, pair->collider1, pair->collider2,
364 pair->narrowPhaseAlgorithmType, pair->isShape1Convex, mPoolAllocator, mHeapAllocator, true);
365 mConcavePairs[newPairIndex].collidingInCurrentFrame = pair->collidingInCurrentFrame;
366 mConcavePairs[newPairIndex].collidingInPreviousFrame = pair->collidingInPreviousFrame;
367
368 // Remove the previous overlapping pair from the concave array
369 removeDisabledConcavePairWithIndex(pairIndex, false);
370}
371
372// Disable a concave overlapping pair (because both bodies of the pair are disabled)
373void OverlappingPairs::disableConcavePairWithIndex(uint64 pairIndex) {

Callers

nothing calls this directly

Calls 3

emplaceMethod · 0.80
sizeMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected