Parcourir la source

Merge pull request #4279 from RaananW/viewer-fixes

small fixes and internal structure changes
Raanan Weber il y a 7 ans
Parent
commit
4fe9b0b487

+ 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();

+ 10 - 5
dist/preview release/what's new.md

@@ -5,20 +5,25 @@
 ## Updates
 
 ### Core Engine
+
 - Add the choice of [forming a closed loop](http://doc.babylonjs.com/how_to/how_to_use_curve3#catmull-rom-spline) to the catamull-rom-spline curve3 ([johnk](https://github.com/babylonjsguide))
 - Add support for specifying the center of rotation to textures ([bghgary](http://www.github.com/bghgary))
 
 ### glTF Loader
-  - Add support for KHR_texture_transform ([bghgary](http://www.github.com/bghgary))
+
+- Add support for KHR_texture_transform ([bghgary](http://www.github.com/bghgary))
 
 ## Bug fixes
 
 ### Core Engine
-  - Fix ```shadowEnabled``` property on lights. Shadows are not visble anymore when disabled ([sebavan](http://www.github.com/sebavan))
+
+- Fix ```shadowEnabled``` property on lights. Shadows are not visble anymore when disabled ([sebavan](http://www.github.com/sebavan))
 
 ### Viewer
-  - Fix Navbar Interaction on Mozilla/Firefox ([SzeyinLee](https://github.com/SzeyinLee))
-  - Fix Animation Slider Interaction on Mozilla/Firefox ([sebavan](http://www.github.com/sebavan))
-  - Fix Animation Slider Clickable area size Cross Plat ([sebavan](http://www.github.com/sebavan))
+
+- Fix Navbar Interaction on Mozilla/Firefox ([SzeyinLee](https://github.com/SzeyinLee))
+- Fix Animation Slider Interaction on Mozilla/Firefox ([sebavan](http://www.github.com/sebavan))
+- Fix Animation Slider Clickable area size Cross Plat ([sebavan](http://www.github.com/sebavan))
+- Ground material didn't take the default main color is no material definition was provided ([RaananW](https://github.com/RaananW))
 
 ## Breaking changes