pub struct SkeletonRig3D { /* private fields */ }Expand description
Hierarchical 3D skeletal rig evaluating forward kinematics across bone chains.
Implementations§
Source§impl SkeletonRig3D
Hierarchical forward-kinematics solver for SkeletonRig3D.
impl SkeletonRig3D
Hierarchical forward-kinematics solver for SkeletonRig3D.
Sourcepub fn add_joint(
&mut self,
name: &str,
parent: Option<usize>,
rest_transform: Transform3D,
) -> usize
pub fn add_joint( &mut self, name: &str, parent: Option<usize>, rest_transform: Transform3D, ) -> usize
Sourcepub fn sample_pose_snapshot_into(
&self,
clip: &AnimationClip3D,
time_secs: f32,
cut: bool,
out: &mut SkeletonPoseSnapshot,
)
pub fn sample_pose_snapshot_into( &self, clip: &AnimationClip3D, time_secs: f32, cut: bool, out: &mut SkeletonPoseSnapshot, )
Samples normalized local joint transforms at time_secs for clip into an existing SkeletonPoseSnapshot with zero allocations.
§Arguments
&Self- Skeleton rig reference.&AnimationClip3D- Active animation clip.f32- Playback timestamp in seconds.bool- Whether this sample represents a discontinuous animation cut.&mut SkeletonPoseSnapshot- Reusable destination pose snapshot overwritten in place.
Sourcepub fn sample_pose_snapshot(
&self,
clip: &AnimationClip3D,
time_secs: f32,
cut: bool,
) -> SkeletonPoseSnapshot
pub fn sample_pose_snapshot( &self, clip: &AnimationClip3D, time_secs: f32, cut: bool, ) -> SkeletonPoseSnapshot
Samples normalized local joint transforms at time_secs for clip into a SkeletonPoseSnapshot.
§Arguments
&Self- Skeleton rig reference.&AnimationClip3D- Active animation clip.f32- Playback timestamp in seconds.bool- Whether this sample represents a discontinuous animation cut.
§Returns
SkeletonPoseSnapshot- Immutable local joint pose snapshot suitable for render-time interpolation.
Sourcepub fn evaluate_world_matrices_into(
&self,
pose: &SkeletonPoseSnapshot,
root_world: Transform3D,
out: &mut Vec<Mat4>,
)
pub fn evaluate_world_matrices_into( &self, pose: &SkeletonPoseSnapshot, root_world: Transform3D, out: &mut Vec<Mat4>, )
Evaluates hierarchical world-space Mat4 joint palettes from pose into a reusable caller buffer with zero allocations.
§Arguments
&Self- Skeleton rig reference.&SkeletonPoseSnapshot- Local joint pose snapshot.Transform3D- Root world transform of the animated actor.&mut Vec<Mat4>- Reusable output palette buffer cleared and populated in place.
Sourcepub fn evaluate_world_matrices(
&self,
pose: &SkeletonPoseSnapshot,
root_world: Transform3D,
) -> Vec<Mat4>
pub fn evaluate_world_matrices( &self, pose: &SkeletonPoseSnapshot, root_world: Transform3D, ) -> Vec<Mat4>
Evaluates hierarchical world-space Mat4 joint palettes from an interpolated SkeletonPoseSnapshot.
§Arguments
&Self- Skeleton rig reference.&SkeletonPoseSnapshot- Local joint pose snapshot (e.g. interpolated between two fixed steps).Transform3D- Interpolated root world transform of the animated actor.
§Returns
Vec<Mat4>- World-space bone matrices indexed by joint id.
Sourcepub fn sample_world_matrices_into(
&self,
clip: &AnimationClip3D,
time_secs: f32,
root_world: Transform3D,
pose_scratch: &mut SkeletonPoseSnapshot,
out_matrices: &mut Vec<Mat4>,
)
pub fn sample_world_matrices_into( &self, clip: &AnimationClip3D, time_secs: f32, root_world: Transform3D, pose_scratch: &mut SkeletonPoseSnapshot, out_matrices: &mut Vec<Mat4>, )
Samples clip at time_secs and writes world-space Mat4 joint palettes into reusable scratch buffers with zero allocations.
§Arguments
&Self- Skeleton rig reference.&AnimationClip3D- Active animation clip.f32- Playback timestamp in seconds.Transform3D- Root world transform of the animated actor.&mut SkeletonPoseSnapshot- Reusable local pose scratch buffer.&mut Vec<Mat4>- Reusable world-matrix output buffer.
Sourcepub fn sample_world_matrices(
&self,
clip: &AnimationClip3D,
time_secs: f32,
root_world: Transform3D,
) -> Vec<Mat4>
pub fn sample_world_matrices( &self, clip: &AnimationClip3D, time_secs: f32, root_world: Transform3D, ) -> Vec<Mat4>
Evaluates hierarchical world-space Mat4 joint palettes at time_secs for clip.
§Arguments
&Self- Skeleton rig reference.&AnimationClip3D- Active animation clip.f32- Playback timestamp in seconds.Transform3D- Root world transform of the animated actor.
§Returns
Vec<Mat4>- World-space bone matrices indexed by joint id.