Class: TopDownBVHTree

Grape2D. TopDownBVHTree

new TopDownBVHTree(objs)

With the top down approach the area of the bounding volume will reduce at every level.
Parameters:
Name Type Argument Description
objs ?Array.<Grape2D.Object2D> <nullable>
List with objects. If objects are provided then tree will be build.
Source:

Members

<private> objs :!Array.<Grape2D.Object2D>

Objects of the tree
Type:
Source:

<private> rootNode :Grape2D.TopDownBVHNode

The root node of the tree.
Type:
Source:

Methods

add()

Adding objects to the tree will not cause it to rebuild.
Source:

clear()

Source:

getRootNode() → {Grape2D.TopDownBVHNode}

Gets the root node of the tree
Source:
Returns:
Root node of the tree.
Type
Grape2D.TopDownBVHNode

query()

Source:

queryPoint()

Source:

queryRay()

Source:

rebuild()

(Re)Builds the tree, based on the objects present on the stack.
Source:

remove()

Removing objects from the tree will not cause it to rebuild.
Source:

update()

Source: