#ifndef _GAME_RENDER_ANIMATION_H #define _GAME_RENDER_ANIMATION_H #include #include #include "../mwworld/refdata.hpp" #include "../mwworld/ptr.hpp" #include "../mwworld/actiontalk.hpp" #include "../mwworld/environment.hpp" #include #include namespace MWRender{ class Animation{ protected: OEngine::Render::OgreRenderer &mRend; MWWorld::Environment& mEnvironment; static std::map mUniqueIDs; std::vector* > shapeparts; //All the NiTriShape data that we need for animating an npc float time; float startTime; float stopTime; bool loop; int animate; //Represents a rotation index for each bone std::vectorrindexI; //Represents a translation index for each bone std::vectortindexI; //Only shapes with morphing data will need a shape number int shapeNumber; std::vector > shapeIndexI; //Ogre::SkeletonInstance* skel; std::vector* shapes; //All the NiTriShapeData for this creature std::vector entityparts; std::vector* transformations; std::map textmappings; Ogre::Entity* base; void handleShapes(std::vector* allshapes, Ogre::Entity* creaturemodel, Ogre::SkeletonInstance *skel); void handleAnimationTransforms(); bool timeIndex( float time, std::vector times, int & i, int & j, float & x ); std::string getUniqueID(std::string mesh); public: Animation(MWWorld::Environment& _env, OEngine::Render::OgreRenderer& _rend): mRend(_rend), mEnvironment(_env), loop(false), animate(0){}; virtual void runAnimation(float timepassed) = 0; void startScript(std::string groupname, int mode, int loops); void stopScript(); ~Animation(); }; } #endif