use bytes::{BytesMut, BufMut, Buf};
#[derive(Copy, Clone, Debug, Default)]
pub struct AngularVelocityRecord {
pub rate_about_x_axis_field: f32,
pub rate_about_y_axis_field: f32,
pub rate_about_z_axis_field: f32
}
impl AngularVelocityRecord {
pub fn new(x: f32, y: f32, z: f32) -> Self {
AngularVelocityRecord {
rate_about_x_axis_field: x,
rate_about_y_axis_field: y,
rate_about_z_axis_field: z
}
}
pub fn serialize(&self, buf: &mut BytesMut) {
buf.put_f32(self.rate_about_x_axis_field);
buf.put_f32(self.rate_about_y_axis_field);
buf.put_f32(self.rate_about_z_axis_field);
}
pub fn decode(buf: &mut BytesMut) -> AngularVelocityRecord {
AngularVelocityRecord {
rate_about_x_axis_field: buf.get_f32(),
rate_about_y_axis_field: buf.get_f32(),
rate_about_z_axis_field: buf.get_f32()
}
}
}