]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - bih.h
implemented and debugged BIH (Bounding Interval Hierarchy) code, more
[xonotic/darkplaces.git] / bih.h
diff --git a/bih.h b/bih.h
index 7a98045f5808e943fd7286d08eb70a2372a8c7da..56632b366fc4b0f6e31b3742f84cbce64df85aee 100644 (file)
--- a/bih.h
+++ b/bih.h
@@ -30,7 +30,11 @@ typedef struct bih_node_s
        float mins[3];
        float maxs[3];
        // < 0 is a leaf index (-1-leafindex), >= 0 is another node index (always >= this node's index)
-       int children[2];
+       int front;
+       int back;
+       // interval of children
+       float frontmin; // children[0]
+       float backmax; // children[1]
 }
 bih_node_t;
 
@@ -54,6 +58,10 @@ typedef struct bih_s
        // nodes are constructed by BIH_Build
        int numnodes;
        bih_node_t *nodes;
+       int rootnode; // 0 if numnodes > 0, -1 otherwise
+       // bounds calculated by BIH_Build
+       float mins[3];
+       float maxs[3];
 
        // fields used only during BIH_Build:
        int maxnodes;