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

  • 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

currentVRCamera: Nullable<Camera>

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

deviceOrientationCamera

deviceOrientationCamera: Nullable<DeviceOrientationCamera>

The deviceOrientationCamera used as the camera when not in VR.

displayGaze

displayGaze: boolean

Sets if the ray of the gaze should be displayed.

displayLaserPointer

displayLaserPointer: boolean

Sets if the ray of the LaserPointer should be displayed.

gazeTrackerMesh

gazeTrackerMesh: Mesh

The mesh used to display where the user is selecting, when set bakeCurrentTransformIntoVertices will be called on the mesh. See http://doc.babylonjs.com/resources/baking_transformations

isInVRMode

isInVRMode: boolean

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

meshSelectionPredicate

meshSelectionPredicate: function

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

Type declaration

onAfterCameraTeleport

onAfterCameraTeleport: Observable<Vector3>

Observable raised after camera teleportation

onBeforeCameraTeleport

onBeforeCameraTeleport: Observable<Vector3>

Observable raised before camera teleportation

onControllerMeshLoaded

onControllerMeshLoaded: Observable<WebVRController>

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

onControllerMeshLoadedObservable

onControllerMeshLoadedObservable: Observable<WebVRController>

Observable raised when controller mesh is loaded.

onEnteringVR

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

onEnteringVRObservable

onEnteringVRObservable: Observable<VRExperienceHelper>

Observable raised when entering VR.

onExitingVR

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

onExitingVRObservable

onExitingVRObservable: Observable<VRExperienceHelper>

Observable raised when exiting VR.

onNewMeshPicked

onNewMeshPicked: Observable<PickingInfo>

Observable raised when a new mesh is picked based on meshSelectionPredicate

onNewMeshSelected

onNewMeshSelected: Observable<AbstractMesh>

Observable raised when a new mesh is selected based on meshSelectionPredicate

onSelectedMeshUnselected

onSelectedMeshUnselected: Observable<AbstractMesh>

Observable raised when current selected mesh gets unselected

position

position: Vector3

Sets the position of the vr experience helper.

raySelectionPredicate

raySelectionPredicate: function

To be optionaly changed by user to define custom ray selection

Type declaration

teleportationEnabled

teleportationEnabled: boolean

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

teleportationTarget

teleportationTarget: Mesh

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

vrDeviceOrientationCamera

vrDeviceOrientationCamera: Nullable<VRDeviceOrientationFreeCamera>

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

webVRCamera

webVRCamera: WebVRFreeCamera

The webVRCamera which is used when in VR.

webVROptions

Options to modify the vr experience helper's behavior.

Methods

addFloorMesh

  • 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

  • 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

  • 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

  • dispose(): void
  • Exits VR and disposes of the vr experience helper

    Returns void

enableInteractions

  • enableInteractions(): void
  • Enables controllers and user interactions suck as selecting and object or clicking on an object.

    Returns void

enableTeleportation

  • Enables interactions and teleportation using the VR controllers and gaze.

    Parameters

    Returns void

enterVR

  • 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

  • exitVR(): void
  • Attempt to exit VR, or fullscreen.

    Returns void

getClassName

  • getClassName(): string
  • Gets the name of the VRExperienceHelper class

    Returns string

    "VRExperienceHelper"

removeFloorMesh

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

    Parameters

    • floorMesh: Mesh

      the mesh to be removed.

    Returns void

Generated using TypeDoc