pub struct CorePackBuilder { /* private fields */ }Expand description
Incrementally assembles an OHPK v1 core pack in memory.
Nothing touches the filesystem; the whole pack is produced as a Vec<u8>
from build, making the builder usable on
wasm32 as well.
Implementations§
Source§impl CorePackBuilder
impl CorePackBuilder
Sourcepub fn set_base_mesh(
&mut self,
positions: &[f32],
indices: &[u32],
uvs: Option<&[f32]>,
) -> &mut Self
pub fn set_base_mesh( &mut self, positions: &[f32], indices: &[u32], uvs: Option<&[f32]>, ) -> &mut Self
Set the base mesh.
positions— flatx, y, ztriples (length must be a multiple of 3).indices— triangle indices (stored raw asu32).uvs— optional flatu, vpairs; when present its length must be exactly2 * n_verts.
Length validation happens in build.
Sourcepub fn set_helper_metadata(&mut self, bytes: &[u8]) -> &mut Self
pub fn set_helper_metadata(&mut self, bytes: &[u8]) -> &mut Self
Attach opaque vertex-group / helper metadata for future use.
Sourcepub fn add_target(
&mut self,
name: impl Into<String>,
category: impl Into<String>,
sparse: &[(u32, [f32; 3])],
) -> &mut Self
pub fn add_target( &mut self, name: impl Into<String>, category: impl Into<String>, sparse: &[(u32, [f32; 3])], ) -> &mut Self
Add a sparse morph target.
sparse is a list of (vertex_index, [dx, dy, dz]) in model units.
Entries may be supplied in any order — they are sorted by index at
encode time.
Sourcepub fn set_manifest(&mut self, manifest: CorePackManifest) -> &mut Self
pub fn set_manifest(&mut self, manifest: CorePackManifest) -> &mut Self
Replace the pack manifest.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CorePackBuilder
impl RefUnwindSafe for CorePackBuilder
impl Send for CorePackBuilder
impl Sync for CorePackBuilder
impl Unpin for CorePackBuilder
impl UnsafeUnpin for CorePackBuilder
impl UnwindSafe for CorePackBuilder
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