concinnity_core/components/controls_command.rs
1// src/components/controls_command.rs
2
3/// Runtime-only event sent by GraphicsSystem when a live camera setting changes,
4/// read by Camera3DSystem from its `Events<ControlsCommand>` queue.
5///
6/// These settings (mouse sensitivity, field of view) take effect on the camera,
7/// not the renderer, so a change made in the settings menu is handed across as
8/// this event rather than read from disk each frame: the camera updates its live
9/// value on the same tick. Each field is an Option so one event can carry only
10/// the value that changed (None leaves the rest untouched). World authors never
11/// declare this type directly.
12#[derive(Debug, Clone, Copy, PartialEq, Default)]
13pub struct ControlsCommand {
14 /// New mouse-look sensitivity, in radians per pixel. None leaves it
15 /// unchanged. Applied live by the camera controller.
16 pub mouse_sensitivity: Option<f32>,
17 /// New camera vertical field of view, in degrees. None leaves it unchanged.
18 /// Applied live to every Camera3D by the camera controller.
19 pub fov_y_degrees: Option<f32>,
20 /// New gamepad look sensitivity, in radians per second at full stick
21 /// deflection. None leaves it unchanged. Applied live by the camera
22 /// controller.
23 pub gamepad_look_sensitivity: Option<f32>,
24 /// New gamepad stick deadzone as a deflection fraction in [0, 1]. None
25 /// leaves it unchanged. Applied live by the input sampling.
26 pub gamepad_deadzone: Option<f32>,
27 /// New gamepad action -> button map after a rebind. None leaves it
28 /// unchanged. Applied live by the input sampling.
29 pub gamepad_map: Option<crate::components::GamepadMap>,
30}