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

Method onBodyWakeUp

physx/source/simulationcontroller/src/ScScene.cpp:5318–5342  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5316}
5317
5318void Sc::Scene::onBodyWakeUp(BodySim* body)
5319{
5320 if(!mSimulationEventCallback)
5321 return;
5322
5323 if (body->readInternalFlag(BodySim::BF_SLEEP_NOTIFY))
5324 {
5325 PX_ASSERT(!body->readInternalFlag(BodySim::BF_WAKEUP_NOTIFY));
5326
5327 // Body is in the list of sleeping bodies, hence, mark this list as dirty such it gets cleaned up before
5328 // being sent to the user
5329 body->clearInternalFlag(BodySim::BF_SLEEP_NOTIFY);
5330 mSleepBodyListValid = false;
5331 }
5332
5333 body->raiseInternalFlag(BodySim::BF_WAKEUP_NOTIFY);
5334
5335 // Avoid multiple insertion (the user can do multiple transitions between asleep and awake)
5336 if (!body->readInternalFlag(BodySim::BF_IS_IN_WAKEUP_LIST))
5337 {
5338 PX_ASSERT(!mWokeBodies.contains(&body->getBodyCore()));
5339 mWokeBodies.insert(&body->getBodyCore());
5340 body->raiseInternalFlag(BodySim::BF_IS_IN_WAKEUP_LIST);
5341 }
5342}
5343
5344PX_INLINE void Sc::Scene::cleanUpSleepBodies()
5345{

Callers 1

activateMethod · 0.80

Calls 2

containsMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected