From 28391110d2e992e148f23934deb95fd208f1ae8d Mon Sep 17 00:00:00 2001 From: hanemile Date: Tue, 30 Oct 2018 15:31:27 +0100 Subject: added the quadtree structure defining a quadtree and it's node at the same time by using recursion. --- structs/structs.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'structs/structs.go') diff --git a/structs/structs.go b/structs/structs.go index b4b550a..ea99d96 100644 --- a/structs/structs.go +++ b/structs/structs.go @@ -31,3 +31,15 @@ func (boundingBox *boundingBox) containsPoint(point coord) bool { // the point is outside of the cell -> return false return false } + +// quadtree defining the whole quadtree and a node in itself (recursively) +type quadtree struct { + nodeCapacity int + boundary boundingBox + + // the quadtree leaves + northWest *quadtree + northEast *quadtree + southWest *quadtree + southEast *quadtree +} -- cgit 1.4.1