forked from mrdoob/three.js
/
OrthographicCamera.js
44 lines (28 loc) · 988 Bytes
/
OrthographicCamera.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/**
* @author alteredq / http://alteredqualia.com/
*/
THREE.OrthographicCamera = function ( left, right, top, bottom, near, far ) {
THREE.Camera.call( this );
this.left = left;
this.right = right;
this.top = top;
this.bottom = bottom;
this.near = ( near !== undefined ) ? near : 0.1;
this.far = ( far !== undefined ) ? far : 2000;
this.updateProjectionMatrix();
};
THREE.OrthographicCamera.prototype = Object.create( THREE.Camera.prototype );
THREE.OrthographicCamera.prototype.updateProjectionMatrix = function () {
this.projectionMatrix.makeOrthographic( this.left, this.right, this.top, this.bottom, this.near, this.far );
};
THREE.OrthographicCamera.prototype.clone = function () {
var camera = new THREE.OrthographicCamera();
THREE.Camera.prototype.clone.call( this, camera );
camera.left = this.left;
camera.right = this.right;
camera.top = this.top;
camera.bottom = this.bottom;
camera.near = this.near;
camera.far = this.far;
return camera;
};