2
0
Эх сурвалжийг харах

StereoCamera: Moved focalLength to PerspectiveCamera.

Mr.doob 9 жил өмнө
parent
commit
810979980b

+ 6 - 2
src/cameras/PerspectiveCamera.js

@@ -10,6 +10,7 @@ THREE.PerspectiveCamera = function ( fov, aspect, near, far ) {
 
 	this.type = 'PerspectiveCamera';
 
+	this.focalLength = 100;
 	this.zoom = 1;
 
 	this.fov = fov !== undefined ? fov : 50;
@@ -126,13 +127,14 @@ THREE.PerspectiveCamera.prototype.copy = function ( source ) {
 
 	THREE.Camera.prototype.copy.call( this, source );
 
+	this.focalLength = source.focalLength;
+	this.zoom = source.zoom;
+
 	this.fov = source.fov;
 	this.aspect = source.aspect;
 	this.near = source.near;
 	this.far = source.far;
 
-	this.zoom = source.zoom;
-
 	return this;
 
 };
@@ -141,7 +143,9 @@ THREE.PerspectiveCamera.prototype.toJSON = function ( meta ) {
 
 	var data = THREE.Object3D.prototype.toJSON.call( this, meta );
 
+	data.object.focalLength = this.focalLength;
 	data.object.zoom = this.zoom;
+
 	data.object.fov = this.fov;
 	data.object.aspect = this.aspect;
 	data.object.near = this.near;

+ 0 - 2
src/cameras/StereoCamera.js

@@ -8,8 +8,6 @@ THREE.StereoCamera = function ( fov, aspect, near, far ) {
 
 	this.type = 'StereoCamera';
 
-	this.focalLength = 125;
-
 	this.cameraL = new THREE.PerspectiveCamera();
 	this.cameraL.layers.enable( 1 );
 	this.cameraL.matrixAutoUpdate = false;