use bevy::prelude::*;
use super::touch::TouchInput;
#[derive(Resource, Default, Debug, PartialEq)]
pub struct ActiveCameraData {
pub entity: Option<Entity>,
pub viewport_size: Option<Vec2>,
pub window_size: Option<Vec2>,
pub manual: bool,
}
#[derive(Clone, PartialEq, Debug, Reflect, Copy)]
pub enum FocusBoundsShape {
Sphere(Sphere),
Cuboid(Cuboid),
}
impl From<Sphere> for FocusBoundsShape {
fn from(value: Sphere) -> Self { Self::Sphere(value) }
}
impl From<Cuboid> for FocusBoundsShape {
fn from(value: Cuboid) -> Self { Self::Cuboid(value) }
}
#[derive(Clone, PartialEq, Eq, Debug, Reflect, Copy)]
pub enum ButtonZoomAxis {
X,
Y,
XY,
}
#[derive(Clone, PartialEq, Eq, Debug, Reflect, Copy)]
pub enum TrackpadBehavior {
ZoomOnly,
BlenderLike {
modifier_pan: Option<KeyCode>,
modifier_zoom: Option<KeyCode>,
},
}
impl TrackpadBehavior {
#[must_use]
pub const fn blender_default() -> Self {
Self::BlenderLike {
modifier_pan: Some(KeyCode::ShiftLeft),
modifier_zoom: Some(KeyCode::ControlLeft),
}
}
}
#[derive(Clone, PartialEq, Debug, Reflect, Copy)]
pub struct InputControl {
pub touch: Option<TouchInput>,
pub trackpad: Option<TrackpadInput>,
pub zoom: ZoomDirection,
}
impl Default for InputControl {
fn default() -> Self {
Self {
touch: Some(TouchInput::OneFingerOrbit),
trackpad: Some(TrackpadInput::default()),
zoom: ZoomDirection::Normal,
}
}
}
#[derive(Clone, PartialEq, Debug, Reflect, Copy)]
pub struct TrackpadInput {
pub behavior: TrackpadBehavior,
pub sensitivity: f32,
}
impl Default for TrackpadInput {
fn default() -> Self {
Self {
behavior: TrackpadBehavior::ZoomOnly,
sensitivity: 1.0,
}
}
}
impl TrackpadInput {
#[must_use]
pub const fn blender_default() -> Self {
Self {
behavior: TrackpadBehavior::blender_default(),
sensitivity: 1.0,
}
}
}
#[derive(Clone, PartialEq, Eq, Debug, Reflect, Copy, Default)]
pub enum ZoomDirection {
#[default]
Normal,
Reversed,
}
#[derive(Clone, PartialEq, Eq, Debug, Reflect, Copy, Default)]
pub enum UpsideDownPolicy {
Allow,
#[default]
Prevent,
}
#[derive(Clone, PartialEq, Eq, Debug, Reflect, Copy, Default)]
pub enum InitializationState {
#[default]
Pending,
Complete,
}
#[derive(Clone, PartialEq, Eq, Debug, Reflect, Copy, Default)]
pub enum ForceUpdate {
#[default]
Idle,
Pending,
}
#[derive(Clone, PartialEq, Eq, Debug, Reflect, Copy, Default)]
pub enum TimeSource {
#[default]
Virtual,
Real,
}