diff options
| author | Jon Santmyer <jon@jonsantmyer.com> | 2026-05-07 10:12:11 -0400 |
|---|---|---|
| committer | Jon Santmyer <jon@jonsantmyer.com> | 2026-05-07 10:12:11 -0400 |
| commit | c9041e2e6fe59d6127bb1085b874e8e3cda8000e (patch) | |
| tree | c339cf86b88743b1c74707f6d714b1a0950c43ff /src/ui/camera_info.rs | |
| parent | c1adf64c1aaecd5a2b9d532d707ef35971f1aa18 (diff) | |
| download | systemic4x-c9041e2e6fe59d6127bb1085b874e8e3cda8000e.tar.gz systemic4x-c9041e2e6fe59d6127bb1085b874e8e3cda8000e.tar.bz2 systemic4x-c9041e2e6fe59d6127bb1085b874e8e3cda8000e.zip | |
more intense position-relative rendering to fix some precision problems
Diffstat (limited to 'src/ui/camera_info.rs')
| -rw-r--r-- | src/ui/camera_info.rs | 58 |
1 files changed, 0 insertions, 58 deletions
diff --git a/src/ui/camera_info.rs b/src/ui/camera_info.rs deleted file mode 100644 index 5332370..0000000 --- a/src/ui/camera_info.rs +++ /dev/null @@ -1,58 +0,0 @@ -use std::cell::RefCell; - -use crate::{GameState, eguictx::EguiCtx, solar_system, ui}; - - -#[derive(Default, Clone)] -pub struct CameraWindowState -{ - pub camera_scale: f32, - pub camera_pos: Option<cgmath::Vector3<f64>>, - pub camera_rot: Option<cgmath::Vector2<cgmath::Rad<f32>>>, - pub target: Option<solar_system::body::BodyId>, -} - -impl CameraWindowState -{ - pub fn render( - ui_state: &mut ui::State, - game_state: &GameState, - eguictx: &EguiCtx) - { - let topbar_state = &ui_state.topbar_sate; - if topbar_state.current_system.is_none() { - return; - } - - let camera_state = &mut ui_state.camera_info; - - let current_system = &game_state.solar_systems()[topbar_state.current_system.unwrap()]; - - egui::Window::new("Debug Camera Info") - .title_bar(false) - .show(eguictx.context(), |ui| { - ui.vertical(|ui| { - let selected_body_label = match camera_state.target { - Some(id) => current_system.bodies()[id].name(), - None => "" - }; - - ui.separator(); - - egui::ComboBox::from_label("Camera Target") - .selected_text(selected_body_label) - .show_ui(ui, |ui| { - - for (i, body) in current_system.bodies().iter().enumerate() { - ui.selectable_value( - &mut camera_state.target, - Some(i), - body.name()); - } - }); - - ui.label(format!("Scale: {}", camera_state.camera_scale)); - }); - }); - } -} |
