3d-interface/js/l3d/src/cameras/FixedCamera.js

38 lines
807 B
JavaScript
Raw Normal View History

2015-07-06 17:59:23 +02:00
/**
* Represents a fixed camera
* @constructor
* @extends THREE.PerspectiveCamera
* @memberof L3D
*/
L3D.FixedCamera = function(arg1, arg2, arg3, arg4, position, target) {
THREE.PerspectiveCamera.apply(this, arguments);
if (position === undefined) {
position = new THREE.Vector3(0,0,5);
}
if (target === undefined ) {
target = new THREE.Vector3();
}
this.position.x = position.x;
this.position.y = position.y;
this.position.z = position.z;
this.target = target.clone();
2015-07-06 17:29:59 +02:00
};
L3D.FixedCamera.prototype = Object.create(THREE.PerspectiveCamera.prototype);
L3D.FixedCamera.prototype.constructor = L3D.FixedCamera;
2015-07-06 17:59:23 +02:00
/**
* Look function. Just like OpenGL gluLookAt
*/
L3D.FixedCamera.prototype.look = function() {
this.lookAt(this.target);
2015-07-06 17:29:59 +02:00
};