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

Method setActive

physx/source/simulationcontroller/src/ScBodySim.cpp:489–523  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

487}
488
489void BodySim::setActive(bool active, PxU32 infoFlag)
490{
491 PX_ASSERT(!active || isDynamicRigid()); // Currently there should be no need to activate an actor that does not take part in island generation
492
493 const PxU32 asPartOfCreation = infoFlag & ActorSim::AS_PART_OF_CREATION;
494 if (asPartOfCreation || isActive() != active)
495 {
496 PX_ASSERT(!asPartOfCreation || (getActorInteractionCount() == 0)); // On creation or destruction there should be no interactions
497
498 if (active)
499 {
500 if (!asPartOfCreation)
501 {
502 // Inactive => Active
503 getScene().addToActiveBodyList(*this);
504 }
505
506 activate();
507
508 PX_ASSERT(asPartOfCreation || isActive());
509 }
510 else
511 {
512 if (!asPartOfCreation)
513 {
514 // Active => Inactive
515 getScene().removeFromActiveBodyList(*this);
516 }
517
518 deactivate();
519
520 PX_ASSERT(asPartOfCreation || (!isActive()));
521 }
522 }
523}
524
525void BodySim::wakeUp()
526{

Callers 5

putObjectsToSleepMethod · 0.45
wakeObjectsUpMethod · 0.45
activateNodeInternalMethod · 0.45
wakeIslandsMethod · 0.45
wakeIslands2Method · 0.45

Calls 3

isDynamicRigidFunction · 0.85
addToActiveBodyListMethod · 0.80

Tested by

no test coverage detected