finally realized that bevy uses right handed coords

This commit is contained in:
2024-08-06 20:49:47 -04:00
parent 911cf8d5c3
commit a8409e5720
9 changed files with 42 additions and 25 deletions

View File

@@ -2,7 +2,6 @@ use core::f32;
use bevy::math::{IVec2, UVec2};
use bevy::prelude::{FloatExt, Vec2};
use bevy::render::render_resource::encase::internal::BufferMut;
use bevy::utils::default;
use noise::{NoiseFn, SuperSimplex};
use rayon::iter::{IntoParallelIterator, ParallelIterator};

View File

@@ -72,12 +72,12 @@ impl Display for HexCoord {
impl HexCoord {
pub const DIRECTIONS: [IVec3; 6] = [
IVec3::new(1, -1, 0),
IVec3::new(1, 0, -1),
IVec3::new(0, 1, -1),
IVec3::new(-1, 1, 0),
IVec3::new(-1, 0, 1),
IVec3::new(1, 0, -1),
IVec3::new(1, -1, 0),
IVec3::new(0, -1, 1),
IVec3::new(-1, 0, 1),
IVec3::new(-1, 1, 0),
];
pub const ZERO: HexCoord = HexCoord { hex: IVec3::ZERO };

View File

@@ -11,7 +11,7 @@ impl MeshChunkData {
pub fn get_neighbors(&self, coord: &HexCoord) -> [f32; 6] {
let mut data = [0.; 6];
let n_tiles = coord.get_neighbors();
for i in 6..0 {
for i in 0..6 {
let n = n_tiles[i];
if !n.is_in_bounds(Chunk::SIZE, Chunk::SIZE) {
continue;