collision fixes

generator changes
This commit is contained in:
2024-09-02 20:53:11 -04:00
parent 9613e3ae0d
commit 2d1fb78ab8
10 changed files with 33 additions and 30 deletions

View File

@@ -5,11 +5,12 @@ use super::chunk::Chunk;
pub struct MeshChunkData {
pub heights: [f32; Chunk::AREA],
pub textures: [[u32; 2]; Chunk::AREA],
pub min_height: f32,
}
impl MeshChunkData {
pub fn get_neighbors(&self, coord: &HexCoord) -> [f32; 6] {
let mut data = [0.; 6];
let mut data = [self.min_height; 6];
let n_tiles = coord.get_neighbors();
for i in 0..6 {
let n = n_tiles[i];