提交 db769897 编写于 作者: D Daniel Hritzkiv

Use copy for PerspectiveCamera and OrthographicCamera to clone/copy attributes

上级 6bab902d
......@@ -36,17 +36,17 @@ THREE.OrthographicCamera.prototype.updateProjectionMatrix = function () {
};
THREE.OrthographicCamera.prototype.clone = function () {
var camera = new this.constructor( this.left, this.right, this.top, this.bottom, this.near, this.far );
return camera.copy( this );
};
THREE.OrthographicCamera.prototype.copy = function ( source ) {
THREE.Camera.prototype.copy.call( this, source );
this.left = source.left;
this.right = source.right;
this.top = source.top;
this.bottom = source.bottom;
this.near = source.near;
this.far = source.far;
this.zoom = source.zoom;
return this;
......
......@@ -122,17 +122,15 @@ THREE.PerspectiveCamera.prototype.updateProjectionMatrix = function () {
};
THREE.PerspectiveCamera.prototype.clone = function () {
var camera = new this.constructor( this.fov, this.aspect, this.near, this.far );
return camera.copy( this );
};
THREE.PerspectiveCamera.prototype.copy = function ( source ) {
THREE.Camera.prototype.copy.call( this, source );
this.fov = source.fov;
this.aspect = source.aspect;
this.near = source.near;
this.far = source.far;
this.zoom = source.zoom;
return this;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册