2 Copyright (C) 1996-1997 Id Software, Inc.
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public License
6 as published by the Free Software Foundation; either version 2
7 of the License, or (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 See the GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
26 typedef enum {ST_SYNC=0, ST_RAND } synctype_t;
31 d*_t structures are on-disk representations
32 m*_t structures are in-memory
36 typedef enum {mod_brush, mod_sprite, mod_alias} modtype_t;
38 #include "model_brush.h"
39 #include "model_sprite.h"
40 #include "model_alias.h"
42 typedef struct model_s
45 qboolean needload; // bmodels and sprites don't cache normally
48 int aliastype; // LordHavoc: Q2 model support
49 int fullbright; // LordHavoc: if true (normally only for sprites) the model/sprite/bmodel is always rendered fullbright
55 // volume occupied by the model graphics
59 // solid volume for clipping
61 vec3_t clipmins, clipmaxs;
64 int firstmodelsurface, nummodelsurfaces;
72 int numleafs; // number of visible leafs, not counting 0
94 dclipnode_t *clipnodes;
97 msurface_t **marksurfaces;
99 hull_t hulls[MAX_MAP_HULLS];
102 texture_t **textures;
108 // additional model data
109 cache_user_t cache; // only access through Mod_Extradata
113 //============================================================================
115 void Mod_Init (void);
116 void Mod_ClearAll (void);
117 model_t *Mod_ForName (char *name, qboolean crash);
118 void *Mod_Extradata (model_t *mod); // handles caching
119 void Mod_TouchModel (char *name);
121 mleaf_t *Mod_PointInLeaf (float *p, model_t *model);
122 byte *Mod_LeafPVS (mleaf_t *leaf, model_t *model);
124 extern model_t *loadmodel;
125 extern char loadname[32]; // for hunk tags
127 extern model_t *Mod_LoadModel (model_t *mod, qboolean crash);
129 extern float RadiusFromBounds (vec3_t mins, vec3_t maxs);
130 extern model_t *Mod_FindName (char *name);