First person controls written in ES6 for Three.js as UMD.
npm install --save first-person-controls
import FirstPersonControls from 'first-person-controls'
const controls = new FirstPersonControls(camera)
controls.lookSpeed = 0.1
controls.movementSpeed = 10
const clock = new THREE.Clock(true)
const render = () => {
requestAnimationFrame(render)
controls.update(clock.getDelta())
}
render()
var THREE = require('three');
var FirstPersonControls = require('first-person-controls');
var controls = new FirstPersonControls(camera);
controls.lookSpeed = 0.1;
controls.movementSpeed = 10;
var clock = new THREE.Clock(true);
var render = function() {
requestAnimationFrame(render);
controls.update(clock.getDelta());
};
render();
MIT © Mr.doob, AlteredQualia and Paul Irish.