]> icculus.org git repositories - divverent/darkplaces.git/blob - model_iqm.h
allow bgmvolume to be > 1 to be able to exceed mastervolume (but this and other ...
[divverent/darkplaces.git] / model_iqm.h
1 #ifndef __MODEL_IQM_H__
2 #define __MODEL_IQM_H__
3
4 typedef struct iqmheader_s
5 {
6         char id[16];
7         unsigned int version;
8         unsigned int filesize;
9         unsigned int flags;
10         unsigned int num_text, ofs_text;
11         unsigned int num_meshes, ofs_meshes;
12         unsigned int num_vertexarrays, num_vertexes, ofs_vertexarrays;
13         unsigned int num_triangles, ofs_triangles, ofs_neighbors;
14         unsigned int num_joints, ofs_joints;
15         unsigned int num_poses, ofs_poses;
16         unsigned int num_anims, ofs_anims;
17         unsigned int num_frames, num_framechannels, ofs_frames, ofs_bounds;
18         unsigned int num_comment, ofs_comment;
19         unsigned int num_extensions, ofs_extensions;
20
21 iqmheader_t;
22
23 typedef struct iqmmesh_s
24 {
25         unsigned int name;
26         unsigned int material;
27         unsigned int first_vertex, num_vertexes;
28         unsigned int first_triangle, num_triangles;
29 }
30 iqmmesh_t;
31
32 #define IQM_POSITION        0
33 #define IQM_TEXCOORD        1
34 #define IQM_NORMAL          2
35 #define IQM_TANGENT         3
36 #define IQM_BLENDINDEXES    4
37 #define IQM_BLENDWEIGHTS    5
38 #define IQM_COLOR               6
39 #define IQM_CUSTOM          0x10
40
41 #define IQM_BYTE    0
42 #define IQM_UBYTE   1
43 #define IQM_SHORT   2
44 #define IQM_USHORT  3
45 #define IQM_INT     4
46 #define IQM_UINT    5
47 #define IQM_HALF    6
48 #define IQM_FLOAT   7
49 #define IQM_DOUBLE  8
50
51 // animflags
52 #define IQM_LOOP 1
53
54 typedef struct iqmtriangle_s
55 {
56         unsigned int vertex[3];
57 }
58 iqmtriangle_t;
59
60 typedef struct iqmjoint_s
61 {
62         unsigned int name;
63         signed int parent;
64         float origin[3], rotation[3], scale[3];
65 }
66 iqmjoint_t;
67
68 typedef struct iqmpose_s
69 {
70         signed int parent;
71         unsigned int channelmask;
72         float channeloffset[9], channelscale[9];
73 }
74 iqmpose_t;
75
76 typedef struct iqmanim_s
77 {
78         unsigned int name;
79         unsigned int first_frame, num_frames;
80         float framerate;
81         unsigned int flags;
82 }
83 iqmanim_t;
84
85 typedef struct iqmvertexarray_s
86 {
87         unsigned int type;
88         unsigned int flags;
89         unsigned int format;
90         unsigned int size;
91         unsigned int offset;
92 }
93 iqmvertexarray_t;
94
95 typedef struct iqmextension_s
96 {
97     unsigned int name;
98     unsigned int num_data, ofs_data;
99     unsigned int ofs_extensions; // pointer to next extension
100 }
101 iqmextension_t;
102
103 typedef struct iqmbounds_s
104 {
105         float mins[3], maxs[3];
106         float xyradius, radius;
107 }
108 iqmbounds_t;
109     
110 #endif
111