#[repr(u16)]pub enum Axis {
LeftStickX = 1,
LeftStickY = 2,
LeftZ = 3,
RightStickX = 4,
RightStickY = 5,
RightZ = 6,
DPadX = 7,
DPadY = 8,
Unknown = 0,
}
Expand description
Gamepad’s elements which state can be represented by value from -1.0 to 1.0.
Variants§
LeftStickX = 1
LeftStickY = 2
LeftZ = 3
RightStickX = 4
RightStickY = 5
RightZ = 6
DPadX = 7
DPadY = 8
Unknown = 0
Implementations§
source§impl Axis
impl Axis
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<Self>
pub fn second_axis(self) -> Option<Self>
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§
source§impl PartialEq for Axis
impl PartialEq for Axis
impl Copy for Axis
impl Eq for Axis
impl StructuralPartialEq for Axis
Auto Trait Implementations§
impl Freeze for Axis
impl RefUnwindSafe for Axis
impl Send for Axis
impl Sync for Axis
impl Unpin for Axis
impl UnwindSafe for Axis
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more