Cursor component for tracked controls in A-Frame.
npm install aframe-controller-cursor-component
trackpaddown for 3DoF. | triggerdown |
trackpadup for 3DoF. | triggerup |
html
`
The controller cursor component is based on A-Frame's built-in
cursor, many of the
events and states are shared.
mouseup and mousedown are mapped to the trigger. Pulling the trigger will
emit the same events as clicking.
$3
To avoid intersecting with the laser, the raycaster's near property is set to
0.03. Thus, you may see odd results when the top of the controller is held
extremely close to the entity you wish to intersect.
This component was built for the Vive controller model. If you are using a
different model, you may need to modify the raycaster and position of the
laser. In the future, this should be made more easily configurable.
#### Browser
Install and use by directly including the browser files:
`html
My A-Frame Scene
`
#### npm
Install via npm:
`bash
npm install aframe-controller-cursor-component
`
Then register and use.
`js
require('aframe');
require('aframe-controller-cursor-component');
``