Class WebXRMotionControllerTeleportation
Hierarchy
-
WebXRAbstractFeature
- WebXRMotionControllerTeleportation
Implements
Index
Constructors
Properties
Accessors
Methods
Constructors
constructor
-
constructs a new anchor 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?
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
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.
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 wether rotation is enabled or not
Parameters
-
enabled: boolean
is rotation enabled when teleportation is shown
Returns any
-
snap Points Only
-
Get the snapPointsOnly flag
Returns boolean
-
Sets the snapPointsOnly flag
Parameters
-
snapToPoints: boolean
should teleportation be exclusively to snap points
Returns any
-
teleportation Target Mesh
-
Exposes the currently set teleportation target mesh.
Returns Nullable<AbstractMesh>
Methods
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
-
Returns boolean
detachSearch playground for detach
-
Returns boolean
disposeSearch playground for dispose
-
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 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 ByNameSearch 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.