MCPcopy Create free account
hub / github.com/NVIDIAGameWorks/PhysX / updateCCD

Method updateCCD

physx/source/lowlevel/software/src/PxsCCD.cpp:1302–1734  ·  view source on GitHub ↗

--------------------------------------------------------------

Source from the content-addressed store, hash-verified

1300
1301// --------------------------------------------------------------
1302void PxsCCDContext::updateCCD(PxReal dt, PxBaseTask* continuation, IG::IslandSim& islandSim, bool disableResweep, PxI32 numFastMovingShapes)
1303{
1304 //Flag to run a slightly less-accurate version of CCD that will ensure that objects don't tunnel through the static world but is not as reliable for dynamic-dynamic collisions
1305 mDisableCCDResweep = disableResweep;
1306 mThresholdStream.clear(); // clear force threshold report stream
1307
1308 mContext->clearManagerTouchEvents();
1309
1310 if (miCCDPass == 0)
1311 {
1312 resetContactManagers();
1313 }
1314
1315
1316 // If we're not in the first pass and the previous pass had no sweeps or the BP didn't generate any fast-moving shapes, we can skip CCD entirely
1317 if ((miCCDPass > 0 && mSweepTotalHits == 0) || (numFastMovingShapes == 0))
1318 {
1319 mSweepTotalHits = 0;
1320 updateCCDEnd();
1321 return;
1322 }
1323 mSweepTotalHits = 0;
1324
1325 PX_ASSERT(continuation);
1326 PX_ASSERT(continuation->getReference() > 0);
1327
1328 //printf("CCD 1\n");
1329
1330 mCCDThreadContext = mContext->getNpThreadContext();
1331 mCCDThreadContext->mDt = dt; // doesn't get set anywhere else since it's only used for CCD now
1332
1333 verifyCCDBegin();
1334
1335 // --------------------------------------------------------------------------------------
1336 // From a list of active CMs, build a temporary array of PxsCCDPair objects (allocated in blocks)
1337 // this is done to gather scattered data from memory and also to reduce PxsRidigBody permanent memory footprint
1338 // we have to do it every pass since new CMs can become fast moving after each pass (and sometimes cease to be)
1339 mCCDPairs.clear_NoDelete();
1340 mCCDPtrPairs.forceSize_Unsafe(0);
1341
1342 mUpdatedCCDBodies.forceSize_Unsafe(0);
1343
1344 mCCDOverlaps.clear_NoDelete();
1345
1346 PxU32 nbKinematicStaticCollisions = 0;
1347
1348
1349 bool needsSweep = false;
1350
1351 {
1352 PX_PROFILE_ZONE("Sim.ccdPair", mContext->mContextID);
1353
1354 Cm::BitMap::Iterator it(mContext->mActiveContactManagersWithCCD);
1355 for (PxU32 index = it.getNext(); index != Cm::BitMap::Iterator::DONE; index = it.getNext())
1356 {
1357 PxsContactManager* cm = mContext->mContactManagerPool.findByIndexFast(index);
1358
1359 // skip disabled pairs

Callers 1

Calls 15

to16Function · 0.85
PxMinFunction · 0.85
PxMaxFunction · 0.85
nextPowerOfTwoFunction · 0.85
IslandPtrCompareClass · 0.85
getNpThreadContextMethod · 0.80
clear_NoDeleteMethod · 0.80
getAbsPoseMethod · 0.80
getLastCCDAbsPoseMethod · 0.80
getNodeIndex1Method · 0.80
getNodeIndex2Method · 0.80

Tested by

no test coverage detected