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

Method enablePair

src/engine/OverlappingPairs.cpp:239–267  ·  view source on GitHub ↗

Enable an overlapping pair (because at least one body of the pair is awaken or not static anymore)

Source from the content-addressed store, hash-verified

237
238// Enable an overlapping pair (because at least one body of the pair is awaken or not static anymore)
239void OverlappingPairs::enablePair(uint64 pairId) {
240
241 RP3D_PROFILE("OverlappingPairs::enablePair()", mProfiler);
242
243 assert(isPairDisabled(pairId));
244 assert(mMapConvexPairIdToPairIndex.find(pairId) == mMapConvexPairIdToPairIndex.end() &&
245 mMapConcavePairIdToPairIndex.find(pairId) == mMapConcavePairIdToPairIndex.end());
246
247 // Get the existing overlapping pair from the convex/concave array
248 auto it = mMapDisabledConvexPairIdToPairIndex.find(pairId);
249 if (it != mMapDisabledConvexPairIdToPairIndex.end()) {
250
251 // Enable the pair
252 enableConvexPairWithIndex(it->second);
253 }
254 else {
255 it = mMapDisabledConcavePairIdToPairIndex.find(pairId);
256 if (it != mMapDisabledConcavePairIdToPairIndex.end()) {
257
258 // Enable the pair
259 enableConcavePairWithIndex(it->second);
260 }
261 else {
262 // Should not happen
263 assert(false);
264 return;
265 }
266 }
267}
268
269// Disable an overlapping pair (because both bodies of the pair are disabled)
270void OverlappingPairs::disablePair(uint64 pairId) {

Callers 1

Calls 2

findMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected