OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
actor.hpp
Go to the documentation of this file.
1 #ifndef OPENCS_VIEW_RENDER_ACTOR_H
2 #define OPENCS_VIEW_RENDER_ACTOR_H
3 
4 #include <string>
5 
6 #include <osg/ref_ptr>
7 
8 #include <QObject>
9 
12 
13 #include "../../model/world/actoradapter.hpp"
14 
15 namespace osg
16 {
17  class Group;
18 }
19 
20 namespace CSMWorld
21 {
22  class Data;
23 }
24 
25 namespace SceneUtil
26 {
27  class Skeleton;
28 }
29 
30 namespace CSVRender
31 {
33  class Actor : public QObject
34  {
35  Q_OBJECT
36  public:
41  Actor(const std::string& id, CSMWorld::Data& data);
42 
44  osg::Group* getBaseNode();
45 
47  void update();
48 
49  private slots:
50  void handleActorChanged(const std::string& refId);
51 
52  private:
53  void loadSkeleton(const std::string& model);
54  void loadBodyParts();
55  void attachBodyPart(ESM::PartReferenceType, const std::string& mesh);
56 
57  std::string getBodyPartMesh(const std::string& bodyPartId);
58 
59  static const std::string MeshPrefix;
60 
61  std::string mId;
64 
65  osg::ref_ptr<osg::Group> mBaseNode;
68  };
69 }
70 
71 #endif
Actor(const std::string &id, CSMWorld::Data &data)
Definition: actor.cpp:19
Handles the bone matrices for any number of child RigGeometries.
Definition: skeleton.hpp:36
CSMWorld::ActorAdapter::ActorDataPtr mActorData
Definition: actor.hpp:63
PartReferenceType
Definition: loadarmo.hpp:13
Handles loading an npc or creature.
Definition: actor.hpp:33
osg::ref_ptr< osg::Group > mBaseNode
Definition: actor.hpp:65
void attachBodyPart(ESM::PartReferenceType, const std::string &mesh)
Definition: actor.cpp:104
std::map< std::string, osg::ref_ptr< osg::MatrixTransform > > NodeMap
Definition: visitor.hpp:66
void loadBodyParts()
Definition: actor.cpp:94
void loadSkeleton(const std::string &model)
Definition: actor.cpp:74
CSMWorld::Data & mData
Definition: actor.hpp:62
osg::Group * getBaseNode()
Retrieves the base node that meshes are attached to.
Definition: actor.cpp:30
static const std::string MeshPrefix
Definition: actor.hpp:59
std::shared_ptr< ActorData > ActorDataPtr
Definition: actoradapter.hpp:112
std::string getBodyPartMesh(const std::string &bodyPartId)
Definition: actor.cpp:118
Definition: data.hpp:80
void handleActorChanged(const std::string &refId)
Definition: actor.cpp:66
SceneUtil::Skeleton * mSkeleton
Definition: actor.hpp:66
std::string mId
Definition: actor.hpp:61
void update()
(Re)creates the npc or creature renderable
Definition: actor.cpp:35
SceneUtil::NodeMapVisitor::NodeMap mNodeMap
Definition: actor.hpp:67