Only change entity orientation when on the ground

This commit is contained in:
Joshua Barretto 2019-07-21 00:18:03 +01:00
parent e8aa654f01
commit 215a09005e
3 changed files with 5 additions and 4 deletions

1
.gitignore vendored
View File

@ -34,3 +34,4 @@
settings.ron
run.sh
screenshots
todo.txt

View File

@ -141,8 +141,8 @@ impl<'a> System<'a> for Sys {
}
}
// Set direction based on velocity
if Vec2::<f32>::from(vel.0).magnitude_squared() > 0.1 {
// Set direction based on velocity when on the ground
if Vec2::<f32>::from(vel.0).magnitude_squared() > 0.1 && a.on_ground {
ori.0 = Lerp::lerp(
ori.0,
vel.0.normalized() * Vec3::new(1.0, 1.0, 0.0),

View File

@ -139,8 +139,8 @@ vec3 get_sky_color(vec3 dir, float time_of_day) {
float fog(vec2 f_pos, vec2 focus_pos) {
float dist = distance(f_pos, focus_pos) / view_distance.x;
float min_fog = 0.75;
float min_fog = 0.5;
float max_fog = 1.0;
return clamp((dist - min_fog) / (max_fog - min_fog), 0.0, 1.0);
return pow(clamp((dist - min_fog) / (max_fog - min_fog), 0.0, 1.0), 1.7);
}