Skip to main content

XRManager

Since version 4.0.0

WebXR manager class

class XRManager extends Component<{
vrEnd: void;
vrStart: {
session: XRSession
}
}>

Extends

  • Component<{
     vrEnd: void;
     vrStart: {
       session: XRSession
     }
    }>

Methods

Destroy instance and end XR session if there was any.

Enter VR session

Exit VR session

Returns WebXR availability.

Events

An event that fires on exiting VR session

An event that fires on entering VR session

Constructor

Create new instance. 새 인스턴스를 생성합니다.
new XRManager(ctx: WebGLContext, options: XRSessionOptions): XRManager

Parameters

ctx

WebGLContext

Instance of WebGL context helper

options

XRSessionOptions

{}

Options

Methods

destroy

>=4.0.0
destroy

void

destroy(): void

Destroy instance and end XR session if there was any.

enter

>=4.0.0
enter

Promise<void>

enter(): Promise<void>

Enter VR session

exit

>=4.0.0
exit

void

exit(): void

Exit VR session

hasOn

inherited
hasOn

boolean

hasOn<K>(eventName: K): boolean

Parameters

eventName

K

isAvailable

>=4.0.0
isAvailable

Promise<boolean>

isAvailable(): Promise<boolean>

Returns WebXR availability.

off

inherited
off

XRManager

off<K>(eventName: K, handlerToDetach: EventCallback<{ vrEnd: void; vrStart: { session: XRSession } }, K, XRManager>): XRManager

Parameters

eventName

K

handlerToDetach

EventCallback<{ vrEnd: void; vrStart: { session: XRSession } }, K, XRManager>

on

inherited
on

XRManager

on(eventHash: Partial<{ vrEnd: (() => any); vrStart: ((event: { session: XRSession }) => any) }>): XRManager

Parameters

eventHash

Partial<{ vrEnd: (() => any); vrStart: ((event: { session: XRSession }) => any) }>

once

inherited
once

XRManager

once(eventHash: Partial<{ vrEnd: (() => any); vrStart: ((event: { session: XRSession }) => any) }>): XRManager

Parameters

eventHash

Partial<{ vrEnd: (() => any); vrStart: ((event: { session: XRSession }) => any) }>

trigger

inherited
trigger

XRManager

trigger<K>(event: K, ...params: EventTriggerParams<{ vrEnd: void; vrStart: { session: XRSession } }, K>): XRManager

Parameters

event

K

params

EventTriggerParams<{ vrEnd: void; vrStart: { session: XRSession } }, K>

Events

vrEnd

>=4.0.0
vrEnd

void

An event that fires on exiting VR session

vrStart

>=4.0.0
vrStart

{ session: XRSession }

An event that fires on entering VR session