Better implementation

This commit is contained in:
Sigma-dev 2024-11-09 12:33:16 +01:00
parent 6e84ad5a92
commit f1334405ba

View file

@ -428,11 +428,11 @@ impl Transform {
/// of the interval `[0,1]` is allowed.
#[inline]
pub fn lerp(&self, rhs: Self, t: f32) -> Self {
let mut transform = Transform::default();
transform.translation = self.translation.lerp(rhs.translation, t);
transform.rotation = self.rotation.lerp(rhs.rotation, t);
transform.scale = self.scale.lerp(rhs.scale, t);
transform
Transform {
translation: self.translation.lerp(rhs.translation, t),
rotation: self.rotation.lerp(rhs.rotation, t),
scale: self.scale.lerp(rhs.scale, t)
}
}
/// Rotates this [`Transform`] so that the `main_axis` vector, reinterpreted in local coordinates, points