X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fanimation%2Farmature.h;fp=source%2Fanimation%2Farmature.h;h=9dc2f505a0e62378d022fd6a525043e32c956ca3;hp=0000000000000000000000000000000000000000;hb=7aaec9a70b8d7733429bec043f8e33e02956f266;hpb=bec07999d95b76f4b47cffcc564d0cd0afc0435e diff --git a/source/animation/armature.h b/source/animation/armature.h new file mode 100644 index 00000000..9dc2f505 --- /dev/null +++ b/source/animation/armature.h @@ -0,0 +1,71 @@ +#ifndef MSP_GL_ARMATURE_H_ +#define MSP_GL_ARMATURE_H_ + +#include +#include +#include +#include "pose.h" +#include "vector.h" + +namespace Msp { +namespace GL { + +class Armature +{ +public: + class Loader: public DataFile::ObjectLoader + { + public: + Loader(Armature &); + private: + void link(const std::string &); + }; + + class Link + { + public: + class Loader: public DataFile::ObjectLoader + { + private: + const Armature &armature; + + public: + Loader(Link &, const Armature &); + private: + void base(float, float, float); + void parent(const std::string &); + }; + + private: + std::string name; + unsigned index; + const Link *parent; + Vector3 base; + + public: + Link(const std::string &, unsigned); + + void set_parent(const Link *); + void set_base(const Vector3 &); + + const std::string &get_name() const { return name; } + unsigned get_index() const { return index; } + const Link *get_parent() const { return parent; } + const Vector3 &get_base() const { return base; } + }; + +private: + std::vector links; + +public: + Link &add_link(); + + const Link &get_link(unsigned) const; + const Link &get_link(const std::string &) const; + unsigned get_max_link_index() const; +}; + +} // namespace GL +} // namespace Msp + +#endif