|
@@ -156,14 +156,24 @@ function Viewport( editor ) {
|
|
|
|
|
|
const camera = editor.cameras[ uuid ];
|
|
|
|
|
|
+ const aspect = container.dom.offsetWidth / container.dom.offsetHeight;
|
|
|
+
|
|
|
if ( camera.isPerspectiveCamera ) {
|
|
|
|
|
|
- camera.aspect = container.dom.offsetWidth / container.dom.offsetHeight;
|
|
|
+ camera.aspect = aspect;
|
|
|
+
|
|
|
+ } else {
|
|
|
|
|
|
- camera.updateProjectionMatrix();
|
|
|
+ camera.left = - aspect;
|
|
|
+ camera.right = aspect;
|
|
|
|
|
|
}
|
|
|
|
|
|
+ camera.updateProjectionMatrix();
|
|
|
+
|
|
|
+ const cameraHelper = editor.helpers[ camera.id ];
|
|
|
+ if ( cameraHelper ) cameraHelper.update();
|
|
|
+
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -631,14 +641,10 @@ function Viewport( editor ) {
|
|
|
|
|
|
const viewportCamera = editor.viewportCamera;
|
|
|
|
|
|
- if ( viewportCamera.isPerspectiveCamera ) {
|
|
|
+ if ( viewportCamera.isPerspectiveCamera || viewportCamera.isOrthographicCamera ) {
|
|
|
|
|
|
updateAspectRatio();
|
|
|
|
|
|
- } else if ( viewportCamera.isOrthographicCamera ) {
|
|
|
-
|
|
|
- // TODO
|
|
|
-
|
|
|
}
|
|
|
|
|
|
// disable EditorControls when setting a user camera
|