diff options
author | hanemile <hanemile@protonmail.com> | 2019-01-23 17:09:50 +0100 |
---|---|---|
committer | hanemile <hanemile@protonmail.com> | 2019-01-23 17:09:50 +0100 |
commit | b15789b178c339c04208c7234a78e7ee1d3bd501 (patch) | |
tree | e33e5ea7050ee8da41191f3a8826051358be3b05 | |
parent | a189ed58ad5fe9c8a4c55d58fe7f4af9a2a42d0d (diff) |
Added some debug information
-rw-r--r-- | quadtree.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/quadtree.go b/quadtree.go index 744389a..5ba232b 100644 --- a/quadtree.go +++ b/quadtree.go @@ -67,6 +67,7 @@ func (n *Node) Insert(star Star2D) error { // if a subtree is present, insert the star into that subtree if n.Subtrees != [4]*Node{} { + fmt.Printf("[ A ]\n") QuadrantBlocking := star.getRelativePositionInt(n.Boundry) err := n.Subtrees[QuadrantBlocking].Insert(star) if err != nil { @@ -75,8 +76,9 @@ func (n *Node) Insert(star Star2D) error { // directly insert the star into the node } else { + fmt.Printf("[ B ] (Direct insert if (%f, %f)\n)", star.C.X, star.C.Y) n.Star = star - fmt.Printf("Direct insert of (%f, %f)\n", star.C.X, star.C.Y) + return nil } // Move the star blocking the slot into it's subtree using a recursive call on this function @@ -85,6 +87,7 @@ func (n *Node) Insert(star Star2D) error { // if the node does not all ready have child nodes, subdivide it if n.Subtrees == ([4]*Node{}) { + fmt.Printf("[ C ] Sudivision\n") n.Subdivide() } |