WebXRExperienceHelper

Base set of functionality needed to create an XR experince (WebXRSessionManager, Camera, StateManagement, etc.)

see

https://doc.babylonjs.com/how_to/webxr

Hierarchy

  • WebXRExperienceHelper

Implements

Index

Properties

camera

Find examples in Playground
camera: WebXRCamera

Camera used to render xr content

featuresManager

Find examples in Playground
featuresManager: WebXRFeaturesManager

A features manager for this xr session

onInitialXRPoseSetObservable

Find examples in Playground
onInitialXRPoseSetObservable: Observable<WebXRCamera>

Observers registered here will be triggered after the camera's initial transformation is set This can be used to set a different ground level or an extra rotation.

Note that ground level is considered to be at 0. The height defined by the XR camera will be added to the position set after this observable is done executing.

onStateChangedObservable

Find examples in Playground
onStateChangedObservable: Observable<WebXRState>

Fires when the state of the experience helper has changed

sessionManager

Find examples in Playground
sessionManager: WebXRSessionManager

Session manager used to keep track of xr session

state

Find examples in Playground
state: WebXRState

The current state of the XR experience (eg. transitioning, in XR or not in XR)

Methods

dispose

Find examples in Playground
  • dispose(): void

enterXRAsync

Find examples in Playground
  • Enters XR mode (This must be done within a user interaction in most browsers eg. button click)

    Parameters

    Returns Promise<WebXRSessionManager>

    promise that resolves after xr mode has entered

exitXRAsync

Find examples in Playground
  • exitXRAsync(): Promise<void>
  • Exits XR mode and returns the scene to its original state

    Returns Promise<void>

    promise that resolves after xr mode has exited

Static CreateAsync

Find examples in Playground
  • Creates the experience helper

    Parameters

    • scene: Scene

      the scene to attach the experience helper to

    Returns Promise<WebXRExperienceHelper>

    a promise for the experience helper

Generated using TypeDoc