XRSession

Overview

The WebXR Device API's XRSession interface represents an ongoing XR session, providing methods and properties used to interact with and control the session. To open a WebXR session, use the XRSystem interface's requestSession() method.

Location

Required Methods


addEventListener (dynamic, dynamic)    (declared in EventTarget)

Registers an event handler of a specific event type on the EventTarget.

 

method addEventListener(partype: dynamic; parlistener: dynamic)

 

void addEventListener(dynamic partype, dynamic parlistener)

 

func addEventListener(_ partype: dynamic, _ parlistener: dynamic)

 

void addEventListener(dynamic partype, dynamic parlistener)

 

Sub addEventListener(partype As dynamic, parlistener As dynamic)

Parameters:

  • partype:
  • parlistener:

addEventListener (dynamic, dynamic, dynamic)    (declared in EventTarget)

Registers an event handler of a specific event type on the EventTarget.

 

method addEventListener(type: dynamic; listener: dynamic; options: dynamic)

 

void addEventListener(dynamic type, dynamic listener, dynamic options)

 

func addEventListener(_ type: dynamic, _ listener: dynamic, _ options: dynamic)

 

void addEventListener(dynamic type, dynamic listener, dynamic options)

 

Sub addEventListener(type As dynamic, listener As dynamic, options As dynamic)

Parameters:

  • type:
  • listener:
  • options:

addEventListener (dynamic, dynamic, Boolean)    (declared in EventTarget)

Registers an event handler of a specific event type on the EventTarget.

 

method addEventListener(type: dynamic; listener: dynamic; useCapture: Boolean)

 

void addEventListener(dynamic type, dynamic listener, Boolean useCapture)

 

func addEventListener(_ type: dynamic, _ listener: dynamic, _ useCapture: Boolean)

 

void addEventListener(dynamic type, dynamic listener, Boolean useCapture)

 

Sub addEventListener(type As dynamic, listener As dynamic, useCapture As Boolean)

Parameters:

  • type:
  • listener:
  • useCapture:

cancelAnimationFrame

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().

 

method cancelAnimationFrame(parhandle: dynamic): dynamic

 

dynamic cancelAnimationFrame(dynamic parhandle)

 

func cancelAnimationFrame(_ parhandle: dynamic) -> dynamic

 

dynamic cancelAnimationFrame(dynamic parhandle)

 

Function cancelAnimationFrame(parhandle As dynamic) As dynamic

Parameters:

  • parhandle:

end

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

 

method end: dynamic

 

dynamic end()

 

func end() -> dynamic

 

dynamic end()

 

Function end() As dynamic

removeEventListener    (declared in EventTarget)

Removes an event listener from the EventTarget.

 

method removeEventListener(partype: dynamic; parlistener: dynamic; paroptions: dynamic; paruseCapture: dynamic): dynamic

 

dynamic removeEventListener(dynamic partype, dynamic parlistener, dynamic paroptions, dynamic paruseCapture)

 

func removeEventListener(_ partype: dynamic, _ parlistener: dynamic, _ paroptions: dynamic, _ paruseCapture: dynamic) -> dynamic

 

dynamic removeEventListener(dynamic partype, dynamic parlistener, dynamic paroptions, dynamic paruseCapture)

 

Function removeEventListener(partype As dynamic, parlistener As dynamic, paroptions As dynamic, paruseCapture As dynamic) As dynamic

Parameters:

  • partype:
  • parlistener:
  • paroptions:
  • paruseCapture:

requestAnimationFrame

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.

 

method requestAnimationFrame(paranimationFrameCallback: dynamic): Int32

 

Int32 requestAnimationFrame(dynamic paranimationFrameCallback)

 

func requestAnimationFrame(_ paranimationFrameCallback: dynamic) -> Int32

 

Int32 requestAnimationFrame(dynamic paranimationFrameCallback)

 

Function requestAnimationFrame(paranimationFrameCallback As dynamic) As Int32

Parameters:

  • paranimationFrameCallback:

requestReferenceSpace

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.

 

method requestReferenceSpace(partype: dynamic): dynamic

 

dynamic requestReferenceSpace(dynamic partype)

 

func requestReferenceSpace(_ partype: dynamic) -> dynamic

 

dynamic requestReferenceSpace(dynamic partype)

 

Function requestReferenceSpace(partype As dynamic) As dynamic

Parameters:

  • partype:

updateRenderState

Updates the properties of the session's render state to match the values specified in the specified XRRenderStateInit dictionary. Any properties not included in the given dictionary are left unchanged from their current values.

 

method updateRenderState(parnewState: dynamic): Int32

 

Int32 updateRenderState(dynamic parnewState)

 

func updateRenderState(_ parnewState: dynamic) -> Int32

 

Int32 updateRenderState(dynamic parnewState)

 

Function updateRenderState(parnewState As dynamic) As Int32

Parameters:

  • parnewState: