summaryrefslogtreecommitdiffstats
path: root/libdimension/prtree.h
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@gmail.com>2010-05-20 22:16:03 -0600
committerTavian Barnes <tavianator@gmail.com>2010-05-20 22:16:03 -0600
commit6592197ee64e1a1d4f1c7db3573895ddce617571 (patch)
tree75a3f0a40ae9d48dfe499f001171fa0a31cc89dc /libdimension/prtree.h
parentd1e94994f75466ab207322f59847ac0f359f46b8 (diff)
downloaddimension-6592197ee64e1a1d4f1c7db3573895ddce617571.tar.xz
Store the bounding boxes of child PR-tree nodes in the parent.
This improves cache locality and is good for about a 10% performance boost.
Diffstat (limited to 'libdimension/prtree.h')
-rw-r--r--libdimension/prtree.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/libdimension/prtree.h b/libdimension/prtree.h
index 1f2dd29..eab359d 100644
--- a/libdimension/prtree.h
+++ b/libdimension/prtree.h
@@ -34,12 +34,12 @@
#define DMNSN_PRTREE_B 6
typedef struct dmnsn_prtree_node {
+ dmnsn_bounding_box bounding_box;
+
/* Children (objects or subtrees) */
- void *children[DMNSN_PRTREE_B];
bool is_leaf;
-
- /* Bounding box */
- dmnsn_bounding_box bounding_box;
+ void *children[DMNSN_PRTREE_B];
+ dmnsn_bounding_box bounding_boxes[DMNSN_PRTREE_B];
} dmnsn_prtree_node;
typedef struct dmnsn_prtree {