2011-11-24 01:48:54 -05:00
|
|
|
#ifndef _GAME_RENDER_ANIMATION_H
|
|
|
|
#define _GAME_RENDER_ANIMATION_H
|
2012-07-17 09:27:12 +02:00
|
|
|
|
2012-07-17 11:23:34 -07:00
|
|
|
#include <vector>
|
|
|
|
|
2012-07-17 16:00:03 -07:00
|
|
|
#include <components/nifogre/ogre_nif_loader.hpp>
|
2011-12-11 22:40:00 -05:00
|
|
|
#include <openengine/ogre/renderer.hpp>
|
|
|
|
#include "../mwworld/actiontalk.hpp"
|
2011-12-15 00:33:10 -05:00
|
|
|
#include <components/nif/node.hpp>
|
2012-01-04 19:47:06 -05:00
|
|
|
#include <openengine/bullet/physic.hpp>
|
2011-12-11 22:40:00 -05:00
|
|
|
|
2012-01-06 02:27:10 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
2012-07-12 20:12:18 -07:00
|
|
|
namespace MWRender {
|
2011-12-11 22:40:00 -05:00
|
|
|
|
2012-07-12 20:12:18 -07:00
|
|
|
class Animation {
|
2012-07-24 14:42:01 -07:00
|
|
|
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)
|
|
|
|
{ }
|
|
|
|
};
|
|
|
|
|
2012-07-12 20:12:18 -07:00
|
|
|
protected:
|
2012-07-13 03:51:58 -07:00
|
|
|
Ogre::SceneNode* mInsert;
|
2011-12-11 22:40:00 -05:00
|
|
|
OEngine::Render::OgreRenderer &mRend;
|
2012-04-23 15:27:03 +02:00
|
|
|
|
2012-07-13 03:51:58 -07:00
|
|
|
float mTime;
|
2012-07-24 14:42:01 -07:00
|
|
|
GroupTimes mCurGroup;
|
2012-07-24 14:54:12 -07:00
|
|
|
GroupTimes mNextGroup;
|
2012-07-24 13:51:48 -07:00
|
|
|
|
2012-07-21 17:39:57 -07:00
|
|
|
bool mSkipFrame;
|
2011-12-27 00:20:14 -05:00
|
|
|
|
2012-07-17 16:00:03 -07:00
|
|
|
NifOgre::EntityList mEntityList;
|
2012-07-23 17:27:35 -07:00
|
|
|
NifOgre::TextKeyMap mTextKeys;
|
2012-04-23 15:27:03 +02:00
|
|
|
|
2012-07-24 14:42:01 -07:00
|
|
|
bool findGroupTimes(const std::string &groupname, GroupTimes *times);
|
2012-07-24 13:51:48 -07:00
|
|
|
|
2012-07-12 20:12:18 -07:00
|
|
|
public:
|
|
|
|
Animation(OEngine::Render::OgreRenderer& _rend);
|
|
|
|
virtual ~Animation();
|
2012-07-20 00:53:12 -07:00
|
|
|
|
|
|
|
void playGroup(std::string groupname, int mode, int loops);
|
|
|
|
void skipAnim();
|
2012-07-21 14:41:26 -07:00
|
|
|
virtual void runAnimation(float timepassed);
|
2011-11-24 01:48:54 -05:00
|
|
|
};
|
2012-07-12 20:12:18 -07:00
|
|
|
|
2011-11-24 01:48:54 -05:00
|
|
|
}
|
2012-03-25 21:56:22 +02:00
|
|
|
#endif
|