fernandojsg / aframe-4dof-controls-component

A-Frame 4DOF Component
https://fernandojsg.github.io/aframe-4dof-controls-component/index.html
MIT License
11 stars 3 forks source link

aframe-4dof-controls-component

Version License

A 4dof Controls component for A-Frame based on the original idea in the Thinking Beyond a Rotation-Only Controller talk.

For A-Frame.

aframe-4dof-controls-component in action

API

Property Description Default Value
events List of events to redirect to the target element.
length Maximum length to move the target element 2
maxAngle Maximum angle to rotate on Z 115
minAngle Minimum angle to rotate on Z 0
target Selector for the target element, if not defined it will default to the first child of the element.

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.7.0/aframe.min.js"></script>
  <script src="https://unpkg.com/aframe-4dof-controls-component/dist/aframe-4dof-controls-component.min.js"></script>
</head>

<body>
  <a-scene>
    <a-entity daydream-controls gearvr-controls 4dof-controls>
      <a-entity><!-- hand --></a-entity>
    </a-entity>
  </a-scene>
</body>

npm

Install via npm:

npm install aframe-4dof-controls-component

Then require and use.

require('aframe');
require('aframe-4dof-controls-component');