Rev | Line | |
---|
[8342] | 1 | /*! |
---|
| 2 | * @file md3_animation.h |
---|
| 3 | * |
---|
| 4 | * Code heavely inspired by: JAVA MD3 Model Viewer - A Java based Quake 3 model viewer |
---|
| 5 | * Copyright (C) 1999 Erwin 'KLR8' Vervaet |
---|
| 6 | */ |
---|
| 7 | |
---|
| 8 | #ifndef _MD3_ANIMATION_H |
---|
| 9 | #define _MD3_ANIMATION_H |
---|
| 10 | |
---|
| 11 | #include <string> |
---|
| 12 | |
---|
[8724] | 13 | namespace md3 |
---|
| 14 | { |
---|
[8342] | 15 | |
---|
[8724] | 16 | typedef enum MD3AnimationType { |
---|
| 17 | LEGS = 0, //!< animation only applicatble to the legs. top level model loaded from lower.md3 |
---|
| 18 | TORSO, //!< animation only applicatboe to the torso. normaly loaded from upper.md3 |
---|
| 19 | BOTH, //!< animation is applicable on both |
---|
| 20 | ALL, //!< animation is applicable to all submodels |
---|
[8342] | 21 | |
---|
[8724] | 22 | NUM_ANIMATION_TYPE //!< number of animations |
---|
| 23 | }; |
---|
[8342] | 24 | |
---|
[8724] | 25 | |
---|
| 26 | typedef struct MD3AnimationMap { |
---|
| 27 | std::string animationName; |
---|
| 28 | MD3AnimationType animationType; |
---|
| 29 | }; |
---|
| 30 | |
---|
| 31 | |
---|
| 32 | |
---|
| 33 | |
---|
[8342] | 34 | /** |
---|
| 35 | * a class with metadata describing an MD3 model animation |
---|
| 36 | */ |
---|
| 37 | class MD3Animation |
---|
| 38 | { |
---|
| 39 | |
---|
| 40 | public: |
---|
[8351] | 41 | MD3Animation(); |
---|
| 42 | virtual ~MD3Animation(); |
---|
[8342] | 43 | |
---|
[8351] | 44 | void init(); |
---|
| 45 | |
---|
[8348] | 46 | std::string toString() { return std::string("Name: " + this->name); } |
---|
[8342] | 47 | |
---|
| 48 | |
---|
| 49 | public: |
---|
[8724] | 50 | MD3AnimationType type; //!< specifies for what parts of a model this animation is appilcable (e.g. LEGS) |
---|
| 51 | std::string name; //!< name of the animation |
---|
[8342] | 52 | |
---|
[8724] | 53 | int offset; //!< for LEGS animation, this is the offset value to skip TORSO frames |
---|
| 54 | int first; //!< first frame |
---|
| 55 | int numFrames; //!< the number of frames in the anumation. < 0 means that all available frames used |
---|
| 56 | int numLoopFrames; //!< number of looping frames |
---|
| 57 | int fps; //!< frames per second |
---|
[8342] | 58 | |
---|
[8724] | 59 | static MD3AnimationMap animationList[25]; //!< the animation list |
---|
[8342] | 60 | }; |
---|
| 61 | |
---|
[8724] | 62 | } |
---|
[8342] | 63 | #endif /* _MD3_ANIMATION_H */ |
---|
Note: See
TracBrowser
for help on using the repository browser.