[][src]Struct gc_adapter::Stick

pub struct Stick {
    pub x: SignedAxis,
    pub y: SignedAxis,
}

An analog control stick. Can represent either the left or right stick.

Fields

x: SignedAxisy: SignedAxis

Implementations

impl Stick[src]

pub fn raw(&self) -> (u8, u8)[src]

Gets the raw stick values, where ~127.5 is center.

pub fn coords(&self) -> (f32, f32)[src]

Gets the stick position as a normalized 2d vector. For higher accuracy, use coords_centered as it allows you to specifiy the

pub fn coords_centered(&self, center: (u8, u8)) -> (f32, f32)[src]

Gets the stick position as a normalized 2d vector. The provided center should be obtained using the raw method.

Trait Implementations

impl BinRead for Stick[src]

type Args = ()

The type of arguments needed to be supplied in order to read this type, usually a tuple. Read more

impl Debug for Stick[src]

impl Default for Stick[src]

Auto Trait Implementations

impl RefUnwindSafe for Stick

impl Send for Stick

impl Sync for Stick

impl Unpin for Stick

impl UnwindSafe for Stick

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.