pub struct OpenXrCurvedScreenOptions {
pub radius_m: f32,
pub screen_width_m: f32,
pub screen_height_m: f32,
pub gap_m: f32,
}Expand description
Physical geometry for a curved screen.
All fields are metres. Self::sanitized enforces positive radius and
dimensions and a non-negative gap.
§Examples
use ailloli_ui_openxr::OpenXrCurvedScreenOptions;
let options = OpenXrCurvedScreenOptions::default();
assert_eq!((options.radius_m, options.gap_m), (2.0, 0.12));Fields§
§radius_m: f32Cylinder radius in metres; sanitized to at least 0.05.
screen_width_m: f32Arc width in metres; sanitized to at least 0.01.
screen_height_m: f32Screen height in metres; sanitized to at least 0.01.
gap_m: f32Separation between adjacent curved screens in metres; clamped to zero.
Implementations§
Source§impl OpenXrCurvedScreenOptions
impl OpenXrCurvedScreenOptions
Sourcepub fn sanitized(self) -> Self
pub fn sanitized(self) -> Self
Returns a copy with geometry clamped to safe positive minima.
§Examples
use ailloli_ui_openxr::OpenXrCurvedScreenOptions;
let sanitized = OpenXrCurvedScreenOptions { radius_m: 0.0, screen_width_m: -1.0, screen_height_m: 0.0, gap_m: -2.0 }.sanitized();
assert_eq!((sanitized.radius_m, sanitized.screen_width_m, sanitized.screen_height_m, sanitized.gap_m), (0.05, 0.01, 0.01, 0.0));Sourcepub fn central_angle(self) -> f32
pub fn central_angle(self) -> f32
Returns the cylinder’s central angle in radians (width / radius).
Sanitization occurs before division.
§Examples
use ailloli_ui_openxr::OpenXrCurvedScreenOptions;
assert!((OpenXrCurvedScreenOptions::default().central_angle() - 0.8).abs() < 1e-6);Sourcepub fn aspect_ratio(self) -> f32
pub fn aspect_ratio(self) -> f32
Returns the sanitized physical width-to-height ratio.
§Examples
use ailloli_ui_openxr::OpenXrCurvedScreenOptions;
assert!((OpenXrCurvedScreenOptions::default().aspect_ratio() - 16.0 / 9.0).abs() < 1e-6);Trait Implementations§
Source§impl Clone for OpenXrCurvedScreenOptions
impl Clone for OpenXrCurvedScreenOptions
Source§fn clone(&self) -> OpenXrCurvedScreenOptions
fn clone(&self) -> OpenXrCurvedScreenOptions
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for OpenXrCurvedScreenOptions
impl Debug for OpenXrCurvedScreenOptions
Source§impl Default for OpenXrCurvedScreenOptions
impl Default for OpenXrCurvedScreenOptions
impl Copy for OpenXrCurvedScreenOptions
impl StructuralPartialEq for OpenXrCurvedScreenOptions
Auto Trait Implementations§
impl Freeze for OpenXrCurvedScreenOptions
impl RefUnwindSafe for OpenXrCurvedScreenOptions
impl Send for OpenXrCurvedScreenOptions
impl Sync for OpenXrCurvedScreenOptions
impl Unpin for OpenXrCurvedScreenOptions
impl UnwindSafe for OpenXrCurvedScreenOptions
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<A> IntoClickAction<A> for Awhere
A: Clone + 'static,
impl<A> IntoClickAction<A> for Awhere
A: Clone + 'static,
Source§fn into_click_action(self) -> ClickAction<A>
fn into_click_action(self) -> ClickAction<A>
Implements the into_click_action helper used by this module.
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().