Class: Node
new Node(bounds)
Parameters:
Name |
Type |
Description |
bounds |
Object
|
|
- Source:
Members
bounds :Object
Type:
- Source:
children :Array.<Node>
Type:
- Source:
depth :number
Type:
- Source:
Type:
- Source:
global :Tree
Type:
- Source:
hasObjects :boolean
Type:
- Source:
index :number
Type:
- Source:
objects :Array.<Body>
Type:
- Source:
Type:
- Source:
Type:
- Source:
Methods
add(node)
Parameters:
Name |
Type |
Description |
node |
Node
|
|
- Source:
childrenHaveObj()
- Source:
Returns:
boolean
contains(bounds)
Parameters:
Name |
Type |
Description |
bounds |
Bounds
|
|
- Source:
Returns:
boolean
draw(ctx)
Parameters:
Name |
Type |
Description |
ctx |
CanvasRenderingContext2D
|
|
- Source:
getCollisionPairs(target, stack)
Parameters:
- Source:
insertObject(obj)
Parameters:
Name |
Type |
Description |
obj |
Body
|
|
- Source:
Returns:
boolean
intersects(bounds)
Parameters:
Name |
Type |
Description |
bounds |
Bounds
|
|
- Source:
Returns:
boolean
isInNode(position)
Parameters:
- Source:
Returns:
boolean
isLeafNode()
- Source:
Returns:
boolean
query(bounds, targetopt)
Parameters:
Name |
Type |
Attributes |
Description |
bounds |
Bounds
|
|
|
target |
Array.<Body>
|
<optional>
|
|
- Source:
Returns:
boolean
removeObject(obj)
Parameters:
Name |
Type |
Description |
obj |
Body
|
|
- Source:
Returns:
boolean
split(depth)
Parameters:
Name |
Type |
Default |
Description |
depth |
number
|
1
|
|
- Source:
traverse(func, target)
Parameters:
Name |
Type |
Description |
func |
Traverser
|
|
target |
Array.<T>
|
|
- Source:
Returns:
[]
updateObject(obj)
Parameters:
Name |
Type |
Description |
obj |
Body
|
|
- Source: