OpenMoHAA 0.82.0
Loading...
Searching...
No Matches
iqm.h
1/*
2===========================================================================
3This file is part of Quake III Arena source code.
4
5Quake III Arena source code is free software; you can redistribute it
6and/or modify it under the terms of the GNU General Public License as
7published by the Free Software Foundation; either version 2 of the License,
8or (at your option) any later version.
9
10Quake III Arena source code is distributed in the hope that it will be
11useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
12MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13GNU General Public License for more details.
14
15You should have received a copy of the GNU General Public License
16along with Quake III Arena source code; if not, write to the Free Software
17Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18===========================================================================
19*/
20
21#ifndef __IQM_H__
22#define __IQM_H__
23
24#define IQM_MAGIC "INTERQUAKEMODEL"
25#define IQM_VERSION 2
26
27#define IQM_MAX_JOINTS 128
28
29typedef struct iqmheader
30{
31 char magic[16];
32 unsigned int version;
33 unsigned int filesize;
34 unsigned int flags;
35 unsigned int num_text, ofs_text;
36 unsigned int num_meshes, ofs_meshes;
37 unsigned int num_vertexarrays, num_vertexes, ofs_vertexarrays;
38 unsigned int num_triangles, ofs_triangles, ofs_adjacency;
39 unsigned int num_joints, ofs_joints;
40 unsigned int num_poses, ofs_poses;
41 unsigned int num_anims, ofs_anims;
42 unsigned int num_frames, num_framechannels, ofs_frames, ofs_bounds;
43 unsigned int num_comment, ofs_comment;
44 unsigned int num_extensions, ofs_extensions;
45} iqmHeader_t;
46
47typedef struct iqmmesh
48{
49 unsigned int name;
50 unsigned int material;
51 unsigned int first_vertex, num_vertexes;
52 unsigned int first_triangle, num_triangles;
53} iqmMesh_t;
54
55enum
56{
57 IQM_POSITION = 0,
58 IQM_TEXCOORD = 1,
59 IQM_NORMAL = 2,
60 IQM_TANGENT = 3,
61 IQM_BLENDINDEXES = 4,
62 IQM_BLENDWEIGHTS = 5,
63 IQM_COLOR = 6,
64 IQM_CUSTOM = 0x10
65};
66
67enum
68{
69 IQM_BYTE = 0,
70 IQM_UBYTE = 1,
71 IQM_SHORT = 2,
72 IQM_USHORT = 3,
73 IQM_INT = 4,
74 IQM_UINT = 5,
75 IQM_HALF = 6,
76 IQM_FLOAT = 7,
77 IQM_DOUBLE = 8,
78};
79
80typedef struct iqmtriangle
81{
82 unsigned int vertex[3];
83} iqmTriangle_t;
84
85typedef struct iqmjoint
86{
87 unsigned int name;
88 int parent;
89 float translate[3], rotate[4], scale[3];
90} iqmJoint_t;
91
92typedef struct iqmpose
93{
94 int parent;
95 unsigned int mask;
96 float channeloffset[10];
97 float channelscale[10];
98} iqmPose_t;
99
100typedef struct iqmanim
101{
102 unsigned int name;
103 unsigned int first_frame, num_frames;
104 float framerate;
105 unsigned int flags;
106} iqmAnim_t;
107
108enum
109{
110 IQM_LOOP = 1<<0
111};
112
113typedef struct iqmvertexarray
114{
115 unsigned int type;
116 unsigned int flags;
117 unsigned int format;
118 unsigned int size;
119 unsigned int offset;
120} iqmVertexArray_t;
121
122typedef struct iqmbounds
123{
124 float bbmin[3], bbmax[3];
125 float xyradius, radius;
126} iqmBounds_t;
127
128#endif
129
Definition iqm.h:101
Definition iqm.h:123
Definition iqm.h:30
Definition iqm.h:86
Definition iqm.h:48
Definition iqm.h:93
Definition iqm.h:81
Definition iqm.h:114