Struct f1_api::packet::motion::MotionPacket [−][src]
pub struct MotionPacket { /* fields omitted */ }
Expand description
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.
Implementations
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
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
Constructs a new MotionPacket
.
Returns the current angle of the front wheels in radians.
Returns the publicly observable motion data for all 20 cars in the session.
Returns the position of the suspension at each corner of the car.
Returns the velocity of the suspension at each corner of the car.
Returns the acceleration of the suspension at each corner of the car.
Returns the wheel speed at each corner of the car.
Returns the wheel slip at each corner of the car.
Returns the velocity in local space on each axis.
Returns the angular velocity on each axis.
Returns the angular acceleration on each axis.
Trait Implementations
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
Auto Trait Implementations
impl RefUnwindSafe for MotionPacket
impl Send for MotionPacket
impl Sync for MotionPacket
impl Unpin for MotionPacket
impl UnwindSafe for MotionPacket
Blanket Implementations
Mutably borrows from an owned value. Read more