Class WebXRMotionControllerTeleportation
Hierarchy
- WebXRAbstractFeature
- WebXRMotionControllerTeleportation
Index
Constructors
Properties
Accessors
Methods
Constructors
constructor
constructs a new teleportation system
Parameters
_xrSessionManager: WebXRSessionManager
an instance of WebXRSessionManager
_options: IWebXRTeleportationOptions
configuration object for this feature
Returns WebXRMotionControllerTeleportation
Properties
backwards Movement EnabledSearch playground for backwardsMovementEnabled
Is movement backwards enabled
backwards Teleportation DistanceSearch playground for backwardsTeleportationDistance
Distance to travel when moving backwards
disable Auto AttachSearch playground for disableAutoAttach
Should auto-attach be disabled?
is DisposedSearch playground for isDisposed
Is this feature disposed?
on Target Mesh Position Updated ObservableSearch playground for onTargetMeshPositionUpdatedObservable
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 ()
parabolic Check RadiusSearch playground for parabolicCheckRadius
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)
parabolic Ray EnabledSearch playground for parabolicRayEnabled
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
rotation AngleSearch playground for rotationAngle
How much rotation should be applied when rotating right and left
skip Next TeleportationSearch playground for skipNextTeleportation
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.
straight Ray EnabledSearch playground for straightRayEnabled
The second type of ray - straight line. Should it be enabled or should the parabolic line be the only one.
teleportation EnabledSearch playground for teleportationEnabled
Is teleportation enabled. Can be used to allow rotation only.
xr Native Feature NameSearch playground for xrNativeFeatureName
The name of the native xr feature name (like anchor, hit-test, or hand-tracking)
Static Readonly NameSearch playground for Name
The module's name
Static Readonly VersionSearch playground for Version
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
Is this feature attached
Returns boolean
rotation Enabled
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 void
snap Points Only
Get the snapPointsOnly flag
Returns boolean
Sets the snapPointsOnly flag
Parameters
snapToPoints: boolean
should teleportation be exclusively to snap points
Returns void
teleportation Target Mesh
Exposes the currently set teleportation target mesh.
Returns Nullable<AbstractMesh>
Methods
add Blocker MeshSearch 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
add Floor MeshSearch playground for addFloorMesh
Add a new mesh to the floor meshes array
Parameters
mesh: AbstractMesh
the mesh to use as floor mesh
Returns void
add Snap PointSearch playground for addSnapPoint
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 this feature
Returns boolean
true if successful, false is failed or already attached
detachSearch playground for detach
detach this feature.
Returns boolean
true if successful, false if failed or already detached
disposeSearch playground for dispose
Dispose this feature and all of the resources attached
Returns void
is CompatibleSearch playground for isCompatible
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
remove Blocker MeshSearch playground for removeBlockerMesh
Remove a mesh from the blocker meshes array
Parameters
mesh: AbstractMesh
the mesh to remove
Returns void
remove Floor MeshSearch playground for removeFloorMesh
Remove a mesh from the floor meshes array
Parameters
mesh: AbstractMesh
the mesh to remove
Returns void
remove Floor Mesh By NameSearch playground for removeFloorMeshByName
Remove a mesh from the floor meshes array using its name
Parameters
name: string
the mesh name to remove
Returns void
remove Snap PointSearch playground for removeSnapPoint
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
set Selection FeatureSearch 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
selectionFeature: Nullable<IWebXRFeature>
the feature to disable when forward movement is enabled
Returns void
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.