Class XRSession Abstract
Hierarchy
- EventTarget
- XRSession
Implements
Implemented by
Index
Constructors
Properties
Methods
- add
Event Listener - cancel
Animation Frame - end
- get
Tracked Image Scores - remove
Event Listener - request
Animation Frame - request
Hit Test - request
Hit Test Source - request
Hit Test Source For Transient Input - request
Light Probe - request
Reference Space - try
Set Feature Point Cloud Enabled - try
Set Mesh Detector Enabled - try
Set Preferred Mesh Detector Options - try
Set Preferred Plane Detector Options - update
Render State - update
Target Frame Rate - update
World Tracking State
Constructors
constructor
Returns XRSession
Properties
Readonly depth Data FormatSearch playground for depthDataFormat
Readonly depth UsageSearch playground for depthUsage
Optional Readonly dom Overlay StateSearch playground for domOverlayState
Readonly environment Blend ModeSearch playground for environmentBlendMode
Optional Readonly frame RateSearch playground for frameRate
Readonly input SourcesSearch playground for inputSources
onendSearch playground for onend
onframeratechangeSearch playground for onframeratechange
oninputsourceschangeSearch playground for oninputsourceschange
onselectSearch playground for onselect
onselectendSearch playground for onselectend
onselectstartSearch playground for onselectstart
onsqueezeSearch playground for onsqueeze
onsqueezeendSearch playground for onsqueezeend
onsqueezestartSearch playground for onsqueezestart
onvisibilitychangeSearch playground for onvisibilitychange
Optional Readonly preferred Reflection FormatSearch playground for preferredReflectionFormat
Readonly render StateSearch playground for renderState
object which contains options affecting how the imagery is rendered. This includes things such as the near and far clipping planes
Optional Readonly supported Frame RatesSearch playground for supportedFrameRates
Readonly visibility StateSearch playground for visibilityState
Methods
add Event ListenerSearch playground for addEventListener
Type Parameters
K extends keyof XRSessionEventMap
Parameters
type: K
listener: ((this: XRSession, ev: XRSessionEventMap[K]) => any)
Parameters
this: XRSession
ev: XRSessionEventMap[K]
Returns any
Optional options: boolean | AddEventListenerOptions
Returns void
Parameters
type: string
listener: EventListenerOrEventListenerObject
Optional options: boolean | AddEventListenerOptions
Returns void
cancel Animation FrameSearch playground for 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().
Parameters
id: number
Returns void
endSearch playground for end
Ends the WebXR session. Returns a promise which resolves when the session has been shut down.
Returns Promise<void>
Optional get Tracked Image ScoresSearch playground for getTrackedImageScores
Returns Promise<XRImageTrackingScore[]>
remove Event ListenerSearch playground for removeEventListener
Type Parameters
K extends keyof XRSessionEventMap
Parameters
type: K
listener: ((this: XRSession, ev: XRSessionEventMap[K]) => any)
Parameters
this: XRSession
ev: XRSessionEventMap[K]
Returns any
Optional options: boolean | EventListenerOptions
Returns void
Parameters
type: string
listener: EventListenerOrEventListenerObject
Optional options: boolean | EventListenerOptions
Returns void
request Animation FrameSearch playground for 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.
Parameters
callback: XRFrameRequestCallback
Returns number
Optional request Hit TestSearch playground for requestHitTest
Parameters
ray: XRRay
referenceSpace: XRReferenceSpace
Returns Promise<XRHitResult[]>
Optional request Hit Test SourceSearch playground for requestHitTestSource
Parameters
options: XRHitTestOptionsInit
Returns Promise<XRHitTestSource>
Optional request Hit Test Source For Transient InputSearch playground for requestHitTestSourceForTransientInput
Parameters
options: XRTransientInputHitTestOptionsInit
Returns Promise<XRTransientInputHitTestSource>
request Light ProbeSearch playground for requestLightProbe
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
Optional options: XRLightProbeInit
Returns Promise<XRLightProbe>
request Reference SpaceSearch playground for 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.
Parameters
type: XRReferenceSpaceType
Returns Promise<XRReferenceSpace | XRBoundedReferenceSpace>
try Set Feature Point Cloud EnabledSearch playground for trySetFeaturePointCloudEnabled
Parameters
enabled: boolean
Returns boolean
try Set Mesh Detector EnabledSearch playground for trySetMeshDetectorEnabled
Parameters
enabled: boolean
Returns boolean
try Set Preferred Mesh Detector OptionsSearch playground for trySetPreferredMeshDetectorOptions
Parameters
preferredOptions: XRGeometryDetectorOptions
Returns boolean
try Set Preferred Plane Detector OptionsSearch playground for trySetPreferredPlaneDetectorOptions
Parameters
preferredOptions: XRGeometryDetectorOptions
Returns boolean
update Render StateSearch playground for updateRenderState
Parameters
Optional renderStateInit: XRRenderStateInit
Returns Promise<void>
update Target Frame RateSearch playground for updateTargetFrameRate
Parameters
rate: number
Returns Promise<void>
Optional update World Tracking StateSearch playground for updateWorldTrackingState
Parameters
options: { planeDetectionState?: { enabled: boolean } }
Optional plane
Detection State?: { enabled: boolean } enabled: boolean
Returns undefined | void
Returns a list of this session's XRInputSources, each representing an input device used to control the camera and/or scene.