Options
All
  • Public
  • Public/Protected
  • All
Menu

Class XRSession Abstract

Hierarchy

  • EventTarget
    • XRSession

Implements

Implemented by

Index

Constructors

  • Returns XRSession

Properties

depthDataFormat: XRDepthDataFormat
depthUsage: XRDepthUsage
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
preferredReflectionFormat?: XRReflectionFormat
renderState: XRRenderState

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

supportedFrameRates?: Float32Array
visibilityState: XRVisibilityState

Methods

  • addEventListener<K>(type: K, listener: ((this: XRSession, ev: XRSessionEventMap[K]) => any), options?: boolean | AddEventListenerOptions): void
  • addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void
  • Type Parameters

    Parameters

    Returns void

  • Parameters

    • type: string
    • listener: EventListenerOrEventListenerObject
    • Optional options: boolean | AddEventListenerOptions

    Returns void

  • cancelAnimationFrame(id: number): void
  • 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

  • end(): Promise<void>
  • Ends the WebXR session. Returns a promise which resolves when the session has been shut down.

    Returns Promise<void>

  • initiateRoomCapture(): Promise<void>
  • Returns Promise<void>

  • removeEventListener<K>(type: K, listener: ((this: XRSession, ev: XRSessionEventMap[K]) => any), options?: boolean | EventListenerOptions): void
  • removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void
  • Type Parameters

    Parameters

    Returns void

  • Parameters

    • type: string
    • listener: EventListenerOrEventListenerObject
    • Optional options: boolean | EventListenerOptions

    Returns 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

  • The XRSession interface is extended with the ability to create new XRLightProbe instances. XRLightProbe instances have a session object, which is the XRSession that created this XRLightProbe.

    Can reject with with a "NotSupportedError" DOMException

    Parameters

    Returns Promise<XRLightProbe>

  • Requests that a new XRReferenceSpace of the specified type be created. Returns a promise which resolves with the XRReferenceSpace or XRBoundedReferenceSpace which was requested, or throws a NotSupportedError if the requested space type isn't supported by the device.

    Parameters

    Returns Promise<XRReferenceSpace | XRBoundedReferenceSpace>

  • trySetFeaturePointCloudEnabled(enabled: boolean): boolean
  • Parameters

    • enabled: boolean

    Returns boolean

  • trySetMeshDetectorEnabled(enabled: boolean): boolean
  • Parameters

    • enabled: boolean

    Returns boolean

  • Parameters

    Returns Promise<void>

  • updateTargetFrameRate(rate: number): Promise<void>
  • Parameters

    • rate: number

    Returns Promise<void>

  • updateWorldTrackingState(options: { planeDetectionState?: { enabled: boolean } }): undefined | void
  • Parameters

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

    Returns undefined | void

Legend

  • Constructor
  • Property
  • Method
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Property
  • Method
  • Static method

Settings

Theme