Auto-Detect Controllers component for A-Frame.
The auto-detect-controllers component interfaces with the Gamepad API to detect Oculus Touch or Vive tracked-position controllers, and when discovered it injects the appropriate controls e.g. tracked-controls, oculus-touch-controls or vive-controls.
By default, the appropriate controls will be injected with their built-in model enabled,
so the user will see Vive or Oculus Touch controller models depending on which is detected.
(Note however that
gearvr-controls does not supply a controller model.)
In some cases, it may be desirable for the developer to build their own model and/or functionality atop the detected controller component, in which case there are two options:
modelto false, in which case the injected component is instructed not to use its built-in model.
trackedcontrolsto true, in which case the more generic component without model will be injected.
To also use
<!-- include gearvr-controls component... --><!-- then somewhere inside a-scene... -->
|hand||When detected, inject controls with this hand.||'right'|
|singlehand||Single-hand controllers inject with this hand.||'right'|
|model||Inject with this model property value.||true|
Install and use by directly including the browser files:
My A-Frame Scene<!-- If detected, will use built-in controller model (e.g. Oculus Touch or Vive) -->
Install via npm:
npm install aframe-auto-detect-controllers-component
Then register and use.