VRExperienceHelper

Helps to quickly add VR support to an existing scene. See http://doc.babylonjs.com/how_to/webvr_helper

Hierarchy

  • VRExperienceHelper

Index

Constructors

constructor

Find examples in Playground
  • Instantiates a VRExperienceHelper. Helps to quickly add VR support to an existing scene.

    Parameters

    • scene: Scene

      The scene the VRExperienceHelper belongs to.

    • Optional webVROptions: VRExperienceHelperOptions

      Options to modify the vr experience helper's behavior.

    Returns VRExperienceHelper

Properties

currentVRCamera

Find examples in Playground
currentVRCamera: Nullable<Camera>

Based on the current WebVR support, returns the current VR camera used.

deviceOrientationCamera

Find examples in Playground
deviceOrientationCamera: Nullable<DeviceOrientationCamera>

The deviceOrientationCamera used as the camera when not in VR.

displayGaze

Find examples in Playground
displayGaze: boolean

Sets if the ray of the gaze should be displayed.

displayLaserPointer

Find examples in Playground
displayLaserPointer: boolean

Sets if the ray of the LaserPointer should be displayed.

gazeTrackerMesh

Find examples in Playground
gazeTrackerMesh: Mesh

The mesh used to display where the user is selecting, this mesh will be cloned and set as the gazeTracker for the left and right controller when set bakeCurrentTransformIntoVertices will be called on the mesh. See http://doc.babylonjs.com/resources/baking_transformations

isInVRMode

Find examples in Playground
isInVRMode: boolean

Gets a value indicating if we are currently in VR mode.

leftControllerGazeTrackerMesh

Find examples in Playground
leftControllerGazeTrackerMesh: Nullable<Mesh>

The gaze tracking mesh corresponding to the left controller

meshSelectionPredicate

Find examples in Playground
meshSelectionPredicate: function

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

Type declaration

onAfterCameraTeleport

Find examples in Playground
onAfterCameraTeleport: Observable<Vector3>

Observable raised after camera teleportation

onBeforeCameraTeleport

Find examples in Playground
onBeforeCameraTeleport: Observable<Vector3>

Observable raised before camera teleportation

onControllerMeshLoaded

Find examples in Playground
onControllerMeshLoaded: Observable<WebVRController>

Return this.onControllerMeshLoadedObservable Note: This one is for backward compatibility. Please use onControllerMeshLoadedObservable directly

onControllerMeshLoadedObservable

Find examples in Playground
onControllerMeshLoadedObservable: Observable<WebVRController>

Observable raised when controller mesh is loaded.

onEnteringVR

Find examples in Playground

Return this.onEnteringVRObservable Note: This one is for backward compatibility. Please use onEnteringVRObservable directly

onEnteringVRObservable

Find examples in Playground
onEnteringVRObservable: Observable<VRExperienceHelper>

Observable raised when entering VR.

onExitingVR

Find examples in Playground

Return this.onExitingVRObservable Note: This one is for backward compatibility. Please use onExitingVRObservable directly

onExitingVRObservable

Find examples in Playground
onExitingVRObservable: Observable<VRExperienceHelper>

Observable raised when exiting VR.

onNewMeshPicked

Find examples in Playground
onNewMeshPicked: Observable<PickingInfo>

Observable raised when a new mesh is picked based on meshSelectionPredicate

onNewMeshSelected

Find examples in Playground
onNewMeshSelected: Observable<AbstractMesh>

Observable raised when a new mesh is selected based on meshSelectionPredicate

onSelectedMeshUnselected

Find examples in Playground
onSelectedMeshUnselected: Observable<AbstractMesh>

Observable raised when current selected mesh gets unselected

position

Find examples in Playground
position: Vector3

Sets the position of the vr experience helper.

raySelectionPredicate

Find examples in Playground
raySelectionPredicate: function

To be optionaly changed by user to define custom ray selection

Type declaration

rightControllerGazeTrackerMesh

Find examples in Playground
rightControllerGazeTrackerMesh: Nullable<Mesh>

The gaze tracking mesh corresponding to the right controller

teleportationEnabled

Find examples in Playground
teleportationEnabled: boolean

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

teleportationTarget

Find examples in Playground
teleportationTarget: Mesh

Sets the mesh to be used to display where the user is going to teleport.

updateGazeTrackerScale

Find examples in Playground
updateGazeTrackerScale: boolean

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

vrDeviceOrientationCamera

Find examples in Playground
vrDeviceOrientationCamera: Nullable<VRDeviceOrientationFreeCamera>

The deviceOrientationCamera that is used as a fallback when vr device is not connected.

webVRCamera

Find examples in Playground
webVRCamera: WebVRFreeCamera

The webVRCamera which is used when in VR.

webVROptions

Find examples in Playground

Options to modify the vr experience helper's behavior.

Methods

addFloorMesh

Find examples in Playground
  • addFloorMesh(floorMesh: Mesh): void
  • Adds a floor mesh to be used for teleportation.

    Parameters

    • floorMesh: Mesh

      the mesh to be used for teleportation.

    Returns void

changeGazeColor

Find examples in Playground
  • changeGazeColor(color: Color3): void
  • Sets the color of the ray from the vr headsets gaze.

    Parameters

    • color: Color3

      new color for the ray.

    Returns void

changeLaserColor

Find examples in Playground
  • changeLaserColor(color: Color3): void
  • Sets the color of the laser ray from the vr controllers.

    Parameters

    • color: Color3

      new color for the ray.

    Returns void

dispose

Find examples in Playground
  • dispose(): void
  • Exits VR and disposes of the vr experience helper

    Returns void

enableInteractions

Find examples in Playground
  • enableInteractions(): void
  • Enables controllers and user interactions such as selecting and object or clicking on an object.

    Returns void

enableTeleportation

Find examples in Playground
  • Enables interactions and teleportation using the VR controllers and gaze.

    Parameters

    Returns void

enterVR

Find examples in Playground
  • enterVR(): void
  • Attempt to enter VR. If a headset is connected and ready, will request present on that. Otherwise, will use the fullscreen API.

    Returns void

exitVR

Find examples in Playground
  • exitVR(): void
  • Attempt to exit VR, or fullscreen.

    Returns void

getClassName

Find examples in Playground
  • getClassName(): string
  • Gets the name of the VRExperienceHelper class

    Returns string

    "VRExperienceHelper"

removeFloorMesh

Find examples in Playground
  • removeFloorMesh(floorMesh: Mesh): void
  • Removes a floor mesh from being used for teleportation.

    Parameters

    • floorMesh: Mesh

      the mesh to be removed.

    Returns void

teleportCamera

Find examples in Playground
  • teleportCamera(location: Vector3): void
  • Teleports the users feet to the desired location

    Parameters

    • location: Vector3

      The location where the user's feet should be placed

    Returns void

Generated using TypeDoc