feat: improve logger

This commit is contained in:
2024-04-23 20:59:45 +02:00
parent 070a5b52d0
commit 415d773610
4 changed files with 60 additions and 39 deletions

View File

@@ -70,20 +70,27 @@ pub fn execute(input: &[i32]) -> Vec<i32> {
for i in 0..points {
let a = i as f64 / (points - 1) as f64;
let px = Vector2::new(j as f64 + a * length * scale, a * scale as f64);
let pz = Vector2::new(a * scale as f64, j as f64 + a * length * scale);
let px = Vector2::new(1000.0 + j as f64 + a * length * scale, a * scale as f64);
let py = Vector2::new(2000.0 + j as f64 + a * length * scale, a * scale as f64);
let pz = Vector2::new(3000.0 + j as f64 + a * length * scale, a * scale as f64);
let nx = open_simplex_2d(px, &hasher) as f32
* strength
* 0.1
* lerp(1.0, a as f32, fix_bottom);
let ny = open_simplex_2d(py, &hasher) as f32
* strength
* 0.1
* lerp(1.0, a as f32, fix_bottom);
let nz = open_simplex_2d(pz, &hasher) as f32
* strength
* 0.1
* lerp(1.0, a as f32, fix_bottom);
plant[3 + i * 4] = encode_float(decode_float(plant[3 + i * 4]) + nx);
plant[4 + i * 4] = encode_float(decode_float(plant[4 + i * 4]) + ny);
plant[5 + i * 4] = encode_float(decode_float(plant[5 + i * 4]) + nz);
}