1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-15 21:19:57 +00:00
openmw-tes3mp/apps/openmw/mwrender/animation.hpp
Chris Robinson 910619eb21 Store the NonAccum animation root from the skeleton instance
Currently this is assumed to be the node with the animation text keys.
2013-01-06 17:31:53 -08:00

56 lines
1.1 KiB
C++

#ifndef _GAME_RENDER_ANIMATION_H
#define _GAME_RENDER_ANIMATION_H
#include <components/nifogre/ogre_nif_loader.hpp>
#include "../mwworld/ptr.hpp"
namespace MWRender
{
class Animation
{
struct GroupTimes {
float mStart;
float mStop;
float mLoopStart;
float mLoopStop;
size_t mLoops;
GroupTimes()
: mStart(-1.0f), mStop(-1.0f), mLoopStart(-1.0f), mLoopStop(-1.0f),
mLoops(0)
{ }
};
protected:
MWWorld::Ptr mPtr;
Ogre::SceneNode* mInsert;
float mTime;
GroupTimes mCurGroup;
GroupTimes mNextGroup;
Ogre::AnimationState *mAnimState;
bool mSkipFrame;
NifOgre::EntityList mEntityList;
NifOgre::TextKeyMap mTextKeys;
Ogre::Node *mNonAccumRoot;
bool findGroupTimes(const std::string &groupname, GroupTimes *times);
void createEntityList(Ogre::SceneNode *node, const std::string &model);
public:
Animation(const MWWorld::Ptr &ptr);
virtual ~Animation();
void playGroup(std::string groupname, int mode, int loops);
void skipAnim();
virtual void runAnimation(float timepassed);
};
}
#endif