David Catuhe 7 lat temu
rodzic
commit
b14cbea3ee
100 zmienionych plików z 27004 dodań i 26829 usunięć
  1. 12888 12888
      Playground/babylon.d.txt
  2. 3 2
      Tools/Gulp/config.json
  3. 89 89
      Tools/Gulp/gulpfile.js
  4. 9 9
      Viewer/src/configuration/configuration.ts
  5. 6 6
      Viewer/src/configuration/configurationCompatibility.ts
  6. 4 4
      Viewer/src/configuration/interfaces/modelConfiguration.ts
  7. 1 1
      Viewer/src/configuration/interfaces/sceneOptimizerConfiguration.ts
  8. 2 3
      Viewer/src/configuration/interfaces/templateConfiguration.ts
  9. 1 1
      Viewer/src/configuration/interfaces/vrConfiguration.ts
  10. 12 10
      Viewer/src/configuration/loader.ts
  11. 12 13
      Viewer/src/configuration/mappers.ts
  12. 1 1
      Viewer/src/configuration/types/default.ts
  13. 1 1
      Viewer/src/configuration/types/environmentMap.ts
  14. 1 1
      Viewer/src/configuration/types/extended.ts
  15. 7 7
      Viewer/src/configuration/types/index.ts
  16. 1 1
      Viewer/src/configuration/types/minimal.ts
  17. 2 2
      Viewer/src/configuration/types/shadowLight.ts
  18. 5 5
      Viewer/src/helper/index.ts
  19. 1 1
      Viewer/src/index.ts
  20. 2 3
      Viewer/src/initializer.ts
  21. 1 2
      Viewer/src/labs/environmentSerializer.ts
  22. 10 10
      Viewer/src/labs/texture.ts
  23. 5 5
      Viewer/src/labs/viewerLabs.ts
  24. 8 9
      Viewer/src/loader/modelLoader.ts
  25. 2 2
      Viewer/src/loader/plugins/index.ts
  26. 0 1
      Viewer/src/loader/plugins/telemetryLoaderPlugin.ts
  27. 61 61
      Viewer/src/managers/sceneManager.ts
  28. 1 2
      Viewer/src/managers/telemetryManager.ts
  29. 15 13
      Viewer/src/model/modelAnimation.ts
  30. 27 30
      Viewer/src/model/viewerModel.ts
  31. 4 4
      Viewer/src/optimizer/custom/extended.ts
  32. 1 1
      Viewer/src/optimizer/custom/index.ts
  33. 7 8
      Viewer/src/templating/eventManager.ts
  34. 3 3
      Viewer/src/templating/plugins/printButton.ts
  35. 37 38
      Viewer/src/templating/templateManager.ts
  36. 2 2
      Viewer/src/templating/viewerTemplatePlugin.ts
  37. 39 40
      Viewer/src/viewer/defaultViewer.ts
  38. 27 32
      Viewer/src/viewer/viewer.ts
  39. 2 2
      Viewer/src/viewer/viewerManager.ts
  40. 5 5
      Viewer/tests/commons/boot.ts
  41. 13 13
      Viewer/tests/commons/helper.ts
  42. 139 139
      Viewer/tests/commons/mockWebGL.ts
  43. 2 2
      Viewer/tests/unit/src/configuration/mappers.ts
  44. 15 15
      Viewer/tests/unit/src/configuration/updateConfiguration.ts
  45. 4 4
      Viewer/tests/unit/src/helper.ts
  46. 1 1
      Viewer/tests/unit/src/index.ts
  47. 4 6
      Viewer/tests/unit/src/viewer/sceneManager.ts
  48. 8 9
      Viewer/tests/unit/src/viewer/viewer.ts
  49. 2 2
      Viewer/tests/unit/src/viewer/viewerManager.ts
  50. 12931 12931
      dist/preview release/babylon.d.ts
  51. 1 1
      dist/preview release/gui/babylon.gui.min.js.map
  52. 1 1
      dist/preview release/inspector/babylon.inspector.bundle.js.map
  53. 98 5
      dist/preview release/viewer/babylon.viewer.d.ts
  54. 15 15
      dist/preview release/viewer/babylon.viewer.max.js
  55. 129 6
      dist/preview release/viewer/babylon.viewer.module.d.ts
  56. 7 7
      gui/src/2D/advancedDynamicTexture.ts
  57. 5 6
      gui/src/2D/controls/button.ts
  58. 4 4
      gui/src/2D/controls/checkbox.ts
  59. 1 1
      gui/src/2D/controls/colorpicker.ts
  60. 1 1
      gui/src/2D/controls/container.ts
  61. 33 35
      gui/src/2D/controls/control.ts
  62. 13 13
      gui/src/2D/controls/displayGrid.ts
  63. 1 1
      gui/src/2D/controls/ellipse.ts
  64. 9 9
      gui/src/2D/controls/image.ts
  65. 2 2
      gui/src/2D/controls/inputText.ts
  66. 2 2
      gui/src/2D/controls/line.ts
  67. 16 17
      gui/src/2D/controls/multiLine.ts
  68. 4 4
      gui/src/2D/controls/radioButton.ts
  69. 2 2
      gui/src/2D/controls/rectangle.ts
  70. 103 106
      gui/src/2D/controls/selector.ts
  71. 6 8
      gui/src/2D/controls/slider.ts
  72. 1 1
      gui/src/2D/controls/stackPanel.ts
  73. 2 2
      gui/src/2D/controls/statics.ts
  74. 2 2
      gui/src/2D/controls/textBlock.ts
  75. 12 13
      gui/src/2D/controls/virtualKeyboard.ts
  76. 17 17
      gui/src/2D/math2D.ts
  77. 2 2
      gui/src/2D/measure.ts
  78. 1 2
      gui/src/2D/multiLinePoint.ts
  79. 2 2
      gui/src/2D/style.ts
  80. 1 1
      gui/src/2D/valueAndUnit.ts
  81. 4 4
      gui/src/3D/controls/button3D.ts
  82. 1 2
      gui/src/3D/controls/container3D.ts
  83. 2 2
      gui/src/3D/controls/control3D.ts
  84. 33 33
      gui/src/3D/controls/holographicButton.ts
  85. 4 4
      gui/src/3D/controls/meshButton3D.ts
  86. 2 2
      gui/src/3D/controls/stackPanel3D.ts
  87. 4 4
      gui/src/3D/controls/volumeBasedPanel.ts
  88. 3 3
      gui/src/3D/gui3DManager.ts
  89. 4 5
      gui/src/3D/materials/fluentMaterial.ts
  90. 2 2
      gui/src/legacy.ts
  91. 19 20
      inspector/src/Inspector.ts
  92. 0 2
      inspector/src/adapters/Adapter.ts
  93. 1 4
      inspector/src/adapters/CameraAdapter.ts
  94. 1 2
      inspector/src/adapters/GUIAdapter.ts
  95. 1 1
      inspector/src/adapters/LightAdapter.ts
  96. 1 1
      inspector/src/adapters/MaterialAdapter.ts
  97. 1 3
      inspector/src/adapters/MeshAdapter.ts
  98. 1 2
      inspector/src/adapters/PhysicsImpostorAdapter.ts
  99. 3 5
      inspector/src/adapters/SoundAdapter.ts
  100. 0 0
      inspector/src/adapters/TextureAdapter.ts

Plik diff jest za duży
+ 12888 - 12888
Playground/babylon.d.txt


+ 3 - 2
Tools/Gulp/config.json

@@ -145,7 +145,7 @@
             "imageProcessing",
             "backgroundMaterial",
             "pbrMaterial",
-            "hdr"        
+            "hdr"
         ]
     },
     "workloads": {
@@ -1443,7 +1443,6 @@
                 "core"
             ]
         }
-
     },
     "typescript": [
         "../../src/**/*.ts",
@@ -1999,6 +1998,7 @@
             }
         ],
         "build": {
+            "srcDirectory": "../../Viewer/src/",
             "srcOutputDirectory": "../../Viewer/",
             "distOutputDirectory": "/viewer/",
             "dtsBundle": {
@@ -2071,6 +2071,7 @@
             }
         ],
         "build": {
+            "srcDirectory": "../../Viewer/src/",
             "srcOutputDirectory": "../../Viewer/",
             "distOutputDirectory": "/viewer/",
             "dtsBundle": {

+ 89 - 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
@@ -271,7 +271,7 @@ gulp.task("build", gulp.series("shaders", function build() {
 /*
 * TsLint all typescript files from the src directory.
 */
-gulp.task("typescript-tsLint", function () {
+gulp.task("typescript-tsLint", function() {
     return gulp.src(config.typescript)
         .pipe(gulpTslint({
             formatter: "stylish",
@@ -284,7 +284,7 @@ gulp.task("typescript-tsLint", function () {
 /*
 * TsLint all typescript files from the src directory.
 */
-var tsLintExternalLibrary = function (library, settings, watch) {
+var tsLintExternalLibrary = function(library, settings, watch) {
     if (library.files && library.files.length) {
         return gulp.src(library.files, { base: settings.build.srcOutputDirectory })
             .pipe(gulpTslint({
@@ -295,7 +295,7 @@ var tsLintExternalLibrary = function (library, settings, watch) {
             .pipe(gulpTslint.report());
     }
     else {
-        return gulp.src(settings.build.srcOutputDirectory + "/**/*.ts")
+        return gulp.src((settings.build.srcDirectory || settings.build.srcOutputDirectory) + "/**/*.ts")
             .pipe(gulpTslint({
                 formatter: "stylish",
                 configuration: "../../tslint.json",
@@ -308,8 +308,8 @@ var tsLintExternalLibrary = function (library, settings, watch) {
 /**
  * Helper methods to tsLint external library (mat, post processes, ...).
  */
-var tsLintExternalLibraries = function (settings) {
-    var tasks = settings.libraries.map(function (library) {
+var tsLintExternalLibraries = function(settings) {
+    var tasks = settings.libraries.map(function(library) {
         return tsLintExternalLibrary(library, settings, false);
     });
 
@@ -320,8 +320,8 @@ var tsLintExternalLibraries = function (settings) {
 /**
  * Dynamic module creation tsLint.
  */
-config.modules.map(function (module) {
-    gulp.task(module + "-tsLint", function () {
+config.modules.map(function(module) {
+    gulp.task(module + "-tsLint", function() {
         return tsLintExternalLibraries(config[module]);
     });
 });
@@ -329,11 +329,11 @@ config.modules.map(function (module) {
 /**
  * Full Librairies tsLint.
  */
-gulp.task("typescript-libraries-tsLint", 
+gulp.task("typescript-libraries-tsLint",
     gulp.series(config.modules.map((module) => {
-         return module + "-tsLint";
+        return module + "-tsLint";
     })
-));
+    ));
 
 /**
  * Full TsLint.
@@ -343,7 +343,7 @@ gulp.task("tsLint", gulp.series("typescript-tsLint", "typescript-libraries-tsLin
 /*
 * Compiles all typescript files and creating a js and a declaration file.
 */
-gulp.task("typescript-compile", function () {
+gulp.task("typescript-compile", function() {
     var tsResult = gulp.src(config.typescript)
         .pipe(sourcemaps.init())
         .pipe(tsProject({
@@ -352,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);
             });
@@ -380,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;
             });
 
@@ -412,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)
@@ -432,7 +432,7 @@ 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 })
@@ -604,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);
@@ -613,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);
@@ -631,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);
@@ -650,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)))
@@ -675,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", "")
@@ -690,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
@@ -743,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]);
     });
 });
@@ -759,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";
@@ -776,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;
@@ -790,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())
@@ -814,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, ""))
@@ -828,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/"));
 });
@@ -836,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,
@@ -858,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([
@@ -878,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);
             });
@@ -913,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"))
@@ -935,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!
@@ -952,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)
@@ -976,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"
                     })),
@@ -1003,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"
                     })),
@@ -1080,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",
@@ -1115,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));
 });
@@ -1123,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));
 });
@@ -1144,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
@@ -1158,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,
@@ -1173,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;
@@ -1191,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);
         });
@@ -1211,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,
@@ -1222,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
@@ -1232,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)
@@ -1249,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);
 
@@ -1257,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";
             }
@@ -1269,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
@@ -1283,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,
@@ -1298,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;
@@ -1316,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);
 
@@ -1324,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";
             }
@@ -1336,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,
@@ -1351,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
@@ -1367,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();
@@ -1380,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);
@@ -1393,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
@@ -1418,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";
                                         }
@@ -1437,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
@@ -1453,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();
@@ -1482,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;

+ 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.
  */
 

+ 2 - 3
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,14 +10,14 @@ 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') {

+ 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 {

+ 37 - 38
Viewer/src/templating/templateManager.ts

@@ -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) {
@@ -464,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) {
@@ -494,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) {
@@ -531,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);
             });
         }
@@ -578,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);
             });
         }
@@ -587,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);
@@ -608,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) {

+ 39 - 40
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';
@@ -29,19 +28,19 @@ export class DefaultViewer extends AbstractViewer {
         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);
@@ -108,11 +107,10 @@ export class DefaultViewer extends AbstractViewer {
                     }, () => {
                     });
                     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);
@@ -372,7 +371,7 @@ export class DefaultViewer extends AbstractViewer {
                     viewerElement.classList.add("in-fullscreen");
                 }
             } else {
-                let exitFullscreen = document.exitFullscreen || (<any>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");
@@ -400,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 || {};
 
@@ -409,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;
@@ -427,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);
@@ -475,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();
 
@@ -490,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);
             }));
@@ -502,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');
@@ -525,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);
     }
 
@@ -553,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;
@@ -580,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);
         }));
@@ -662,7 +661,7 @@ export class DefaultViewer extends AbstractViewer {
                         lightTarget.subtractToRef(flashlight.position, flashlight.direction);
                     }
                 }
-            }
+            };
             this.sceneManager.scene.registerBeforeRender(updateFlashlightFunction);
             this._registeredOnBeforeRenderFunctions.push(updateFlashlightFunction);
         }

+ 27 - 32
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?
      */
@@ -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 {
@@ -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"));

+ 8 - 9
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);
@@ -101,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();
@@ -132,7 +132,7 @@ describe('Viewer', function () {
             // mock the resize function
             engine.resize = () => {
                 resizeCount++;
-            }
+            };
         });
 
         viewer.onInitDoneObservable.add(() => {
@@ -214,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();
@@ -241,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");
@@ -311,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();
 

Plik diff jest za duży
+ 12931 - 12931
dist/preview release/babylon.d.ts


Plik diff jest za duży
+ 1 - 1
dist/preview release/gui/babylon.gui.min.js.map


Plik diff jest za duży
+ 1 - 1
dist/preview release/inspector/babylon.inspector.bundle.js.map


+ 98 - 5
dist/preview release/viewer/babylon.viewer.d.ts

@@ -168,11 +168,11 @@ declare module BabylonViewer {
                 * Mainly used for help and errors
                 * @param subScreen the name of the subScreen. Those can be defined in the configuration object
                 */
-            showOverlayScreen(subScreen: string): Promise<string> | Promise<Template>;
+            showOverlayScreen(subScreen: string): Promise<Template> | Promise<string>;
             /**
                 * Hide the overlay screen.
                 */
-            hideOverlayScreen(): Promise<string> | Promise<Template>;
+            hideOverlayScreen(): Promise<Template> | Promise<string>;
             /**
                 * show the viewer (in case it was hidden)
                 *
@@ -189,11 +189,11 @@ declare module BabylonViewer {
                 * Show the loading screen.
                 * The loading screen can be configured using the configuration object
                 */
-            showLoadingScreen(): Promise<string> | Promise<Template>;
+            showLoadingScreen(): Promise<Template> | Promise<string>;
             /**
                 * Hide the loading screen
                 */
-            hideLoadingScreen(): Promise<string> | Promise<Template>;
+            hideLoadingScreen(): Promise<Template> | Promise<string>;
             dispose(): void;
             protected _onConfigurationLoaded(configuration: ViewerConfiguration): void;
     }
@@ -482,6 +482,37 @@ declare module BabylonViewer {
     export const telemetryManager: TelemetryManager;
 }
 declare module BabylonViewer {
+    /**
+        * 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 {
+            readonly baseUrl: string;
+            /**
+                * Create a new Model loader
+                * @param _viewer the viewer using this model loader
+                */
+            constructor(_observablesManager: ObservablesManager, _configurationContainer?: ConfigurationContainer | undefined);
+            /**
+                * Adds a new plugin to the loader process.
+                *
+                * @param plugin the plugin name or the plugin itself
+                */
+            addPlugin(plugin: ILoaderPlugin | string): void;
+            /**
+                * Load a model using predefined configuration
+                * @param modelConfiguration the modelConfiguration to use to load the model
+                */
+            load(modelConfiguration: IModelConfiguration): ViewerModel;
+            cancelLoad(model: ViewerModel): void;
+            /**
+                * dispose the model loader.
+                * If loaders are registered and are in the middle of loading, they will be disposed and the request(s) will be cancelled.
+                */
+            dispose(): void;
+    }
 }
 declare module BabylonViewer {
     /**
@@ -893,7 +924,7 @@ declare module BabylonViewer {
       * @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
       */
-    export function getCustomOptimizerByName(name: string, upgrade?: boolean): (sceneManager: SceneManager) => boolean;
+    export function getCustomOptimizerByName(name: string, upgrade?: boolean): typeof extendedUpgrade;
     export function registerCustomOptimizer(name: string, optimizer: (sceneManager: SceneManager) => boolean): void;
 }
 declare module BabylonViewer {
@@ -1514,6 +1545,33 @@ declare module BabylonViewer {
     }
 }
 declare module BabylonViewer {
+    /**
+        * 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): ILoaderPlugin;
+    /**
+        *
+        */
+    export function addLoaderPlugin(name: string, plugin: ILoaderPlugin): void;
+}
+declare module BabylonViewer {
+    /**
+        * A custom upgrade-oriented function configuration for the scene optimizer.
+        *
+        * @param viewer the viewer to optimize
+        */
+    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;
+}
+declare module BabylonViewer {
 }
 declare module BabylonViewer {
     export interface IEnvironmentMapConfiguration {
@@ -1649,6 +1707,41 @@ declare module BabylonViewer {
     }
 }
 declare module BabylonViewer {
+    export class TelemetryLoaderPlugin implements ILoaderPlugin {
+        onInit(loader: BABYLON.ISceneLoaderPlugin | BABYLON.ISceneLoaderPluginAsync, model: ViewerModel): void;
+        onLoaded(model: ViewerModel): void;
+        onError(message: string, exception: any): void;
+        onComplete(): void;
+    }
+}
+declare module BabylonViewer {
+    /**
+      * A loder plugin to use MSFT_lod extension correctly (glTF)
+      */
+    export class MSFTLodLoaderPlugin implements ILoaderPlugin {
+        onInit(loader: BABYLON.ISceneLoaderPlugin | BABYLON.ISceneLoaderPluginAsync, model: ViewerModel): void;
+        onExtensionLoaded(extension: BABYLON.IGLTFLoaderExtension): void;
+    }
+}
+declare module BabylonViewer {
+    /**
+      * Force-apply material configuration right after a material was loaded.
+      */
+    export class ApplyMaterialConfigPlugin implements ILoaderPlugin {
+        onInit(loader: BABYLON.ISceneLoaderPlugin | BABYLON.ISceneLoaderPluginAsync, model: ViewerModel): void;
+        onMaterialLoaded(material: BABYLON.Material): void;
+    }
+}
+declare module BabylonViewer {
+    /**
+      * A (PBR) material will be extended using this function.
+      * This function will hold extra default configuration for the viewer, if not implemented in Babylon itself.
+      */
+    export class ExtendedMaterialLoaderPlugin implements ILoaderPlugin {
+        onMaterialLoaded(baseMaterial: BABYLON.Material): void;
+    }
+}
+declare module BabylonViewer {
     export interface ICameraConfiguration {
         position?: {
             x: number;

Plik diff jest za duży
+ 15 - 15
dist/preview release/viewer/babylon.viewer.max.js


+ 129 - 6
dist/preview release/viewer/babylon.viewer.module.d.ts

@@ -200,11 +200,11 @@ declare module 'babylonjs-viewer/viewer/defaultViewer' {
                 * Mainly used for help and errors
                 * @param subScreen the name of the subScreen. Those can be defined in the configuration object
                 */
-            showOverlayScreen(subScreen: string): Promise<string> | Promise<Template>;
+            showOverlayScreen(subScreen: string): Promise<Template> | Promise<string>;
             /**
                 * Hide the overlay screen.
                 */
-            hideOverlayScreen(): Promise<string> | Promise<Template>;
+            hideOverlayScreen(): Promise<Template> | Promise<string>;
             /**
                 * show the viewer (in case it was hidden)
                 *
@@ -221,11 +221,11 @@ declare module 'babylonjs-viewer/viewer/defaultViewer' {
                 * Show the loading screen.
                 * The loading screen can be configured using the configuration object
                 */
-            showLoadingScreen(): Promise<string> | Promise<Template>;
+            showLoadingScreen(): Promise<Template> | Promise<string>;
             /**
                 * Hide the loading screen
                 */
-            hideLoadingScreen(): Promise<string> | Promise<Template>;
+            hideLoadingScreen(): Promise<Template> | Promise<string>;
             dispose(): void;
             protected _onConfigurationLoaded(configuration: ViewerConfiguration): void;
     }
@@ -527,7 +527,42 @@ declare module 'babylonjs-viewer/managers/telemetryManager' {
 }
 
 declare module 'babylonjs-viewer/loader/modelLoader' {
-    
+    import { ConfigurationContainer } from 'babylonjs-viewer/configuration/configurationContainer';
+    import { IModelConfiguration } from 'babylonjs-viewer/configuration/interfaces/modelConfiguration';
+    import { ObservablesManager } from 'babylonjs-viewer/managers/observablesManager';
+    import { ViewerModel } from 'babylonjs-viewer/model/viewerModel';
+    import { ILoaderPlugin } from 'babylonjs-viewer/loader/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 {
+            readonly baseUrl: string;
+            /**
+                * Create a new Model loader
+                * @param _viewer the viewer using this model loader
+                */
+            constructor(_observablesManager: ObservablesManager, _configurationContainer?: ConfigurationContainer | undefined);
+            /**
+                * Adds a new plugin to the loader process.
+                *
+                * @param plugin the plugin name or the plugin itself
+                */
+            addPlugin(plugin: ILoaderPlugin | string): void;
+            /**
+                * Load a model using predefined configuration
+                * @param modelConfiguration the modelConfiguration to use to load the model
+                */
+            load(modelConfiguration: IModelConfiguration): ViewerModel;
+            cancelLoad(model: ViewerModel): void;
+            /**
+                * dispose the model loader.
+                * If loaders are registered and are in the middle of loading, they will be disposed and the request(s) will be cancelled.
+                */
+            dispose(): void;
+    }
 }
 
 declare module 'babylonjs-viewer/model/viewerModel' {
@@ -950,13 +985,14 @@ declare module 'babylonjs-viewer/templating/viewerTemplatePlugin' {
 }
 
 declare module 'babylonjs-viewer/optimizer/custom' {
+    import { extendedUpgrade } from "babylonjs-viewer/optimizer/custom/extended";
     import { SceneManager } from "babylonjs-viewer/managers/sceneManager";
     /**
       *
       * @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
       */
-    export function getCustomOptimizerByName(name: string, upgrade?: boolean): (sceneManager: SceneManager) => boolean;
+    export function getCustomOptimizerByName(name: string, upgrade?: boolean): typeof extendedUpgrade;
     export function registerCustomOptimizer(name: string, optimizer: (sceneManager: SceneManager) => boolean): void;
 }
 
@@ -1607,6 +1643,42 @@ declare module 'babylonjs-viewer/configuration/interfaces/modelConfiguration' {
     }
 }
 
+declare module 'babylonjs-viewer/loader/plugins' {
+    import { TelemetryLoaderPlugin } from "babylonjs-viewer/loader/plugins/telemetryLoaderPlugin";
+    import { ILoaderPlugin } from "babylonjs-viewer/loader/plugins/loaderPlugin";
+    import { MSFTLodLoaderPlugin } from 'babylonjs-viewer/loader/plugins/msftLodLoaderPlugin';
+    import { ApplyMaterialConfigPlugin } from 'babylonjs-viewer/loader/plugins/applyMaterialConfig';
+    import { ExtendedMaterialLoaderPlugin } from 'babylonjs-viewer/loader/plugins/extendedMaterialLoaderPlugin';
+    export { TelemetryLoaderPlugin, ILoaderPlugin, MSFTLodLoaderPlugin, ApplyMaterialConfigPlugin, ExtendedMaterialLoaderPlugin };
+    /**
+        * 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): ILoaderPlugin;
+    /**
+        *
+        */
+    export function addLoaderPlugin(name: string, plugin: ILoaderPlugin): void;
+}
+
+declare module 'babylonjs-viewer/optimizer/custom/extended' {
+    import { SceneManager } from 'babylonjs-viewer/managers/sceneManager';
+    /**
+        * A custom upgrade-oriented function configuration for the scene optimizer.
+        *
+        * @param viewer the viewer to optimize
+        */
+    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;
+}
+
 declare module 'babylonjs-viewer/configuration/interfaces' {
     export * from 'babylonjs-viewer/configuration/interfaces/cameraConfiguration';
     export * from 'babylonjs-viewer/configuration/interfaces/colorGradingConfiguration';
@@ -1765,6 +1837,57 @@ declare module 'babylonjs-viewer/configuration/interfaces/modelAnimationConfigur
     }
 }
 
+declare module 'babylonjs-viewer/loader/plugins/telemetryLoaderPlugin' {
+    import { ILoaderPlugin } from "babylonjs-viewer/loader/plugins/loaderPlugin";
+    import { ViewerModel } from "babylonjs-viewer/model/viewerModel";
+    import { ISceneLoaderPlugin, ISceneLoaderPluginAsync } from "babylonjs";
+    export class TelemetryLoaderPlugin implements ILoaderPlugin {
+        onInit(loader: ISceneLoaderPlugin | ISceneLoaderPluginAsync, model: ViewerModel): void;
+        onLoaded(model: ViewerModel): void;
+        onError(message: string, exception: any): void;
+        onComplete(): void;
+    }
+}
+
+declare module 'babylonjs-viewer/loader/plugins/msftLodLoaderPlugin' {
+    import { ISceneLoaderPlugin, ISceneLoaderPluginAsync } from 'babylonjs';
+    import { IGLTFLoaderExtension } from 'babylonjs-loaders';
+    import { ViewerModel } from 'babylonjs-viewer/model/viewerModel';
+    import { ILoaderPlugin } from 'babylonjs-viewer/loader/plugins/loaderPlugin';
+    /**
+      * A loder plugin to use MSFT_lod extension correctly (glTF)
+      */
+    export class MSFTLodLoaderPlugin implements ILoaderPlugin {
+        onInit(loader: ISceneLoaderPlugin | ISceneLoaderPluginAsync, model: ViewerModel): void;
+        onExtensionLoaded(extension: IGLTFLoaderExtension): void;
+    }
+}
+
+declare module 'babylonjs-viewer/loader/plugins/applyMaterialConfig' {
+    import { ISceneLoaderPlugin, ISceneLoaderPluginAsync, Material } from 'babylonjs';
+    import { ViewerModel } from 'babylonjs-viewer/model/viewerModel';
+    import { ILoaderPlugin } from 'babylonjs-viewer/loader/plugins/loaderPlugin';
+    /**
+      * Force-apply material configuration right after a material was loaded.
+      */
+    export class ApplyMaterialConfigPlugin implements ILoaderPlugin {
+        onInit(loader: ISceneLoaderPlugin | ISceneLoaderPluginAsync, model: ViewerModel): void;
+        onMaterialLoaded(material: Material): void;
+    }
+}
+
+declare module 'babylonjs-viewer/loader/plugins/extendedMaterialLoaderPlugin' {
+    import { Material } from 'babylonjs';
+    import { ILoaderPlugin } from 'babylonjs-viewer/loader/plugins/loaderPlugin';
+    /**
+      * A (PBR) material will be extended using this function.
+      * This function will hold extra default configuration for the viewer, if not implemented in Babylon itself.
+      */
+    export class ExtendedMaterialLoaderPlugin implements ILoaderPlugin {
+        onMaterialLoaded(baseMaterial: Material): void;
+    }
+}
+
 declare module 'babylonjs-viewer/configuration/interfaces/cameraConfiguration' {
     export interface ICameraConfiguration {
         position?: {

+ 7 - 7
gui/src/2D/advancedDynamicTexture.ts

@@ -257,7 +257,7 @@ export class AdvancedDynamicTexture extends DynamicTexture {
         this._rootCanvas = scene.getEngine()!.getRenderingCanvas()!;
 
         this._renderObserver = scene.onBeforeCameraRenderObservable.add((camera: Camera) => this._checkUpdate(camera));
-        this._preKeyboardObserver = scene.onPreKeyboardObservable.add(info => {
+        this._preKeyboardObserver = scene.onPreKeyboardObservable.add((info) => {
             if (!this._focusedControl) {
                 return;
             }
@@ -617,9 +617,9 @@ export class AdvancedDynamicTexture extends DynamicTexture {
             this._shouldBlockPointer = false;
             // Do picking modifies _shouldBlockPointer
             this._doPicking(x, y, pi.type, (pi.event as PointerEvent).pointerId || 0, pi.event.button);
-            
-            // Avoid overwriting a true skipOnPointerObservable to false 
-            if(this._shouldBlockPointer){
+
+            // Avoid overwriting a true skipOnPointerObservable to false
+            if (this._shouldBlockPointer) {
                 pi.skipOnPointerObservable = this._shouldBlockPointer;
             }
         });
@@ -660,7 +660,7 @@ export class AdvancedDynamicTexture extends DynamicTexture {
 
                 if (this.focusedControl) {
                     const friendlyControls = this.focusedControl.keepsFocusWith();
-                    
+
                     let canMoveFocus = true;
 
                     if (friendlyControls) {
@@ -760,10 +760,10 @@ export class AdvancedDynamicTexture extends DynamicTexture {
         if (onlyAlphaTesting) {
             material.diffuseTexture = result;
             material.emissiveTexture = result;
-            result.hasAlpha = true;    
+            result.hasAlpha = true;
         } else {
             material.emissiveTexture = result;
-            material.opacityTexture = result;   
+            material.opacityTexture = result;
         }
 
         mesh.material = material;

+ 5 - 6
gui/src/2D/controls/button.ts

@@ -37,21 +37,21 @@ export class Button extends Rectangle {
 
         this.pointerEnterAnimation = () => {
             this.alpha -= 0.1;
-        }
+        };
 
         this.pointerOutAnimation = () => {
             this.alpha += 0.1;
-        }
+        };
 
         this.pointerDownAnimation = () => {
             this.scaleX -= 0.05;
             this.scaleY -= 0.05;
-        }
+        };
 
         this.pointerUpAnimation = () => {
             this.scaleX += 0.05;
             this.scaleY += 0.05;
-        }
+        };
     }
 
     protected _getTypeName(): string {
@@ -102,7 +102,6 @@ export class Button extends Rectangle {
             return false;
         }
 
-
         if (this.pointerDownAnimation) {
             this.pointerDownAnimation();
         }
@@ -206,4 +205,4 @@ export class Button extends Rectangle {
 
         return result;
     }
-}    
+}

+ 4 - 4
gui/src/2D/controls/checkbox.ts

@@ -162,16 +162,16 @@ export class Checkbox extends Control {
         checkbox.isChecked = true;
         checkbox.color = "green";
         checkbox.onIsCheckedChangedObservable.add(onValueChanged);
-        panel.addControl(checkbox);    
-    
+        panel.addControl(checkbox);
+
         var header = new TextBlock();
         header.text = title;
         header.width = "180px";
         header.paddingLeft = "5px";
         header.textHorizontalAlignment = Control.HORIZONTAL_ALIGNMENT_LEFT;
         header.color = "white";
-        panel.addControl(header); 
+        panel.addControl(header);
 
         return panel;
     }
-}   
+}

+ 1 - 1
gui/src/2D/controls/colorpicker.ts

@@ -425,4 +425,4 @@ export class ColorPicker extends Control {
         delete this._host._capturingControl[pointerId];
         super._onPointerUp(target, coordinates, pointerId, buttonIndex, notifyClick);
     }
-}  
+}

+ 1 - 1
gui/src/2D/controls/container.ts

@@ -354,4 +354,4 @@ export class Container extends Control {
             control.dispose();
         }
     }
-}   
+}

+ 33 - 35
gui/src/2D/controls/control.ts

@@ -175,7 +175,7 @@ export class Control {
         this._markAsDirty();
     }
 
-    /** Gets or sets a value indicating the scale factor on X axis (1 by default) 
+    /** Gets or sets a value indicating the scale factor on X axis (1 by default)
      * @see http://doc.babylonjs.com/how_to/gui#rotation-and-scaling
     */
     public get scaleX(): number {
@@ -192,7 +192,7 @@ export class Control {
         this._markMatrixAsDirty();
     }
 
-    /** Gets or sets a value indicating the scale factor on Y axis (1 by default) 
+    /** Gets or sets a value indicating the scale factor on Y axis (1 by default)
      * @see http://doc.babylonjs.com/how_to/gui#rotation-and-scaling
     */
     public get scaleY(): number {
@@ -209,7 +209,7 @@ export class Control {
         this._markMatrixAsDirty();
     }
 
-    /** Gets or sets the rotation angle (0 by default) 
+    /** Gets or sets the rotation angle (0 by default)
      * @see http://doc.babylonjs.com/how_to/gui#rotation-and-scaling
     */
     public get rotation(): number {
@@ -260,8 +260,8 @@ export class Control {
         this._markMatrixAsDirty();
     }
 
-    /** 
-     * Gets or sets the horizontal alignment 
+    /**
+     * Gets or sets the horizontal alignment
      * @see http://doc.babylonjs.com/how_to/gui#alignments
      */
     public get horizontalAlignment(): number {
@@ -277,8 +277,8 @@ export class Control {
         this._markAsDirty();
     }
 
-    /** 
-     * Gets or sets the vertical alignment 
+    /**
+     * Gets or sets the vertical alignment
      * @see http://doc.babylonjs.com/how_to/gui#alignments
      */
     public get verticalAlignment(): number {
@@ -294,15 +294,15 @@ export class Control {
         this._markAsDirty();
     }
 
-    /** 
-     * Gets or sets control width 
+    /**
+     * Gets or sets control width
      * @see http://doc.babylonjs.com/how_to/gui#position-and-size
      */
     public get width(): string | number {
         return this._width.toString(this._host);
     }
 
-    /** 
+    /**
      * Gets control width in pixel
      * @see http://doc.babylonjs.com/how_to/gui#position-and-size
      */
@@ -320,15 +320,15 @@ export class Control {
         }
     }
 
-    /** 
-     * Gets or sets control height 
+    /**
+     * Gets or sets control height
      * @see http://doc.babylonjs.com/how_to/gui#position-and-size
      */
     public get height(): string | number {
         return this._height.toString(this._host);
     }
 
-    /** 
+    /**
      * Gets control height in pixel
      * @see http://doc.babylonjs.com/how_to/gui#position-and-size
      */
@@ -710,7 +710,7 @@ export class Control {
     }
 
     public set isEnabled(value: boolean) {
-        if(this._isEnabled === value){
+        if (this._isEnabled === value) {
             return;
         }
 
@@ -723,7 +723,7 @@ export class Control {
     }
 
     public set disabledColor(value: string) {
-        if(this._disabledColor === value){
+        if (this._disabledColor === value) {
             return;
         }
 
@@ -769,8 +769,8 @@ export class Control {
         return this.parent.isAscendant(container);
     }
 
-    /** 
-     * Gets coordinates in local control space 
+    /**
+     * Gets coordinates in local control space
      * @param globalCoordinates defines the coordinates to transform
      * @returns the new coordinates in local space
      */
@@ -782,8 +782,8 @@ export class Control {
         return result;
     }
 
-    /** 
-     * Gets coordinates in local control space 
+    /**
+     * Gets coordinates in local control space
      * @param globalCoordinates defines the coordinates to transform
      * @param result defines the target vector2 where to store the result
      * @returns the current control
@@ -794,8 +794,8 @@ export class Control {
         return this;
     }
 
-    /** 
-     * Gets coordinates in parent local control space 
+    /**
+     * Gets coordinates in parent local control space
      * @param globalCoordinates defines the coordinates to transform
      * @returns the new coordinates in parent local space
      */
@@ -1093,7 +1093,7 @@ export class Control {
 
         switch (this.horizontalAlignment) {
             case Control.HORIZONTAL_ALIGNMENT_LEFT:
-                x = 0
+                x = 0;
                 break;
             case Control.HORIZONTAL_ALIGNMENT_RIGHT:
                 x = parentWidth - width;
@@ -1212,7 +1212,7 @@ export class Control {
 
     /** @hidden */
     public _processPicking(x: number, y: number, type: number, pointerId: number, buttonIndex: number): boolean {
-        if(!this._isEnabled){
+        if (!this._isEnabled) {
             return false;
         }
         if (!this.isHitTestVisible || !this.isVisible || this._doNotRender) {
@@ -1232,12 +1232,12 @@ export class Control {
     public _onPointerMove(target: Control, coordinates: Vector2): void {
         var canNotify: boolean = this.onPointerMoveObservable.notifyObservers(coordinates, -1, target, this);
 
-        if (canNotify && this.parent != null) this.parent._onPointerMove(target, coordinates);
+        if (canNotify && this.parent != null) { this.parent._onPointerMove(target, coordinates); }
     }
 
     /** @hidden */
     public _onPointerEnter(target: Control): boolean {
-        if(!this._isEnabled){
+        if (!this._isEnabled) {
             return false;
         }
         if (this._enterCount > 0) {
@@ -1251,21 +1251,21 @@ export class Control {
 
         var canNotify: boolean = this.onPointerEnterObservable.notifyObservers(this, -1, target, this);
 
-        if (canNotify && this.parent != null) this.parent._onPointerEnter(target);
+        if (canNotify && this.parent != null) { this.parent._onPointerEnter(target); }
 
         return true;
     }
 
     /** @hidden */
     public _onPointerOut(target: Control): void {
-        if(!this._isEnabled){
+        if (!this._isEnabled) {
             return;
         }
         this._enterCount = 0;
 
         var canNotify: boolean = this.onPointerOutObservable.notifyObservers(this, -1, target, this);
 
-        if (canNotify && this.parent != null) this.parent._onPointerOut(target);
+        if (canNotify && this.parent != null) { this.parent._onPointerOut(target); }
     }
 
     /** @hidden */
@@ -1284,14 +1284,14 @@ export class Control {
 
         var canNotify: boolean = this.onPointerDownObservable.notifyObservers(new Vector2WithInfo(coordinates, buttonIndex), -1, target, this);
 
-        if (canNotify && this.parent != null) this.parent._onPointerDown(target, coordinates, pointerId, buttonIndex);
+        if (canNotify && this.parent != null) { this.parent._onPointerDown(target, coordinates, pointerId, buttonIndex); }
 
         return true;
     }
 
     /** @hidden */
     public _onPointerUp(target: Control, coordinates: Vector2, pointerId: number, buttonIndex: number, notifyClick: boolean): void {
-        if(!this._isEnabled){
+        if (!this._isEnabled) {
             return;
         }
         this._downCount = 0;
@@ -1304,7 +1304,7 @@ export class Control {
         }
         var canNotify: boolean = this.onPointerUpObservable.notifyObservers(new Vector2WithInfo(coordinates, buttonIndex), -1, target, this);
 
-        if (canNotify && this.parent != null) this.parent._onPointerUp(target, coordinates, pointerId, buttonIndex, canNotifyClick);
+        if (canNotify && this.parent != null) { this.parent._onPointerUp(target, coordinates, pointerId, buttonIndex, canNotifyClick); }
     }
 
     /** @hidden */
@@ -1320,7 +1320,7 @@ export class Control {
 
     /** @hidden */
     public _processObservables(type: number, x: number, y: number, pointerId: number, buttonIndex: number): boolean {
-        if(!this._isEnabled){
+        if (!this._isEnabled) {
             return false;
         }
         this._dummyVector2.copyFromFloats(x, y);
@@ -1478,9 +1478,7 @@ export class Control {
         Control._FontHeightSizes[font] = result;
 
         return result;
-    };
-
-
+    }
 
     /**
      * Creates a stack panel that can be used to render headers

+ 13 - 13
gui/src/2D/controls/displayGrid.ts

@@ -32,7 +32,7 @@ export class DisplayGrid extends Control {
 
         this._displayMinorLines = value;
         this._markAsDirty();
-    }  
+    }
 
     /** Gets or sets a boolean indicating if major lines must be rendered (true by default)) */
     public get displayMajorLines(): boolean {
@@ -46,7 +46,7 @@ export class DisplayGrid extends Control {
 
         this._displayMajorLines = value;
         this._markAsDirty();
-    }  
+    }
 
     /** Gets or sets background color (Black by default) */
     public get background(): string {
@@ -60,7 +60,7 @@ export class DisplayGrid extends Control {
 
         this._background = value;
         this._markAsDirty();
-    }    
+    }
 
     /** Gets or sets the width of each cell (20 by default) */
     public get cellWidth(): number {
@@ -104,7 +104,7 @@ export class DisplayGrid extends Control {
         this._minorLineColor = value;
 
         this._markAsDirty();
-    }    
+    }
 
     /** Gets or sets the tickness of major lines (2 by default) */
     public get majorLineTickness(): number {
@@ -126,7 +126,7 @@ export class DisplayGrid extends Control {
         this._majorLineColor = value;
 
         this._markAsDirty();
-    }    
+    }
 
     /** Gets or sets the frequency of major lines (default is 1 every 5 minor lines)*/
     public get majorLineFrequency(): number {
@@ -149,7 +149,7 @@ export class DisplayGrid extends Control {
 
     public _draw(parentMeasure: Measure, context: CanvasRenderingContext2D): void {
         context.save();
-        
+
         this._applyStates(context);
 
         if (this._isEnabled && this._processMeasures(parentMeasure, context)) {
@@ -162,13 +162,13 @@ export class DisplayGrid extends Control {
             let cellCountX = this._currentMeasure.width / this._cellWidth;
             let cellCountY = this._currentMeasure.height / this._cellHeight;
 
-            // Minor lines    
+            // Minor lines
             const left = this._currentMeasure.left + this._currentMeasure.width / 2;
             const top = this._currentMeasure.top + this._currentMeasure.height / 2;
 
             if (this._displayMinorLines) {
                 context.strokeStyle = this._minorLineColor;
-                context.lineWidth = this._minorLineTickness;    
+                context.lineWidth = this._minorLineTickness;
 
                 for (var x = -cellCountX / 2; x < cellCountX / 2; x++) {
                     const cellX = left + x * this.cellWidth;
@@ -176,8 +176,8 @@ export class DisplayGrid extends Control {
                     context.beginPath();
                     context.moveTo(cellX, this._currentMeasure.top);
                     context.lineTo(cellX, this._currentMeasure.top + this._currentMeasure.height);
-                    
-                    context.stroke();                
+
+                    context.stroke();
                 }
 
                 for (var y = -cellCountY / 2; y < cellCountY / 2; y++) {
@@ -193,12 +193,12 @@ export class DisplayGrid extends Control {
             // Major lines
             if (this._displayMajorLines) {
                 context.strokeStyle = this._majorLineColor;
-                context.lineWidth = this._majorLineTickness;        
+                context.lineWidth = this._majorLineTickness;
 
                 for (var x = -cellCountX / 2 + this._majorLineFrequency; x < cellCountX / 2; x += this._majorLineFrequency) {
                     let cellX = left + x * this.cellWidth;
 
-                    context.beginPath();    
+                    context.beginPath();
                     context.moveTo(cellX, this._currentMeasure.top);
                     context.lineTo(cellX, this._currentMeasure.top + this._currentMeasure.height);
                     context.stroke();
@@ -220,4 +220,4 @@ export class DisplayGrid extends Control {
     protected _getTypeName(): string {
         return "DisplayGrid";
     }
-}    
+}

+ 1 - 1
gui/src/2D/controls/ellipse.ts

@@ -84,4 +84,4 @@ export class Ellipse extends Container {
 
         context.clip();
     }
-}   
+}

+ 9 - 9
gui/src/2D/controls/image.ts

@@ -91,8 +91,8 @@ export class Image extends Control {
         this._markAsDirty();
     }
 
-    /** 
-     * Gets or sets a boolean indicating if the image can force its container to adapt its size 
+    /**
+     * Gets or sets a boolean indicating if the image can force its container to adapt its size
      * @see http://doc.babylonjs.com/how_to/gui#image
      */
     public get autoScale(): boolean {
@@ -138,7 +138,7 @@ export class Image extends Control {
         } else {
             this._domImage.onload = () => {
                 this._onImageLoaded();
-            }
+            };
         }
     }
 
@@ -173,15 +173,15 @@ export class Image extends Control {
 
         this._domImage.onload = () => {
             this._onImageLoaded();
-        }
+        };
         if (value) {
             Tools.SetCorsBehavior(value, this._domImage);
             this._domImage.src = value;
         }
     }
 
-    /** 
-     * Gets or sets the cell width to use when animation sheet is enabled 
+    /**
+     * Gets or sets the cell width to use when animation sheet is enabled
      * @see http://doc.babylonjs.com/how_to/gui#image
      */
     get cellWidth(): number {
@@ -196,8 +196,8 @@ export class Image extends Control {
         this._markAsDirty();
     }
 
-    /** 
-     * Gets or sets the cell height to use when animation sheet is enabled 
+    /**
+     * Gets or sets the cell height to use when animation sheet is enabled
      * @see http://doc.babylonjs.com/how_to/gui#image
      */
     get cellHeight(): number {
@@ -212,7 +212,7 @@ export class Image extends Control {
         this._markAsDirty();
     }
 
-    /** 
+    /**
      * Gets or sets the cell id to use (this will turn on the animation sheet mode)
      * @see http://doc.babylonjs.com/how_to/gui#image
      */

+ 2 - 2
gui/src/2D/controls/inputText.ts

@@ -250,7 +250,7 @@ export class InputText extends Control implements IFocusableControl {
 
     /** @hidden */
     public onFocus(): void {
-        if(!this._isEnabled) {
+        if (!this._isEnabled) {
             return;
         }
         this._scrollLeft = null;
@@ -533,7 +533,7 @@ export class InputText extends Control implements IFocusableControl {
             this._markAsDirty();
             return true;
         }
-        if(!this._isEnabled) {
+        if (!this._isEnabled) {
             return false;
         }
         this._host.focusedControl = this;

+ 2 - 2
gui/src/2D/controls/line.ts

@@ -212,7 +212,7 @@ export class Line extends Control {
         var globalViewport = this._host._getGlobalViewport(scene);
         var projectedPosition = Vector3.Project(position, Matrix.Identity(), scene.getTransformMatrix(), globalViewport);
 
-        this._moveToProjectedPosition(projectedPosition, end)
+        this._moveToProjectedPosition(projectedPosition, end);
 
         if (projectedPosition.z < 0 || projectedPosition.z > 1) {
             this.notRenderable = true;
@@ -242,4 +242,4 @@ export class Line extends Control {
             this._y1.ignoreAdaptiveScaling = true;
         }
     }
-}   
+}

+ 16 - 17
gui/src/2D/controls/multiLine.ts

@@ -3,7 +3,6 @@ import { MultiLinePoint } from "../multiLinePoint";
 import { Nullable, AbstractMesh } from "babylonjs";
 import { Measure } from "../measure";
 
-
 /**
  * Class used to create multi line control
  */
@@ -67,22 +66,22 @@ export class MultiLine extends Control {
 
     /**
      * Adds new points to the point collection
-     * @param items defines the list of items (mesh, control or 2d coordiantes) to add 
+     * @param items defines the list of items (mesh, control or 2d coordiantes) to add
      * @returns the list of created MultiLinePoint
      */
     public add(...items: (AbstractMesh | Control | { x: string | number, y: string | number })[]): MultiLinePoint[] {
-        return items.map(item => this.push(item));
+        return items.map((item) => this.push(item));
     }
 
     /**
      * Adds a new point to the point collection
-     * @param item defines the item (mesh, control or 2d coordiantes) to add 
+     * @param item defines the item (mesh, control or 2d coordiantes) to add
      * @returns the created MultiLinePoint
      */
     public push(item?: (AbstractMesh | Control | { x: string | number, y: string | number })): MultiLinePoint {
         var point: MultiLinePoint = this.getAt(this._points.length);
 
-        if (item == null) return point;
+        if (item == null) { return point; }
 
         if (item instanceof AbstractMesh) {
             point.mesh = item;
@@ -140,8 +139,8 @@ export class MultiLine extends Control {
      * Resets all links
      */
     public resetLinks(): void {
-        this._points.forEach(point => {
-            if (point != null) point.resetLinks();
+        this._points.forEach((point) => {
+            if (point != null) { point.resetLinks(); }
         });
     }
 
@@ -192,7 +191,7 @@ export class MultiLine extends Control {
 
             var first: boolean = true; //first index is not necessarily 0
 
-            this._points.forEach(point => {
+            this._points.forEach((point) => {
                 if (!point) {
                     return;
                 }
@@ -226,16 +225,16 @@ export class MultiLine extends Control {
 
             point.translate();
 
-            if (this._minX == null || point._point.x < this._minX) this._minX = point._point.x;
-            if (this._minY == null || point._point.y < this._minY) this._minY = point._point.y;
-            if (this._maxX == null || point._point.x > this._maxX) this._maxX = point._point.x;
-            if (this._maxY == null || point._point.y > this._maxY) this._maxY = point._point.y;
+            if (this._minX == null || point._point.x < this._minX) { this._minX = point._point.x; }
+            if (this._minY == null || point._point.y < this._minY) { this._minY = point._point.y; }
+            if (this._maxX == null || point._point.x > this._maxX) { this._maxX = point._point.x; }
+            if (this._maxY == null || point._point.y > this._maxY) { this._maxY = point._point.y; }
         });
 
-        if (this._minX == null) this._minX = 0;
-        if (this._minY == null) this._minY = 0;
-        if (this._maxX == null) this._maxX = 0;
-        if (this._maxY == null) this._maxY = 0;
+        if (this._minX == null) { this._minX = 0; }
+        if (this._minY == null) { this._minY = 0; }
+        if (this._maxX == null) { this._maxX = 0; }
+        if (this._maxY == null) { this._maxY = 0; }
     }
 
     public _measure(): void {
@@ -262,4 +261,4 @@ export class MultiLine extends Control {
         super.dispose();
     }
 
-}    
+}

+ 4 - 4
gui/src/2D/controls/radioButton.ts

@@ -191,16 +191,16 @@ export class RadioButton extends Control {
         radio.color = "green";
         radio.group = group;
         radio.onIsCheckedChangedObservable.add((value) => onValueChanged(radio, value));
-        panel.addControl(radio);    
-    
+        panel.addControl(radio);
+
         var header = new TextBlock();
         header.text = title;
         header.width = "180px";
         header.paddingLeft = "5px";
         header.textHorizontalAlignment = Control.HORIZONTAL_ALIGNMENT_LEFT;
         header.color = "white";
-        panel.addControl(header); 
+        panel.addControl(header);
 
         return panel;
     }
-}   
+}

+ 2 - 2
gui/src/2D/controls/rectangle.ts

@@ -49,7 +49,7 @@ export class Rectangle extends Container {
     protected _getTypeName(): string {
         return "Rectangle";
     }
-    
+
     protected _localDraw(context: CanvasRenderingContext2D): void {
         context.save();
 
@@ -132,4 +132,4 @@ export class Rectangle extends Container {
             context.clip();
         }
     }
-}    
+}

+ 103 - 106
gui/src/2D/controls/selector.ts

@@ -1,13 +1,13 @@
-import {Rectangle} from "./rectangle";
-import {StackPanel} from "./stackPanel";
-import {Control} from "./control";
-import {TextBlock} from "./textBlock";
-import {Checkbox} from "./checkbox";
-import {RadioButton} from "./radioButton";
-import {Slider} from "./slider";
+import { Rectangle } from "./rectangle";
+import { StackPanel } from "./stackPanel";
+import { Control } from "./control";
+import { TextBlock } from "./textBlock";
+import { Checkbox } from "./checkbox";
+import { RadioButton } from "./radioButton";
+import { Slider } from "./slider";
 import { Container } from "./container";
 
-/** Class used to create a RadioGroup 
+/** Class used to create a RadioGroup
  * which contains groups of radio buttons
 */
 export class SelectorGroup {
@@ -21,7 +21,7 @@ export class SelectorGroup {
      */
     constructor(
         /** name of SelectorGroup */
-        public name: string, ) {
+        public name: string) {
 
         this._groupPanel.verticalAlignment = Control.VERTICAL_ALIGNMENT_TOP;
         this._groupPanel.horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_LEFT;
@@ -44,11 +44,11 @@ export class SelectorGroup {
     }
 
     public set header(label: string) {
-        if(this._groupHeader.text === "label") {
-            return
+        if (this._groupHeader.text === "label") {
+            return;
         }
 
-        this._groupHeader.text = label
+        this._groupHeader.text = label;
     }
 
     /** @hidden */
@@ -67,17 +67,17 @@ export class SelectorGroup {
 
     /** @hidden*/
     public _getSelector(selectorNb: number) {
-        if(selectorNb < 0 || selectorNb >= this._selectors.length) {
+        if (selectorNb < 0 || selectorNb >= this._selectors.length) {
             return;
         }
         return this._selectors[selectorNb];
     }
 
-     /** Removes the selector at the given position 
-     * @param selectorNb the position of the selector within the group
-    */
+    /** Removes the selector at the given position
+    * @param selectorNb the position of the selector within the group
+   */
     public removeSelector(selectorNb: number) {
-        if(selectorNb < 0 || selectorNb >= this._selectors.length) {
+        if (selectorNb < 0 || selectorNb >= this._selectors.length) {
             return;
         }
         this._groupPanel.removeControl(this._selectors[selectorNb]);
@@ -86,41 +86,41 @@ export class SelectorGroup {
 
 }
 
-/** Class used to create a CheckboxGroup 
+/** Class used to create a CheckboxGroup
  * which contains groups of checkbox buttons
 */
-export class CheckboxGroup extends SelectorGroup{
+export class CheckboxGroup extends SelectorGroup {
     /** Adds a checkbox as a control
      * @param text is the label for the selector
      * @param func is the function called when the Selector is checked
      * @param checked is true when Selector is checked
      */
-    public addCheckbox(text: string, func = (s: boolean)=>{}, checked: boolean = false): void {
+    public addCheckbox(text: string, func = (s: boolean) => { }, checked: boolean = false): void {
         var checked = checked || false;
         var button = new Checkbox();
         button.width = "20px";
         button.height = "20px";
         button.color = "#364249";
-        button.background = "#CCCCCC"; 
+        button.background = "#CCCCCC";
         button.horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_LEFT;
-    
-        button.onIsCheckedChangedObservable.add(function(state) {				
-            func(state);	
-        }); 
-    
+
+        button.onIsCheckedChangedObservable.add(function(state) {
+            func(state);
+        });
+
         var _selector = Control.AddHeader(button, text, "200px", { isHorizontal: true, controlFirst: true });
         _selector.height = "30px";
         _selector.horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_LEFT;
         _selector.left = "4px";
-    
+
         this.groupPanel.addControl(_selector);
         this.selectors.push(_selector);
         button.isChecked = checked;
 
-        if(this.groupPanel.parent && this.groupPanel.parent.parent) {
+        if (this.groupPanel.parent && this.groupPanel.parent.parent) {
             button.color = (<SelectionPanel>this.groupPanel.parent.parent).buttonColor;
             button.background = (<SelectionPanel>this.groupPanel.parent.parent).buttonBackground;
-        } 
+        }
     }
 
     /** @hidden */
@@ -133,7 +133,6 @@ export class CheckboxGroup extends SelectorGroup{
         (<TextBlock>this.selectors[selectorNb].children[1]).color = color;
     }
 
-
     /** @hidden */
     public _setSelectorButtonColor(selectorNb: number, color: string) {
         this.selectors[selectorNb].children[0].color = color;
@@ -145,10 +144,10 @@ export class CheckboxGroup extends SelectorGroup{
     }
 }
 
-/** Class used to create a RadioGroup 
+/** Class used to create a RadioGroup
  * which contains groups of radio buttons
 */
-export class RadioGroup extends SelectorGroup{
+export class RadioGroup extends SelectorGroup {
     private _selectNb = 0;
 
     /** Adds a radio button as a control
@@ -156,23 +155,23 @@ export class RadioGroup extends SelectorGroup{
      * @param func is the function called when the Selector is checked
      * @param checked is true when Selector is checked
      */
-    public addRadio(label: string, func = (n:number) => {} , checked = false): void {				
+    public addRadio(label: string, func = (n: number) => { }, checked = false): void {
         var nb = this._selectNb++;
         var button = new RadioButton();
         button.name = label;
         button.width = "20px";
         button.height = "20px";
         button.color = "#364249";
-        button.background = "#CCCCCC"; 
+        button.background = "#CCCCCC";
         button.group = this.name;
         button.horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_LEFT;
 
         button.onIsCheckedChangedObservable.add(function(state) {
-            if(state) {
+            if (state) {
                 func(nb);
             }
         });
-        
+
         var _selector = Control.AddHeader(button, label, "200px", { isHorizontal: true, controlFirst: true });
         _selector.height = "30px";
         _selector.horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_LEFT;
@@ -180,11 +179,11 @@ export class RadioGroup extends SelectorGroup{
         this.groupPanel.addControl(_selector);
         this.selectors.push(_selector);
         button.isChecked = checked;
-        
-        if(this.groupPanel.parent && this.groupPanel.parent.parent) {
+
+        if (this.groupPanel.parent && this.groupPanel.parent.parent) {
             button.color = (<SelectionPanel>this.groupPanel.parent.parent).buttonColor;
             button.background = (<SelectionPanel>this.groupPanel.parent.parent).buttonBackground;
-        } 
+        }
     }
 
     /** @hidden */
@@ -208,10 +207,10 @@ export class RadioGroup extends SelectorGroup{
     }
 }
 
-/** Class used to create a SliderGroup 
+/** Class used to create a SliderGroup
  * which contains groups of slider buttons
 */
-export class SliderGroup extends SelectorGroup{
+export class SliderGroup extends SelectorGroup {
     /**
      * Adds a slider to the SelectorGroup
      * @param label is the label for the SliderBar
@@ -222,12 +221,12 @@ export class SliderGroup extends SelectorGroup{
      * @param value is the start value for the Slider between min and max
      * @param onValueChange is the function used to format the value displayed, eg radians to degrees
      */
-    public addSlider(label: string, func = (v:number) => {}, unit: string = "Units", min: number = 0, max: number = 0, value: number = 0, onValueChange = (v:number)=>{return v | 0}): void {
+    public addSlider(label: string, func = (v: number) => { }, unit: string = "Units", min: number = 0, max: number = 0, value: number = 0, onValueChange = (v: number) => { return v | 0; }): void {
         var button = new Slider();
         button.name = unit;
         button.value = value;
         button.minimum = min;
-        button.maximum = max;				
+        button.maximum = max;
         button.width = 0.9;
         button.height = "20px";
         button.color = "#364249";
@@ -241,7 +240,7 @@ export class SliderGroup extends SelectorGroup{
             (<TextBlock>button.parent!.children[0]).text = button.parent!.children[0].name + ": " + onValueChange(value) + " " + button.name;
             func(value);
         });
-        
+
         var _selector = Control.AddHeader(button, label + ": " + onValueChange(value) + " " + unit, "30px", { isHorizontal: false, controlFirst: false });
         _selector.height = "60px";
         _selector.horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_LEFT;
@@ -249,8 +248,8 @@ export class SliderGroup extends SelectorGroup{
         _selector.children[0].name = label;
         this.groupPanel.addControl(_selector);
         this.selectors.push(_selector);
-        
-        if(this.groupPanel.parent && this.groupPanel.parent.parent) {
+
+        if (this.groupPanel.parent && this.groupPanel.parent.parent) {
             button.color = (<SelectionPanel>this.groupPanel.parent.parent).buttonColor;
             button.background = (<SelectionPanel>this.groupPanel.parent.parent).buttonBackground;
         }
@@ -278,14 +277,13 @@ export class SliderGroup extends SelectorGroup{
     }
 }
 
-
-/** Class used to hold the controls for the checkboxes, radio buttons and sliders 
+/** Class used to hold the controls for the checkboxes, radio buttons and sliders
  * @see http://doc.babylonjs.com/how_to/selector
 */
 export class SelectionPanel extends Rectangle {
     private _panel: StackPanel;
     private _buttonColor: string = "#364249";
-    private _buttonBackground: string = "#CCCCCC"; 
+    private _buttonBackground: string = "#CCCCCC";
     private _headerColor: string = "black";
     private _barColor: string = "white";
     private _barHeight: string = "2px";
@@ -301,7 +299,7 @@ export class SelectionPanel extends Rectangle {
     */
     constructor(
         /** name of SelectionPanel */
-        public name: string, 
+        public name: string,
         /** an array of SelectionGroups */
         public groups: SelectorGroup[] = []) {
         super(name);
@@ -313,27 +311,27 @@ export class SelectionPanel extends Rectangle {
         this._panel.top = 5;
         this._panel.left = 5;
         this._panel.width = 0.95;
-        if(groups.length > 0) {
-            for(var i = 0; i < groups.length - 1; i++) {
+        if (groups.length > 0) {
+            for (var i = 0; i < groups.length - 1; i++) {
                 this._panel.addControl(groups[i].groupPanel);
                 this._addSpacer();
             }
             this._panel.addControl(groups[groups.length - 1].groupPanel);
-        }				
+        }
         this.addControl(this._panel);
     }
 
     protected _getTypeName(): string {
         return "SelectionPanel";
     }
-    
+
     /** Gets or sets the headerColor */
     public get headerColor(): string {
         return this._headerColor;
     }
 
     public set headerColor(color: string) {
-        if(this._headerColor === color) {
+        if (this._headerColor === color) {
             return;
         }
         this._headerColor = color;
@@ -342,7 +340,7 @@ export class SelectionPanel extends Rectangle {
     }
 
     private _setHeaderColor() {
-        for(var i = 0; i < this._groups.length; i++) {
+        for (var i = 0; i < this._groups.length; i++) {
             this._groups[i].groupPanel.children[0].color = this._headerColor;
         }
     }
@@ -353,7 +351,7 @@ export class SelectionPanel extends Rectangle {
     }
 
     public set buttonColor(color: string) {
-        if(this._buttonColor === color) {
+        if (this._buttonColor === color) {
             return;
         }
 
@@ -363,10 +361,10 @@ export class SelectionPanel extends Rectangle {
     }
 
     private _setbuttonColor() {
-        for(var i = 0; i < this._groups.length; i++) {
-            for(var j = 0; j < this._groups[i].selectors.length; j++) {
-                (<CheckboxGroup|RadioGroup|SliderGroup>this._groups[i])._setSelectorButtonColor(j, this._buttonColor);
-            }         
+        for (var i = 0; i < this._groups.length; i++) {
+            for (var j = 0; j < this._groups[i].selectors.length; j++) {
+                (<CheckboxGroup | RadioGroup | SliderGroup>this._groups[i])._setSelectorButtonColor(j, this._buttonColor);
+            }
         }
     }
 
@@ -376,7 +374,7 @@ export class SelectionPanel extends Rectangle {
     }
 
     public set labelColor(color: string) {
-        if(this._labelColor === color) {
+        if (this._labelColor === color) {
             return;
         }
         this._labelColor = color;
@@ -384,10 +382,10 @@ export class SelectionPanel extends Rectangle {
     }
 
     private _setLabelColor() {
-        for(var i = 0; i < this._groups.length; i++) {
-            for(var j = 0; j < this._groups[i].selectors.length; j++) {
-                (<CheckboxGroup|RadioGroup|SliderGroup>this._groups[i])._setSelectorLabelColor(j, this._labelColor);
-            }         
+        for (var i = 0; i < this._groups.length; i++) {
+            for (var j = 0; j < this._groups[i].selectors.length; j++) {
+                (<CheckboxGroup | RadioGroup | SliderGroup>this._groups[i])._setSelectorLabelColor(j, this._labelColor);
+            }
         }
     }
 
@@ -397,7 +395,7 @@ export class SelectionPanel extends Rectangle {
     }
 
     public set buttonBackground(color: string) {
-        if(this._buttonBackground === color) {
+        if (this._buttonBackground === color) {
             return;
         }
 
@@ -407,10 +405,10 @@ export class SelectionPanel extends Rectangle {
     }
 
     private _setButtonBackground() {
-        for(var i = 0; i < this._groups.length; i++) {
-            for(var j = 0; j < this._groups[i].selectors.length; j++) {
-                (<CheckboxGroup|RadioGroup|SliderGroup>this._groups[i])._setSelectorButtonBackground(j, this._buttonBackground);
-            }         
+        for (var i = 0; i < this._groups.length; i++) {
+            for (var j = 0; j < this._groups[i].selectors.length; j++) {
+                (<CheckboxGroup | RadioGroup | SliderGroup>this._groups[i])._setSelectorButtonBackground(j, this._buttonBackground);
+            }
         }
     }
 
@@ -420,16 +418,16 @@ export class SelectionPanel extends Rectangle {
     }
 
     public set barColor(color: string) {
-       if(this._barColor === color) {
-           return;
-       }
-       
-       this._barColor = color;
-       this._setBarColor();
+        if (this._barColor === color) {
+            return;
+        }
+
+        this._barColor = color;
+        this._setBarColor();
     }
 
     private _setBarColor() {
-        for(var i = 0; i < this._bars.length; i++) {
+        for (var i = 0; i < this._bars.length; i++) {
             this._bars[i].children[0].background = this._barColor;
         }
     }
@@ -440,16 +438,16 @@ export class SelectionPanel extends Rectangle {
     }
 
     public set barHeight(value: string) {
-        if(this._barHeight === value) {
+        if (this._barHeight === value) {
             return;
         }
-        
+
         this._barHeight = value;
         this._setBarHeight();
     }
 
     private _setBarHeight() {
-        for(var i = 0; i < this._bars.length; i++) {
+        for (var i = 0; i < this._bars.length; i++) {
             this._bars[i].children[0].height = this._barHeight;
         }
     }
@@ -460,16 +458,16 @@ export class SelectionPanel extends Rectangle {
     }
 
     public set spacerHeight(value: string) {
-        if(this._spacerHeight === value) {
+        if (this._spacerHeight === value) {
             return;
         }
-        
+
         this._spacerHeight = value;
         this._setSpacerHeight();
     }
 
     private _setSpacerHeight() {
-        for(var i = 0; i < this._bars.length; i++) {
+        for (var i = 0; i < this._bars.length; i++) {
             this._bars[i].height = this._spacerHeight;
         }
     }
@@ -498,15 +496,15 @@ export class SelectionPanel extends Rectangle {
      * @param group is the selector group to add
      */
     public addGroup(group: SelectorGroup): void {
-        if(this._groups.length > 0) {
+        if (this._groups.length > 0) {
             this._addSpacer();
         }
         this._panel.addControl(group.groupPanel);
         this._groups.push(group);
         group.groupPanel.children[0].color = this._headerColor;
-        for(var j = 0; j < group.selectors.length; j++) {
-            (<CheckboxGroup|RadioGroup|SliderGroup>group)._setSelectorButtonColor(j, this._buttonColor);
-            (<CheckboxGroup|RadioGroup|SliderGroup>group)._setSelectorButtonBackground(j, this._buttonBackground);
+        for (var j = 0; j < group.selectors.length; j++) {
+            (<CheckboxGroup | RadioGroup | SliderGroup>group)._setSelectorButtonColor(j, this._buttonColor);
+            (<CheckboxGroup | RadioGroup | SliderGroup>group)._setSelectorButtonBackground(j, this._buttonBackground);
         }
     }
 
@@ -514,13 +512,13 @@ export class SelectionPanel extends Rectangle {
      * @param groupNb is the position of the group in the list
      */
     public removeGroup(groupNb: number): void {
-        if(groupNb < 0 || groupNb >= this._groups.length) {
+        if (groupNb < 0 || groupNb >= this._groups.length) {
             return;
         }
         var group = this._groups[groupNb];
         this._panel.removeControl(group.groupPanel);
         this._groups.splice(groupNb, 1);
-        if(groupNb < this._bars.length) {
+        if (groupNb < this._bars.length) {
             this._panel.removeControl(this._bars[groupNb]);
             this._bars.splice(groupNb, 1);
         }
@@ -531,28 +529,27 @@ export class SelectionPanel extends Rectangle {
      * @param groupNb is the number of the group to relabel
      * */
     public setHeaderName(label: string, groupNb: number) {
-        if(groupNb < 0 || groupNb >= this._groups.length) {
+        if (groupNb < 0 || groupNb >= this._groups.length) {
             return;
         }
         var group = this._groups[groupNb];
         (<TextBlock>group.groupPanel.children[0]).text = label;
     }
 
-
-    /** Change selector label to the one given 
+    /** Change selector label to the one given
      * @param label is the new selector label
      * @param groupNb is the number of the groupcontaining the selector
      * @param selectorNb is the number of the selector within a group to relabel
-     * */ 
+     * */
     public relabel(label: string, groupNb: number, selectorNb: number): void {
-        if(groupNb < 0 || groupNb >= this._groups.length) {
+        if (groupNb < 0 || groupNb >= this._groups.length) {
             return;
         }
         var group = this._groups[groupNb];
-        if(selectorNb < 0 || selectorNb >= group.selectors.length) {
+        if (selectorNb < 0 || selectorNb >= group.selectors.length) {
             return;
         }
-        (<CheckboxGroup|RadioGroup|SliderGroup>group)._setSelectorLabel(selectorNb, label);
+        (<CheckboxGroup | RadioGroup | SliderGroup>group)._setSelectorLabel(selectorNb, label);
     }
 
     /** For a given group position remove the selector at the given position
@@ -560,11 +557,11 @@ export class SelectionPanel extends Rectangle {
      * @param selectorNb is the number of the selector within the group
      */
     public removeFromGroupSelector(groupNb: number, selectorNb: number): void {
-        if(groupNb < 0 || groupNb >= this._groups.length) {
+        if (groupNb < 0 || groupNb >= this._groups.length) {
             return;
         }
         var group = this._groups[groupNb];
-        if(selectorNb < 0 || selectorNb >= group.selectors.length) {
+        if (selectorNb < 0 || selectorNb >= group.selectors.length) {
             return;
         }
         group.removeSelector(selectorNb);
@@ -576,8 +573,8 @@ export class SelectionPanel extends Rectangle {
      * @param func is the function called when the Selector is checked
      * @param checked is true when Selector is checked
      */
-    public addToGroupCheckbox(groupNb: number, label: string, func = () => {} , checked: boolean = false): void {
-        if(groupNb < 0 || groupNb >= this._groups.length) {
+    public addToGroupCheckbox(groupNb: number, label: string, func = () => { }, checked: boolean = false): void {
+        if (groupNb < 0 || groupNb >= this._groups.length) {
             return;
         }
         var group = this._groups[groupNb];
@@ -590,8 +587,8 @@ export class SelectionPanel extends Rectangle {
      * @param func is the function called when the Selector is checked
      * @param checked is true when Selector is checked
      */
-    public addToGroupRadio(groupNb: number, label: string, func = () => {} , checked: boolean = false): void {
-        if(groupNb < 0 || groupNb >= this._groups.length) {
+    public addToGroupRadio(groupNb: number, label: string, func = () => { }, checked: boolean = false): void {
+        if (groupNb < 0 || groupNb >= this._groups.length) {
             return;
         }
         var group = this._groups[groupNb];
@@ -609,12 +606,12 @@ export class SelectionPanel extends Rectangle {
      * @param value is the start value for the Slider between min and max
      * @param onVal is the function used to format the value displayed, eg radians to degrees
      */
-    public addToGroupSlider(groupNb: number, label: string, func = () => {}, unit: string = "Units", min: number = 0, max: number = 0, value: number = 0, onVal = (v:number)=>{return v | 0}): void {
-        if(groupNb < 0 || groupNb >= this._groups.length) {
+    public addToGroupSlider(groupNb: number, label: string, func = () => { }, unit: string = "Units", min: number = 0, max: number = 0, value: number = 0, onVal = (v: number) => { return v | 0; }): void {
+        if (groupNb < 0 || groupNb >= this._groups.length) {
             return;
         }
         var group = this._groups[groupNb];
         (<SliderGroup>group).addSlider(label, func, unit, min, max, value, onVal);
     }
-    
+
 }

+ 6 - 8
gui/src/2D/controls/slider.ts

@@ -216,7 +216,6 @@ export class Slider extends Control {
         return thumbThickness;
     }
 
-
     public _draw(parentMeasure: Measure, context: CanvasRenderingContext2D): void {
         context.save();
 
@@ -238,7 +237,6 @@ export class Slider extends Control {
 
             var radius = 0;
 
-
             //throw error when height is less than width for vertical slider
             if ((this._isVertical && this._currentMeasure.height < this._currentMeasure.width)) {
                 console.error("Height should be greater than width");
@@ -273,10 +271,12 @@ export class Slider extends Control {
             }
 
             if (this.isThumbClamped && this.isThumbCircle) {
-                if (this._isVertical)
-                    top += (effectiveThumbThickness / 2);
-                else
-                    left += (effectiveThumbThickness / 2);
+                if (this._isVertical) {
+                    top += (effectiveThumbThickness / 2);
+                }
+                else {
+                    left += (effectiveThumbThickness / 2);
+                }
 
                 radius = backgroundBoxThickness / 2;
             }
@@ -367,7 +367,6 @@ export class Slider extends Control {
                 }
             }
 
-
             if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) {
                 context.shadowColor = this.shadowColor;
                 context.shadowBlur = this.shadowBlur;
@@ -415,7 +414,6 @@ export class Slider extends Control {
         context.restore();
     }
 
-
     // Events
     private _pointerIsDown = false;
 

+ 1 - 1
gui/src/2D/controls/stackPanel.ts

@@ -150,4 +150,4 @@ export class StackPanel extends Container {
 
         super._preMeasure(parentMeasure, context);
     }
-}  
+}

+ 2 - 2
gui/src/2D/controls/statics.ts

@@ -18,7 +18,7 @@ export { name };
  * @param options defines options used to configure the header
  * @returns a new StackPanel
  */
-Control.AddHeader = function (control: Control, text: string, size: string | number, options: { isHorizontal: boolean, controlFirst: boolean }): StackPanel {
+Control.AddHeader = function(control: Control, text: string, size: string | number, options: { isHorizontal: boolean, controlFirst: boolean }): StackPanel {
     let panel = new StackPanel("panel");
     let isHorizontal = options ? options.isHorizontal : true;
     let controlFirst = options ? options.controlFirst : true;
@@ -50,4 +50,4 @@ Control.AddHeader = function (control: Control, text: string, size: string | num
     header.shadowOffsetY = control.shadowOffsetY;
 
     return panel;
-}
+};

+ 2 - 2
gui/src/2D/controls/textBlock.ts

@@ -226,7 +226,7 @@ export class TextBlock extends Control {
         var x = 0;
         switch (this._textHorizontalAlignment) {
             case Control.HORIZONTAL_ALIGNMENT_LEFT:
-                x = 0
+                x = 0;
                 break;
             case Control.HORIZONTAL_ALIGNMENT_RIGHT:
                 x = width - textWidth;
@@ -378,7 +378,7 @@ export class TextBlock extends Control {
             this._drawText(line.text, line.width, rootY, context);
             rootY += this._fontOffset.height;
 
-            if (line.width > maxLineWidth) maxLineWidth = line.width;
+            if (line.width > maxLineWidth) { maxLineWidth = line.width; }
         }
 
         if (this._resizeToFit) {

+ 12 - 13
gui/src/2D/controls/virtualKeyboard.ts

@@ -5,7 +5,6 @@ import { Container } from "./container";
 import { TextBlock } from "./textBlock";
 import { InputText } from "./inputText";
 
-
 /**
  * Class used to store key control properties
  */
@@ -32,7 +31,7 @@ type ConnectedInputText = {
     input: InputText,
     onFocusObserver: Nullable<Observer<InputText>>,
     onBlurObserver: Nullable<Observer<InputText>>
-}
+};
 
 /**
  * Class used to create virtual keyboard
@@ -168,11 +167,11 @@ export class VirtualKeyboard extends StackPanel {
 
     /**
      * Connects the keyboard with an input text control
-     * 
+     *
      * @param input defines the target control
      */
     public connect(input: InputText): void {
-        const inputTextAlreadyConnected = this._connectedInputTexts.some(a => a.input === input);
+        const inputTextAlreadyConnected = this._connectedInputTexts.some((a) => a.input === input);
         if (inputTextAlreadyConnected) {
             return;
         }
@@ -201,7 +200,7 @@ export class VirtualKeyboard extends StackPanel {
                         return;
                 }
                 this._currentlyConnectedInputText.processKey(-1, (this.shiftState ? key.toUpperCase() : key));
-    
+
                 if (this.shiftState === 1) {
                     this.shiftState = 0;
                     this.applyShiftState(this.shiftState);
@@ -212,7 +211,7 @@ export class VirtualKeyboard extends StackPanel {
         this.isVisible = false;
         this._currentlyConnectedInputText = input;
         input._connectedVirtualKeyboard = this;
-        
+
         // Events hooking
         const onFocusObserver: Nullable<Observer<InputText>> = input.onFocusObservable.add(() => {
             this._currentlyConnectedInputText = input;
@@ -230,31 +229,31 @@ export class VirtualKeyboard extends StackPanel {
             input,
             onBlurObserver,
             onFocusObserver
-        })
+        });
     }
 
     /**
      * Disconnects the keyboard from connected InputText controls
-     * 
+     *
      * @param input optionally defines a target control, otherwise all are disconnected
      */
     public disconnect(input?: InputText): void {
         if (input) {
             // .find not available on IE
-            let filtered = this._connectedInputTexts.filter(a => a.input === input);
+            let filtered = this._connectedInputTexts.filter((a) => a.input === input);
             if (filtered.length === 1) {
                 this._removeConnectedInputObservables(filtered[0]);
-                
-                this._connectedInputTexts = this._connectedInputTexts.filter(a => a.input !== input);
+
+                this._connectedInputTexts = this._connectedInputTexts.filter((a) => a.input !== input);
                 if (this._currentlyConnectedInputText === input) {
                     this._currentlyConnectedInputText = null;
                 }
             }
         } else {
             this._connectedInputTexts.forEach((connectedInputText: ConnectedInputText) => {
-                this._removeConnectedInputObservables(connectedInputText)
+                this._removeConnectedInputObservables(connectedInputText);
             });
-            this._connectedInputTexts = []
+            this._connectedInputTexts = [];
         }
 
         if (this._connectedInputTexts.length === 0) {

+ 17 - 17
gui/src/2D/math2D.ts

@@ -24,11 +24,11 @@ export class Matrix2D {
     /**
      * Creates a new matrix
      * @param m00 defines value for (0, 0)
-     * @param m01 defines value for (0, 1) 
-     * @param m10 defines value for (1, 0) 
-     * @param m11 defines value for (1, 1) 
-     * @param m20 defines value for (2, 0) 
-     * @param m21 defines value for (2, 1) 
+     * @param m01 defines value for (0, 1)
+     * @param m10 defines value for (1, 0)
+     * @param m11 defines value for (1, 1)
+     * @param m20 defines value for (2, 0)
+     * @param m21 defines value for (2, 1)
      */
     constructor(m00: number, m01: number, m10: number, m11: number, m20: number, m21: number) {
         this.fromValues(m00, m01, m10, m11, m20, m21);
@@ -51,7 +51,7 @@ export class Matrix2D {
         return this;
     }
 
-    /** 
+    /**
      * Gets matrix determinant
      * @returns the determinant
      */
@@ -92,7 +92,7 @@ export class Matrix2D {
     /**
      * Multiplies the current matrix with another one
      * @param other defines the second operand
-     * @param result defines the target matrix 
+     * @param result defines the target matrix
      * @returns the current matrix
      */
     public multiplyToRef(other: Matrix2D, result: Matrix2D): Matrix2D {
@@ -114,8 +114,8 @@ export class Matrix2D {
     /**
      * Applies the current matrix to a set of 2 floats and stores the result in a vector2
      * @param x defines the x coordinate to transform
-     * @param y defines the x coordinate to transform 
-     * @param result defines the target vector2 
+     * @param y defines the x coordinate to transform
+     * @param result defines the target vector2
      * @returns the current matrix
      */
     public transformCoordinates(x: number, y: number, result: Vector2): Matrix2D {
@@ -137,7 +137,7 @@ export class Matrix2D {
     /**
      * Creates a translation matrix and stores it in a target matrix
      * @param x defines the x coordinate of the translation
-     * @param y defines the y coordinate of the translation 
+     * @param y defines the y coordinate of the translation
      * @param result defines the target matrix
      */
     public static TranslationToRef(x: number, y: number, result: Matrix2D): void {
@@ -147,7 +147,7 @@ export class Matrix2D {
     /**
      * Creates a scaling matrix and stores it in a target matrix
      * @param x defines the x coordinate of the scaling
-     * @param y defines the y coordinate of the scaling 
+     * @param y defines the y coordinate of the scaling
      * @param result defines the target matrix
      */
     public static ScalingToRef(x: number, y: number, result: Matrix2D): void {
@@ -175,14 +175,14 @@ export class Matrix2D {
     private static _TempCompose2 = Matrix2D.Identity();
 
     /**
-     * Composes a matrix from translation, rotation, scaling and parent matrix and stores it in a target matrix 
+     * Composes a matrix from translation, rotation, scaling and parent matrix and stores it in a target matrix
      * @param tx defines the x coordinate of the translation
-     * @param ty defines the y coordinate of the translation 
-     * @param angle defines the rotation angle 
+     * @param ty defines the y coordinate of the translation
+     * @param angle defines the rotation angle
      * @param scaleX defines the x coordinate of the scaling
-     * @param scaleY defines the y coordinate of the scaling 
+     * @param scaleY defines the y coordinate of the scaling
      * @param parentMatrix defines the parent matrix to multiply by (can be null)
-     * @param result defines the target matrix 
+     * @param result defines the target matrix
      */
     public static ComposeToRef(tx: number, ty: number, angle: number, scaleX: number, scaleY: number, parentMatrix: Nullable<Matrix2D>, result: Matrix2D): void {
         Matrix2D.TranslationToRef(tx, ty, Matrix2D._TempPreTranslationMatrix);
@@ -202,4 +202,4 @@ export class Matrix2D {
             Matrix2D._TempCompose1.multiplyToRef(Matrix2D._TempPostTranslationMatrix, result);
         }
     }
-}   
+}

+ 2 - 2
gui/src/2D/measure.ts

@@ -6,7 +6,7 @@ export class Measure {
     /**
      * Creates a new measure
      * @param left defines left coordinate
-     * @param top defines top coordinate 
+     * @param top defines top coordinate
      * @param width defines width dimension
      * @param height defines height dimension
      */
@@ -66,4 +66,4 @@ export class Measure {
     public static Empty(): Measure {
         return new Measure(0, 0, 0, 0);
     }
-}   
+}

+ 1 - 2
gui/src/2D/multiLinePoint.ts

@@ -3,7 +3,6 @@ import { ValueAndUnit } from "./valueAndUnit";
 import { Control } from "./controls/control";
 import { AbstractMesh, Nullable, Observer, Camera, Vector2 } from "babylonjs";
 
-
 /**
  * Class used to store a point for a MultiLine object.
  * The point can be pure 2D coordinates, a mesh or a control
@@ -120,7 +119,7 @@ export class MultiLinePoint {
         this.mesh = null;
     }
 
-    /** 
+    /**
      * Gets a translation vector
      * @returns the translation vector
      */

+ 2 - 2
gui/src/2D/style.ts

@@ -62,7 +62,7 @@ export class Style implements IDisposable {
     }
 
     /**
-     * Gets or sets the font style 
+     * Gets or sets the font style
      */
     public get fontStyle(): string {
         return this._fontStyle;
@@ -95,4 +95,4 @@ export class Style implements IDisposable {
     public dispose() {
         this.onChangedObservable.clear();
     }
-}    
+}

+ 1 - 1
gui/src/2D/valueAndUnit.ts

@@ -160,4 +160,4 @@ export class ValueAndUnit {
     public static get UNITMODE_PIXEL(): number {
         return ValueAndUnit._UNITMODE_PIXEL;
     }
-}  
+}

+ 4 - 4
gui/src/3D/controls/button3D.ts

@@ -72,11 +72,11 @@ export class Button3D extends AbstractButton3D {
                 return;
             }
             (<StandardMaterial>this._currentMaterial).emissiveColor = Color3.Red();
-        }
+        };
 
         this.pointerOutAnimation = () => {
             (<StandardMaterial>this._currentMaterial).emissiveColor = Color3.Black();
-        }
+        };
 
         this.pointerDownAnimation = () => {
             if (!this.mesh) {
@@ -84,7 +84,7 @@ export class Button3D extends AbstractButton3D {
             }
 
             this.mesh.scaling.scaleInPlace(0.95);
-        }
+        };
 
         this.pointerUpAnimation = () => {
             if (!this.mesh) {
@@ -92,7 +92,7 @@ export class Button3D extends AbstractButton3D {
             }
 
             this.mesh.scaling.scaleInPlace(1.0 / 0.95);
-        }
+        };
     }
 
     /**

+ 1 - 2
gui/src/3D/controls/container3D.ts

@@ -96,9 +96,8 @@ export class Container3D extends Control3D {
         return this;
     }
 
-
     /**
-     * This function will be called everytime a new control is added 
+     * This function will be called everytime a new control is added
      */
     protected _arrangeChildren() {
     }

+ 2 - 2
gui/src/3D/controls/control3D.ts

@@ -29,7 +29,7 @@ export class Control3D implements IDisposable, IBehaviorAware<Control3D> {
             return;
         }
 
-        this._node.position = value;;
+        this._node.position = value;
     }
 
     /** Gets or sets the control scaling  in world space */
@@ -46,7 +46,7 @@ export class Control3D implements IDisposable, IBehaviorAware<Control3D> {
             return;
         }
 
-        this._node.scaling = value;;
+        this._node.scaling = value;
     }
 
     /** Callback used to start pointer enter animation */

+ 33 - 33
gui/src/3D/controls/holographicButton.ts

@@ -27,18 +27,18 @@ export class HolographicButton extends Button3D {
     private _tooltipTextBlock: Nullable<TextBlock>;
     private _tooltipTexture: Nullable<AdvancedDynamicTexture>;
     private _tooltipMesh: Nullable<Mesh>;
-    private _tooltipHoverObserver:Nullable<Observer<Control3D>>
-    private _tooltipOutObserver:Nullable<Observer<Control3D>>
+    private _tooltipHoverObserver: Nullable<Observer<Control3D>>;
+    private _tooltipOutObserver: Nullable<Observer<Control3D>>;
 
-    private _disposeTooltip(){
+    private _disposeTooltip() {
         this._tooltipFade = null;
-        if(this._tooltipTextBlock){
+        if (this._tooltipTextBlock) {
             this._tooltipTextBlock.dispose();
         }
-        if(this._tooltipTexture){
+        if (this._tooltipTexture) {
             this._tooltipTexture.dispose();
         }
-        if(this._tooltipMesh){
+        if (this._tooltipMesh) {
             this._tooltipMesh.dispose();
         }
         this.onPointerEnterObservable.remove(this._tooltipHoverObserver);
@@ -48,31 +48,31 @@ export class HolographicButton extends Button3D {
     /**
      * Text to be displayed on the tooltip shown when hovering on the button. When set to null tooltip is disabled. (Default: null)
      */
-    public set tooltipText(text:Nullable<string>){
-        if(!text){
+    public set tooltipText(text: Nullable<string>) {
+        if (!text) {
             this._disposeTooltip();
             return;
         }
-        if(!this._tooltipFade){
+        if (!this._tooltipFade) {
             // Create tooltip with mesh and text
-            this._tooltipMesh = BABYLON.MeshBuilder.CreatePlane("", {size: 1}, this._backPlate._scene)
-            var tooltipBackground = BABYLON.MeshBuilder.CreatePlane("", {size: 1, sideOrientation: BABYLON.Mesh.DOUBLESIDE}, this._backPlate._scene)
+            this._tooltipMesh = BABYLON.MeshBuilder.CreatePlane("", {size: 1}, this._backPlate._scene);
+            var tooltipBackground = BABYLON.MeshBuilder.CreatePlane("", {size: 1, sideOrientation: BABYLON.Mesh.DOUBLESIDE}, this._backPlate._scene);
             var mat = new StandardMaterial("", this._backPlate._scene);
-            mat.diffuseColor = BABYLON.Color3.FromHexString("#212121")
-            tooltipBackground.material = mat
+            mat.diffuseColor = BABYLON.Color3.FromHexString("#212121");
+            tooltipBackground.material = mat;
             tooltipBackground.isPickable = false;
-            this._tooltipMesh.addChild(tooltipBackground)
-            tooltipBackground.position.z = 0.05
-            this._tooltipMesh.scaling.y = 1/3
+            this._tooltipMesh.addChild(tooltipBackground);
+            tooltipBackground.position.z = 0.05;
+            this._tooltipMesh.scaling.y = 1 / 3;
             this._tooltipMesh.position.y = 0.7;
             this._tooltipMesh.position.z = -0.15;
             this._tooltipMesh.isPickable = false;
             this._tooltipMesh.parent = this._backPlate;
 
             // Create text texture for the tooltip
-            this._tooltipTexture = AdvancedDynamicTexture.CreateForMesh(this._tooltipMesh)
+            this._tooltipTexture = AdvancedDynamicTexture.CreateForMesh(this._tooltipMesh);
             this._tooltipTextBlock = new TextBlock();
-            this._tooltipTextBlock.scaleY = 3
+            this._tooltipTextBlock.scaleY = 3;
             this._tooltipTextBlock.color = "white";
             this._tooltipTextBlock.fontSize = 130;
             this._tooltipTexture.addControl(this._tooltipTextBlock);
@@ -81,29 +81,29 @@ export class HolographicButton extends Button3D {
             this._tooltipFade = new BABYLON.FadeInOutBehavior();
             this._tooltipFade.delay = 500;
             this._tooltipMesh.addBehavior(this._tooltipFade);
-            this._tooltipHoverObserver = this.onPointerEnterObservable.add(()=>{
-                if(this._tooltipFade){
-                    this._tooltipFade.fadeIn(true)
+            this._tooltipHoverObserver = this.onPointerEnterObservable.add(() => {
+                if (this._tooltipFade) {
+                    this._tooltipFade.fadeIn(true);
                 }
-            })
-            this._tooltipOutObserver = this.onPointerOutObservable.add(()=>{
-                if(this._tooltipFade){
-                    this._tooltipFade.fadeIn(false)
+            });
+            this._tooltipOutObserver = this.onPointerOutObservable.add(() => {
+                if (this._tooltipFade) {
+                    this._tooltipFade.fadeIn(false);
                 }
-            })
+            });
         }
-        if(this._tooltipTextBlock){
+        if (this._tooltipTextBlock) {
             this._tooltipTextBlock.text = text;
         }
     }
 
-    public get tooltipText(){
-        if(this._tooltipTextBlock){
+    public get tooltipText() {
+        if (this._tooltipTextBlock) {
             return this._tooltipTextBlock.text;
         }
         return null;
     }
-    
+
     /**
      * Gets or sets text for the button
      */
@@ -179,14 +179,14 @@ export class HolographicButton extends Button3D {
                 return;
             }
             this._frontPlate.setEnabled(true);
-        }
+        };
 
         this.pointerOutAnimation = () => {
             if (!this.mesh) {
                 return;
             }
             this._frontPlate.setEnabled(false);
-        }
+        };
     }
 
     protected _getTypeName(): string {
@@ -258,7 +258,7 @@ export class HolographicButton extends Button3D {
     private _createBackMaterial(mesh: Mesh) {
         this._backMaterial = new FluentMaterial(this.name + "Back Material", mesh.getScene());
         this._backMaterial.renderHoverLight = true;
-        this._pickedPointObserver = this._host.onPickedPointChangedObservable.add(pickedPoint => {
+        this._pickedPointObserver = this._host.onPickedPointChangedObservable.add((pickedPoint) => {
             if (pickedPoint) {
                 this._backMaterial.hoverPosition = pickedPoint;
                 this._backMaterial.hoverColor.a = 1.0;

+ 4 - 4
gui/src/3D/controls/meshButton3D.ts

@@ -26,28 +26,28 @@ export class MeshButton3D extends Button3D {
                 return;
             }
             this.mesh.scaling.scaleInPlace(1.1);
-        }
+        };
 
         this.pointerOutAnimation = () => {
             if (!this.mesh) {
                 return;
             }
             this.mesh.scaling.scaleInPlace(1.0 / 1.1);
-        }
+        };
 
         this.pointerDownAnimation = () => {
             if (!this.mesh) {
                 return;
             }
             this.mesh.scaling.scaleInPlace(0.95);
-        }
+        };
 
         this.pointerUpAnimation = () => {
             if (!this.mesh) {
                 return;
             }
             this.mesh.scaling.scaleInPlace(1.0 / 0.95);
-        }
+        };
     }
 
     protected _getTypeName(): string {

+ 2 - 2
gui/src/3D/controls/stackPanel3D.ts

@@ -33,7 +33,7 @@ export class StackPanel3D extends Container3D {
 
     /**
      * Creates new StackPanel
-     * @param isVertical 
+     * @param isVertical
      */
     public constructor(isVertical = false) {
         super();
@@ -102,7 +102,7 @@ export class StackPanel3D extends Container3D {
                 offset += extendSize.x * 2;
             }
 
-            offset += (controlCount > 0 ? this.margin : 0)
+            offset += (controlCount > 0 ? this.margin : 0);
         }
     }
 }

+ 4 - 4
gui/src/3D/controls/volumeBasedPanel.ts

@@ -47,8 +47,8 @@ export abstract class VolumeBasedPanel extends Container3D {
     }
 
     /**
-     * Gets or sets the number of columns requested (10 by default). 
-     * The panel will automatically compute the number of rows based on number of child controls. 
+     * Gets or sets the number of columns requested (10 by default).
+     * The panel will automatically compute the number of rows based on number of child controls.
      */
     public get columns(): int {
         return this._columns;
@@ -68,8 +68,8 @@ export abstract class VolumeBasedPanel extends Container3D {
     }
 
     /**
-     * Gets or sets a the number of rows requested. 
-     * The panel will automatically compute the number of columns based on number of child controls. 
+     * Gets or sets a the number of rows requested.
+     * The panel will automatically compute the number of columns based on number of child controls.
      */
     public get rows(): int {
         return this._rows;

+ 3 - 3
gui/src/3D/gui3DManager.ts

@@ -41,7 +41,7 @@ export class GUI3DManager implements IDisposable {
 
     /**
      * Creates a new GUI3DManager
-     * @param scene 
+     * @param scene
      */
     public constructor(scene?: Scene) {
         this._scene = scene || Engine.LastCreatedScene!;
@@ -49,13 +49,13 @@ export class GUI3DManager implements IDisposable {
             this._sceneDisposeObserver = null;
             this._utilityLayer = null;
             this.dispose();
-        })
+        });
 
         this._utilityLayer = new UtilityLayerRenderer(this._scene);
         this._utilityLayer.onlyCheckPointerDownEvents = false;
         this._utilityLayer.mainSceneTrackerPredicate = (mesh: Nullable<AbstractMesh>) => {
             return mesh && mesh.metadata && mesh.metadata._node;
-        }
+        };
 
         // Root
         this._rootContainer = new Container3D("RootContainer");

+ 4 - 5
gui/src/3D/materials/fluentMaterial.ts

@@ -103,7 +103,7 @@ export class FluentMaterial extends PushMaterial {
 
     /** Gets or sets the texture to use for albedo color */
     @expandToProperty("_markAllSubMeshesAsTexturesAndMiscDirty")
-    public albedoTexture: Nullable<BaseTexture>;    
+    public albedoTexture: Nullable<BaseTexture>;
 
     /**
      * Creates a new Fluent material
@@ -162,7 +162,7 @@ export class FluentMaterial extends PushMaterial {
         }
 
         var engine = scene.getEngine();
-        // Get correct effect      
+        // Get correct effect
         if (defines.isDirty) {
             defines.markAsProcessed();
             scene.resetCachedMaterial();
@@ -229,11 +229,10 @@ export class FluentMaterial extends PushMaterial {
         }
         this._activeEffect = effect;
 
-        // Matrices        
+        // Matrices
         this.bindOnlyWorldMatrix(world);
         this._activeEffect.setMatrix("viewProjection", scene.getTransformMatrix());
 
-
         if (this._mustRebind(scene, effect)) {
             this._activeEffect.setColor4("albedoColor", this.albedoColor, this.alpha);
 
@@ -257,7 +256,7 @@ export class FluentMaterial extends PushMaterial {
             }
 
             if (defines.TEXTURE) {
-                this._activeEffect.setTexture("albedoSampler", this._albedoTexture)
+                this._activeEffect.setTexture("albedoSampler", this._albedoTexture);
             }
         }
 

+ 2 - 2
gui/src/legacy.ts

@@ -2,8 +2,8 @@ import * as GUI from "./index";
 
 /**
  * Legacy support, defining window.BABYLON.GUI (global variable).
- * 
- * This is the entry point for the UMD module. 
+ *
+ * This is the entry point for the UMD module.
  * The entry point for a future ESM package should be index.ts
  */
 var globalObject = (typeof global !== 'undefined') ? global : ((typeof window !== 'undefined') ? window : undefined);

+ 19 - 20
inspector/src/Inspector.ts

@@ -52,13 +52,13 @@ export class Inspector {
 
         this.onGUILoaded = new Observable();
 
-        import("babylonjs-gui").then(GUI => {
+        import("babylonjs-gui").then((GUI) => {
             // Load GUI library if not already done
             if (!GUI || (typeof GUI !== "undefined" && Object.keys(GUI).indexOf("default") !== -1)) {
                 Tools.LoadScript("https://preview.babylonjs.com/gui/babylon.gui.min.js", () => {
                     Inspector.GUIObject = (<any>BABYLON).GUI;
                     this.onGUILoaded.notifyObservers(Inspector.GUIObject);
-                    //Load properties of GUI objects now as GUI has to be declared before 
+                    //Load properties of GUI objects now as GUI has to be declared before
                     loadGUIProperties(Inspector.GUIObject);
                 }, () => {
                     console.warn('Error : loading "babylon.gui.min.js". Please add script https://preview.babylonjs.com/gui/babylon.min.gui.js to the HTML file.');
@@ -67,10 +67,10 @@ export class Inspector {
             else {
                 Inspector.GUIObject = GUI;
                 this.onGUILoaded.notifyObservers(Inspector.GUIObject);
-                //Load properties of GUI objects now as GUI has to be declared before 
+                //Load properties of GUI objects now as GUI has to be declared before
                 loadGUIProperties(Inspector.GUIObject);
             }
-        })
+        });
         //get Tabbar initialTab
         this._initialTab = initialTab;
 
@@ -87,13 +87,13 @@ export class Inspector {
         // POPUP MODE
         if (popup) {
             // Build the inspector in the given parent
-            this.openPopup(true);// set to true in order to NOT dispose the inspector (done in openPopup), as it's not existing yet
+            this.openPopup(true); // set to true in order to NOT dispose the inspector (done in openPopup), as it's not existing yet
         } else {
             // Get canvas and its DOM parent
             let canvas = <HTMLElement>this._scene.getEngine().getRenderingCanvas();
             let canvasParent = canvas.parentElement;
 
-            // get canvas style                
+            // get canvas style
             let canvasComputedStyle = Inspector.WINDOW.getComputedStyle(canvas);
 
             this._canvasStyle = {
@@ -127,11 +127,11 @@ export class Inspector {
                 this._c2diwrapper.style.height = '100%';
                 this._c2diwrapper.style.paddingLeft = '5px';
 
-                // add inspector     
+                // add inspector
                 let inspector = Helpers.CreateDiv('insp-right-panel', this._c2diwrapper);
                 inspector.style.width = '100%';
                 inspector.style.height = '100%';
-                // and build it in the popup  
+                // and build it in the popup
                 this._buildInspector(inspector);
             } else {
                 // Create c2di wrapper
@@ -159,7 +159,6 @@ export class Inspector {
                     }
                 }
 
-
                 // Check if the parent of the canvas is the body page. If yes, the size ratio is computed
                 let parent = this._getRelativeParent(canvas);
 
@@ -205,7 +204,7 @@ export class Inspector {
                         onDrag: () => {
                             Helpers.SEND_EVENT('resize');
                             if (this._tabbar) {
-                                this._tabbar.updateWidth()
+                                this._tabbar.updateWidth();
                             }
                         }
                     });
@@ -253,17 +252,17 @@ export class Inspector {
                         .replace(/#454545/g, bColorl3) // background-lighter3
                         .replace(/#ccc/g, color) // color
                         .replace(/#f29766/g, colorTop) // color-top
-                        .replace(/#5db0d7/g, colorBot) // color-bot
+                        .replace(/#5db0d7/g, colorBot); // color-bot
                 }
             }
         }
     }
 
     /**
-     * If the given element has a position 'asbolute' or 'relative', 
+     * If the given element has a position 'asbolute' or 'relative',
      * returns the first parent of the given element that has a position 'relative' or 'absolute'.
      * If the given element has no position, returns the first parent
-     * 
+     *
      */
     private _getRelativeParent(elem: HTMLElement, lookForAbsoluteOrRelative?: boolean): HTMLElement {
         // If the elem has no parent, returns himself
@@ -281,7 +280,7 @@ export class Inspector {
                 return this._getRelativeParent(elem.parentElement, true);
             }
         }
-        // looking for the relative parent of the element 
+        // looking for the relative parent of the element
         else {
             if (computedStyle.position == "static") {
                 return elem.parentElement;
@@ -315,7 +314,7 @@ export class Inspector {
         return this._popupMode;
     }
 
-    /**  
+    /**
      * Filter the list of item present in the tree.
      * All item returned should have the given filter contained in the item id.
     */
@@ -366,7 +365,7 @@ export class Inspector {
             for (let prop in this._canvasStyle) {
                 (<any>canvas.style)[prop] = this._canvasStyle[prop];
             }
-            // Get parent of the wrapper 
+            // Get parent of the wrapper
             if (canvas.parentElement) {
                 let canvasParent = canvas.parentElement.parentElement;
 
@@ -395,7 +394,7 @@ export class Inspector {
             return;
         }
         popup.document.title = "js INSPECTOR";
-        // Get the inspector style      
+        // Get the inspector style
         let styles = Inspector.DOCUMENT.querySelectorAll('style');
         for (let s = 0; s < styles.length; s++) {
             popup.document.body.appendChild(styles[s].cloneNode(true));
@@ -421,17 +420,17 @@ export class Inspector {
         Inspector.WINDOW = popup;
         // Build the inspector wrapper
         this._c2diwrapper = Helpers.CreateDiv('insp-wrapper', popup.document.body);
-        // add inspector     
+        // add inspector
         let inspector = Helpers.CreateDiv('insp-right-panel', this._c2diwrapper);
         inspector.classList.add('popupmode');
-        // and build it in the popup  
+        // and build it in the popup
         this._buildInspector(inspector);
         // Rebuild it
         this.refresh();
 
         popup.addEventListener('resize', () => {
             if (this._tabbar) {
-                this._tabbar.updateWidth()
+                this._tabbar.updateWidth();
             }
         });
     }

+ 0 - 2
inspector/src/adapters/Adapter.ts

@@ -2,7 +2,6 @@ import { Geometry } from "babylonjs";
 import { PropertyLine } from "../details/PropertyLine";
 import { AbstractTreeTool } from "../treetools/AbstractTreeTool";
 
-
 export abstract class Adapter {
 
     protected _obj: any;
@@ -13,7 +12,6 @@ export abstract class Adapter {
         this._obj = obj;
     }
 
-
     /** Returns the name displayed in the tree */
     public abstract id(): string;
 

+ 1 - 4
inspector/src/adapters/CameraAdapter.ts

@@ -5,7 +5,6 @@ import { Helpers } from "../helpers/Helpers";
 import { CameraPOV, ICameraPOV } from "../treetools/CameraPOV";
 import { Adapter } from "./Adapter";
 
-
 export class CameraAdapter
     extends Adapter
     implements ICameraPOV {
@@ -19,7 +18,7 @@ export class CameraAdapter
         let str = '';
         if (this._obj.name) {
             str = this._obj.name;
-        } // otherwise nothing displayed        
+        } // otherwise nothing displayed
         return str;
     }
 
@@ -54,6 +53,4 @@ export class CameraAdapter
         }
     }
 
-
-
 }

+ 1 - 2
inspector/src/adapters/GUIAdapter.ts

@@ -5,7 +5,6 @@ import { AbstractTreeTool } from "../treetools/AbstractTreeTool";
 import { Checkbox, IToolVisible } from "../treetools/Checkbox";
 import { Adapter } from "./Adapter";
 
-
 export class GUIAdapter
     extends Adapter
     implements IToolVisible {
@@ -19,7 +18,7 @@ export class GUIAdapter
         let str = '';
         if (this._obj.name) {
             str = this._obj.name;
-        } // otherwise nothing displayed        
+        } // otherwise nothing displayed
         return str;
     }
 

+ 1 - 1
inspector/src/adapters/LightAdapter.ts

@@ -17,7 +17,7 @@ export class LightAdapter
         let str = '';
         if (this._obj.name) {
             str = this._obj.name;
-        } // otherwise nothing displayed        
+        } // otherwise nothing displayed
         return str;
     }
 

+ 1 - 1
inspector/src/adapters/MaterialAdapter.ts

@@ -16,7 +16,7 @@ export class MaterialAdapter
         let str = '';
         if (this._obj.name) {
             str = this._obj.name;
-        } // otherwise nothing displayed        
+        } // otherwise nothing displayed
         return str;
     }
 

+ 1 - 3
inspector/src/adapters/MeshAdapter.ts

@@ -8,7 +8,6 @@ import { DebugArea, IToolDebug } from "../treetools/DebugArea";
 import { Info, IToolInfo } from "../treetools/Info";
 import { Adapter } from "./Adapter";
 
-
 export class MeshAdapter
     extends Adapter
     implements IToolVisible, IToolDebug, IToolBoundingBox, IToolInfo {
@@ -26,7 +25,7 @@ export class MeshAdapter
         let str = '';
         if (this._obj.name) {
             str = this._obj.name;
-        } // otherwise nothing displayed        
+        } // otherwise nothing displayed
         return str;
     }
 
@@ -50,7 +49,6 @@ export class MeshAdapter
             }
         }
 
-
         tools.push(new Info(this));
         return tools;
     }

+ 1 - 2
inspector/src/adapters/PhysicsImpostorAdapter.ts

@@ -5,7 +5,6 @@ import { AbstractTreeTool } from "../treetools/AbstractTreeTool";
 import { Checkbox, IToolVisible } from "../treetools/Checkbox";
 import { Adapter } from "./Adapter";
 
-
 export class PhysicsImpostorAdapter
     extends Adapter
     implements IToolVisible {
@@ -24,7 +23,7 @@ export class PhysicsImpostorAdapter
         let physicsImposter = (<PhysicsImpostor>this._obj);
         if (physicsImposter && physicsImposter.object) {
             str = (<AbstractMesh>physicsImposter.object).name || "";
-        } // otherwise nothing displayed        
+        } // otherwise nothing displayed
         return str;
     }
 

+ 3 - 5
inspector/src/adapters/SoundAdapter.ts

@@ -5,7 +5,6 @@ import { AbstractTreeTool } from "../treetools/AbstractTreeTool";
 import { ISoundInteractions, SoundInteractions } from "../treetools/SoundInteractions";
 import { Adapter } from "./Adapter";
 
-
 export class SoundAdapter
     extends Adapter
     implements ISoundInteractions {
@@ -19,7 +18,7 @@ export class SoundAdapter
         let str = '';
         if (this._obj.name) {
             str = this._obj.name;
-        } // otherwise nothing displayed        
+        } // otherwise nothing displayed
         return str;
     }
 
@@ -39,7 +38,6 @@ export class SoundAdapter
         return tools;
     }
 
-
     public setPlaying(callback: Function) {
         if ((this._obj as Sound).isPlaying) {
             (this._obj as Sound).pause();
@@ -47,8 +45,8 @@ export class SoundAdapter
         else {
             (this._obj as Sound).play();
         }
-        (this._obj as Sound).onEndedObservable.addOnce(() => { 
-            callback(); 
+        (this._obj as Sound).onEndedObservable.addOnce(() => {
+            callback();
         });
     }
 }

+ 0 - 0
inspector/src/adapters/TextureAdapter.ts


Niektóre pliki nie zostały wyświetlone z powodu dużej ilości zmienionych plików