2011-12-12 04:42:39 +00:00
|
|
|
#include "animation.hpp"
|
|
|
|
|
2012-07-03 13:32:38 +00:00
|
|
|
#include <OgreHardwarePixelBuffer.h>
|
|
|
|
#include <OgreSkeletonInstance.h>
|
|
|
|
#include <OgreEntity.h>
|
|
|
|
#include <OgreBone.h>
|
|
|
|
#include <OgreSubMesh.h>
|
2012-07-18 07:17:39 +00:00
|
|
|
#include <OgreSceneManager.h>
|
2011-12-17 06:29:08 +00:00
|
|
|
|
2012-07-13 10:51:58 +00:00
|
|
|
namespace MWRender
|
|
|
|
{
|
2012-07-17 17:57:15 +00:00
|
|
|
std::map<std::string, int> Animation::sUniqueIDs;
|
2012-07-13 03:12:18 +00:00
|
|
|
|
|
|
|
Animation::Animation(OEngine::Render::OgreRenderer& _rend)
|
2012-07-17 17:57:15 +00:00
|
|
|
: mInsert(NULL)
|
2012-07-13 03:12:18 +00:00
|
|
|
, mRend(_rend)
|
2012-07-17 17:57:15 +00:00
|
|
|
, mTime(0.0f)
|
|
|
|
, mAnimate(0)
|
2012-07-13 03:12:18 +00:00
|
|
|
{
|
2011-12-17 06:29:08 +00:00
|
|
|
}
|
2012-02-20 13:02:24 +00:00
|
|
|
|
2012-07-13 03:12:18 +00:00
|
|
|
Animation::~Animation()
|
|
|
|
{
|
2012-07-18 07:17:39 +00: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-13 03:12:18 +00:00
|
|
|
}
|
2012-01-07 03:52:15 +00:00
|
|
|
|
2012-07-13 03:12:18 +00:00
|
|
|
void Animation::startScript(std::string groupname, int mode, int loops)
|
|
|
|
{
|
|
|
|
if(groupname == "all")
|
|
|
|
{
|
2012-07-17 17:57:15 +00:00
|
|
|
mAnimate = loops;
|
2012-07-20 07:29:22 +00:00
|
|
|
mTime = 0.0f;
|
2012-07-13 03:12:18 +00:00
|
|
|
}
|
|
|
|
}
|
2012-02-20 13:02:24 +00:00
|
|
|
|
2011-12-15 05:33:10 +00:00
|
|
|
|
2012-07-13 03:12:18 +00:00
|
|
|
void Animation::stopScript()
|
|
|
|
{
|
2012-07-17 17:57:15 +00:00
|
|
|
mAnimate = 0;
|
2012-07-13 03:12:18 +00:00
|
|
|
}
|
2012-02-20 13:02:24 +00:00
|
|
|
|
|
|
|
}
|