X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fpose.h;fp=source%2Fpose.h;h=5f37c414d4e60d127626a68db3f53dfa352a19cd;hp=0000000000000000000000000000000000000000;hb=9abfb801dbceb59272f6561731d066ed516340e5;hpb=e8bdd7946874a6622bda3376232290a35422fdea diff --git a/source/pose.h b/source/pose.h new file mode 100644 index 00000000..5f37c414 --- /dev/null +++ b/source/pose.h @@ -0,0 +1,57 @@ +#ifndef MSP_GL_POSE_H_ +#define MSP_GL_POSE_H_ + +#include +#include +#include "matrix.h" + +namespace Msp { +namespace GL { + +class Armature; + +class Pose +{ +public: + class Loader: public DataFile::CollectionObjectLoader + { + public: + Loader(Pose &, Collection &); + private: + void link(const std::string &); + }; + +private: + struct Link + { + Matrix matrix; + Matrix local_matrix; + }; + + class LinkLoader: public DataFile::ObjectLoader + { + private: + unsigned link_index; + + public: + LinkLoader(Pose &, unsigned); + private: + void rotation(float, float, float, float); + }; + + const Armature *armature; + std::vector links; + +public: + Pose(); + Pose(const Armature &); + + void set_armature(const Armature &); + void rotate_link(unsigned, float, const Vector3 &); + const Matrix &get_link_matrix(unsigned) const; +}; + +} // namespace GL +} // namespace Msp + +#endif