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

34 lines
745 B
C++
Raw Normal View History

#include "creatureanimation.hpp"
2012-04-03 13:13:47 +00:00
#include "renderconst.hpp"
#include "../mwbase/world.hpp"
namespace MWRender
{
2011-12-12 04:42:39 +00:00
CreatureAnimation::~CreatureAnimation()
{
2011-12-12 04:42:39 +00:00
}
CreatureAnimation::CreatureAnimation(const MWWorld::Ptr &ptr)
: Animation(ptr, ptr.getRefData().getBaseNode())
{
MWWorld::LiveCellRef<ESM::Creature> *ref = mPtr.get<ESM::Creature>();
2012-11-05 12:07:59 +00:00
assert (ref->mBase != NULL);
if(!ref->mBase->mModel.empty())
{
2013-02-23 11:34:03 +00:00
std::string model = "meshes\\"+ref->mBase->mModel;
setObjectRoot(model, false);
setRenderProperties(mObjectRoot, RV_Actors, RQG_Main, RQG_Alpha);
if((ref->mBase->mFlags&ESM::Creature::Biped))
addAnimSource("meshes\\base_anim.nif");
addAnimSource(model);
}
}
2012-01-17 14:10:53 +00:00
}