1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-26 18:35:20 +00:00
OpenMW/apps/openmw/mwrender/animation.hpp

59 lines
1.4 KiB
C++
Raw Normal View History

#ifndef _GAME_RENDER_ANIMATION_H
#define _GAME_RENDER_ANIMATION_H
#include <components/nif/data.hpp>
#include <openengine/ogre/renderer.hpp>
#include "../mwworld/refdata.hpp"
#include "../mwworld/ptr.hpp"
#include "../mwworld/actiontalk.hpp"
2011-12-15 00:33:10 -05:00
#include <components/nif/node.hpp>
#include <map>
2012-01-04 19:47:06 -05:00
#include <openengine/bullet/physic.hpp>
2012-01-06 02:27:10 -05:00
namespace MWRender {
struct PosAndRot {
Ogre::Quaternion vecRot;
Ogre::Vector3 vecPos;
};
class Animation {
protected:
2012-01-05 21:45:17 -05:00
Ogre::SceneNode* insert;
OEngine::Render::OgreRenderer &mRend;
static std::map<std::string, int> mUniqueIDs;
2011-12-13 23:49:03 -05:00
float time;
float startTime;
float stopTime;
int animate;
//Represents a rotation index for each bone
std::vector<int>rindexI;
2011-12-13 23:49:03 -05:00
//Represents a translation index for each bone
std::vector<int>tindexI;
2011-12-27 00:20:14 -05:00
//Only shapes with morphing data will use a shape number
int shapeNumber;
std::vector<std::vector<int> > shapeIndexI;
2011-12-13 23:49:03 -05:00
std::vector<Nif::NiKeyframeData>* transformations;
2012-01-06 00:55:02 -05:00
std::map<std::string,float>* textmappings;
Ogre::Entity* base;
2011-12-27 22:35:22 -05:00
void handleAnimationTransforms();
2012-03-06 18:28:41 -05:00
bool timeIndex( float time, const std::vector<float> & times, int & i, int & j, float & x );
public:
Animation(OEngine::Render::OgreRenderer& _rend);
virtual void runAnimation(float timepassed) = 0;
void startScript(std::string groupname, int mode, int loops);
void stopScript();
virtual ~Animation();
};
}
#endif