X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=model_shared.h;h=d1d11e2355fdecfd21cf07625b2b046a0dde1bcc;hb=8a12613ca05c0ceb6420751690abf2563b31f333;hp=1d6b78e55371728bfaed6e799e4ba53d5859d2fe;hpb=e24d834dcbcc61f28fdf0e2c1ba75693d9e23ed1;p=xonotic%2Fdarkplaces.git diff --git a/model_shared.h b/model_shared.h index 1d6b78e5..d1d11e23 100644 --- a/model_shared.h +++ b/model_shared.h @@ -154,13 +154,14 @@ typedef struct model_brush_s // common functions int (*SuperContentsFromNativeContents)(struct model_s *model, int nativecontents); int (*NativeContentsFromSuperContents)(struct model_s *model, int supercontents); - void (*AmbientSoundLevelsForPoint)(struct model_s *model, const vec3_t p, qbyte *out, int outsize); + 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); 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); void (*TraceBox)(struct model_s *model, struct trace_s *trace, const vec3_t boxstartmins, const vec3_t boxstartmaxs, const vec3_t boxendmins, const vec3_t boxendmaxs, int hitsupercontentsmask); - // this is actually only found on brushq1, but NULL is handled gracefully + // these are actually only found on brushq1, but NULL is handled gracefully + void (*AmbientSoundLevelsForPoint)(struct model_s *model, const vec3_t p, qbyte *out, int outsize); void (*RoundUpToHullSize)(struct model_s *cmodel, const vec3_t inmins, const vec3_t inmaxs, vec3_t outmins, vec3_t outmaxs); } model_brush_t; @@ -201,7 +202,6 @@ typedef struct model_brushq1_s int *surfacepvsframes; msurface_t *surfacepvsnext; surfmesh_t *entiremesh; - surfmesh_t *surfmeshes; int numsurfedges; int *surfedges; @@ -268,6 +268,7 @@ model_brushq2_t; */ #define Q3MTEXTURERENDERFLAGS_NODRAW 1 +#define Q3MTEXTURERENDERFLAGS_SKY 2 typedef struct q3mtexture_s { @@ -284,8 +285,12 @@ q3mtexture_t; typedef struct q3mnode_s { + //this part shared between node and leaf int isnode; // true struct q3mnode_s *parent; + vec3_t mins; + vec3_t maxs; + // this part unique to nodes struct mplane_s *plane; struct q3mnode_s *children[2]; } @@ -293,16 +298,18 @@ q3mnode_t; typedef struct q3mleaf_s { + //this part shared between node and leaf int isnode; // false struct q3mnode_s *parent; + vec3_t mins; + vec3_t maxs; + // this part unique to leafs int clusterindex; int areaindex; int numleaffaces; struct q3mface_s **firstleafface; int numleafbrushes; struct q3mbrush_s **firstleafbrush; - vec3_t mins; - vec3_t maxs; } q3mleaf_t; @@ -346,13 +353,22 @@ 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 numvertices; int firstelement; - int numelements; 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; @@ -360,7 +376,6 @@ typedef struct q3mface_s float *data_tvector3f; float *data_normal3f; float *data_color4f; - int numtriangles; int *data_element3i; int *data_neighbor3i; } @@ -368,6 +383,10 @@ 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; @@ -494,8 +513,6 @@ typedef struct model_s void(*DrawSky)(struct entity_render_s *ent); // draw the model using lightmap/dlight shading void(*Draw)(struct entity_render_s *ent); - // draw a fake shadow for the model - void(*DrawFakeShadow)(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) @@ -523,6 +540,8 @@ extern rtexture_t *mod_shared_detailtextures[NUM_DETAILTEXTURES]; // every texture must be in a pool... extern rtexturepool_t *mod_shared_texturepool; +extern rtexture_t *mod_shared_distorttexture[64]; + // model loading extern model_t *loadmodel; extern qbyte *mod_base; @@ -590,5 +609,7 @@ skinfile_t *Mod_LoadSkinFiles(void); void Mod_FreeSkinFiles(skinfile_t *skinfile); int Mod_CountSkinFiles(skinfile_t *skinfile); +int Mod_RemoveDegenerateTriangles(int numtriangles, const int *inelement3i, int *outelement3i, const float *vertex3f); + #endif // __MODEL__