pub struct MotionPacket { /* private fields */ }
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§
Source§impl MotionPacket
impl MotionPacket
Sourcepub 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
.
Source§impl MotionPacket
impl MotionPacket
Sourcepub fn front_wheels_angle(&self) -> f32
pub fn front_wheels_angle(&self) -> f32
Returns the current angle of the front wheels in radians.
Source§impl MotionPacket
impl MotionPacket
Sourcepub fn cars(&self) -> &Vec<Motion>
pub fn cars(&self) -> &Vec<Motion>
Returns the publicly observable motion data for all 20 cars in the session.
Sourcepub fn suspension_position(&self) -> &CornerProperty<f32>
pub fn suspension_position(&self) -> &CornerProperty<f32>
Returns the position of the suspension at each corner of the car.
Sourcepub fn suspension_velocity(&self) -> &CornerProperty<f32>
pub fn suspension_velocity(&self) -> &CornerProperty<f32>
Returns the velocity of the suspension at each corner of the car.
Sourcepub fn suspension_acceleration(&self) -> &CornerProperty<f32>
pub fn suspension_acceleration(&self) -> &CornerProperty<f32>
Returns the acceleration of the suspension at each corner of the car.
Sourcepub fn wheel_speed(&self) -> &CornerProperty<f32>
pub fn wheel_speed(&self) -> &CornerProperty<f32>
Returns the wheel speed at each corner of the car.
Sourcepub fn wheel_slip(&self) -> &CornerProperty<f32>
pub fn wheel_slip(&self) -> &CornerProperty<f32>
Returns the wheel slip at each corner of the car.
Sourcepub fn local_velocity(&self) -> &Property3D<f32>
pub fn local_velocity(&self) -> &Property3D<f32>
Returns the velocity in local space on each axis.
Sourcepub fn angular_velocity(&self) -> &Property3D<f32>
pub fn angular_velocity(&self) -> &Property3D<f32>
Returns the angular velocity on each axis.
Sourcepub fn angular_acceleration(&self) -> &Property3D<f32>
pub fn angular_acceleration(&self) -> &Property3D<f32>
Returns the angular acceleration on each axis.
Trait Implementations§
Source§impl Clone for MotionPacket
impl Clone for MotionPacket
Source§fn clone(&self) -> MotionPacket
fn clone(&self) -> MotionPacket
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more