[][src]Struct f1_api::packet::motion::Motion

pub struct Motion { /* fields omitted */ }

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.

Methods

impl Motion[src]

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
[src]

Constructs a new Motion.

impl Motion[src]

pub fn yaw(&self) -> f32[src]

Returns the yaw angle of the car in radians.

pub fn pitch(&self) -> f32[src]

Returns the pitch angle of the car in radians.

pub fn roll(&self) -> f32[src]

Returns the roll angle of the car in radians.

impl Motion[src]

pub fn position(&self) -> &Property3D<f32>[src]

Returns the position of the car in 3D space.

pub fn velocity(&self) -> &Property3D<f32>[src]

Returns the velocity of the car on three axis.

pub fn forward_direction(&self) -> &Property3D<i16>[src]

Returns the normalized forward motion of the car on three axis.

Normalized values can be converted to float through division by 32767.0f.

pub fn right_direction(&self) -> &Property3D<i16>[src]

Returns the normalized lateral motion of the car on three axis.

Normalized values can be converted to float through division by 32767.0f.

pub fn g_force(&self) -> &Property3D<f32>[src]

Returns the G force on the car on each of the three axis.

Trait Implementations

impl Clone for Motion[src]

impl Copy for Motion[src]

impl Debug for Motion[src]

impl Default for Motion[src]

impl PartialEq<Motion> for Motion[src]

impl PartialOrd<Motion> for Motion[src]

impl StructuralPartialEq for Motion[src]

Auto Trait Implementations

impl RefUnwindSafe for Motion

impl Send for Motion

impl Sync for Motion

impl Unpin for Motion

impl UnwindSafe for Motion

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.