#[repr(C)]pub struct BoneTransform {
pub position: Vec2,
pub rotation: f32,
pub scale: Vec2,
}Expand description
Affine transform for a single bone: position, rotation (radians), scale.
Fields§
§position: Vec2Translation offset relative to the parent bone (or world origin for root).
rotation: f32Rotation in radians (counter-clockwise positive).
scale: Vec2Non-uniform scale.
Implementations§
Source§impl BoneTransform
impl BoneTransform
Sourcepub fn lerp(self, other: BoneTransform, t: f32) -> BoneTransform
pub fn lerp(self, other: BoneTransform, t: f32) -> BoneTransform
Linearly interpolates between self and other by factor t.
Position and scale use Vec2::lerp; rotation uses shortest-path
angle interpolation so that crossing the ±PI boundary works correctly.
Sourcepub fn to_matrix(&self) -> [[f32; 3]; 3]
pub fn to_matrix(&self) -> [[f32; 3]; 3]
Builds a 3x3 affine matrix (scale * rotate * translate) stored row-major.
The matrix applies scale, then rotation, then translation:
| sx*cos -sy*sin tx |
| sx*sin sy*cos ty |
| 0 0 1 |Sourcepub fn combine(parent: &BoneTransform, child: &BoneTransform) -> BoneTransform
pub fn combine(parent: &BoneTransform, child: &BoneTransform) -> BoneTransform
Composes parent and child transforms: parent * child.
Applies TRS composition: scales child position by parent scale, then rotates by parent rotation, then translates by parent position. Rotations accumulate additively; scales multiply component-wise.
Trait Implementations§
Source§impl Clone for BoneTransform
impl Clone for BoneTransform
Source§fn clone(&self) -> BoneTransform
fn clone(&self) -> BoneTransform
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for BoneTransform
impl Debug for BoneTransform
Source§impl Default for BoneTransform
impl Default for BoneTransform
Source§fn default() -> BoneTransform
fn default() -> BoneTransform
Identity transform: zero position, zero rotation, unit scale.
Source§impl PartialEq for BoneTransform
impl PartialEq for BoneTransform
impl Copy for BoneTransform
impl StructuralPartialEq for BoneTransform
Auto Trait Implementations§
impl Freeze for BoneTransform
impl RefUnwindSafe for BoneTransform
impl Send for BoneTransform
impl Sync for BoneTransform
impl Unpin for BoneTransform
impl UnsafeUnpin for BoneTransform
impl UnwindSafe for BoneTransform
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
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>
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>
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 moreSource§impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
fn into_sample(self) -> T
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().