Dynamic loading, saving, generating chunks works
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
use cgmath::Point3;
|
||||
use cgmath::Vector3;
|
||||
use noise::{Perlin, NoiseFn};
|
||||
use rand::{Rng, prelude::ThreadRng};
|
||||
|
||||
@@ -39,7 +39,7 @@ impl WorldGen {
|
||||
/*
|
||||
* Generate block
|
||||
*/
|
||||
pub fn generate(block_pos: &Point3<i32>, block: &mut WorldBlock) {
|
||||
pub fn generate(block_pos: &Vector3<i32>, block: &mut WorldBlock) {
|
||||
let mut rng = rand::thread_rng();
|
||||
let noise = Perlin::new();
|
||||
|
||||
@@ -52,7 +52,7 @@ impl WorldGen {
|
||||
let h = map[x][z];
|
||||
//let h = 16; // testing
|
||||
for y in 0..h {
|
||||
block.set(Point3{x, y, z}, 2);
|
||||
block.set(Vector3{x, y, z}, 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user