mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-27 03:35:27 +00:00
Search more aggressively for an animation velocity
This commit is contained in:
parent
5a9c1e1245
commit
56eede2610
@ -546,8 +546,9 @@ bool Animation::resetActiveGroups()
|
|||||||
|
|
||||||
bool ismoving = false;
|
bool ismoving = false;
|
||||||
|
|
||||||
const NifOgre::TextKeyMap &keys = state->second.mSource->mTextKeys;
|
const AnimSource *animsrc = state->second.mSource;
|
||||||
std::vector<Ogre::Controller<Ogre::Real> >&ctrls = state->second.mSource->mControllers[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++)
|
for(size_t i = 0;i < ctrls.size();i++)
|
||||||
{
|
{
|
||||||
NifOgre::NodeTargetValue<Ogre::Real> *dstval;
|
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;
|
return ismoving;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user