pub struct CorePack { /* private fields */ }Expand description
A fully parsed OHPK v1 core pack held in memory.
Implementations§
Source§impl CorePack
impl CorePack
Sourcepub fn parse(bytes: &[u8]) -> Result<Self>
pub fn parse(bytes: &[u8]) -> Result<Self>
Parse an OHPK v1 pack from bytes.
Every malformed input — bad magic, unsupported version, truncated
stream, an oversized declared body length, or a corrupt DEFLATE
payload — yields an Err and never panics.
Sourcepub fn manifest(&self) -> &CorePackManifest
pub fn manifest(&self) -> &CorePackManifest
The embedded manifest.
Sourcepub fn vertex_count(&self) -> usize
pub fn vertex_count(&self) -> usize
Number of vertices in the base mesh.
Sourcepub fn base_positions(&self) -> Vec<f32>
pub fn base_positions(&self) -> Vec<f32>
De-quantised base positions as flat x, y, z triples.
Sourcepub fn base_indices(&self) -> &[u32]
pub fn base_indices(&self) -> &[u32]
The raw base-mesh triangle indices.
Sourcepub fn base_uvs(&self) -> Option<Vec<f32>>
pub fn base_uvs(&self) -> Option<Vec<f32>>
De-quantised base UVs as flat u, v pairs, if present.
Sourcepub fn helper_metadata(&self) -> Option<&[u8]>
pub fn helper_metadata(&self) -> Option<&[u8]>
Opaque helper / vertex-group metadata, if the pack carries any.
Sourcepub fn targets(&self) -> &[CorePackTarget]
pub fn targets(&self) -> &[CorePackTarget]
The parsed morph targets.
Sourcepub fn quantization_report(&self) -> QuantizationReport
pub fn quantization_report(&self) -> QuantizationReport
Build the honest quantisation-error report for the whole pack.
Auto Trait Implementations§
impl Freeze for CorePack
impl RefUnwindSafe for CorePack
impl Send for CorePack
impl Sync for CorePack
impl Unpin for CorePack
impl UnsafeUnpin for CorePack
impl UnwindSafe for CorePack
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
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>
Converts
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>
Converts
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