This commit is contained in:
2024-03-27 00:17:23 -04:00
parent c01b927dfb
commit 5c9b5efbf8
12 changed files with 191 additions and 30 deletions

View File

@@ -3,8 +3,7 @@ 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);
}
}