+typedef struct q3mface_s
+{
+ struct q3mtexture_s *texture;
+ struct q3meffect_s *effect;
+ rtexture_t *lightmaptexture;
+ int collisions; // performs per triangle collisions on this surface
+ int collisionmarkframe; // don't collide twice in one trace
+ int type;
+ int firstvertex;
+ int firstelement;
+ int patchsize[2];
+ // used for processing
+ int markframe;
+ // (world only) visframe == r_framecount means it is visible this frame
+ int visframe;
+ // bounding box for culling
+ float mins[3];
+ float maxs[3];
+
+ int num_vertices;
+ int num_triangles;
+ float *data_vertex3f;
+ float *data_texcoordtexture2f;
+ float *data_texcoordlightmap2f;
+ float *data_svector3f;
+ float *data_tvector3f;
+ float *data_normal3f;
+ float *data_color4f;
+ int *data_element3i;
+ int *data_neighbor3i;
+}
+q3mface_t;
+
+typedef struct model_brushq3_s
+{
+ // if non-zero this is a submodel
+ // (this is the number of the submodel, an index into data_models)
+ int submodel;
+
+ int num_textures;
+ q3mtexture_t *data_textures;
+
+ int num_planes;
+ mplane_t *data_planes;
+
+ int num_nodes;
+ q3mnode_t *data_nodes;
+
+ int num_leafs;
+ q3mleaf_t *data_leafs;
+
+ int num_leafbrushes;
+ q3mbrush_t **data_leafbrushes;
+
+ int num_leaffaces;
+ q3mface_t **data_leaffaces;
+
+ int num_models;
+ q3mmodel_t *data_models;
+ // each submodel gets its own model struct so this is different for each.
+ q3mmodel_t *data_thismodel;
+
+ int num_brushes;
+ q3mbrush_t *data_brushes;
+
+ int num_brushsides;
+ q3mbrushside_t *data_brushsides;
+
+ int num_vertices;
+ float *data_vertex3f;
+ float *data_texcoordtexture2f;
+ float *data_texcoordlightmap2f;
+ float *data_svector3f;
+ float *data_tvector3f;
+ float *data_normal3f;
+ float *data_color4f;
+
+ int num_triangles;
+ int *data_element3i;
+ int *data_neighbor3i;
+
+ int num_effects;
+ q3meffect_t *data_effects;
+
+ int num_faces;
+ q3mface_t *data_faces;
+
+ // lightmap textures
+ int num_lightmaps;
+ rtexture_t **data_lightmaps;
+
+ // voxel light data with directional shading
+ int num_lightgrid;
+ q3dlightgrid_t *data_lightgrid;
+ // size of each cell (may vary by map, typically 64 64 128)
+ float num_lightgrid_cellsize[3];
+ // 1.0 / num_lightgrid_cellsize
+ float num_lightgrid_scale[3];
+ // dimensions of the world model in lightgrid cells
+ int num_lightgrid_imins[3];
+ int num_lightgrid_imaxs[3];
+ int num_lightgrid_isize[3];
+ // indexing/clamping
+ int num_lightgrid_dimensions[3];
+ // transform modelspace coordinates to lightgrid index
+ matrix4x4_t num_lightgrid_indexfromworld;
+
+ // pvs
+ int num_pvsclusters;
+ int num_pvschainlength;
+ unsigned char *data_pvschains;
+ // example
+ //pvschain = model->brushq3.data_pvschains + mycluster * model->brushq3.num_pvschainlength;
+ //if (pvschain[thatcluster >> 3] & (1 << (thatcluster & 7)))
+}
+model_brushq3_t;
+
+typedef struct model_s
+{
+ // name and path of model, for example "progs/player.mdl"
+ char name[MAX_QPATH];
+ // model needs to be loaded if this is true
+ qboolean needload;
+ // set if the model is used in current map, models which are not, are purged
+ qboolean used;
+ // true if this is the world model (I.E. defines what sky to use, and may contain submodels)
+ qboolean isworldmodel;
+ // CRC of the file this model was loaded from, to reload if changed
+ unsigned int crc;
+ // mod_brush, mod_alias, mod_sprite
+ modtype_t type;
+ // memory pool for allocations
+ mempool_t *mempool;
+ // all models use textures...
+ rtexturepool_t *texturepool;
+ // flags from the model file
+ int flags;
+ // engine calculated flags, ones that can not be set in the file
+ int flags2;
+ // LordHavoc: if true (normally only for sprites) the model/sprite/bmodel is always rendered fullbright
+ int fullbright;
+ // number of QC accessible frame(group)s in the model
+ int numframes;
+ // number of QC accessible skin(group)s in the model
+ int numskins;
+ // whether to randomize animated framegroups
+ synctype_t synctype;
+ // bounding box at angles '0 0 0'
+ vec3_t normalmins, normalmaxs;
+ // bounding box if yaw angle is not 0, but pitch and roll are
+ vec3_t yawmins, yawmaxs;
+ // bounding box if pitch or roll are used
+ vec3_t rotatedmins, rotatedmaxs;
+ // sphere radius, usable at any angles
+ float radius;
+ // squared sphere radius for easier comparisons
+ float radius2;
+ // skin animation info
+ animscene_t *skinscenes; // [numskins]
+ // skin animation info
+ animscene_t *animscenes; // [numframes]