diff --git a/apps/openmw/mwrender/animation.cpp b/apps/openmw/mwrender/animation.cpp index d0806b511..cdbeffa19 100644 --- a/apps/openmw/mwrender/animation.cpp +++ b/apps/openmw/mwrender/animation.cpp @@ -575,6 +575,8 @@ namespace MWRender mAccumCtrl = NULL; mAnimSources.clear(); + + mAnimVelocities.clear(); } bool Animation::hasAnimation(const std::string &anim) const @@ -952,6 +954,10 @@ namespace MWRender if (!mAccumRoot) return 0.0f; + std::map::const_iterator found = mAnimVelocities.find(groupname); + if (found != mAnimVelocities.end()) + return found->second; + // Look in reverse; last-inserted source has priority. AnimSourceList::const_reverse_iterator animsrc(mAnimSources.rbegin()); for(;animsrc != mAnimSources.rend();++animsrc) @@ -999,6 +1005,8 @@ namespace MWRender } } + mAnimVelocities.insert(std::make_pair(groupname, velocity)); + return velocity; } diff --git a/apps/openmw/mwrender/animation.hpp b/apps/openmw/mwrender/animation.hpp index 584eca614..f765a7a40 100644 --- a/apps/openmw/mwrender/animation.hpp +++ b/apps/openmw/mwrender/animation.hpp @@ -274,6 +274,8 @@ protected: float mAlpha; + mutable std::map mAnimVelocities; + osg::ref_ptr mLightListCallback; const NodeMap& getNodeMap() const;