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

Method disablePair

src/engine/OverlappingPairs.cpp:270–298  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

268
269// Disable an overlapping pair (because both bodies of the pair are disabled)
270void OverlappingPairs::disablePair(uint64 pairId) {
271
272 RP3D_PROFILE("OverlappingPairs::disablePair()", mProfiler);
273
274 assert(!isPairDisabled(pairId));
275 assert(mMapConvexPairIdToPairIndex.find(pairId) != mMapConvexPairIdToPairIndex.end() ||
276 mMapConcavePairIdToPairIndex.find(pairId) != mMapConcavePairIdToPairIndex.end());
277
278 // Get the existing overlapping pair from the convex/concave array
279 auto it = mMapConvexPairIdToPairIndex.find(pairId);
280 if (it != mMapConvexPairIdToPairIndex.end()) {
281
282 // Disable the pair
283 disableConvexPairWithIndex(it->second);
284 }
285 else {
286 it = mMapConcavePairIdToPairIndex.find(pairId);
287 if (it != mMapConcavePairIdToPairIndex.end()) {
288
289 // Disable the pair
290 disableConcavePairWithIndex(it->second);
291 }
292 else {
293 // Should not happen
294 assert(false);
295 return;
296 }
297 }
298}
299
300// Enable a convex overlapping pair
301void OverlappingPairs::enableConvexPairWithIndex(uint64 pairIndex) {

Callers 1

Calls 2

findMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected