pub struct OpenXrPanelFacingOptions {
pub mode: OpenXrPanelFacingMode,
pub pitch_min_rad: f32,
pub pitch_max_rad: f32,
}Expand description
Facing policy and inclusive pitch bounds in radians.
Non-finite bounds normalize to +/-45 degrees and reversed bounds are swapped.
§Examples
use ailloli_ui_openxr::{OpenXrPanelFacingMode, OpenXrPanelFacingOptions};
let options = OpenXrPanelFacingOptions::default();
assert_eq!(options.mode, OpenXrPanelFacingMode::FaceUserOnDrag);Fields§
§mode: OpenXrPanelFacingModeOrientation policy.
pitch_min_rad: f32Inclusive minimum pitch in radians.
pitch_max_rad: f32Inclusive maximum pitch in radians.
Implementations§
Source§impl OpenXrPanelFacingOptions
impl OpenXrPanelFacingOptions
Sourcepub fn new(
mode: OpenXrPanelFacingMode,
pitch_min_rad: f32,
pitch_max_rad: f32,
) -> Self
pub fn new( mode: OpenXrPanelFacingMode, pitch_min_rad: f32, pitch_max_rad: f32, ) -> Self
Creates options and immediately normalizes both pitch bounds.
§Examples
use ailloli_ui_openxr::{OpenXrPanelFacingMode, OpenXrPanelFacingOptions};
let options = OpenXrPanelFacingOptions::new(OpenXrPanelFacingMode::FaceUserYawPitchOnDrag, 0.5, -0.5);
assert_eq!((options.pitch_min_rad, options.pitch_max_rad), (-0.5, 0.5));Sourcepub fn normalize_pitch_bounds(&mut self)
pub fn normalize_pitch_bounds(&mut self)
Replaces non-finite defaults and orders the pitch bounds in place.
§Examples
use ailloli_ui_openxr::{OpenXrPanelFacingMode, OpenXrPanelFacingOptions};
let mut options = OpenXrPanelFacingOptions { mode: OpenXrPanelFacingMode::Fixed, pitch_min_rad: f32::NAN, pitch_max_rad: f32::INFINITY };
options.normalize_pitch_bounds();
assert_eq!((options.pitch_min_rad.to_degrees(), options.pitch_max_rad.to_degrees()), (-45.0, 45.0));Trait Implementations§
Source§impl Clone for OpenXrPanelFacingOptions
impl Clone for OpenXrPanelFacingOptions
Source§fn clone(&self) -> OpenXrPanelFacingOptions
fn clone(&self) -> OpenXrPanelFacingOptions
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 OpenXrPanelFacingOptions
impl Debug for OpenXrPanelFacingOptions
Source§impl Default for OpenXrPanelFacingOptions
impl Default for OpenXrPanelFacingOptions
Source§impl PartialEq for OpenXrPanelFacingOptions
impl PartialEq for OpenXrPanelFacingOptions
impl Copy for OpenXrPanelFacingOptions
impl StructuralPartialEq for OpenXrPanelFacingOptions
Auto Trait Implementations§
impl Freeze for OpenXrPanelFacingOptions
impl RefUnwindSafe for OpenXrPanelFacingOptions
impl Send for OpenXrPanelFacingOptions
impl Sync for OpenXrPanelFacingOptions
impl Unpin for OpenXrPanelFacingOptions
impl UnwindSafe for OpenXrPanelFacingOptions
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().