#

API Docs for: 0.6.1
Show: Inherited Protected Private Deprecated

# Octree Class

Extends OctreeNode
Defined in: `src/utils/Octree.js:40`

- Index
- Methods
- Properties

## Item Index

### Methods

- aabbQuery
- insert
- rayQuery
- removeEmptyNodes
- subdivide

### Properties

- aabb
- children
- data
- maxDepth
- root

## Methods

### `aabbQuery`

(

- `aabb`
- `result`

)
Array

Defined in `src/utils/Octree.js:158`

Get all data, potentially within an AABB

#### Parameters:

- `aabb` AABB
- `result` Array

#### Returns:

Array:

The "result" object

### `insert`

(

- `aabb`
- `elementData`

)
Boolean

Defined in `src/utils/Octree.js:65`

Insert data into this node

#### Parameters:

- `aabb` AABB
- `elementData` Object

#### Returns:

Boolean:

True if successful, otherwise false

### `rayQuery`

(

- `ray`
- `treeTransform`
- `result`

)
Array

Defined in `src/utils/Octree.js:200`

Get all data, potentially intersected by a ray.

#### Parameters:

- `ray` Ray
- `treeTransform` Transform
- `result` Array

#### Returns:

Array:

The "result" object

### `removeEmptyNodes`

()

Defined in `src/utils/Octree.js:219`

### `subdivide`

()

Defined in `src/utils/Octree.js:112`

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

## Properties

### `aabb`

AABB

Inherited from OctreeNode: `src/utils/Octree.js:21`

Boundary of this node

### `children`

Array

Inherited from OctreeNode: `src/utils/Octree.js:33`

Children to this node

### `data`

Array

Inherited from OctreeNode: `src/utils/Octree.js:27`

Contained data at the current node level.

### `maxDepth`

Number

Defined in `src/utils/Octree.js:53`

Maximum subdivision depth

### `root`

OctreeNode

Inherited from OctreeNode: `src/utils/Octree.js:15`

The root node