Function chip::euler_rotation

source ·
pub fn euler_rotation(pyr: &Vector3<f32>) -> Rotation3<f32>
Expand description

Converts the given (pitch, yaw, roll) to a rotation matrix. The rotations are applied in ZYX order, which matches Rocket League.

Example

let pitch = 0.0;
let yaw = PI / 2.0;
let roll = 0.0;
let pyr = Vector3::new(pitch, yaw, roll);
let rotation_matrix = euler_rotation(&pyr);