Fix outdated bone locations when camera view is changed while paralyzed

moveref
scrawl 10 years ago
parent d1a29300f0
commit d26d5f6c26

@ -1640,6 +1640,7 @@ void CharacterController::update(float duration)
else else
forcestateupdate = updateCreatureState() || forcestateupdate; forcestateupdate = updateCreatureState() || forcestateupdate;
if (!mSkipAnim)
refreshCurrentAnims(idlestate, movestate, forcestateupdate); refreshCurrentAnims(idlestate, movestate, forcestateupdate);
if (inJump) if (inJump)
mMovementAnimationControlled = false; mMovementAnimationControlled = false;
@ -1672,6 +1673,7 @@ void CharacterController::update(float duration)
// Can't reset jump state (mPosition[2]) here; we don't know for sure whether the PhysicSystem will actually handle it in this frame // Can't reset jump state (mPosition[2]) here; we don't know for sure whether the PhysicSystem will actually handle it in this frame
// due to the fixed minimum timestep used for the physics update. It will be reset in PhysicSystem::move once the jump is handled. // due to the fixed minimum timestep used for the physics update. It will be reset in PhysicSystem::move once the jump is handled.
if (!mSkipAnim)
updateHeadTracking(duration); updateHeadTracking(duration);
} }
else if(cls.getCreatureStats(mPtr).isDead()) else if(cls.getCreatureStats(mPtr).isDead())
@ -1679,9 +1681,7 @@ void CharacterController::update(float duration)
world->queueMovement(mPtr, Ogre::Vector3(0.0f)); world->queueMovement(mPtr, Ogre::Vector3(0.0f));
} }
if(!mSkipAnim) Ogre::Vector3 moved = mAnimation->runAnimation(mSkipAnim ? 0.f : duration);
{
Ogre::Vector3 moved = mAnimation->runAnimation(duration);
if(duration > 0.0f) if(duration > 0.0f)
moved /= duration; moved /= duration;
else else
@ -1707,12 +1707,13 @@ void CharacterController::update(float duration)
moved *= (l / newLength); moved *= (l / newLength);
} }
if (mSkipAnim)
mAnimation->updateEffects(duration);
// Update movement // Update movement
if(mMovementAnimationControlled && mPtr.getClass().isActor()) if(mMovementAnimationControlled && mPtr.getClass().isActor())
world->queueMovement(mPtr, moved); world->queueMovement(mPtr, moved);
}
else
mAnimation->updateEffects(duration);
mSkipAnim = false; mSkipAnim = false;
mAnimation->enableHeadAnimation(cls.isActor() && !cls.getCreatureStats(mPtr).isDead()); mAnimation->enableHeadAnimation(cls.isActor() && !cls.getCreatureStats(mPtr).isDead());
@ -1781,6 +1782,8 @@ void CharacterController::forceStateUpdate()
{ {
playRandomDeath(); playRandomDeath();
} }
mAnimation->runAnimation(0.f);
} }
bool CharacterController::kill() bool CharacterController::kill()

Loading…
Cancel
Save