Class: Node

Node(bounds)

new Node(bounds)

Parameters:
Name Type Description
bounds Object
Source:

Members

bounds :Object

Type:
  • Object
Source:

children :Array.<Node>

Type:
Source:

depth :number

Type:
  • number
Source:

dims :Vector_like

Type:
Source:

global :Tree

Type:
  • Tree
Source:

hasObjects :boolean

Type:
  • boolean
Source:

index :number

Type:
  • number
Source:

objects :Array.<Body>

Type:
Source:

parent :Node

Type:
Source:

root :Node

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:
Name Type Description
target Array.<CollisionPair>
stack Array.<CollisionPair>
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:
Name Type Description
position Vector_like
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: