md2.h

Go to the documentation of this file.
00001 #ifndef _ANTI_MD2_
00002 #define _ANTI_MD2_
00003 
00004 #include "antistd.h"
00005 #include "texture.h"
00006 
00007 // http://tfc.duke.free.fr/old/models/md2.htm
00008 // http://linux.ucla.edu/~phaethon/q3a/formats/md2-schoenblum.html
00009 
00010 typedef struct aeMD2Header
00011 {
00012         int id;
00013         int ver;
00014         int texwidth;
00015         int texheight;
00016         int framesize;
00017         int numSkins;
00018         int numVerts;
00019         int numCoords;
00020         int numTris;
00021         int numGLCmds;
00022         int numFrames;
00023         int offsetSkins;
00024         int offsetCoords;
00025         int offsetTris;
00026         int offsetFrames;
00027         int offsetGLCmds;
00028         int offsetEnd;
00029 } aeMD2Header;
00030 
00031 typedef struct aeMD2Triangle
00032 {
00033         ushort vert[3];
00034         ushort coord[3];
00035 } aeMD2Triangle;
00036 
00037 typedef struct aeMD2CompressedVertex
00038 {
00039         byte pos[3];
00040         byte normal;
00041 } aeMD2CompressedVertex;
00042 
00043 typedef struct aeMD2Vertex
00044 {
00045         vec3 pos;
00046         vec3 normal;
00047 } aeMD2Vertex;
00048 
00049 typedef struct aeMD2Frame
00050 {
00051         vec3 scale;
00052         vec3 translation;
00053         char name[16];
00054         aeMD2Vertex* verts;
00055 } aeMD2Frame;
00056 
00057 typedef struct aeMD2GLCmd
00058 {
00059         float s;
00060         float t;
00061         int i;
00062 } aeMD2GLCmd;
00063 
00064 typedef struct aeMD2
00065 {
00066         aeTexture** skins;
00067         int numSkins;
00068 
00069         vec2* coords;
00070         int numCoords;
00071 
00072         aeMD2Triangle* tris;
00073         int numTris;
00074 
00075         aeMD2Frame* frames;
00076         int numFrames;
00077         int numVerts;
00078 
00079         int* glcmds;
00080         int numGLCmds;
00081 } aeMD2;
00082 
00083 void aeLoadMD2(aeMD2*,const char*);
00084 void aeRenderMD2FrameNoGlcmds(aeMD2*,int);
00085 void aeRenderMD2Frame(aeMD2*,int);
00086 void aeRenderMD2Interpolated(aeMD2*,int,int,float);
00087 
00088 #endif

Generated on Fri Jun 1 09:08:53 2007 for Antigone by  doxygen 1.4.7