Options
All
  • Public
  • Public/Protected
  • All
Menu

Class WebXRMotionControllerTeleportation

This is a teleportation feature to be used with WebXR-enabled motion controllers. When enabled and attached, the feature will allow a user to move around and rotate in the scene using the input of the attached controllers.

Hierarchy

Implements

Index

Constructors

constructor

Properties

backwardsMovementEnabledSearch playground for backwardsMovementEnabled

backwardsMovementEnabled: boolean

Is movement backwards enabled

backwardsTeleportationDistanceSearch playground for backwardsTeleportationDistance

backwardsTeleportationDistance: number

Distance to travel when moving backwards

disableAutoAttachSearch playground for disableAutoAttach

disableAutoAttach: boolean

Should auto-attach be disabled?

isDisposedSearch playground for isDisposed

isDisposed: boolean

Is this feature disposed?

onTargetMeshPositionUpdatedObservableSearch playground for onTargetMeshPositionUpdatedObservable

onTargetMeshPositionUpdatedObservable: Observable<PickingInfo>

This observable will notify when the target mesh position was updated. The picking info it provides contains the point to which the target mesh will move ()

parabolicCheckRadiusSearch playground for parabolicCheckRadius

parabolicCheckRadius: number

The distance from the user to the inspection point in the direction of the controller A higher number will allow the user to move further defaults to 5 (meters, in xr units)

parabolicRayEnabledSearch playground for parabolicRayEnabled

parabolicRayEnabled: boolean

Should the module support parabolic ray on top of direct ray If enabled, the user will be able to point "at the sky" and move according to predefined radius distance Very helpful when moving between floors / different heights

rotationAngleSearch playground for rotationAngle

rotationAngle: number

How much rotation should be applied when rotating right and left

skipNextTeleportationSearch playground for skipNextTeleportation

skipNextTeleportation: boolean

Skip the next teleportation. This can be controlled by the user to prevent the user from teleportation to sections that are not yet "unlocked", but should still show the teleportation mesh.

straightRayEnabledSearch playground for straightRayEnabled

straightRayEnabled: boolean

The second type of ray - straight line. Should it be enabled or should the parabolic line be the only one.

teleportationEnabledSearch playground for teleportationEnabled

teleportationEnabled: boolean

Is teleportation enabled. Can be used to allow rotation only.

xrNativeFeatureNameSearch playground for xrNativeFeatureName

xrNativeFeatureName: string

The name of the native xr feature name (like anchor, hit-test, or hand-tracking)

Static Readonly NameSearch playground for Name

Name: "xr-controller-teleportation" = "xr-controller-teleportation"

The module's name

Static Readonly VersionSearch playground for Version

Version: 1 = 1

The (Babylon) version of this module. This is an integer representing the implementation version. This number does not correspond to the webxr specs version

Accessors

attached

  • get attached(): boolean

rotationEnabled

  • get rotationEnabled(): boolean
  • set rotationEnabled(enabled: boolean): any
  • Is rotation enabled when moving forward? Disabling this feature will prevent the user from deciding the direction when teleporting

    Returns boolean

  • Sets whether rotation is enabled or not

    Parameters

    • enabled: boolean

      is rotation enabled when teleportation is shown

    Returns any

snapPointsOnly

  • get snapPointsOnly(): boolean
  • set snapPointsOnly(snapToPoints: boolean): any
  • Get the snapPointsOnly flag

    Returns boolean

  • Sets the snapPointsOnly flag

    Parameters

    • snapToPoints: boolean

      should teleportation be exclusively to snap points

    Returns any

teleportationTargetMesh

  • Exposes the currently set teleportation target mesh.

    Returns Nullable<AbstractMesh>

Methods

addBlockerMeshSearch playground for addBlockerMesh

  • Add a mesh to the list of meshes blocking the teleportation ray

    Parameters

    • mesh: AbstractMesh

      The mesh to add to the teleportation-blocking meshes

    Returns void

addFloorMeshSearch playground for addFloorMesh

  • Add a new mesh to the floor meshes array

    Parameters

    Returns void

addSnapPointSearch playground for addSnapPoint

  • addSnapPoint(newSnapPoint: Vector3): void
  • Add a new snap-to point to fix teleportation to this position

    Parameters

    • newSnapPoint: Vector3

      The new Snap-To point

    Returns void

attachSearch playground for attach

  • attach(): boolean

detachSearch playground for detach

  • detach(): boolean

disposeSearch playground for dispose

  • dispose(): void

isCompatibleSearch playground for isCompatible

  • isCompatible(): boolean
  • This function will be executed during before enabling the feature and can be used to not-allow enabling it. Note that at this point the session has NOT started, so this is purely checking if the browser supports it

    Returns boolean

    whether or not the feature is compatible in this environment

removeBlockerMeshSearch playground for removeBlockerMesh

  • Remove a mesh from the blocker meshes array

    Parameters

    Returns void

removeFloorMeshSearch playground for removeFloorMesh

  • Remove a mesh from the floor meshes array

    Parameters

    Returns void

removeFloorMeshByNameSearch playground for removeFloorMeshByName

  • removeFloorMeshByName(name: string): void
  • Remove a mesh from the floor meshes array using its name

    Parameters

    • name: string

      the mesh name to remove

    Returns void

removeSnapPointSearch playground for removeSnapPoint

  • removeSnapPoint(snapPointToRemove: Vector3): boolean
  • This function will iterate through the array, searching for this point or equal to it. It will then remove it from the snap-to array

    Parameters

    • snapPointToRemove: Vector3

      the point (or a clone of it) to be removed from the array

    Returns boolean

    was the point found and removed or not

setSelectionFeatureSearch playground for setSelectionFeature

  • This function sets a selection feature that will be disabled when the forward ray is shown and will be reattached when hidden. This is used to remove the selection rays when moving.

    Parameters

    Returns void

Legend

  • Constructor
  • Property
  • Method
  • Accessor
  • Property
  • Method
  • Inherited property
  • Inherited method
  • Static property
  • Static method