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

pub struct MotionPacket { /* fields omitted */ }

Packet containing data about the movement and position of all cars in the session

The F1 games publish motion data for all cars in the session. This data is restricted to publicly observable properties for most cars, e.g. the position and movement of a car. For the player's car, additional motion data is published, e.g. various physical forces on the car and its suspension.

Methods

impl MotionPacket[src]

pub fn new(
    header: Header,
    cars: Vec<Motion>,
    suspension_position: CornerProperty<f32>,
    suspension_velocity: CornerProperty<f32>,
    suspension_acceleration: CornerProperty<f32>,
    wheel_speed: CornerProperty<f32>,
    wheel_slip: CornerProperty<f32>,
    local_velocity: Property3D<f32>,
    angular_velocity: Property3D<f32>,
    angular_acceleration: Property3D<f32>,
    front_wheels_angle: f32
) -> Self
[src]

Constructs a new MotionPacket.

impl MotionPacket[src]

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

Returns the current angle of the front wheels in radians.

impl MotionPacket[src]

pub fn header(&self) -> &Header[src]

Returns the packet header prefixing the motion packet.

pub fn cars(&self) -> &Vec<Motion>[src]

Returns the publicly observable motion data for all 20 cars in the session.

pub fn suspension_position(&self) -> &CornerProperty<f32>[src]

Returns the position of the suspension at each corner of the car.

pub fn suspension_velocity(&self) -> &CornerProperty<f32>[src]

Returns the velocity of the suspension at each corner of the car.

pub fn suspension_acceleration(&self) -> &CornerProperty<f32>[src]

Returns the acceleration of the suspension at each corner of the car.

pub fn wheel_speed(&self) -> &CornerProperty<f32>[src]

Returns the wheel speed at each corner of the car.

pub fn wheel_slip(&self) -> &CornerProperty<f32>[src]

Returns the wheel slip at each corner of the car.

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

Returns the velocity in local space on each axis.

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

Returns the angular velocity on each axis.

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

Returns the angular acceleration on each axis.

Trait Implementations

impl Clone for MotionPacket[src]

impl Debug for MotionPacket[src]

impl PartialEq<MotionPacket> for MotionPacket[src]

impl PartialOrd<MotionPacket> for MotionPacket[src]

impl StructuralPartialEq for MotionPacket[src]

Auto Trait Implementations

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.