This commit is contained in:
WanderingPenwing 2024-10-08 09:07:09 +02:00
parent 3430f37783
commit 0d0673a0af

View file

@ -113,10 +113,12 @@ pub fn zoom(
mut projection_query: Query<&mut Projection, With<Player>>, mut projection_query: Query<&mut Projection, With<Player>>,
) { ) {
let Ok(mut projection) = projection_query.get_single_mut() else { let Ok(mut projection) = projection_query.get_single_mut() else {
//info!("no camera projection");
return; return;
}; };
let Projection::Perspective(ref mut perspective) = *projection else { let Projection::Perspective(ref mut perspective) = *projection else {
//info!("no camera perspective");
return; return;
}; };
@ -124,9 +126,10 @@ pub fn zoom(
match ev.unit { match ev.unit {
MouseScrollUnit::Line => { MouseScrollUnit::Line => {
perspective.fov = (0.6*PI).min((0.02*PI).max(perspective.fov * 0.9_f32.powf(ev.y))); perspective.fov = (0.6*PI).min((0.02*PI).max(perspective.fov * 0.9_f32.powf(ev.y)));
//info!("Scroll (line units): vertical: {}, horizontal: {}", ev.y, ev.x);
} }
MouseScrollUnit::Pixel => { MouseScrollUnit::Pixel => {
println!("Scroll (pixel units): vertical: {}, horizontal: {}", ev.y, ev.x); //info!("Scroll (pixel units): vertical: {}, horizontal: {}", ev.y, ev.x);
} }
} }
} }