]> de.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)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 20 Feb 2010 13:31:40 +0000 (13:31 +0000)
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

model_brush.c

index 2f7caae247973d4d86ed8c5910996d4a7ccc3299..ca0f454b9454160d6c9c29ca60d76997bcf1ab65 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;