Struct ami::Octree [] [src]

pub struct Octree<T: Pos> { /* fields omitted */ }

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.

Methods

impl<T> Octree<T> where
    T: Pos
[src]

[src]

Create a new octree

[src]

Add a point in the octree

[src]

Remove a point from the octree

[src]

Modify a point in the octree.

[src]

Sort the octree nearest to farthest, while culling all outside of view frustum.

[src]

Sort the octree farthest to nearest, while culling all outside of view frustum.

[src]

Print the octree

[src]

Get the number of points in the octree.

[src]

Abort program on error if the octree is corrupt!

Trait Implementations

impl<T> Index<u32> for Octree<T> where
    T: Pos
[src]

The returned type after indexing.

[src]

Performs the indexing (container[index]) operation.

impl<T> IndexMut<u32> for Octree<T> where
    T: Pos
[src]

[src]

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

impl<T> Debug for Octree<T> where
    T: Pos
[src]

[src]

Formats the value using the given formatter.