get (): boolean True if this node is a leaf node.
()
=> void Splits the node, but doesn't redistribute objects
()
=> void Tries to merge and collapse nodes which are no longer overpopulated.
(rect: Rect)
=>
Parsing error with FirstLiteralToken
|
Parsing error with FirstLiteralToken
|
Parsing error with FirstLiteralToken
|
Parsing error with PrefixUnaryExpression
|
Parsing error with FirstLiteralToken
Returns the quadrant this rect fits in or -1 if it doesn't fit any quadrant
param rect- The rect to test with.
returns The index of the quadrant fitting the rect completely, or -1 if none.
(rect: Rect)
=> number[] Returns the quadrants this rect intersects
param rect- The rect to test with. Note that this rect is assumed to be within the node.
returns the list of quadrant indices
(obj: GameObj<AreaComp>, bbox: Rect)
=> void Inserts the object with the given rectangle
param obj- The object to add
param bbox- The bounding box of the object
(obj: GameObj<AreaComp>)
=> void Add the object
param obj- The object to add
(rect: Rect, retrieveCb: (obj: GameObj<AreaComp>) => void)
=> void Retrieves all objects potentially intersecting the rectangle
param rect- The rect to test with
returns A set of objects potentially intersecting the rectangle
(obj: GameObj<AreaComp>, fast?: boolean)
=> boolean Removes the object
param obj- The object to remove
param fast- No node collapse if true
(root: Quadtree, obj: GameObj<AreaComp>, bbox: Rect)
=> void Updates a single object
Note that no testing is done here. Make sure the object needs to be actually updated.
param root- The tree root, since insertion happens from the root
param obj- The object to update
param bbox- The new bounding box
(bbox: Rect)
=> boolean True if the rectangle is completely outside this node's bounds
param bbox- The bounding box to test
(bbox: Rect)
=> boolean True if the rectangle is completely outside this node's bounds
param bbox- The bounding box to test
(orphans: [GameObj<AreaComp>, Rect][])
=> void Updates all objects in this node and the objects of its children
param orphans- The tree root, since insertion happens from the root
()
=> void Clears this node and collapses it
(ancestorObjects: Array<GameObj<AreaComp>>, pairCb: (obj1: GameObj<AreaComp>, obj2: GameObj<AreaComp>) => void)
=> void Gathers all collision pairs in this node and child nodes
param ancestorObjects- Objects in one of the node's ancestors
param pairCb- The pairs being gathered