From b15789b178c339c04208c7234a78e7ee1d3bd501 Mon Sep 17 00:00:00 2001 From: hanemile Date: Wed, 23 Jan 2019 17:09:50 +0100 Subject: Added some debug information --- quadtree.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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() } -- cgit 1.4.1