Extends
Methods
canCollide(a, b)
Checks to see if two bodies can proceed to have their bounding boxes checked
Parameters:
Name | Type | Description |
---|---|---|
a |
Body | |
b |
Body |
- Overrides:
- Source:
draw()
Renders a representation of a broadphase
- Overrides:
- Source:
getCollisionPairs(target) → {Array.<CollisionPair>}
Gets all possibly colliding pairs.
Parameters:
Name | Type | Description |
---|---|---|
target |
Array.<CollisionPair> | Empty array to store results. |
- Overrides:
- Source:
Returns:
- Type
- Array.<CollisionPair>
insert(obj)
Adds a body to the broadphase
Parameters:
Name | Type | Description |
---|---|---|
obj |
Body |
- Overrides:
- Source:
query(bounds, target) → {Array.<Body>}
Returns bodies that are within the given bound.
Parameters:
Name | Type | Description |
---|---|---|
bounds |
Bounds | Region to check in. |
target |
Array.<Body> | Empty array to store results. |
- Overrides:
- Source:
Returns:
- Type
- Array.<Body>
recalculateBounds()
Resizes a quadtree to a new bound size.
This method should not be used without care.
Parameters:
Name | Type | Description |
---|---|---|
bounds. |
Bounds |
- Source:
remove(obj)
Removes a body from the broadphase
Parameters:
Name | Type | Description |
---|---|---|
obj |
Body |
- Overrides:
- Source:
traverse(func)
A depth first search of the quadtree that applies the given function to its nodes.
Parameters:
Name | Type | Description |
---|---|---|
func |
function | The function that checks every node unless it returns true. |
- Source:
update(bodies)
Updates the internals of the broadphase if needed.
Parameters:
Name | Type | Description |
---|---|---|
bodies |
Array.<Body> |
- Overrides:
- Source: