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
impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
. Read morefn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read morefn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s. Read morefn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s. Read more