1 | /*! |
---|
2 | * @file md_model_structure.h |
---|
3 | */ |
---|
4 | |
---|
5 | |
---|
6 | #include "vector.h" |
---|
7 | |
---|
8 | |
---|
9 | //! compressed vertex data: char insetead of float, the value will be expanded by the scale value. only for loading |
---|
10 | typedef struct |
---|
11 | { |
---|
12 | unsigned char v[3]; //!< the vector of the vertex |
---|
13 | unsigned char lightNormalIndex; //!< the index of the light normal |
---|
14 | } sVertex; |
---|
15 | |
---|
16 | |
---|
17 | //! compressed texture offset data: coords scaled by the texture size. Only for loading |
---|
18 | typedef struct |
---|
19 | { |
---|
20 | short s; //!< the s,t coordinates of a texture |
---|
21 | short t; //!< the s,t coordinates of a texture |
---|
22 | } sTexCoor; |
---|
23 | |
---|
24 | |
---|
25 | //! holds tha informations about a md2 frame |
---|
26 | typedef struct |
---|
27 | { |
---|
28 | sVec3D scale; //!< scales values of the model |
---|
29 | sVec3D translate; //!< translates the model |
---|
30 | char name[16]; //!< frame name: something like "run32" |
---|
31 | sVertex pVertices[1]; //!< first vertex of thes frame |
---|
32 | } sFrame; |
---|
33 | |
---|
34 | |
---|
35 | //! holds the information about a triangle |
---|
36 | typedef struct |
---|
37 | { |
---|
38 | unsigned short indexToVertices[3]; //!< index to the verteces of the triangle |
---|
39 | unsigned short indexToTexCoor[3]; //!< index to the texture coordinates |
---|
40 | } sTriangle; |
---|
41 | |
---|
42 | |
---|
43 | |
---|
44 | //! the command list of the md2 model, very md2 specific |
---|
45 | typedef struct |
---|
46 | { |
---|
47 | float s; //!< texture coordinate 1 |
---|
48 | float t; //!< texture coordinate 2 |
---|
49 | int vertexIndex; //!< index of the vertex in the vertex list |
---|
50 | } glCommandVertex; |
---|
51 | |
---|
52 | |
---|
53 | //! a md2 animation definition |
---|
54 | typedef struct |
---|
55 | { |
---|
56 | int firstFrame; //!< first frame of the animation |
---|
57 | int lastFrame; //!< last frame of the animation |
---|
58 | int fps; //!< speed: number of frames per second |
---|
59 | int bStoppable; //!< 1 if the animation is stoppable 0 else |
---|
60 | } sAnim; |
---|
61 | |
---|
62 | |
---|
63 | //! animation state definition |
---|
64 | typedef struct |
---|
65 | { |
---|
66 | int startFrame; //!< the start frame of an animation |
---|
67 | int endFrame; //!< last frame of the animation |
---|
68 | int fps; //!< fps of the animaion (speed) |
---|
69 | |
---|
70 | float localTime; //!< the local time |
---|
71 | float lastTime; //!< last time stamp |
---|
72 | float interpolationState; //!< the state of the animation [0..1] |
---|
73 | |
---|
74 | int type; //!< animation type |
---|
75 | |
---|
76 | int currentFrame; //!< the current frame |
---|
77 | int nextFrame; //!< the next frame in the list |
---|
78 | int numPlays; //!< the number of times, this has been played in series |
---|
79 | |
---|
80 | int animPlaybackMode; //!< the playback mode |
---|
81 | } sAnimState; |
---|
82 | |
---|