Skip to content

Commit

Permalink
rustfmt
Browse files Browse the repository at this point in the history
  • Loading branch information
oli-obk committed Dec 1, 2023
1 parent a8b738a commit edaee43
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/flycam.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,18 @@ fn setup(
keys.toggle_grab_cursor = KeyCode::G;
}


fn update_camera_speed(
mut movement_settings: ResMut<MovementSettings>,
fly_cam: Query<&Transform, (With<FlyCam>, Without<TileMap>)>,
tilemap: Query<&Transform, (With<TileMap>, Without<FlyCam>)>,
) {
let speed = 1. * (fly_cam.single().translation.distance(tilemap.single().translation) - crate::geopos::EARTH_RADIUS);
movement_settings.speed = speed.clamp(0.1,1000.);
let speed = 1.
* (fly_cam
.single()
.translation
.distance(tilemap.single().translation)
- crate::geopos::EARTH_RADIUS);
movement_settings.speed = speed.clamp(0.1, 1000.);
}

// Todo ? Merge both to fn update? To many different parameters?
Expand Down

0 comments on commit edaee43

Please sign in to comment.