From 4e456bac7fba5ff042186565cf9c5bd06267d476 Mon Sep 17 00:00:00 2001 From: Timo Kokkonen Date: Fri, 8 Jul 2011 11:49:32 +0300 Subject: [PATCH] quadtree: Document subtree indexing As stupid as it might sound, I forgot how the subtrees are indexed in spatially. Therefore it might make sense to simply document even the trivial things in the header file to avoid future confusion. Signed-off-by: Timo Kokkonen --- quadtree.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/quadtree.h b/quadtree.h index aef487e..45478fa 100644 --- a/quadtree.h +++ b/quadtree.h @@ -8,6 +8,14 @@ struct quadtree { struct vector pos; + + /* + * Each node divide the sub-tree in following quadtrants: + * + * up left (0) | up right (1) + * ----------------------------- + * down left (2) | down right (3) + */ struct quadtree *child[4]; struct quadtree *parent; -- 2.45.0