API

Class WebXRSpatialLayerWrapper<LayerT, LayerTypeT>

Wraps a positionable XR composition layer and synchronizes it with a Babylon transform node. The node's scaling does not affect the physical dimensions of the layer.

Type Parameters

Hierarchy (View Summary)

Index
  • Type Parameters

    • LayerT extends any = any

      the concrete positionable WebXR layer type

    • LayerTypeT extends WebXRSpatialLayerType = WebXRSpatialLayerType

    Parameters

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

      Whether the layer should follow changes to the session manager's reference space.

    • createRTTProvider: (
          xrSessionManager: WebXRSessionManager,
      ) => WebXRLayerRenderTargetTextureProvider<LayerTypeT>
    • transformNode: TransformNode

      The Babylon node whose world position and rotation are applied to the native layer.

    • _ownsTransformNode: boolean

    Returns WebXRSpatialLayerWrapper<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
transformNode: TransformNode

The Babylon node whose world position and rotation are applied to the native layer.

usesRenderTargetProvider: boolean = true

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

usesSessionReferenceSpace: boolean

Whether the layer should follow changes to the session manager's reference space.

  • 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.

  • get opacity(): number

    Gets the compositor opacity applied to this layer.

    Returns number

    The native opacity in the range 0 to 1.

    If opacity is not supported by the active XR runtime.

  • set opacity(value: number): void

    Sets the compositor opacity applied to this layer. The native runtime clamps the value to the range 0 to 1.

    Parameters

    • value: number

      The desired opacity.

    Returns void

    If opacity is not supported by the active XR runtime.

  • get quality(): XRLayerQuality

    Gets the compositor quality hint applied to this layer.

    Returns XRLayerQuality

    The current native layer quality hint.

    If quality hints are not supported by the active XR runtime.

  • set quality(value: XRLayerQuality): void

    Sets the compositor quality hint applied to this layer.

    Parameters

    • value: XRLayerQuality

      The desired quality hint.

    Returns void

    If quality hints are not supported by the active XR runtime, or the native runtime rejects the value.

  • Synchronizes the native layer with the current world transform of the Babylon node.

    Parameters

    • useRightHandedSystem: boolean

      whether the Babylon scene uses right-handed coordinates

    • worldScalingFactor: number

      the number of Babylon scene units represented by one meter

    Returns void