1.0.2 • Published 8 years ago

gl-flyCamera v1.0.2

Weekly downloads
1
License
MIT
Repository
-
Last release
8 years ago

gl-flyCamera

✈️ controls

Installation

$ npm install gl-flyCamera

Example

controls = new flyCamera({
	domElement: document, // default: document
	movementSpeed: 100, // default: 10
	rollSpeed: Math.PI, // default: Math.PI / 3
	dragToLook: true, // default: false
	autoForward: true, // default: false
	paused: true, //default: false
	position: [1, 2, 5] //default: [0, 0, 0]
});
controls.start();

var lastTimeStamp = 0;
function renderLoop(timeStamp){
	var delta = timeStamp - lastTimeStamp;
	lastTimeStamp = timeStamp;

	controls.update(delta);
	var currentPosition = controls.position; //current camera position
	var currentOrientation = controls.quaternion; //current camera orientation
	/*

		...doing the actual rendering

	*/
	window.requestAnimationFrame(renderLoop);
}
window.requestAnimationFrame(renderLoop);

Badges

npm.io npm.io

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago

0.1.0

8 years ago

0.0.1

8 years ago