Module building_blocks_storage::octree[][src]

Expand description

This module contains octrees in various forms. The most fundamental of these is the OctreeSet, which is used to implement everything else. Because the OctreeSet has a bounded domain, it is extended to being unbounded by storing multiple OctreeSets in a hash map. This is known as the ChunkOctreeSet.

While each octree is a set of Point3is, they can also be used as sets of ChunkKey3s. After all, ChunkKeys are just Points at a different scale. The OctreeChunkIndex satisfies this use case; it can be used to index an unbounded set of chunks, which makes it a nice companion for the ChunkMap3. It can also be used as a clipmap for level of detail.

Re-exports

pub use chunk_index::*;
pub use chunked_set::*;
pub use clipmap::*;
pub use set::*;

Modules

OctreeChunkIndex is “unbounded” because it is actually a collection of OctreeSets stored in a map. Each entry of that map is called a “super chunk.” You can think if it like a ChunkMap, except instead of Arrays, it stores OctreeSets. Every superchunk is the same shape, and each is resonsible for a sparse set of chunks in a bounded region.

The OctreeSet type is a memory-efficient set of points organized hierarchically. Often referred to as a “hashed octree.”