1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-15 23:19:56 +00:00
openmw-tes3mp/apps/openmw/mwrender/creatureanimation.hpp

69 lines
2.2 KiB
C++
Raw Normal View History

#ifndef GAME_RENDER_CREATUREANIMATION_H
#define GAME_RENDER_CREATUREANIMATION_H
#include "actoranimation.hpp"
2014-03-12 10:30:44 +00:00
#include "weaponanimation.hpp"
#include "../mwworld/inventorystore.hpp"
namespace MWWorld
{
class Ptr;
}
namespace MWRender
{
class CreatureAnimation : public ActorAnimation
{
public:
2015-04-19 01:05:47 +00:00
CreatureAnimation(const MWWorld::Ptr &ptr, const std::string& model, Resource::ResourceSystem* resourceSystem);
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.
class CreatureWeaponAnimation : public ActorAnimation, public WeaponAnimation, public MWWorld::InventoryStoreListener
{
public:
2015-04-19 01:05:47 +00:00
CreatureWeaponAnimation(const MWWorld::Ptr &ptr, const std::string& model, Resource::ResourceSystem* resourceSystem);
virtual ~CreatureWeaponAnimation() {}
virtual void equipmentChanged() { updateParts(); }
virtual void showWeapons(bool showWeapon);
virtual void showCarriedLeft(bool show);
void updateParts();
2015-04-19 01:05:47 +00:00
void updatePart(PartHolderPtr& scene, int slot);
2014-03-12 10:30:44 +00:00
virtual void attachArrow();
virtual void releaseArrow(float attackStrength);
2015-05-30 23:07:43 +00:00
// WeaponAnimation
virtual osg::Group* getArrowBone();
virtual osg::Node* getWeaponNode();
virtual Resource::ResourceSystem* getResourceSystem();
virtual void showWeapon(bool show) { showWeapons(show); }
virtual void setWeaponGroup(const std::string& group) { mWeaponAnimationTime->setGroup(group); }
2014-03-12 10:30:44 +00:00
2015-05-31 16:53:16 +00:00
virtual void addControllers();
2015-04-19 01:05:47 +00:00
virtual osg::Vec3f runAnimation(float duration);
2014-03-12 10:30:44 +00:00
/// A relative factor (0-1) that decides if and how much the skeleton should be pitched
/// to indicate the facing orientation of the character.
2015-05-31 16:53:16 +00:00
virtual void setPitchFactor(float factor) { mPitchFactor = factor; }
2014-03-12 10:30:44 +00:00
private:
2015-04-19 01:05:47 +00:00
PartHolderPtr mWeapon;
PartHolderPtr mShield;
bool mShowWeapons;
bool mShowCarriedLeft;
2014-03-12 10:30:44 +00:00
2015-05-30 23:07:43 +00:00
boost::shared_ptr<WeaponAnimationTime> mWeaponAnimationTime;
};
}
#endif