move more things

This commit is contained in:
griffi-gh 2023-01-30 03:23:39 +01:00
parent 80be3673a2
commit 0ae2a8ac17
10 changed files with 17 additions and 9 deletions

View file

@ -6,4 +6,6 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
glam = { version = "0.22", features = ["debug-glam-assert", "mint", "fast-math"] }
strum = { version = "0.24", features = ["derive"] }
bracket-noise = "0.8"

4
kubi-shared/src/chunk.rs Normal file
View file

@ -0,0 +1,4 @@
use crate::blocks::Block;
pub const CHUNK_SIZE: usize = 32;
pub type BlockData = Box<[[[Block; CHUNK_SIZE]; CHUNK_SIZE]; CHUNK_SIZE]>;

View file

@ -1 +1,4 @@
pub mod blocks;
pub mod networking;
pub mod worldgen;
pub mod chunk;

View file

@ -0,0 +1,2 @@
pub mod client;
pub mod server;

View file

View file

View file

@ -1,8 +1,8 @@
use glam::{IVec3, ivec3};
use bracket_noise::prelude::*;
use super::{
use crate::{
chunk::{BlockData, CHUNK_SIZE},
block::Block
blocks::Block
};
pub fn generate_world(chunk_position: IVec3, seed: u64) -> BlockData {

View file

@ -6,16 +6,15 @@ edition = "2021"
[dependencies]
kubi-shared = { path = "../kubi-shared" }
glium = "0.32"
glam = { version = "0.22", features = ["debug-glam-assert", "mint", "fast-math"] }
image = { version = "0.24", default_features = false, features = ["png"] }
log = "0.4"
env_logger = "0.10"
strum = { version = "0.24", features = ["derive"] }
glam = { version = "0.22", features = ["debug-glam-assert", "mint", "fast-math"] }
hashbrown = "0.13"
rayon = "1.6"
shipyard = { version = "0.6", features = ["thread_local"] }
nohash-hasher = "0.2.0"
anyhow = "1.0"
flume = "0.10"
bracket-noise = "0.8"
#rkyv = "0.7"

View file

@ -4,13 +4,14 @@ use glam::IVec3;
use hashbrown::HashMap;
use anyhow::{Result, Context};
pub use kubi_shared::worldgen;
pub mod chunk;
pub mod block;
pub mod tasks;
pub mod loading;
pub mod mesh;
pub mod neighbors;
pub mod worldgen;
pub mod raycast;
use chunk::{Chunk, ChunkMesh};

View file

@ -1,11 +1,8 @@
use glam::IVec3;
use glium::{VertexBuffer, IndexBuffer};
use super::block::Block;
use crate::rendering::world::ChunkVertex;
pub const CHUNK_SIZE: usize = 32;
pub type BlockData = Box<[[[Block; CHUNK_SIZE]; CHUNK_SIZE]; CHUNK_SIZE]>;
pub use kubi_shared::chunk::{CHUNK_SIZE, BlockData};
pub struct ChunkData {
pub blocks: BlockData,