Kaynağa Gözat

Merge pull request #3987 from RaananW/small-feature-viewer

bug fix when no camera configuration provided
Raanan Weber 7 yıl önce
ebeveyn
işleme
4f05cec95d

+ 2 - 2
Viewer/src/viewer/viewer.ts

@@ -861,8 +861,8 @@ export abstract class AbstractViewer {
                 .then(() => {
                     this._configureLights(this._configuration.lights);
 
-                    if (this._configuration.camera) {
-                        this._configureCamera(this._configuration.camera, model);
+                    if (this._configuration.camera || !this.scene.activeCamera) {
+                        this._configureCamera(this._configuration.camera || {}, model);
                     }
                     return this._initEnvironment(model);
                 }).then(() => {

Dosya farkı çok büyük olduğundan ihmal edildi
+ 5 - 5
dist/preview release/viewer/babylon.viewer.js


+ 2 - 2
dist/preview release/viewer/babylon.viewer.max.js

@@ -94347,8 +94347,8 @@ var AbstractViewer = (function () {
             _this.onModelLoadedObservable.notifyObserversWithPromise(model)
                 .then(function () {
                 _this._configureLights(_this._configuration.lights);
-                if (_this._configuration.camera) {
-                    _this._configureCamera(_this._configuration.camera, model);
+                if (_this._configuration.camera || !_this.scene.activeCamera) {
+                    _this._configureCamera(_this._configuration.camera || {}, model);
                 }
                 return _this._initEnvironment(model);
             }).then(function () {