Use nlerp for interpolating rotations in animation

This commit is contained in:
Ludvig Böklin 2021-02-15 11:01:59 +01:00
parent 84990553e0
commit 0f1227ca7d

View File

@ -4178,8 +4178,7 @@ impl<S: Skeleton> FigureState<S> {
/* let radius = vek::Extent3::<f32>::from(model.bounds.half_size()).reduce_partial_max();
let _bounds = BoundingSphere::new(pos.into_array(), scale * 0.8 * radius); */
// self.last_ori = vek::Lerp::lerp(self.last_ori, ori, 15.0 * dt);
self.last_ori = anim::vek::Quaternion::slerp(self.last_ori, ori, 15.0 * dt);
self.last_ori = vek::Lerp::lerp(self.last_ori, ori, 15.0 * dt).normalized();
self.state_time += (dt * state_animation_rate) as f64;