This package has been deprecated

    Author message:

    name changed to 'aframe-controller-cursor-component'

    aframe-vive-cursor-component

    0.1.2 • Public • Published

    aframe-vive-cursor-component

    This is an A-Frame component for adding a cursor to an HTC Vive controller.

    API

    Property Description Default Value
    color Laser color 0x0000ff
    radius Laser radius (top and bottom) 0.001
    objects Query selector to pick which objects to test for intersection. If not specified, all entities will be tested. ""

    Usage

    Simply attach the component to an entity alongside the vive-controls component.

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

    As it is based on A-Frame's built-in cursor, many of the events and states are shared.

    Note that "mouseup" and "mousedown" have been mapped to the trigger. In other words, pulling the trigger is the same as clicking.

    Notes

    To avoid intersecting with the laser, the raycaster's "near" property is set to 0.03. As a result, 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 the hand model or a different model entirely, you may need to modify the raycaster and position of the laser.

    Browser

    Install and use by directly including the browser files:

    <head>
      <title>My A-Frame Scene</title>
      <script src="https://cdn.rawgit.com/aframevr/aframe/master/dist/aframe.min.js"></script> 
      <script src="https://rawgit.com/bryik/aframe-vive-cursor-component/master/dist/aframe-vive-cursor-component.min.js"></script> 
    </head>
     
    <body>
      <a-scene>
        <a-entity vive-controls="hand: left"></a-entity>
        <a-entity vive-controls="hand: right" vive-cursor></a-entity>
      </a-scene>
    </body>

    npm

    Install via npm:

    npm install aframe-vive-cursor-component

    Then register and use.

    require('aframe');
    require('aframe-vive-cursor-component');

    Install

    npm i aframe-vive-cursor-component

    DownloadsWeekly Downloads

    0

    Version

    0.1.2

    License

    MIT

    Last publish

    Collaborators

    • bryik