diff options
author | hanemile <hanemile@protonmail.com> | 2018-10-30 15:31:27 +0100 |
---|---|---|
committer | hanemile <hanemile@protonmail.com> | 2018-10-30 15:31:27 +0100 |
commit | 28391110d2e992e148f23934deb95fd208f1ae8d (patch) | |
tree | ce62211e46cb2ee03a9814875e3e2b431bab3f7c /structs/structs.go | |
parent | 1f1679b276ae1f9f0dccf9fe7572666132b57023 (diff) |
added the quadtree structure defining a quadtree and it's node at the
same time by using recursion.
Diffstat (limited to 'structs/structs.go')
-rw-r--r-- | structs/structs.go | 12 |
1 files changed, 12 insertions, 0 deletions
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 +} |