pub struct BonePose<'a> { /* private fields */ }
Expand description
A pose of a Bone, referring to it so that many poses can use the same Bone.
A BonePose has a current Transformation which indicates how it is posed; the Bone contains mapping matrices for going from bone-parent space to bone space, and for going from mesh space to bone space
Implementations§
Source§impl<'a> BonePose<'a>
impl<'a> BonePose<'a>
Sourcepub fn transformation_reset(&mut self)
pub fn transformation_reset(&mut self)
Reset the pose transformation to that of the bone in the skeleton
Sourcepub fn set_transformation(&mut self, transform: Transformation)
pub fn set_transformation(&mut self, transform: Transformation)
Set a new pose transformation for the posed bone
Sourcepub fn derive_animation(
&mut self,
is_root: bool,
parent_animated_pbtm: &Mat4,
) -> &Mat4
pub fn derive_animation( &mut self, is_root: bool, parent_animated_pbtm: &Mat4, ) -> &Mat4
Derive the animation matrices given a parent animated-posed-bone-to-mesh matrix
If there is no parent (is_root true) then the animated bone-to-mesh is just the posed-bone-to-parent transformation
If there is a parent then its pose transformation must be preapplied to this; when this animated_btm is applied to a vector (in this local bone space) one must first generate the vector in the parent-bone space (by applying pbtp) and then apply parent pbtm to generate model space
Vectors in the model mesh space can be multiplied by the bones mtb matrix to get a vector in this local bone space, to which the animated_btm can be applied to get a model space vector. Hence multiplying animated_btm and bone.mtb together.
Sourcepub fn borrow_animated_mtm(&self) -> &Mat4
pub fn borrow_animated_mtm(&self) -> &Mat4
Borrow the animated mesh-to-model-space matrix
This assumes it has been derived