Skip to main content

Skin3D

Struct Skin3D 

Source
pub struct Skin3D { /* private fields */ }
Expand description

Real Blender/glTF 2.0 armature skin binding scene-graph joints and inverse bind matrices for LBS and DQS deformation.

Implementations§

Source§

impl Skin3D

Real armature skinning (LBS and DQS) and pre-skinning morph evaluation for Skin3D.

Source

pub fn from_imported(imported: &ImportedSkin3D) -> Self

Constructs a Skin3D directly from an imported glTF/Blender ImportedSkin3D.

§Arguments
  • &ImportedSkin3D - Imported armature skin asset.
§Returns
  • Self - Runtime skin configured in SkinningMode::LinearBlend.
Source

pub fn new( name: &str, joints: Vec<u32>, skeleton_root: Option<u32>, inverse_bind_matrices: Vec<Mat4>, ) -> Self

Constructs a Skin3D from explicit joint node indices and inverse bind matrices.

§Arguments
  • &str - Human-readable skin name.
  • Vec<u32> - Scene-graph node indices for each bone joint.
  • Option<u32> - Optional skeleton root node index.
  • Vec<Mat4> - Inverse bind matrices aligned 1:1 with joints.
§Returns
  • Self - Configured armature skin.
Source

pub fn with_skinning_mode(self, mode: SkinningMode) -> Self

Returns a copy of this skin configured with mode (LinearBlend or DualQuaternion).

§Arguments
  • Self - Base skin descriptor.
  • SkinningMode - Desired vertex deformation algorithm.
§Returns
  • Self - Updated skin descriptor.
Source

pub fn compute_skin_matrices_into( &self, mesh_world_matrix: Mat4, scene_graph: &SceneGraph3D, scratch: &mut SkinPaletteScratch3D, )

Computes exact per-joint skin matrices inv(M_mesh_world) * M_joint_world[j] * M_inv_bind[j], cofactor normal bases, and dual quaternions into scratch with zero steady-state allocations.

§Arguments
  • &Self - Armature skin reference.
  • Mat4 - World transformation matrix of the skinned mesh node.
  • &SceneGraph3D - Propagated hierarchical scene graph supplying current joint world matrices.
  • &mut SkinPaletteScratch3D - Reusable scratch arena overwritten in place.
Source

pub fn skin_vertices_lbs_into( source_vertices: &[Vertex3D], skin_influences: &[MeshSkinInfluence3D], skin_matrices: &[Mat4], skin_normal_matrices: &[[Vec3; 3]], out_vertices: &mut Vec<Vertex3D>, )

Evaluates 8-bone Linear-Blend Skinning (LBS) over source_vertices into out_vertices preserving UVs, colors, and tangent handedness.

§Arguments
  • &[Vertex3D] - Bind-pose or pre-morphed source vertices.
  • &[MeshSkinInfluence3D] - Per-vertex 8-bone joint indices and weights.
  • &[Mat4] - Precomputed skin palette matrices.
  • &[[Vec3; 3]] - Precomputed cofactor 3x3 normal bases aligned with skin_matrices.
  • &mut Vec<Vertex3D> - Reusable destination vertex buffer populated in place.
Source

pub fn skin_vertices_dqs_into( source_vertices: &[Vertex3D], skin_influences: &[MeshSkinInfluence3D], skin_dual_quats: &[DualQuat], out_vertices: &mut Vec<Vertex3D>, )

Evaluates volume-preserving 8-bone Dual-Quaternion Skinning (DQS) over source_vertices into out_vertices, avoiding candy-wrapper collapse at large twist angles.

§Arguments
  • &[Vertex3D] - Bind-pose or pre-morphed source vertices.
  • &[MeshSkinInfluence3D] - Per-vertex 8-bone joint indices and weights.
  • &[DualQuat] - Precomputed bone dual quaternions.
  • &mut Vec<Vertex3D> - Reusable destination vertex buffer populated in place.
Source

pub fn deform_mesh_into( &self, mesh: &Mesh3D, morph_weights: &[f32], mesh_world_matrix: Mat4, scene_graph: &SceneGraph3D, scratch: &mut SkinPaletteScratch3D, ) -> bool

Evaluates Blender’s exact modifier order (Shape Keys BEFORE Armature Skinning) for mesh into scratch.skinned_vertices with zero steady-state allocations.

§Arguments
  • &Self - Armature skin reference.
  • &Mesh3D - Source bind-pose mesh with optional morph_targets and skin_influences.
  • &[f32] - Active shape-key weights for this mesh node.
  • Mat4 - Current mesh node world matrix.
  • &SceneGraph3D - Propagated hierarchical scene graph.
  • &mut SkinPaletteScratch3D - Reusable deformation scratch arena.
§Returns
  • bool - true when scratch.skinned_vertices was populated with deformed vertices.
Source§

impl Skin3D

Implements impl #impl_generics #name #ty_generics #where_clause.

Source

pub fn get_name(&self) -> &String

Source

pub fn get_mut_name(&mut self) -> &mut String

Source

pub fn set_name(&mut self, val: String) -> &mut Self

Source

pub fn get_joints(&self) -> &Vec<u32>

Source

pub fn get_mut_joints(&mut self) -> &mut Vec<u32>

Source

pub fn set_joints(&mut self, val: Vec<u32>) -> &mut Self

Source

pub fn get_skeleton_root(&self) -> Option<u32>

Source

pub fn try_get_skeleton_root(&self) -> Option<u32>

Source

pub fn get_mut_skeleton_root(&mut self) -> &mut Option<u32>

Source

pub fn set_skeleton_root(&mut self, val: Option<u32>) -> &mut Self

Source

pub fn get_inverse_bind_matrices(&self) -> &Vec<Mat4>

Source

pub fn get_mut_inverse_bind_matrices(&mut self) -> &mut Vec<Mat4>

Source

pub fn set_inverse_bind_matrices(&mut self, val: Vec<Mat4>) -> &mut Self

Source

pub fn get_skinning_mode(&self) -> SkinningMode

Source

pub fn get_mut_skinning_mode(&mut self) -> &mut SkinningMode

Source

pub fn set_skinning_mode(&mut self, val: SkinningMode) -> &mut Self

Trait Implementations§

Source§

impl Clone for Skin3D

Source§

fn clone(&self) -> Self

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 Debug for Skin3D

Source§

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

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

impl Default for Skin3D

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl PartialEq for Skin3D

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Skin3D

Auto Trait Implementations§

§

impl Forget for Skin3D

§

impl Freeze for Skin3D

§

impl Move for Skin3D

§

impl RefUnwindSafe for Skin3D

§

impl Send for Skin3D
where RawVecInner: Send,

§

impl Sync for Skin3D
where RawVecInner: Sync,

§

impl Unpin for Skin3D
where *const u8 is !null: Unpin,

§

impl UnsafeUnpin for Skin3D

§

impl UnwindSafe for Skin3D
where RawVecInner: UnwindSafe,

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.