Explorar o código

render loop registered when scene and model are done loading

Raanan Weber %!s(int64=7) %!d(string=hai) anos
pai
achega
9903f49ea8
Modificáronse 1 ficheiros con 3 adicións e 5 borrados
  1. 3 5
      Viewer/src/viewer/viewer.ts

+ 3 - 5
Viewer/src/viewer/viewer.ts

@@ -271,8 +271,8 @@ export abstract class AbstractViewer {
             } else {
                 this.engine.performanceMonitor.disable();
 
-                // Need to update behaviors
-                this.sceneManager.scene.activeCamera && this.sceneManager.scene.activeCamera.update();
+                // TODO - is this needed?
+                // this.sceneManager.scene.activeCamera && this.sceneManager.scene.activeCamera.update();
             }
         }
     }
@@ -430,6 +430,7 @@ export abstract class AbstractViewer {
                 return this.onSceneInitObservable.notifyObserversWithPromise(scene);
             }).then(() => {
                 this._isInit = true;
+                this.engine.runRenderLoop(this._render);
                 return this.onInitDoneObservable.notifyObserversWithPromise(this);
             }).catch(e => {
                 Tools.Warn(e.toString());
@@ -472,9 +473,6 @@ export abstract class AbstractViewer {
             window.addEventListener('resize', this._resize);
         }
 
-
-        this.engine.runRenderLoop(this._render);
-
         if (this._configuration.engine && this._configuration.engine.adaptiveQuality) {
             var scale = Math.max(0.5, 1 / (window.devicePixelRatio || 2));
             this.engine.setHardwareScalingLevel(scale);