1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-10 15:39:02 +00:00
OpenMW/apps/openmw/mwrender/creatureanimation.cpp
2011-12-11 23:42:39 -05:00

27 lines
783 B
C++

#include "creatureanimation.hpp"
#include "../mwworld/world.hpp"
using namespace Ogre;
using namespace NifOgre;
namespace MWRender{
CreatureAnimation::~CreatureAnimation(){
}
CreatureAnimation::CreatureAnimation(const MWWorld::Ptr& ptr, MWWorld::Environment& _env,OEngine::Render::OgreRenderer& _rend): Animation(_env,_rend){
Ogre::SceneNode* insert = ptr.getRefData().getBaseNode();
assert(insert);
ESMS::LiveCellRef<ESM::Creature, MWWorld::RefData> *ref =
ptr.get<ESM::Creature>();
assert (ref->base != NULL);
if(!ref->base->model.empty()){
const std::string &mesh = "meshes\\" + ref->base->model;
NifOgre::NIFLoader::load(mesh);
base = mRend.getScene()->createEntity(mesh);
insert->attachObject(base);
}
}
}