pub trait TripleAxislike:
UserInput
+ DynClone
+ DynEq
+ DynHash
+ Reflect
+ Serialize {
// Required method
fn axis_triple(
&self,
input_store: &CentralInputStore,
gamepad: Gamepad,
) -> Vec3;
// Provided methods
fn set_axis_triple(&self, world: &mut World, value: Vec3) { ... }
fn set_axis_triple_as_gamepad(
&self,
world: &mut World,
value: Vec3,
_gamepad: Option<Gamepad>,
) { ... }
}
Expand description
A trait used for triple-axis-like user inputs, which provide separate X, Y, and Z values.
Required Methods§
sourcefn axis_triple(&self, input_store: &CentralInputStore, gamepad: Gamepad) -> Vec3
fn axis_triple(&self, input_store: &CentralInputStore, gamepad: Gamepad) -> Vec3
Gets the values of this input along the X, Y, and Z axes (if applicable).
Provided Methods§
sourcefn set_axis_triple(&self, world: &mut World, value: Vec3)
fn set_axis_triple(&self, world: &mut World, value: Vec3)
Simulate a triple-axis-like input by sending the appropriate event.
This method defaults to calling TripleAxislike::set_axis_triple_as_gamepad
if not overridden,
as is the case for gamepad-reliant inputs.
sourcefn set_axis_triple_as_gamepad(
&self,
world: &mut World,
value: Vec3,
_gamepad: Option<Gamepad>,
)
fn set_axis_triple_as_gamepad( &self, world: &mut World, value: Vec3, _gamepad: Option<Gamepad>, )
Simulate a triple-axis-like input, pretending to be the provided Gamepad
.
This method defaults to calling TripleAxislike::set_axis_triple
if not overridden,
as is the case for things like a space mouse.
Use find_gamepad
inside of this method to search for a gamepad to press the button on
if the provided gamepad is None
.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Box<dyn TripleAxislike>
impl<'de> Deserialize<'de> for Box<dyn TripleAxislike>
source§fn 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
source§impl FromReflect for Box<dyn TripleAxislike>
impl FromReflect for Box<dyn TripleAxislike>
source§fn from_reflect(reflect: &dyn Reflect) -> Option<Self>
fn from_reflect(reflect: &dyn Reflect) -> Option<Self>
Constructs a concrete instance of
Self
from a reflected value.source§fn take_from_reflect(
reflect: Box<dyn Reflect>,
) -> Result<Self, Box<dyn Reflect>>
fn take_from_reflect( reflect: Box<dyn Reflect>, ) -> Result<Self, Box<dyn Reflect>>
Attempts to downcast the given value to
Self
using,
constructing the value using from_reflect
if that fails. Read moresource§impl GetTypeRegistration for Box<dyn TripleAxislike>
impl GetTypeRegistration for Box<dyn TripleAxislike>
source§fn get_type_registration() -> TypeRegistration
fn get_type_registration() -> TypeRegistration
Returns the default
TypeRegistration
for this type.source§fn register_type_dependencies(registry: &mut TypeRegistry)
fn register_type_dependencies(registry: &mut TypeRegistry)
Registers other types needed by this type. Read more
source§impl<'hash> Hash for dyn TripleAxislike + 'hash
impl<'hash> Hash for dyn TripleAxislike + 'hash
source§impl<'hash> Hash for dyn TripleAxislike + Send + 'hash
impl<'hash> Hash for dyn TripleAxislike + Send + 'hash
source§impl<'hash> Hash for dyn TripleAxislike + Sync + 'hash
impl<'hash> Hash for dyn TripleAxislike + Sync + 'hash
source§impl<'eq> PartialEq<&Box<dyn TripleAxislike + 'eq>> for Box<dyn TripleAxislike + 'eq>
impl<'eq> PartialEq<&Box<dyn TripleAxislike + 'eq>> for Box<dyn TripleAxislike + 'eq>
source§impl<'eq> PartialEq<&Box<dyn TripleAxislike + Send + 'eq>> for Box<dyn TripleAxislike + Send + 'eq>
impl<'eq> PartialEq<&Box<dyn TripleAxislike + Send + 'eq>> for Box<dyn TripleAxislike + Send + 'eq>
source§impl<'eq> PartialEq<&Box<dyn TripleAxislike + Send + Sync + 'eq>> for Box<dyn TripleAxislike + Send + Sync + 'eq>
impl<'eq> PartialEq<&Box<dyn TripleAxislike + Send + Sync + 'eq>> for Box<dyn TripleAxislike + Send + Sync + 'eq>
source§impl<'eq> PartialEq<&Box<dyn TripleAxislike + Sync + 'eq>> for Box<dyn TripleAxislike + Sync + 'eq>
impl<'eq> PartialEq<&Box<dyn TripleAxislike + Sync + 'eq>> for Box<dyn TripleAxislike + Sync + 'eq>
source§impl<'eq> PartialEq for dyn TripleAxislike + 'eq
impl<'eq> PartialEq for dyn TripleAxislike + 'eq
source§impl<'eq> PartialEq for dyn TripleAxislike + Send + 'eq
impl<'eq> PartialEq for dyn TripleAxislike + Send + 'eq
source§impl<'eq> PartialEq for dyn TripleAxislike + Sync + 'eq
impl<'eq> PartialEq for dyn TripleAxislike + Sync + 'eq
source§impl Reflect for Box<dyn TripleAxislike>
impl Reflect for Box<dyn TripleAxislike>
source§fn get_represented_type_info(&self) -> Option<&'static TypeInfo>
fn get_represented_type_info(&self) -> Option<&'static TypeInfo>
source§fn as_any_mut(&mut self) -> &mut dyn Any
fn as_any_mut(&mut self) -> &mut dyn Any
Returns the value as a
&mut dyn Any
.source§fn into_reflect(self: Box<Self>) -> Box<dyn Reflect>
fn into_reflect(self: Box<Self>) -> Box<dyn Reflect>
Casts this type to a boxed reflected value.
source§fn as_reflect(&self) -> &dyn Reflect
fn as_reflect(&self) -> &dyn Reflect
Casts this type to a reflected value.
source§fn as_reflect_mut(&mut self) -> &mut dyn Reflect
fn as_reflect_mut(&mut self) -> &mut dyn Reflect
Casts this type to a mutable reflected value.
source§fn set(&mut self, value: Box<dyn Reflect>) -> Result<(), Box<dyn Reflect>>
fn set(&mut self, value: Box<dyn Reflect>) -> Result<(), Box<dyn Reflect>>
Performs a type-checked assignment of a reflected value to this value. Read more
source§fn reflect_kind(&self) -> ReflectKind
fn reflect_kind(&self) -> ReflectKind
Returns a zero-sized enumeration of “kinds” of type. Read more
source§fn reflect_ref(&self) -> ReflectRef<'_>
fn reflect_ref(&self) -> ReflectRef<'_>
Returns an immutable enumeration of “kinds” of type. Read more
source§fn reflect_mut(&mut self) -> ReflectMut<'_>
fn reflect_mut(&mut self) -> ReflectMut<'_>
Returns a mutable enumeration of “kinds” of type. Read more
source§fn reflect_owned(self: Box<Self>) -> ReflectOwned
fn reflect_owned(self: Box<Self>) -> ReflectOwned
Returns an owned enumeration of “kinds” of type. Read more
source§fn clone_value(&self) -> Box<dyn Reflect>
fn clone_value(&self) -> Box<dyn Reflect>
Clones the value as a
Reflect
trait object. Read moresource§fn reflect_hash(&self) -> Option<u64>
fn reflect_hash(&self) -> Option<u64>
Returns a hash of the value (which includes the type). Read more
source§fn reflect_partial_eq(&self, value: &dyn Reflect) -> Option<bool>
fn reflect_partial_eq(&self, value: &dyn Reflect) -> Option<bool>
Returns a “partial equality” comparison result. Read more
source§fn serializable(&self) -> Option<Serializable<'_>>
fn serializable(&self) -> Option<Serializable<'_>>
Returns a serializable version of the value. Read more
source§fn is_dynamic(&self) -> bool
fn is_dynamic(&self) -> bool
Indicates whether or not this type is a dynamic type. Read more
source§impl<'de> RegisterTypeTag<'de, dyn TripleAxislike> for KeyboardVirtualDPad3D
impl<'de> RegisterTypeTag<'de, dyn TripleAxislike> for KeyboardVirtualDPad3D
source§fn register_typetag(registry: &mut InfallibleMapRegistry<dyn TripleAxislike>)
fn register_typetag(registry: &mut InfallibleMapRegistry<dyn TripleAxislike>)
Registers the specified type tag into the
InfallibleMapRegistry
.source§impl<'de> RegisterTypeTag<'de, dyn TripleAxislike> for TripleAxislikeChord
impl<'de> RegisterTypeTag<'de, dyn TripleAxislike> for TripleAxislikeChord
source§fn register_typetag(registry: &mut InfallibleMapRegistry<dyn TripleAxislike>)
fn register_typetag(registry: &mut InfallibleMapRegistry<dyn TripleAxislike>)
Registers the specified type tag into the
InfallibleMapRegistry
.source§impl<'a> Serialize for dyn TripleAxislike + 'a
impl<'a> Serialize for dyn TripleAxislike + 'a
source§impl TypePath for Box<dyn TripleAxislike>
impl TypePath for Box<dyn TripleAxislike>
source§fn type_path() -> &'static str
fn type_path() -> &'static str
Returns the fully qualified path of the underlying type. Read more
source§fn short_type_path() -> &'static str
fn short_type_path() -> &'static str
Returns a short, pretty-print enabled path to the type. Read more