mirror of
https://github.com/bevyengine/bevy
synced 2024-11-27 15:10:19 +00:00
Better implementation
This commit is contained in:
parent
6e84ad5a92
commit
f1334405ba
1 changed files with 5 additions and 5 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue