mod orbit_control;
#[doc(inline)]
pub use orbit_control::*;
mod free_orbit_control;
#[doc(inline)]
pub use free_orbit_control::*;
mod first_person_control;
#[doc(inline)]
pub use first_person_control::*;
mod fly_control;
#[doc(inline)]
pub use fly_control::*;
mod control2d;
#[doc(inline)]
pub use control2d::*;
pub use three_d_asset::PixelPoint as PhysicalPoint;
use three_d_asset::prelude::*;
#[derive(Clone, Copy, Debug, Eq, Ord, PartialEq, PartialOrd, Hash)]
pub enum MouseButton {
Left,
Right,
Middle,
}
#[derive(Clone, Debug)]
pub enum Event {
MousePress {
button: MouseButton,
position: PhysicalPoint,
modifiers: Modifiers,
handled: bool,
},
MouseRelease {
button: MouseButton,
position: PhysicalPoint,
modifiers: Modifiers,
handled: bool,
},
MouseMotion {
button: Option<MouseButton>,
delta: (f32, f32),
position: PhysicalPoint,
modifiers: Modifiers,
handled: bool,
},
MouseWheel {
delta: (f32, f32),
position: PhysicalPoint,
modifiers: Modifiers,
handled: bool,
},
PinchGesture {
delta: f32,
position: PhysicalPoint,
modifiers: Modifiers,
handled: bool,
},
RotationGesture {
delta: Radians,
position: PhysicalPoint,
modifiers: Modifiers,
handled: bool,
},
MouseEnter,
MouseLeave,
KeyPress {
kind: Key,
modifiers: Modifiers,
handled: bool,
},
KeyRelease {
kind: Key,
modifiers: Modifiers,
handled: bool,
},
ModifiersChange {
modifiers: Modifiers,
},
Text(String),
}
#[allow(missing_docs)]
#[derive(Clone, Copy, Debug, Eq, Ord, PartialEq, PartialOrd, Hash)]
pub enum Key {
ArrowDown,
ArrowLeft,
ArrowRight,
ArrowUp,
Escape,
Tab,
Backspace,
Enter,
Space,
Insert,
Delete,
Home,
End,
PageUp,
PageDown,
Snapshot,
Mute,
VolumeDown,
VolumeUp,
Copy,
Paste,
Cut,
Equals,
Minus,
Plus,
Num0,
Num1,
Num2,
Num3,
Num4,
Num5,
Num6,
Num7,
Num8,
Num9,
A,
B,
C,
D,
E,
F,
G,
H,
I,
J,
K,
L,
M,
N,
O,
P,
Q,
R,
S,
T,
U,
V,
W,
X,
Y,
Z,
F1,
F2,
F3,
F4,
F5,
F6,
F7,
F8,
F9,
F10,
F11,
F12,
F13,
F14,
F15,
F16,
F17,
F18,
F19,
F20,
F21,
F22,
F23,
F24,
Apostrophe,
Asterisk,
Backslash,
Caret,
Colon,
Comma,
Grave,
LBracket,
Period,
RBracket,
Semicolon,
Slash,
Underline,
}
#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
pub struct Modifiers {
pub alt: bool,
pub ctrl: bool,
pub shift: bool,
pub command: bool,
}