]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - model_shared.h
speed up decal creation in newdecalsystem by using BIH for finding the affected triangles
[xonotic/darkplaces.git] / model_shared.h
index eca7ef39dfa6dc9081d412c3b855d74ad671b921..8b15a6ef46cc1978d3ff54161dfd733f6442eb4b 100644 (file)
@@ -283,7 +283,10 @@ typedef enum q3wavefunc_e
        Q3WAVEFUNC_TRIANGLE,
        Q3WAVEFUNC_COUNT
 }
-q3wavefunc_t;
+q3wavefunc_e;
+typedef int q3wavefunc_t;
+#define Q3WAVEFUNC_USER_COUNT 4
+#define Q3WAVEFUNC_USER_SHIFT 8 // use 8 bits for wave func type
 
 typedef enum q3deform_e
 {
@@ -957,6 +960,7 @@ typedef struct model_s
        int                             nummodelbrushes;
        // BIH (Bounding Interval Hierarchy) for this (sub)model
        bih_t                   collision_bih;
+       bih_t                   render_bih; // if not set, use collision_bih instead for rendering purposes too
        // for md3 models
        int                             num_tags;
        int                             num_tagframes;
@@ -1166,7 +1170,7 @@ void Mod_CollisionBIH_TraceLine(dp_model_t *model, const struct frameblend_s *fr
 void Mod_CollisionBIH_TraceBox(dp_model_t *model, const struct frameblend_s *frameblend, const skeleton_t *skeleton, struct trace_s *trace, const vec3_t start, const vec3_t boxmins, const vec3_t boxmaxs, const vec3_t end, int hitsupercontentsmask);
 void Mod_CollisionBIH_TracePoint_Mesh(dp_model_t *model, const struct frameblend_s *frameblend, const skeleton_t *skeleton, struct trace_s *trace, const vec3_t start, int hitsupercontentsmask);
 int Mod_CollisionBIH_PointSuperContents_Mesh(struct model_s *model, int frame, const vec3_t point);
-void Mod_MakeCollisionBIH(dp_model_t *model, qboolean userendersurfaces);
+bih_t *Mod_MakeCollisionBIH(dp_model_t *model, qboolean userendersurfaces, bih_t *out);
 
 // alias models
 struct frameblend_s;