void NpArticulation::wakeUpInternal(bool forceWakeUp, bool autowake) { NpScene* scene = getAPIScene(); PX_ASSERT(scene); PxReal wakeCounterResetValue = scene->getWakeCounterResetValueInteral(); Scb::Articulation& a = getArticulation(); PxReal wakeCounter = a.getWakeCounter(); bool needsWakingUp = isSleeping() && (autowake || forceWakeUp); if (autowake && (wakeCounter < wakeCounterResetValue)) { wakeCounter = wakeCounterResetValue; needsWakingUp = true; } if (needsWakingUp) { for(PxU32 i=0; i < mArticulationLinks.size(); i++) { mArticulationLinks[i]->getScbBodyFast().wakeUpInternal(wakeCounter); } a.wakeUpInternal(wakeCounter); } }
void NpArticulation::wakeUp() { NpScene* scene = getAPIScene(); NP_WRITE_CHECK(getOwnerScene()); // don't use the API scene, since it will be NULL on pending removal PX_CHECK_AND_RETURN(scene, "Articulation::wakeUp: articulation must be in a scene."); for(PxU32 i=0; i < mArticulationLinks.size(); i++) { mArticulationLinks[i]->getScbBodyFast().wakeUpInternal(scene->getWakeCounterResetValueInteral()); } getArticulation().wakeUp(); }
void NpRigidDynamic::wakeUpInternalNoKinematicTest(Scb::Body& body, bool forceWakeUp, bool autowake) { NpScene* scene = NpActor::getOwnerScene(*this); PX_ASSERT(scene); PxReal wakeCounterResetValue = scene->getWakeCounterResetValueInteral(); PxReal wakeCounter = body.getWakeCounter(); bool needsWakingUp = body.isSleeping() && (autowake || forceWakeUp); if (autowake && (wakeCounter < wakeCounterResetValue)) { wakeCounter = wakeCounterResetValue; needsWakingUp = true; } if (needsWakingUp) body.wakeUpInternal(wakeCounter); }