2015-07-06 17:59:23 +02:00
|
|
|
/**
|
|
|
|
* Represents a fixed camera
|
|
|
|
* @constructor
|
|
|
|
* @extends THREE.PerspectiveCamera
|
|
|
|
* @memberof L3D
|
|
|
|
*/
|
2015-07-06 17:18:08 +02:00
|
|
|
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
|
|
|
};
|
2015-07-06 17:18:08 +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
|
|
|
|
*/
|
2015-07-06 17:18:08 +02:00
|
|
|
L3D.FixedCamera.prototype.look = function() {
|
|
|
|
this.lookAt(this.target);
|
2015-07-06 17:29:59 +02:00
|
|
|
};
|