|
@@ -7,12 +7,19 @@ import { WebXRState, WebXRRenderTarget } from "./webXRTypes";
|
|
|
* COnfiguration object for WebXR output canvas
|
|
|
*/
|
|
|
export class WebXRManagedOutputCanvasOptions {
|
|
|
+ /**
|
|
|
+ * Options for this XR Layer output
|
|
|
+ */
|
|
|
public canvasOptions: XRWebGLLayerOptions;
|
|
|
|
|
|
+ /**
|
|
|
+ * CSS styling for a newly created canvas (if not provided)
|
|
|
+ */
|
|
|
public newCanvasCssStyle?: string;
|
|
|
|
|
|
/**
|
|
|
- *Get the default values of the configuration object
|
|
|
+ * Get the default values of the configuration object
|
|
|
+ * @returns default values of this configuration object
|
|
|
*/
|
|
|
public static GetDefaults(): WebXRManagedOutputCanvasOptions {
|
|
|
const defaults = new WebXRManagedOutputCanvasOptions();
|
|
@@ -75,6 +82,7 @@ export class WebXRManagedOutputCanvas implements WebXRRenderTarget {
|
|
|
* @param engine the Babylon engine
|
|
|
* @param canvas The canvas to be added/removed (If not specified a full screen canvas will be created)
|
|
|
* @param onStateChangedObservable the mechanism by which the canvas will be added/removed based on XR state
|
|
|
+ * @param configuration optional configuration for this canvas output. defaults will be used if not provided
|
|
|
*/
|
|
|
constructor(engine: ThinEngine, canvas?: HTMLCanvasElement, onStateChangedObservable?: Observable<WebXRState>, private configuration: WebXRManagedOutputCanvasOptions = WebXRManagedOutputCanvasOptions.GetDefaults()) {
|
|
|
this._engine = engine;
|