]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
slight improvement to BIH recursion speeds by checking for box overlap
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 20 Feb 2010 13:31:40 +0000 (13:31 +0000)
committerRudolf Polzer <rpolzer@grawp.div0.qc.to>
Mon, 22 Feb 2010 17:28:21 +0000 (18:28 +0100)
on every node (in addition to the side check)

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9990 d7cf8633-e32d-0410-b094-e92efae38249
::stable-branch::merge=969efaea336f33793b6c35cea05f595f4d9e0f03

model_brush.c

index 1f382f92fcfcddc90b72f77d45ff4335ddb841ab..f64c7a73d88b01c5966e9de6b6d6f39358652bf4 100644 (file)
@@ -5760,7 +5760,7 @@ static void Mod_CollisionBIH_TraceLine_RecursiveBIHNode(trace_t *trace, dp_model
        while (nodenum >= 0)
        {
                node = model->collision_bih.nodes + nodenum;
-#if 0
+#if 1
                if (!BoxesOverlap(segmentmins, segmentmaxs, node->mins, node->maxs))
                        return;
 #endif
@@ -6009,11 +6009,11 @@ static void Mod_CollisionBIH_TraceBrush_RecursiveBIHNode(trace_t *trace, dp_mode
        {
                node = model->collision_bih.nodes + nodenum;
                axis = node->type - BIH_SPLITX;
-#if 0
-#if 0
+#if 1
                if (!BoxesOverlap(segmentmins, segmentmaxs, node->mins, node->maxs))
                        return;
 #endif
+#if 0
                Mod_CollisionBIH_TraceBrush_RecursiveBIHNode(trace, model, node->front, thisbrush_start, thisbrush_end, segmentmins, segmentmaxs);
                nodenum = node->back;
                continue;