Fixed always adding a new node to AABBTree when updating a node.

This commit is contained in:
2019-02-25 12:51:26 -06:00
parent 97818c8a33
commit 0d7210b3f7
4 changed files with 14 additions and 12 deletions

View File

@@ -32,7 +32,6 @@ class IMICFPS
def update(object, bounding_box)
leaf = remove(object)
leaf.bounding_box = bounding_box
@objects[object] = leaf
insert_leaf(leaf)
end
@@ -50,7 +49,6 @@ class IMICFPS
def remove(object)
leaf = @objects.delete(object)
@root = @root.remove_subtree(leaf) if leaf
@root.parent = nil
return leaf
end