#[repr(C)]pub struct XRSession {Show 19 fields
eventtarget: EventTarget,
blend_mode: XREnvironmentBlendMode,
mode: XRSessionMode,
visibility_state: Cell<XRVisibilityState>,
viewer_space: MutNullableDom<XRSpace>,
session: DomRefCell<Session>,
frame_requested: Cell<bool>,
pending_render_state: MutNullableDom<XRRenderState>,
active_render_state: MutDom<XRRenderState>,
inline_projection_matrix: DomRefCell<Transform3D<f32, Viewer, Display>>,
next_raf_id: Cell<i32>,
raf_callback_list: DomRefCell<Vec<(i32, Option<Rc<XRFrameRequestCallback>>)>>,
current_raf_callback_list: DomRefCell<Vec<(i32, Option<Rc<XRFrameRequestCallback>>)>>,
input_sources: Dom<XRInputSourceArray>,
end_promises: DomRefCell<Vec<Rc<Promise>>>,
ended: Cell<bool>,
next_hit_test_id: Cell<HitTestId>,
pending_hit_test_promises: DomRefCell<HashMapTracedValues<HitTestId, Rc<Promise>>>,
outside_raf: Cell<bool>,
}
Fields§
§eventtarget: EventTarget
§blend_mode: XREnvironmentBlendMode
§mode: XRSessionMode
§visibility_state: Cell<XRVisibilityState>
§viewer_space: MutNullableDom<XRSpace>
§session: DomRefCell<Session>
§frame_requested: Cell<bool>
§pending_render_state: MutNullableDom<XRRenderState>
§active_render_state: MutDom<XRRenderState>
§inline_projection_matrix: DomRefCell<Transform3D<f32, Viewer, Display>>
Cached projection matrix for inline sessions
next_raf_id: Cell<i32>
§raf_callback_list: DomRefCell<Vec<(i32, Option<Rc<XRFrameRequestCallback>>)>>
§current_raf_callback_list: DomRefCell<Vec<(i32, Option<Rc<XRFrameRequestCallback>>)>>
§input_sources: Dom<XRInputSourceArray>
§end_promises: DomRefCell<Vec<Rc<Promise>>>
§ended: Cell<bool>
https://immersive-web.github.io/webxr/#ended
next_hit_test_id: Cell<HitTestId>
§pending_hit_test_promises: DomRefCell<HashMapTracedValues<HitTestId, Rc<Promise>>>
§outside_raf: Cell<bool>
Opaque framebuffers need to know the session is “outside of a requestAnimationFrame” https://immersive-web.github.io/webxr/#opaque-framebuffer
Implementations§
source§impl XRSession
impl XRSession
fn __assert_parent_type(&self)
source§impl XRSession
impl XRSession
fn new_inherited( session: Session, render_state: &XRRenderState, input_sources: &XRInputSourceArray, mode: XRSessionMode ) -> XRSession
pub fn new( global: &GlobalScope, session: Session, mode: XRSessionMode, frame_receiver: IpcReceiver<Frame> ) -> Root<Dom<XRSession>>
pub fn with_session<R, F: FnOnce(&Session) -> R>(&self, with: F) -> R
pub fn is_ended(&self) -> bool
pub fn is_immersive(&self) -> bool
pub fn has_layers_feature(&self) -> bool
fn setup_raf_loop(&self, frame_receiver: IpcReceiver<Frame>)
pub fn is_outside_raf(&self) -> bool
fn attach_event_handler(&self)
pub fn setup_initial_inputs(&self)
fn event_callback(&self, event: XREvent)
sourcefn raf_callback(&self, frame: Frame)
fn raf_callback(&self, frame: Frame)
https://immersive-web.github.io/webxr/#xr-animation-frame
fn update_inline_projection_matrix(&self)
sourcepub fn inline_view(&self) -> View<Viewer>
pub fn inline_view(&self) -> View<Viewer>
Constructs a View suitable for inline sessions using the inlineVerticalFieldOfView and canvas size
pub fn session_id(&self) -> SessionId
pub fn dirty_layers(&self)
fn layers_begin_frame(&self, frame: &XRFrame)
fn layers_end_frame(&self, frame: &XRFrame)
sourcefn apply_frame_updates(&self, _frame: &XRFrame)
fn apply_frame_updates(&self, _frame: &XRFrame)
https://immersive-web.github.io/webxr/#xrframe-apply-frame-updates
fn handle_frame_event(&self, event: FrameUpdateEvent)
Trait Implementations§
source§impl Castable for XRSession
impl Castable for XRSession
source§impl DomObjectWrap for XRSession
impl DomObjectWrap for XRSession
source§const WRAP: unsafe fn(_: SafeJSContext, _: &GlobalScope, _: Option<HandleObject<'_>>, _: Box<Self>) -> Root<Dom<Self>> = {dom::bindings::codegen::Bindings::XRSessionBinding::XRSession_Binding::Wrap as for<'a, 'b> unsafe fn(script_runtime::JSContext, &'a dom::globalscope::GlobalScope, std::option::Option<js::rust::Handle<'b, *mut js::jsapi::JSObject>>, std::boxed::Box<dom::xrsession::XRSession>) -> dom::bindings::root::Root<dom::bindings::root::Dom<dom::xrsession::XRSession>>}
const WRAP: unsafe fn(_: SafeJSContext, _: &GlobalScope, _: Option<HandleObject<'_>>, _: Box<Self>) -> Root<Dom<Self>> = {dom::bindings::codegen::Bindings::XRSessionBinding::XRSession_Binding::Wrap as for<'a, 'b> unsafe fn(script_runtime::JSContext, &'a dom::globalscope::GlobalScope, std::option::Option<js::rust::Handle<'b, *mut js::jsapi::JSObject>>, std::boxed::Box<dom::xrsession::XRSession>) -> dom::bindings::root::Root<dom::bindings::root::Dom<dom::xrsession::XRSession>>}
source§impl HasParent for XRSession
impl HasParent for XRSession
source§fn as_parent(&self) -> &EventTarget
fn as_parent(&self) -> &EventTarget
This is used in a type assertion to ensure that the source and webidls agree as to what the parent type is
type Parent = EventTarget
source§impl IDLInterface for XRSession
impl IDLInterface for XRSession
source§impl MallocSizeOf for XRSession
impl MallocSizeOf for XRSession
source§fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
source§impl MutDomObject for XRSession
impl MutDomObject for XRSession
source§unsafe fn init_reflector(&self, obj: *mut JSObject)
unsafe fn init_reflector(&self, obj: *mut JSObject)
source§impl PartialEq<XRSession> for XRSession
impl PartialEq<XRSession> for XRSession
source§impl ToJSValConvertible for XRSession
impl ToJSValConvertible for XRSession
source§impl XRSessionMethods for XRSession
impl XRSessionMethods for XRSession
source§fn UpdateRenderState(
&self,
init: &XRRenderStateInit,
_: InRealm<'_>
) -> Result<(), Error>
fn UpdateRenderState( &self, init: &XRRenderStateInit, _: InRealm<'_> ) -> Result<(), Error>
https://immersive-web.github.io/webxr/#dom-xrsession-updaterenderstate
source§fn RequestAnimationFrame(&self, callback: Rc<XRFrameRequestCallback>) -> i32
fn RequestAnimationFrame(&self, callback: Rc<XRFrameRequestCallback>) -> i32
https://immersive-web.github.io/webxr/#dom-xrsession-requestanimationframe
source§fn CancelAnimationFrame(&self, frame: i32)
fn CancelAnimationFrame(&self, frame: i32)
https://immersive-web.github.io/webxr/#dom-xrsession-cancelanimationframe
source§fn EnvironmentBlendMode(&self) -> XREnvironmentBlendMode
fn EnvironmentBlendMode(&self) -> XREnvironmentBlendMode
https://immersive-web.github.io/webxr/#dom-xrsession-environmentblendmode
source§fn VisibilityState(&self) -> XRVisibilityState
fn VisibilityState(&self) -> XRVisibilityState
https://immersive-web.github.io/webxr/#dom-xrsession-visibilitystate
source§fn RequestReferenceSpace(
&self,
ty: XRReferenceSpaceType,
comp: InRealm<'_>
) -> Rc<Promise>
fn RequestReferenceSpace( &self, ty: XRReferenceSpaceType, comp: InRealm<'_> ) -> Rc<Promise>
https://immersive-web.github.io/webxr/#dom-xrsession-requestreferencespace
source§fn InputSources(&self) -> Root<Dom<XRInputSourceArray>>
fn InputSources(&self) -> Root<Dom<XRInputSourceArray>>
https://immersive-web.github.io/webxr/#dom-xrsession-inputsources