Can now update AABBTree however something weird is happening where the tree grows for the same numbeer of objects...

This commit is contained in:
2019-02-25 09:35:01 -06:00
parent 5cf07ca620
commit d5a5ced955
9 changed files with 140 additions and 33 deletions

View File

@@ -0,0 +1,26 @@
class IMICFPS
# Gets included into AABBTree
module AABBTreeDebug
def inspect
@branches, @leaves = 0, 0
if @root
node = @root
debug_search(node.a)
debug_search(node.b)
end
puts "<#{self.class}:#{self.object_id}> has #{@branches} branches and #{@leaves} leaves"
end
def debug_search(node)
if node.leaf?
@leaves += 1
else
@branches += 1
debug_search(node.a)
debug_search(node.b)
end
end
end
end