rust_webvr_api/vr_eye_parameters.rs
1use VRFieldOfView;
2
3/// The VREyeParameters interface represents all the information
4/// required to correctly render a scene for a given eye.
5#[derive(Debug, Clone)]
6#[cfg_attr(feature = "serde-serialization", derive(Deserialize, Serialize))]
7pub struct VREyeParameters {
8 /// Offset from the center point between the users eyes to the center of the eye in meters.
9 pub offset: [f32; 3],
10
11 /// Describes the recommended render target width of each eye viewport, in pixels.
12 pub render_width: u32,
13
14 /// Describes the recommended render target height of each eye viewport, in pixels.
15 pub render_height: u32,
16
17 /// Describes the current field of view for the eye
18 pub field_of_view: VRFieldOfView
19}
20
21impl Default for VREyeParameters {
22 fn default() -> VREyeParameters {
23 VREyeParameters {
24 offset: [0.0, 0.0, 0.0],
25 render_width: 0,
26 render_height: 0,
27 field_of_view: VRFieldOfView::default()
28 }
29 }
30}