瀏覽代碼

New debug option
setting scene.debug as attribute will turn the debug layer on automatically.

Raanan Weber 7 年之前
父節點
當前提交
15b6e136b5
共有 2 個文件被更改,包括 4 次插入0 次删除
  1. 1 0
      Viewer/src/configuration/configuration.ts
  2. 3 0
      Viewer/src/viewer/viewer.ts

+ 1 - 0
Viewer/src/configuration/configuration.ts

@@ -46,6 +46,7 @@ export interface ViewerConfiguration {
     };
 
     scene?: {
+        debug?: boolean;
         autoRotate?: boolean;
         rotationSpeed?: number;
         defaultCamera?: boolean;

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

@@ -107,6 +107,9 @@ export abstract class AbstractViewer {
         this.scene = new Scene(this.engine);
         // make sure there is a default camera and light.
         this.scene.createDefaultCameraOrLight(true, true, true);
+        if (this.configuration.scene && this.configuration.scene.debug) {
+            this.scene.debugLayer.show();
+        }
         return Promise.resolve(this.scene);
     }