tweaked constants

This commit is contained in:
WanderingPenwing 2024-10-07 22:48:07 +02:00
parent 9a1b13b6f9
commit d07780dcdb
2 changed files with 4 additions and 3 deletions

View file

@ -7,10 +7,10 @@ use crate::ConstellationModel;
use crate::Sky; use crate::Sky;
use crate::MainGame; use crate::MainGame;
use crate::spawn_cons_lines; use crate::spawn_cons_lines;
use crate::CONS_VIEW_RADIUS; use crate::CONS_VIEW_RADIUS;
use crate::MOUSE_SPEED;
#[derive(Component)] #[derive(Component)]
pub struct InfoLabel; pub struct InfoLabel;
@ -119,7 +119,7 @@ fn rotate_to_align(ray_1: Ray3d, ray_2: Ray3d) -> Quat {
} }
let dot_product = dir_1.dot(dir_2).clamp(-1.0, 1.0); let dot_product = dir_1.dot(dir_2).clamp(-1.0, 1.0);
let angle_of_rotation = dot_product.acos() * 6.0; let angle_of_rotation = dot_product.acos() * MOUSE_SPEED;
if angle_of_rotation.is_nan() || angle_of_rotation.is_infinite() { if angle_of_rotation.is_nan() || angle_of_rotation.is_infinite() {
return Quat::IDENTITY; return Quat::IDENTITY;

View file

@ -21,6 +21,7 @@ const MAX_STAR_SIZE: f32 = 0.63;
const STAR_SCALE: f32 = 0.02; const STAR_SCALE: f32 = 0.02;
const SKY_RADIUS: f32 = 4.0; const SKY_RADIUS: f32 = 4.0;
const CONS_VIEW_RADIUS: f32 = 0.8; const CONS_VIEW_RADIUS: f32 = 0.8;
const MOUSE_SPEED: f32 = 12.0;
#[derive(Serialize, Deserialize, Debug, Clone)] #[derive(Serialize, Deserialize, Debug, Clone)]
struct StarData { struct StarData {
@ -141,7 +142,6 @@ fn main() {
.add_systems(Update, explo_state::player_mouse_move.run_if(in_state(GameState::Game).or_else(in_state(GameState::Explo)))) .add_systems(Update, explo_state::player_mouse_move.run_if(in_state(GameState::Game).or_else(in_state(GameState::Explo))))
.add_systems(Update, explo_state::rotate_camera.run_if(in_state(GameState::Game).or_else(in_state(GameState::Explo)))) .add_systems(Update, explo_state::rotate_camera.run_if(in_state(GameState::Game).or_else(in_state(GameState::Explo))))
.add_systems(Update, game_state::ui_buttons.run_if(in_state(GameState::Game))) .add_systems(Update, game_state::ui_buttons.run_if(in_state(GameState::Game)))
.add_systems(Update, explo_state::constellation_opacity.run_if(in_state(GameState::Game).or_else(in_state(GameState::Explo))))
.add_systems(Update, game_state::ui_labels.run_if(in_state(GameState::Game))) .add_systems(Update, game_state::ui_labels.run_if(in_state(GameState::Game)))
.add_systems(OnExit(GameState::Game), despawn_screen::<MainGame>) .add_systems(OnExit(GameState::Game), despawn_screen::<MainGame>)
.add_systems(OnEnter(GameState::End), end_state::setup) .add_systems(OnEnter(GameState::End), end_state::setup)
@ -149,6 +149,7 @@ fn main() {
.add_systems(OnExit(GameState::End), despawn_screen::<GameOver>) .add_systems(OnExit(GameState::End), despawn_screen::<GameOver>)
.add_systems(OnEnter(GameState::Explo), explo_state::setup) .add_systems(OnEnter(GameState::Explo), explo_state::setup)
.add_systems(Update, explo_state::player_interact.run_if(in_state(GameState::Explo))) .add_systems(Update, explo_state::player_interact.run_if(in_state(GameState::Explo)))
.add_systems(Update, explo_state::constellation_opacity.run_if(in_state(GameState::Explo)))
.add_systems(OnExit(GameState::Explo), despawn_screen::<MainGame>) .add_systems(OnExit(GameState::Explo), despawn_screen::<MainGame>)
.run(); .run();
} }