lighthouse_protocol/input/
motion_event.rs

1use serde::{Deserialize, Serialize};
2
3use crate::{Rot3, Vec3};
4
5use super::EventSource;
6
7/// A device motion event.
8#[derive(Debug, Serialize, Deserialize, PartialEq, Clone)]
9#[serde(rename_all = "camelCase")]
10pub struct MotionEvent {
11    /// The client identifier.
12    pub source: EventSource,
13    /// The acceleration in 3D space in m/s^2.
14    pub acceleration: Option<Vec3<Option<f64>>>,
15    /// The acceleration in 3D space (including gravity) in m/s^2.
16    pub acceleration_including_gravity: Option<Vec3<Option<f64>>>,
17    /// The rotation rate in deg/s on the three rotation axes.
18    pub rotation_rate: Option<Rot3<Option<f64>>>,
19    /// The granularity of these events in ms.
20    pub interval: f64,
21}