Class WebXREnterExitUI
Implements
Constructors
constructor
-
Construct a new EnterExit UI class
Parameters
- _scene: Scene
babylon scene object to use
- options: WebXREnterExitUIOptions
(read-only) version of the options passed to this UI
Returns WebXREnterExitUI
- _scene: Scene
Properties
active Button Changed Observable
Fired every time the active button is changed.
When xr is entered via a button that launches xr that button will be the callback parameter
When exiting xr the callback parameter will be null)
options
version of the options passed to this UI
Readonlyoverlay
The HTML Div Element to which buttons are added.
Methods
dispose
-
Disposes of the XR UI component
Returns void
set Helper Async
-
setHelperAsync(
helper: WebXRExperienceHelper,
renderTarget?: WebXRRenderTarget<WebGLRenderingContext, XRWebGLLayer>,
): Promise<void>Set the helper to be used with this UI component. The UI is bound to an experience helper. If not provided the UI can still be used but the events should be registered by the developer.
Parameters
- helper: WebXRExperienceHelper
the experience helper to attach
OptionalrenderTarget: WebXRRenderTarget<WebGLRenderingContext, XRWebGLLayer>an optional render target (in case it is created outside of the helper scope)
Returns Promise<void>
a promise that resolves when the ui is ready
- helper: WebXRExperienceHelper
StaticCreate Async
-
CreateAsync(
scene: Scene,
helper: WebXRExperienceHelper,
options: WebXREnterExitUIOptions,
): Promise<WebXREnterExitUI>Creates UI to allow the user to enter/exit XR mode
Parameters
- scene: Scene
the scene to add the ui to
- helper: WebXRExperienceHelper
the xr experience helper to enter/exit xr with
- options: WebXREnterExitUIOptions
options to configure the UI
Returns Promise<WebXREnterExitUI>
the created ui
- scene: Scene
UI to allow the user to enter/exit XR mode