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

Method cleanUpSleepBodies

physx/source/simulationcontroller/src/ScScene.cpp:5344–5369  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5342}
5343
5344PX_INLINE void Sc::Scene::cleanUpSleepBodies()
5345{
5346 BodyCore* const* bodyArray = mSleepBodies.getEntries();
5347 PxU32 bodyCount = mSleepBodies.size();
5348
5349 IG::IslandSim& islandSim = mSimpleIslandManager->getAccurateIslandSim();
5350
5351 while (bodyCount--)
5352 {
5353 BodySim* body = bodyArray[bodyCount]->getSim();
5354
5355 if (body->readInternalFlag(static_cast<BodySim::InternalFlags>(BodySim::BF_WAKEUP_NOTIFY)))
5356 {
5357 body->clearInternalFlag(static_cast<BodySim::InternalFlags>(BodySim::BF_IS_IN_WAKEUP_LIST));
5358 mSleepBodies.erase(bodyArray[bodyCount]);
5359 }
5360 else if (islandSim.getNode(body->getNodeIndex()).isActive())
5361 {
5362 //This body is still active in the island simulation, so the request to deactivate the actor by the application must have failed. Recover by undoing this
5363 mSleepBodies.erase(bodyArray[bodyCount]);
5364 body->internalWakeUp();
5365 }
5366 }
5367
5368 mSleepBodyListValid = true;
5369}
5370
5371PX_INLINE void Sc::Scene::cleanUpWokenBodies()
5372{

Callers

nothing calls this directly

Calls 7

getNodeMethod · 0.80
getEntriesMethod · 0.45
sizeMethod · 0.45
getSimMethod · 0.45
eraseMethod · 0.45
isActiveMethod · 0.45
internalWakeUpMethod · 0.45

Tested by

no test coverage detected