pub struct HeightFieldData {Show 18 fields
pub version: u64,
pub byte_count: i32,
pub hash: u32,
pub aabb: Aabb,
pub min_height: f32,
pub max_height: f32,
pub height_scale: f32,
pub scale: Vec3,
pub column_count: i32,
pub row_count: i32,
pub heights_offset: i32,
pub material_offset: i32,
pub flags_offset: i32,
pub clockwise: bool,
pub padding: [u8; 3],
pub compressed_heights: Vec<u16>,
pub material_indices: Vec<u8>,
pub flags: Vec<u8>,
}Expand description
A height field with compressed storage.
Maps to C’s b3HeightFieldData + trailing blob. Offsets and byte_count match
C so HeightFieldData::to_bytes reproduces the contiguous layout used by
b3Hash.
Fields§
§version: u64§byte_count: i32§hash: u32§aabb: Aabb§min_height: f32§max_height: f32§height_scale: f32§scale: Vec3§column_count: i32§row_count: i32§heights_offset: i32§material_offset: i32§flags_offset: i32§clockwise: bool§padding: [u8; 3]§compressed_heights: Vec<u16>§material_indices: Vec<u8>§flags: Vec<u8>Implementations§
Source§impl HeightFieldData
impl HeightFieldData
Sourcepub fn from_bytes(bytes: &[u8]) -> Option<HeightFieldData>
pub fn from_bytes(bytes: &[u8]) -> Option<HeightFieldData>
Restore from a contiguous blob. (inverse of [to_bytes])
Trait Implementations§
Source§impl Clone for HeightFieldData
impl Clone for HeightFieldData
Source§fn clone(&self) -> HeightFieldData
fn clone(&self) -> HeightFieldData
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 moreSource§impl Debug for HeightFieldData
impl Debug for HeightFieldData
Auto Trait Implementations§
impl Freeze for HeightFieldData
impl RefUnwindSafe for HeightFieldData
impl Send for HeightFieldData
impl Sync for HeightFieldData
impl Unpin for HeightFieldData
impl UnsafeUnpin for HeightFieldData
impl UnwindSafe for HeightFieldData
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