]> de.git.xonotic.org Git - xonotic/darkplaces.git/blob - model_zymotic.h
added viewzoom extension to QC and client (smooth sniper zooming, with sensitivity...
[xonotic/darkplaces.git] / model_zymotic.h
1
2 typedef struct zymlump_s
3 {
4         int start;
5         int length;
6 } zymlump_t;
7
8 typedef struct zymtype1header_s
9 {
10         char id[12]; // "ZYMOTICMODEL", length 12, no termination
11         int type; // 0 (vertex morph) 1 (skeletal pose) or 2 (skeletal scripted)
12         int filesize; // size of entire model file
13         float mins[3], maxs[3], radius; // for clipping uses
14         int numverts;
15         int numtris;
16         int numshaders;
17         int numbones; // this may be zero in the vertex morph format (undecided)
18         int numscenes; // 0 in skeletal scripted models
19
20 // skeletal pose header
21         // lump offsets are relative to the file
22         zymlump_t lump_scenes; // zymscene_t scene[numscenes]; // name and other information for each scene (see zymscene struct)
23         zymlump_t lump_poses; // float pose[numposes][numbones][6]; // animation data
24         zymlump_t lump_bones; // zymbone_t bone[numbones];
25         zymlump_t lump_vertbonecounts; // int vertbonecounts[numvertices]; // how many bones influence each vertex (separate mainly to make this compress better)
26         zymlump_t lump_verts; // zymvertex_t vert[numvertices]; // see vertex struct
27         zymlump_t lump_texcoords; // float texcoords[numvertices][2];
28         zymlump_t lump_render; // int renderlist[rendersize]; // sorted by shader with run lengths (int count), shaders are sequentially used, each run can be used with glDrawElements (each triangle is 3 int indices)
29         zymlump_t lump_shaders; // char shadername[numshaders][32]; // shaders used on this model
30         zymlump_t lump_trizone; // byte trizone[numtris]; // see trizone explanation
31 }
32 zymtype1header_t;
33
34 #define ZYMBONEFLAG_SHARED 1
35
36 typedef struct zymbone_s
37 {
38         char name[32];
39         int flags;
40         int parent; // parent bone number
41 }
42 zymbone_t;
43
44 // normally the scene will loop, if this is set it will stay on the final frame
45 #define ZYMSCENEFLAG_NOLOOP 1
46
47 typedef struct zymscene_s
48 {
49         char name[32];
50         float mins[3], maxs[3], radius; // for clipping
51         float framerate; // the scene will animate at this framerate (in frames per second)
52         int flags;
53         int start, length; // range of poses
54 }
55 zymscene_t;
56
57 typedef struct zymvertex_s
58 {
59         int bonenum;
60         float origin[3];
61 }
62 zymvertex_t;
63
64 extern void Mod_LoadZymoticModel (struct model_s *mod, void *buffer);