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

Find examples in Playground

Properties

backwardsMovementEnabled

Find examples in Playground
backwardsMovementEnabled: boolean

Is movement backwards enabled

backwardsTeleportationDistance

Find examples in Playground
backwardsTeleportationDistance: number

Distance to travel when moving backwards

disableAutoAttach

Find examples in Playground
disableAutoAttach: boolean

Should auto-attach be disabled?

isDisposed

Find examples in Playground
isDisposed: boolean

Is this feature disposed?

parabolicCheckRadius

Find examples in Playground
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)

parabolicRayEnabled

Find examples in Playground
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

rotationAngle

Find examples in Playground
rotationAngle: number

How much rotation should be applied when rotating right and left

rotationEnabled

Find examples in Playground
rotationEnabled: boolean

Is rotation enabled when moving forward? Disabling this feature will prevent the user from deciding the direction when teleporting

xrNativeFeatureName

Find examples in Playground
xrNativeFeatureName: string

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

Static Readonly Name

Find examples in Playground
Name: string

The module's name

Static Readonly Version

Find examples in Playground
Version: number

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

Find examples in Playground
  • get attached(): boolean

snapPointsOnly

Find examples in Playground
  • 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

Methods

addFloorMesh

Find examples in Playground
  • Add a new mesh to the floor meshes array

    Parameters

    Returns void

addSnapPoint

Find examples in Playground
  • 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

attach

Find examples in Playground
  • attach(): boolean

detach

Find examples in Playground
  • detach(): boolean

dispose

Find examples in Playground
  • dispose(): void

isCompatible

Find examples in Playground
  • 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

removeFloorMesh

Find examples in Playground
  • Remove a mesh from the floor meshes array

    Parameters

    Returns void

removeFloorMeshByName

Find examples in Playground
  • 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

removeSnapPoint

Find examples in Playground
  • 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

setSelectionFeature

Find examples in Playground
  • 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

Generated using TypeDoc