diff --git a/crates/bevy_animation/src/lib.rs b/crates/bevy_animation/src/lib.rs index 90545ecaa465b..a389da5176d32 100644 --- a/crates/bevy_animation/src/lib.rs +++ b/crates/bevy_animation/src/lib.rs @@ -138,6 +138,7 @@ pub enum Interpolation { } impl Interpolation { + #[inline(always)] fn interpolate( self, lerp: f32, @@ -165,6 +166,7 @@ impl Interpolation { } } + #[inline(always)] fn step_size(self) -> usize { match self { Interpolation::Linear | Interpolation::Step => 1, @@ -177,19 +179,22 @@ trait Interpolatable: Sized + Copy + Mul + Add Self; } -impl Interpolatable for Vec3 { +impl Interpolatable for f32 { + #[inline(always)] fn _lerp(self, rhs: Self, t: f32) -> Self { self.lerp(rhs, t) } } -impl Interpolatable for f32 { +impl Interpolatable for Vec3 { + #[inline(always)] fn _lerp(self, rhs: Self, t: f32) -> Self { self.lerp(rhs, t) } } impl Interpolatable for Quat { + #[inline(always)] fn _lerp(self, rhs: Self, t: f32) -> Self { self.slerp(rhs, t) }