Bläddra i källkod

Updating babylon version and compiling.

Raanan Weber 7 år sedan
förälder
incheckning
abf20e47bd
3 ändrade filer med 4747 tillägg och 2567 borttagningar
  1. 4729 2553
      Viewer/dist/viewer.js
  2. 10 10
      Viewer/package.json
  3. 8 4
      Viewer/src/viewer/defaultViewer.ts

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 4729 - 2553
Viewer/dist/viewer.js


+ 10 - 10
Viewer/package.json

@@ -23,26 +23,26 @@
     },
     "homepage": "https://github.com/BabylonJS/Babylon.js#readme",
     "devDependencies": {
-        "@types/node": "^8.0.44",
+        "@types/node": "^8.0.47",
         "base64-image-loader": "^1.2.0",
         "html-loader": "^0.5.1",
         "json-loader": "^0.5.7",
         "ts-loader": "^2.3.7",
-        "typescript": "^2.5.3",
-        "uglifyjs-webpack-plugin": "^1.0.0-beta.3",
+        "typescript": "^2.6.1",
+        "uglifyjs-webpack-plugin": "^1.0.1",
         "webpack": "^3.8.1",
-        "webpack-dev-server": "^2.9.2"
+        "webpack-dev-server": "^2.9.4"
     },
     "dependencies": {
-        "babylonjs": "^3.1.0-alpha3.6",
-        "babylonjs-loaders": "^3.1.0-alpha3.6",
-        "babylonjs-materials": "^3.1.0-alpha3.6",
-        "babylonjs-post-process": "^3.1.0-alpha3.6",
-        "babylonjs-procedural-textures": "^3.1.0-alpha3.6",
+        "babylonjs": "^3.1.0-alpha3.7",
+        "babylonjs-loaders": "^3.1.0-alpha3.7",
+        "babylonjs-materials": "^3.1.0-alpha3.7",
+        "babylonjs-post-process": "^3.1.0-alpha3.7",
+        "babylonjs-procedural-textures": "^3.1.0-alpha3.7",
         "es6-promise": "^4.1.1",
         "handlebars": "^4.0.11",
         "lodash": "^4.17.4",
         "lodash.merge": "^4.6.0",
         "promise-polyfill": "^6.0.2"
     }
-}
+}

+ 8 - 4
Viewer/src/viewer/defaultViewer.ts

@@ -199,12 +199,12 @@ export class DefaultViewer extends AbstractViewer {
             if (texture) {
                 this.extendClassWithConfig(texture, this.configuration.skybox.cubeTexture);
 
-                let scale = this.configuration.skybox.scale || (this.scene.activeCamera.maxZ - this.scene.activeCamera.minZ) / 2;
+                let scale = this.configuration.skybox.scale || this.scene.activeCamera && (this.scene.activeCamera.maxZ - this.scene.activeCamera.minZ) / 2 || 1;
 
                 let box = this.scene.createDefaultSkybox(texture, this.configuration.skybox.pbr, scale, this.configuration.skybox.blur);
 
                 // before extending, set the material's imageprocessing configuration object, if needed:
-                if (this.configuration.skybox.material && this.configuration.skybox.material.imageProcessingConfiguration) {
+                if (this.configuration.skybox.material && this.configuration.skybox.material.imageProcessingConfiguration && box) {
                     (<StandardMaterial>box.material).imageProcessingConfiguration = new ImageProcessingConfiguration();
                 }
 
@@ -335,6 +335,7 @@ export class DefaultViewer extends AbstractViewer {
                 let lightConfig = this.configuration.lights && this.configuration.lights[name] || { name: name, type: 0 };
                 lightConfig.name = name;
                 let constructor = Light.GetConstructorFromName(lightConfig.type, lightConfig.name, this.scene);
+                if (!constructor) return;
                 let light = constructor();
 
                 //enabled
@@ -347,11 +348,14 @@ export class DefaultViewer extends AbstractViewer {
                 //position. Some lights don't support shadows
                 if (light instanceof ShadowLight) {
                     if (lightConfig.shadowEnabled) {
-                        var shadowGenerator = new BABYLON.ShadowGenerator(512, light)
+                        var shadowGenerator = new BABYLON.ShadowGenerator(512, light);
                         this.extendClassWithConfig(shadowGenerator, lightConfig.shadowConfig || {});
                         // add the focues meshes to the shadow list
+                        let shadownMap = shadowGenerator.getShadowMap();
+                        if (!shadownMap) return;
+                        let renderList = shadownMap.renderList;
                         for (var index = 0; index < focusMeshes.length; index++) {
-                            shadowGenerator.getShadowMap().renderList.push(focusMeshes[index]);
+                            renderList && renderList.push(focusMeshes[index]);
                         }
                     }
                 }