Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bryik/aframe-controller-cursor-component
A cursor for tracked controllers.
https://github.com/bryik/aframe-controller-cursor-component
aframe oculus vive vr
Last synced: 3 months ago
JSON representation
A cursor for tracked controllers.
- Host: GitHub
- URL: https://github.com/bryik/aframe-controller-cursor-component
- Owner: bryik
- License: mit
- Archived: true
- Created: 2016-07-22T21:14:33.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-10-26T20:33:35.000Z (about 6 years ago)
- Last Synced: 2024-05-21T01:58:44.515Z (8 months ago)
- Topics: aframe, oculus, vive, vr
- Language: JavaScript
- Homepage: https://bryik.github.io/aframe-controller-cursor-component/
- Size: 1.02 MB
- Stars: 30
- Watchers: 4
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## aframe-controller-cursor-component
**This is an old component!** A-Frame 0.6.0 and up includes [laser-controls](https://aframe.io/docs/0.6.0/components/laser-controls.html). Use that instead!
[A-Frame](https://aframe.io) component for adding a laser-style cursor to a
tracked controls (e.g., HTC Vive, Oculus Touch).
### API
| Property | Description | Default Value |
|------------|-----------------------------------------------------------------------------------------|---------------|
| color | Laser color. | #74BEC1 |
| downEvents | Event to detect button down, comma-separated. For example, use `trackpaddown` for 3DoF. | triggerdown |
| upEvents | Event to detect button up, comma-separated. For example, use `trackpadup` for 3DoF. | triggerup |
| radius | Laser radius (top and bottom). | 0.001 |### Usage
Attach the component to an entity alongside a tracked controls entity.
```html
```
The controller cursor component is based on A-Frame's [built-in
cursor](https://aframe.io/docs/master/components/cursor.html), 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.### Notes
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](dist):
```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');
```