2014-01-05 17:22:29 +00:00
|
|
|
#ifndef GAME_RENDER_CREATUREANIMATION_H
|
|
|
|
#define GAME_RENDER_CREATUREANIMATION_H
|
2011-11-24 06:48:54 +00:00
|
|
|
|
|
|
|
#include "animation.hpp"
|
2014-03-12 10:30:44 +00:00
|
|
|
#include "weaponanimation.hpp"
|
2014-01-19 12:05:26 +00:00
|
|
|
#include "../mwworld/inventorystore.hpp"
|
2011-12-12 03:40:00 +00:00
|
|
|
|
2013-01-06 05:12:08 +00:00
|
|
|
namespace MWWorld
|
|
|
|
{
|
|
|
|
class Ptr;
|
|
|
|
}
|
2011-11-24 06:48:54 +00:00
|
|
|
|
2013-01-06 05:12:08 +00:00
|
|
|
namespace MWRender
|
|
|
|
{
|
|
|
|
class CreatureAnimation : public Animation
|
2012-09-14 22:57:29 +00:00
|
|
|
{
|
2011-12-12 03:40:00 +00:00
|
|
|
public:
|
2012-09-14 22:57:29 +00:00
|
|
|
CreatureAnimation(const MWWorld::Ptr& ptr);
|
2014-01-19 12:05:26 +00:00
|
|
|
virtual ~CreatureAnimation() {}
|
|
|
|
};
|
|
|
|
|
|
|
|
// For creatures with weapons and shields
|
|
|
|
// Animation is already virtual anyway, so might as well make a separate class.
|
|
|
|
// Most creatures don't need weapons/shields, so this will save some memory.
|
2014-03-12 10:30:44 +00:00
|
|
|
class CreatureWeaponAnimation : public Animation, public WeaponAnimation, public MWWorld::InventoryStoreListener
|
2014-01-19 12:05:26 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
CreatureWeaponAnimation(const MWWorld::Ptr& ptr);
|
|
|
|
virtual ~CreatureWeaponAnimation() {}
|
|
|
|
|
|
|
|
virtual void equipmentChanged() { updateParts(); }
|
|
|
|
|
|
|
|
virtual void showWeapons(bool showWeapon);
|
|
|
|
virtual void showCarriedLeft(bool show);
|
|
|
|
|
|
|
|
void updateParts();
|
|
|
|
|
|
|
|
void updatePart(NifOgre::ObjectScenePtr& scene, int slot);
|
|
|
|
|
2014-03-12 10:30:44 +00:00
|
|
|
virtual void attachArrow();
|
|
|
|
virtual void releaseArrow();
|
|
|
|
|
|
|
|
virtual Ogre::Vector3 runAnimation(float duration);
|
|
|
|
|
|
|
|
/// A relative factor (0-1) that decides if and how much the skeleton should be pitched
|
|
|
|
/// to indicate the facing orientation of the character.
|
|
|
|
virtual void setPitchFactor(float factor) { mPitchFactor = factor; }
|
|
|
|
|
|
|
|
virtual void setWeaponGroup(const std::string& group) { mWeaponAnimationTime->setGroup(group); }
|
|
|
|
|
|
|
|
// WeaponAnimation
|
|
|
|
virtual NifOgre::ObjectScenePtr getWeapon() { return mWeapon; }
|
|
|
|
virtual void showWeapon(bool show) { showWeapons(show); }
|
|
|
|
virtual void configureAddedObject(NifOgre::ObjectScenePtr object, MWWorld::Ptr ptr, int slot);
|
|
|
|
|
2014-01-19 12:05:26 +00:00
|
|
|
private:
|
|
|
|
NifOgre::ObjectScenePtr mWeapon;
|
|
|
|
NifOgre::ObjectScenePtr mShield;
|
|
|
|
bool mShowWeapons;
|
|
|
|
bool mShowCarriedLeft;
|
2014-03-12 10:30:44 +00:00
|
|
|
|
|
|
|
Ogre::SharedPtr<WeaponAnimationTime> mWeaponAnimationTime;
|
2012-09-14 22:57:29 +00:00
|
|
|
};
|
2011-11-24 06:48:54 +00:00
|
|
|
}
|
2013-01-06 05:12:08 +00:00
|
|
|
|
2012-04-23 13:27:03 +00:00
|
|
|
#endif
|