pub struct VrApp<A> {
pub input_mapper: OpenXrInputMapper,
/* private fields */
}Expand description
VR-friendly facade hook for external loops.
VrApp does not own an OpenXR session; it only provides stable stateful
input conversion entry points for any loop that emits OpenXrPointerSources.
§Examples
use ailloli_ui_openxr::openxr_runtime::VrApp;
let app = VrApp::<()>::new();
assert!(format!("{:?}", app.input_mapper).contains("source_state"));Fields§
§input_mapper: OpenXrInputMapperStateful pointer-transition mapper shared across frames.
Implementations§
Source§impl<A> VrApp<A>
impl<A> VrApp<A>
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a facade with no remembered pointer state.
§Examples
use ailloli_ui_openxr::openxr_runtime::VrApp;
let _: VrApp<String> = VrApp::new();Sourcepub fn map_pointer_sources<T>(
&mut self,
sources: &[T],
modifiers: Modifiers,
) -> Vec<Event>where
T: OpenXrPointerSource,
pub fn map_pointer_sources<T>(
&mut self,
sources: &[T],
modifiers: Modifiers,
) -> Vec<Event>where
T: OpenXrPointerSource,
Converts one ordered source slice into runtime events.
The mapper retains hover and pressed transitions for subsequent calls.
§Examples
use ailloli_ui_core::event::Modifiers;
use ailloli_ui_openxr::{OpenXrPointerHit, OpenXrPointerSample};
use ailloli_ui_openxr::openxr_runtime::VrApp;
let mut app = VrApp::<()>::new();
let events = app.map_pointer_sources(
&[OpenXrPointerSample::new(1, OpenXrPointerHit::Miss, false)],
Modifiers::default(),
);
assert!(events.is_empty());Sourcepub fn clear_pointer_state(&mut self)
pub fn clear_pointer_state(&mut self)
Resets all pointer state without synthesizing releases.
Call this on app hide or focus loss before accepting a fresh source set.
§Examples
use ailloli_ui_openxr::openxr_runtime::VrApp;
let mut app = VrApp::<()>::new();
app.clear_pointer_state();Trait Implementations§
Auto Trait Implementations§
impl<A> Freeze for VrApp<A>
impl<A> RefUnwindSafe for VrApp<A>where
A: RefUnwindSafe,
impl<A> Send for VrApp<A>where
A: Send,
impl<A> Sync for VrApp<A>where
A: Sync,
impl<A> Unpin for VrApp<A>where
A: Unpin,
impl<A> UnwindSafe for VrApp<A>where
A: UnwindSafe,
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
§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<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