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.
impl Skin3D
Real armature skinning (LBS and DQS) and pre-skinning morph evaluation for Skin3D.
Sourcepub fn from_imported(imported: &ImportedSkin3D) -> Self
pub fn from_imported(imported: &ImportedSkin3D) -> Self
Sourcepub fn new(
name: &str,
joints: Vec<u32>,
skeleton_root: Option<u32>,
inverse_bind_matrices: Vec<Mat4>,
) -> Self
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 withjoints.
§Returns
Self- Configured armature skin.
Sourcepub fn with_skinning_mode(self, mode: SkinningMode) -> Self
pub fn with_skinning_mode(self, mode: SkinningMode) -> Self
Sourcepub fn compute_skin_matrices_into(
&self,
mesh_world_matrix: Mat4,
scene_graph: &SceneGraph3D,
scratch: &mut SkinPaletteScratch3D,
)
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.
Sourcepub fn skin_vertices_lbs_into(
source_vertices: &[Vertex3D],
skin_influences: &[MeshSkinInfluence3D],
skin_matrices: &[Mat4],
skin_normal_matrices: &[[Vec3; 3]],
out_vertices: &mut Vec<Vertex3D>,
)
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 withskin_matrices.&mut Vec<Vertex3D>- Reusable destination vertex buffer populated in place.
Sourcepub fn skin_vertices_dqs_into(
source_vertices: &[Vertex3D],
skin_influences: &[MeshSkinInfluence3D],
skin_dual_quats: &[DualQuat],
out_vertices: &mut Vec<Vertex3D>,
)
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.
Sourcepub fn deform_mesh_into(
&self,
mesh: &Mesh3D,
morph_weights: &[f32],
mesh_world_matrix: Mat4,
scene_graph: &SceneGraph3D,
scratch: &mut SkinPaletteScratch3D,
) -> bool
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 optionalmorph_targetsandskin_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-truewhenscratch.skinned_verticeswas populated with deformed vertices.
Source§impl Skin3D
Implements impl #impl_generics #name #ty_generics #where_clause.
impl Skin3D
Implements impl #impl_generics #name #ty_generics #where_clause.