logo

Struct ami::Octree

source · []
pub struct Octree<T: Collider> { /* private fields */ }
Expand description

An octree is a DAG that can quickly search for points in 3D space.

The bounding box of the root node contains all points in the octree. If a point outside the bounding box is added, a new root node is created which contains the old root as one of its octants. This process is repeated until the point is contained.

The nodes are stored in a vector, and are indexed using a 32-bit node ID. This saves memory over using pointers on 64-bit systems. Node ID 1 is the first node in the vector.

Implementations

Create a new octree

Clear the octree.

Add a point in the octree

Remove a point from the octree

Trait Implementations

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

The returned type after indexing.

Performs the indexing (container[index]) operation. Read more

Performs the mutable indexing (container[index]) operation. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.