Interface XRSession

Hierarchy

Properties

domOverlayState?: XRDOMOverlayState
enabledFeatures?: string[]
environmentBlendMode: XREnvironmentBlendMode
frameRate?: number
inputSources: XRInputSourceArray

Returns a list of this session's XRInputSources, each representing an input device used to control the camera and/or scene.

onframeratechange: XRSessionEventHandler
oninputsourceschange: XRInputSourceChangeEventHandler
onvisibilitychange: XRSessionEventHandler
renderState: XRRenderState

object which contains options affecting how the imagery is rendered. This includes things such as the near and far clipping planes

requestHitTest?: ((ray, referenceSpace) => Promise<XRHitResult[]>)

Type declaration

requestHitTestSource?: ((options) => Promise<XRHitTestSource>)

Type declaration

requestHitTestSourceForTransientInput?: ((options) => Promise<XRTransientInputHitTestSource>)
supportedFrameRates?: Float32Array
updateWorldTrackingState?: ((options) => void)

Type declaration

    • (options): void
    • Parameters

      • options: {
            planeDetectionState?: {
                enabled: boolean;
            };
        }
        • Optional planeDetectionState?: {
              enabled: boolean;
          }
          • enabled: boolean

      Returns void

visibilityState: XRVisibilityState

Methods

  • Removes a callback from the animation frame painting callback from XRSession's set of animation frame rendering callbacks, given the identifying handle returned by a previous call to requestAnimationFrame().

    Parameters

    • id: number

    Returns void

  • Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise.

    MDN Reference

    Parameters

    Returns boolean

  • Ends the WebXR session. Returns a promise which resolves when the session has been shut down.

    Returns Promise<void>

  • Schedules the specified method to be called the next time the user agent is working on rendering an animation frame for the WebXR device. Returns an integer value which can be used to identify the request for the purposes of canceling the callback using cancelAnimationFrame(). This method is comparable to the Window.requestAnimationFrame() method.

    Parameters

    Returns number

  • Parameters

    • rate: number

    Returns Promise<void>