mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-21 12:53:53 +00:00
Search more aggressively for an animation velocity
This commit is contained in:
parent
5a9c1e1245
commit
56eede2610
1 changed files with 20 additions and 2 deletions
|
@ -546,8 +546,9 @@ bool Animation::resetActiveGroups()
|
|||
|
||||
bool ismoving = false;
|
||||
|
||||
const NifOgre::TextKeyMap &keys = state->second.mSource->mTextKeys;
|
||||
std::vector<Ogre::Controller<Ogre::Real> >&ctrls = state->second.mSource->mControllers[0];
|
||||
const AnimSource *animsrc = state->second.mSource;
|
||||
const NifOgre::TextKeyMap &keys = animsrc->mTextKeys;
|
||||
const std::vector<Ogre::Controller<Ogre::Real> >&ctrls = animsrc->mControllers[0];
|
||||
for(size_t i = 0;i < ctrls.size();i++)
|
||||
{
|
||||
NifOgre::NodeTargetValue<Ogre::Real> *dstval;
|
||||
|
@ -562,6 +563,23 @@ bool Animation::resetActiveGroups()
|
|||
}
|
||||
}
|
||||
|
||||
// If there's no velocity, keep looking
|
||||
while(!(mAnimVelocity > 1.0f) && animsrc-- != &mAnimSources[0])
|
||||
{
|
||||
const NifOgre::TextKeyMap &keys = animsrc->mTextKeys;
|
||||
const std::vector<Ogre::Controller<Ogre::Real> >&ctrls = animsrc->mControllers[0];
|
||||
for(size_t i = 0;i < ctrls.size();i++)
|
||||
{
|
||||
NifOgre::NodeTargetValue<Ogre::Real> *dstval;
|
||||
dstval = static_cast<NifOgre::NodeTargetValue<Ogre::Real>*>(ctrls[i].getDestination().getPointer());
|
||||
if(dstval->getNode() == mNonAccumRoot)
|
||||
{
|
||||
mAnimVelocity = calcAnimVelocity(keys, dstval, mAccumulate, state->first);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ismoving;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue