提交 733be119 编写于 作者: M Mr.doob 提交者: GitHub

Merge pull request #12158 from WestLangley/dev-view_offset

Cameras: update setViewOffset()
......@@ -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.
先完成此消息的编辑!
想要评论请 注册