Use nlerp for interpolating rotations in animation

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

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 radius = vek::Extent3::<f32>::from(model.bounds.half_size()).reduce_partial_max();
let _bounds = BoundingSphere::new(pos.into_array(), scale * 0.8 * radius); */ 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 = vek::Lerp::lerp(self.last_ori, ori, 15.0 * dt).normalized();
self.last_ori = anim::vek::Quaternion::slerp(self.last_ori, ori, 15.0 * dt);
self.state_time += (dt * state_animation_rate) as f64; self.state_time += (dt * state_animation_rate) as f64;