pub struct Heightmap {
pub data: BitStorage,
pub min_y: i32,
pub kind: HeightmapKind,
}
Fields§
§data: BitStorage
§min_y: i32
§kind: HeightmapKind
Implementations§
Source§impl Heightmap
impl Heightmap
pub fn new( kind: HeightmapKind, dimension_height: u32, min_y: i32, data: Vec<u64>, ) -> Self
pub fn get_index(x: u8, z: u8) -> usize
pub fn get_first_available_at_index(&self, index: usize) -> i32
pub fn get_first_available(&self, x: u8, z: u8) -> i32
pub fn get_highest_taken(&self, x: u8, z: u8) -> i32
pub fn set_height(&mut self, x: u8, z: u8, height: i32)
Sourcepub fn update(
&mut self,
pos: &ChunkBlockPos,
block_state: BlockState,
sections: &[Section],
) -> bool
pub fn update( &mut self, pos: &ChunkBlockPos, block_state: BlockState, sections: &[Section], ) -> bool
Updates the heightmap with the given block state at the given position.
Sourcepub fn iter_first_available(&self) -> impl Iterator<Item = ChunkBlockPos> + '_
pub fn iter_first_available(&self) -> impl Iterator<Item = ChunkBlockPos> + '_
Get an iterator over the top available block positions in this heightmap.
Sourcepub fn iter_highest_taken(&self) -> impl Iterator<Item = ChunkBlockPos> + '_
pub fn iter_highest_taken(&self) -> impl Iterator<Item = ChunkBlockPos> + '_
Get an iterator over the top block positions in this heightmap.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Heightmap
impl RefUnwindSafe for Heightmap
impl Send for Heightmap
impl Sync for Heightmap
impl Unpin for Heightmap
impl UnwindSafe for Heightmap
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§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
.§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
.§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.§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.