Crazy cliffs

This commit is contained in:
Joshua Barretto 2019-06-10 00:40:16 +01:00
parent 414b730b59
commit 7f5a0970f1
2 changed files with 17 additions and 3 deletions

View File

@ -66,7 +66,21 @@ impl<'a> Sampler for BlockGen<'a> {
.mul((chaos - 0.1).max(0.0))
.mul(90.0);
let height = alt + warp;
let cliff = (self.world.sim()
.gen_ctx
.warp_nz
.get((wposf.div(Vec3::new(150.0, 150.0, 150.0))).into_array())
as f32)
//.add(0.6)
.mul(130.0);
let is_cliff = (self.world.sim()
.gen_ctx
.warp_nz
.get((wposf.div(Vec3::new(100.0, 100.0, 100.0))).into_array())
as f32) > 0.0;//4;
let height = alt + warp + if is_cliff { cliff } else { 0.0 };
// Sample blocks

View File

@ -140,7 +140,7 @@ impl WorldSim {
}
}
const Z_TOLERANCE: (f32, f32) = (128.0, 64.0);
const Z_TOLERANCE: (f32, f32) = (128.0, 128.0);
pub struct SimChunk {
pub chaos: f32,
@ -179,7 +179,7 @@ impl SimChunk {
let alt_base = alt_base
.mul(0.4)
.add(alt_base.mul(128.0).sin().mul(0.005))
.mul(800.0);
.mul(400.0);
let alt_main = (gen_ctx.alt_nz.get((wposf.div(1_000.0)).into_array()) as f32)
.abs()