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

Method wakeObjectsUp

physx/source/simulationcontroller/src/ScScene.cpp:2593–2621  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2591}
2592
2593PX_FORCE_INLINE void Sc::Scene::wakeObjectsUp(PxU32 infoFlag)
2594{
2595 //Wake up all bodies that were in sleeping islands that have just been hit by a moving object.
2596
2597 const IG::IslandSim& islandSim = mSimpleIslandManager->getAccurateIslandSim();
2598
2599 const PxU32 nbBodiesToWake = islandSim.getNbNodesToActivate(IG::Node::eRIGID_BODY_TYPE);
2600 const IG::NodeIndex*const bodyIndices = islandSim.getNodesToActivate(IG::Node::eRIGID_BODY_TYPE);
2601
2602 for(PxU32 i=0;i<nbBodiesToWake;i++)
2603 {
2604 PxsRigidBody* rigidBody = islandSim.getRigidBody(bodyIndices[i]);
2605 if (rigidBody && islandSim.getNode(bodyIndices[i]).isActive())
2606 {
2607 Sc::BodySim* bodySim = reinterpret_cast<Sc::BodySim*>(reinterpret_cast<PxU8*>(rigidBody) - Sc::BodySim::getRigidBodyOffset());
2608 bodySim->setActive(true, infoFlag);
2609 }
2610 }
2611
2612 const PxU32 nbArticulationsToWake = islandSim.getNbNodesToActivate(IG::Node::eARTICULATION_TYPE);
2613 const IG::NodeIndex*const articIndices = islandSim.getNodesToActivate(IG::Node::eARTICULATION_TYPE);
2614
2615 for(PxU32 i=0;i<nbArticulationsToWake;i++)
2616 {
2617 Sc::ArticulationSim* articSim = islandSim.getLLArticulation(articIndices[i])->getArticulationSim();
2618 if (articSim && islandSim.getNode(articIndices[i]).isActive())
2619 articSim->setActive(true, infoFlag);
2620 }
2621}
2622
2623void Sc::Scene::postIslandGen(PxBaseTask* continuationTask)
2624{

Callers

nothing calls this directly

Calls 6

getNbNodesToActivateMethod · 0.80
getNodesToActivateMethod · 0.80
getRigidBodyMethod · 0.80
getNodeMethod · 0.80
isActiveMethod · 0.45
setActiveMethod · 0.45

Tested by

no test coverage detected