cargo fmt

This commit is contained in:
yuni 2024-11-29 22:40:38 +01:00
parent 4c8a4278a2
commit 568c5a39bf
3 changed files with 22 additions and 7 deletions

View file

@ -16,7 +16,9 @@ use crate::prelude::*;
use bevy::core_pipeline::bloom::{BloomCompositeMode, BloomSettings}; use bevy::core_pipeline::bloom::{BloomCompositeMode, BloomSettings};
use bevy::core_pipeline::tonemapping::Tonemapping; use bevy::core_pipeline::tonemapping::Tonemapping;
use bevy::input::mouse::{MouseMotion, MouseWheel}; use bevy::input::mouse::{MouseMotion, MouseWheel};
use bevy::pbr::{CascadeShadowConfigBuilder, DirectionalLightShadowMap, VolumetricFogSettings, VolumetricLight}; use bevy::pbr::{
CascadeShadowConfigBuilder, DirectionalLightShadowMap, VolumetricFogSettings, VolumetricLight,
};
use bevy::prelude::*; use bevy::prelude::*;
use bevy::transform::TransformSystem; use bevy::transform::TransformSystem;
use bevy::window::PrimaryWindow; use bevy::window::PrimaryWindow;
@ -816,7 +818,10 @@ fn tweak_scene(
} }
} }
pub fn update_volumetric_fog(settings: Res<Settings>, mut q_fog: Query<&mut VolumetricFogSettings>) { pub fn update_volumetric_fog(
settings: Res<Settings>,
mut q_fog: Query<&mut VolumetricFogSettings>,
) {
let mut fog = if let Ok(x) = q_fog.get_single_mut() { let mut fog = if let Ok(x) = q_fog.get_single_mut() {
x x
} else { } else {

View file

@ -480,8 +480,7 @@ fn handle_cheats(
// We targeted something, but it has no velocity. // We targeted something, but it has no velocity.
v.0 = DVec3::ZERO; v.0 = DVec3::ZERO;
} }
} } else {
else {
// We aren't targeting anything. Match orbital velocity. // We aren't targeting anything. Match orbital velocity.
v.0 = nature::orbital_velocity(pos.0 - jupiter_pos.0, nature::JUPITER_MASS); v.0 = nature::orbital_velocity(pos.0 - jupiter_pos.0, nature::JUPITER_MASS);
} }

View file

@ -884,7 +884,7 @@ fn update_speedometer(
atmo += format!("p: {}bar\n", nature::readable_si(val as f64)).as_str(); atmo += format!("p: {}bar\n", nature::readable_si(val as f64)).as_str();
} }
if let Some(val) = settings.atmo_density { if let Some(val) = settings.atmo_density {
atmo += format!("dens: {}g/m³\n", nature::readable_si(val*1000.0)).as_str(); atmo += format!("dens: {}g/m³\n", nature::readable_si(val * 1000.0)).as_str();
} }
if let Some(val) = settings.atmo_drag { if let Some(val) = settings.atmo_drag {
atmo += format!("drag: {}m/s²\n", nature::readable_si(val)).as_str(); atmo += format!("drag: {}m/s²\n", nature::readable_si(val)).as_str();
@ -986,7 +986,16 @@ fn update_hud(
), ),
>, >,
settings: Res<Settings>, settings: Res<Settings>,
q_target: Query<(&IsClickable, &Transform, Option<&Mass>, Option<&Position>, Option<&LinearVelocity>), With<IsTargeted>>, q_target: Query<
(
&IsClickable,
&Transform,
Option<&Mass>,
Option<&Position>,
Option<&LinearVelocity>,
),
With<IsTargeted>,
>,
) { ) {
if timer.0.tick(time.delta()).just_finished() || log.needs_rerendering { if timer.0.tick(time.delta()).just_finished() || log.needs_rerendering {
let q_camera_result = q_camera.get_single(); let q_camera_result = q_camera.get_single();
@ -1059,7 +1068,9 @@ fn update_hud(
let size = nature::readable_si(trans.scale.x as f64 * 2.0); let size = nature::readable_si(trans.scale.x as f64 * 2.0);
let mass = if let Some(mass) = mass { let mass = if let Some(mass) = mass {
nature::readable_si(mass.0 * 0.001) nature::readable_si(mass.0 * 0.001)
} else { String::from("?") }; } else {
String::from("?")
};
text.sections[0].value = text.sections[0].value =
format!("Target: {target_name}\n{pronoun}Distance: {distance}\nSize: {size}m\nMass: {mass}g\n\n"); format!("Target: {target_name}\n{pronoun}Distance: {distance}\nSize: {size}m\nMass: {mass}g\n\n");
} else { } else {