pub struct Quad(pub u64);
Tuple Fields§
§0: u64
Implementations§
Source§impl Quad
impl Quad
Sourcepub fn pack(
x: usize,
y: usize,
z: usize,
w: usize,
h: usize,
v_type: usize,
) -> Self
pub fn pack( x: usize, y: usize, z: usize, w: usize, h: usize, v_type: usize, ) -> Self
x: 6 bits y: 6 bits z: 6 bits 18 width (w): 6 bits height (h): 6 bits voxel id (v): 32 bits
ao (a): 2 bits
layout: 0bvvvv_vvvv_vvvv_vvvv_vvvv_vvvv_vvvv_vvvv_00hh_hhhh_wwww_wwzz_zzzz_yyyy_yyxx_xxxx
pub fn xyz(&self) -> [u64; 3]
pub fn width(&self) -> u64
pub fn height(&self) -> u64
pub fn voxel_id(&self) -> u64
Sourcepub fn debug_quad(&self) -> String
pub fn debug_quad(&self) -> String
Unpacks quad data and formats it as “{x};{y};{z} {w}x{h} v={v_type}” for debugging
Trait Implementations§
Source§impl Ord for Quad
impl Ord for Quad
Source§impl PartialOrd for Quad
impl PartialOrd for Quad
impl Copy for Quad
impl Eq for Quad
impl StructuralPartialEq for Quad
Auto Trait Implementations§
impl Freeze for Quad
impl RefUnwindSafe for Quad
impl Send for Quad
impl Sync for Quad
impl Unpin for Quad
impl UnwindSafe for Quad
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