OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
creatureanimation.hpp
Go to the documentation of this file.
1 #ifndef GAME_RENDER_CREATUREANIMATION_H
2 #define GAME_RENDER_CREATUREANIMATION_H
3 
4 #include "actoranimation.hpp"
5 #include "weaponanimation.hpp"
6 #include "../mwworld/inventorystore.hpp"
7 
8 namespace MWWorld
9 {
10  class Ptr;
11 }
12 
13 namespace MWRender
14 {
16  {
17  public:
18  CreatureAnimation(const MWWorld::Ptr &ptr, const std::string& model, Resource::ResourceSystem* resourceSystem);
19  virtual ~CreatureAnimation() {}
20  };
21 
22  // For creatures with weapons and shields
23  // Animation is already virtual anyway, so might as well make a separate class.
24  // Most creatures don't need weapons/shields, so this will save some memory.
26  {
27  public:
28  CreatureWeaponAnimation(const MWWorld::Ptr &ptr, const std::string& model, Resource::ResourceSystem* resourceSystem);
30 
31  virtual void equipmentChanged() { updateParts(); }
32 
33  virtual void showWeapons(bool showWeapon);
34  virtual void showCarriedLeft(bool show);
35 
36  void updateParts();
37 
38  void updatePart(PartHolderPtr& scene, int slot);
39 
40  virtual void attachArrow();
41  virtual void releaseArrow(float attackStrength);
42  // WeaponAnimation
43  virtual osg::Group* getArrowBone();
44  virtual osg::Node* getWeaponNode();
46  virtual void showWeapon(bool show) { showWeapons(show); }
47  virtual void setWeaponGroup(const std::string& group) { mWeaponAnimationTime->setGroup(group); }
48 
49  virtual void addControllers();
50 
51  virtual osg::Vec3f runAnimation(float duration);
52 
55  virtual void setPitchFactor(float factor) { mPitchFactor = factor; }
56 
57 
58  private:
63 
64  boost::shared_ptr<WeaponAnimationTime> mWeaponAnimationTime;
65  };
66 }
67 
68 #endif
virtual void showCarriedLeft(bool show)
Definition: creatureanimation.cpp:68
Wrapper class that constructs and provides access to the most commonly used resource subsystems...
Definition: resourcesystem.hpp:24
void updatePart(PartHolderPtr &scene, int slot)
Definition: creatureanimation.cpp:89
virtual void addControllers()
Definition: creatureanimation.cpp:176
virtual void showWeapons(bool showWeapon)
Definition: creatureanimation.cpp:59
virtual osg::Group * getArrowBone()
Definition: creatureanimation.cpp:155
Definition: creatureanimation.hpp:15
Handles attach & release of projectiles for ranged weapons.
Definition: weaponanimation.hpp:29
bool mShowCarriedLeft
Definition: creatureanimation.hpp:62
Definition: creatureanimation.hpp:25
virtual void equipmentChanged()
Definition: creatureanimation.hpp:31
PartHolderPtr mShield
Definition: creatureanimation.hpp:60
PartHolderPtr mWeapon
Definition: creatureanimation.hpp:59
virtual void releaseArrow(float attackStrength)
Definition: creatureanimation.cpp:150
virtual ~CreatureWeaponAnimation()
Definition: creatureanimation.hpp:29
virtual void attachArrow()
Definition: creatureanimation.cpp:145
Variant of the ContainerStore for NPCs.
Definition: inventorystore.hpp:20
float mPitchFactor
Definition: weaponanimation.hpp:66
Definition: actoranimation.hpp:31
virtual ~CreatureAnimation()
Definition: creatureanimation.hpp:19
bool mShowWeapons
Definition: creatureanimation.hpp:61
virtual osg::Vec3f runAnimation(float duration)
Definition: creatureanimation.cpp:182
virtual osg::Node * getWeaponNode()
Definition: creatureanimation.cpp:166
void updateParts()
Definition: creatureanimation.cpp:77
CreatureWeaponAnimation(const MWWorld::Ptr &ptr, const std::string &model, Resource::ResourceSystem *resourceSystem)
Definition: creatureanimation.cpp:36
CreatureAnimation(const MWWorld::Ptr &ptr, const std::string &model, Resource::ResourceSystem *resourceSystem)
Definition: creatureanimation.cpp:19
Pointer to a LiveCellRef.
Definition: ptr.hpp:19
virtual void setWeaponGroup(const std::string &group)
Definition: creatureanimation.hpp:47
boost::shared_ptr< PartHolder > PartHolderPtr
Definition: animation.hpp:75
boost::shared_ptr< WeaponAnimationTime > mWeaponAnimationTime
Definition: creatureanimation.hpp:64
virtual void showWeapon(bool show)
Definition: creatureanimation.hpp:46
virtual void setPitchFactor(float factor)
Definition: creatureanimation.hpp:55
virtual Resource::ResourceSystem * getResourceSystem()
Definition: creatureanimation.cpp:171