]> git.tdb.fi Git - libs/gl.git/blob - source/pose.h
Render final pipeline output into the bound framebuffer
[libs/gl.git] / source / pose.h
1 #ifndef MSP_GL_POSE_H_
2 #define MSP_GL_POSE_H_
3
4 #include <map>
5 #include <msp/datafile/objectloader.h>
6 #include "matrix.h"
7
8 namespace Msp {
9 namespace GL {
10
11 class Armature;
12
13 class Pose
14 {
15 public:
16         class Loader: public DataFile::CollectionObjectLoader<Pose>
17         {
18         public:
19                 Loader(Pose &, Collection &);
20         private:
21                 void armature(const std::string &);
22                 void link(const std::string &);
23         };
24
25 private:
26         struct Link
27         {
28                 Matrix matrix;
29                 Matrix local_matrix;
30         };
31
32         class LinkLoader: public DataFile::ObjectLoader<Pose>
33         {
34         private:
35                 unsigned link_index;
36
37         public:
38                 LinkLoader(Pose &, unsigned);
39         private:
40                 void rotation(float, float, float, float);
41         };
42
43         const Armature *armature;
44         std::vector<Link> links;
45
46 public:
47         Pose();
48         Pose(const Armature &);
49
50         void set_armature(const Armature &);
51         void rotate_link(unsigned, float, const Vector3 &);
52         const Matrix &get_link_matrix(unsigned) const;
53 };
54
55 } // namespace GL
56 } // namespace Msp
57
58 #endif