fix: clippy warnings

This commit is contained in:
Kristofers Solo 2025-01-17 12:41:22 +02:00
parent 48a39d4430
commit 62a91f5765
2 changed files with 2 additions and 3 deletions

View File

@ -1,6 +1,6 @@
use bevy::{input::mouse::MouseWheel, prelude::*};
use crate::constants::{BASE_ZOOM_SPEED, DISTANCE_SCALE_FACTOR, MAX_ZOOM, MIN_ZOOM};
use crate::constants::{BASE_ZOOM_SPEED, MAX_ZOOM, MIN_ZOOM};
pub(super) fn plugin(app: &mut App) {
app.add_systems(Update, camera_zoom);
@ -39,7 +39,7 @@ fn camera_zoom(
let current_distance = transform.translation.length();
// Calculate zoom speed based on distance
let distance_multiplier = (current_distance / MIN_ZOOM).powf(DISTANCE_SCALE_FACTOR);
let distance_multiplier = (current_distance / MIN_ZOOM).sqrt();
let adjusted_zoom_speed = BASE_ZOOM_SPEED * distance_multiplier;
let mut zoom_delta = 0.0;

View File

@ -17,4 +17,3 @@ pub const TIME_REFERENCE_SECONDS: f32 = 60.0; // Reference time for score calcul
pub const BASE_ZOOM_SPEED: f32 = 10.0;
pub const MIN_ZOOM: f32 = 50.0;
pub const MAX_ZOOM: f32 = 2500.0;
pub const DISTANCE_SCALE_FACTOR: f32 = 0.5; // Adjust this to control how much distance affects zoom speed