pub struct Pose {
pub local_transforms: Vec<Transform3D>,
}Expand description
Per-bone local transforms representing a character pose.
The length of local_transforms matches Skeleton::len().
Fields§
§local_transforms: Vec<Transform3D>Implementations§
Source§impl Pose
impl Pose
Sourcepub fn new(bone_count: usize) -> Self
pub fn new(bone_count: usize) -> Self
Create a pose for a skeleton with bone_count bones, initialised to identity.
pub fn is_empty(&self) -> bool
Sourcepub fn get(&self, id: BoneId) -> Option<Transform3D>
pub fn get(&self, id: BoneId) -> Option<Transform3D>
Get the local transform for bone id.
Sourcepub fn set(&mut self, id: BoneId, xform: Transform3D)
pub fn set(&mut self, id: BoneId, xform: Transform3D)
Set the local transform for bone id.
Sourcepub fn blend(&self, other: &Pose, t: f32) -> Pose
pub fn blend(&self, other: &Pose, t: f32) -> Pose
Linear blend: self * (1 - t) + other * t.
Both poses must have the same number of bones.
Sourcepub fn add_pose(&self, additive: &Pose, weight: f32) -> Pose
pub fn add_pose(&self, additive: &Pose, weight: f32) -> Pose
Additive blend: apply additive on top of self with weight.
The additive pose is interpreted relative to the reference (identity) pose.
Sourcepub fn apply_mask(&self, other: &Pose, mask: &BoneMask) -> Pose
pub fn apply_mask(&self, other: &Pose, mask: &BoneMask) -> Pose
Apply a bone mask: for each bone, blend between self (original)
and other according to the mask weight for that bone.
Bones absent from the mask are kept from self.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Pose
impl RefUnwindSafe for Pose
impl Send for Pose
impl Sync for Pose
impl Unpin for Pose
impl UnsafeUnpin for Pose
impl UnwindSafe for Pose
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.