update toolchain to

This commit is contained in:
Marcel Märtens
2020-02-09 22:15:10 +01:00
parent 9f0307b926
commit 8f5e409ac4
4 changed files with 8 additions and 8 deletions

View File

@ -57,12 +57,12 @@ impl Input {
/// Whether it's the first frame this input has been in /// Whether it's the first frame this input has been in
/// its current state /// its current state
pub fn is_just_pressed(&self) -> bool { (self.just_changed && self.is_pressed()) } pub fn is_just_pressed(&self) -> bool { self.just_changed && self.is_pressed() }
/// Whether input has been in current state longer than /// Whether input has been in current state longer than
/// `DEFAULT_HOLD_DURATION` /// `DEFAULT_HOLD_DURATION`
pub fn is_held_down(&self) -> bool { pub fn is_held_down(&self) -> bool {
(self.is_pressed() && self.duration >= DEFAULT_HOLD_DURATION) self.is_pressed() && self.duration >= DEFAULT_HOLD_DURATION
} }
/// Handles logic of updating state of Input /// Handles logic of updating state of Input

View File

@ -1 +1 @@
nightly-2020-01-18 nightly-2020-02-06

View File

@ -574,7 +574,7 @@ impl WorldSim {
fn spring(x: f64, pow: f64) -> f64 { x.abs().powf(pow) * x.signum() } fn spring(x: f64, pow: f64) -> f64 { x.abs().powf(pow) * x.signum() }
(0.0 + alt_main 0.0 + alt_main
+ (gen_ctx + (gen_ctx
.small_nz .small_nz
.get( .get(
@ -590,7 +590,7 @@ impl WorldSim {
.mul(0.3) .mul(0.3)
.add(1.0) .add(1.0)
.mul(0.4) .mul(0.4)
+ spring(alt_main.abs().powf(0.5).min(0.75).mul(60.0).sin(), 4.0).mul(0.045)) + spring(alt_main.abs().powf(0.5).min(0.75).mul(60.0).sin(), 4.0).mul(0.045)
}; };
// Now we can compute the final altitude using chaos. // Now we can compute the final altitude using chaos.
@ -669,7 +669,7 @@ impl WorldSim {
let alt_exp_max_uniform = inv_func(max_epsilon); let alt_exp_max_uniform = inv_func(max_epsilon);
let erosion_factor = |x: f64| { let erosion_factor = |x: f64| {
((inv_func(x) - alt_exp_min_uniform) / (alt_exp_max_uniform - alt_exp_min_uniform)) (inv_func(x) - alt_exp_min_uniform) / (alt_exp_max_uniform - alt_exp_min_uniform)
}; };
let rock_strength_div_factor = (2.0 * TerrainChunkSize::RECT_SIZE.x as f64) / 8.0; let rock_strength_div_factor = (2.0 * TerrainChunkSize::RECT_SIZE.x as f64) / 8.0;
let theta_func = |_posi| 0.4; let theta_func = |_posi| 0.4;

View File

@ -175,12 +175,12 @@ pub fn uniform_noise<F: Float + Send>(
let mut noise = (0..WORLD_SIZE.x * WORLD_SIZE.y) let mut noise = (0..WORLD_SIZE.x * WORLD_SIZE.y)
.into_par_iter() .into_par_iter()
.filter_map(|i| { .filter_map(|i| {
(f( f(
i, i,
(uniform_idx_as_vec2(i) * TerrainChunkSize::RECT_SIZE.map(|e| e as i32)) (uniform_idx_as_vec2(i) * TerrainChunkSize::RECT_SIZE.map(|e| e as i32))
.map(|e| e as f64), .map(|e| e as f64),
) )
.map(|res| (i, res))) .map(|res| (i, res))
}) })
.collect::<Vec<_>>(); .collect::<Vec<_>>();