mesh generation

This commit is contained in:
2024-03-26 19:30:28 -04:00
parent aada52a45b
commit ad1c3e5370
11 changed files with 218 additions and 64 deletions

View File

@@ -0,0 +1,10 @@
use bevy::prelude::*;
pub const OUTER_RADIUS: f32 = 1.;
pub const INNER_RADIUS: f32 = OUTER_RADIUS * 0.866025404;
pub fn to_hex_pos(pos: Vec3) -> Vec3 {
let x = (pos.x + pos.z * 0.5 - (pos.z / 2.).floor()) * (INNER_RADIUS * 2.);
return Vec3::new(x, pos.y, pos.z * OUTER_RADIUS * 1.5);
}