[][src]Struct carambolage::game::controller::Controller

pub struct Controller {
    is_smooth: bool,
    ci: ControllerInternal,
    axis_goal: Vector2<f32>,
    axis: Vector2<f32>,
    boost: bool,
}

Prototype controller emulation for keyboard users.

Fields

Internal settings and flags.

Buttons and input axis that can be used in the game.

Methods

impl Controller
[src]

Create a new controller. You can activate smooth axis interpolation for up, left, down, right by setting smoothto true.

Process input keys for this controller.

The input is handled from glfw::Window due to event polling.

Return the x axis value, clamped between [-1.0f32; 1.0f32].

Return the y axis value, clamped between [-1.0f32; 1.0f32].

Return true if the boost button is pressed.

Sets the x axis value to make process_input better readable.

Sets the y axis value to make process_input better readable.

Trait Implementations

impl Copy for Controller
[src]

impl Clone for Controller
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for Controller
[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl Send for Controller

impl Sync for Controller

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

impl<T> From for T
[src]

Performs the conversion.

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

Performs the conversion.

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.

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

Immutably borrows from an owned value. Read more

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.

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

Mutably borrows from an owned value. Read more

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

🔬 This is a nightly-only experimental API. (get_type_id)

this method will likely be replaced by an associated static

Gets the TypeId of self. Read more

impl<T> SetParameter for T

Sets value as a parameter of self.

impl<T> Same for T

Should always be Self

impl<SS, SP> SupersetOf for SP where
    SS: SubsetOf<SP>, 

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more

Checks if self is actually part of its subset T (and can be converted to it).

Use with care! Same as self.to_subset but without any property checks. Always succeeds.

The inclusion map: converts self to the equivalent element of its superset.