pub struct CompressedMesh<'a> { /* private fields */ }Expand description
A zero-allocation borrowed view over a validated Bunny compressed mesh payload.
Implementations§
Source§impl<'a> CompressedMesh<'a>
impl<'a> CompressedMesh<'a>
Sourcepub const fn bounds(self) -> FixedAabb3
pub const fn bounds(self) -> FixedAabb3
Returns the decoded Q32.32 quantization bounds.
Sourcepub const fn vertex_count(self) -> usize
pub const fn vertex_count(self) -> usize
Returns the decoded vertex count.
Sourcepub const fn triangle_count(self) -> usize
pub const fn triangle_count(self) -> usize
Returns the decoded triangle count.
Sourcepub const fn index_width(self) -> CompressedIndexWidth
pub const fn index_width(self) -> CompressedIndexWidth
Returns the decoded triangle index width.
Sourcepub const fn vertex_bytes(self) -> &'a [u8] ⓘ
pub const fn vertex_bytes(self) -> &'a [u8] ⓘ
Returns the borrowed quantized vertex payload bytes.
Sourcepub const fn triangle_bytes(self) -> &'a [u8] ⓘ
pub const fn triangle_bytes(self) -> &'a [u8] ⓘ
Returns the borrowed triangle index payload bytes.
Sourcepub fn vertex(
self,
index: usize,
) -> Result<QuantizedVertex, CompressedMeshError>
pub fn vertex( self, index: usize, ) -> Result<QuantizedVertex, CompressedMeshError>
Reads a quantized vertex record.
§Errors
Returns CompressedMeshError::IndexOutOfBounds when index is outside
the decoded vertex range.
Sourcepub fn triangle(
self,
index: usize,
) -> Result<CompressedTriangle, CompressedMeshError>
pub fn triangle( self, index: usize, ) -> Result<CompressedTriangle, CompressedMeshError>
Reads a triangle record using the width declared by the byte stream.
§Errors
Returns CompressedMeshError::IndexOutOfBounds when index is outside
the decoded triangle range.
Trait Implementations§
Source§impl<'a> Clone for CompressedMesh<'a>
impl<'a> Clone for CompressedMesh<'a>
Source§fn clone(&self) -> CompressedMesh<'a>
fn clone(&self) -> CompressedMesh<'a>
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 moreimpl<'a> Copy for CompressedMesh<'a>
Source§impl<'a> Debug for CompressedMesh<'a>
impl<'a> Debug for CompressedMesh<'a>
impl<'a> Eq for CompressedMesh<'a>
Source§impl<'a> PartialEq for CompressedMesh<'a>
impl<'a> PartialEq for CompressedMesh<'a>
Source§fn eq(&self, other: &CompressedMesh<'a>) -> bool
fn eq(&self, other: &CompressedMesh<'a>) -> bool
Tests for
self and other values to be equal, and is used by ==.impl<'a> StructuralPartialEq for CompressedMesh<'a>
Auto Trait Implementations§
impl<'a> Freeze for CompressedMesh<'a>
impl<'a> RefUnwindSafe for CompressedMesh<'a>
impl<'a> Send for CompressedMesh<'a>
impl<'a> Sync for CompressedMesh<'a>
impl<'a> Unpin for CompressedMesh<'a>
impl<'a> UnsafeUnpin for CompressedMesh<'a>
impl<'a> UnwindSafe for CompressedMesh<'a>
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