| 390 | //-------------------------------------------------------------- |
| 391 | |
| 392 | void 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 | |
| 437 | void BodySim::deactivate() |
| 438 | { |
nothing calls this directly
no test coverage detected