pub struct ResolvedBoneAnimation {
pub bone_id: i32,
pub parent_bone: i16,
pub pivot: C3Vector,
pub translation: Option<(Vec<u32>, Vec<C3Vector>)>,
pub rotation: Option<(Vec<u32>, Vec<[i16; 4]>)>,
pub scale: Option<(Vec<u32>, Vec<C3Vector>)>,
pub bind_pose_translation: C3Vector,
pub bind_pose_rotation: [f32; 4],
pub bind_pose_scale: C3Vector,
}Expand description
Resolved bone animation data with actual keyframe values
Fields§
§bone_id: i32Bone ID
parent_bone: i16Parent bone ID
pivot: C3VectorBone pivot point
translation: Option<(Vec<u32>, Vec<C3Vector>)>Translation keyframes (timestamps, values)
rotation: Option<(Vec<u32>, Vec<[i16; 4]>)>Rotation keyframes (timestamps, quaternions as compressed format)
scale: Option<(Vec<u32>, Vec<C3Vector>)>Scale keyframes (timestamps, values)
bind_pose_translation: C3VectorBind pose translation (first keyframe or default)
bind_pose_rotation: [f32; 4]Bind pose rotation (first keyframe or identity)
bind_pose_scale: C3VectorBind pose scale (first keyframe or 1,1,1)
Implementations§
Source§impl ResolvedBoneAnimation
impl ResolvedBoneAnimation
Sourcepub fn from_bone<R: Read + Seek>(bone: &M2Bone, reader: &mut R) -> Result<Self>
pub fn from_bone<R: Read + Seek>(bone: &M2Bone, reader: &mut R) -> Result<Self>
Extract bind pose from the first keyframe or use defaults
Sourcepub fn has_animation(&self) -> bool
pub fn has_animation(&self) -> bool
Check if this bone has any animation data
Sourcepub fn translation_keyframe_count(&self) -> usize
pub fn translation_keyframe_count(&self) -> usize
Get the number of translation keyframes
Sourcepub fn rotation_keyframe_count(&self) -> usize
pub fn rotation_keyframe_count(&self) -> usize
Get the number of rotation keyframes
Sourcepub fn scale_keyframe_count(&self) -> usize
pub fn scale_keyframe_count(&self) -> usize
Get the number of scale keyframes
Trait Implementations§
Source§impl Clone for ResolvedBoneAnimation
impl Clone for ResolvedBoneAnimation
Source§fn clone(&self) -> ResolvedBoneAnimation
fn clone(&self) -> ResolvedBoneAnimation
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ResolvedBoneAnimation
impl RefUnwindSafe for ResolvedBoneAnimation
impl Send for ResolvedBoneAnimation
impl Sync for ResolvedBoneAnimation
impl Unpin for ResolvedBoneAnimation
impl UnwindSafe for ResolvedBoneAnimation
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more