Classes
Members
buttons
    left and right buttons.
- Source:
controllerObserver
    Function that tracks turning XR controllers on/off
- Source:
hands
    left and right thumb and index finger
- Source:
movementMode
    or NONE, or SLIDE
- Source:
nearHoverRadius
    Near hover radius:
more than this, selection with ray,
less than this, selection with finger/controller touch
(babylonjs internal defaults to 10cm, we set it to 3cm)
https://github.com/BabylonJS/Babylon.js/blob/a1a76330a43a210c258c274d19ae736cc409752f/packages/dev/core/src/XR/features/WebXRNearInteraction.ts#L446
- Source:
nearPickRadius
    Babylonjs internal, defaults to 2cm, set to 1cm here
- Source:
squeeze
    left and right squeeze values
- Source:
stateChangeObserver
    Function that tracks enter/exit VR
- Source:
thumbstick
    left and right thumbstick, if available
- Source:
touchpad
    left and right touchpad, if available
- Source:
trigger
    left and right trigger values
- Source:
vrHelper
    Underlying babylon VR (obsolete) or XR helper (WebXRDefaultExperience) component
- Source:
world :World
Type:
- Source:
Methods
addFloorMesh()
    Internally used to add teleportation mesh
- Source:
addFloors()
    Adds all world floor meshes to teleportation
- Source:
addSqueezeConsumer(callback)
    Adds given callback to the list of XR controller squeeze button consumer.
Consumer is passed value(0-1) and side (left/right) of the event. 
If it consumes the event, returns false.
    Parameters:
| Name | Type | Description | 
|---|---|---|
| callback | returns true if processing should continue | 
- Source:
addTriggerListener()
    Adds given callback to the list of XR controller trigger listeners
CHECKME: include gamepad trigger?
- Source:
afterTeleportation()
    Called after teleoportation to update non-VR world camera and dynamic terrain if needed
- Source:
armPos(side)
    Returns the absolute position of left or right controller grip
    Parameters:
| Name | Type | Description | 
|---|---|---|
| side | left or right | 
- Source:
armRot(side)
    Returns the rotation quaternion of left or right controller grip
    Parameters:
| Name | Type | Description | 
|---|---|---|
| side | left or right | 
- Source:
camera()
    Returns the current WebXRCamera
- Source:
changePosition()
    Change position of WebXRCamera by given distance, i.e. moves forward or back
- Source:
changeRotation()
    Rotates the WebXRCamera by given angle
- Source:
clearFloors()
    Removes all current teleportation meshes
- Source:
clearPointer()
    Removes pointer ray and target
- Source:
createPointer()
    Creates pointer ray and intersection mesh.
- Source:
disableMovement() → {string}
    Disable both teleportation and sliding.
- Source:
Returns:
    previous movement mode
- Type
- string
enableMovement(mode)
    Enable movement in given mode
    Parameters:
| Name | Type | Description | 
|---|---|---|
| mode | string | TELEPORT or SLIDE | 
- Source:
enableSliding()
    Experimental, quite limited.
Disable teleportation and enable sliding movement.
Movement then ignores collisions, i.e. camera flies through everything.
Correctly implementing this will require collision calculation using a collider mesh,
mesh.moveWithCollisions(), then setting camera positon - much like AvatarMovement.moveAvatar().
- Source:
enableTeleportation()
    Disable sliding movement and enable teleportation.
- Source:
handPosition(side)
    Returns controller/hand position relative to the user.
    Parameters:
| Name | Type | Description | 
|---|---|---|
| side | string | left or right | 
- Source:
handRotation(side)
    Returns controller/hand rotation relative to the user.
    Parameters:
| Name | Type | Description | 
|---|---|---|
| side | string | left or right | 
- Source:
(async) initXR(world)
Parameters:
| Name | Type | Description | 
|---|---|---|
| world | World | attaches the control to the World | 
- Source:
leftArmPos()
    Returns the absolute position of left controller grip
- Source:
leftArmRot()
    Returns the rotation quaternion of left controller grip
- Source:
raySelectionPredicate()
    Returns the current ray selection predicate, and optionally installs a new one
- Source:
realWorldHeight()
    Returns the height of the user, as defined by WebXRCamera
- Source:
removeFloorMesh()
    Internally used to remove teleportation mesh
- Source:
removeSqueezeConsumer()
    Remove squeeze listener
- Source:
removeTriggerListener()
    Remove trigger listener
- Source:
rightArmPos()
    Returns the absolute position of right controller grip
- Source:
rightArmRot()
    Returns the rotation quaternion of right controller grip
- Source:
squeezeTracker()
    Used internally to track squeeze buttons of VR controllers. Disables the teleporation if a button is pressed.
Calls squeeze listeners, passing the them the value (0-1) and side (left/right);
- Source:
startTracking()
    Start XR device tracking: prepare pointer ray and mesh, and register tracking function (trackXrDevices) to scene render loop.
- Source:
stopTracking()
    Stop XR device tracking: clean up
- Source:
teleportEnd()
    End of teleportation: moves the camera to the destination (this.teleportTarget) and cleans up.
- Source:
teleportStart()
    Start of teleportation, when gampad stick is pressed forward.
Installs a ray caster into rendering loop, that moves teleportation destination marker around.
- Source:
trackThumbsticks(callback)
    Track thumbsticks on VR controllers. Thumbsticks are used for teleporatation by default,
so this may be useful when teleporation is disabled.
    Parameters:
| Name | Type | Description | 
|---|---|---|
| callback | function to call when thumbsticks change, passed position (x,y) and side (left/right) | 
- Source:
trackXrDevices()
    Called from render loop to set internal state variables, and implements XR pointer for mobile devices.
When XR controllers are unavailable, it renders a ray pointing forward, and moves pointer mesh to
ray intersection with scene meshes.
Calls World.trackXrDevices()
- Source:
triggerTracker()
    Used internally to track triggers of VR controllers. Disables the teleporation if a trigger is pressed.
Calls trigger listeners, passing the them the value (0-1) and side (left/right);
- Source:
xrDeviceTracker()
    Function that tracks XR devices (headeset, controllers), calls this.trackXrDevices()
- Source: