/*! * @file md_model_structure.h */ #ifndef _MD3_MODEL_STRUCTURE_H #define _MD3_MODEL_STRUCTURE_H #include "vector.h" //! compressed vertex data: char insetead of float, the value will be expanded by the scale value. only for loading typedef struct { unsigned char v[3]; //!< the vector of the vertex unsigned char lightNormalIndex; //!< the index of the light normal } sVertex; //! compressed texture offset data: coords scaled by the texture size. Only for loading typedef struct { short s; //!< the s,t coordinates of a texture short t; //!< the s,t coordinates of a texture } sTexCoor; //! holds tha informations about a md2 frame typedef struct { sVec3D scale; //!< scales values of the model sVec3D translate; //!< translates the model char name[16]; //!< frame name: something like "run32" sVertex pVertices[1]; //!< first vertex of thes frame } sFrame; //! holds the information about a triangle typedef struct { unsigned short indexToVertices[3]; //!< index to the verteces of the triangle unsigned short indexToTexCoor[3]; //!< index to the texture coordinates } sTriangle; //! the command list of the md2 model, very md2 specific typedef struct { float s; //!< texture coordinate 1 float t; //!< texture coordinate 2 int vertexIndex; //!< index of the vertex in the vertex list } glCommandVertex; //! a md2 animation definition typedef struct { int firstFrame; //!< first frame of the animation int lastFrame; //!< last frame of the animation int fps; //!< speed: number of frames per second int bStoppable; //!< 1 if the animation is stoppable 0 else } sAnim; //! animation state definition typedef struct { int startFrame; //!< the start frame of an animation int endFrame; //!< last frame of the animation int fps; //!< fps of the animaion (speed) float localTime; //!< the local time float lastTime; //!< last time stamp float interpolationState; //!< the state of the animation [0..1] int type; //!< animation type int currentFrame; //!< the current frame int nextFrame; //!< the next frame in the list int numPlays; //!< the number of times, this has been played in series int animPlaybackMode; //!< the playback mode } sAnimState; #endif /* _MD3_MODEL_STRUCTURE_H */