CorentinTh / quadtree-js

A simple quadtree implementation for javascript and typescript (nodejs or browser).
MIT License
75 stars 6 forks source link

Update tree #16

Closed manix closed 4 years ago

manix commented 4 years ago

What do I need to do after changing a point's coordinates so that the tree updates?

CorentinTh commented 4 years ago

Hi @manix Thank you for your interrest in my Quadtree.

If you change a point coordinates, the best way to update the Quadtree is to remove the point and reinsert it. If all you point may have changed, you can clear the quadtree and reinsert them.

Removing and inserting point are rather cheap operations.