Skip to main content

QuantizedMeshView

Struct QuantizedMeshView 

Source
pub struct QuantizedMeshView<'a> {
Show 13 fields pub header: QuantizedMeshHeader, pub vertex_count: u32, pub use_32bit_indices: bool, pub triangle_count: u32, pub encoded_u_bytes: &'a [u8], pub encoded_v_bytes: &'a [u8], pub encoded_height_bytes: &'a [u8], pub indices: IndicesView<'a>, pub edge_west: IndicesView<'a>, pub edge_south: IndicesView<'a>, pub edge_east: IndicesView<'a>, pub edge_north: IndicesView<'a>, pub extensions: ExtensionsView<'a>,
}
Expand description

Zero-copy view over a parsed quantized-mesh stream.

Every byte section (vertex / index / edge / extension data) is a slice borrowed from the input. Use the iter_* helpers to decode on the fly, or Self::into_owned to materialise everything into a DecodedMesh.

Fields§

§header: QuantizedMeshHeader

Parsed 88-byte header (copied — it’s small and not aligned in the source).

§vertex_count: u32

Number of vertices.

§use_32bit_indices: bool

Whether the index stream uses 32-bit indices (vertex_count > 65535).

§triangle_count: u32

Number of triangles.

§encoded_u_bytes: &'a [u8]

Zigzag-delta encoded u coordinate bytes (2 bytes per vertex).

§encoded_v_bytes: &'a [u8]

Zigzag-delta encoded v coordinate bytes.

§encoded_height_bytes: &'a [u8]

Zigzag-delta encoded height bytes.

§indices: IndicesView<'a>

High-water-mark encoded triangle indices.

§edge_west: IndicesView<'a>

West-edge indices (raw little-endian).

§edge_south: IndicesView<'a>

South-edge indices.

§edge_east: IndicesView<'a>

East-edge indices.

§edge_north: IndicesView<'a>

North-edge indices.

§extensions: ExtensionsView<'a>

Parsed extension views.

Implementations§

Source§

impl<'a> QuantizedMeshView<'a>

Source

pub fn parse(data: &'a [u8]) -> DecodeResult<Self>

Parse a raw (already gzip-decompressed) quantized-mesh byte stream.

Source

pub fn iter_u(&self) -> ZigzagDeltaIter<'a>

Lazily decoded u coordinates.

Source

pub fn iter_v(&self) -> ZigzagDeltaIter<'a>

Lazily decoded v coordinates.

Source

pub fn iter_height(&self) -> ZigzagDeltaIter<'a>

Lazily decoded height values.

Source

pub fn into_owned(self) -> DecodeResult<DecodedMesh>

Materialise into a fully owned DecodedMesh.

Trait Implementations§

Source§

impl<'a> Clone for QuantizedMeshView<'a>

Source§

fn clone(&self) -> QuantizedMeshView<'a>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Debug for QuantizedMeshView<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a> Copy for QuantizedMeshView<'a>

Auto Trait Implementations§

§

impl<'a> Freeze for QuantizedMeshView<'a>

§

impl<'a> RefUnwindSafe for QuantizedMeshView<'a>

§

impl<'a> Send for QuantizedMeshView<'a>

§

impl<'a> Sync for QuantizedMeshView<'a>

§

impl<'a> Unpin for QuantizedMeshView<'a>

§

impl<'a> UnsafeUnpin for QuantizedMeshView<'a>

§

impl<'a> UnwindSafe for QuantizedMeshView<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.