mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-01 19:45:35 +00:00
Fix offset to accumulation root not being cleared when adding an animation state with startpoint=1.f (observed with death animations)
This commit is contained in:
parent
5660f283dd
commit
4caa8c5cca
1 changed files with 8 additions and 1 deletions
|
@ -775,11 +775,11 @@ void Animation::play(const std::string &groupname, int priority, int groups, boo
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Look in reverse; last-inserted source has priority. */
|
/* Look in reverse; last-inserted source has priority. */
|
||||||
|
AnimState state;
|
||||||
AnimSourceList::reverse_iterator iter(mAnimSources.rbegin());
|
AnimSourceList::reverse_iterator iter(mAnimSources.rbegin());
|
||||||
for(;iter != mAnimSources.rend();++iter)
|
for(;iter != mAnimSources.rend();++iter)
|
||||||
{
|
{
|
||||||
const NifOgre::TextKeyMap &textkeys = (*iter)->mTextKeys;
|
const NifOgre::TextKeyMap &textkeys = (*iter)->mTextKeys;
|
||||||
AnimState state;
|
|
||||||
if(reset(state, textkeys, groupname, start, stop, startpoint))
|
if(reset(state, textkeys, groupname, start, stop, startpoint))
|
||||||
{
|
{
|
||||||
state.mSource = *iter;
|
state.mSource = *iter;
|
||||||
|
@ -821,6 +821,13 @@ void Animation::play(const std::string &groupname, int priority, int groups, boo
|
||||||
std::cerr<< "Failed to find animation "<<groupname<<" for "<<mPtr.getCellRef().getRefId() <<std::endl;
|
std::cerr<< "Failed to find animation "<<groupname<<" for "<<mPtr.getCellRef().getRefId() <<std::endl;
|
||||||
|
|
||||||
resetActiveGroups();
|
resetActiveGroups();
|
||||||
|
|
||||||
|
if (!state.mPlaying && mNonAccumCtrl)
|
||||||
|
{
|
||||||
|
// If the animation state is not playing, we need to manually apply the accumulation
|
||||||
|
// (see updatePosition, which would be called if the animation was playing)
|
||||||
|
mAccumRoot->setPosition(-mNonAccumCtrl->getTranslation(state.mTime)*mAccumulate);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Animation::isPlaying(const std::string &groupname) const
|
bool Animation::isPlaying(const std::string &groupname) const
|
||||||
|
|
Loading…
Reference in a new issue