##Overview Intuitive look controls for desktop 3D experiences with A-Frame.
##Demo: https://alexrkass.github.io/no-click-example/
##Features
- 🚫⬅️➡️🚫 Dynamically set maximum yaw and pitch (see options) to control sensitivity and max turn angles.
- 💻 Provides intuitive desktop view controls without requiring mousedown+drag.
- 😎📱💯 Includes the core touch and HMD view controls for drop-in replacement of core
look-controls
component.
##Usage ####Script
<html>
<head>
<!-- A-Frame Library -->
<script src="https://aframe.io/releases/latest/aframe.js"></script>
<!-- Component -->
<script src="dist/aframe-no-click-look-controls"></script>
</head>
<body>
<a-scene>
<!-- ... -->
<a-entity camera no-click-look-controls.js></a-entity>
</a-scene>
</body>
</html>
####NPM
Install module using CLI.
$ npm install no-click-look-controls
Register component in Javascript.
var AFRAME = require('aframe-core');
var NoClickLookControls = require('aframe-no-click-look-controls');
AFRAME.registerComponent('no-click-look-controls', NoClickLookControls);
Add markup.
<a-entity camera no-click-look-controls></a-entity>
##Options
(units are radians)
Property | Default | Description |
---|---|---|
maxyaw | 3π | Controls the max y-axis rotation. Actual max viewing angle is twice the parameter, ie 3π is 3π to the right and 3π to the left. |
maxpitch | π/2 | Controls the max x-axis rotation. Actual max viewing angle is twice the parameter, ie π/2 is π/2 up and π/2 down. |
enabled | true | Enables controls |
######Example Options
<a-entity camera no-click-look-controls="maxyaw: 3.14; maxpitch: 0"></a-entity>