Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 20, 2005, 3:21:19 AM (20 years ago)
Author:
patrick
Message:

christmas: cleaned up the model package

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/christmas_branche/src/lib/graphics/importer/md2Model.h

    r6175 r6180  
    6565};
    6666
     67
     68//! compressed vertex data: char insetead of float, the value will be expanded by the scale value. only for loading
     69typedef struct
     70{
     71  char             v[3];                 //!< the vector of the vertex
     72  unsigned char    lightNormalIndex;     //!< the index of the light normal
     73} sVertex;
     74
     75
     76//! compressed texture offset data: coords scaled by the texture size. Only for loading
     77typedef struct
     78{
     79  short            s;                    //!< the s,t coordinates of a texture
     80  short            t;                    //!< the s,t coordinates of a texture
     81} sTexCoor;
     82
     83
     84//! holds tha informations about a md2 frame
     85typedef struct
     86{
     87  sVec3D           scale;                //!< scales values of the model
     88  sVec3D           translate;            //!< translates the model
     89  char             name[16];             //!< frame name: something like "run32"
     90  sVertex          pVertices[1];         //!< first vertex of thes frame
     91} sFrame;
     92
     93
     94//! holds the information about a triangle
     95typedef struct
     96{
     97  unsigned short   indexToVertices[3];   //!< index to the verteces of the triangle
     98  unsigned short   indexToTexCoor[3];    //!< index to the texture coordinates
     99} sTriangle;
     100
     101
     102
     103//! the command list of the md2 model, very md2 specific
     104typedef struct
     105{
     106  float            s;                    //!< texture coordinate 1
     107  float            t;                    //!< texture coordinate 2
     108  int              vertexIndex;          //!< index of the vertex in the vertex list
     109} glCommandVertex;
     110
     111
     112//! a md2 animation definition
     113typedef struct
     114{
     115  int              firstFrame;           //!< first frame of the animation
     116  int              lastFrame;            //!< last frame of the animation
     117  int              fps;                  //!< speed: number of frames per second
     118} sAnim;
     119
     120
     121//! animation state definition
     122typedef struct
     123{
     124  int              startFrame;           //!< the start frame of an animation
     125  int              endFrame;             //!< last frame of the animation
     126  int              fps;                  //!< fps of the animaion (speed)
     127
     128  float            localTime;            //!< the local time
     129  float            lastTime;             //!< last time stamp
     130  float            interpolationState;   //!< the state of the animation [0..1]
     131
     132  int              type;                 //!< animation type
     133
     134  int              currentFrame;         //!< the current frame
     135  int              nextFrame;            //!< the next frame in the list
     136} sAnimState;
    67137
    68138
     
    159229  void animate();
    160230  void processLighting();
    161   void interpolate(sVec3D* verticesList);
     231  void interpolate(/*sVec3D* verticesList*/);
    162232  void renderFrame() const ;
    163233
Note: See TracChangeset for help on using the changeset viewer.