|
@@ -5,7 +5,7 @@ import { WebXRControllerModelLoader } from './webXRControllerModelLoader';
|
|
|
import { WebXRControllerPointerSelection } from './webXRControllerPointerSelection';
|
|
|
import { WebXRControllerTeleportation } from './webXRControllerTeleportation';
|
|
|
import { WebXRRenderTarget } from './webXRTypes';
|
|
|
-import { WebXREnterExitUI } from './webXREnterExitUI';
|
|
|
+import { WebXREnterExitUI, WebXREnterExitUIOptions } from './webXREnterExitUI';
|
|
|
import { AbstractMesh } from '../../Meshes/abstractMesh';
|
|
|
import { WebXRManagedOutputCanvasOptions } from './webXRManagedOutputCanvas';
|
|
|
|
|
@@ -26,7 +26,12 @@ export class WebXRDefaultExperienceOptions {
|
|
|
/**
|
|
|
* optional configuration for the output canvas
|
|
|
*/
|
|
|
- public outputCanvasOptions? : WebXRManagedOutputCanvasOptions;
|
|
|
+ public outputCanvasOptions?: WebXRManagedOutputCanvasOptions;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * optional UI options. This can be used among other to change session mode and reference space type
|
|
|
+ */
|
|
|
+ public uiOptions?: WebXREnterExitUIOptions;
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -54,7 +59,7 @@ export class WebXRDefaultExperience {
|
|
|
*/
|
|
|
public teleportation: WebXRControllerTeleportation;
|
|
|
/**
|
|
|
- * Enables ui for enetering/exiting xr
|
|
|
+ * Enables ui for entering/exiting xr
|
|
|
*/
|
|
|
public enterExitUI: WebXREnterExitUI;
|
|
|
/**
|
|
@@ -88,8 +93,11 @@ export class WebXRDefaultExperience {
|
|
|
result.renderTarget = result.baseExperience.sessionManager.getWebXRRenderTarget(xrHelper.onStateChangedObservable, options.outputCanvasOptions);
|
|
|
|
|
|
if (!options.disableDefaultUI) {
|
|
|
+ if (options.uiOptions) {
|
|
|
+ options.uiOptions.renderTarget = options.uiOptions.renderTarget || result.renderTarget;
|
|
|
+ }
|
|
|
// Create ui for entering/exiting xr
|
|
|
- return WebXREnterExitUI.CreateAsync(scene, result.baseExperience, { renderTarget: result.renderTarget }).then((ui) => {
|
|
|
+ return WebXREnterExitUI.CreateAsync(scene, result.baseExperience, options.uiOptions || { renderTarget: result.renderTarget }).then((ui) => {
|
|
|
result.enterExitUI = ui;
|
|
|
});
|
|
|
} else {
|