Skip to main content

SkeletonRig3D

Struct SkeletonRig3D 

Source
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.

Source

pub fn add_joint( &mut self, name: &str, parent: Option<usize>, rest_transform: Transform3D, ) -> usize

Appends a joint to the skeleton hierarchy and returns its assigned index.

§Arguments
  • &Self - Mutable skeleton rig.
  • &str - Joint label.
  • Option<usize> - Optional parent joint index.
  • Transform3D - Bind-pose local transform.
§Returns
  • usize - Assigned joint index.
Source

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.
Source

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.
Source

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.
Source

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.
Source

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.
Source

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.
Source§

impl SkeletonRig3D

Source

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

Source

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

Source

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

Trait Implementations§

Source§

impl Clone for SkeletonRig3D

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 SkeletonRig3D

Source§

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

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

impl Default for SkeletonRig3D

Source§

fn default() -> Self

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

impl PartialEq for SkeletonRig3D

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 SkeletonRig3D

Auto Trait Implementations§

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.