Struct building_blocks_storage::octree::chunk_index::OctreeChunkIndex [−][src]
pub struct OctreeChunkIndex { pub superchunk_octrees: ChunkedOctreeSet, // some fields omitted }
Expand description
A ChunkedOctreeSet
that indexes the chunks of a ChunkMap
. Useful for representing a clipmap.
Fields
superchunk_octrees: ChunkedOctreeSet
An unbounded set of chunk keys, but scaled down to be contiguous. For example, if the chunk shape is 16^3
, then the
chunk key [16, 32, -64]
is represented as point [1, 2, -4]
in this set.
Implementations
The shape of the world extent convered by a single chunk (a leaf of an octree).
The shape of the world extent covered by a single octree, i.e. all of its chunks when full.
pub fn index_chunk_map<T, Ch, Store>(
superchunk_shape: Point3i,
chunk_map: &ChunkMap3<T, Ch, Store>
) -> Self where
Store: for<'r> IterChunkKeys<'r, [i32; 3]>,
[src]
pub fn index_chunk_map<T, Ch, Store>(
superchunk_shape: Point3i,
chunk_map: &ChunkMap3<T, Ch, Store>
) -> Self where
Store: for<'r> IterChunkKeys<'r, [i32; 3]>,
[src]Same as index_lod0_chunks
, but using the chunk keys and chunk shape from chunk_map
.
Create a new OctreeChunkIndex
whose octrees contain exactly the set chunk_keys
. The number of levels in an octree
corresponds to the relative sizes of the chunks and superchunks. A superchunk is a chunk of the domain that contains a
single octree of many smaller chunks. Superchunk shape, like chunk shape, must have all dimensions be powers of 2.
Because of the static limitations on OctreeSet
size, you can only have up to 6 levels of detail. This means
superchunk_shape / chunk_shape
must be less than 2 ^ [6, 6, 6] = [64, 64, 64]
. For example, if your chunk shape is
[16, 16, 16]
, then your superchunk shape can be at most [512, 512, 512]
.
pub fn active_clipmap_lod_chunks(
&self,
extent: &Extent3i,
clip_box_radius: u16,
lod0_center: ChunkUnits3,
init_rx: impl FnMut(ChunkKey3)
)
[src]
pub fn active_clipmap_lod_chunks(
&self,
extent: &Extent3i,
clip_box_radius: u16,
lod0_center: ChunkUnits3,
init_rx: impl FnMut(ChunkKey3)
)
[src]Traverses all octree nodes overlapping extent
to find the ChunkKey3
s that are “active” when the clipmap is
centered at lod0_center
.
pub fn find_clipmap_chunk_updates(
&self,
extent: &Extent3i,
clip_box_radius: u16,
old_lod0_center: ChunkUnits3,
new_lod0_center: ChunkUnits3,
update_rx: impl FnMut(LodChunkUpdate3)
)
[src]Trait Implementations
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations
impl RefUnwindSafe for OctreeChunkIndex
impl Send for OctreeChunkIndex
impl Sync for OctreeChunkIndex
impl Unpin for OctreeChunkIndex
impl UnwindSafe for OctreeChunkIndex
Blanket Implementations
Mutably borrows from an owned value. Read more