Added generation of images based on the map
Tweaks to consistency with DIRECTIONS and HEX_CORNERS Misc debug visualizations
This commit is contained in:
@@ -14,6 +14,7 @@ use world_generation::{
|
||||
biome_painter::*,
|
||||
heightmap::generate_heightmap,
|
||||
hex_utils::{offset_to_index, SHORT_DIAGONAL},
|
||||
map::map_utils::{render_biome_map, render_map},
|
||||
prelude::*,
|
||||
tile_manager::*,
|
||||
tile_mapper::*,
|
||||
@@ -212,6 +213,11 @@ fn create_heightmap(
|
||||
};
|
||||
let heightmap = generate_heightmap(&config, 42069, &biome_painter);
|
||||
|
||||
let game_map = render_map(&heightmap, 1.5);
|
||||
let biome_map = render_biome_map(&heightmap);
|
||||
_ = biome_map.save("Biomes.png");
|
||||
_ = game_map.save("Test.png");
|
||||
|
||||
let (mut cam_t, cam_entity) = cam.single_mut();
|
||||
cam_t.translation = heightmap.get_center();
|
||||
|
||||
|
||||
@@ -90,6 +90,15 @@ fn show_tile_heights(
|
||||
Color::WHITE,
|
||||
);
|
||||
}
|
||||
let nbors = map.get_neighbors(&contact_coord);
|
||||
for i in 0..6 {
|
||||
if let Some(s) = nbors[i] {
|
||||
let coord = contact_coord.get_neighbor(i);
|
||||
let p = coord.to_world(s);
|
||||
gizmos.arrow(p, p + Vec3::Y * (i as f32 + 1.0), Color::WHITE);
|
||||
}
|
||||
}
|
||||
|
||||
gizmos.sphere(contact_point, Quat::IDENTITY, 0.1, Srgba::rgb(1., 0., 0.5));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user