pub struct ControllerState {
pub throttle: f32,
pub steer: f32,
pub pitch: f32,
pub yaw: f32,
pub roll: f32,
pub jump: bool,
pub boost: bool,
pub handbrake: bool,
}
Expand description
The inputs that control a car.
Fields§
§throttle: f32
-1 for full reverse, 1 for full forward
steer: f32
-1 for full left, 1 for full right
pitch: f32
-1 for nose down, 1 for nose up
yaw: f32
-1 for full left, 1 for full right
roll: f32
-1 for roll left, 1 for roll right
jump: bool
true if you want to press the jump button
boost: bool
true if you want to press the boost button
handbrake: bool
true if you want to press the handbrake button
Trait Implementations§
Source§impl Default for ControllerState
impl Default for ControllerState
Source§fn default() -> ControllerState
fn default() -> ControllerState
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ControllerState
impl RefUnwindSafe for ControllerState
impl Send for ControllerState
impl Sync for ControllerState
impl Unpin for ControllerState
impl UnwindSafe for ControllerState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).Source§unsafe fn to_subset_unchecked(&self) -> SS
unsafe fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.