Ejemplo n.º 1
0
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);
	}
}
Ejemplo n.º 2
0
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();
}
Ejemplo n.º 3
0
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);
}