Enum amethyst_input::Axis
source · pub enum Axis {
Emulated {
pos: Button,
neg: Button,
},
Controller {
controller_id: u32,
axis: ControllerAxis,
invert: bool,
dead_zone: f64,
},
}
Expand description
Represents any input represented by a float value from -1 to 1. Retrieve the value of this with axis_value.
Variants
Emulated
Fields
pos: Button
Positive button, when pressed down axis value will return 1 if neg
is not pressed down.
neg: Button
Negative button, when pressed down axis value will return -1 if pos
is not pressed down.
Represents an emulated analogue axis made up of pair of digital inputs,
like W and S keyboard buttons or DPadUp
and DPadDown
controller buttons.
Controller
Fields
controller_id: u32
A number representing specific controller, assigned and reused in order of connection.
axis: ControllerAxis
The axis being bound
invert: bool
Whether or not to multiply the axis value by -1.
dead_zone: f64
Treat input values from -dead_zone to dead_zone as 0, linearly interpolate remaining ranges.
Represents an analogue axis of a controller.
Trait Implementations
sourceimpl<'de> Deserialize<'de> for Axis
impl<'de> Deserialize<'de> for Axis
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
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
impl<T> Any for Twhere
T: Any,
impl<T> Any for Twhere
T: Any,
fn get_type_id(&self) -> TypeId
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