12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394 |
- /*!
- * \file include/SkeletalModel.h
- * \brief This is the factored out skeletal model class
- *
- * \author Mongoose
- * \author xythobuz
- *
- * \todo Start cutting off old hacks by simple force use of method interface.
- * Also move the publicly exposed attributes out =)
- * Better animation system in general - this is memory wasteful
- */
-
- #ifndef _SKELETALMODEL_H_
- #define _SKELETALMODEL_H_
-
- #include <vector>
-
- #include "math/math.h"
-
- typedef struct {
- int mesh;
- vec3_t off;
- vec3_t rot;
- char flag;
- } bone_tag_t;
-
- typedef struct {
- std::vector<bone_tag_t *> tag;
- vec3_t pos;
- float yaw;
- } bone_frame_t;
-
- typedef struct {
- int id;
- char rate;
- std::vector<bone_frame_t *> frame;
- } animation_frame_t;
-
- typedef struct {
- int id;
- bool tr4Overlay;
- bool pigtails;
- int ponytailId;
- vec3_t ponytail;
- int ponytailMeshId;
- unsigned int ponytailNumMeshes;
- float ponytailAngle;
- float ponyOff;
- float ponyOff2;
- std::vector<animation_frame_t *> animation;
- } skeletal_model_t;
-
- /*!
- * \brief This is the factored out skeletal model class
- */
- class SkeletalModel {
- public:
- /*!
- * \brief Constructs an object of SkeletalModel
- */
- SkeletalModel();
-
- /*!
- * \brief Deconstructs an object of SkeletalModel
- */
- ~SkeletalModel();
-
- int getAnimation();
-
- int getFrame();
-
- int getIdleAnimation();
-
- void setModel(skeletal_model_t *mdl);
-
- void setAnimation(int index);
-
- void setFrame(int index);
-
- void setIdleAnimation(int index);
-
- unsigned int flags;
- skeletal_model_t *model; //!< World render model
- float time; //!< Interpolation use
- float lastTime;
- float rate; //!< \fixme temp cache this here for old animation system use
-
- private:
- int mBoneFrame; //!< Bone frame
- int mAnimationFrame; //!< Animation frame
- int mIdleAnimation; //!< Idle animation
- };
-
- #endif
|