Enable an overlapping pair (because at least one body of the pair is awaken or not static anymore)
| 237 | |
| 238 | // Enable an overlapping pair (because at least one body of the pair is awaken or not static anymore) |
| 239 | void 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) |
| 270 | void OverlappingPairs::disablePair(uint64 pairId) { |
no test coverage detected