All Projects → bryik → aframe-controller-cursor-component

bryik / aframe-controller-cursor-component

Licence: MIT license
A cursor for tracked controllers.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to aframe-controller-cursor-component

Aframe
🅰️ web framework for building virtual reality experiences.
Stars: ✭ 13,428 (+44660%)
Mutual labels:  vr, vive, oculus, aframe
home-space
Startpage and WebXR home
Stars: ✭ 43 (+43.33%)
Mutual labels:  vr, vive, oculus
Webxr Handtracking
👐 WebXR hand tracking examples
Stars: ✭ 116 (+286.67%)
Mutual labels:  vr, oculus, aframe
zephyr
Mirror Android notifications to VR
Stars: ✭ 78 (+160%)
Mutual labels:  vr, vive, oculus
MoonMotion
Moon Motion Toolkit - Free and open source toolkit for VR locomotion
Stars: ✭ 38 (+26.67%)
Mutual labels:  vr, vive, oculus
Ideaspace
😎 Create interactive 3D and VR web experiences for desktop, mobile & VR devices
Stars: ✭ 344 (+1046.67%)
Mutual labels:  vr, oculus, aframe
janusweb
An in-browser implementation of JanusVR
Stars: ✭ 145 (+383.33%)
Mutual labels:  vr, vive, oculus
Aframe Vimeo Component
Stream Vimeo videos into WebVR.
Stars: ✭ 62 (+106.67%)
Mutual labels:  vr, oculus, aframe
Thehallaframe
WebVR demo that displays art
Stars: ✭ 120 (+300%)
Mutual labels:  vr, oculus, aframe
Meganekko
Gear VR Application Framework
Stars: ✭ 25 (-16.67%)
Mutual labels:  vr, oculus
zanzarah-tools
The set of various zanzarah browsing and editing tools, written entirely in coffee and js.
Stars: ✭ 29 (-3.33%)
Mutual labels:  vr, aframe
soundstagevr
virtual reality music sandbox built specifically for room-scale VR
Stars: ✭ 38 (+26.67%)
Mutual labels:  vr, oculus
Aframe Effects
A VR Ready Post processing framework for Three.js and/or A-Frame
Stars: ✭ 176 (+486.67%)
Mutual labels:  vr, aframe
a-blast
💥 Save the World From the Cutest Creatures in the Universe!
Stars: ✭ 116 (+286.67%)
Mutual labels:  vr, aframe
Altspacesdk
Software Development Kit for AltspaceVR
Stars: ✭ 159 (+430%)
Mutual labels:  vr, aframe
Aframe Particle System Component
Particle systems for A-Frame.
Stars: ✭ 156 (+420%)
Mutual labels:  vr, aframe
lvr
👓 Augmented Reality for everyone - Out of the world experiences
Stars: ✭ 92 (+206.67%)
Mutual labels:  vr, aframe
thedarkmodvr
VR support for The Dark Mod
Stars: ✭ 49 (+63.33%)
Mutual labels:  vr, vive
AnotherBadBeatSaberClone
This is a discontinued but perhaps helpful VR project created during my Master's degree at FH Wedel.
Stars: ✭ 22 (-26.67%)
Mutual labels:  vr, oculus
virtual-reality-tour
📍 Virtual reality travel in Google Street View.
Stars: ✭ 34 (+13.33%)
Mutual labels:  vr, aframe

aframe-controller-cursor-component

This is an old component! A-Frame 0.6.0 and up includes laser-controls. Use that instead!


A-Frame 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.

<a-entity hand-controls="right" controller-cursor></a-entity>

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.

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:

<head>
  <title>My A-Frame Scene</title>
  <script src="https://cdn.jsdelivr.net/gh/aframevr/aframe@8d60730f449ae0e50976b0dbe58bad4ce25f6602/dist/aframe-master.min.js"></script>
  <script src="https://unpkg.com/[email protected]/dist/aframe-controller-cursor-component.min.js"></script>
</head>

<body>
  <a-scene>
    <a-entity vive-controls="hand: left"></a-entity>
    <a-entity vive-controls="hand: right" controller-cursor></a-entity>
  </a-scene>
</body>

npm

Install via npm:

npm install aframe-controller-cursor-component

Then register and use.

require('aframe');
require('aframe-controller-cursor-component');
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].