2011-12-11 23:42:39 -05:00
|
|
|
#include "animation.hpp"
|
|
|
|
|
2012-07-03 15:32:38 +02:00
|
|
|
#include <OgreHardwarePixelBuffer.h>
|
|
|
|
#include <OgreSkeletonInstance.h>
|
|
|
|
#include <OgreEntity.h>
|
|
|
|
#include <OgreBone.h>
|
|
|
|
#include <OgreSubMesh.h>
|
2012-07-18 00:17:39 -07:00
|
|
|
#include <OgreSceneManager.h>
|
2011-12-17 01:29:08 -05:00
|
|
|
|
2012-07-13 03:51:58 -07:00
|
|
|
namespace MWRender
|
|
|
|
{
|
2012-07-17 10:57:15 -07:00
|
|
|
std::map<std::string, int> Animation::sUniqueIDs;
|
2012-07-12 20:12:18 -07:00
|
|
|
|
|
|
|
Animation::Animation(OEngine::Render::OgreRenderer& _rend)
|
2012-07-17 10:57:15 -07:00
|
|
|
: mInsert(NULL)
|
2012-07-12 20:12:18 -07:00
|
|
|
, mRend(_rend)
|
2012-07-17 10:57:15 -07:00
|
|
|
, mTime(0.0f)
|
|
|
|
, mAnimate(0)
|
2012-07-12 20:12:18 -07:00
|
|
|
{
|
2011-12-17 01:29:08 -05:00
|
|
|
}
|
2012-02-20 14:02:24 +01:00
|
|
|
|
2012-07-12 20:12:18 -07:00
|
|
|
Animation::~Animation()
|
|
|
|
{
|
2012-07-18 00:17:39 -07:00
|
|
|
Ogre::SceneManager *sceneMgr = mInsert->getCreator();
|
|
|
|
for(size_t i = 0;i < mEntityList.mEntities.size();i++)
|
|
|
|
sceneMgr->destroyEntity(mEntityList.mEntities[i]);
|
|
|
|
mEntityList.mEntities.clear();
|
2012-07-12 20:12:18 -07:00
|
|
|
}
|
2012-01-06 22:52:15 -05:00
|
|
|
|
2012-07-20 00:53:12 -07:00
|
|
|
void Animation::playGroup(std::string groupname, int mode, int loops)
|
2012-07-12 20:12:18 -07:00
|
|
|
{
|
|
|
|
if(groupname == "all")
|
|
|
|
{
|
2012-07-17 10:57:15 -07:00
|
|
|
mAnimate = loops;
|
2012-07-20 00:29:22 -07:00
|
|
|
mTime = 0.0f;
|
2012-07-12 20:12:18 -07:00
|
|
|
}
|
|
|
|
}
|
2012-02-20 14:02:24 +01:00
|
|
|
|
2011-12-15 00:33:10 -05:00
|
|
|
|
2012-07-20 00:53:12 -07:00
|
|
|
void Animation::skipAnim()
|
2012-07-12 20:12:18 -07:00
|
|
|
{
|
2012-07-17 10:57:15 -07:00
|
|
|
mAnimate = 0;
|
2012-07-12 20:12:18 -07:00
|
|
|
}
|
2012-02-20 14:02:24 +01:00
|
|
|
|
|
|
|
}
|