Wearable Only
Protected
constructorReadonly
onAn event triggered when the selected controller's state changes between being available for use (connected, properly set up, and transmitting data) and otherwise.
Readonly
onEvent triggered when the motion type of the controller changes.
Readonly
onTriggered by a touch event from the controller. Arguments:
Readonly
onTriggered when the touchpad size is changed. Custom controllers can adjust the interactable area of the touchpad.
Readonly
onEvent triggered when the tracking quality state of the motion controller changes.
Readonly
onAn event is triggered when new motion data becomes available. The arguments are the world position and the world rotation of the motion controller, respectively.
Readonly
optionsReturns the configuration of the motion controller.
Get the current motion type being provided by the motion controller.
Returns the size of the touchpad in centimeters. Returns null
if motion controller is not connected.
Returns the size of the touchpad in points. Returns null
if motion controller is not connected.
Returns the tracking quality state of the motion controller, indicating whether the data received from it is accurate or not.
Returns the name of this object's type.
Returns the last known position of the motion controller in world coordinate space. If no motion data has been received, or the motion type is set to 3DOF
or NoMotion
, this value will be null
.
Returns the last known rotation of the motion controller in world coordinate space. If no motion data has been received or the motion type is set to NoMotion
, this value will be null
.
Invokes haptic feedback on the controller using a preset of options, if supported.
Indicates whether the selected controller is currently available to use. This means that the device is connected, properly set up, and transmitting data.
Returns true if the object matches or derives from the passed in type.
Returns true if this object is the same as other
. Useful for checking if two references point to the same thing.
Gives access to motion data and touch events from an external device to Spectacles, as well as haptic feedback requests from Spectacles to an external device. Currently, the API supports Mobile Controller only, allowing one motion controller to be connected at a time. Developers use the Motion Controller API through the MotionControllerModule in Lens Studio.
See
Motion Controller Module guide.
Example