Browse Source

small fixes and internal structure changes

Raanan Weber 7 years ago
parent
commit
06de34c277
3 changed files with 8 additions and 3 deletions
  1. 1 0
      Viewer/src/configuration/index.ts
  2. 2 0
      Viewer/src/index.ts
  3. 5 3
      Viewer/src/viewer/sceneManager.ts

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

@@ -0,0 +1 @@
+export * from './configuration';

+ 2 - 0
Viewer/src/index.ts

@@ -46,3 +46,5 @@ console.log("Babylon.js viewer (v" + Version + ")");
 
 // public API for initialization
 export { BABYLON, Version, InitTags, DefaultViewer, AbstractViewer, viewerGlobals, telemetryManager, disableInit, viewerManager, mapperManager, disposeAll, ModelLoader, ViewerModel, AnimationPlayMode, AnimationState, ModelState, ILoaderPlugin };
+// export publicliy all configuration interfaces
+export * from './configuration';

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

@@ -915,7 +915,7 @@ export class SceneManager {
         if (!this.environmentHelper) {
             this.environmentHelper = this.scene.createDefaultEnvironment(options)!;
         } else {
-            // there might be a new scene! we need to dispose.
+            // unlikely, but there might be a new scene! we need to dispose.
 
             // get the scene used by the envHelper
             let scene: Scene = this.environmentHelper.rootMesh.getScene();
@@ -933,9 +933,11 @@ export class SceneManager {
         }
 
         let groundConfig = (typeof groundConfiguration === 'boolean') ? {} : groundConfiguration;
-        if (this.environmentHelper.groundMaterial && groundConfig && groundConfig.material) {
+        if (this.environmentHelper.groundMaterial && groundConfig) {
             this.environmentHelper.groundMaterial._perceptualColor = this.mainColor;
-            extendClassWithConfig(this.environmentHelper.groundMaterial, groundConfig.material);
+            if (groundConfig.material) {
+                extendClassWithConfig(this.environmentHelper.groundMaterial, groundConfig.material);
+            }
 
             if (this.environmentHelper.groundMirror) {
                 const mirrorClearColor = this.environmentHelper.groundMaterial._perceptualColor.toLinearSpace();