finally realized that bevy uses right handed coords
This commit is contained in:
@@ -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};
|
||||
|
||||
@@ -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 };
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user