pub struct CarvingMask {
min_y: i32,
height: i32,
bits: Vec<u64>,
}Expand description
A 16 × height × 16 bitset of local block positions in a chunk.
Fields§
§min_y: i32§height: i32§bits: Vec<u64>256 bits per Y layer (x in low 4 bits, z in next 4 bits).
Implementations§
Source§impl CarvingMask
impl CarvingMask
Sourcepub fn new(height: i32, min_y: i32) -> Self
pub fn new(height: i32, min_y: i32) -> Self
Creates an empty mask covering [min_y, min_y + height).
Sourcepub fn from_packed_u64s(height: i32, min_y: i32, packed: &[u64]) -> Self
pub fn from_packed_u64s(height: i32, min_y: i32, packed: &[u64]) -> Self
Rebuilds a mask from Steel’s packed u64 bitset representation.
Sourcepub fn to_packed_u64s(&self) -> Vec<u64>
pub fn to_packed_u64s(&self) -> Vec<u64>
Returns Steel’s packed u64 bitset representation, trimming trailing zeroes.
Sourceconst fn index(&self, x: i32, y: i32, z: i32) -> usize
const fn index(&self, x: i32, y: i32, z: i32) -> usize
Vanilla’s getIndex: x & 15 | (z & 15) << 4 | (y - min_y) << 8.
Trait Implementations§
Source§impl Clone for CarvingMask
impl Clone for CarvingMask
Source§fn clone(&self) -> CarvingMask
fn clone(&self) -> CarvingMask
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for CarvingMask
impl RefUnwindSafe for CarvingMask
impl Send for CarvingMask
impl Sync for CarvingMask
impl Unpin for CarvingMask
impl UnsafeUnpin for CarvingMask
impl UnwindSafe for CarvingMask
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,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreWraps this value in an
Arc<SyncMutex<>>