From 41f647e862080fafeaa843fa0295e4822ac93e71 Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Sun, 23 Jun 2019 00:13:59 +0100 Subject: [PATCH] Added path colouring --- world/src/column/mod.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/world/src/column/mod.rs b/world/src/column/mod.rs index 9fc77b8410..3be71ba02d 100644 --- a/world/src/column/mod.rs +++ b/world/src/column/mod.rs @@ -40,10 +40,10 @@ impl<'a> Sampler for ColumnGen<'a> { let sim = self.world.sim(); let turb = Vec2::new( - world.sim().gen_ctx.turb_x_nz.get((wposf.div(48.0)).into_array()) as f32, - world.sim().gen_ctx.turb_y_nz.get((wposf.div(48.0)).into_array()) as f32, + sim.gen_ctx.turb_x_nz.get((wposf.div(48.0)).into_array()) as f32, + sim.gen_ctx.turb_y_nz.get((wposf.div(48.0)).into_array()) as f32, ) * 12.0; - let wposf_turb = wposf + turb; + let wposf_turb = wposf + turb.map(|e| e as f64); let alt_base = sim.get_interpolated(wpos, |chunk| chunk.alt_base)?; let chaos = sim.get_interpolated(wpos, |chunk| chunk.chaos)?; @@ -141,7 +141,11 @@ impl<'a> Sampler for ColumnGen<'a> { .div(near_0.distance(near_1)); let (alt, ground) = if dist_to_path < 5.0 { - (alt - 1.5, Rgb::new(0.4, 0.25, 0.0)) + (alt - 1.5, Lerp::lerp( + Rgb::new(0.25, 0.15, 0.05), + Rgb::new(0.4, 0.25, 0.0), + marble, + )) } else { (alt, ground) };