Move debug_vectors_enabled flag to Scene

This commit is contained in:
juliancoffee 2024-02-06 14:25:47 +02:00
parent ff3f1b9b1c
commit ce98de4370
3 changed files with 5 additions and 5 deletions

View File

@ -311,8 +311,6 @@ pub struct Client {
flashing_lights_enabled: bool,
pub debug_vectors_enabled: bool,
/// Terrrain view distance
server_view_distance_limit: Option<u32>,
view_distance: Option<u32>,
@ -989,7 +987,6 @@ impl Client {
dt_adjustment: 1.0,
connected_server_constants: server_constants,
debug_vectors_enabled: false,
})
}

View File

@ -123,6 +123,8 @@ pub struct Scene {
pub interpolated_time_of_day: Option<f64>,
last_lightning: Option<(Vec3<f32>, f64)>,
local_time: f64,
pub debug_vectors_enabled: bool,
}
pub struct SceneData<'a> {
@ -362,6 +364,7 @@ impl Scene {
interpolated_time_of_day: None,
last_lightning: None,
local_time: 0.0,
debug_vectors_enabled: false,
}
}
@ -1649,7 +1652,7 @@ impl Scene {
lines.fluid_vel.take().map(|id| self.debug.remove_shape(id));
lines.wind.take().map(|id| self.debug.remove_shape(id));
lines.vel.take().map(|id| self.debug.remove_shape(id));
if client.debug_vectors_enabled {
if self.debug_vectors_enabled {
let ecs = client.state().ecs();
let vels = &ecs.read_component::<comp::Vel>();

View File

@ -103,7 +103,7 @@ impl EguiState {
}
},
EguiAction::SetShowDebugVector(enabled) => {
client.debug_vectors_enabled = enabled;
scene.debug_vectors_enabled = enabled;
},
});