pub struct TerrainWorld {
pub chunks: HashMap<(i32, i32), TerrainChunk>,
pub chunk_size: f32,
pub chunk_resolution: usize,
pub noise_gen: NoiseGenerator,
pub erosion_settings: ErosionSettings,
pub apply_erosion: bool,
pub generate_biomes: bool,
pub generate_splat: bool,
pub view_distance: f32,
pub loaded_chunks: Vec<(i32, i32)>,
}Fields§
§chunks: HashMap<(i32, i32), TerrainChunk>§chunk_size: f32§chunk_resolution: usize§noise_gen: NoiseGenerator§erosion_settings: ErosionSettings§apply_erosion: bool§generate_biomes: bool§generate_splat: bool§view_distance: f32§loaded_chunks: Vec<(i32, i32)>Implementations§
Source§impl TerrainWorld
impl TerrainWorld
pub fn new(seed: u32) -> Self
pub fn load_chunk(&mut self, cx: i32, cz: i32) -> &TerrainChunk
pub fn unload_chunk(&mut self, cx: i32, cz: i32)
pub fn update_view(&mut self, camera_x: f32, camera_z: f32)
pub fn height_at(&self, wx: f32, wz: f32) -> f32
pub fn loaded_chunk_count(&self) -> usize
pub fn total_vertex_count(&self) -> usize
Trait Implementations§
Source§impl Clone for TerrainWorld
impl Clone for TerrainWorld
Auto Trait Implementations§
impl Freeze for TerrainWorld
impl RefUnwindSafe for TerrainWorld
impl Send for TerrainWorld
impl Sync for TerrainWorld
impl Unpin for TerrainWorld
impl UnsafeUnpin for TerrainWorld
impl UnwindSafe for TerrainWorld
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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.