2017-01-07 02:13:20 +00:00
|
|
|
#ifndef __IQM_H__
|
|
|
|
#define __IQM_H__
|
|
|
|
|
|
|
|
#define IQM_MAGIC "INTERQUAKEMODEL"
|
|
|
|
#define IQM_VERSION 2
|
|
|
|
|
|
|
|
struct iqmheader
|
|
|
|
{
|
2017-01-13 00:42:51 +00:00
|
|
|
char magic[16];
|
|
|
|
unsigned int version;
|
|
|
|
unsigned int filesize;
|
|
|
|
unsigned int flags;
|
|
|
|
unsigned int num_text, ofs_text;
|
|
|
|
unsigned int num_meshes, ofs_meshes;
|
|
|
|
unsigned int num_vertexarrays, num_vertexes, ofs_vertexarrays;
|
|
|
|
unsigned int num_triangles, ofs_triangles, ofs_adjacency;
|
|
|
|
unsigned int num_joints, ofs_joints;
|
|
|
|
unsigned int num_poses, ofs_poses;
|
|
|
|
unsigned int num_anims, ofs_anims;
|
|
|
|
unsigned int num_frames, num_framechannels, ofs_frames, ofs_bounds;
|
|
|
|
unsigned int num_comment, ofs_comment;
|
|
|
|
unsigned int num_extensions, ofs_extensions;
|
2017-01-07 02:13:20 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct iqmmesh
|
|
|
|
{
|
2017-01-13 00:42:51 +00:00
|
|
|
unsigned int name;
|
|
|
|
unsigned int material;
|
|
|
|
unsigned int first_vertex, num_vertexes;
|
|
|
|
unsigned int first_triangle, num_triangles;
|
2017-01-07 02:13:20 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
enum
|
|
|
|
{
|
2017-01-13 00:42:51 +00:00
|
|
|
IQM_POSITION = 0,
|
|
|
|
IQM_TEXCOORD = 1,
|
|
|
|
IQM_NORMAL = 2,
|
|
|
|
IQM_TANGENT = 3,
|
|
|
|
IQM_BLENDINDEXES = 4,
|
|
|
|
IQM_BLENDWEIGHTS = 5,
|
|
|
|
IQM_COLOR = 6,
|
|
|
|
IQM_CUSTOM = 0x10
|
2017-01-07 02:13:20 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
enum
|
|
|
|
{
|
2017-01-13 00:42:51 +00:00
|
|
|
IQM_BYTE = 0,
|
|
|
|
IQM_UBYTE = 1,
|
|
|
|
IQM_SHORT = 2,
|
|
|
|
IQM_USHORT = 3,
|
|
|
|
IQM_INT = 4,
|
|
|
|
IQM_UINT = 5,
|
|
|
|
IQM_HALF = 6,
|
|
|
|
IQM_FLOAT = 7,
|
|
|
|
IQM_DOUBLE = 8
|
2017-01-07 02:13:20 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct iqmtriangle
|
|
|
|
{
|
2017-01-13 00:42:51 +00:00
|
|
|
unsigned int vertex[3];
|
2017-01-07 02:13:20 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct iqmadjacency
|
|
|
|
{
|
2017-01-13 00:42:51 +00:00
|
|
|
unsigned int triangle[3];
|
2017-01-07 02:13:20 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct iqmjointv1
|
|
|
|
{
|
2017-01-13 00:42:51 +00:00
|
|
|
unsigned int name;
|
|
|
|
int parent;
|
|
|
|
float translate[3], rotate[3], scale[3];
|
2017-01-07 02:13:20 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct iqmjoint
|
|
|
|
{
|
2017-01-13 00:42:51 +00:00
|
|
|
unsigned int name;
|
|
|
|
int parent;
|
|
|
|
float translate[3], rotate[4], scale[3];
|
2017-01-07 02:13:20 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct iqmposev1
|
|
|
|
{
|
2017-01-13 00:42:51 +00:00
|
|
|
int parent;
|
|
|
|
unsigned int mask;
|
|
|
|
float channeloffset[9];
|
|
|
|
float channelscale[9];
|
2017-01-07 02:13:20 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct iqmpose
|
|
|
|
{
|
2017-01-13 00:42:51 +00:00
|
|
|
int parent;
|
|
|
|
unsigned int mask;
|
|
|
|
float channeloffset[10];
|
|
|
|
float channelscale[10];
|
2017-01-07 02:13:20 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct iqmanim
|
|
|
|
{
|
2017-01-13 00:42:51 +00:00
|
|
|
unsigned int name;
|
|
|
|
unsigned int first_frame, num_frames;
|
|
|
|
float framerate;
|
|
|
|
unsigned int flags;
|
2017-01-07 02:13:20 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
enum
|
|
|
|
{
|
2017-01-13 00:42:51 +00:00
|
|
|
IQM_LOOP = 1<<0
|
2017-01-07 02:13:20 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct iqmvertexarray
|
|
|
|
{
|
2017-01-13 00:42:51 +00:00
|
|
|
unsigned int type;
|
|
|
|
unsigned int flags;
|
|
|
|
unsigned int format;
|
|
|
|
unsigned int size;
|
|
|
|
unsigned int offset;
|
2017-01-07 02:13:20 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct iqmbounds
|
|
|
|
{
|
2017-01-13 00:42:51 +00:00
|
|
|
float bbmin[3], bbmax[3];
|
|
|
|
float xyradius, radius;
|
2017-01-07 02:13:20 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct iqmextension
|
|
|
|
{
|
2017-01-13 00:42:51 +00:00
|
|
|
unsigned int name;
|
|
|
|
unsigned int num_data, ofs_data;
|
|
|
|
unsigned int ofs_extensions; // pointer to next extension
|
2017-01-07 02:13:20 +00:00
|
|
|
};
|
|
|
|
|
2017-01-13 00:42:51 +00:00
|
|
|
struct iqmext_fte_mesh
|
|
|
|
{
|
|
|
|
unsigned int contents; //default CONTENTS_BODY
|
|
|
|
unsigned int surfaceflags; //propagates to trace_surfaceflags
|
|
|
|
unsigned int body; //the part of the body that this mesh is meant to be from
|
|
|
|
unsigned int geomset;
|
|
|
|
unsigned int geomid;
|
|
|
|
float mindist;
|
|
|
|
float maxdist;
|
|
|
|
};
|
|
|
|
struct iqmext_fte_events
|
|
|
|
{
|
|
|
|
unsigned int anim;
|
|
|
|
float timestamp;
|
|
|
|
unsigned int evcode;
|
|
|
|
unsigned int evdata_str;
|
|
|
|
};
|
2021-09-03 08:02:21 +00:00
|
|
|
|
|
|
|
|
|
|
|
//skin lump is made of 3 parts
|
|
|
|
struct iqmext_fte_skin
|
|
|
|
{
|
|
|
|
unsigned int nummeshskins;
|
|
|
|
unsigned int numskinframes;
|
|
|
|
//unsigned int numskins[nummeshes];
|
|
|
|
//iqmext_fte_skin_skinframe[numskinframes];
|
|
|
|
//iqmext_fte_skin_meshskin mesh0[numskins[0]];
|
|
|
|
//iqmext_fte_skin_meshskin mesh1[numskins[1]]; etc
|
|
|
|
};
|
|
|
|
struct iqmext_fte_skin_skinframe
|
|
|
|
{ //as many as needed
|
|
|
|
unsigned int material_idx;
|
|
|
|
unsigned int shadertext_idx;
|
|
|
|
};
|
|
|
|
struct iqmext_fte_skin_meshskin
|
|
|
|
{
|
|
|
|
unsigned int firstframe; //index into skinframes
|
|
|
|
unsigned int countframes; //skinframes
|
|
|
|
float interval;
|
|
|
|
};
|
2017-01-07 02:13:20 +00:00
|
|
|
#endif
|
|
|
|
|