浏览代码

updatewhat's new +
Merge remote-tracking branch 'upstream/master' into SPS_optimization

# Conflicts:
# src/Culling/babylon.boundingBox.ts
# src/Math/babylon.math.ts

Julien Barrois 6 年之前
父节点
当前提交
6553b82a3f
共有 100 个文件被更改,包括 112788 次插入58969 次删除
  1. 2 0
      .travis.yml
  2. 2372 2298
      Playground/babylon.d.txt
  3. 50 20
      Playground/frame.css
  4. 11 4
      Playground/frame.html
  5. 6 7
      Playground/js/frame.js
  6. 二进制
      Playground/textures/Dot.png
  7. 二进制
      Playground/textures/Fire_SpriteSheet1_8x8.png
  8. 二进制
      Playground/textures/Fire_SpriteSheet2_8x8.png
  9. 二进制
      Playground/textures/Fire_SpriteSheet3_8x8.png
  10. 二进制
      Playground/textures/Fire_SpriteSheet_8x8.png
  11. 二进制
      Playground/textures/FlameBlastSpriteSheet.png
  12. 二进制
      Playground/textures/FlashParticle.png
  13. 二进制
      Playground/textures/GatonaParkWalkway1_Panorama_4Kx2K.jpg
  14. 二进制
      Playground/textures/Rain.png
  15. 二进制
      Playground/textures/Smoke_SpriteSheet_8x8.png
  16. 二进制
      Playground/textures/Spark.png
  17. 二进制
      Playground/textures/Studio_Softbox_2Umbrellas_cube_specular.dds
  18. 二进制
      Playground/textures/icons/Back.png
  19. 二进制
      Playground/textures/icons/Crop.png
  20. 二进制
      Playground/textures/icons/Delete.png
  21. 二进制
      Playground/textures/icons/Dot.png
  22. 二进制
      Playground/textures/icons/Download.png
  23. 二进制
      Playground/textures/icons/Edit.png
  24. 二进制
      Playground/textures/icons/GearIcon.png
  25. 1 0
      Playground/textures/icons/Icon_Fullscreen.svg
  26. 二进制
      Playground/textures/icons/Open.png
  27. 二进制
      Playground/textures/icons/Pause.png
  28. 二进制
      Playground/textures/icons/Play.png
  29. 二进制
      Playground/textures/icons/Redo.png
  30. 二进制
      Playground/textures/icons/Refresh.png
  31. 二进制
      Playground/textures/icons/Save.png
  32. 二进制
      Playground/textures/icons/Settings.png
  33. 二进制
      Playground/textures/icons/Share.png
  34. 二进制
      Playground/textures/icons/Undo.png
  35. 二进制
      Playground/textures/icons/Upload.png
  36. 二进制
      Playground/textures/icons/Zoom.png
  37. 二进制
      Playground/textures/sparkStretched.png
  38. 二进制
      Playground/textures/sparks.png
  39. 17 3
      Tools/Gulp/config.json
  40. 149 89
      Tools/Gulp/gulpfile.js
  41. 6 6
      Tools/Gulp/package.json
  42. 3 3
      Tools/Publisher/index.js
  43. 2 2
      Tools/Publisher/package.json
  44. 1 1
      Viewer/package.json
  45. 9 9
      Viewer/src/configuration/configuration.ts
  46. 6 6
      Viewer/src/configuration/configurationCompatibility.ts
  47. 4 4
      Viewer/src/configuration/interfaces/modelConfiguration.ts
  48. 1 1
      Viewer/src/configuration/interfaces/sceneOptimizerConfiguration.ts
  49. 2 3
      Viewer/src/configuration/interfaces/templateConfiguration.ts
  50. 1 1
      Viewer/src/configuration/interfaces/vrConfiguration.ts
  51. 12 10
      Viewer/src/configuration/loader.ts
  52. 12 13
      Viewer/src/configuration/mappers.ts
  53. 1 1
      Viewer/src/configuration/types/default.ts
  54. 1 1
      Viewer/src/configuration/types/environmentMap.ts
  55. 1 1
      Viewer/src/configuration/types/extended.ts
  56. 7 7
      Viewer/src/configuration/types/index.ts
  57. 1 1
      Viewer/src/configuration/types/minimal.ts
  58. 2 2
      Viewer/src/configuration/types/shadowLight.ts
  59. 5 5
      Viewer/src/helper/index.ts
  60. 1 1
      Viewer/src/index.ts
  61. 3 4
      Viewer/src/initializer.ts
  62. 1 2
      Viewer/src/labs/environmentSerializer.ts
  63. 10 10
      Viewer/src/labs/texture.ts
  64. 5 5
      Viewer/src/labs/viewerLabs.ts
  65. 8 9
      Viewer/src/loader/modelLoader.ts
  66. 2 2
      Viewer/src/loader/plugins/index.ts
  67. 0 1
      Viewer/src/loader/plugins/telemetryLoaderPlugin.ts
  68. 61 61
      Viewer/src/managers/sceneManager.ts
  69. 1 2
      Viewer/src/managers/telemetryManager.ts
  70. 15 13
      Viewer/src/model/modelAnimation.ts
  71. 27 30
      Viewer/src/model/viewerModel.ts
  72. 4 4
      Viewer/src/optimizer/custom/extended.ts
  73. 1 1
      Viewer/src/optimizer/custom/index.ts
  74. 7 8
      Viewer/src/templating/eventManager.ts
  75. 3 3
      Viewer/src/templating/plugins/printButton.ts
  76. 42 40
      Viewer/src/templating/templateManager.ts
  77. 2 2
      Viewer/src/templating/viewerTemplatePlugin.ts
  78. 50 48
      Viewer/src/viewer/defaultViewer.ts
  79. 29 34
      Viewer/src/viewer/viewer.ts
  80. 2 2
      Viewer/src/viewer/viewerManager.ts
  81. 5 5
      Viewer/tests/commons/boot.ts
  82. 13 13
      Viewer/tests/commons/helper.ts
  83. 139 139
      Viewer/tests/commons/mockWebGL.ts
  84. 2 2
      Viewer/tests/unit/src/configuration/mappers.ts
  85. 15 15
      Viewer/tests/unit/src/configuration/updateConfiguration.ts
  86. 4 4
      Viewer/tests/unit/src/helper.ts
  87. 1 1
      Viewer/tests/unit/src/index.ts
  88. 4 6
      Viewer/tests/unit/src/viewer/sceneManager.ts
  89. 12 12
      Viewer/tests/unit/src/viewer/viewer.ts
  90. 2 2
      Viewer/tests/unit/src/viewer/viewerManager.ts
  91. 44 44
      Viewer/tests/validation/index.html
  92. 31206 16752
      dist/babylon.d.ts
  93. 1 60
      dist/babylon.js
  94. 39130 19469
      dist/babylon.max.js
  95. 39130 19469
      dist/babylon.no-module.max.js
  96. 1 62
      dist/babylon.worker.js
  97. 8 8
      dist/draco_decoder_gltf.js
  98. 二进制
      dist/draco_decoder_gltf.wasm
  99. 112 126
      dist/draco_wasm_wrapper_gltf.js
  100. 0 0
      dist/es6.js

+ 2 - 0
.travis.yml

@@ -21,6 +21,8 @@ jobs:
     script: gulp tests-whatsnew
   - env: JOB=DocumentationCheck
     script: gulp typedoc-check
+  - env: JOB=Styling
+    script: gulp tsLint
   - env: JOB=Build
     script: gulp typescript-all
   - env: JOB=Tests

文件差异内容过多而无法显示
+ 2372 - 2298
Playground/babylon.d.txt


+ 50 - 20
Playground/frame.css

@@ -9,36 +9,66 @@
 }
 
 canvas {
+    height: calc(100% - 56px);
     border:none !important;
     outline:none !important;
 }
 
+.footerLeft{
+    position: relative;
+    display: flex;
+    align-items: center;
+}
+
 #fpsLabel {
-    position: absolute;
-    right: 10px;
-    top: 20px;
     cursor: default;
-    color: white;
+    z-index:10;
+    color:white;
+    pointer-events: none;
+    user-select: none;
+    line-height: 56px;
+    vertical-align: middle;
+    margin: auto 0px auto 15px;
 }
 
-#link {
+
+.footer {
     position: absolute;
     width: 100%;
-    bottom: 10px;
-    cursor: default;
-    color: white;
-    text-align: center;
-    left:0;
-    cursor:pointer;
+    height: 56px;
+    bottom: 0;
+    margin: 0;
+    padding: 0;
+    right: 0;
+    left: 0;
+    background-color: #3B789A;
 }
 
-#refresh {
+.footerRight {
+    display: inline;
     position: absolute;
-    width: 100%;
-    top: 10px;
-    cursor: default;
-    color: white;
-    text-align: center;
-    left:0;
-    cursor:pointer;
-}
+    bottom: 0;
+    right: 0px;
+    top: 0px;
+}
+
+.footerRight a {
+    float: left; /* Float links side by side */
+    width: 56px; 
+    height: 56px;
+    margin: 0px;
+    padding: 0;
+    transition: all 0.3s ease; /* Add transition for hover effects */
+}
+
+.footerRight a img {
+    margin: 10px;
+}
+
+.footerRight a:hover {
+    background-color: #2c5a74; /* Add a hover color */    
+}
+
+.footerRight a:active{
+    background-color: #162D3A; /* Add a hover color */
+}

+ 11 - 4
Playground/frame.html

@@ -76,10 +76,17 @@
     <body>
         <canvas touch-action="none" id="renderCanvas" tabindex="1"></canvas>
 
-        <span class="label" id="fpsLabel">FPS</span>
-
-        <a class="link" id="refresh" href="#">Reload</a>
-        <a class="link" id="link" href="#" target="_blank">Edit</a>
+        <div class="footer">
+        <span id="fpsLabel">FPS</span>
+        <div class="footerRight">
+                <a href="javascript:void(null);">
+                    <img id="refresh" src="textures/icons/refresh.png"  width="36" height="36" alt="Reload page" title="Reload page"/>
+                </a>
+                <a id="edit" href="#" target="_blank">
+                    <img src="textures/icons/edit.png" width="36" height="36" alt="Edit in playground" title="Edit in playground"/>
+                </a>
+        </div>
+        </div>
 
         <script src="https://code.jquery.com/jquery.js"></script>
         <script src="js/frame.js"></script>

+ 6 - 7
Playground/js/frame.js

@@ -4,7 +4,7 @@
     var engine;
     var fpsLabel = document.getElementById("fpsLabel");
     var refreshAnchor = document.getElementById("refresh");
-    var linkAnchor = document.getElementById("link");
+    var editAnchor = document.getElementById("edit");
     var scripts;
     var zipCode;
 
@@ -13,8 +13,8 @@
         fpsLabel.style.display = "none";
         refreshAnchor.style.visibility = "hidden";
         refreshAnchor.style.display = "none";
-        linkAnchor.style.visibility = "hidden";
-        linkAnchor.style.display = "none";
+        editAnchor.style.visibility = "hidden";
+        editAnchor.style.display = "none";
     }
 
     BABYLON.Engine.ShadersRepository = "/src/Shaders/";
@@ -150,7 +150,6 @@
     });
 
     // UI
-
     var cleanHash = function () {
         var splits = decodeURIComponent(location.hash.substr(1)).split("#");
 
@@ -191,10 +190,10 @@
                 xmlHttp.open("GET", snippetUrl + "/" + hash.replace("#", "/"));
                 xmlHttp.send();
 
-                var link = document.getElementById("link");
+                var edit = document.getElementById("edit");
 
-                if (link) {
-                    link.href = "//www.babylonjs-playground.com/#" + hash;
+                if (edit) {
+                    edit.href = "//www.babylonjs-playground.com/#" + hash;
                 }
             } catch (e) {
 

二进制
Playground/textures/Dot.png


二进制
Playground/textures/Fire_SpriteSheet1_8x8.png


二进制
Playground/textures/Fire_SpriteSheet2_8x8.png


二进制
Playground/textures/Fire_SpriteSheet3_8x8.png


二进制
Playground/textures/Fire_SpriteSheet_8x8.png


二进制
Playground/textures/FlameBlastSpriteSheet.png


二进制
Playground/textures/FlashParticle.png


二进制
Playground/textures/GatonaParkWalkway1_Panorama_4Kx2K.jpg


二进制
Playground/textures/Rain.png


二进制
Playground/textures/Smoke_SpriteSheet_8x8.png


二进制
Playground/textures/Spark.png


二进制
Playground/textures/Studio_Softbox_2Umbrellas_cube_specular.dds


二进制
Playground/textures/icons/Back.png


二进制
Playground/textures/icons/Crop.png


二进制
Playground/textures/icons/Delete.png


二进制
Playground/textures/icons/Dot.png


二进制
Playground/textures/icons/Download.png


二进制
Playground/textures/icons/Edit.png


二进制
Playground/textures/icons/GearIcon.png


+ 1 - 0
Playground/textures/icons/Icon_Fullscreen.svg

@@ -0,0 +1 @@
+<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 160 160"><defs><style>.cls-1{fill:#fff;}</style></defs><title>Icon_Fullscreen</title><path class="cls-1" d="M117.66,42.34v26.9h-5.38V51.54L51.54,112.28h17.7v5.38H42.34V90.76h5.38v17.7l60.74-60.74H90.76V42.34Z"/></svg>

二进制
Playground/textures/icons/Open.png


二进制
Playground/textures/icons/Pause.png


二进制
Playground/textures/icons/Play.png


二进制
Playground/textures/icons/Redo.png


二进制
Playground/textures/icons/Refresh.png


二进制
Playground/textures/icons/Save.png


二进制
Playground/textures/icons/Settings.png


二进制
Playground/textures/icons/Share.png


二进制
Playground/textures/icons/Undo.png


二进制
Playground/textures/icons/Upload.png


二进制
Playground/textures/icons/Zoom.png


二进制
Playground/textures/sparkStretched.png


二进制
Playground/textures/sparks.png


+ 17 - 3
Tools/Gulp/config.json

@@ -44,6 +44,7 @@
         "all": [
             "pbrMaterial",
             "freeCamera",
+            "flyCamera",
             "arcRotateCamera",
             "hemisphericLight",
             "pointLight",
@@ -131,6 +132,7 @@
         "minimal": [
             "meshBuilder",
             "freeCamera",
+            "flyCamera",
             "hemisphericLight"
         ],
         "360Viewer": [
@@ -145,7 +147,7 @@
             "imageProcessing",
             "backgroundMaterial",
             "pbrMaterial",
-            "hdr"        
+            "hdr"
         ]
     },
     "workloads": {
@@ -155,6 +157,7 @@
                 "../../src/babylon.types.js",
                 "../../src/Events/babylon.keyboardEvents.js",
                 "../../src/Events/babylon.pointerEvents.js",
+                "../../src/Tools/babylon.tools.js",
                 "../../src/Math/babylon.math.js",
                 "../../src/Math/babylon.math.scalar.js",
                 "../../src/babylon.mixins.js",
@@ -163,7 +166,6 @@
                 "../../src/Tools/babylon.deferred.js",
                 "../../src/Tools/babylon.observable.js",
                 "../../src/Tools/babylon.smartArray.js",
-                "../../src/Tools/babylon.tools.js",
                 "../../src/Tools/babylon.promise.js",
                 "../../src/Tools/babylon.workerPool.js",
                 "../../src/States/babylon.alphaCullingState.js",
@@ -540,6 +542,17 @@
                 "targetCamera"
             ]
         },
+        "flyCamera": {
+            "files": [
+                "../../src/Cameras/Inputs/babylon.flyCameraMouseInput.js",
+                "../../src/Cameras/Inputs/babylon.flyCameraKeyboardInput.js",
+                "../../src/Cameras/babylon.flyCameraInputsManager.js",
+                "../../src/Cameras/babylon.flyCamera.js"
+            ],
+            "dependUpon": [
+                "targetCamera"
+            ]
+        },
         "arcRotateCamera": {
             "files": [
                 "../../src/Cameras/Inputs/babylon.arcRotateCameraKeyboardMoveInput.js",
@@ -1443,7 +1456,6 @@
                 "core"
             ]
         }
-
     },
     "typescript": [
         "../../src/**/*.ts",
@@ -1999,6 +2011,7 @@
             }
         ],
         "build": {
+            "srcDirectory": "../../Viewer/src/",
             "srcOutputDirectory": "../../Viewer/",
             "distOutputDirectory": "/viewer/",
             "dtsBundle": {
@@ -2071,6 +2084,7 @@
             }
         ],
         "build": {
+            "srcDirectory": "../../Viewer/src/",
             "srcOutputDirectory": "../../Viewer/",
             "distOutputDirectory": "/viewer/",
             "dtsBundle": {

+ 149 - 89
Tools/Gulp/gulpfile.js

@@ -172,7 +172,7 @@ function includeShadersName(filename) {
 /*
  * Main necessary files stream Management.
  */
-gulp.task("includeShaders", function (cb) {
+gulp.task("includeShaders", function(cb) {
     var filesToProcess = determineFilesToProcess("shaderIncludes");
     includeShadersStream = gulp.src(filesToProcess).
         pipe(expect.real({ errorOnFailure: true }, filesToProcess)).
@@ -183,7 +183,7 @@ gulp.task("includeShaders", function (cb) {
     cb();
 });
 
-gulp.task("shaders", gulp.series("includeShaders", function (cb) {
+gulp.task("shaders", gulp.series("includeShaders", function(cb) {
     var filesToProcess = determineFilesToProcess("shaders");
     shadersStream = gulp.src(filesToProcess).
         pipe(expect.real({ errorOnFailure: true }, filesToProcess)).
@@ -194,8 +194,8 @@ gulp.task("shaders", gulp.series("includeShaders", function (cb) {
     cb();
 }));
 
-gulp.task("workers", function (cb) {
-    workersStream = config.workers.map(function (workerDef) {
+gulp.task("workers", function(cb) {
+    workersStream = config.workers.map(function(workerDef) {
         return gulp.src(workerDef.files).
             pipe(expect.real({ errorOnFailure: true }, workerDef.files)).
             pipe(uglify()).
@@ -209,7 +209,7 @@ gulp.task("workers", function (cb) {
 /**
  * Build tasks to concat minify uflify optimise the BJS js in different flavor (workers...).
  */
-gulp.task("buildWorker", gulp.series(gulp.parallel("workers", "shaders"), function () {
+gulp.task("buildWorker", gulp.series(gulp.parallel("workers", "shaders"), function() {
     var filesToProcess = determineFilesToProcess("files");
     return merge2(
         gulp.src(filesToProcess).
@@ -239,7 +239,7 @@ gulp.task("build", gulp.series("shaders", function build() {
         shadersStream,
         includeShadersStream);
     if (directFilesToProcess.length) {
-      mergedStreams.add(gulp.src(directFilesToProcess));
+        mergedStreams.add(gulp.src(directFilesToProcess));
     }
     return merge2(
         mergedStreams
@@ -269,16 +269,82 @@ gulp.task("build", gulp.series("shaders", function build() {
 }));
 
 /*
-* Compiles all typescript files and creating a js and a declaration file.
+* TsLint all typescript files from the src directory.
 */
-gulp.task("typescript-compile", function () {
-    var tsResult = gulp.src(config.typescript)
+gulp.task("typescript-tsLint", function() {
+    return gulp.src(config.typescript)
         .pipe(gulpTslint({
             formatter: "stylish",
             configuration: "../../tslint.json",
             fix: tsLintFix
         }))
-        .pipe(gulpTslint.report())
+        .pipe(gulpTslint.report());
+});
+
+/*
+* TsLint all typescript files from the src directory.
+*/
+var tsLintExternalLibrary = function(library, settings, watch) {
+    if (library.files && library.files.length) {
+        return gulp.src(library.files, { base: settings.build.srcOutputDirectory })
+            .pipe(gulpTslint({
+                formatter: "stylish",
+                configuration: "../../tslint.json",
+                fix: tsLintFix
+            }))
+            .pipe(gulpTslint.report());
+    }
+    else {
+        return gulp.src((settings.build.srcDirectory || settings.build.srcOutputDirectory) + "/**/*.ts")
+            .pipe(gulpTslint({
+                formatter: "stylish",
+                configuration: "../../tslint.json",
+                fix: tsLintFix
+            }))
+            .pipe(gulpTslint.report());
+    }
+}
+
+/**
+ * Helper methods to tsLint external library (mat, post processes, ...).
+ */
+var tsLintExternalLibraries = function(settings) {
+    var tasks = settings.libraries.map(function(library) {
+        return tsLintExternalLibrary(library, settings, false);
+    });
+
+    let mergedTasks = merge2(tasks);
+    return mergedTasks;
+}
+
+/**
+ * Dynamic module creation tsLint.
+ */
+config.modules.map(function(module) {
+    gulp.task(module + "-tsLint", function() {
+        return tsLintExternalLibraries(config[module]);
+    });
+});
+
+/**
+ * Full Librairies tsLint.
+ */
+gulp.task("typescript-libraries-tsLint",
+    gulp.series(config.modules.map((module) => {
+        return module + "-tsLint";
+    })
+    ));
+
+/**
+ * Full TsLint.
+ */
+gulp.task("tsLint", gulp.series("typescript-tsLint", "typescript-libraries-tsLint"));
+
+/*
+* Compiles all typescript files and creating a js and a declaration file.
+*/
+gulp.task("typescript-compile", function() {
+    var tsResult = gulp.src(config.typescript)
         .pipe(sourcemaps.init())
         .pipe(tsProject({
             summarizeFailureOutput: true
@@ -286,8 +352,8 @@ gulp.task("typescript-compile", function () {
 
     //If this gulp task is running on travis, file the build!
     if (process.env.TRAVIS) {
-        tsResult.once("error", function () {
-            tsResult.once("finish", function () {
+        tsResult.once("error", function() {
+            tsResult.once("finish", function() {
                 console.log("Typescript compile failed");
                 process.exit(1);
             });
@@ -314,19 +380,19 @@ gulp.task("typescript-compile", function () {
 /**
  * Helper methods to build external library (mat, post processes, ...).
  */
-var buildExternalLibraries = function (settings) {
-    var tasks = settings.libraries.map(function (library) {
+var buildExternalLibraries = function(settings) {
+    var tasks = settings.libraries.map(function(library) {
         return buildExternalLibrary(library, settings, false);
     });
 
     let mergedTasks = merge2(tasks);
 
     if (settings.build.buildAsModule) {
-        mergedTasks.on("end", function () {
+        mergedTasks.on("end", function() {
             //generate js file list
-            let files = settings.libraries.filter(function (lib) {
+            let files = settings.libraries.filter(function(lib) {
                 return !lib.doNotIncludeInBundle;
-            }).map(function (lib) {
+            }).map(function(lib) {
                 return config.build.outputDirectory + settings.build.distOutputDirectory + lib.output;
             });
 
@@ -346,7 +412,7 @@ var buildExternalLibraries = function (settings) {
                 .pipe(optimisejs())
                 .pipe(gulp.dest(outputDirectory));
 
-            let dtsFiles = files.map(function (filename) {
+            let dtsFiles = files.map(function(filename) {
                 return filename.replace(".js", ".d.ts");
             });
             let dtsModuleTask = gulp.src(dtsFiles)
@@ -366,16 +432,10 @@ var buildExternalLibraries = function (settings) {
     return mergedTasks;
 }
 
-var buildExternalLibrary = function (library, settings, watch) {
+var buildExternalLibrary = function(library, settings, watch) {
     var tsProcess;
     if (library.files && library.files.length) {
         tsProcess = gulp.src(library.files, { base: settings.build.srcOutputDirectory })
-            .pipe(gulpTslint({
-                formatter: "stylish",
-                configuration: "../../tslint.json",
-                fix: tsLintFix
-            }))
-            .pipe(gulpTslint.report())
             .pipe(sourcemaps.init())
             .pipe(typescript(externalTsConfig));
     }
@@ -544,7 +604,7 @@ var buildExternalLibrary = function (library, settings, watch) {
                     //shoud dtsBundle create the declaration?
                     if (settings.build.dtsBundle) {
                         let event = wpBuild
-                            .pipe(through.obj(function (file, enc, cb) {
+                            .pipe(through.obj(function(file, enc, cb) {
                                 // only declaration files
                                 const isdts = /\.d\.ts$/.test(file.path);
                                 if (isdts) this.push(file);
@@ -553,12 +613,12 @@ var buildExternalLibrary = function (library, settings, watch) {
                             .pipe(gulp.dest(outputDirectory));
                         // dts-bundle does NOT support (gulp) streams, so files have to be saved and reloaded, 
                         // until I fix it
-                        event.on("end", function () {
+                        event.on("end", function() {
                             // create the file
                             dtsBundle.bundle(settings.build.dtsBundle);
                             // prepend the needed reference
                             let fileLocation = path.join(path.dirname(settings.build.dtsBundle.main), settings.build.dtsBundle.out);
-                            fs.readFile(fileLocation, function (err, data) {
+                            fs.readFile(fileLocation, function(err, data) {
                                 if (err) throw err;
                                 data = (settings.build.dtsBundle.prependText || "") + '\n' + data.toString();
                                 fs.writeFileSync(fileLocation, data);
@@ -571,7 +631,7 @@ var buildExternalLibrary = function (library, settings, watch) {
                     }
 
                     let build = wpBuild
-                        .pipe(through.obj(function (file, enc, cb) {
+                        .pipe(through.obj(function(file, enc, cb) {
                             // only pipe js files
                             const isJs = /\.js$/.test(file.path);
                             if (isJs) this.push(file);
@@ -590,11 +650,11 @@ var buildExternalLibrary = function (library, settings, watch) {
                             if (dest.addBabylonDeclaration === true) {
                                 dest.addBabylonDeclaration = [config.build.declarationFilename];
                             }
-                            var decsToAdd = dest.addBabylonDeclaration.map(function (dec) {
+                            var decsToAdd = dest.addBabylonDeclaration.map(function(dec) {
                                 return config.build.outputDirectory + '/' + dec;
                             });
                             sequence.unshift(gulp.src(decsToAdd)
-                                .pipe(rename(function (path) {
+                                .pipe(rename(function(path) {
                                     path.dirname = '';
                                 }))
                                 .pipe(gulp.dest(outputDirectory)))
@@ -615,13 +675,13 @@ var buildExternalLibrary = function (library, settings, watch) {
                 let buildEvent = wpBuild
                     .pipe(gulp.dest(outputDirectory))
                     //back-compat
-                    .pipe(through.obj(function (file, enc, cb) {
+                    .pipe(through.obj(function(file, enc, cb) {
                         // only js files
                         const isjs = /\.js$/.test(file.path);
                         if (isjs) this.push(file);
                         cb();
                     }))
-                    .pipe(rename(function (path) {
+                    .pipe(rename(function(path) {
                         console.log(path.basename);
                         //path.extname === ".js"
                         path.basename = path.basename.replace(".min", "")
@@ -630,12 +690,12 @@ var buildExternalLibrary = function (library, settings, watch) {
                     buildEvent
                 );
                 if (settings.build.dtsBundle || settings.build.processDeclaration) {
-                    buildEvent.on("end", function () {
+                    buildEvent.on("end", function() {
                         if (settings.build.dtsBundle) {
                             dtsBundle.bundle(settings.build.dtsBundle);
                         } if (settings.build.processDeclaration) {
                             let fileLocation = path.join(outputDirectory, settings.build.processDeclaration.filename);
-                            fs.readFile(fileLocation, function (err, data) {
+                            fs.readFile(fileLocation, function(err, data) {
                                 if (err) throw err;
 
                                 // For Raanan,litera litteral import hack TO BETTER INTEGRATE
@@ -683,8 +743,8 @@ gulp.task("typescript", gulp.series("typescript-compile", "mainBuild"));
 /**
  * Dynamic module creation.
  */
-config.modules.map(function (module) {
-    gulp.task(module, function () {
+config.modules.map(function(module) {
+    gulp.task(module, function() {
         return buildExternalLibraries(config[module]);
     });
 });
@@ -699,7 +759,7 @@ gulp.task("build-custom", gulp.series("typescript-compile", "build"));
 /**
  * Watch ts files from typescript .
  */
-gulp.task("srcTscWatch", function () {
+gulp.task("srcTscWatch", function() {
     // Reuse The TSC CLI from gulp to enable -w.
     process.argv[2] = "-w";
     process.argv[3] = "-p";
@@ -716,9 +776,9 @@ gulp.task("watch", gulp.series("srcTscWatch", function startWatch() {
 
     var tasks = [];
 
-    config.modules.map(function (module) {
+    config.modules.map(function(module) {
 
-        config[module].libraries.map(function (library) {
+        config[module].libraries.map(function(library) {
             if (library.webpack) {
                 if (library.noWatch) return;
                 var outputDirectory = config.build.tempDirectory + config[module].build.distOutputDirectory;
@@ -730,17 +790,17 @@ gulp.task("watch", gulp.series("srcTscWatch", function startWatch() {
                 //config.stats = "minimal";
                 tasks.push(webpackStream(wpconfig, webpack).pipe(gulp.dest(outputDirectory)))
             } else {
-                tasks.push(gulp.watch(library.files, { interval: interval }, function () {
+                tasks.push(gulp.watch(library.files, { interval: interval }, function() {
                     console.log(library.output);
                     return buildExternalLibrary(library, config[module], true)
                         .pipe(debug());
                 }));
-                tasks.push(gulp.watch(library.shaderFiles, { interval: interval }, function () {
+                tasks.push(gulp.watch(library.shaderFiles, { interval: interval }, function() {
                     console.log(library.output);
                     return buildExternalLibrary(library, config[module], true)
                         .pipe(debug())
                 }));
-                tasks.push(gulp.watch(library.sassFiles, { interval: interval }, function () {
+                tasks.push(gulp.watch(library.sassFiles, { interval: interval }, function() {
                     console.log(library.output);
                     return buildExternalLibrary(library, config[module], true)
                         .pipe(debug())
@@ -754,7 +814,7 @@ gulp.task("watch", gulp.series("srcTscWatch", function startWatch() {
     return Promise.resolve();
 }));
 
-gulp.task("intellisense", function () {
+gulp.task("intellisense", function() {
     return gulp.src(config.build.intellisenseSources)
         .pipe(concat(config.build.intellisenseFile))
         .pipe(replace(/^\s+_.*?;/gm, ""))
@@ -768,7 +828,7 @@ gulp.task("intellisense", function () {
 /**
  * Embedded local dev env management.
  */
-gulp.task("deployLocalDev", function () {
+gulp.task("deployLocalDev", function() {
     return gulp.src("../../localDev/template/**.*")
         .pipe(gulp.dest("../../localDev/src/"));
 });
@@ -776,7 +836,7 @@ gulp.task("deployLocalDev", function () {
 /**
  * Embedded webserver for test convenience.
  */
-gulp.task("webserver", function () {
+gulp.task("webserver", function() {
     var options = {
         port: 1338,
         livereload: false,
@@ -798,13 +858,13 @@ gulp.task("run", gulp.series("watch", "webserver"));
 /**
  * Cleans map and js files from the src folder.
  */
-gulp.task("clean-JS-MAP", function () {
+gulp.task("clean-JS-MAP", function() {
     return del([
         "../../src/**/*.js.map", "../../src/**/*.js"
     ], { force: true });
 });
 
-gulp.task("netlify-cleanup", function () {
+gulp.task("netlify-cleanup", function() {
     //set by netlify
     if (process.env.REPOSITORY_URL) {
         return del([
@@ -818,15 +878,15 @@ gulp.task("netlify-cleanup", function () {
 })
 
 // this is needed for the modules for the declaration files.
-gulp.task("modules-compile", function () {
+gulp.task("modules-compile", function() {
     var tsResult = gulp.src(config.typescript)
         .pipe(sourcemaps.init())
         .pipe(tsProject());
 
     // If this gulp task is running on travis
     if (process.env.TRAVIS) {
-        tsResult.once("error", function () {
-            tsResult.once("finish", function () {
+        tsResult.once("error", function() {
+            tsResult.once("finish", function() {
                 console.log("Typescript compile failed");
                 process.exit(1);
             });
@@ -853,7 +913,7 @@ let declared = {}
 let perFile = {};
 let dependencyTree = {};
 
-gulp.task('prepare-for-modules', /*["modules-compile"],*/ function () {
+gulp.task('prepare-for-modules', /*["modules-compile"],*/ function() {
     let tasks = [];
     Object.keys(config.workloads).forEach((moduleName) => {
         let dtsFiles = config.workloads[moduleName].files.map(f => f.replace(".js", ".d.ts"))
@@ -875,7 +935,7 @@ gulp.task('prepare-for-modules', /*["modules-compile"],*/ function () {
     return merge2(tasks);
 });
 
-gulp.task('prepare-dependency-tree', gulp.series("prepare-for-modules", function () {
+gulp.task('prepare-dependency-tree', gulp.series("prepare-for-modules", function() {
     let tasks = [];
 
     // now calculate internal dependencies in the .ts files!
@@ -892,7 +952,7 @@ gulp.task('prepare-dependency-tree', gulp.series("prepare-for-modules", function
 
 // generate the modules directory, along with commonjs modules and es6 modules
 // Note - the generated modules are UNMINIFIED! The user will choose whether they want to minify or not.
-gulp.task("modules", gulp.series("prepare-dependency-tree", function () {
+gulp.task("modules", gulp.series("prepare-dependency-tree", function() {
     let tasks = [];
 
     Object.keys(config.workloads)
@@ -916,7 +976,7 @@ gulp.task("modules", gulp.series("prepare-dependency-tree", function () {
                     .pipe(replace(referenceSearchRegex, ""))
                     .pipe(replace(/var BABYLON;\n/g, ""))
                     .pipe(babylonModuleExports(moduleName, dependencyTree, false, perFile, shadersFiles.length, shaderIncludeFiles.length))
-                    .pipe(rename(function (path) {
+                    .pipe(rename(function(path) {
                         path.basename = path.basename.split(".").pop()
                         path.extname = ".js"
                     })),
@@ -943,7 +1003,7 @@ gulp.task("modules", gulp.series("prepare-dependency-tree", function () {
                     .pipe(replace(referenceSearchRegex, ""))
                     .pipe(replace(/var BABYLON;\n/g, ""))
                     .pipe(babylonES6ModuleExports(moduleName, dependencyTree, false, perFile, shadersFiles.length, shaderIncludeFiles.length))
-                    .pipe(rename(function (path) {
+                    .pipe(rename(function(path) {
                         path.basename = path.basename.split(".").pop()
                         path.extname = ".js"
                     })),
@@ -1020,7 +1080,7 @@ gulp.task("modules", gulp.series("prepare-dependency-tree", function () {
 /**
  * Generate the TypeDoc JSON output in order to create code metadata.
  */
-gulp.task("typedoc-generate", function () {
+gulp.task("typedoc-generate", function() {
     return gulp
         .src([
             "../../dist/preview release/babylon.d.ts",
@@ -1055,7 +1115,7 @@ gulp.task("typedoc-generate", function () {
  * Validate the TypeDoc JSON output against the current baselin to ensure our code is correctly documented.
  * (in the newly introduced areas)
  */
-gulp.task("typedoc-validate", function () {
+gulp.task("typedoc-validate", function() {
     return gulp.src(config.build.typedocJSON)
         .pipe(validateTypedoc(config.build.typedocValidationBaseline, "BABYLON", true, false));
 });
@@ -1063,7 +1123,7 @@ gulp.task("typedoc-validate", function () {
 /**
  * Generate the validation reference to ensure our code is correctly documented.
  */
-gulp.task("typedoc-generateValidationBaseline", function () {
+gulp.task("typedoc-generateValidationBaseline", function() {
     return gulp.src(config.build.typedocJSON)
         .pipe(validateTypedoc(config.build.typedocValidationBaseline, "BABYLON", true, true));
 });
@@ -1084,7 +1144,7 @@ gulp.task("typedoc-check", gulp.series("typescript-compile", "gui", "loaders", "
  * Launches the KARMA validation tests in chrome in order to debug them.
  * (Can only be launch locally.)
  */
-gulp.task("tests-validation-karma", function (done) {
+gulp.task("tests-validation-karma", function(done) {
     var kamaServerOptions = {
         configFile: __dirname + "/../../tests/validation/karma.conf.js",
         singleRun: false
@@ -1098,7 +1158,7 @@ gulp.task("tests-validation-karma", function (done) {
  * Launches the KARMA validation tests in ff or virtual screen ff on travis for a quick analysis during the build.
  * (Can only be launch on any branches.)
  */
-gulp.task("tests-validation-virtualscreen", function (done) {
+gulp.task("tests-validation-virtualscreen", function(done) {
     var kamaServerOptions = {
         configFile: __dirname + "/../../tests/validation/karma.conf.js",
         singleRun: true,
@@ -1113,7 +1173,7 @@ gulp.task("tests-validation-virtualscreen", function (done) {
  * Launches the KARMA validation tests in browser stack for remote and cross devices validation tests.
  * (Can only be launch from secure branches.)
  */
-gulp.task("tests-validation-browserstack", function (done) {
+gulp.task("tests-validation-browserstack", function(done) {
     if (!process.env.BROWSER_STACK_USERNAME) {
         done();
         return;
@@ -1131,14 +1191,14 @@ gulp.task("tests-validation-browserstack", function (done) {
 /**
  * Transpiles typescript unit tests. 
  */
-gulp.task("tests-unit-transpile", function (done) {
+gulp.task("tests-unit-transpile", function(done) {
     var tsProject = typescript.createProject('../../tests/unit/tsconfig.json');
 
     var tsResult = gulp.src("../../tests/unit/**/*.ts", { base: "../../" })
         .pipe(tsProject());
 
-    tsResult.once("error", function () {
-        tsResult.once("finish", function () {
+    tsResult.once("error", function() {
+        tsResult.once("finish", function() {
             console.log("Typescript compile failed");
             process.exit(1);
         });
@@ -1151,7 +1211,7 @@ gulp.task("tests-unit-transpile", function (done) {
  * Launches the KARMA unit tests in phantomJS.
  * (Can only be launch on any branches.)
  */
-gulp.task("tests-unit-debug", gulp.series("tests-unit-transpile", function (done) {
+gulp.task("tests-unit-debug", gulp.series("tests-unit-transpile", function(done) {
     var kamaServerOptions = {
         configFile: __dirname + "/../../tests/unit/karma.conf.js",
         singleRun: false,
@@ -1162,7 +1222,7 @@ gulp.task("tests-unit-debug", gulp.series("tests-unit-transpile", function (done
     server.start();
 }));
 
-gulp.task("tests-babylon-unit", gulp.series("tests-unit-transpile", function (done) {
+gulp.task("tests-babylon-unit", gulp.series("tests-unit-transpile", function(done) {
     var kamaServerOptions = {
         configFile: __dirname + "/../../tests/unit/karma.conf.js",
         singleRun: true
@@ -1172,7 +1232,7 @@ gulp.task("tests-babylon-unit", gulp.series("tests-unit-transpile", function (do
     server.start();
 }));
 
-var rmDir = function (dirPath) {
+var rmDir = function(dirPath) {
     try { var files = fs.readdirSync(dirPath); }
     catch (e) { return; }
     if (files.length > 0)
@@ -1189,7 +1249,7 @@ var rmDir = function (dirPath) {
 /**
  * Transpiles viewer typescript unit tests. 
  */
-gulp.task("tests-viewer-validation-transpile", function () {
+gulp.task("tests-viewer-validation-transpile", function() {
 
     let wpBuild = webpackStream(require('../../Viewer/webpack.gulp.config.js'), webpack);
 
@@ -1197,7 +1257,7 @@ gulp.task("tests-viewer-validation-transpile", function () {
     rmDir("../../Viewer/tests/build/");
 
     return wpBuild
-        .pipe(rename(function (path) {
+        .pipe(rename(function(path) {
             if (path.extname === '.js') {
                 path.basename = "test";
             }
@@ -1209,7 +1269,7 @@ gulp.task("tests-viewer-validation-transpile", function () {
  * Launches the viewer's KARMA validation tests in chrome in order to debug them.
  * (Can only be launch locally.)
  */
-gulp.task("tests-viewer-validation-karma", gulp.series("tests-viewer-validation-transpile", function (done) {
+gulp.task("tests-viewer-validation-karma", gulp.series("tests-viewer-validation-transpile", function(done) {
     var kamaServerOptions = {
         configFile: __dirname + "/../../Viewer/tests/validation/karma.conf.js",
         singleRun: false
@@ -1223,7 +1283,7 @@ gulp.task("tests-viewer-validation-karma", gulp.series("tests-viewer-validation-
  * Launches the KARMA validation tests in ff or virtual screen ff on travis for a quick analysis during the build.
  * (Can only be launch on any branches.)
  */
-gulp.task("tests-viewer-validation-virtualscreen", gulp.series("tests-viewer-validation-transpile", function (done) {
+gulp.task("tests-viewer-validation-virtualscreen", gulp.series("tests-viewer-validation-transpile", function(done) {
     var kamaServerOptions = {
         configFile: __dirname + "/../../Viewer/tests/validation/karma.conf.js",
         singleRun: true,
@@ -1238,7 +1298,7 @@ gulp.task("tests-viewer-validation-virtualscreen", gulp.series("tests-viewer-val
  * Launches the KARMA validation tests in browser stack for remote and cross devices validation tests.
  * (Can only be launch from secure branches.)
  */
-gulp.task("tests-viewer-validation-browserstack", gulp.series("tests-viewer-validation-transpile", function (done) {
+gulp.task("tests-viewer-validation-browserstack", gulp.series("tests-viewer-validation-transpile", function(done) {
     if (!process.env.BROWSER_STACK_USERNAME) {
         done();
         return;
@@ -1256,7 +1316,7 @@ gulp.task("tests-viewer-validation-browserstack", gulp.series("tests-viewer-vali
 /**
  * Transpiles viewer typescript unit tests. 
  */
-gulp.task("tests-viewer-transpile", function () {
+gulp.task("tests-viewer-transpile", function() {
 
     let wpBuild = webpackStream(require('../../Viewer/tests/unit/webpack.config.js'), webpack);
 
@@ -1264,7 +1324,7 @@ gulp.task("tests-viewer-transpile", function () {
     rmDir("../../Viewer/tests/build/");
 
     return wpBuild
-        .pipe(rename(function (path) {
+        .pipe(rename(function(path) {
             if (path.extname === '.js') {
                 path.basename = "test";
             }
@@ -1276,7 +1336,7 @@ gulp.task("tests-viewer-transpile", function () {
  * Launches the KARMA unit tests in chrome.
  * (Can be launch on any branches.)
  */
-gulp.task("tests-viewer-unit-debug", gulp.series("tests-viewer-transpile", function (done) {
+gulp.task("tests-viewer-unit-debug", gulp.series("tests-viewer-transpile", function(done) {
     var kamaServerOptions = {
         configFile: __dirname + "/../../Viewer/tests/karma.conf.js",
         singleRun: false,
@@ -1291,7 +1351,7 @@ gulp.task("tests-viewer-unit-debug", gulp.series("tests-viewer-transpile", funct
  * Launches the KARMA unit tests in phantomJS.
  * (Can be launch on any branches.)
  */
-gulp.task("tests-viewer-unit", gulp.series("tests-viewer-transpile", function (done) {
+gulp.task("tests-viewer-unit", gulp.series("tests-viewer-transpile", function(done) {
     var kamaServerOptions = {
         configFile: __dirname + "/../../Viewer/tests/karma.conf.js",
         singleRun: true
@@ -1307,7 +1367,7 @@ gulp.task("tests-viewer-unit", gulp.series("tests-viewer-transpile", function (d
  */
 gulp.task("tests-unit", gulp.series("tests-babylon-unit", "tests-viewer-unit"));
 
-gulp.task("tests-modules", function () {
+gulp.task("tests-modules", function() {
     let testsToRun = require('../../tests/modules/tests.json');
 
     let sequencePromise = Promise.resolve();
@@ -1320,9 +1380,9 @@ gulp.task("tests-modules", function () {
             let compilePromise = Promise.resolve();
 
             if (test.dependencies) {
-                compilePromise = new Promise(function (resolve, reject) {
+                compilePromise = new Promise(function(resolve, reject) {
                     let counter = 0;
-                    let copyTask = gulp.src(test.dependencies.map(dep => config.build.outputDirectory + '/' + dep)).pipe(rename(function (path) {
+                    let copyTask = gulp.src(test.dependencies.map(dep => config.build.outputDirectory + '/' + dep)).pipe(rename(function(path) {
                         path.basename = (counter++) + '';
                     })).pipe(gulp.dest("../../tests/modules/build/dependencies/"))
                     copyTask.once("finish", resolve);
@@ -1333,20 +1393,20 @@ gulp.task("tests-modules", function () {
                 //typescript only
                 if (test.typescript && !test.bundler) {
                     compilePromise = compilePromise.then(() => {
-                        return new Promise(function (resolve, reject) {
+                        return new Promise(function(resolve, reject) {
                             var tsProject = typescript.createProject(basePath + (test.tsconfig || 'tsconfig.json'));
 
                             var tsResult = gulp.src(basePath + '/src/**/*.ts', { base: basePath })
                                 .pipe(tsProject());
 
                             let error = false;
-                            tsResult.once("error", function () {
+                            tsResult.once("error", function() {
                                 error = true;
                             });
 
                             let jsPipe = tsResult.js.pipe(gulp.dest("../../tests/modules/"));
 
-                            jsPipe.once("finish", function () {
+                            jsPipe.once("finish", function() {
                                 if (error)
                                     reject('error compiling test');
                                 else
@@ -1358,11 +1418,11 @@ gulp.task("tests-modules", function () {
                     if (test.bundler === 'webpack') {
                         console.log("webpack");
                         compilePromise = compilePromise.then(() => {
-                            return new Promise(function (resolve, reject) {
+                            return new Promise(function(resolve, reject) {
                                 let wpBuild = webpackStream(require(basePath + '/webpack.config.js'), webpack);
 
                                 wpBuild = wpBuild
-                                    .pipe(rename(function (path) {
+                                    .pipe(rename(function(path) {
                                         if (path.extname === '.js') {
                                             path.basename = "tests-loader";
                                         }
@@ -1377,7 +1437,7 @@ gulp.task("tests-modules", function () {
             }
 
             return compilePromise.then(() => {
-                return new Promise(function (resolve, reject) {
+                return new Promise(function(resolve, reject) {
                     var kamaServerOptions = {
                         configFile: __dirname + "/../../tests/modules/karma.conf.js",
                         singleRun: true
@@ -1393,7 +1453,7 @@ gulp.task("tests-modules", function () {
     return sequencePromise;
 });
 
-gulp.task("tests-whatsnew", function (done) {
+gulp.task("tests-whatsnew", function(done) {
     // Only checks on Travis
     if (!process.env.TRAVIS) {
         done();
@@ -1422,7 +1482,7 @@ gulp.task("tests-whatsnew", function (done) {
             oldData += data;
         });
         res.on("end", () => {
-            fs.readFile("../../dist/preview release/what's new.md", "utf-8", function (err, newData) {
+            fs.readFile("../../dist/preview release/what's new.md", "utf-8", function(err, newData) {
                 if (err || oldData != newData) {
                     done();
                     return;
@@ -1443,4 +1503,4 @@ gulp.task("typescript-all", gulp.series("typescript", "typescript-libraries", "n
 /**
  * The default task, concat and min the main BJS files.
  */
-gulp.task("default", gulp.series("typescript-all", "intellisense", "typedoc-all", "tests-unit", "tests-modules", "tests-validation-virtualscreen", "tests-validation-browserstack"));
+gulp.task("default", gulp.series("tsLint", "typescript-all", "intellisense", "typedoc-all", "tests-unit", "tests-modules", "tests-validation-virtualscreen", "tests-validation-browserstack"));

+ 6 - 6
Tools/Gulp/package.json

@@ -1,6 +1,6 @@
 {
-    "name": "BabylonJS",
-    "version": "3.1.1",
+    "name": "babylonjs",
+    "version": "3.3.0",
     "description": "Babylon.js is a 3D engine based on webgl and javascript",
     "main": "",
     "repository": {
@@ -23,6 +23,7 @@
         "gulp-rename": "^1.4.0",
         "gulp-replace": "~1.0.0",
         "gulp-sourcemaps": "~2.6.4",
+        "gulp-tslint": "^8.1.3",
         "gulp-typedoc": "^2.2.0",
         "gulp-typescript": "4.0.2",
         "gulp-uglify": "^3.0.1",
@@ -42,12 +43,11 @@
         "sinon": "^6.1.4",
         "through2": "~2.0.3",
         "ts-loader": "^4.4.2",
+        "tslint": "^5.11.0",
         "typedoc": "^0.12.0",
-        "typescript": "^3.0.1",
+        "typescript": "~3.0.1",
         "webpack": "^4.16.3",
-        "webpack-stream": "5.0.0",
-        "tslint": "^5.11.0",
-        "gulp-tslint": "^8.1.3"
+        "webpack-stream": "5.0.0"
     },
     "scripts": {
         "install": "cd ../../gui && npm install && cd ../Tools/Gulp/ &&  cd ../../inspector && npm install && cd ../Tools/Gulp/ && npm --prefix ../../Playground/ install ../../Playground/ && npm --prefix ../../tests/unit/ install ../../tests/unit/ && npm --prefix ../../Viewer/tests/ install ../../Viewer/tests/ && cd ../../Viewer && npm install && cd ../Tools/Gulp/ && gulp deployLocalDev"

+ 3 - 3
Tools/Publisher/index.js

@@ -6,7 +6,7 @@ let path = require('path');
 let basePath = '../../dist/preview release';
 
 // This can be changed when we have a new major release.
-let minimumDependency = '>=3.2.0-alpha';
+let minimumDependency = '>=3.3.0-rc.4';
 
 process.env.PATH += (path.delimiter + path.join(__dirname, 'node_modules', '.bin'));
 
@@ -122,7 +122,7 @@ let loginCheck = shelljs.exec('npm whoami');
 if (loginCheck.code === 0) {
     prompt.start();
 
-    prompt.get(['version'], function (err, result) {
+    prompt.get(['version'], function(err, result) {
         let version = result.version;
         updateEngineVersion(version);
         if (process.argv.indexOf('--no-build') === -1) {
@@ -258,7 +258,7 @@ function publish(version, packageName, basePath) {
 
     let tagDef = "";
     // check for alpha or beta
-    if (version.indexOf('alpha') !== -1 || version.indexOf('beta') !== -1) {
+    if (version.indexOf('alpha') !== -1 || version.indexOf('beta') !== -1 || version.indexOf('-rc.') !== -1) {
         tagDef = '--tag preview';
     }
 

+ 2 - 2
Tools/Publisher/package.json

@@ -12,9 +12,9 @@
         "fs-extra": "^5.0.0",
         "prompt": "^1.0.0",
         "shelljs": "^0.7.8",
-        "typescript": "^3.0.1"
+        "typescript": "~3.0.1"
     },
     "devDependencies": {
         "gulp": "^4.0.0"
     }
-}
+}

+ 1 - 1
Viewer/package.json

@@ -33,7 +33,7 @@
         "html-loader": "^0.5.5",
         "json-loader": "^0.5.7",
         "ts-loader": "^4.4.0",
-        "typescript": "^3.0.1",
+        "typescript": "~3.0.1",
         "uglifyjs-webpack-plugin": "^1.2.2",
         "webpack": "^4.16.0",
         "webpack-cli": "^3.0.8",

+ 9 - 9
Viewer/src/configuration/configuration.ts

@@ -5,14 +5,14 @@ import { IEnvironmentMapConfiguration } from './interfaces/environmentMapConfigu
 export function getConfigurationKey(key: string, configObject: any) {
     let splits = key.split('.');
 
-    if (splits.length === 0 || !configObject) return;
+    if (splits.length === 0 || !configObject) { return; }
     else if (splits.length === 1) {
         if (configObject[key] !== undefined) {
             return configObject[key];
         }
     } else {
         let firstKey = splits.shift();
-        return getConfigurationKey(splits.join("."), configObject[firstKey!])
+        return getConfigurationKey(splits.join("."), configObject[firstKey!]);
     }
 }
 
@@ -40,14 +40,14 @@ export interface ViewerConfiguration {
     scene?: ISceneConfiguration;
     optimizer?: ISceneOptimizerConfiguration | boolean;
     // at the moment, support only a single camera.
-    camera?: ICameraConfiguration,
+    camera?: ICameraConfiguration;
     skybox?: boolean | ISkyboxConfiguration;
 
     ground?: boolean | IGroundConfiguration;
     lights?: {
         //globalRotation: number,
         [name: string]: number | boolean | ILightConfiguration
-    },
+    };
     // engine configuration. optional!
     engine?: {
         renderInBackground?: boolean;
@@ -56,7 +56,7 @@ export interface ViewerConfiguration {
         engineOptions?: EngineOptions;
         adaptiveQuality?: boolean;
         hdEnabled?: boolean;
-    },
+    };
     //templateStructure?: ITemplateStructure,
     templates?: {
         main: ITemplateConfiguration,
@@ -70,7 +70,7 @@ export interface ViewerConfiguration {
         includes?: {
             [key: string]: string;
         }
-    }
+    };
 
     loaderPlugins?: {
         extendedMaterial?: boolean;
@@ -81,12 +81,12 @@ export interface ViewerConfiguration {
         [propName: string]: boolean | undefined;
     };
 
-    environmentMap?: IEnvironmentMapConfiguration
+    environmentMap?: IEnvironmentMapConfiguration;
 
     vr?: IVRConfiguration;
 
     // features that are being tested.
-    // those features' syntax will change and move out! 
+    // those features' syntax will change and move out!
     // Don't use in production (or be ready to make the changes :) )
     lab?: {
         flashlight?: boolean | {
@@ -119,5 +119,5 @@ export interface ViewerConfiguration {
         }
         defaultRenderingPipelines?: boolean | IDefaultRenderingPipelineConfiguration;
         globalLightRotation?: number;
-    }
+    };
 }

+ 6 - 6
Viewer/src/configuration/configurationCompatibility.ts

@@ -1,8 +1,8 @@
-import { ViewerConfiguration, getConfigurationKey } from './configuration'
+import { ViewerConfiguration, getConfigurationKey } from './configuration';
 /**
  * This function will make sure the configuration file is taking deprecated fields into account
  * and is setting them to the correct keys and values.
- * 
+ *
  * @param configuration The configuration to process. Mutable!
  */
 export function processConfigurationCompatibility(configuration: ViewerConfiguration) {
@@ -53,14 +53,14 @@ export function processConfigurationCompatibility(configuration: ViewerConfigura
 
 function setKeyInObject(object: any, keys: string, value: any, shouldOverwrite?: boolean) {
     let keySplit = keys.split(".");
-    if (keySplit.length === 0) return;
+    if (keySplit.length === 0) { return; }
     let lastKey = keySplit.pop();
-    if (!lastKey) return;
+    if (!lastKey) { return; }
     let curObj = object;
-    keySplit.forEach(key => {
+    keySplit.forEach((key) => {
         curObj[key] = curObj[key] || {};
         curObj = curObj[key];
     });
-    if (curObj[lastKey] !== undefined && !shouldOverwrite) return;
+    if (curObj[lastKey] !== undefined && !shouldOverwrite) { return; }
     curObj[lastKey] = value;
 }

+ 4 - 4
Viewer/src/configuration/interfaces/modelConfiguration.ts

@@ -27,7 +27,7 @@ export interface IModelConfiguration {
         autoStart?: boolean | string;
         playOnce?: boolean;
         autoStartIndex?: number;
-    }
+    };
 
     entryAnimation?: IModelAnimationConfiguration;
     exitAnimation?: IModelAnimationConfiguration;
@@ -38,9 +38,9 @@ export interface IModelConfiguration {
         emissiveIntensity?: number;
         environmentIntensity?: number;
         [propName: string]: any;
-    }
+    };
 
-    /** 
+    /**
      * Rotation offset axis definition
      */
     rotationOffsetAxis?: {
@@ -57,7 +57,7 @@ export interface IModelConfiguration {
     loaderConfiguration?: {
         maxLODsToLoad?: number;
         progressiveLoading?: boolean;
-    }
+    };
 
     // [propName: string]: any; // further configuration, like title and creator
 }

+ 1 - 1
Viewer/src/configuration/interfaces/sceneOptimizerConfiguration.ts

@@ -13,7 +13,7 @@ export interface ISceneOptimizerConfiguration {
         particles?: ISceneOptimizerParameters;
         renderTarget?: ISceneOptimizerParameters;
         mergeMeshes?: ISceneOptimizerParameters;
-    }
+    };
     custom?: string;
 }
 

+ 2 - 3
Viewer/src/configuration/interfaces/templateConfiguration.ts

@@ -21,7 +21,7 @@ export interface ITemplateConfiguration {
      * Events to attach to this template.
      * event name is the key. the value can either be a boolean (attach to the parent element)
      * or a map of html id elements.
-     * 
+     *
      * See - http://doc.babylonjs.com/extensions/the_templating_system#event-binding
      */
     events?: {
@@ -40,7 +40,6 @@ export interface ITemplateConfiguration {
         dragstart?: boolean | { [id: string]: boolean; };
         drop?: boolean | { [id: string]: boolean; };
 
-
         [key: string]: boolean | { [id: string]: boolean; } | undefined;
-    }
+    };
 }

+ 1 - 1
Viewer/src/configuration/interfaces/vrConfiguration.ts

@@ -9,5 +9,5 @@ export interface IVRConfiguration {
     vrOptions?: VRExperienceHelperOptions;
     modelHeightCorrection?: number | boolean;
     rotateUsingControllers?: boolean; // experimental feature
-    cameraPosition?: { x: number, y: number, z: number }
+    cameraPosition?: { x: number, y: number, z: number };
 }

+ 12 - 10
Viewer/src/configuration/loader.ts

@@ -25,7 +25,7 @@ export class ConfigurationLoader {
     /**
      * load a configuration object that is defined in the initial configuration provided.
      * The viewer configuration can extend different types of configuration objects and have an extra configuration defined.
-     * 
+     *
      * @param initConfig the initial configuration that has the definitions of further configuration to load.
      * @param callback an optional callback that will be called sync, if noconfiguration needs to be loaded or configuration is payload-only
      * @returns A promise that delivers the extended viewer configuration, when done.
@@ -74,13 +74,13 @@ export class ConfigurationLoader {
                 let parsed = deepmerge(mapper.map(data), loadedConfig);
                 let merged = deepmerge(extendedConfiguration, parsed);
                 processConfigurationCompatibility(merged);
-                if (callback) callback(merged);
+                if (callback) { callback(merged); }
                 return merged;
             });
         } else {
             loadedConfig = deepmerge(extendedConfiguration, loadedConfig);
             processConfigurationCompatibility(loadedConfig);
-            if (callback) callback(loadedConfig);
+            if (callback) { callback(loadedConfig); }
             return Promise.resolve(loadedConfig);
         }
     }
@@ -89,7 +89,7 @@ export class ConfigurationLoader {
      * Dispose the configuration loader. This will cancel file requests, if active.
      */
     public dispose() {
-        this._loadRequests.forEach(request => {
+        this._loadRequests.forEach((request) => {
             request.abort();
         });
         this._loadRequests.length = 0;
@@ -104,7 +104,7 @@ export class ConfigurationLoader {
             if (typeof config.model === "string") {
                 config.model = {
                     url: config.model
-                }
+                };
             }
         }
     }
@@ -118,14 +118,16 @@ export class ConfigurationLoader {
         return new Promise((resolve, reject) => {
             let fileRequest = Tools.LoadFile(url, (result) => {
                 let idx = this._loadRequests.indexOf(fileRequest);
-                if (idx !== -1)
-                    this._loadRequests.splice(idx, 1);
-                if (this._enableCache) cacheReference[url] = result;
+                if (idx !== -1) {
+                    this._loadRequests.splice(idx, 1);
+                }
+                if (this._enableCache) { cacheReference[url] = result; }
                 resolve(result);
             }, undefined, undefined, false, (request, error: any) => {
                 let idx = this._loadRequests.indexOf(fileRequest);
-                if (idx !== -1)
-                    this._loadRequests.splice(idx, 1);
+                if (idx !== -1) {
+                    this._loadRequests.splice(idx, 1);
+                }
                 reject(error);
             });
             this._loadRequests.push(fileRequest);

+ 12 - 13
Viewer/src/configuration/mappers.ts

@@ -11,12 +11,12 @@ export interface IMapper {
 }
 
 /**
- * This is a simple HTML mapper. 
+ * This is a simple HTML mapper.
  * This mapper parses a single HTML element and returns the configuration from its attributes.
  * it parses numbers and boolean values to the corresponding variable types.
- * The following HTML element: 
+ * The following HTML element:
  *  <div test="1" random-flag="true" a.string.object="test"> will result in the following configuration:
- * 
+ *
  *  {
  *      test: 1, //a number!
  *      randomFlag: boolean, //camelCase and boolean
@@ -31,7 +31,7 @@ class HTMLMapper implements IMapper {
 
     /**
      * Map a specific element and get configuration from it
-     * @param element the HTML element to analyze. 
+     * @param element the HTML element to analyze.
      */
     map(element: HTMLElement): ViewerConfiguration {
 
@@ -57,7 +57,7 @@ class HTMLMapper implements IMapper {
                     } else if (val === "null") {
                         val = null;
                     } else {
-                        var isnum = !isNaN(parseFloat(val)) && isFinite(val);///^\d+$/.test(val);
+                        var isnum = !isNaN(parseFloat(val)) && isFinite(val); ///^\d+$/.test(val);
                         if (isnum) {
                             let number = parseFloat(val);
                             if (!isNaN(number)) {
@@ -102,7 +102,7 @@ class DOMMapper implements IMapper {
         let htmlMapper = new HTMLMapper();
         let config = htmlMapper.map(baseElement);
 
-        let traverseChildren = function (element: HTMLElement, partConfig) {
+        let traverseChildren = function(element: HTMLElement, partConfig) {
             let children = element.children;
             if (children.length) {
                 for (let i = 0; i < children.length; ++i) {
@@ -114,12 +114,12 @@ class DOMMapper implements IMapper {
                         partConfig[key] = [];
                     } else {
                         if (element.attributes.getNamedItem('array') && element.attributes.getNamedItem('array')!.nodeValue === 'true') {
-                            partConfig.push(configMapped)
+                            partConfig.push(configMapped);
                         } else if (partConfig[key]) {
                             //exists already! probably an array
                             element.setAttribute('array', 'true');
                             let oldItem = partConfig[key];
-                            partConfig = [oldItem, configMapped]
+                            partConfig = [oldItem, configMapped];
                         } else {
                             partConfig[key] = configMapped;
                         }
@@ -128,11 +128,10 @@ class DOMMapper implements IMapper {
                 }
             }
             return partConfig;
-        }
+        };
 
         traverseChildren(baseElement, config);
 
-
         return config;
     }
 
@@ -155,12 +154,12 @@ export class MapperManager {
             "html": new HTMLMapper(),
             "json": new JSONMapper(),
             "dom": new DOMMapper()
-        }
+        };
     }
 
     /**
      * Get a specific configuration mapper.
-     * 
+     *
      * @param type the name of the mapper to load
      */
     public getMapper(type: string) {
@@ -174,7 +173,7 @@ export class MapperManager {
      * Use this functio to register your own configuration mapper.
      * After a mapper is registered, it can be used to parse the specific type fo configuration to the standard ViewerConfiguration.
      * @param type the name of the mapper. This will be used to define the configuration type and/or to get the mapper
-     * @param mapper The implemented mapper 
+     * @param mapper The implemented mapper
      */
     public registerMapper(type: string, mapper: IMapper) {
         this._mappers[type] = mapper;

+ 1 - 1
Viewer/src/configuration/types/default.ts

@@ -119,4 +119,4 @@ export let defaultConfiguration: ViewerConfiguration = {
     },
     scene: {
     }
-}
+};

+ 1 - 1
Viewer/src/configuration/types/environmentMap.ts

@@ -12,4 +12,4 @@ export const environmentMapConfiguration: ViewerConfiguration = {
             tintLevel: 0.4
         }
     }
-}
+};

+ 1 - 1
Viewer/src/configuration/types/extended.ts

@@ -315,4 +315,4 @@ export let extendedConfiguration: ViewerConfiguration = {
             bloomWeight: 0.05
         }
     }
-}
+};

+ 7 - 7
Viewer/src/configuration/types/index.ts

@@ -9,15 +9,15 @@ import { deepmerge } from '../../helper/';
 /**
  * Get the configuration type you need to use as the base for your viewer.
  * The types can either be a single string, or comma separated types that will extend each other. for example:
- * 
+ *
  * "default, environmentMap" will first load the default configuration and will extend it using the environmentMap configuration.
- * 
- * @param types a comma-separated string of the type(s) or configuration to load. 
+ *
+ * @param types a comma-separated string of the type(s) or configuration to load.
  */
-let getConfigurationType = function (types: string): ViewerConfiguration {
+let getConfigurationType = function(types: string): ViewerConfiguration {
     let config: ViewerConfiguration = {};
     let typesSeparated = types.split(",");
-    typesSeparated.forEach(type => {
+    typesSeparated.forEach((type) => {
         switch (type.trim()) {
             case 'environmentMap':
                 config = deepmerge(config, environmentMapConfiguration);
@@ -48,6 +48,6 @@ let getConfigurationType = function (types: string): ViewerConfiguration {
     });
     return config;
 
-}
+};
 
-export { getConfigurationType, defaultConfiguration, minimalConfiguration }
+export { getConfigurationType, defaultConfiguration, minimalConfiguration };

+ 1 - 1
Viewer/src/configuration/types/minimal.ts

@@ -43,4 +43,4 @@ export let minimalConfiguration: ViewerConfiguration = {
     engine: {
         antialiasing: true
     }
-}
+};

+ 2 - 2
Viewer/src/configuration/types/shadowLight.ts

@@ -31,7 +31,7 @@ export const shadowDirectionalLightConfiguration: ViewerConfiguration = {
             }
         }
     }
-}
+};
 
 /**
  * Defines a default shadow-enabled spot light for normalized objects.
@@ -63,4 +63,4 @@ export const shadowSpotlLightConfiguration: ViewerConfiguration = {
             }
         }
     }
-}
+};

+ 5 - 5
Viewer/src/helper/index.ts

@@ -5,7 +5,7 @@ export { expDm as deepmerge };
 
 /**
  * Is the provided string a URL?
- * 
+ *
  * @param urlToCheck the url to inspect
  */
 export function isUrl(urlToCheck: string): boolean {
@@ -20,7 +20,7 @@ export function isUrl(urlToCheck: string): boolean {
  * @param s string to convert
  */
 export function kebabToCamel(s) {
-    return s.replace(/(\-\w)/g, function (m) { return m[1].toUpperCase(); });
+    return s.replace(/(\-\w)/g, function(m) { return m[1].toUpperCase(); });
 }
 
 //https://gist.github.com/youssman/745578062609e8acac9f
@@ -29,7 +29,7 @@ export function kebabToCamel(s) {
  * @param str string to convert
  */
 export function camelToKebab(str) {
-    return !str ? null : str.replace(/([A-Z])/g, function (g) { return '-' + g[0].toLowerCase() });
+    return !str ? null : str.replace(/([A-Z])/g, function(g) { return '-' + g[0].toLowerCase(); });
 }
 
 /**
@@ -40,8 +40,8 @@ export function camelToKebab(str) {
  * @param config the configuration object that will extend the object
  */
 export function extendClassWithConfig(object: any, config: any) {
-    if (!config || typeof config !== 'object') return;
-    Object.keys(config).forEach(function (key) {
+    if (!config || typeof config !== 'object') { return; }
+    Object.keys(config).forEach(function(key) {
         if (key in object && typeof object[key] !== 'function') {
             // if (typeof object[key] === 'function') return;
             // if it is an object, iterate internally until reaching basic types

+ 1 - 1
Viewer/src/index.ts

@@ -13,7 +13,7 @@ import { registerCustomOptimizer } from './optimizer/custom';
 
 /**
  * BabylonJS Viewer
- * 
+ *
  * An HTML-Based viewer for 3D models, based on BabylonJS and its extensions.
  */
 

+ 3 - 4
Viewer/src/initializer.ts

@@ -2,7 +2,6 @@ import { DefaultViewer } from './viewer/defaultViewer';
 import { mapperManager } from './configuration/mappers';
 import { viewerGlobals } from './configuration/globals';
 
-
 /**
  * Will attach an init function the the DOMContentLoaded event.
  * The init function will be removed automatically after the event was triggered.
@@ -11,20 +10,20 @@ export function initListeners() {
     document.addEventListener("DOMContentLoaded", init);
     function init(event) {
         document.removeEventListener("DOMContentLoaded", init);
-        if (viewerGlobals.disableInit) return;
+        if (viewerGlobals.disableInit) { return; }
         InitTags();
     }
 }
 
 /**
  * Select all HTML tags on the page that match the selector and initialize a viewer
- * 
+ *
  * @param selector the selector to initialize the viewer on (default is 'babylon')
  */
 export function InitTags(selector: string = 'babylon') {
     let elements = document.querySelectorAll(selector);
     for (let i = 0; i < elements.length; ++i) {
-        let element: HTMLElement = <HTMLElement>elements.item(i);
+        let element = elements.item(i);
 
         // get the html configuration
         let configMapper = mapperManager.getMapper('dom');

+ 1 - 2
Viewer/src/labs/environmentSerializer.ts

@@ -37,7 +37,6 @@ export interface PBREnvironment {
     textureIntensityScale: number;
 }
 
-
 /**
 		 * Environment map representations: layouts, projections and approximations
 		 */
@@ -238,7 +237,7 @@ export class EnvironmentDeserializer {
     /**
      * Convert from irradiance to outgoing radiance for Lambertian BDRF, suitable for efficient shader evaluation.
      *	  L = (1/pi) * E * rho
-     * 
+     *
      * This is done by an additional scale by 1/pi, so is a fairly trivial operation but important conceptually.
      * @param harmonics Spherical harmonic coefficients (9)
      */

+ 10 - 10
Viewer/src/labs/texture.ts

@@ -184,7 +184,7 @@ export class TextureUtils {
      * @return Babylon cube texture
      */
     public static GetBabylonCubeTexture(scene: Scene, textureCube: TextureCube, automaticMipmaps: boolean, environment = false, singleLod = false): CubeTexture {
-        if (!textureCube) throw new Error("no texture cube provided");
+        if (!textureCube) { throw new Error("no texture cube provided"); }
 
         var parameters: SamplingParameters;
         if (environment) {
@@ -227,12 +227,12 @@ export class TextureUtils {
             let maxMipLevel = automaticMipmaps ? 0 : textureCube.source.length - 1;
             let texturesUploaded = 0;
 
-            var textureComplete = function () {
+            var textureComplete = function() {
                 return texturesUploaded === ((maxMipLevel + 1) * 6);
             };
 
-            var uploadFace = function (i: number, level: number, face: TextureSource) {
-                if (!glTexture) return;
+            var uploadFace = function(i: number, level: number, face: TextureSource) {
+                if (!glTexture) { return; }
 
                 if (i === 0 && level === 0) {
                     internalTexture.width = face.width;
@@ -340,20 +340,20 @@ export class TextureUtils {
      */
     public static ApplySamplingParameters(babylonTexture: BaseTexture, parameters: SamplingParameters) {
         let scene = babylonTexture.getScene();
-        if (!scene) return;
+        if (!scene) { return; }
         let gl = (<any>(scene.getEngine()))._gl;
 
         let target = babylonTexture.isCube ? gl.TEXTURE_CUBE_MAP : gl.TEXTURE_2D;
 
         let internalTexture = babylonTexture._texture;
-        if (!internalTexture) return;
+        if (!internalTexture) { return; }
         let glTexture = internalTexture._webGLTexture;
         gl.bindTexture(target, glTexture);
 
-        if (parameters.magFilter != null) gl.texParameteri(target, gl.TEXTURE_MAG_FILTER, parameters.magFilter);
-        if (parameters.minFilter != null) gl.texParameteri(target, gl.TEXTURE_MIN_FILTER, parameters.minFilter);
-        if (parameters.wrapS != null) gl.texParameteri(target, gl.TEXTURE_WRAP_S, parameters.wrapS);
-        if (parameters.wrapT != null) gl.texParameteri(target, gl.TEXTURE_WRAP_T, parameters.wrapT);
+        if (parameters.magFilter != null) { gl.texParameteri(target, gl.TEXTURE_MAG_FILTER, parameters.magFilter); }
+        if (parameters.minFilter != null) { gl.texParameteri(target, gl.TEXTURE_MIN_FILTER, parameters.minFilter); }
+        if (parameters.wrapS != null) { gl.texParameteri(target, gl.TEXTURE_WRAP_S, parameters.wrapS); }
+        if (parameters.wrapT != null) { gl.texParameteri(target, gl.TEXTURE_WRAP_T, parameters.wrapT); }
 
         //set babylon wrap modes from sampling parameter
         switch (parameters.wrapS) {

+ 5 - 5
Viewer/src/labs/viewerLabs.ts

@@ -58,16 +58,16 @@ export class ViewerLabs {
         //@! todo: should loadEnvironment cancel any currently loading environments?
         if (data instanceof ArrayBuffer) {
             this.environment = EnvironmentDeserializer.Parse(data);
-            if (onSuccess) onSuccess(this.environment);
+            if (onSuccess) { onSuccess(this.environment); }
         } else if (typeof data === 'string') {
             let url = this.getAssetUrl(data);
             this._scene._loadFile(
                 url,
                 (arrayBuffer: ArrayBuffer) => {
                     this.environment = EnvironmentDeserializer.Parse(arrayBuffer);
-                    if (onSuccess) onSuccess(this.environment);
+                    if (onSuccess) { onSuccess(this.environment); }
                 },
-                (progressEvent) => { if (onProgress) onProgress(progressEvent.loaded, progressEvent.total); },
+                (progressEvent) => { if (onProgress) { onProgress(progressEvent.loaded, progressEvent.total); } },
                 false,
                 true,
                 (r, e) => {
@@ -79,7 +79,7 @@ export class ViewerLabs {
         } else {
             //data assumed to be PBREnvironment object
             this.environment = data;
-            if (onSuccess) onSuccess(data);
+            if (onSuccess) { onSuccess(data); }
         }
     }
 
@@ -88,7 +88,7 @@ export class ViewerLabs {
      * @param environmentMapConfiguration Environment map configuration to apply
      */
     public applyEnvironmentMapConfiguration(rotationY?: number) {
-        if (!this.environment) return;
+        if (!this.environment) { return; }
 
         //set orientation
         let rotatquatRotationionY = Quaternion.RotationAxis(Axis.Y, rotationY || 0);

+ 8 - 9
Viewer/src/loader/modelLoader.ts

@@ -10,7 +10,7 @@ import { getLoaderPluginByName, ILoaderPlugin } from './plugins/';
 /**
  * An instance of the class is in charge of loading the model correctly.
  * This class will continously be expended with tasks required from the specific loaders Babylon has.
- * 
+ *
  * A Model loader is unique per (Abstract)Viewer. It is being generated by the viewer
  */
 export class ModelLoader {
@@ -40,7 +40,7 @@ export class ModelLoader {
 
     /**
      * Adds a new plugin to the loader process.
-     * 
+     *
      * @param plugin the plugin name or the plugin itself
      */
     public addPlugin(plugin: ILoaderPlugin | string) {
@@ -84,13 +84,12 @@ export class ModelLoader {
             return model;
         }
 
-
         let plugin = modelConfiguration.loader;
 
         let scene = model.rootMesh.getScene();
 
         model.loader = SceneLoader.ImportMesh(undefined, this._baseUrl, filename, scene, (meshes, particleSystems, skeletons, animationGroups) => {
-            meshes.forEach(mesh => {
+            meshes.forEach((mesh) => {
                 Tags.AddTagsTo(mesh, "viewerMesh");
                 model.addMesh(mesh);
             });
@@ -133,7 +132,7 @@ export class ModelLoader {
                 && this._configurationContainer.configuration.ground.mirror) {
                 gltfLoader.useClipPlane = true;
             }
-            Object.keys(gltfLoader).filter(name => name.indexOf('on') === 0 && name.indexOf('Observable') !== -1).forEach(functionName => {
+            Object.keys(gltfLoader).filter((name) => name.indexOf('on') === 0 && name.indexOf('Observable') !== -1).forEach((functionName) => {
                 gltfLoader[functionName].add((payload) => {
                     this._checkAndRun(functionName.replace("Observable", ''), payload);
                 });
@@ -176,7 +175,7 @@ export class ModelLoader {
      * If loaders are registered and are in the middle of loading, they will be disposed and the request(s) will be cancelled.
      */
     public dispose() {
-        this._loaders.forEach(loader => {
+        this._loaders.forEach((loader) => {
             if (loader.name === "gltf") {
                 (<GLTFFileLoader>loader).dispose();
             }
@@ -186,11 +185,11 @@ export class ModelLoader {
     }
 
     private _checkAndRun(functionName: string, ...payload: Array<any>) {
-        if (this._disposed) return;
-        this._plugins.filter(p => p[functionName]).forEach(plugin => {
+        if (this._disposed) { return; }
+        this._plugins.filter((p) => p[functionName]).forEach((plugin) => {
             try {
                 plugin[functionName].apply(this, payload);
             } catch (e) { }
-        })
+        });
     }
 }

+ 2 - 2
Viewer/src/loader/plugins/index.ts

@@ -12,7 +12,7 @@ export { TelemetryLoaderPlugin, ILoaderPlugin, MSFTLodLoaderPlugin, ApplyMateria
 /**
  * Get a loader plugin according to its name.
  * The plugin will be cached and will be reused if called for again.
- * 
+ *
  * @param name the name of the plugin
  */
 export function getLoaderPluginByName(name: string) {
@@ -37,7 +37,7 @@ export function getLoaderPluginByName(name: string) {
 }
 
 /**
- * 
+ *
  */
 export function addLoaderPlugin(name: string, plugin: ILoaderPlugin) {
     if (pluginCache[name]) {

+ 0 - 1
Viewer/src/loader/plugins/telemetryLoaderPlugin.ts

@@ -3,7 +3,6 @@ import { telemetryManager } from "../../managers/telemetryManager";
 import { ViewerModel } from "../../model/viewerModel";
 import { Tools, ISceneLoaderPlugin, ISceneLoaderPluginAsync } from "babylonjs";
 
-
 export class TelemetryLoaderPlugin implements ILoaderPlugin {
 
     private _model: ViewerModel;

+ 61 - 61
Viewer/src/managers/sceneManager.ts

@@ -82,7 +82,6 @@ export class SceneManager {
 
     private _animationBlendingEnabled: boolean = true;
 
-
     //The following are configuration objects, default values.
     protected _defaultHighpTextureType: number;
     protected _shadowGeneratorBias: number;
@@ -115,7 +114,6 @@ export class SceneManager {
         return this._defaultRenderingPipeline;
     }
 
-
     protected _vrHelper?: VRExperienceHelper;
 
     public get vrHelper() {
@@ -154,7 +152,7 @@ export class SceneManager {
                         }
                     }
                 }
-            }
+            };
             scene.registerBeforeRender(() => {
                 if (this._forceShadowUpdate || (scene.animatables && scene.animatables.length > 0)) {
                     // make sure all models are loaded
@@ -165,7 +163,7 @@ export class SceneManager {
                         model.shadowsRenderedAfterLoad = true;
                         return false;
                     }
-                    return model.state === ModelState.COMPLETE && !model.currentAnimation
+                    return model.state === ModelState.COMPLETE && !model.currentAnimation;
                 }))) {
                     updateShadows();
                 }
@@ -187,12 +185,12 @@ export class SceneManager {
                 this._focusOnModel(model);
             });
 
-            this._observablesManager.onModelAddedObservable.add(model => {
+            this._observablesManager.onModelAddedObservable.add((model) => {
                 this.models.push(model);
             });
-            this._observablesManager.onModelRemovedObservable.add(model => {
+            this._observablesManager.onModelRemovedObservable.add((model) => {
                 this.models.splice(this.models.indexOf(model), 1);
-            })
+            });
 
         }
 
@@ -240,7 +238,7 @@ export class SceneManager {
     /**
      * Should shadows be rendered every frame, or only once and stop.
      * This can be used to optimize a scene.
-     * 
+     *
      * Not that the shadows will NOT disapear but will remain in place.
      * @param process if true shadows will be updated once every frame. if false they will stop being updated.
      */
@@ -269,7 +267,7 @@ export class SceneManager {
     }
 
     public set groundEnabled(newValue: boolean) {
-        if (newValue === this._groundEnabled) return;
+        if (newValue === this._groundEnabled) { return; }
 
         this._groundEnabled = newValue;
 
@@ -389,11 +387,11 @@ export class SceneManager {
 
     public clearScene(clearModels: boolean = true, clearLights: boolean = false) {
         if (clearModels) {
-            this.models.forEach(m => m.dispose());
+            this.models.forEach((m) => m.dispose());
             this.models.length = 0;
         }
         if (clearLights) {
-            this.scene.lights.forEach(l => l.dispose());
+            this.scene.lights.forEach((l) => l.dispose());
         }
     }
 
@@ -465,7 +463,7 @@ export class SceneManager {
 
             if (newConfiguration.lab.globalLightRotation !== undefined) {
                 // rotate all lights that are shadow lights
-                this.scene.lights.filter(light => light instanceof ShadowLight).forEach(light => {
+                this.scene.lights.filter((light) => light instanceof ShadowLight).forEach((light) => {
                     // casting and '!' are safe, due to the constraints tested before
                     this.labs.rotateShadowLight(<ShadowLight>light, newConfiguration.lab!.globalLightRotation!);
                 });
@@ -586,13 +584,13 @@ export class SceneManager {
                 oldcc.r = cc.r;
             }
             if (cc.g !== undefined) {
-                oldcc.g = cc.g
+                oldcc.g = cc.g;
             }
             if (cc.b !== undefined) {
-                oldcc.b = cc.b
+                oldcc.b = cc.b;
             }
             if (cc.a !== undefined) {
-                oldcc.a = cc.a
+                oldcc.a = cc.a;
             }
         }
 
@@ -705,7 +703,7 @@ export class SceneManager {
             }
             if (this.sceneOptimizer) {
                 this.sceneOptimizer.stop();
-                this.sceneOptimizer.dispose()
+                this.sceneOptimizer.dispose();
             }
             if (optimizerConfig.custom) {
                 let customOptimizer = getCustomOptimizerByName(optimizerConfig.custom, optimizerConfig.improvementMode);
@@ -834,15 +832,14 @@ export class SceneManager {
                 this.mainColor.r = mc.r;
             }
             if (mc.g !== undefined) {
-                this.mainColor.g = mc.g
+                this.mainColor.g = mc.g;
             }
             if (mc.b !== undefined) {
-                this.mainColor.b = mc.b
+                this.mainColor.b = mc.b;
             }
 
             this.reflectionColor.copyFrom(this.mainColor);
 
-
             let environmentTint = getConfigurationKey("environmentMap.tintLevel", this._globalConfiguration) || 0;
 
             // reflection color
@@ -897,7 +894,7 @@ export class SceneManager {
         }*/
 
         if (cameraConfig.rotation) {
-            this.camera.rotationQuaternion = new Quaternion(cameraConfig.rotation.x || 0, cameraConfig.rotation.y || 0, cameraConfig.rotation.z || 0, cameraConfig.rotation.w || 0)
+            this.camera.rotationQuaternion = new Quaternion(cameraConfig.rotation.x || 0, cameraConfig.rotation.y || 0, cameraConfig.rotation.z || 0, cameraConfig.rotation.w || 0);
         }
 
         if (cameraConfig.behaviors) {
@@ -906,7 +903,7 @@ export class SceneManager {
                     this._setCameraBehavior(name, cameraConfig.behaviors[name]);
                 }
             }
-        };
+        }
 
         const sceneExtends = this.scene.getWorldExtends((mesh) => {
             return !this.environmentHelper || (mesh !== this.environmentHelper.ground && mesh !== this.environmentHelper.rootMesh && mesh !== this.environmentHelper.skybox);
@@ -944,11 +941,13 @@ export class SceneManager {
         this.camera.radius = (this._globalConfiguration.camera && this._globalConfiguration.camera.radius) || this.camera.radius;
 
         const sceneDiagonalLenght = sizeVec.length();
-        if (isFinite(sceneDiagonalLenght))
-            this.camera.upperRadiusLimit = sceneDiagonalLenght * 4;
+        if (isFinite(sceneDiagonalLenght)) {
+            this.camera.upperRadiusLimit = sceneDiagonalLenght * 4;
+        }
 
-        if (this._configurationContainer.configuration)
-            this._configureEnvironment(this._configurationContainer.configuration.skybox, this._configurationContainer.configuration.ground);
+        if (this._configurationContainer.configuration) {
+            this._configureEnvironment(this._configurationContainer.configuration.skybox, this._configurationContainer.configuration.ground);
+        }
         /*this.scene.lights.filter(light => light instanceof ShadowLight).forEach(light => {
             // casting ais safe, due to the constraints tested before
             (<ShadowLight>light).setDirectionToTarget(center);
@@ -960,10 +959,9 @@ export class SceneManager {
             if (this.environmentHelper) {
                 this.environmentHelper.dispose();
                 this.environmentHelper = undefined;
-            };
+            }
         } else {
 
-
             const options: Partial<IEnvironmentHelperOptions> = {
                 createGround: !!groundConfiguration && this._groundEnabled,
                 createSkybox: !!skyboxConifguration,
@@ -996,7 +994,7 @@ export class SceneManager {
                     options.groundTexture = this._getAssetUrl(groundConfig.texture);
                 }
                 if (groundConfig.color) {
-                    options.groundColor = new Color3(groundConfig.color.r, groundConfig.color.g, groundConfig.color.b)
+                    options.groundColor = new Color3(groundConfig.color.r, groundConfig.color.g, groundConfig.color.b);
                 }
 
                 if (groundConfig.opacity !== undefined) {
@@ -1007,18 +1005,24 @@ export class SceneManager {
                     options.enableGroundMirror = true;
                     // to prevent undefines
                     if (typeof groundConfig.mirror === "object") {
-                        if (groundConfig.mirror.amount !== undefined)
-                            options.groundMirrorAmount = groundConfig.mirror.amount;
-                        if (groundConfig.mirror.sizeRatio !== undefined)
-                            options.groundMirrorSizeRatio = groundConfig.mirror.sizeRatio;
-                        if (groundConfig.mirror.blurKernel !== undefined)
-                            options.groundMirrorBlurKernel = groundConfig.mirror.blurKernel;
-                        if (groundConfig.mirror.fresnelWeight !== undefined)
-                            options.groundMirrorFresnelWeight = groundConfig.mirror.fresnelWeight;
-                        if (groundConfig.mirror.fallOffDistance !== undefined)
-                            options.groundMirrorFallOffDistance = groundConfig.mirror.fallOffDistance;
-                        if (this._defaultPipelineTextureType !== undefined)
-                            options.groundMirrorTextureType = this._defaultPipelineTextureType;
+                        if (groundConfig.mirror.amount !== undefined) {
+                            options.groundMirrorAmount = groundConfig.mirror.amount;
+                        }
+                        if (groundConfig.mirror.sizeRatio !== undefined) {
+                            options.groundMirrorSizeRatio = groundConfig.mirror.sizeRatio;
+                        }
+                        if (groundConfig.mirror.blurKernel !== undefined) {
+                            options.groundMirrorBlurKernel = groundConfig.mirror.blurKernel;
+                        }
+                        if (groundConfig.mirror.fresnelWeight !== undefined) {
+                            options.groundMirrorFresnelWeight = groundConfig.mirror.fresnelWeight;
+                        }
+                        if (groundConfig.mirror.fallOffDistance !== undefined) {
+                            options.groundMirrorFallOffDistance = groundConfig.mirror.fallOffDistance;
+                        }
+                        if (this._defaultPipelineTextureType !== undefined) {
+                            options.groundMirrorTextureType = this._defaultPipelineTextureType;
+                        }
                     }
                 }
             }
@@ -1035,7 +1039,7 @@ export class SceneManager {
                 }
                 options.sizeAuto = !options.skyboxSize;
                 if (conf.color) {
-                    options.skyboxColor = new Color3(conf.color.r, conf.color.g, conf.color.b)
+                    options.skyboxColor = new Color3(conf.color.r, conf.color.g, conf.color.b);
                 }
                 if (conf.cubeTexture && conf.cubeTexture.url) {
                     if (typeof conf.cubeTexture.url === "string") {
@@ -1109,7 +1113,6 @@ export class SceneManager {
                 }
             }
 
-
             let skyboxMaterial = this.environmentHelper.skyboxMaterial;
             if (skyboxMaterial) {
                 skyboxMaterial._perceptualColor = this.mainColor;
@@ -1127,7 +1130,6 @@ export class SceneManager {
             this._updateGroundMirrorRenderList(model);
         });
 
-
         this.onEnvironmentConfiguredObservable.notifyObservers({
             sceneManager: this,
             object: this.environmentHelper!,
@@ -1140,25 +1142,26 @@ export class SceneManager {
 
     /**
      * configure the lights.
-     * 
+     *
      * @param lightsConfiguration the (new) light(s) configuration
      * @param model optionally use the model to configure the camera.
      */
     protected _configureLights(lightsConfiguration: { [name: string]: ILightConfiguration | boolean | number } = {}) {
 
         // sanity check!
-        let lightKeys = Object.keys(lightsConfiguration).filter(name => name !== 'globalRotation');
+        let lightKeys = Object.keys(lightsConfiguration).filter((name) => name !== 'globalRotation');
 
         if (!lightKeys.length) {
-            if (!this.scene.lights.length)
-                this.scene.createDefaultLight(true);
+            if (!this.scene.lights.length) {
+                this.scene.createDefaultLight(true);
+            }
         } else {
 
-            let lightsAvailable: Array<string> = this.scene.lights.map(light => light.name);
+            let lightsAvailable: Array<string> = this.scene.lights.map((light) => light.name);
             // compare to the global (!) configuration object and dispose unneeded:
             let lightsToConfigure = Object.keys(this._globalConfiguration.lights || []);
             if (Object.keys(lightsToConfigure).length !== lightsAvailable.length) {
-                lightsAvailable.forEach(lName => {
+                lightsAvailable.forEach((lName) => {
                     if (lightsToConfigure.indexOf(lName) === -1) {
                         this.scene.getLightByName(lName)!.dispose();
                     }
@@ -1180,7 +1183,7 @@ export class SceneManager {
                 // light is not already available
                 if (lightsAvailable.indexOf(name) === -1) {
                     let constructor = Light.GetConstructorFromName(lightConfig.type, lightConfig.name, this.scene);
-                    if (!constructor) return;
+                    if (!constructor) { return; }
                     light = constructor();
                 } else {
                     // available? get it from the scene
@@ -1188,11 +1191,11 @@ export class SceneManager {
                     if (typeof lightsConfiguration[name] === 'boolean') {
                         lightConfig.type = light.getTypeID();
                     }
-                    lightsAvailable = lightsAvailable.filter(ln => ln !== name);
+                    lightsAvailable = lightsAvailable.filter((ln) => ln !== name);
                     if (lightConfig.type !== undefined && light.getTypeID() !== lightConfig.type) {
                         light.dispose();
                         let constructor = Light.GetConstructorFromName(lightConfig.type, lightConfig.name, this.scene);
-                        if (!constructor) return;
+                        if (!constructor) { return; }
                         light = constructor();
                     }
                 }
@@ -1207,11 +1210,8 @@ export class SceneManager {
                 var enabled = lightConfig.enabled !== undefined ? lightConfig.enabled : !lightConfig.disabled;
                 light.setEnabled(enabled);
 
-
                 extendClassWithConfig(light, lightConfig);
 
-
-
                 //position. Some lights don't support shadows
                 if (light instanceof ShadowLight) {
                     // set default values
@@ -1284,7 +1284,7 @@ export class SceneManager {
                 let configuration = globalLightsConfiguration[name];
                 let light = this.scene.getLightByName(name);
                 // sanity check
-                if (!light) return;
+                if (!light) { return; }
                 light.renderPriority = -idx;
             });
         }
@@ -1302,11 +1302,11 @@ export class SceneManager {
         let focusMeshes = model ? model.meshes : this.scene.meshes;
         // add the focues meshes to the shadow list
         let shadownMap = shadowGenerator.getShadowMap();
-        if (!shadownMap) return;
+        if (!shadownMap) { return; }
         if (resetList && shadownMap.renderList) {
             shadownMap.renderList.length = 0;
         } else {
-            shadownMap.renderList = shadownMap.renderList || []
+            shadownMap.renderList = shadownMap.renderList || [];
         }
         for (var index = 0; index < focusMeshes.length; index++) {
             let mesh = focusMeshes[index];
@@ -1439,7 +1439,7 @@ export class SceneManager {
             this.environmentHelper.dispose();
         }
 
-        this.models.forEach(model => {
+        this.models.forEach((model) => {
             model.dispose();
         });
 
@@ -1483,14 +1483,14 @@ export class SceneManager {
         let behavior: Behavior<ArcRotateCamera> | null;
         let type: number;
         if (typeof behaviorConfig === 'object') {
-            type = behaviorConfig.type
+            type = behaviorConfig.type;
         } else if (typeof behaviorConfig === 'number') {
             type = behaviorConfig;
         } else {
             type = this._cameraBehaviorMapping[name];
         }
 
-        if (type === undefined) return;
+        if (type === undefined) { return; }
 
         let config: { [propName: string]: any } = (typeof behaviorConfig === "object") ? behaviorConfig : {};
 

+ 1 - 2
Viewer/src/managers/telemetryManager.ts

@@ -54,7 +54,7 @@ export class TelemetryManager {
 
     /**
      * Enable or disable telemetry events
-     * @param enabled Boolan, true if events are enabled 
+     * @param enabled Boolan, true if events are enabled
      */
     public set enable(enabled: boolean) {
         if (enabled) {
@@ -121,4 +121,3 @@ export class TelemetryManager {
 }
 
 export const telemetryManager = new TelemetryManager();
-

+ 15 - 13
Viewer/src/model/modelAnimation.ts

@@ -20,7 +20,7 @@ export const enum AnimationState {
 }
 
 /**
- * The different type of easing functions available 
+ * The different type of easing functions available
  */
 export const enum EasingFunction {
     Linear = 0,
@@ -78,14 +78,14 @@ export interface IModelAnimation {
     readonly name: string;
     /**
      * Get the max numbers of frame available in the animation group
-     * 
+     *
      * In correlation to an arry, this would be ".length"
      */
     readonly frames: number;
     /**
-     * Get the current frame playing right now. 
+     * Get the current frame playing right now.
      * This can be used to poll the frame currently playing (and, for exmaple, display a progress bar with the data)
-     * 
+     *
      * In correlation to an array, this would be the current index
      */
     readonly currentFrame: number;
@@ -124,7 +124,7 @@ export interface IModelAnimation {
      */
     restart();
     /**
-     * Go to a specific 
+     * Go to a specific
      * @param frameNumber the frame number to go to
      */
     goToFrame(frameNumber: number);
@@ -187,7 +187,7 @@ export class GroupModelAnimation implements IModelAnimation {
 
     /**
      * Get the max numbers of frame available in the animation group
-     * 
+     *
      * In correlation to an arry, this would be ".length"
      */
     public get frames(): number {
@@ -195,9 +195,9 @@ export class GroupModelAnimation implements IModelAnimation {
     }
 
     /**
-     * Get the current frame playing right now. 
+     * Get the current frame playing right now.
      * This can be used to poll the frame currently playing (and, for exmaple, display a progress bar with the data)
-     * 
+     *
      * In correlation to an array, this would be the current index
      */
     public get currentFrame(): number {
@@ -266,14 +266,16 @@ export class GroupModelAnimation implements IModelAnimation {
      * Restart the animation group
      */
     restart() {
-        if (this.state === AnimationState.PAUSED)
-            this._animationGroup.restart();
-        else
-            this.start();
+        if (this.state === AnimationState.PAUSED) {
+            this._animationGroup.restart();
+        }
+        else {
+            this.start();
+        }
     }
 
     /**
-     * 
+     *
      * @param frameNumber Go to a specific frame in the animation
      */
     goToFrame(frameNumber: number) {

+ 27 - 30
Viewer/src/model/viewerModel.ts

@@ -8,7 +8,6 @@ import { deepmerge, extendClassWithConfig } from '../helper/';
 import { ObservablesManager } from "../managers/observablesManager";
 import { ConfigurationContainer } from "../configuration/configurationContainer";
 
-
 /**
  * The current state of the model
  */
@@ -114,7 +113,7 @@ export class ViewerModel implements IDisposable {
 
         this.state = ModelState.INIT;
 
-        let scene = this._configurationContainer && this._configurationContainer.scene
+        let scene = this._configurationContainer && this._configurationContainer.scene;
 
         this.rootMesh = new AbstractMesh("modelRootMesh", scene);
         this._pivotMesh = new AbstractMesh("pivotMesh", scene);
@@ -189,7 +188,7 @@ export class ViewerModel implements IDisposable {
     /**
      * Add a mesh to this model.
      * Any mesh that has no parent will be provided with the root mesh as its new parent.
-     * 
+     *
      * @param mesh the new mesh to add
      * @param triggerLoaded should this mesh trigger the onLoaded observable. Used when adding meshes manually.
      */
@@ -238,14 +237,13 @@ export class ViewerModel implements IDisposable {
         this._configureModel();
     }
 
-
     private _initAnimations() {
         // check if this is not a gltf loader and init the animations
         if (this.skeletons.length) {
             this.skeletons.forEach((skeleton, idx) => {
                 let ag = new AnimationGroup("animation-" + idx, this._configurationContainer && this._configurationContainer.scene);
                 let add = false;
-                skeleton.getAnimatables().forEach(a => {
+                skeleton.getAnimatables().forEach((a) => {
                     if (a.animations[0]) {
                         ag.addTargetedAnimation(a.animations[0], a);
                         add = true;
@@ -259,11 +257,11 @@ export class ViewerModel implements IDisposable {
 
         let completeCallback = () => {
 
-        }
+        };
 
         if (this._modelConfiguration.animation) {
             if (this._modelConfiguration.animation.playOnce) {
-                this._animations.forEach(a => {
+                this._animations.forEach((a) => {
                     a.playMode = AnimationPlayMode.ONCE;
                 });
             }
@@ -273,7 +271,7 @@ export class ViewerModel implements IDisposable {
 
                 completeCallback = () => {
                     this.playAnimation(animationName);
-                }
+                };
             }
         }
 
@@ -291,8 +289,8 @@ export class ViewerModel implements IDisposable {
             this.state = ModelState.ENTRYDONE;
             scene.animationPropertiesOverride!.enableBlending = previousValue;
             this._checkCompleteState();
-            if (completeCallback) completeCallback();
-        }
+            if (completeCallback) { completeCallback(); }
+        };
         if (!this._entryAnimation) {
             callback();
             return;
@@ -319,7 +317,7 @@ export class ViewerModel implements IDisposable {
     private _modelComplete() {
         //reapply material defines to be sure:
         let meshes = this._pivotMesh.getChildMeshes(false);
-        meshes.filter(m => m.material).forEach((mesh) => {
+        meshes.filter((m) => m.material).forEach((mesh) => {
             this._applyModelMaterialConfiguration(mesh.material!);
         });
         this.state = ModelState.COMPLETE;
@@ -345,7 +343,7 @@ export class ViewerModel implements IDisposable {
      * Get the animations' names. Using the names you can play a specific animation.
      */
     public getAnimationNames(): Array<string> {
-        return this._animations.map(a => a.name);
+        return this._animations.map((a) => a.name);
     }
 
     /**
@@ -354,7 +352,7 @@ export class ViewerModel implements IDisposable {
      */
     protected _getAnimationByName(name: string): Nullable<IModelAnimation> {
         // can't use .find, noe available on IE
-        let filtered = this._animations.filter(a => a.name === name.trim());
+        let filtered = this._animations.filter((a) => a.name === name.trim());
         // what the next line means - if two animations have the same name, they will not be returned!
         if (filtered.length === 1) {
             return filtered[0];
@@ -391,16 +389,16 @@ export class ViewerModel implements IDisposable {
 
     private _configureModel() {
         // this can be changed to the meshes that have rootMesh a parent without breaking anything.
-        let meshesWithNoParent: Array<AbstractMesh> = [this.rootMesh] //this._meshes.filter(m => m.parent === this.rootMesh);
+        let meshesWithNoParent: Array<AbstractMesh> = [this.rootMesh]; //this._meshes.filter(m => m.parent === this.rootMesh);
         let updateMeshesWithNoParent = (variable: string, value: any, param?: string) => {
-            meshesWithNoParent.forEach(mesh => {
+            meshesWithNoParent.forEach((mesh) => {
                 if (param) {
                     mesh[variable][param] = value;
                 } else {
                     mesh[variable] = value;
                 }
             });
-        }
+        };
         let updateXYZ = (variable: string, configValues: { x: number, y: number, z: number, w?: number }) => {
             if (configValues.x !== undefined) {
                 updateMeshesWithNoParent(variable, configValues.x, 'x');
@@ -414,7 +412,7 @@ export class ViewerModel implements IDisposable {
             if (configValues.w !== undefined) {
                 updateMeshesWithNoParent(variable, configValues.w, 'w');
             }
-        }
+        };
 
         if (this._modelConfiguration.normalize) {
             let center = false;
@@ -437,13 +435,13 @@ export class ViewerModel implements IDisposable {
             }
 
             if (unitSize) {
-                meshesToNormalize.forEach(mesh => {
+                meshesToNormalize.forEach((mesh) => {
                     mesh.normalizeToUnitCube(true);
                     mesh.computeWorldMatrix(true);
                 });
             }
             if (center) {
-                meshesToNormalize.forEach(mesh => {
+                meshesToNormalize.forEach((mesh) => {
                     const boundingInfo = mesh.getHierarchyBoundingVectors(true);
                     const sizeVec = boundingInfo.max.subtract(boundingInfo.min);
                     const halfSizeVec = sizeVec.scale(0.5);
@@ -467,11 +465,11 @@ export class ViewerModel implements IDisposable {
         if (this._modelConfiguration.rotation) {
             //quaternion?
             if (this._modelConfiguration.rotation.w) {
-                meshesWithNoParent.forEach(mesh => {
+                meshesWithNoParent.forEach((mesh) => {
                     if (!mesh.rotationQuaternion) {
                         mesh.rotationQuaternion = new Quaternion();
                     }
-                })
+                });
                 updateXYZ('rotationQuaternion', this._modelConfiguration.rotation);
             } else {
                 updateXYZ('rotation', this._modelConfiguration.rotation);
@@ -481,7 +479,7 @@ export class ViewerModel implements IDisposable {
         if (this._modelConfiguration.rotationOffsetAxis) {
             let rotationAxis = new Vector3(0, 0, 0).copyFrom(this._modelConfiguration.rotationOffsetAxis as Vector3);
 
-            meshesWithNoParent.forEach(m => {
+            meshesWithNoParent.forEach((m) => {
                 if (this._modelConfiguration.rotationOffsetAngle) {
                     m.rotate(rotationAxis, this._modelConfiguration.rotationOffsetAngle);
                 }
@@ -494,13 +492,13 @@ export class ViewerModel implements IDisposable {
         }
 
         if (this._modelConfiguration.castShadow) {
-            this._meshes.forEach(mesh => {
+            this._meshes.forEach((mesh) => {
                 Tags.AddTagsTo(mesh, 'castShadow');
             });
         }
 
         let meshes = this._pivotMesh.getChildMeshes(false);
-        meshes.filter(m => m.material).forEach((mesh) => {
+        meshes.filter((m) => m.material).forEach((mesh) => {
             this._applyModelMaterialConfiguration(mesh.material!);
         });
 
@@ -512,7 +510,6 @@ export class ViewerModel implements IDisposable {
             this._exitAnimation = this._modelAnimationConfigurationToObject(this._modelConfiguration.exitAnimation);
         }
 
-
         this.onAfterConfigure.notifyObservers(this);
     }
 
@@ -539,7 +536,7 @@ export class ViewerModel implements IDisposable {
      * @hidden
      */
     public _applyModelMaterialConfiguration(material: Material) {
-        if (!this._modelConfiguration.material) return;
+        if (!this._modelConfiguration.material) { return; }
 
         extendClassWithConfig(material, this._modelConfiguration.material);
 
@@ -606,7 +603,7 @@ export class ViewerModel implements IDisposable {
             animationConfiguration.time,
             this._createEasingFunction(animationConfiguration.easingFunction),
             animationConfiguration.easingMode,
-            () => { if (completeCallback) completeCallback(); }
+            () => { if (completeCallback) { completeCallback(); } }
         );
     }
 
@@ -757,11 +754,11 @@ export class ViewerModel implements IDisposable {
         if (this.loader && this.loader.name === "gltf") {
             (<GLTFFileLoader>this.loader).dispose();
         }
-        this.particleSystems.forEach(ps => ps.dispose());
+        this.particleSystems.forEach((ps) => ps.dispose());
         this.particleSystems.length = 0;
-        this.skeletons.forEach(s => s.dispose());
+        this.skeletons.forEach((s) => s.dispose());
         this.skeletons.length = 0;
-        this._animations.forEach(ag => ag.dispose());
+        this._animations.forEach((ag) => ag.dispose());
         this._animations.length = 0;
         this.rootMesh.dispose(false, true);
     }

+ 4 - 4
Viewer/src/optimizer/custom/extended.ts

@@ -3,7 +3,7 @@ import { SceneManager } from '../../managers/sceneManager';
 
 /**
  * A custom upgrade-oriented function configuration for the scene optimizer.
- * 
+ *
  * @param viewer the viewer to optimize
  */
 export function extendedUpgrade(sceneManager: SceneManager): boolean {
@@ -28,7 +28,7 @@ export function extendedUpgrade(sceneManager: SceneManager): boolean {
         return false;
     }
     if (defaultPipeline && !sceneManager.fxaaEnabled) {
-        sceneManager.fxaaEnabled = true
+        sceneManager.fxaaEnabled = true;
         return false;
     }
     var hardwareScalingLevel = Math.max(1 / 2, 1 / (window.devicePixelRatio || 2));
@@ -42,7 +42,7 @@ export function extendedUpgrade(sceneManager: SceneManager): boolean {
         return false;
     }
     if (defaultPipeline && !sceneManager.bloomEnabled) {
-        sceneManager.bloomEnabled = true
+        sceneManager.bloomEnabled = true;
         return false;
     }
     if (!sceneManager.groundMirrorEnabled) {
@@ -54,7 +54,7 @@ export function extendedUpgrade(sceneManager: SceneManager): boolean {
 
 /**
  * A custom degrade-oriented function configuration for the scene optimizer.
- * 
+ *
  * @param viewer the viewer to optimize
  */
 export function extendedDegrade(sceneManager: SceneManager): boolean {

+ 1 - 1
Viewer/src/optimizer/custom/index.ts

@@ -4,7 +4,7 @@ import { SceneManager } from "../../managers/sceneManager";
 const cache: { [key: string]: (sceneManager: SceneManager) => boolean } = {};
 
 /**
- * 
+ *
  * @param name the name of the custom optimizer configuration
  * @param upgrade set to true if you want to upgrade optimizer and false if you want to degrade
  */

+ 7 - 8
Viewer/src/templating/eventManager.ts

@@ -1,25 +1,24 @@
 import { EventCallback, TemplateManager } from "./templateManager";
 
-
 /**
  * The EventManager is in charge of registering user interctions with the viewer.
  * It is used in the TemplateManager
  */
 export class EventManager {
 
-    private _callbacksContainer: { [key: string]: Array<{ eventType?: string, selector?: string, callback: (eventData: EventCallback) => void }> }
+    private _callbacksContainer: { [key: string]: Array<{ eventType?: string, selector?: string, callback: (eventData: EventCallback) => void }> };
 
     constructor(private _templateManager: TemplateManager) {
         this._callbacksContainer = {};
-        this._templateManager.onEventTriggered.add(eventData => {
+        this._templateManager.onEventTriggered.add((eventData) => {
             this._eventTriggered(eventData);
-        })
+        });
     }
 
     /**
      * Register a new callback to a specific template.
      * The best example for the usage can be found in the DefaultViewer
-     * 
+     *
      * @param templateName the templateName to register the event to
      * @param callback The callback to be executed
      * @param eventType the type of event to register
@@ -39,7 +38,7 @@ export class EventManager {
     /**
      * This will remove a registered event from the defined template.
      * Each one of the variables apart from the template name are optional, but one must be provided.
-     * 
+     *
      * @param templateName the templateName
      * @param callback the callback to remove (optional)
      * @param eventType the event type to remove (optional)
@@ -47,7 +46,7 @@ export class EventManager {
      */
     public unregisterCallback(templateName: string, callback: (eventData: EventCallback) => void, eventType?: string, selector?: string) {
         let callbackDefs = this._callbacksContainer[templateName] || [];
-        this._callbacksContainer[templateName] = callbackDefs.filter(callbackDef => (!callbackDef.eventType || callbackDef.eventType === eventType) && (!callbackDef.selector || callbackDef.selector === selector));
+        this._callbacksContainer[templateName] = callbackDefs.filter((callbackDef) => (!callbackDef.eventType || callbackDef.eventType === eventType) && (!callbackDef.selector || callbackDef.selector === selector));
     }
 
     private _eventTriggered(data: EventCallback) {
@@ -56,7 +55,7 @@ export class EventManager {
         let selector = data.selector;
 
         let callbackDefs = this._callbacksContainer[templateName] || [];
-        callbackDefs.filter(callbackDef => (!callbackDef.eventType || callbackDef.eventType === eventType) && (!callbackDef.selector || callbackDef.selector === selector)).forEach(callbackDef => {
+        callbackDefs.filter((callbackDef) => (!callbackDef.eventType || callbackDef.eventType === eventType) && (!callbackDef.selector || callbackDef.selector === selector)).forEach((callbackDef) => {
             callbackDef.callback(data);
         });
     }

+ 3 - 3
Viewer/src/templating/plugins/printButton.ts

@@ -20,16 +20,16 @@ export class PrintButtonPlugin extends AbstractViewerNavbarButton {
                 let extension = model.configuration.loader || filename.split(".").pop() || "";
                 let printable = false;
                 // not using .some sue to IE11
-                ["gltf", "glb", "obj", "stl"].forEach(ext => {
+                ["gltf", "glb", "obj", "stl"].forEach((ext) => {
                     if (extension.indexOf(ext) !== -1) {
                         printable = true;
                     }
-                })
+                });
                 if (printable) {
                     this._currentModelUrl = baseUrl + filename;
                 }
             }
-        })
+        });
     }
 
     onEvent(event: EventCallback): void {

+ 42 - 40
Viewer/src/templating/templateManager.ts

@@ -51,7 +51,7 @@ export class TemplateManager {
 
     private templates: { [name: string]: Template };
 
-    constructor(public containerElement: HTMLElement) {
+    constructor(public containerElement: Element) {
         this.templates = {};
 
         this.onTemplateInit = new Observable<Template>();
@@ -73,7 +73,7 @@ export class TemplateManager {
             //init template
             let template = this.templates[name];
 
-            let childrenTemplates = Object.keys(dependencyMap).map(childName => {
+            let childrenTemplates = Object.keys(dependencyMap).map((childName) => {
                 return internalInit(dependencyMap[childName], childName, template);
             });
 
@@ -84,7 +84,7 @@ export class TemplateManager {
                 let containingElement = (lastElements && lastElements.length && lastElements.item(lastElements.length - 1)) || this.containerElement;
                 template.appendTo(<HTMLElement>containingElement);
                 this._checkLoadedState();
-            }
+            };
 
             if (parentTemplate && !parentTemplate.parent) {
                 parentTemplate.onAppended.add(() => {
@@ -96,10 +96,10 @@ export class TemplateManager {
             //});
 
             return template;
-        }
+        };
 
         //build the html tree
-        return this._buildHTMLTree(templates).then(htmlTree => {
+        return this._buildHTMLTree(templates).then((htmlTree) => {
             if (this.templates['main']) {
                 internalInit(htmlTree, 'main');
             } else {
@@ -110,17 +110,17 @@ export class TemplateManager {
     }
 
     /**
-     * 
+     *
      * This function will create a simple map with child-dependencies of the template html tree.
      * It will compile each template, check if its children exist in the configuration and will add them if they do.
      * It is expected that the main template will be called main!
-     * 
+     *
      * @param templates
      */
     private _buildHTMLTree(templates: { [key: string]: ITemplateConfiguration }): Promise<object> {
-        let promises: Array<Promise<Template | boolean>> = Object.keys(templates).map(name => {
+        let promises: Array<Promise<Template | boolean>> = Object.keys(templates).map((name) => {
             // if the template was overridden
-            if (!templates[name]) return Promise.resolve(false);
+            if (!templates[name]) { return Promise.resolve(false); }
             // else - we have a template, let's do our job!
             let template = new Template(name, templates[name]);
             template.onLoaded.add(() => {
@@ -131,7 +131,7 @@ export class TemplateManager {
             });
             this.onTemplateInit.notifyObservers(template);
             // make sure the global onEventTriggered is called as well
-            template.onEventTriggered.add(eventData => this.onEventTriggered.notifyObservers(eventData));
+            template.onEventTriggered.add((eventData) => this.onEventTriggered.notifyObservers(eventData));
             this.templates[name] = template;
             return template.initPromise;
         });
@@ -141,12 +141,12 @@ export class TemplateManager {
             // now iterate through all templates and check for children:
             let buildTree = (parentObject, name) => {
                 this.templates[name].isInHtmlTree = true;
-                let childNodes = this.templates[name].getChildElements().filter(n => !!this.templates[n]);
-                childNodes.forEach(element => {
+                let childNodes = this.templates[name].getChildElements().filter((n) => !!this.templates[n]);
+                childNodes.forEach((element) => {
                     parentObject[element] = {};
                     buildTree(parentObject[element], element);
                 });
-            }
+            };
             if (this.templates['main']) {
                 buildTree(templateStructure, "main");
             }
@@ -185,7 +185,7 @@ export class TemplateManager {
      */
     public dispose() {
         // dispose all templates
-        Object.keys(this.templates).forEach(template => {
+        Object.keys(this.templates).forEach((template) => {
             this.templates[template].dispose();
         });
         this.templates = {};
@@ -201,9 +201,9 @@ export class TemplateManager {
 }
 
 // register a new helper. modified https://stackoverflow.com/questions/9838925/is-there-any-method-to-iterate-a-map-with-handlebars-js
-Handlebars.registerHelper('eachInMap', function (map, block) {
+Handlebars.registerHelper('eachInMap', function(map, block) {
     var out = '';
-    Object.keys(map).map(function (prop) {
+    Object.keys(map).map(function(prop) {
         let data = map[prop];
         if (typeof data === 'object') {
             data.id = data.id || prop;
@@ -215,32 +215,31 @@ Handlebars.registerHelper('eachInMap', function (map, block) {
     return out;
 });
 
-Handlebars.registerHelper('add', function (a, b) {
+Handlebars.registerHelper('add', function(a, b) {
     var out = a + b;
     return out;
 });
 
-Handlebars.registerHelper('eq', function (a, b) {
+Handlebars.registerHelper('eq', function(a, b) {
     var out = (a == b);
     return out;
 });
 
-
-Handlebars.registerHelper('or', function (a, b) {
+Handlebars.registerHelper('or', function(a, b) {
     var out = a || b;
     return out;
 });
 
-Handlebars.registerHelper('not', function (a) {
+Handlebars.registerHelper('not', function(a) {
     var out = !a;
     return out;
 });
 
-Handlebars.registerHelper('count', function (map) {
+Handlebars.registerHelper('count', function(map) {
     return map.length;
 });
 
-Handlebars.registerHelper('gt', function (a, b) {
+Handlebars.registerHelper('gt', function(a, b) {
     var out = a > b;
     return out;
 });
@@ -250,7 +249,7 @@ Handlebars.registerHelper('gt', function (a, b) {
  * An example for a template is a single canvas, an overlay (containing sub-templates) or the navigation bar.
  * A template is injected using the template manager in the correct position.
  * The template is rendered using Handlebars and can use Handlebars' features (such as parameter injection)
- * 
+ *
  * For further information please refer to the documentation page, https://doc.babylonjs.com
  */
 export class Template {
@@ -325,7 +324,7 @@ export class Template {
 
         let htmlContentPromise = this._getTemplateAsHtml(_configuration);
 
-        this.initPromise = htmlContentPromise.then(htmlTemplate => {
+        this.initPromise = htmlContentPromise.then((htmlTemplate) => {
             if (htmlTemplate) {
                 this._htmlTemplate = htmlTemplate;
                 let compiledTemplate = Handlebars.compile(htmlTemplate, { noEscape: (this._configuration.params && !!this._configuration.params.noEscape) });
@@ -350,9 +349,9 @@ export class Template {
      * Some templates have parameters (like background color for example).
      * The parameters are provided to Handlebars which in turn generates the template.
      * This function will update the template with the new parameters
-     * 
+     *
      * Note that when updating parameters the events will be registered again (after being cleared).
-     * 
+     *
      * @param params the new template parameters
      */
     public updateParams(params: { [key: string]: string | number | boolean | object }, append: boolean = true) {
@@ -410,7 +409,10 @@ export class Template {
             children = this._fragment.querySelectorAll('*');
         }
         for (let i = 0; i < children.length; ++i) {
-            childrenArray.push(kebabToCamel(children.item(i).nodeName.toLowerCase()));
+            const child = children.item(i);
+            if (child) {
+                childrenArray.push(kebabToCamel(child.nodeName.toLowerCase()));
+            }
         }
         return childrenArray;
     }
@@ -461,10 +463,10 @@ export class Template {
      * The provided function returns a promise that should be fullfilled when the element is shown.
      * Since it is a promise async operations are more than possible.
      * See the default viewer for an opacity example.
-     * @param visibilityFunction The function to execute to show the template. 
+     * @param visibilityFunction The function to execute to show the template.
      */
     public show(visibilityFunction?: (template: Template) => Promise<Template>): Promise<Template> {
-        if (this._isHiding) return Promise.resolve(this);
+        if (this._isHiding) { return Promise.resolve(this); }
         return Promise.resolve().then(() => {
             this._isShowing = true;
             if (visibilityFunction) {
@@ -491,10 +493,10 @@ export class Template {
      * The provided function returns a promise that should be fullfilled when the element is hidden.
      * Since it is a promise async operations are more than possible.
      * See the default viewer for an opacity example.
-     * @param visibilityFunction The function to execute to show the template. 
+     * @param visibilityFunction The function to execute to show the template.
      */
     public hide(visibilityFunction?: (template: Template) => Promise<Template>): Promise<Template> {
-        if (this._isShowing) return Promise.resolve(this);
+        if (this._isShowing) { return Promise.resolve(this); }
         return Promise.resolve().then(() => {
             this._isHiding = true;
             if (visibilityFunction) {
@@ -528,12 +530,12 @@ export class Template {
             //noop
         }
 
-        this.loadRequests.forEach(request => {
+        this.loadRequests.forEach((request) => {
             request.abort();
         });
 
         if (this._registeredEvents) {
-            this._registeredEvents.forEach(evt => {
+            this._registeredEvents.forEach((evt) => {
                 evt.htmlElement.removeEventListener(evt.eventName, evt.function);
             });
         }
@@ -575,7 +577,7 @@ export class Template {
         this._registeredEvents = this._registeredEvents || [];
         if (this._registeredEvents.length) {
             // first remove the registered events
-            this._registeredEvents.forEach(evt => {
+            this._registeredEvents.forEach((evt) => {
                 evt.htmlElement.removeEventListener(evt.eventName, evt.function);
             });
         }
@@ -584,15 +586,15 @@ export class Template {
                 if (this._configuration.events && this._configuration.events[eventName]) {
                     let functionToFire = (selector, event) => {
                         this.onEventTriggered.notifyObservers({ event: event, template: this, selector: selector });
-                    }
+                    };
 
                     // if boolean, set the parent as the event listener
                     if (typeof this._configuration.events[eventName] === 'boolean') {
-                        let selector = this.parent.id
+                        let selector = this.parent.id;
                         if (selector) {
-                            selector = '#' + selector
+                            selector = '#' + selector;
                         } else {
-                            selector = this.parent.tagName
+                            selector = this.parent.tagName;
                         }
                         let binding = functionToFire.bind(this, selector);
                         this.parent.addEventListener(eventName, functionToFire.bind(this, selector), false);
@@ -605,7 +607,7 @@ export class Template {
                         let selectorsArray: Array<string> = Object.keys(this._configuration.events[eventName] || {});
                         // strict null checl is working incorrectly, must override:
                         let event = this._configuration.events[eventName] || {};
-                        selectorsArray.filter(selector => event[selector]).forEach(selector => {
+                        selectorsArray.filter((selector) => event[selector]).forEach((selector) => {
                             let htmlElement = <HTMLElement>this.parent.querySelector(selector);
                             if (!htmlElement) {
                                 // backcompat, fallback to id

+ 2 - 2
Viewer/src/templating/viewerTemplatePlugin.ts

@@ -27,7 +27,7 @@ export abstract class AbstractViewerNavbarButton implements IViewerTemplatePlugi
         } else {
             this._buttonClass = buttonName + '-button';
         }
-        if (htmlTemplate) { this._htmlTemplate = htmlTemplate }
+        if (htmlTemplate) { this._htmlTemplate = htmlTemplate; }
         else {
             this._htmlTemplate = `
 <button class="${this._buttonClass}">
@@ -39,7 +39,7 @@ export abstract class AbstractViewerNavbarButton implements IViewerTemplatePlugi
 
     interactionPredicate(event: EventCallback): boolean {
         let pointerDown = <PointerEvent>event.event;
-        if (pointerDown.button !== 0) return false;
+        if (pointerDown.button !== 0) { return false; }
         var element = (<HTMLElement>event.event.target);
 
         if (!element) {

+ 50 - 48
Viewer/src/viewer/defaultViewer.ts

@@ -1,5 +1,4 @@
 
-
 import { ViewerConfiguration, IModelConfiguration, ILightConfiguration } from './../configuration';
 import { Template, EventCallback } from '../templating/templateManager';
 import { AbstractViewer } from './viewer';
@@ -16,32 +15,32 @@ import { PrintButtonPlugin } from '../templating/plugins/printButton';
  */
 export class DefaultViewer extends AbstractViewer {
 
-    public fullscreenElement?: HTMLElement;
+    public fullscreenElement?: Element;
 
     /**
      * Create a new default viewer
      * @param containerElement the element in which the templates will be rendered
      * @param initialConfiguration the initial configuration. Defaults to extending the default configuration
      */
-    constructor(public containerElement: HTMLElement, initialConfiguration: ViewerConfiguration = { extends: 'default' }) {
+    constructor(public containerElement: Element, initialConfiguration: ViewerConfiguration = { extends: 'default' }) {
         super(containerElement, initialConfiguration);
 
         this.onModelLoadedObservable.add(this._onModelLoaded);
         this.onModelRemovedObservable.add(() => {
             this._configureTemplate();
-        })
+        });
 
         this.onEngineInitObservable.add(() => {
             this.sceneManager.onLightsConfiguredObservable.add((data) => {
                 this._configureLights();
-            })
+            });
         });
 
         this.onInitDoneObservable.add(() => {
             if (!this.sceneManager.models.length) {
                 this.hideLoadingScreen();
             }
-        })
+        });
     }
 
     private _registeredPlugins: Array<IViewerTemplatePlugin> = [];
@@ -64,7 +63,7 @@ export class DefaultViewer extends AbstractViewer {
         }
 
         if (plugin.eventsToAttach) {
-            plugin.eventsToAttach.forEach(eventName => {
+            plugin.eventsToAttach.forEach((eventName) => {
                 plugin.onEvent && this.templateManager.eventManager.registerCallback(plugin.templateName, (event) => {
                     if (plugin.onEvent && plugin.interactionPredicate(event)) {
                         plugin.onEvent(event);
@@ -102,17 +101,16 @@ export class DefaultViewer extends AbstractViewer {
                     }, () => {
                     }, () => {
                     }, () => {
-                    }, function () {
+                    }, function() {
                     }, (file: File) => {
                         this.loadModel(file);
                     }, () => {
                     });
                     filesInput.monitorElementForDragNDrop(this.templateManager.getCanvas()!);
-                })
+                });
             }
         }
 
-
         return super._onTemplatesLoaded();
     }
 
@@ -129,9 +127,9 @@ export class DefaultViewer extends AbstractViewer {
             this.templateManager.eventManager.registerCallback("navBar", (event: EventCallback) => {
                 const evt = event.event;
                 const element = <HTMLInputElement>(evt.target);
-                if (!this._currentAnimation) return;
+                if (!this._currentAnimation) { return; }
                 const gotoFrame = +element.value / 100 * this._currentAnimation.frames;
-                if (isNaN(gotoFrame)) return;
+                if (isNaN(gotoFrame)) { return; }
                 this._currentAnimation.goToFrame(gotoFrame);
             }, "input");
 
@@ -161,7 +159,7 @@ export class DefaultViewer extends AbstractViewer {
     private _handlePointerClick = (event: EventCallback) => {
 
         let pointerDown = <PointerEvent>event.event;
-        if (pointerDown.button !== 0) return;
+        if (pointerDown.button !== 0) { return; }
         var element = (<HTMLElement>event.event.target);
 
         if (!element) {
@@ -206,8 +204,9 @@ export class DefaultViewer extends AbstractViewer {
                     return;
                 }
                 var speed = element.dataset["value"];
-                if (speed)
-                    this._updateAnimationSpeed(speed);
+                if (speed) {
+                    this._updateAnimationSpeed(speed);
+                }
                 break;
             case "progress-wrapper":
                 this._resumePlay = !this._isAnimationPaused;
@@ -241,10 +240,10 @@ export class DefaultViewer extends AbstractViewer {
 
         this._isAnimationPaused = !this._isAnimationPaused;
 
-        if (noUiUpdate) return;
+        if (noUiUpdate) { return; }
 
         let navbar = this.templateManager.getTemplate('navBar');
-        if (!navbar) return;
+        if (!navbar) { return; }
 
         navbar.updateParams({
             paused: this._isAnimationPaused,
@@ -258,7 +257,7 @@ export class DefaultViewer extends AbstractViewer {
      */
     private _updateProgressBar = () => {
         let navbar = this.templateManager.getTemplate('navBar');
-        if (!navbar) return;
+        if (!navbar) { return; }
         var progressSlider = <HTMLInputElement>navbar.parent.querySelector("input.progress-wrapper");
         if (progressSlider && this._currentAnimation) {
             const progress = this._currentAnimation.currentFrame / this._currentAnimation.frames * 100;
@@ -281,12 +280,12 @@ export class DefaultViewer extends AbstractViewer {
         }
     }
 
-    /** 
+    /**
      * Update Current Animation Speed
      */
     private _updateAnimationSpeed = (speed: string, paramsObject?: any) => {
         let navbar = this.templateManager.getTemplate('navBar');
-        if (!navbar) return;
+        if (!navbar) { return; }
 
         if (speed && this._currentAnimation) {
             this._currentAnimation.speedRatio = parseFloat(speed);
@@ -295,7 +294,7 @@ export class DefaultViewer extends AbstractViewer {
             }
 
             if (paramsObject) {
-                paramsObject.selectedSpeed = speed + "x"
+                paramsObject.selectedSpeed = speed + "x";
             } else {
                 navbar.updateParams({
                     selectedSpeed: speed + "x",
@@ -304,12 +303,12 @@ export class DefaultViewer extends AbstractViewer {
         }
     }
 
-    /** 
+    /**
      * Update Current Animation Type
      */
     private _updateAnimationType = (data: { label: string, value: string }, paramsObject?: any) => {
         let navbar = this.templateManager.getTemplate('navBar');
-        if (!navbar) return;
+        if (!navbar) { return; }
 
         if (data) {
             this._currentAnimation = this.sceneManager.models[0].setCurrentAnimationByName(data.value);
@@ -364,15 +363,15 @@ export class DefaultViewer extends AbstractViewer {
         let fullscreenElement = this.fullscreenElement || viewerElement;
 
         if (fullscreenElement) {
-            let currentElement = document.fullscreenElement || document.webkitFullscreenElement || (<any>document).mozFullScreenElement || (<any>document).msFullscreenElement;
+            let currentElement = (<any>document).fullscreenElement || (<any>document).webkitFullscreenElement || (<any>document).mozFullScreenElement || (<any>document).msFullscreenElement;
             if (!currentElement) {
-                let requestFullScreen = fullscreenElement.requestFullscreen || fullscreenElement.webkitRequestFullscreen || (<any>fullscreenElement).msRequestFullscreen || (<any>fullscreenElement).mozRequestFullScreen;
+                let requestFullScreen = fullscreenElement.requestFullscreen || (<any>fullscreenElement).webkitRequestFullscreen || (<any>fullscreenElement).msRequestFullscreen || (<any>fullscreenElement).mozRequestFullScreen;
                 requestFullScreen.call(fullscreenElement);
                 if (viewerElement) {
                     viewerElement.classList.add("in-fullscreen");
                 }
             } else {
-                let exitFullscreen = document.exitFullscreen || document.webkitExitFullscreen || (<any>document).msExitFullscreen || (<any>document).mozCancelFullScreen
+                let exitFullscreen = document.exitFullscreen || (<any>document).webkitExitFullscreen || (<any>document).msExitFullscreen || (<any>document).mozCancelFullScreen;
                 exitFullscreen.call(document);
                 if (viewerElement) {
                     viewerElement.classList.remove("in-fullscreen");
@@ -385,9 +384,12 @@ export class DefaultViewer extends AbstractViewer {
      * Preparing the container element to present the viewer
      */
     protected _prepareContainerElement() {
-        this.containerElement.style.position = 'relative';
-        this.containerElement.style.height = '100%';
-        this.containerElement.style.display = 'flex';
+        const htmlElement = this.containerElement as HTMLElement;
+        if (htmlElement.style) {
+            htmlElement.style.position = 'relative';
+            htmlElement.style.height = '100%';
+            htmlElement.style.display = 'flex';
+        }
     }
 
     /**
@@ -397,7 +399,7 @@ export class DefaultViewer extends AbstractViewer {
      */
     protected _configureTemplate(model?: ViewerModel) {
         let navbar = this.templateManager.getTemplate('navBar');
-        if (!navbar) return;
+        if (!navbar) { return; }
 
         let newParams: any = navbar.configuration.params || {};
 
@@ -406,7 +408,7 @@ export class DefaultViewer extends AbstractViewer {
         } else {
 
             let animationNames = model.getAnimationNames();
-            newParams.animations = animationNames.map(a => { return { label: a, value: a } });
+            newParams.animations = animationNames.map((a) => { return { label: a, value: a }; });
             if (animationNames.length) {
                 this._isAnimationPaused = (model.configuration.animation && !model.configuration.animation.autoStart) || !model.configuration.animation;
                 this._animationList = animationNames;
@@ -424,7 +426,7 @@ export class DefaultViewer extends AbstractViewer {
             }
 
             if (model.configuration.thumbnail) {
-                newParams.logoImage = model.configuration.thumbnail
+                newParams.logoImage = model.configuration.thumbnail;
             }
         }
         navbar.updateParams(newParams, false);
@@ -472,9 +474,9 @@ export class DefaultViewer extends AbstractViewer {
      */
     public showOverlayScreen(subScreen: string) {
         let template = this.templateManager.getTemplate('overlay');
-        if (!template) return Promise.resolve('Overlay template not found');
+        if (!template) { return Promise.resolve('Overlay template not found'); }
 
-        return template.show((template => {
+        return template.show(((template) => {
 
             var canvasRect = this.containerElement.getBoundingClientRect();
 
@@ -487,7 +489,7 @@ export class DefaultViewer extends AbstractViewer {
             if (!subTemplate) {
                 return Promise.reject(subScreen + ' template not found');
             }
-            return subTemplate.show((template => {
+            return subTemplate.show(((template) => {
                 template.parent.style.display = 'flex';
                 return Promise.resolve(template);
             }));
@@ -499,14 +501,14 @@ export class DefaultViewer extends AbstractViewer {
      */
     public hideOverlayScreen() {
         let template = this.templateManager.getTemplate('overlay');
-        if (!template) return Promise.resolve('Overlay template not found');
+        if (!template) { return Promise.resolve('Overlay template not found'); }
 
-        return template.hide((template => {
+        return template.hide(((template) => {
             template.parent.style.opacity = "0";
             let onTransitionEnd = () => {
                 template.parent.removeEventListener("transitionend", onTransitionEnd);
                 template.parent.style.display = 'none';
-            }
+            };
             template.parent.addEventListener("transitionend", onTransitionEnd);
 
             let overlays = template.parent.querySelectorAll('.overlay');
@@ -522,25 +524,25 @@ export class DefaultViewer extends AbstractViewer {
 
     /**
      * show the viewer (in case it was hidden)
-     * 
+     *
      * @param visibilityFunction an optional function to execute in order to show the container
      */
     public show(visibilityFunction?: ((template: Template) => Promise<Template>)): Promise<Template> {
         let template = this.templateManager.getTemplate('main');
         //not possible, but yet:
-        if (!template) return Promise.reject('Main template not found');
+        if (!template) { return Promise.reject('Main template not found'); }
         return template.show(visibilityFunction);
     }
 
     /**
      * hide the viewer (in case it is visible)
-     * 
+     *
      * @param visibilityFunction an optional function to execute in order to hide the container
      */
     public hide(visibilityFunction?: ((template: Template) => Promise<Template>)) {
         let template = this.templateManager.getTemplate('main');
         //not possible, but yet:
-        if (!template) return Promise.reject('Main template not found');
+        if (!template) { return Promise.reject('Main template not found'); }
         return template.hide(visibilityFunction);
     }
 
@@ -550,9 +552,9 @@ export class DefaultViewer extends AbstractViewer {
      */
     public showLoadingScreen() {
         let template = this.templateManager.getTemplate('loadingScreen');
-        if (!template) return Promise.resolve('Loading Screen template not found');
+        if (!template) { return Promise.resolve('Loading Screen template not found'); }
 
-        return template.show((template => {
+        return template.show(((template) => {
 
             var canvasRect = this.containerElement.getBoundingClientRect();
             // var canvasPositioning = window.getComputedStyle(this.containerElement).position;
@@ -577,14 +579,14 @@ export class DefaultViewer extends AbstractViewer {
      */
     public hideLoadingScreen() {
         let template = this.templateManager.getTemplate('loadingScreen');
-        if (!template) return Promise.resolve('Loading Screen template not found');
+        if (!template) { return Promise.resolve('Loading Screen template not found'); }
 
-        return template.hide((template => {
+        return template.hide(((template) => {
             template.parent.style.opacity = "0";
             let onTransitionEnd = () => {
                 template.parent.removeEventListener("transitionend", onTransitionEnd);
                 template.parent.style.display = 'none';
-            }
+            };
             template.parent.addEventListener("transitionend", onTransitionEnd);
             return Promise.resolve(template);
         }));
@@ -659,7 +661,7 @@ export class DefaultViewer extends AbstractViewer {
                         lightTarget.subtractToRef(flashlight.position, flashlight.direction);
                     }
                 }
-            }
+            };
             this.sceneManager.scene.registerBeforeRender(updateFlashlightFunction);
             this._registeredOnBeforeRenderFunctions.push(updateFlashlightFunction);
         }

+ 29 - 34
Viewer/src/viewer/viewer.ts

@@ -13,7 +13,6 @@ import { ViewerModel } from '../model/viewerModel';
 import { TemplateManager } from '../templating/templateManager';
 import { viewerManager } from './viewerManager';
 
-
 /**
  * The AbstractViewr is the center of Babylon's viewer.
  * It is the basic implementation of the default viewer and is responsible of loading and showing the model and the templates
@@ -36,7 +35,7 @@ export abstract class AbstractViewer {
     public readonly baseId: string;
 
     /**
-     * The last loader used to load a model. 
+     * The last loader used to load a model.
      * @deprecated
      */
     public lastUsedLoader: ISceneLoaderPlugin | ISceneLoaderPluginAsync;
@@ -148,7 +147,6 @@ export abstract class AbstractViewer {
         return this._canvas;
     }
 
-
     /**
      * is this viewer disposed?
      */
@@ -175,7 +173,7 @@ export abstract class AbstractViewer {
         return this._configurationContainer;
     }
 
-    constructor(public containerElement: HTMLElement, initialConfiguration: ViewerConfiguration = {}) {
+    constructor(public containerElement: Element, initialConfiguration: ViewerConfiguration = {}) {
         // if exists, use the container id. otherwise, generate a random string.
         if (containerElement.id) {
             this.baseId = containerElement.id;
@@ -246,7 +244,7 @@ export abstract class AbstractViewer {
     }
 
     /**
-     * Get the configuration object. This is a reference only. 
+     * Get the configuration object. This is a reference only.
      * The configuration can ONLY be updated using the updateConfiguration function.
      * changing this object will have no direct effect on the scene.
      */
@@ -303,7 +301,7 @@ export abstract class AbstractViewer {
                 // set the height of the model to be what the user has configured, or floating by default
                 if (this.configuration.vr && this.configuration.vr.modelHeightCorrection !== undefined) {
                     if (typeof this.configuration.vr.modelHeightCorrection === 'number') {
-                        this._vrModelRepositioning = this.configuration.vr.modelHeightCorrection
+                        this._vrModelRepositioning = this.configuration.vr.modelHeightCorrection;
                     } else if (this.configuration.vr.modelHeightCorrection) {
                         this._vrModelRepositioning = this.sceneManager.vrHelper.currentVRCamera.position.y / 2;
                     } else {
@@ -355,7 +353,7 @@ export abstract class AbstractViewer {
             this.observablesManager.onExitingVRObservable.add(() => {
                 if (this._vrToggled) {
                     this._vrToggled = false;
-                    
+
                     // undo the scaling of the model
                     if (this.sceneManager.models.length) {
                         this.sceneManager.models[0].rootMesh.scaling.scaleInPlace(1 / this._vrScale);
@@ -379,7 +377,7 @@ export abstract class AbstractViewer {
                     this.canvas.removeAttribute("width");
                     this.engine.resize();
                 }
-            })
+            });
         }
 
         this._vrInit = true;
@@ -412,11 +410,11 @@ export abstract class AbstractViewer {
         }
         // TODO remove this after testing, as this is done in the updateConfiguration as well.
         if (this.configuration.loaderPlugins) {
-            Object.keys(this.configuration.loaderPlugins).forEach((name => {
+            Object.keys(this.configuration.loaderPlugins).forEach(((name) => {
                 if (this.configuration.loaderPlugins && this.configuration.loaderPlugins[name]) {
                     this.modelLoader.addPlugin(name);
                 }
-            }))
+            }));
         }
 
         this.templateManager = new TemplateManager(this.containerElement);
@@ -479,10 +477,10 @@ export abstract class AbstractViewer {
     /**
      * Update the current viewer configuration with new values.
      * Only provided information will be updated, old configuration values will be kept.
-     * If this.configuration was manually changed, you can trigger this function with no parameters, 
-     * and the entire configuration will be updated. 
+     * If this.configuration was manually changed, you can trigger this function with no parameters,
+     * and the entire configuration will be updated.
      * @param newConfiguration the partial configuration to update or a URL to a JSON holding the updated configuration
-     * 
+     *
      */
     public updateConfiguration(newConfiguration: Partial<ViewerConfiguration> | string = this.configuration) {
         if (typeof newConfiguration === "string") {
@@ -511,7 +509,7 @@ export abstract class AbstractViewer {
             }
 
             if (newConfiguration.loaderPlugins) {
-                Object.keys(newConfiguration.loaderPlugins).forEach((name => {
+                Object.keys(newConfiguration.loaderPlugins).forEach(((name) => {
                     if (newConfiguration.loaderPlugins && newConfiguration.loaderPlugins[name]) {
                         this.modelLoader.addPlugin(name);
                     }
@@ -567,8 +565,6 @@ export abstract class AbstractViewer {
 
         this._fpsTimeoutInterval && clearInterval(this._fpsTimeoutInterval);
 
-
-
         this.observablesManager.dispose();
 
         this.modelLoader.dispose();
@@ -589,7 +585,7 @@ export abstract class AbstractViewer {
     /**
      * This function will execute when the HTML templates finished initializing.
      * It should initialize the engine and continue execution.
-     * 
+     *
      * @returns {Promise<AbstractViewer>} The viewer object will be returned after the object was loaded.
      */
     protected _onTemplatesLoaded(): Promise<AbstractViewer> {
@@ -613,24 +609,24 @@ export abstract class AbstractViewer {
             }).then(() => {
                 this._initTelemetryEvents();
                 if (autoLoad) {
-                    return this.loadModel(this.configuration.model!).catch(() => { }).then(() => { return this.sceneManager.scene });
+                    return this.loadModel(this.configuration.model!).catch(() => { }).then(() => { return this.sceneManager.scene; });
                 } else {
                     return this.sceneManager.scene || this.sceneManager.initScene(this.configuration.scene);
                 }
             }).then(() => {
                 return this.onInitDoneObservable.notifyObserversWithPromise(this);
-            }).catch(e => {
+            }).catch((e) => {
                 Tools.Warn(e.toString());
                 return this;
             });
-        })
+        });
     }
 
     /**
      * Initialize the engine. Retruns a promise in case async calls are needed.
-     * 
+     *
      * @protected
-     * @returns {Promise<Engine>} 
+     * @returns {Promise<Engine>}
      * @memberof Viewer
      */
     protected _initEngine(): Promise<Engine> {
@@ -681,7 +677,7 @@ export abstract class AbstractViewer {
     /**
      * Initialize a model loading. The returned object (a ViewerModel object) will be loaded in the background.
      * The difference between this and loadModel is that loadModel will fulfill the promise when the model finished loading.
-     * 
+     *
      * @param modelConfig model configuration to use when loading the model.
      * @param clearScene should the scene be cleared before loading this model
      * @returns a ViewerModel object that is not yet fully loaded.
@@ -692,14 +688,14 @@ export abstract class AbstractViewer {
         if (typeof modelConfig === 'string') {
             configuration = {
                 url: modelConfig
-            }
+            };
         } else if (modelConfig instanceof File) {
             configuration = {
                 file: modelConfig,
                 root: "file:"
-            }
+            };
         } else {
-            configuration = modelConfig
+            configuration = modelConfig;
         }
 
         if (!configuration.url && !configuration.file) {
@@ -712,7 +708,7 @@ export abstract class AbstractViewer {
 
         //merge the configuration for future models:
         if (this.configuration.model && typeof this.configuration.model === 'object') {
-            let globalConfig = deepmerge({}, this.configuration.model)
+            let globalConfig = deepmerge({}, this.configuration.model);
             configuration = deepmerge(globalConfig, configuration);
             if (modelConfig instanceof File) {
                 configuration.file = modelConfig;
@@ -745,10 +741,10 @@ export abstract class AbstractViewer {
      * load a model using the provided configuration.
      * This function, as opposed to initModel, will return a promise that resolves when the model is loaded, and rejects with error.
      * If you want to attach to the observables of the model, use initModle instead.
-     * 
+     *
      * @param modelConfig the model configuration or URL to load.
      * @param clearScene Should the scene be cleared before loading the model
-     * @returns a Promise the fulfills when the model finished loading successfully. 
+     * @returns a Promise the fulfills when the model finished loading successfully.
      */
     public loadModel(modelConfig: string | File | IModelConfiguration, clearScene: boolean = true): Promise<ViewerModel> {
         if (this._isLoading) {
@@ -757,7 +753,7 @@ export abstract class AbstractViewer {
         }
 
         return Promise.resolve(this.sceneManager.scene).then((scene) => {
-            if (!scene) return this.sceneManager.initScene(this.configuration.scene, this.configuration.optimizer);
+            if (!scene) { return this.sceneManager.initScene(this.configuration.scene, this.configuration.optimizer); }
             return scene;
         }).then(() => {
             let model = this.initModel(modelConfig, clearScene);
@@ -770,12 +766,11 @@ export abstract class AbstractViewer {
                     reject(error);
                 });
             });
-        })
+        });
     }
 
     private _fpsTimeoutInterval: number;
 
-
     protected _initTelemetryEvents() {
         telemetryManager.broadcast("Engine Capabilities", this.baseId, this.engine.getCaps());
         telemetryManager.broadcast("Platform Details", this.baseId, {
@@ -804,13 +799,13 @@ export abstract class AbstractViewer {
             return;
         }
         if (customShaders.shaders) {
-            Object.keys(customShaders.shaders).forEach(key => {
+            Object.keys(customShaders.shaders).forEach((key) => {
                 // typescript considers a callback "unsafe", so... '!'
                 Effect.ShadersStore[key] = customShaders!.shaders![key];
             });
         }
         if (customShaders.includes) {
-            Object.keys(customShaders.includes).forEach(key => {
+            Object.keys(customShaders.includes).forEach((key) => {
                 // typescript considers a callback "unsafe", so... '!'
                 Effect.IncludesShadersStore[key] = customShaders!.includes![key];
             });

+ 2 - 2
Viewer/src/viewer/viewerManager.ts

@@ -75,7 +75,7 @@ export class ViewerManager {
      */
     public getViewerPromiseById(id: string): Promise<AbstractViewer> {
         return new Promise((resolve, reject) => {
-            let localViewer = this.getViewerById(id)
+            let localViewer = this.getViewerById(id);
             if (localViewer) {
                 return resolve(localViewer);
             }
@@ -84,7 +84,7 @@ export class ViewerManager {
                     resolve(viewer);
                     this.onViewerAddedObservable.removeCallback(viewerFunction);
                 }
-            }
+            };
             this.onViewerAddedObservable.add(viewerFunction);
         });
     }

+ 5 - 5
Viewer/tests/commons/boot.ts

@@ -12,12 +12,12 @@ export class Boot {
         document.body.innerHTML = `<div id="result-div"></div><div id="working-div"></div>`;
 
         //register actions to occur before each test
-        beforeEach(function (done) {
+        beforeEach(function(done) {
             // tslint:disable-next-line:no-console
             //console.debug('> Executing "' + details.name + '"');
 
             //clear DOM and create canvas and container
-            document.getElementById('working-div')!.innerHTML = `<div style="font-size:30px;">WORKING CANVASES.</div> 
+            document.getElementById('working-div')!.innerHTML = `<div style="font-size:30px;">WORKING CANVASES.</div>
 				<div id="viewer-testing" style="width:512px;height:512px;">
                     <div id="renderCanvas" width="512" height="512" style="width:512px;height:512px;">
                     <canvas width="512" height="512" style="width:512px;height:512px;"></canvas></div>
@@ -53,8 +53,8 @@ export class Boot {
 
             viewerGlobals.disableInit = true;
 
-            var DOMContentLoaded_event = document.createEvent("Event")
-            DOMContentLoaded_event.initEvent("DOMContentLoaded", true, true)
+            var DOMContentLoaded_event = document.createEvent("Event");
+            DOMContentLoaded_event.initEvent("DOMContentLoaded", true, true);
             window.document.dispatchEvent(DOMContentLoaded_event);
 
             // Disable Webgl2 support in test mode for Phantom/IE compatibility.
@@ -62,7 +62,7 @@ export class Boot {
             done();
         });
 
-        afterEach(function (done) {
+        afterEach(function(done) {
             Helper.disposeViewer();
             //(<any>window).BabylonViewer.disposeAll();
             done();

+ 13 - 13
Viewer/tests/commons/helper.ts

@@ -80,9 +80,9 @@ export class Helper {
     }
 
     public static MockScreenCapture(viewer: AbstractViewer, data) {
-        BABYLON.Tools.CreateScreenshot = function (viewer, camera, size, successCallback) {
+        BABYLON.Tools.CreateScreenshot = function(viewer, camera, size, successCallback) {
             successCallback && successCallback(data || '');
-        }
+        };
     }
 
     public static MockModelAnimation(model: ViewerModel, name: string) {
@@ -137,7 +137,7 @@ export class NullEngineAbstractViewer extends AbstractViewer {
 
         this.engine.getRenderingCanvas = () => {
             return this.canvas;
-        }
+        };
 
         this.sceneManager = new SceneManager(this.engine, this.configurationContainer, this.observablesManager);
 
@@ -153,9 +153,9 @@ export class NullEngineAbstractViewer extends AbstractViewer {
             this.engine.setHardwareScalingLevel(scale);
         }
 
-        this.engine.createCubeTexture = <any>function () { };
+        this.engine.createCubeTexture = <any>function() { };
 
-        this.engine.dispose = function () { };
+        this.engine.dispose = function() { };
 
         return Promise.resolve(this.engine);
     }
@@ -179,7 +179,7 @@ export class NullEngineDefaultViewer extends DefaultViewer {
         this.engine = new BABYLON.NullEngine(config.engineOptions);
         this.engine.getRenderingCanvas = () => {
             return this.canvas;
-        }
+        };
 
         this.sceneManager = new SceneManager(this.engine, this.configurationContainer, this.observablesManager);
 
@@ -195,9 +195,9 @@ export class NullEngineDefaultViewer extends DefaultViewer {
             this.engine.setHardwareScalingLevel(scale);
         }
 
-        this.engine.createCubeTexture = <any>function () { };
+        this.engine.createCubeTexture = <any>function() { };
 
-        this.engine.dispose = function () { };
+        this.engine.dispose = function() { };
 
         return Promise.resolve(this.engine);
     }
@@ -218,22 +218,22 @@ class ModelAnimationMock implements IModelAnimation {
     public playMode = AnimationPlayMode.ONCE;
 
     constructor(public name: string) {
-        this.state = AnimationState.INIT
+        this.state = AnimationState.INIT;
     }
 
     public reset() {
         this.currentFrame = 0;
-        this.state = AnimationState.STOPPED
+        this.state = AnimationState.STOPPED;
     }
     public restart() {
         this.goToFrame(0);
     }
 
     public start() {
-        this.state = AnimationState.PLAYING
+        this.state = AnimationState.PLAYING;
     }
     public stop() {
-        this.state = AnimationState.STOPPED
+        this.state = AnimationState.STOPPED;
     }
     public dispose() {
 
@@ -242,6 +242,6 @@ class ModelAnimationMock implements IModelAnimation {
         this.currentFrame = frame;
     }
     public pause() {
-        this.state = AnimationState.PAUSED
+        this.state = AnimationState.PAUSED;
     }
 }

+ 139 - 139
Viewer/tests/commons/mockWebGL.ts

@@ -8,7 +8,7 @@ export default function webglSupport() {
 
     //mock webgl support
     (<any>HTMLCanvasElement.prototype)._getContext = HTMLCanvasElement.prototype.getContext;
-    HTMLCanvasElement.prototype.getContext = function (ctxName, options) {
+    HTMLCanvasElement.prototype.getContext = function(ctxName, options) {
         //patch in mock webgl
         switch (ctxName) {
             case 'webgl':
@@ -441,143 +441,143 @@ export default function webglSupport() {
         drawingBufferWidth: 0,
         drawingBufferHeight: 0,
 
-        getContextAttributes: function () { return {}; },
-        isContextLost: function () { return {}; },
-        getSupportedExtensions: function () { return {}; },
-        getExtension: function (name) { return name === "EXT_texture_filter_anisotropic" ? {} : null; },
-        activeTexture: function () { return {}; },
-        attachShader: function () { return {}; },
-        bindAttribLocation: function () { return {}; },
-        bindBuffer: function () { return {}; },
-        bindFramebuffer: function () { return {}; },
-        bindRenderbuffer: function () { return {}; },
-        bindTexture: function () { return {}; },
-        blendColor: function () { return {}; },
-        blendEquation: function () { return {}; },
-        blendEquationSeparate: function () { return {}; },
-        blendFunc: function () { return {}; },
-        blendFuncSeparate: function () { return {}; },
-        bufferData: function () { return {}; },
-        bufferSubData: function () { return {}; },
-        checkFramebufferStatus: function () { return {}; },
-        clear: function () { return {}; },
-        clearColor: function () { return {}; },
-        clearDepth: function () { return {}; },
-        clearStencil: function () { return {}; },
-        colorMask: function () { return {}; },
-        compileShader: function () { return {}; },
-        compressedTexImage2D: function () { return {}; },
-        compressedTexSubImage2D: function () { return {}; },
-        copyTexImage2D: function () { return {}; },
-        copyTexSubImage2D: function () { return {}; },
-        createBuffer: function () { return {}; },
-        createFramebuffer: function () { return {}; },
-        createProgram: function () { return {}; },
-        createRenderbuffer: function () { return {}; },
-        createShader: function () { return {}; },
-        createTexture: function () { return {}; },
-        cullFace: function () { return {}; },
-        deleteBuffer: function () { return {}; },
-        deleteFramebuffer: function () { return {}; },
-        deleteProgram: function () { return {}; },
-        deleteRenderbuffer: function () { return {}; },
-        deleteShader: function () { return {}; },
-        deleteTexture: function () { return {}; },
-        depthFunc: function () { return {}; },
-        depthMask: function () { return {}; },
-        depthRange: function () { return {}; },
-        detachShader: function () { return {}; },
-        disable: function () { return {}; },
-        disableVertexAttribArray: function () { return {}; },
-        drawArrays: function () { return {}; },
-        drawElements: function () { return {}; },
-        enable: function () { return {}; },
-        enableVertexAttribArray: function () { return {}; },
-        finish: function () { return {}; },
-        flush: function () { return {}; },
-        framebufferRenderbuffer: function () { return {}; },
-        framebufferTexture2D: function () { return {}; },
-        frontFace: function () { return {}; },
-        generateMipmap: function () { return {}; },
-        getActiveAttrib: function () { return {}; },
-        getActiveUniform: function () { return {}; },
-        getAttachedShaders: function () { return {}; },
-        getAttribLocation: function () { return {}; },
-        getBufferParameter: function () { return {}; },
-        getParameter: function () { return 256; },
-        getError: function () { return 0; },
-        getFramebufferAttachmentParameter: function () { return {}; },
-        getProgramParameter: function () { return {}; },
-        getProgramInfoLog: function () { return {}; },
-        getRenderbufferParameter: function () { return {}; },
-        getShaderParameter: function () { return {}; },
-        getShaderPrecisionFormat: function () { return {}; },
-        getShaderInfoLog: function () { return {}; },
-        getShaderSource: function () { return {}; },
-        getTexParameter: function () { return {}; },
-        getUniform: function () { return {}; },
-        getUniformLocation: function () { return {}; },
-        getVertexAttrib: function () { return {}; },
-        getVertexAttribOffset: function () { return {}; },
-        hint: function () { return {}; },
-        isBuffer: function () { return {}; },
-        isEnabled: function () { return {}; },
-        isFramebuffer: function () { return {}; },
-        isProgram: function () { return {}; },
-        isRenderbuffer: function () { return {}; },
-        isShader: function () { return {}; },
-        isTexture: function () { return {}; },
-        lineWidth: function () { return {}; },
-        linkProgram: function () { return {}; },
-        pixelStorei: function () { return {}; },
-        polygonOffset: function () { return {}; },
-        readPixels: function () { return {}; },
-        renderbufferStorage: function () { return {}; },
-        sampleCoverage: function () { return {}; },
-        scissor: function () { return {}; },
-        shaderSource: function () { return {}; },
-        stencilFunc: function () { return {}; },
-        stencilFuncSeparate: function () { return {}; },
-        stencilMask: function () { return {}; },
-        stencilMaskSeparate: function () { return {}; },
-        stencilOp: function () { return {}; },
-        stencilOpSeparate: function () { return {}; },
-        texImage2D: function () { return {}; },
-        texImage3D: function () { return {}; },
-        texParameterf: function () { return {}; },
-        texParameteri: function () { return {}; },
-        texSubImage2D: function () { return {}; },
-        uniform1f: function () { return {}; },
-        uniform1fv: function () { return {}; },
-        uniform1i: function () { return {}; },
-        uniform1iv: function () { return {}; },
-        uniform2f: function () { return {}; },
-        uniform2fv: function () { return {}; },
-        uniform2i: function () { return {}; },
-        uniform2iv: function () { return {}; },
-        uniform3f: function () { return {}; },
-        uniform3fv: function () { return {}; },
-        uniform3i: function () { return {}; },
-        uniform3iv: function () { return {}; },
-        uniform4f: function () { return {}; },
-        uniform4fv: function () { return {}; },
-        uniform4i: function () { return {}; },
-        uniform4iv: function () { return {}; },
-        uniformMatrix2fv: function () { return {}; },
-        uniformMatrix3fv: function () { return {}; },
-        uniformMatrix4fv: function () { return {}; },
-        useProgram: function () { return {}; },
-        validateProgram: function () { return {}; },
-        vertexAttrib1f: function () { return {}; },
-        vertexAttrib1fv: function () { return {}; },
-        vertexAttrib2f: function () { return {}; },
-        vertexAttrib2fv: function () { return {}; },
-        vertexAttrib3f: function () { return {}; },
-        vertexAttrib3fv: function () { return {}; },
-        vertexAttrib4f: function () { return {}; },
-        vertexAttrib4fv: function () { return {}; },
-        vertexAttribPointer: function () { return {}; },
-        viewport: function () { return {}; }
-    }
+        getContextAttributes: function() { return {}; },
+        isContextLost: function() { return {}; },
+        getSupportedExtensions: function() { return {}; },
+        getExtension: function(name) { return name === "EXT_texture_filter_anisotropic" ? {} : null; },
+        activeTexture: function() { return {}; },
+        attachShader: function() { return {}; },
+        bindAttribLocation: function() { return {}; },
+        bindBuffer: function() { return {}; },
+        bindFramebuffer: function() { return {}; },
+        bindRenderbuffer: function() { return {}; },
+        bindTexture: function() { return {}; },
+        blendColor: function() { return {}; },
+        blendEquation: function() { return {}; },
+        blendEquationSeparate: function() { return {}; },
+        blendFunc: function() { return {}; },
+        blendFuncSeparate: function() { return {}; },
+        bufferData: function() { return {}; },
+        bufferSubData: function() { return {}; },
+        checkFramebufferStatus: function() { return {}; },
+        clear: function() { return {}; },
+        clearColor: function() { return {}; },
+        clearDepth: function() { return {}; },
+        clearStencil: function() { return {}; },
+        colorMask: function() { return {}; },
+        compileShader: function() { return {}; },
+        compressedTexImage2D: function() { return {}; },
+        compressedTexSubImage2D: function() { return {}; },
+        copyTexImage2D: function() { return {}; },
+        copyTexSubImage2D: function() { return {}; },
+        createBuffer: function() { return {}; },
+        createFramebuffer: function() { return {}; },
+        createProgram: function() { return {}; },
+        createRenderbuffer: function() { return {}; },
+        createShader: function() { return {}; },
+        createTexture: function() { return {}; },
+        cullFace: function() { return {}; },
+        deleteBuffer: function() { return {}; },
+        deleteFramebuffer: function() { return {}; },
+        deleteProgram: function() { return {}; },
+        deleteRenderbuffer: function() { return {}; },
+        deleteShader: function() { return {}; },
+        deleteTexture: function() { return {}; },
+        depthFunc: function() { return {}; },
+        depthMask: function() { return {}; },
+        depthRange: function() { return {}; },
+        detachShader: function() { return {}; },
+        disable: function() { return {}; },
+        disableVertexAttribArray: function() { return {}; },
+        drawArrays: function() { return {}; },
+        drawElements: function() { return {}; },
+        enable: function() { return {}; },
+        enableVertexAttribArray: function() { return {}; },
+        finish: function() { return {}; },
+        flush: function() { return {}; },
+        framebufferRenderbuffer: function() { return {}; },
+        framebufferTexture2D: function() { return {}; },
+        frontFace: function() { return {}; },
+        generateMipmap: function() { return {}; },
+        getActiveAttrib: function() { return {}; },
+        getActiveUniform: function() { return {}; },
+        getAttachedShaders: function() { return {}; },
+        getAttribLocation: function() { return {}; },
+        getBufferParameter: function() { return {}; },
+        getParameter: function() { return 256; },
+        getError: function() { return 0; },
+        getFramebufferAttachmentParameter: function() { return {}; },
+        getProgramParameter: function() { return {}; },
+        getProgramInfoLog: function() { return {}; },
+        getRenderbufferParameter: function() { return {}; },
+        getShaderParameter: function() { return {}; },
+        getShaderPrecisionFormat: function() { return {}; },
+        getShaderInfoLog: function() { return {}; },
+        getShaderSource: function() { return {}; },
+        getTexParameter: function() { return {}; },
+        getUniform: function() { return {}; },
+        getUniformLocation: function() { return {}; },
+        getVertexAttrib: function() { return {}; },
+        getVertexAttribOffset: function() { return {}; },
+        hint: function() { return {}; },
+        isBuffer: function() { return {}; },
+        isEnabled: function() { return {}; },
+        isFramebuffer: function() { return {}; },
+        isProgram: function() { return {}; },
+        isRenderbuffer: function() { return {}; },
+        isShader: function() { return {}; },
+        isTexture: function() { return {}; },
+        lineWidth: function() { return {}; },
+        linkProgram: function() { return {}; },
+        pixelStorei: function() { return {}; },
+        polygonOffset: function() { return {}; },
+        readPixels: function() { return {}; },
+        renderbufferStorage: function() { return {}; },
+        sampleCoverage: function() { return {}; },
+        scissor: function() { return {}; },
+        shaderSource: function() { return {}; },
+        stencilFunc: function() { return {}; },
+        stencilFuncSeparate: function() { return {}; },
+        stencilMask: function() { return {}; },
+        stencilMaskSeparate: function() { return {}; },
+        stencilOp: function() { return {}; },
+        stencilOpSeparate: function() { return {}; },
+        texImage2D: function() { return {}; },
+        texImage3D: function() { return {}; },
+        texParameterf: function() { return {}; },
+        texParameteri: function() { return {}; },
+        texSubImage2D: function() { return {}; },
+        uniform1f: function() { return {}; },
+        uniform1fv: function() { return {}; },
+        uniform1i: function() { return {}; },
+        uniform1iv: function() { return {}; },
+        uniform2f: function() { return {}; },
+        uniform2fv: function() { return {}; },
+        uniform2i: function() { return {}; },
+        uniform2iv: function() { return {}; },
+        uniform3f: function() { return {}; },
+        uniform3fv: function() { return {}; },
+        uniform3i: function() { return {}; },
+        uniform3iv: function() { return {}; },
+        uniform4f: function() { return {}; },
+        uniform4fv: function() { return {}; },
+        uniform4i: function() { return {}; },
+        uniform4iv: function() { return {}; },
+        uniformMatrix2fv: function() { return {}; },
+        uniformMatrix3fv: function() { return {}; },
+        uniformMatrix4fv: function() { return {}; },
+        useProgram: function() { return {}; },
+        validateProgram: function() { return {}; },
+        vertexAttrib1f: function() { return {}; },
+        vertexAttrib1fv: function() { return {}; },
+        vertexAttrib2f: function() { return {}; },
+        vertexAttrib2fv: function() { return {}; },
+        vertexAttrib3f: function() { return {}; },
+        vertexAttrib3fv: function() { return {}; },
+        vertexAttrib4f: function() { return {}; },
+        vertexAttrib4fv: function() { return {}; },
+        vertexAttribPointer: function() { return {}; },
+        viewport: function() { return {}; }
+    };
 
 }

+ 2 - 2
Viewer/tests/unit/src/configuration/mappers.ts

@@ -73,9 +73,9 @@ describe("Configuration mappers", () => {
             map: (rawSource) => {
                 return {
                     version: randomVersion
-                }
+                };
             }
-        }
+        };
 
         console.log("Next error log is expected");
 

+ 15 - 15
Viewer/tests/unit/src/configuration/updateConfiguration.ts

@@ -24,17 +24,17 @@ describe(name + " scene", () => {
             scene.debugLayer.show = () => {
                 showCalled++;
                 isVisible = true;
-            }
+            };
 
             scene.debugLayer.hide = () => {
                 hideCalled++;
                 isVisible = false;
-            }
+            };
 
             scene.debugLayer.isVisible = () => {
                 return isVisible;
-            }
-        })
+            };
+        });
         viewer.onInitDoneObservable.add(() => {
             // assert.isUndefined(viewer.configuration.scene);
             assert.equal(showCalled, 0);
@@ -107,7 +107,7 @@ describe(name + " scene", () => {
                 assert.fail(viewer.sceneManager.scene.imageProcessingConfiguration.colorCurves, {}, "color curves was not initialized");
             }
 
-            let randoms = [0, 1, 2, 3, 4].map(n => Math.random());
+            let randoms = [0, 1, 2, 3, 4].map((n) => Math.random());
 
             viewer.updateConfiguration({
                 scene: {
@@ -267,20 +267,20 @@ describe(name + " scene optimizer", () => {
         let optimizerFunction = BABYLON.SceneOptimizer;
 
         //mock!
-        (<any>BABYLON.SceneOptimizer) = function () {
+        (<any>BABYLON.SceneOptimizer) = function() {
             constructed = true;
-        }
+        };
 
-        BABYLON.SceneOptimizer.prototype.start = function () {
+        BABYLON.SceneOptimizer.prototype.start = function() {
             started = true;
-        }
+        };
 
-        BABYLON.SceneOptimizer.prototype.stop = function () {
+        BABYLON.SceneOptimizer.prototype.stop = function() {
             started = false;
-        }
+        };
 
-        BABYLON.SceneOptimizer.prototype.dispose = function () {
-        }
+        BABYLON.SceneOptimizer.prototype.dispose = function() {
+        };
 
         viewer.onInitDoneObservable.add(() => {
 
@@ -337,5 +337,5 @@ describe(name + " camera", () => {
             viewer.dispose();
             done();
         });
-    })
-})
+    });
+});

+ 4 - 4
Viewer/tests/unit/src/helper.ts

@@ -23,7 +23,7 @@ describe("viewer helper", () => {
     it("should find absolute and relative http urls", (done) => {
 
         let url = "http://test.url/?param=123";
-        let https = "https://https.url.to.check/"
+        let https = "https://https.url.to.check/";
         let relativeUrl = "/url/to/find";
         let notUrl = "not a url!";
         let ftp = "ftp://test.ftp.server";
@@ -47,10 +47,10 @@ describe("viewer helper", () => {
                 r: 0,
                 g: 0
             },
-            test: function () {
+            test: function() {
 
             }
-        }
+        };
 
         let augmentation: any = {
             definedKey: finalKey,
@@ -61,7 +61,7 @@ describe("viewer helper", () => {
             },
             undefinedKey: "shouldNotBeAugmented",
             test: "should be ignored"
-        }
+        };
 
         assert.notEqual(toAugoment.definedKey, augmentation.definedKey);
 

+ 1 - 1
Viewer/tests/unit/src/index.ts

@@ -9,4 +9,4 @@ import './configuration/loader';
 import './helper';
 import './configuration/updateConfiguration';
 import './viewer/sceneManager';
-export * from '../../../src'
+export * from '../../../src';

+ 4 - 6
Viewer/tests/unit/src/viewer/sceneManager.ts

@@ -4,7 +4,7 @@ import { DefaultViewer, AbstractViewer, Version, viewerManager } from "../../../
 
 export let name = "scene manager";
 
-describe(name, function () {
+describe(name, function() {
 
     it("should be initialized when an engine is created", (done) => {
         let viewer = Helper.getNewViewerInstance();
@@ -16,7 +16,7 @@ describe(name, function () {
             viewer.dispose();
             done();
         });
-    })
+    });
 
     it("should have objects initialized after init", (done) => {
         let viewer = Helper.getNewViewerInstance();
@@ -28,7 +28,7 @@ describe(name, function () {
             assert.isDefined(viewer.sceneManager.mainColor);
             assert.isDefined(viewer.sceneManager.reflectionColor);
             // default is white
-            ["r", "g", "b"].forEach(l => {
+            ["r", "g", "b"].forEach((l) => {
                 assert.equal(viewer.sceneManager.mainColor[l], 1);
                 assert.equal(viewer.sceneManager.reflectionColor[l], 1);
             });
@@ -65,8 +65,6 @@ describe(name, function () {
                 sceneInitCalled = true;
             });
 
-
-
             let update = (str: string, data) => {
                 if (s.indexOf(str) !== -1) {
                     assert.fail(false, true, str + " observer already called");
@@ -75,7 +73,7 @@ describe(name, function () {
                     s.push(str);
                     return true;
                 }
-            }
+            };
 
             viewer.sceneManager.onCameraConfiguredObservable.add(update.bind(null, "camera"));
             viewer.sceneManager.onLightsConfiguredObservable.add(update.bind(null, "light"));

+ 12 - 12
Viewer/tests/unit/src/viewer/viewer.ts

@@ -8,7 +8,7 @@ export let name = "viewer Tests";
  * To prevent test-state-leakage ensure that there is a viewer.dispose() for every new DefaultViewer
  */
 
-describe('Viewer', function () {
+describe('Viewer', function() {
     it('should initialize a new viewer and its internal variables', (done) => {
         let viewer = Helper.getNewViewerInstance();
         assert.isDefined(viewer.baseId, "base id should be defined");
@@ -45,7 +45,7 @@ describe('Viewer', function () {
             // force typescript to "think" that the element exist with "!"
             let viewer = Helper.getNewViewerInstance(document.getElementById('doesntexist')!);
             expect(viewer).not.to.exist;
-            if (viewer) viewer.dispose();
+            if (viewer) { viewer.dispose(); }
         } catch (e) {
             // exception was thrown, we are happy
             assert.isTrue(true);
@@ -57,13 +57,14 @@ describe('Viewer', function () {
         let viewer: DefaultViewer = <DefaultViewer>Helper.getNewViewerInstance();
         viewer.onInitDoneObservable.add(() => {
             // default visibility is not none
-            expect(viewer.containerElement.style.display).not.to.equal('none');
+            const htmlElement = viewer.containerElement as HTMLElement;
+            expect(htmlElement.style.display).not.to.equal('none');
             viewer.hide().then(() => {
                 // element is hidden
-                assert.equal(viewer.containerElement.style.display, 'none', "Viewer is still visible");
+                assert.equal(htmlElement.style.display, 'none', "Viewer is still visible");
                 viewer.show().then(() => {
                     //element is shown
-                    assert.notEqual(viewer.containerElement.style.display, 'none', "Viewer is not visible");
+                    assert.notEqual(htmlElement.style.display, 'none', "Viewer is not visible");
                     viewer.dispose();
                     done();
                 });
@@ -100,13 +101,13 @@ describe('Viewer', function () {
                 renderCount++;
             });
             assert.equal(renderCount, 0);
-            window.requestAnimationFrame(function () {
+            window.requestAnimationFrame(function() {
                 assert.equal(renderCount, 1, "render loop should have been executed");
                 viewer.runRenderLoop = false;
-                window.requestAnimationFrame(function () {
+                window.requestAnimationFrame(function() {
                     assert.equal(renderCount, 1, "Render loop should not have been executed");
                     viewer.runRenderLoop = true;
-                    window.requestAnimationFrame(function () {
+                    window.requestAnimationFrame(function() {
                         assert.equal(renderCount, 2, "render loop should have been executed again");
                         viewer.dispose();
                         done();
@@ -131,7 +132,7 @@ describe('Viewer', function () {
             // mock the resize function
             engine.resize = () => {
                 resizeCount++;
-            }
+            };
         });
 
         viewer.onInitDoneObservable.add(() => {
@@ -213,7 +214,7 @@ describe('Viewer', function () {
         viewer.onInitDoneObservable.add(() => {
             Helper.MockScreenCapture(viewer, Helper.mockScreenCaptureData());
 
-            viewer.takeScreenshot(function (data) {
+            viewer.takeScreenshot(function(data) {
                 assert.equal(data, Helper.mockScreenCaptureData(), "Screenshot failed.");
 
                 viewer.dispose();
@@ -240,7 +241,7 @@ describe('Viewer', function () {
 
         viewer.onSceneInitObservable.add((scene) => {
             assert.equal(scene, viewer.sceneManager.scene, "scene instance is not the same");
-        })
+        });
 
         viewer.onInitDoneObservable.add((viewerInstance) => {
             assert.isDefined(viewerInstance.sceneManager.scene, "scene is not defined");
@@ -310,7 +311,6 @@ describe('Viewer', function () {
 //}
 /*
 
-
 QUnit.test('Viewer disable ctrl for panning', function (assert) {
     let viewer = new DefaultViewer(Helper.getCanvas());
 

+ 2 - 2
Viewer/tests/unit/src/viewer/viewerManager.ts

@@ -4,7 +4,7 @@ import { DefaultViewer, AbstractViewer, Version, viewerManager } from "../../../
 
 export let name = "viewer manager tests";
 
-describe('Viewer Manager', function () {
+describe('Viewer Manager', function() {
     it("should be defined when the library is loaded", (done) => {
         assert.isDefined(viewerManager, "viewerManager is not defined");
         done();
@@ -78,7 +78,7 @@ describe('Viewer Manager', function () {
         viewer.dispose = () => {
             dispose.call(viewer);
             done();
-        }
+        };
 
         viewerManager.dispose();
 

+ 44 - 44
Viewer/tests/validation/index.html

@@ -1,55 +1,55 @@
 <!DOCTYPE html>
 <html>
 
-    <head>
-        <title>BabylonJS - Build validation page</title>
-        <link href="index.css" rel="stylesheet" />
-        <script src="https://preview.babylonjs.com/draco_decoder.js"></script>
-    </head>
-
-    <body>
-        <script>
-            /*BABYLONDEVTOOLS.Loader.require('validation.js')
-                .load(function() {*/
-            // Loading tests
-            var xhr = new XMLHttpRequest();
-
-            xhr.open("GET", "config.json", true);
-
-            xhr.addEventListener("load", function () {
-                if (xhr.status === 200) {
-
-                    config = JSON.parse(xhr.responseText);
-
-                    // Run tests
-                    var index = 0;
-                    if (window.location.search) {
-                        justOnce = true;
-                        var title = window.location.search.replace("?", "").replace(/%20/g, " ");
-                        for (var index = 0; index < config.tests.length; index++) {
-                            if (config.tests[index].title === title) {
-                                break;
-                            }
+<head>
+    <title>BabylonJS - Build validation page</title>
+    <link href="index.css" rel="stylesheet" />
+    <script src="https://preview.babylonjs.com/draco_decoder_gltf.js"></script>
+</head>
+
+<body>
+    <script>
+        /*BABYLONDEVTOOLS.Loader.require('validation.js')
+            .load(function() {*/
+        // Loading tests
+        var xhr = new XMLHttpRequest();
+
+        xhr.open("GET", "config.json", true);
+
+        xhr.addEventListener("load", function () {
+            if (xhr.status === 200) {
+
+                config = JSON.parse(xhr.responseText);
+
+                // Run tests
+                var index = 0;
+                if (window.location.search) {
+                    justOnce = true;
+                    var title = window.location.search.replace("?", "").replace(/%20/g, " ");
+                    for (var index = 0; index < config.tests.length; index++) {
+                        if (config.tests[index].title === title) {
+                            break;
                         }
                     }
+                }
 
-                    var recursiveRunTest = function (i) {
-                        runTest(i, function () {
-                            i++;
-                            if (justOnce || i >= config.tests.length) {
-                                return;
-                            }
-                            recursiveRunTest(i);
-                        });
-                    }
-
-                    recursiveRunTest(index);
+                var recursiveRunTest = function (i) {
+                    runTest(i, function () {
+                        i++;
+                        if (justOnce || i >= config.tests.length) {
+                            return;
+                        }
+                        recursiveRunTest(i);
+                    });
                 }
-            }, false);
 
-            xhr.send();
+                recursiveRunTest(index);
+            }
+        }, false);
+
+        xhr.send();
 			//});
-        </script>
-    </body>
+    </script>
+</body>
 
 </html>

文件差异内容过多而无法显示
+ 31206 - 16752
dist/babylon.d.ts


文件差异内容过多而无法显示
+ 1 - 60
dist/babylon.js


文件差异内容过多而无法显示
+ 39130 - 19469
dist/babylon.max.js


文件差异内容过多而无法显示
+ 39130 - 19469
dist/babylon.no-module.max.js


文件差异内容过多而无法显示
+ 1 - 62
dist/babylon.worker.js


文件差异内容过多而无法显示
+ 8 - 8
dist/draco_decoder_gltf.js


二进制
dist/draco_decoder_gltf.wasm


文件差异内容过多而无法显示
+ 112 - 126
dist/draco_wasm_wrapper_gltf.js


+ 0 - 0
dist/es6.js


部分文件因为文件数量过多而无法显示