Construct a new quad tree.
Overall bounds of the quad tree
Max entries a quad can contain until it has to be subdivided
Max subdivision depth. A quad will not be subdivided further if this value
is met - even if maxEntriesPerQuad
is exceeded
Try to add an entry to the quad tree.
Entry to add
true
if the entry was added, false
if the entry was outside quad tree bounds
Clear the quad tree.
Delete an entry from the quad tree.
Entry to delete (via reference comparison)
If true
, try to merge quads after the deletion
true
if entry
was deleted
Traverses the whole tree to ensure the entry is deleted. If the entry's position and size has not changed, use QuadTree.deleteSpatial for a delete that uses the quad tree's fast spatial query.
Delete an entry from the quad tree.
Entry to delete (via reference comparison)
If true
, try to merge quads after the deletion
true
if entry
was deleted
If the entry's position or shape has changed, use QuadTree.delete to ensure its deletion.
Get all entries that match the predicate.
Entry predicate
Quad predicate. Will be called with quad bounds
Optional
results: ArraySet<E>Optional Set
to put results into. Will allocate a new Set
otherwise
A Set
containing all matched entries
Merge subdivided quads that fall below the max entry value.
Update an entry in the tree after it was transformed. Entry may be added to the tree if it was not present before. It may also be deleted even if it was present if the new shape is outside the quad tree's bounds.
Entry to update
If true
, try to merge quads after the deletion
true
if the entry is present after this operation
Combines both QuadTree.add and QuadTree.delete into one operation which removes the need to traverse part of the tree again in QuadTree.add.
Quad tree.
Entries must implement the QuadTreeEntry interface.