use bevy::prelude::{KeyCode, Resource};
use std::f32::consts::PI;
pub const LINEAR_QWERTY_LAYOUT: KeyboardLinearInputs = KeyboardLinearInputs {
forward: KeyCode::KeyW,
back: KeyCode::KeyS,
right: KeyCode::KeyD,
left: KeyCode::KeyA,
};
pub const LINEAR_AZERTY_LAYOUT: KeyboardLinearInputs = KeyboardLinearInputs {
forward: KeyCode::KeyZ,
back: KeyCode::KeyS,
right: KeyCode::KeyD,
left: KeyCode::KeyQ,
};
#[derive(Clone, Copy, Debug)]
pub struct KeyboardLinearInputs {
pub forward: KeyCode,
pub back: KeyCode,
pub right: KeyCode,
pub left: KeyCode,
}
#[derive(Resource, Copy, Clone, Debug)]
pub struct FpcConfiguration {
pub keyboard_linear_inputs: KeyboardLinearInputs,
pub angular_clamping: f32,
pub angular_sensitivity: f32,
pub angular_smoothing: f32,
}
impl Default for FpcConfiguration {
fn default() -> Self {
Self {
keyboard_linear_inputs: LINEAR_QWERTY_LAYOUT,
angular_clamping: PI / 2.,
angular_sensitivity: 1.,
angular_smoothing: 1.,
}
}
}