API

Class WebXREnterExitUIOptions

Options to create the webXR UI

Index
customButtons?: WebXREnterExitUIButton[]

User provided buttons to enable/disable WebXR. The system will provide default if not set

ignoreSessionGrantedEvent?: boolean

If set, the sessiongranted event will not be registered. sessiongranted is used to move seamlessly between WebXR experiences. If set to true the user will be forced to press the "enter XR" button even if sessiongranted event was triggered. If not set and a sessiongranted event was triggered, the XR session will start automatically.

onError?: (error: any) => void

Called with the error from enterXRAsync when entering XR through the UI fails. The button still displays ERROR; the application decides whether to show a message or rebuild with WebGL.

optionalFeatures?: string[]

A list of optional features to init the session with

referenceSpaceType?: any

A reference space type to use when creating the default button. Default is local-floor

renderTarget?: Nullable<WebXRRenderTarget<WebGLRenderingContext, XRWebGLLayer>>

Context to enter xr with

requiredFeatures?: string[]

A list of optional features to init the session with

sessionMode?: any

A session mode to use when creating the default button. Default is immersive-vr