nodes: BaseQuadtree[]
True if this node is a leaf node.
Splits the node, but doesn't redistribute objects
Tries to merge and collapse nodes which are no longer overpopulated.
getQuadrant(rect: Rect ): FirstLiteralToken | FirstLiteralToken | FirstLiteralToken | PrefixUnaryExpression | FirstLiteralToken
Returns the quadrant this rect fits in or -1 if it doesn't fit any quadrant
paramrect- The rect to test with.
returnsThe index of the quadrant fitting the rect completely, or -1 if none.
Returns the quadrants this rect intersects
paramrect- The rect to test with. Note that this rect is assumed to be within the node.
returnsthe list of quadrant indices
insert(obj: T , bbox: Rect ): void
Inserts the object with the given rectangle
paramobj- The object to add
parambbox- The bounding box of the object
retrieve(rect: Rect , retrieveCb: (obj: T )=>void ): void
Retrieves all objects potentially intersecting the rectangle
paramrect- The rect to test with
returnsA set of objects potentially intersecting the rectangle
remove(obj: T , fast?: boolean ): boolean
Removes the object
paramobj- The object to remove
paramfast- No node collapse if true
updateObject(obj: T , bbox: Rect , fast?: boolean ): void
Updates a single object
Note that no testing is done here. Make sure the object needs to be actually updated.
paramobj- The object to update
parambbox- The new bounding box
isOutside(bbox: Rect ): boolean
True if the rectangle is completely outside this node's bounds
parambbox- The bounding box to test
isInside(bbox: Rect ): boolean
True if the rectangle is completely outside this node's bounds
parambbox- The bounding box to test
Clears this node and collapses it
gatherPairs(ancestorObjects: Array , pairCb: (obj1: T , obj2: T )=>void ): void
Gathers all collision pairs in this node and child nodes
paramancestorObjects- Objects in one of the node's ancestors
parampairCb- The pairs being gathered
iterPairs(pairCb: (obj1: T , obj2: T )=>void ): void