Version bump rand

This commit is contained in:
2021-05-31 10:10:45 -07:00
parent 9dcb36612d
commit bf8b533b15
13 changed files with 1179 additions and 1127 deletions

View File

@@ -22,7 +22,7 @@ impl Lode {
for x in 0..NOISE_SIZE {
for y in 0..NOISE_SIZE {
for z in 0..NOISE_SIZE {
noise[x][y][z] = rng.gen_range(0., 1.);
noise[x][y][z] = rng.gen();
}
}
}

View File

@@ -1,6 +1,7 @@
// There are many math functions in this file, so we allow single letter variable names.
#![allow(clippy::many_single_char_names)]
use log::trace;
use rand::seq::SliceRandom;
use rand::Rng;
use crate::noise::NoiseSource;
@@ -21,9 +22,9 @@ where
(0..256)
.map(|_| {
Vec3::new(
rng.gen_range(-1., 1.),
rng.gen_range(-1., 1.),
rng.gen_range(-1., 1.),
rng.gen_range(-1. ..1.),
rng.gen_range(-1. ..1.),
rng.gen_range(-1. ..1.),
)
.unit_vector()
})
@@ -35,7 +36,7 @@ where
R: Rng,
{
let mut p: Vec<usize> = (0..256).map(|i| i).collect();
rng.shuffle(&mut p);
p.shuffle(rng);
p
}