pub struct TerrainChunk {
pub coord: ChunkCoord,
pub heightmap: HeightMap,
pub biome_map: Option<BiomeMap>,
pub vegetation: Option<VegetationSystem>,
pub lod_level: u8,
pub state: ChunkState,
pub last_used: Instant,
pub seed: u64,
}Expand description
A single terrain chunk: one tile of the infinite world grid.
Fields§
§coord: ChunkCoord§heightmap: HeightMap§biome_map: Option<BiomeMap>§vegetation: Option<VegetationSystem>§lod_level: u8§state: ChunkState§last_used: Instant§seed: u64Implementations§
Source§impl TerrainChunk
impl TerrainChunk
Sourcepub fn world_bounds(&self, chunk_size: f32) -> (Vec3, Vec3)
pub fn world_bounds(&self, chunk_size: f32) -> (Vec3, Vec3)
World-space bounds: (min, max) corner of this chunk.
Sourcepub fn age_seconds(&self) -> f32
pub fn age_seconds(&self) -> f32
Seconds since this chunk was last accessed.
Sourcepub fn memory_bytes(&self) -> usize
pub fn memory_bytes(&self) -> usize
Approximate memory usage in bytes.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TerrainChunk
impl RefUnwindSafe for TerrainChunk
impl Send for TerrainChunk
impl Sync for TerrainChunk
impl Unpin for TerrainChunk
impl UnsafeUnpin for TerrainChunk
impl UnwindSafe for TerrainChunk
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.