API

Class VRExperienceHelper

Helps to quickly add VR support to an existing scene. See https://doc.babylonjs.com/features/featuresDeepDive/cameras/webVRHelper

Use WebXR instead!

Index
enableGazeEvenWhenNoPointerLock: boolean = false

Gets or sets a boolean indicating that gaze can be enabled even if pointer lock is not engage (useful on iOS where fullscreen mode and pointer lock are not supported)

exitVROnDoubleTap: boolean = true

Gets or sets a boolean indicating that the VREXperienceHelper will exit VR if double tap is detected

meshSelectionPredicate: (mesh: AbstractMesh) => boolean

To be optionally changed by user to define custom selection logic (after ray selection)

onAfterCameraTeleport: Observable<Vector3> = ...

Observable raised after camera teleportation

onAfterEnteringVRObservable: Observable<OnAfterEnteringVRObservableEvent> = ...

Observable raised when entering VR has completed.

onBeforeCameraTeleport: Observable<Vector3> = ...

Observable raised before camera teleportation

onEnteringVRObservable: Observable<VRExperienceHelper> = ...

Observable raised right before entering VR.

onExitingVRObservable: Observable<VRExperienceHelper> = ...

Observable raised when exiting VR.

onNewMeshPicked: Observable<PickingInfo> = ...

Observable raised when a new mesh is picked based on meshSelectionPredicate

onNewMeshSelected: Observable<AbstractMesh> = ...

Observable raised when a new mesh is selected based on meshSelectionPredicate

onSelectedMeshUnselected: Observable<AbstractMesh> = ...

Observable raised when current selected mesh gets unselected

raySelectionPredicate: (mesh: AbstractMesh) => boolean

To be optionally changed by user to define custom ray selection

requestPointerLockOnFullScreen: boolean = true

Defines whether or not Pointer lock should be requested when switching to full screen.

teleportationEnabled: boolean = true

Set teleportation enabled. If set to false camera teleportation will be disabled but camera rotation will be kept.

updateControllerLaserColor: boolean = true

If the controller laser color should be updated when selecting meshes

updateGazeTrackerColor: boolean = true

If the gaze trackers color should be updated when selecting meshes

updateGazeTrackerScale: boolean = true

If the gaze trackers scale should be updated to be constant size when pointing at near/far meshes

webVROptions: VRExperienceHelperOptions = {}

[Empty object] Options to modify the vr experience helper's behavior.

If asking to force XR, this will be populated with the default xr experience

xrTestDone: boolean = false

Was the XR test done already. If this is true AND this.xr exists, xr is initialized. If this is true and no this.xr, xr exists but is not supported, using WebVR.

TELEPORTATIONMODE_CONSTANTSPEED: 1

Speed Constant Teleportation Mode

TELEPORTATIONMODE_CONSTANTTIME: 0

Time Constant Teleportation Mode