API

Class WebXRCompositionLayerWrapper<LayerT, LayerTypeT>

Wraps an XR composition layer and creates its Babylon render target provider.

Type Parameters

Hierarchy (View Summary)

Index
  • Type Parameters

    • LayerT extends XRCompositionLayer = XRCompositionLayer

      the concrete WebXR composition layer type

    • LayerTypeT extends WebXRSupportedLayerType = WebXRLayerType

    Parameters

    • getWidth: () => number
    • getHeight: () => number
    • layer: LayerT
    • layerType: LayerTypeT
    • isMultiview: boolean

      Whether the layer renders both views into a texture array.

    • createRTTProvider: (
          xrSessionManager: WebXRSessionManager,
      ) => WebXRLayerRenderTargetTextureProvider<LayerTypeT>
    • _originalInternalTexture: Nullable<InternalTexture> = null
    • _destroyLayerOnDispose: boolean = false
    • isStatic: boolean = false

      Whether the layer can only be rendered when its native needsRedraw flag is set.

    Returns WebXRCompositionLayerWrapper<LayerT, LayerTypeT>

_originalInternalTexture: Nullable<InternalTexture> = null
createRTTProvider: (
    xrSessionManager: WebXRSessionManager,
) => WebXRLayerRenderTargetTextureProvider<LayerTypeT>
getHeight: () => number
getWidth: () => number
isMediaLayer: boolean = false

Whether this layer receives its content directly from an HTML media element.

isMultiview: boolean

Whether the layer renders both views into a texture array.

isStatic: boolean = false

Whether the layer can only be rendered when its native needsRedraw flag is set.

layer: LayerT
layerType: LayerTypeT
usesRenderTargetProvider: boolean = true

Whether Babylon should acquire subimages and expose render target textures for this layer.

  • get forceMonoPresentation(): boolean

    Gets whether the compositor presents the left-eye layer configuration to both eyes.

    Returns boolean

    Whether mono presentation is forced.

    If mono presentation control is not supported by the active XR runtime.

  • set forceMonoPresentation(value: boolean): void

    Sets whether the compositor presents the left-eye layer configuration to both eyes. Applications should continue rendering both eyes when this is enabled.

    Parameters

    • value: boolean

      Whether to force mono presentation.

    Returns void

    If mono presentation control is not supported by the active XR runtime.