Class Octree

Octree

Hierarchy (view full)

Constructors

  • Parameters

    • Optional aabb: AABB

      The total AABB of the tree

    • Optional options: {
          maxDepth?: number;
      }
      • Optional maxDepth?: number

        Maximum subdivision depth

        Default

        8
        

    Returns Octree

Properties

aabb: AABB

Boundary of this node

children: OctreeNode[]

Children to this node

data: number[]

Contained data at the current node level

maxDepth: number

Maximum subdivision depth

Default

8

The root node

Methods

  • Get all data, potentially within an AABB

    Parameters

    • aabb: AABB
    • result: number[]

    Returns number[]

    The "result" object

  • Insert data into this node

    Parameters

    • aabb: AABB
    • elementData: number
    • Optional level: number

    Returns boolean

    True if successful, otherwise false

  • Get all data, potentially intersected by a ray.

    Parameters

    Returns number[]

    The "result" object

  • Create 8 equally sized children nodes and put them in the children array.

    Returns void