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