add rotationx command

This commit is contained in:
yuni 2024-03-29 14:19:18 +01:00
parent 9d5c7a4947
commit 477794f95c

View file

@ -536,6 +536,15 @@ pub fn load_defs(
continue;
}
}
["rotationx", rotation_x] => {
if let Ok(rotation_x_float) = rotation_x.parse::<f32>() {
state.rotation = Quat::from_rotation_x(PI * rotation_x_float);
}
else {
error!("Can't parse float: {line}");
continue;
}
}
["rotationy", rotation_y] => {
if let Ok(rotation_y_float) = rotation_y.parse::<f32>() {
state.rotation = Quat::from_rotation_y(PI * rotation_y_float);