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
destroyvoid
destroy(): void
Destroy instance and end XR session if there was any.
enter
>=4.0.0
enterPromise<void>
enter(): Promise<void>
Enter VR session
exit
>=4.0.0
exitvoid
exit(): void
Exit VR session
hasOn
hasOnboolean
hasOn<K>(eventName: K): boolean
Parameters
eventName
K
isAvailable
>=4.0.0
isAvailablePromise<boolean>
isAvailable(): Promise<boolean>
Returns WebXR availability.
off
on
on
on(eventHash: Partial<{ vrEnd: (() => any); vrStart: ((event: { session: XRSession }) => any) }>): XRManager
Parameters
eventHash
Partial<{ vrEnd: (() => any); vrStart: ((event: { session: XRSession }) => any) }>
once
once
once(eventHash: Partial<{ vrEnd: (() => any); vrStart: ((event: { session: XRSession }) => any) }>): XRManager
Parameters
eventHash
Partial<{ vrEnd: (() => any); vrStart: ((event: { session: XRSession }) => any) }>
trigger
trigger
trigger<K>(event: K, ...params: EventTriggerParams<{ vrEnd: void; vrStart: { session: XRSession } }, K>): XRManager
Parameters
event
K
params
EventTriggerParams<{ vrEnd: void; vrStart: { session: XRSession } }, K>