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

Method activate

physx/source/simulationcontroller/src/ScBodySim.cpp:392–435  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

390//--------------------------------------------------------------
391
392void BodySim::activate()
393{
394 // Activate body
395 {
396 PX_ASSERT((!isKinematic()) || notInScene() || readInternalFlag(InternalFlags(BF_KINEMATIC_MOVED | BF_KINEMATIC_SURFACE_VELOCITY))); // kinematics should only get activated when a target is set.
397 // exception: object gets newly added, then the state change will happen later
398 if(!isArticulationLink())
399 {
400 mLLBody.mInternalFlags &= (~PxsRigidBody::eFROZEN);
401 // Put in list of activated bodies. The list gets cleared at the end of a sim step after the sleep callbacks have been fired.
402 getScene().onBodyWakeUp(this);
403 }
404
405 BodyCore& core = getBodyCore();
406 if(core.getFlags() & PxRigidBodyFlag::eENABLE_POSE_INTEGRATION_PREVIEW)
407 {
408 PX_ASSERT(!getScene().isInPosePreviewList(*this));
409 getScene().addToPosePreviewList(*this);
410 }
411 createSqBounds();
412 }
413
414 // Activate interactions
415 {
416 const PxU32 nbInteractions = getActorInteractionCount();
417
418 for(PxU32 i=0; i<nbInteractions; ++i)
419 {
420 Ps::prefetchLine(mInteractions[PxMin(i+1,nbInteractions-1)]);
421 Interaction* interaction = mInteractions[i];
422
423 const bool isNotIGControlled = interaction->getType() != InteractionType::eOVERLAP &&
424 interaction->getType() != InteractionType::eMARKER;
425
426 if(!interaction->readInteractionFlag(InteractionFlag::eIS_ACTIVE) && (isNotIGControlled))
427 {
428 const bool proceed = activateInteraction(interaction, NULL);
429
430 if (proceed && (interaction->getType() < InteractionType::eTRACKED_IN_SCENE_COUNT))
431 getScene().notifyInteractionActivated(interaction);
432 }
433 }
434 }
435}
436
437void BodySim::deactivate()
438{

Callers

nothing calls this directly

Calls 9

isKinematicFunction · 0.85
notInSceneFunction · 0.85
InternalFlagsEnum · 0.85
PxMinFunction · 0.85
onBodyWakeUpMethod · 0.80
prefetchLineFunction · 0.50
getFlagsMethod · 0.45
getTypeMethod · 0.45

Tested by

no test coverage detected