Fix the creature position glitch

openmw-35
scrawl 10 years ago
parent 6f747df713
commit d56906acf7

@ -441,6 +441,8 @@ void CharacterController::refreshCurrentAnims(CharacterState idle, CharacterStat
}
// idle handled last as it can depend on the other states
// FIXME: if one of the below states is close to their last animation frame (i.e. will be disabled in the coming update),
// the idle animation should be displayed
if ((mUpperBodyState != UpperCharState_Nothing
|| mMovementState != CharState_None
|| mHitState != CharState_None)

@ -988,7 +988,11 @@ void Animation::resetActiveGroups()
AnimStateMap::const_iterator state = mStates.find(mAnimationTimePtr[0]->getAnimName());
if(state == mStates.end())
{
if (mAccumRoot && mNonAccumRoot)
mAccumRoot->setPosition(-mNonAccumRoot->getPosition()*mAccumulate);
return;
}
const Ogre::SharedPtr<AnimSource> &animsrc = state->second.mSource;
const std::vector<Ogre::Controller<Ogre::Real> >&ctrls = animsrc->mControllers[0];
@ -1142,9 +1146,6 @@ Ogre::Vector3 Animation::runAnimation(float duration)
if(!state.mPlaying && state.mAutoDisable)
{
if(mNonAccumCtrl && stateiter->first == mAnimationTimePtr[0]->getAnimName())
mAccumRoot->setPosition(0.f,0.f,0.f);
mStates.erase(stateiter++);
resetActiveGroups();

Loading…
Cancel
Save