rust_webvr_api/vr_pose.rs
1/// The VRPose struct represents a sensor’s state at a given timestamp.
2#[derive(Debug, Clone, Copy, Default)]
3#[cfg_attr(feature = "serde-serialization", derive(Deserialize, Serialize))]
4pub struct VRPose {
5 /// Position of the VRDisplay as a 3D vector.
6 /// May be None if the sensor is incapable of providing positional data.
7 pub position: Option<[f32; 3]>,
8
9 /// Linear velocity of the sensor given in meters per second.
10 /// May be None if the sensor is incapable of providing linear velocity data.
11 pub linear_velocity: Option<[f32; 3]>,
12
13 /// Linear acceleration of the sensor given in meters per second squared.
14 /// May be None if the sensor is incapable of providing linear acceleration data.
15 pub linear_acceleration: Option<[f32; 3]>,
16
17 /// Orientation of the sensor as a quaternion.
18 /// May be None if the sensor is incapable of providing orientation.
19 pub orientation: Option<[f32; 4]>,
20
21 /// Angular velocity of the sensor given in radians per second.
22 /// May be None if the sensor is incapable of providing angular velocity data.
23 pub angular_velocity: Option<[f32; 3]>,
24
25 /// Linear acceleration of the sensor given in radians per second squared.
26 /// May be None if the sensor is incapable of providing angular acceleration data.
27 pub angular_acceleration: Option<[f32; 3]>,
28}