提交 86f15421 编写于 作者: W WestLangley

Update setViewOffset()

上级 65b0ee20
......@@ -53,15 +53,26 @@ OrthographicCamera.prototype = Object.assign( Object.create( Camera.prototype ),
setViewOffset: function ( fullWidth, fullHeight, x, y, width, height ) {
this.view = {
fullWidth: fullWidth,
fullHeight: fullHeight,
offsetX: x,
offsetY: y,
width: width,
height: height
if ( this.view === null ) {
this.view = {
fullWidth: 1,
fullHeight: 1,
offsetX: 0,
offsetY: 0,
width: 1,
height: 1
};
};
this.view.fullWidth = fullWidth;
this.view.fullHeight = fullHeight;
this.view.offsetX = x;
this.view.offsetY = y;
this.view.width = width;
this.view.height = height;
this.updateProjectionMatrix();
},
......
......@@ -148,15 +148,26 @@ PerspectiveCamera.prototype = Object.assign( Object.create( Camera.prototype ),
this.aspect = fullWidth / fullHeight;
this.view = {
fullWidth: fullWidth,
fullHeight: fullHeight,
offsetX: x,
offsetY: y,
width: width,
height: height
if ( this.view === null ) {
this.view = {
fullWidth: 1,
fullHeight: 1,
offsetX: 0,
offsetY: 0,
width: 1,
height: 1
};
};
this.view.fullWidth = fullWidth;
this.view.fullHeight = fullHeight;
this.view.offsetX = x;
this.view.offsetY = y;
this.view.width = width;
this.view.height = height;
this.updateProjectionMatrix();
},
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册