+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]
+ // draw the model's sky polygons (only used by brush models)
+ void(*DrawSky)(struct entity_render_s *ent);
+ // draw the model using lightmap/dlight shading
+ void(*Draw)(struct entity_render_s *ent);
+ // draw a shadow volume for the model based on light source
+ void(*DrawShadowVolume)(struct entity_render_s *ent, vec3_t relativelightorigin, float lightradius);
+ // draw the lighting on a model (through stencil)
+ void(*DrawLight)(struct entity_render_s *ent, vec3_t relativelightorigin, vec3_t relativeeyeorigin, float lightradius, float *lightcolor, const matrix4x4_t *matrix_modeltofilter, const matrix4x4_t *matrix_modeltoattenuationxyz, const matrix4x4_t *matrix_modeltoattenuationz);
+ // trace a box against this model
+ void (*TraceBox)(struct model_s *model, int frame, struct trace_s *trace, const vec3_t boxstartmins, const vec3_t boxstartmaxs, const vec3_t boxendmins, const vec3_t boxendmaxs, int hitsupercontentsmask);
+ // fields belonging to each type of model
+ model_alias_t alias;
+ model_sprite_t sprite;
+ model_brush_t brush;
+ model_brushq1_t brushq1;
+ /* MSVC can't handle an empty struct, so this is commented out for now
+ model_brushq2_t brushq2;
+ */
+ model_brushq3_t brushq3;
+ // skin files can have different tags for each skin
+ overridetagnameset_t *data_overridetagnamesforskin;
+ // flags this model for offseting sounds to the model center (used by brush models)
+ int soundfromcenter;
+}
+model_t;