// walk the tree until we hit a leaf, recursing for any split cases
while (node->plane)
{
+#if 0
+ if (!BoxesOverlap(segmentmins, segmentmaxs, node->mins, node->maxs))
+ return;
+ Mod_Q3BSP_TraceLine_RecursiveBSPNode(trace, model, node->children[0], start, end, startfrac, endfrac, linestart, lineend, markframe, segmentmins, segmentmaxs);
+ node = node->children[1];
+#else
// abort if this part of the bsp tree can not be hit by this trace
// if (!(node->combinedsupercontents & trace->hitsupercontentsmask))
// return;
Mod_Q3BSP_TraceLine_RecursiveBSPNode(trace, model, node->children[endside], mid, end, midfrac, endfrac, linestart, lineend, markframe, segmentmins, segmentmaxs);
return;
}
+#endif
}
// abort if this part of the bsp tree can not be hit by this trace
// if (!(node->combinedsupercontents & trace->hitsupercontentsmask))
nodesegmentmaxs[2] = max(start[2], end[2]) + 1;
// line trace the brushes
leaf = (mleaf_t *)node;
+#if 0
+ if (!BoxesOverlap(segmentmins, segmentmaxs, leaf->mins, leaf->maxs))
+ return;
+#endif
for (i = 0;i < leaf->numleafbrushes;i++)
{
brush = model->brush.data_brushes[leaf->firstleafbrush[i]].colbrushf;
// walk the tree until we hit a leaf, recursing for any split cases
while (node->plane)
{
+#if 0
+ if (!BoxesOverlap(segmentmins, segmentmaxs, node->mins, node->maxs))
+ return;
+ Mod_Q3BSP_TraceBrush_RecursiveBSPNode(trace, model, node->children[0], thisbrush_start, thisbrush_end, markframe, segmentmins, segmentmaxs);
+ node = node->children[1];
+#else
// abort if this part of the bsp tree can not be hit by this trace
// if (!(node->combinedsupercontents & trace->hitsupercontentsmask))
// return;
return; // ERROR: NAN bounding box!
// take whichever side the segment box is on
node = node->children[sides - 1];
+#endif
}
// abort if this part of the bsp tree can not be hit by this trace
// if (!(node->combinedsupercontents & trace->hitsupercontentsmask))
nodesegmentmaxs[2] = min(segmentmaxs[2], node->maxs[2] + 1);
// hit a leaf
leaf = (mleaf_t *)node;
+#if 0
+ if (!BoxesOverlap(segmentmins, segmentmaxs, leaf->mins, leaf->maxs))
+ return;
+#endif
for (i = 0;i < leaf->numleafbrushes;i++)
{
brush = model->brush.data_brushes[leaf->firstleafbrush[i]].colbrushf;