pub struct Motion { /* private fields */ }
Expand description
Data about a car and its position and movement in space
The position and movement of each car in a session is described in the motion packet.
Implementations§
Source§impl Motion
impl Motion
Sourcepub fn new(
position: Property3D<f32>,
velocity: Property3D<f32>,
forward_direction: Property3D<i16>,
right_direction: Property3D<i16>,
g_force: Property3D<f32>,
yaw: f32,
pitch: f32,
roll: f32,
) -> Self
pub fn new( position: Property3D<f32>, velocity: Property3D<f32>, forward_direction: Property3D<i16>, right_direction: Property3D<i16>, g_force: Property3D<f32>, yaw: f32, pitch: f32, roll: f32, ) -> Self
Constructs a new Motion
.
Source§impl Motion
impl Motion
Sourcepub fn position(&self) -> &Property3D<f32>
pub fn position(&self) -> &Property3D<f32>
Returns the position of the car in 3D space.
Sourcepub fn velocity(&self) -> &Property3D<f32>
pub fn velocity(&self) -> &Property3D<f32>
Returns the velocity of the car on three axis.
Sourcepub fn forward_direction(&self) -> &Property3D<i16>
pub fn forward_direction(&self) -> &Property3D<i16>
Returns the normalized forward motion of the car on three axis.
Normalized values can be converted to float through division by 32767.0f.
Sourcepub fn right_direction(&self) -> &Property3D<i16>
pub fn right_direction(&self) -> &Property3D<i16>
Returns the normalized lateral motion of the car on three axis.
Normalized values can be converted to float through division by 32767.0f.
Sourcepub fn g_force(&self) -> &Property3D<f32>
pub fn g_force(&self) -> &Property3D<f32>
Returns the G force on the car on each of the three axis.
Trait Implementations§
Source§impl PartialOrd for Motion
impl PartialOrd for Motion
impl Copy for Motion
impl StructuralPartialEq for Motion
Auto Trait Implementations§
impl Freeze for Motion
impl RefUnwindSafe for Motion
impl Send for Motion
impl Sync for Motion
impl Unpin for Motion
impl UnwindSafe for Motion
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