]> de.git.xonotic.org Git - xonotic/netradiant.git/blob - contrib/pk3man/md3.h
* added pk3man and fixed it to compile for latest radiant
[xonotic/netradiant.git] / contrib / pk3man / md3.h
1 // MD3 file headers
2
3
4 typedef struct
5 {
6         char ID[4];         //id of file, always "IDP3"
7         int  Version;       //i suspect this is a version
8                                                 //number, always 15
9         char FileName[68];      //sometimes left Blank...
10                                                 //65 chars, 32bit aligned ==
11                                                 //68 chars
12         int  BoneFrame_num; //number of BoneFrames
13         int  Tag_num;       //number of 'tags' per BoneFrame
14         int  Mesh_num;      //number of meshes/skins
15         int  MaxSkin_num;   //maximum number of unique skins
16                                                 //used in md3 file
17         int  HeaderLength;  //always equal to the length of
18                                                 //this header
19         int  Tag_Start;     //starting position of
20                                                 //tag-structures
21         int  Tag_End;           //ending position of
22                                                 //tag-structures/starting
23                                                 //position of mesh-structures
24         int  FileSize;          //size of file
25 } md3_header_t;
26
27
28 typedef struct
29 {
30         char Name[64];          //name of 'tag' as it's usually
31                                                 //called in the md3 files try to
32                                                 //see it as a sub-mesh/seperate
33                                                 //mesh-part.
34                                                 //sometimes this 64 string may
35                                                 //contain some garbage, but
36                                                 //i've been told this is because
37                                                 //some tools leave garbage in
38                                                 //those strings, but they ARE
39                                                 //strings...
40         float Postition[3]; //relative position of tag
41         float Rotation[3][3];   //the direction the tag is facing relative to the rest of the model
42 } md3_tag_t;
43
44
45 typedef struct
46 {
47         //unverified:
48         float  Mins[3];
49         float  Maxs[3];
50         float  Position[3];
51         float  scale;
52         char   Creator[16];     //i think this is the
53                                 //"creator" name..
54                                 //but i'm only guessing.
55 } md3_boneframe_t;
56
57
58 typedef struct
59 {
60         char ID[4];             //id, must be IDP3
61         char Name[68];          //name of mesh
62                                 //65 chars,
63                                 //32 bit aligned == 68 chars
64         int  MeshFrame_num;     //number of meshframes
65                                 //in mesh
66         int  Skin_num;          //number of skins in mesh
67         int  Vertex_num;        //number of vertices
68         int  Triangle_num;      //number of Triangles
69         int  Triangle_Start;    //starting position of
70                                 //Triangle data, relative
71                                 //to start of Mesh_Header
72         int  HeaderSize;        //size of header
73         int  TexVec_Start;      //starting position of
74                                 //texvector data, relative
75                                 //to start of Mesh_Header
76         int  Vertex_Start;      //starting position of
77                                 //vertex data,relative
78                                 //to start of Mesh_Header
79         int  MeshSize;          //size of mesh
80 } md3_mesh_t;
81
82
83 typedef struct
84 {
85         char Name[68];  //name of skin used by mesh
86                         //65 chars,
87                         //32 bit aligned == 68 chars
88 } md3_skin_t;
89
90
91 typedef struct
92 {
93         int  Triangle[3];       //vertex 1,2,3 of triangle
94
95 } md3_triangles_t;
96
97
98 typedef struct
99 {
100         float  TexVec[2];       //Texture U/V coordinates of vertex
101
102 } md3_texcoords_t;
103
104
105 typedef struct
106 {
107         //!!!important!!! signed!
108         signed short Vec[3];            //vertex X/Y/Z coordinate
109         unsigned char EnvTex[2];        //enviromental mapping texture coordinates
110
111 } md3_vertices_t;