added path finding
This commit is contained in:
@@ -34,11 +34,10 @@ use crate::{
|
||||
},
|
||||
utlis::{
|
||||
chunk_utils::{paint_map, prepare_chunk_mesh_with_collider},
|
||||
render_distance_system::RenderDistanceVisibility,
|
||||
},
|
||||
};
|
||||
|
||||
use super::{chunk_rebuild::ChunkRebuildPlugin, terraforming_test::TerraFormingTestPlugin};
|
||||
use super::{chunk_rebuild::ChunkRebuildPlugin, render_distance_system::RenderDistanceVisibility, terraforming_test::TerraFormingTestPlugin};
|
||||
|
||||
pub struct MapInitPlugin;
|
||||
|
||||
|
||||
@@ -2,3 +2,4 @@ pub mod chunk_rebuild;
|
||||
pub mod map_init;
|
||||
pub mod prelude;
|
||||
pub mod terraforming_test;
|
||||
pub mod render_distance_system;
|
||||
|
||||
@@ -9,9 +9,6 @@ impl Plugin for RenderDistancePlugin {
|
||||
app.register_type::<RenderDistanceSettings>();
|
||||
app.add_systems(PostUpdate, render_distance_system)
|
||||
.insert_resource(RenderDistanceSettings::default());
|
||||
|
||||
#[cfg(debug_assertions)]
|
||||
app.insert_resource(RenderDistanceSettings::new(f32::MAX));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
use crate::camera_system::components::PhosCamera;
|
||||
use crate::map_rendering::map_init::MapInitPlugin;
|
||||
use crate::map_rendering::render_distance_system::RenderDistancePlugin;
|
||||
use crate::utlis::editor_plugin::EditorPlugin;
|
||||
use crate::utlis::render_distance_system::RenderDistancePlugin;
|
||||
use crate::utlis::tile_selection_plugin::TileSelectionPlugin;
|
||||
use crate::{camera_system::camera_plugin::PhosCameraPlugin, utlis::debug_plugin::DebugPlugin};
|
||||
use bevy::{
|
||||
|
||||
@@ -1,16 +1,7 @@
|
||||
use bevy::{prelude::*, window::PrimaryWindow};
|
||||
use bevy_inspector_egui::bevy_egui::{systems::InputEvents, EguiContexts};
|
||||
use bevy_inspector_egui::egui;
|
||||
use bevy_rapier3d::prelude::*;
|
||||
use bevy::prelude::*;
|
||||
use shared::resources::TileUnderCursor;
|
||||
use shared::states::GameplayState;
|
||||
use shared::tags::MainCamera;
|
||||
use world_generation::{
|
||||
consts::HEX_CORNERS,
|
||||
hex_utils::{HexCoord, INNER_RADIUS},
|
||||
prelude::Map,
|
||||
states::GeneratorState,
|
||||
};
|
||||
use world_generation::{consts::HEX_CORNERS, prelude::Map, states::GeneratorState};
|
||||
|
||||
pub struct DebugPlugin;
|
||||
|
||||
@@ -76,24 +67,10 @@ fn show_tile_heights(map: Res<Map>, mut gizmos: Gizmos, shape: Res<Shape>, tile_
|
||||
Quat::IDENTITY,
|
||||
Color::WHITE,
|
||||
);
|
||||
let nbors = map.get_neighbors(&contact.tile);
|
||||
let contact_tile_pos = contact.tile.to_world(map.sample_height(&contact.tile));
|
||||
|
||||
// for i in 0..6 {
|
||||
// if let Some(s) = nbors[i] {
|
||||
// let coord = contact.tile.get_neighbor(i);
|
||||
// let p = coord.to_world(s);
|
||||
// gizmos.arrow(p, p + Vec3::Y * (i as f32 + 1.0), Color::WHITE);
|
||||
// }
|
||||
|
||||
// let p = HEX_CORNERS[i] + contact_tile_pos;
|
||||
// gizmos.arrow(p, p + Vec3::Y * (i as f32 + 1.0), LinearRgba::rgb(1.0, 0.0, 0.5));
|
||||
// }
|
||||
|
||||
gizmos.line(contact.point, contact.point + Vec3::X, LinearRgba::RED);
|
||||
gizmos.line(contact.point, contact.point + Vec3::Y, LinearRgba::GREEN);
|
||||
gizmos.line(contact.point, contact.point + Vec3::Z, LinearRgba::BLUE);
|
||||
//gizmos.sphere(contact_point, Quat::IDENTITY, 0.1, LinearRgba::rgb(1., 0., 0.5));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
pub mod chunk_utils;
|
||||
pub mod render_distance_system;
|
||||
pub mod debug_plugin;
|
||||
pub mod editor_plugin;
|
||||
pub mod tile_selection_plugin;
|
||||
|
||||
Reference in New Issue
Block a user