amend todos
This commit is contained in:
parent
4d22b8783f
commit
cbe80ca2df
3 changed files with 17 additions and 14 deletions
|
|
@ -32,7 +32,7 @@ pub fn moveCamera(camera: *raylib.Camera3D, vec: raylib.Vector3) void {
|
|||
pub fn createDefaultChunk(a7r: Allocator) !chunks.Chunk {
|
||||
var chunk = try chunks.Chunk.init(a7r);
|
||||
|
||||
// const height_generator = znoise.FnlGenerator{ .seed = 413445 };
|
||||
const height_generator = znoise.FnlGenerator{ .seed = 413445 };
|
||||
const tile_type_generator = znoise.FnlGenerator{ .seed = 4435, .frequency = 0.1 };
|
||||
for (0..32) |raw_x| for (0..32) |raw_y| for (0..32) |raw_z| {
|
||||
const x: u5 = @intCast(raw_x);
|
||||
|
|
@ -42,9 +42,9 @@ pub fn createDefaultChunk(a7r: Allocator) !chunks.Chunk {
|
|||
const yf: f32 = @floatFromInt(raw_y);
|
||||
const zf: f32 = @floatFromInt(raw_z);
|
||||
const tile_type: u32 = if (tile_type_generator.noise3(xf, yf, zf) > 0) 1 else 2;
|
||||
// const height: f32 = (height_generator.noise2(xf, zf) + 1) * 16 + @as(f32, if(x > 24) 4.0 else 0.0) + @as(f32, if(z < 8) 4.0 else 0.0);
|
||||
// if (height >= yf) chunk.setTile(x, y, z, tile_type);
|
||||
if((xf-16)*(xf-16)+(yf-16)*(yf-16)+(zf-16)*(zf-16) < 16*16) chunk.setTile(x, y, z, tile_type);
|
||||
const height: f32 = (height_generator.noise2(xf, zf) + 1) * 16;
|
||||
if (height >= yf) chunk.setTile(x, y, z, tile_type);
|
||||
// if((xf-16)*(xf-16)+(yf-16)*(yf-16)+(zf-16)*(zf-16) < 16*16) chunk.setTile(x, y, z, tile_type);
|
||||
};
|
||||
return chunk;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue