From 2656f263b1d0edf7e7da9874e7789e7d3df27773 Mon Sep 17 00:00:00 2001 From: uis Date: Sun, 21 Apr 2024 03:59:09 +0300 Subject: [PATCH] Reduce BIH node size by 32 bytes --- bih.h | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/bih.h b/bih.h index 4be1564f..90e361ff 100644 --- a/bih.h +++ b/bih.h @@ -39,14 +39,18 @@ typedef struct bih_node_s // TODO: move bounds data to parent node and remove it from leafs? float mins[3]; float maxs[3]; - // node indexes of children (always > this node's index) - int front; - int back; - // interval of children - float frontmin; // children[0] - float backmax; // children[1] - // BIH_UNORDERED uses this for a list of leafindex (all >= 0), -1 = end of list - int children[BIH_MAXUNORDEREDCHILDREN]; + union { + struct{ + // node indexes of children (always > this node's index) + int front; + int back; + // interval of children + float frontmin; // children[0] + float backmax; // children[1] + }; + // BIH_UNORDERED uses this for a list of leafindex (all >= 0), -1 = end of list + int children[BIH_MAXUNORDEREDCHILDREN]; + }; } bih_node_t; -- 2.39.2