int num_surfaces;
msurface_t *data_surfaces;
+ int num_brushes;
+ q3mbrush_t *data_brushes;
+
+ int num_brushsides;
+ q3mbrushside_t *data_brushsides;
+
// pvs
int num_pvsclusters;
int num_pvsclusterbytes;
qbyte *(*GetPVS)(struct model_s *model, const vec3_t p);
int (*FatPVS)(struct model_s *model, const vec3_t org, vec_t radius, qbyte *pvsbuffer, int pvsbufferlength);
int (*BoxTouchingPVS)(struct model_s *model, const qbyte *pvs, const vec3_t mins, const vec3_t maxs);
+ int (*BoxTouchingVisibleLeafs)(struct model_s *model, const qbyte *visibleleafs, const vec3_t mins, const vec3_t maxs);
void (*LightPoint)(struct model_s *model, const vec3_t p, vec3_t ambientcolor, vec3_t diffusecolor, vec3_t diffusenormal);
void (*FindNonSolidLocation)(struct model_s *model, const vec3_t in, vec3_t out, vec_t radius);
// these are actually only found on brushq1, but NULL is handled gracefully
typedef struct model_brushq3_s
{
int num_models;
- q3mmodel_t *data_models;
-
- int num_brushes;
- q3mbrush_t *data_brushes;
-
- int num_brushsides;
- q3mbrushside_t *data_brushsides;
+ q3dmodel_t *data_models;
// freed after loading!
int num_vertices;
int *data_element3i;
int num_effects;
- q3meffect_t *data_effects;
+ q3deffect_t *data_effects;
// lightmap textures
int num_lightmaps;
// range of surface numbers in this (sub)model
int firstmodelsurface;
int nummodelsurfaces;
+ // range of collision brush numbers in this (sub)model
+ int firstmodelbrush;
+ int nummodelbrushes;
// list of surface numbers in this (sub)model
int *surfacelist;
// surface meshes are merged to a smaller set of meshes to allow reduced
// gathers info on which clusters and surfaces are lit by light, as well as calculating a bounding box
void(*GetLightInfo)(struct entity_render_s *ent, vec3_t relativelightorigin, float lightradius, vec3_t outmins, vec3_t outmaxs, int *outclusterlist, qbyte *outclusterpvs, int *outnumclusterspointer, int *outsurfacelist, qbyte *outsurfacepvs, int *outnumsurfacespointer);
// draw a shadow volume for the model based on light source
- void(*DrawShadowVolume)(struct entity_render_s *ent, vec3_t relativelightorigin, float lightradius, int numsurfaces, const int *surfacelist);
+ void(*DrawShadowVolume)(struct entity_render_s *ent, vec3_t relativelightorigin, float lightradius, int numsurfaces, const int *surfacelist, const vec3_t lightmins, const vec3_t lightmaxs);
// 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_modeltolight, const matrix4x4_t *matrix_modeltoattenuationxyz, const matrix4x4_t *matrix_modeltoattenuationz, rtexture_t *lightcubemap, vec_t ambientscale, vec_t diffusescale, vec_t specularscale, int numsurfaces, const int *surfacelist);
// trace a box against this model
//============================================================================
// this can be used for anything without a valid texture
-extern rtexture_t *r_notexture;
+extern rtexture_t *r_texture_notexture;
#define NUM_DETAILTEXTURES 1
extern rtexture_t *mod_shared_detailtextures[NUM_DETAILTEXTURES];
// every texture must be in a pool...