npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

aframe-auto-detect-controllers-component

v0.1.4

Published

Auto-Detect Controllers component for A-Frame.

Downloads

36

Readme

aframe-auto-detect-controllers-component

Auto-Detect Controllers component for A-Frame.

Image of Controllers

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.

If gearvr-controls is included, it will also detect and inject that component. See https://github.com/chenzlabs/gearvr-controls for more information on that component.

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:

  • Set model to false, in which case the injected component is instructed not to use its built-in model.
  • Set trackedcontrols to true, in which case the more generic component without model will be injected.

Example

<a-entity auto-detect-controllers></a-entity>

To also use gearvr-controls:

<!-- include gearvr-controls component... -->
<script src="https://rawgit.com/chenzlabs/gearvr-controls/master/dist/aframe-gearvr-controls-component.min.js"></script>

<!-- then somewhere inside a-scene... -->
<a-entity auto-detect-controllers></a-entity>

Value

| Property | Description | Default Value | |----------------------|----------------------------------------------------|----------------------| | hand | When detected, inject controls with this hand. | 'right' | | singlehand | Single-hand controllers inject with this hand. | 'right' | | trackedcontrols | Inject tracked-controls not e.g. vive-controls | false | | model | Inject with this model property value. | true |

Events

| Event Name | Description | | ---------- | ----------- |

Installation

Browser

Install and use by directly including the browser files:

<head>
  <title>My A-Frame Scene</title>
  <script src="https://aframe.io/releases/0.4.0/aframe.min.js"></script>
  <script src="https://rawgit.com/chenzlabs/auto-detect-controllers/master/dist/aframe-auto-detect-controllers-component.min.js"></script>
</head>

<body>
  <a-scene>
    <!-- If detected, will use built-in controller model (e.g. Oculus Touch or Vive) -->
    <a-entity id="lefthand" auto-detect-controllers="hand:left"></a-entity>
    <a-entity id="righthand" auto-detect-controllers="hand:right"></a-entity>
  </a-scene>
</body>

npm

Install via npm:

npm install aframe-auto-detect-controllers-component

Then register and use.

require('aframe');
require('aframe-auto-detect-controllers-component');