Fixed screw-up

This commit is contained in:
Joshua Barretto 2020-04-17 23:21:58 +01:00
parent 3541305ff4
commit 7d4443cbcd

View File

@ -376,7 +376,7 @@ impl Floor {
};
let wall_thickness = 3.0;
let dist_to_wall = self.nearest_wall(rpos).map(|nearest| nearest.distance(rpos) as f32).unwrap_or(TILE_SIZE as f32);
let dist_to_wall = self.nearest_wall(rpos).map(|nearest| (nearest.distance_squared(rpos) as f32).sqrt()).unwrap_or(TILE_SIZE as f32);
let tunnel_dist = 1.0 - (dist_to_wall.powf(2.0) - wall_thickness).max(0.0).sqrt() / TILE_SIZE as f32;
move |z| {