2011-11-24 06:48:54 +00:00
|
|
|
#ifndef _GAME_RENDER_ANIMATION_H
|
|
|
|
#define _GAME_RENDER_ANIMATION_H
|
2012-07-17 07:27:12 +00:00
|
|
|
|
2011-12-12 03:40:00 +00:00
|
|
|
#include <openengine/ogre/renderer.hpp>
|
|
|
|
#include "../mwworld/actiontalk.hpp"
|
2011-12-15 05:33:10 +00:00
|
|
|
#include <components/nif/node.hpp>
|
2012-01-05 00:47:06 +00:00
|
|
|
#include <openengine/bullet/physic.hpp>
|
2011-12-12 03:40:00 +00:00
|
|
|
|
2012-01-06 07:27:10 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2012-07-13 03:12:18 +00:00
|
|
|
namespace MWRender {
|
2011-12-12 03:40:00 +00:00
|
|
|
|
2012-07-13 03:12:18 +00:00
|
|
|
struct PosAndRot {
|
2012-01-12 21:03:07 +00:00
|
|
|
Ogre::Quaternion vecRot;
|
|
|
|
Ogre::Vector3 vecPos;
|
|
|
|
};
|
|
|
|
|
2012-07-13 03:12:18 +00:00
|
|
|
class Animation {
|
|
|
|
protected:
|
2012-07-13 10:51:58 +00:00
|
|
|
Ogre::SceneNode* mInsert;
|
2011-12-12 03:40:00 +00:00
|
|
|
OEngine::Render::OgreRenderer &mRend;
|
2012-07-13 10:51:58 +00:00
|
|
|
static std::map<std::string, int> sUniqueIDs;
|
2012-04-23 13:27:03 +00:00
|
|
|
|
2012-07-13 10:51:58 +00:00
|
|
|
float mTime;
|
|
|
|
float mStartTime;
|
|
|
|
float mStopTime;
|
|
|
|
int mAnimate;
|
2012-07-13 03:12:18 +00:00
|
|
|
//Represents a rotation index for each bone
|
2012-07-13 10:51:58 +00:00
|
|
|
std::vector<int>mRindexI;
|
2011-12-14 04:49:03 +00:00
|
|
|
//Represents a translation index for each bone
|
2012-07-13 10:51:58 +00:00
|
|
|
std::vector<int>mTindexI;
|
2011-12-27 05:20:14 +00:00
|
|
|
|
2012-07-13 03:12:18 +00:00
|
|
|
//Only shapes with morphing data will use a shape number
|
2012-07-13 10:51:58 +00:00
|
|
|
int mShapeNumber;
|
|
|
|
std::vector<std::vector<int> > mShapeIndexI;
|
2011-12-12 03:40:00 +00:00
|
|
|
|
2012-07-13 10:51:58 +00:00
|
|
|
std::vector<Nif::NiKeyframeData>* mTransformations;
|
|
|
|
std::map<std::string,float>* mTextmappings;
|
|
|
|
Ogre::Entity* mBase;
|
2011-12-28 03:35:22 +00:00
|
|
|
void handleAnimationTransforms();
|
2012-03-06 23:28:41 +00:00
|
|
|
bool timeIndex( float time, const std::vector<float> & times, int & i, int & j, float & x );
|
2012-04-23 13:27:03 +00:00
|
|
|
|
2012-07-13 03:12:18 +00:00
|
|
|
public:
|
|
|
|
Animation(OEngine::Render::OgreRenderer& _rend);
|
|
|
|
virtual void runAnimation(float timepassed) = 0;
|
|
|
|
void startScript(std::string groupname, int mode, int loops);
|
|
|
|
void stopScript();
|
2012-03-25 19:56:22 +00:00
|
|
|
|
2012-07-13 03:12:18 +00:00
|
|
|
virtual ~Animation();
|
2011-11-24 06:48:54 +00:00
|
|
|
};
|
2012-07-13 03:12:18 +00:00
|
|
|
|
2011-11-24 06:48:54 +00:00
|
|
|
}
|
2012-03-25 19:56:22 +00:00
|
|
|
#endif
|