Search more aggressively for an animation velocity

pull/16/head
Chris Robinson 12 years ago
parent 5a9c1e1245
commit 56eede2610

@ -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…
Cancel
Save