From: Timo Kokkonen Date: Fri, 8 Jul 2011 08:49:32 +0000 (+0300) Subject: quadtree: Document subtree indexing X-Git-Url: http://git.itanic.dy.fi/?p=sdl-planets;a=commitdiff_plain;h=4e456bac7fba5ff042186565cf9c5bd06267d476 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 --- 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;