The bounding rectangle of the region
The maximum number of objects allowed within this node before it must split
The maximum number of levels that the base quadtree is allowed
The depth of this node within the root Quadtree
The objects contained at this level of the tree
Children of this node
The root Quadtree
A constant that enumerates the index order of the quadtree nodes from top-left to bottom-right.
Return an array of all the objects in the Quadtree (recursive)
Split this node into 4 sub-nodes.
The split Quadtree
Clear the quadtree of all existing contents
The cleared Quadtree
Add a rectangle object to the tree
The object being inserted
The Quadtree nodes the object was added to.
Remove an object from the quadtree
The quadtree target being removed
The Quadtree for method chaining
Remove an existing object from the quadtree and re-insert it with a new position
The object being inserted
The Quadtree nodes the object was added to
Get all the objects which could collide with the provided rectangle
The normalized target rectangle
Options affecting the collision test.
The objects in the Quadtree which represent potential collisions
Obtain the leaf nodes to which a target rectangle belongs. This traverses the quadtree recursively obtaining the final nodes which have no children.
The target rectangle.
The Quadtree nodes to which the target rectangle belongs
Obtain the child nodes within the current node which a rectangle belongs to. Note that this function is not recursive, it only returns nodes at the current or child level.
The target rectangle.
The Quadtree nodes to which the target rectangle belongs
Identify all nodes which are adjacent to this one within the parent Quadtree.
Visualize the nodes and objects in the quadtree
Visualize the rectangular bounds of objects in the Quadtree. Default is false.
A Quadtree implementation that supports collision detection for rectangles.
The outer bounds of the region
Additional options which configure the Quadtree
The maximum number of objects per node
The maximum number of levels within the root Quadtree
The depth level of the sub-tree. For internal use
The root of the quadtree. For internal use