| 3541 | } |
| 3542 | |
| 3543 | void Sc::Scene::finalizationPhase(PxBaseTask* /*continuation*/) |
| 3544 | { |
| 3545 | PX_PROFILE_ZONE("Sim.sceneFinalization", getContextId()); |
| 3546 | |
| 3547 | if (mCCDContext) |
| 3548 | { |
| 3549 | //KS - force simulation controller to update any bodies updated by the CCD. When running GPU simulation, this would be required |
| 3550 | //to ensure that cached body states are updated |
| 3551 | const PxU32 nbUpdatedBodies = mCCDContext->getNumUpdatedBodies(); |
| 3552 | PxsRigidBody*const* updatedBodies = mCCDContext->getUpdatedBodies(); |
| 3553 | |
| 3554 | const PxU32 rigidBodyOffset = Sc::BodySim::getRigidBodyOffset(); |
| 3555 | |
| 3556 | for (PxU32 a = 0; a < nbUpdatedBodies; ++a) |
| 3557 | { |
| 3558 | Sc::BodySim* bodySim = reinterpret_cast<Sc::BodySim*>(reinterpret_cast<PxU8*>(updatedBodies[a]) - rigidBodyOffset); |
| 3559 | mSimulationController->updateDynamic(bodySim->isArticulationLink(), bodySim->getNodeIndex()); |
| 3560 | } |
| 3561 | |
| 3562 | mCCDContext->clearUpdatedBodies(); |
| 3563 | } |
| 3564 | |
| 3565 | if (mTmpConstraintGroupRootBuffer) |
| 3566 | { |
| 3567 | mLLContext->getScratchAllocator().free(mTmpConstraintGroupRootBuffer); |
| 3568 | mTmpConstraintGroupRootBuffer = NULL; |
| 3569 | } |
| 3570 | |
| 3571 | fireOnAdvanceCallback(); // placed here because it needs to be done after sleep check and afrer potential CCD passes |
| 3572 | |
| 3573 | checkConstraintBreakage(); // Performs breakage tests on breakable constraints |
| 3574 | |
| 3575 | PX_PROFILE_STOP_CROSSTHREAD("Basic.rigidBodySolver", getContextId()); |
| 3576 | |
| 3577 | //KS - process deleted elementIDs now - before GPU particles releases elements, causing issues - sschirm: particles are gone... |
| 3578 | mElementIDPool->processPendingReleases(); |
| 3579 | mElementIDPool->clearDeletedIDMap(); |
| 3580 | |
| 3581 | visualizeEndStep(); |
| 3582 | |
| 3583 | mTaskPool.clear(); |
| 3584 | |
| 3585 | mReportShapePairTimeStamp++; // important to do this before fetchResults() is called to make sure that delayed deleted actors/shapes get |
| 3586 | // separate pair entries in contact reports |
| 3587 | } |
| 3588 | |
| 3589 | void Sc::Scene::postReportsCleanup() |
| 3590 | { |
nothing calls this directly
no test coverage detected