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

Method postCCDPass

physx/source/simulationcontroller/src/ScScene.cpp:3472–3541  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3470}
3471
3472void Sc::Scene::postCCDPass(PxBaseTask* /*continuation*/)
3473{
3474 // - Performs sleep check
3475 // - Updates touch flags
3476
3477 PxU32 currentPass = mCCDContext->getCurrentCCDPass();
3478 PX_ASSERT(currentPass > 0); // to make sure changes to the CCD pass counting get noticed. For contact reports, 0 means discrete collision phase.
3479
3480 int newTouchCount, lostTouchCount, ccdTouchCount;
3481 mLLContext->getManagerTouchEventCount(&newTouchCount, &lostTouchCount, &ccdTouchCount);
3482 PX_ALLOCA(newTouches, PxvContactManagerTouchEvent, newTouchCount);
3483 PX_ALLOCA(lostTouches, PxvContactManagerTouchEvent, lostTouchCount);
3484 PX_ALLOCA(ccdTouches, PxvContactManagerTouchEvent, ccdTouchCount);
3485
3486 PxsContactManagerOutputIterator outputs = mLLContext->getNphaseImplementationContext()->getContactManagerOutputs();
3487
3488 bool useAdaptiveForce = mPublicFlags & PxSceneFlag::eADAPTIVE_FORCE;
3489
3490 // Note: For contact notifications it is important that the new touch pairs get processed before the lost touch pairs.
3491 // This allows to know for sure if a pair of actors lost all touch (see eACTOR_PAIR_LOST_TOUCH).
3492 mLLContext->fillManagerTouchEvents(newTouches, newTouchCount, lostTouches, lostTouchCount, ccdTouches, ccdTouchCount);
3493 for(PxI32 i=0; i<newTouchCount; ++i)
3494 {
3495 ShapeInteraction* si = reinterpret_cast<ShapeInteraction*>(newTouches[i].userData);
3496 PX_ASSERT(si);
3497 mNPhaseCore->managerNewTouch(*si);
3498 si->managerNewTouch(currentPass, true, outputs, useAdaptiveForce);
3499 if (!si->readFlag(ShapeInteraction::CONTACTS_RESPONSE_DISABLED))
3500 {
3501 mSimpleIslandManager->setEdgeConnected(si->getEdgeIndex());
3502 }
3503 }
3504 for(PxI32 i=0; i<lostTouchCount; ++i)
3505 {
3506 ShapeInteraction* si = reinterpret_cast<ShapeInteraction*>(lostTouches[i].userData);
3507 PX_ASSERT(si);
3508 if (si->managerLostTouch(currentPass, true, outputs, useAdaptiveForce) && !si->readFlag(ShapeInteraction::CONTACTS_RESPONSE_DISABLED))
3509 addToLostTouchList(si->getShape0().getBodySim(), si->getShape1().getBodySim());
3510
3511 mSimpleIslandManager->setEdgeDisconnected(si->getEdgeIndex());
3512 }
3513 for(PxI32 i=0; i<ccdTouchCount; ++i)
3514 {
3515 ShapeInteraction* si = reinterpret_cast<ShapeInteraction*>(ccdTouches[i].userData);
3516 PX_ASSERT(si);
3517 si->sendCCDRetouch(currentPass, outputs);
3518 }
3519 checkForceThresholdContactEvents(currentPass);
3520 {
3521 Cm::BitMapPinned& changedAABBMgrActorHandles = mAABBManager->getChangedAABBMgActorHandleMap();
3522
3523 for (PxU32 i = 0, s = mCcdBodies.size(); i < s; i++)
3524 {
3525 BodySim*const body = mCcdBodies[i];
3526 if(i+8 < s)
3527 Ps::prefetch(mCcdBodies[i+8], 512);
3528
3529 PX_ASSERT(body->getBody2World().p.isFinite());

Callers

nothing calls this directly

Calls 15

getCurrentCCDPassMethod · 0.80
setEdgeConnectedMethod · 0.80
managerLostTouchMethod · 0.80
getBodySimMethod · 0.80
setEdgeDisconnectedMethod · 0.80
sendCCDRetouchMethod · 0.80
prefetchFunction · 0.50
managerNewTouchMethod · 0.45

Tested by

no test coverage detected