From 489733bd509937d7c6ef30a87330e66260175888 Mon Sep 17 00:00:00 2001 From: Tobias Berger Date: Sun, 6 Nov 2022 12:10:55 +0100 Subject: [PATCH] Fix timestep for globe rotation --- src/main.rs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index 417596c..9746905 100644 --- a/src/main.rs +++ b/src/main.rs @@ -67,6 +67,7 @@ use { prelude::{Quat, Vec3}, render::camera::OrthographicProjection, render::mesh::{shape::UVSphere, Mesh}, + time::Time, transform::components::Transform, }, std::f32::consts::FRAC_PI_2, @@ -105,10 +106,15 @@ fn update_cursor_map_position( } #[cfg(all(feature = "render", feature = "globe_view"))] -const ROTATION_SPEED: f32 = 0.002; +const GLOBE_ROTATIONS_PER_SECOND: f32 = std::f32::consts::TAU / 15.0; #[cfg(all(feature = "render", feature = "globe_view"))] -fn rotate_globe(mut globe_transform: Query<'_, '_, &mut Transform, With>>) { - globe_transform.single_mut().rotate_y(ROTATION_SPEED); +fn rotate_globe( + mut globe_transform: Query<'_, '_, &mut Transform, With>>, + time: Res