pub enum Axis {
LeftStickX,
LeftStickY,
LeftZ,
RightStickX,
RightStickY,
RightZ,
DPadX,
DPadY,
Unknown,
}
Expand description
An analog axis of some device (gamepad thumbstick, joystick…). Gamepad’s elements which state can be represented by value from -1.0 to 1.0.
Variants
LeftStickX
LeftStickY
LeftZ
RightStickX
RightStickY
RightZ
DPadX
DPadY
Unknown
Implementations
sourceimpl Axis
impl Axis
An analog axis of some device (gamepad thumbstick, joystick…).
sourcepub fn is_stick(self) -> bool
pub fn is_stick(self) -> bool
Returns true if axis is LeftStickX
, LeftStickY
, RightStickX
or RightStickY
.
sourcepub fn second_axis(self) -> Option<Axis>
pub fn second_axis(self) -> Option<Axis>
Returns the other axis from same element of gamepad, if any.
input | output |
---|---|
LeftStickX | Some(LeftStickY) |
LeftStickY | Some(LeftStickX) |
RightStickX | Some(RightStickY) |
RightStickY | Some(RightStickX) |
DpadX | Some(DpadY) |
DpadY | Some(DpadX) |
… | None |
Trait Implementations
impl Copy for Axis
impl Eq for Axis
impl StructuralEq for Axis
impl StructuralPartialEq for Axis
Auto Trait Implementations
impl RefUnwindSafe for Axis
impl Send for Axis
impl Sync for Axis
impl Unpin for Axis
impl UnwindSafe for Axis
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more