Improved orientation slerping

This commit is contained in:
Joshua Barretto 2019-08-04 15:51:17 +01:00
parent e5bcc8912e
commit a324f01a1d
2 changed files with 6 additions and 2 deletions

View File

@ -120,7 +120,11 @@ impl<'a> System<'a> for Sys {
&& (ori.0.normalized() - Vec3::from(ori_dir).normalized()).magnitude_squared()
> 0.001
{
ori.0 = vek::ops::Slerp::slerp(ori.0, ori_dir.into(), 15.0 * dt.0);
ori.0 = vek::ops::Slerp::slerp(
ori.0,
ori_dir.into(),
if a.on_ground { 12.0 } else { 2.0 } * dt.0,
);
}
}

View File

@ -96,7 +96,7 @@ vec3 get_sky_color(vec3 dir, float time_of_day) {
vec3 sky_top = mix(
mix(
SKY_DUSK_TOP,
SKY_DUSK_TOP + star,
SKY_NIGHT_TOP + star,
max(sun_dir.z, 0)
),