#[repr(C, align(16))]pub struct Vox0DagNode {
pub child_mask: u8,
pub leaf_mask: u8,
pub primary_material_lut: u8,
pub secondary_material_lut: u8,
pub child_ptr_or_density: u32,
pub normal_oct_snorm8: [i8; 2],
pub moisture_u8: u8,
pub compaction_u8: u8,
pub node_crc16: u16,
pub _reserved: [u8; 2],
}Expand description
16-Byte POD Node Record for Sparse Voxel Octrees and DAGs.
Fields§
§child_mask: u81B: Valid octant child bitmask (bits 0..7).
leaf_mask: u81B: Bitmask of octants that terminate as solid leaves (bits 0..7).
primary_material_lut: u81B: Primary constituent LUT index (0..255).
secondary_material_lut: u81B: Secondary constituent LUT index (0..255).
child_ptr_or_density: u324B: Child pointer into node array (when non-leaf) or packed density.
normal_oct_snorm8: [i8; 2]2B: Octahedrally-encoded surface normal vector.
moisture_u8: u81B: Volumetric moisture saturation Sw (0..255 maps to 0..100%).
compaction_u8: u81B: Soil compaction / hardness metric (0..255).
node_crc16: u162B: CRC-16 checksum of bytes 0..11.
_reserved: [u8; 2]2B: Explicit zero padding to 16 bytes.
Implementations§
Source§impl Vox0DagNode
impl Vox0DagNode
Sourcepub fn has_child(&self, octant: usize) -> bool
pub fn has_child(&self, octant: usize) -> bool
Returns true if the child octant (0..7) exists in the lattice.
Sourcepub fn is_leaf(&self, octant: usize) -> bool
pub fn is_leaf(&self, octant: usize) -> bool
Returns true if the child octant (0..7) terminates as a leaf.
Sourcepub fn compute_crc16(&self) -> u16
pub fn compute_crc16(&self) -> u16
Compute simple CRC-16 (IBM polynomial 0xA001) over bytes 0..11.
Sourcepub fn update_crc(&mut self)
pub fn update_crc(&mut self)
Update node_crc16 with the computed checksum.
Trait Implementations§
Source§impl Clone for Vox0DagNode
impl Clone for Vox0DagNode
impl Copy for Vox0DagNode
Source§impl Debug for Vox0DagNode
impl Debug for Vox0DagNode
Source§impl Default for Vox0DagNode
impl Default for Vox0DagNode
Source§impl PartialEq for Vox0DagNode
impl PartialEq for Vox0DagNode
impl Pod for Vox0DagNode
impl StructuralPartialEq for Vox0DagNode
Auto Trait Implementations§
impl Freeze for Vox0DagNode
impl RefUnwindSafe for Vox0DagNode
impl Send for Vox0DagNode
impl Sync for Vox0DagNode
impl Unpin for Vox0DagNode
impl UnsafeUnpin for Vox0DagNode
impl UnwindSafe for Vox0DagNode
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<T> AnyBitPattern for Twhere
T: Pod,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
§type Bits = T
type Bits = T
Self must have the same layout as the specified Bits except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern.§fn is_valid_bit_pattern(_bits: &T) -> bool
fn is_valid_bit_pattern(_bits: &T) -> bool
bits
as &Self.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> ⓘ
impl<T> Interleave for Twhere
T: Pod,
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> ⓘ
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> ⓘ
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 more