Pārlūkot izejas kodu

Merge branch 'master' into makeTestNotTimeDependant

Trevor Baron 7 gadi atpakaļ
vecāks
revīzija
999a8257b9
100 mainītis faili ar 365413 papildinājumiem un 366327 dzēšanām
  1. 9300 9296
      Playground/babylon.d.txt
  2. 20 2
      Tools/Gulp/gulpfile.js
  3. 3 1
      Tools/Gulp/package.json
  4. 4063 4063
      dist/preview release/babylon.d.ts
  5. 1 1
      dist/preview release/babylon.js
  6. 116854 117222
      dist/preview release/babylon.max.js
  7. 116781 117149
      dist/preview release/babylon.no-module.max.js
  8. 116781 117149
      dist/preview release/es6.js
  9. 18 16
      dist/preview release/loaders/babylon.glTF1FileLoader.js
  10. 20 11
      dist/preview release/loaders/babylon.glTF2FileLoader.js
  11. 30 23
      dist/preview release/loaders/babylon.glTFFileLoader.js
  12. 6 3
      dist/preview release/loaders/babylon.objFileLoader.js
  13. 36 26
      dist/preview release/loaders/babylonjs.loaders.js
  14. 4 4
      dist/preview release/materialsLibrary/babylon.cellMaterial.js
  15. 3 3
      dist/preview release/materialsLibrary/babylon.fireMaterial.js
  16. 5 5
      dist/preview release/materialsLibrary/babylon.furMaterial.js
  17. 3 3
      dist/preview release/materialsLibrary/babylon.gradientMaterial.js
  18. 1 1
      dist/preview release/materialsLibrary/babylon.gridMaterial.js
  19. 4 4
      dist/preview release/materialsLibrary/babylon.lavaMaterial.js
  20. 4 4
      dist/preview release/materialsLibrary/babylon.mixMaterial.js
  21. 4 4
      dist/preview release/materialsLibrary/babylon.normalMaterial.js
  22. 3 3
      dist/preview release/materialsLibrary/babylon.shadowOnlyMaterial.js
  23. 4 4
      dist/preview release/materialsLibrary/babylon.simpleMaterial.js
  24. 3 3
      dist/preview release/materialsLibrary/babylon.skyMaterial.js
  25. 4 4
      dist/preview release/materialsLibrary/babylon.terrainMaterial.js
  26. 4 4
      dist/preview release/materialsLibrary/babylon.triPlanarMaterial.js
  27. 4 4
      dist/preview release/materialsLibrary/babylon.waterMaterial.js
  28. 50 50
      dist/preview release/materialsLibrary/babylonjs.materials.js
  29. 0 7
      dist/preview release/serializers/babylon.glTF2Serializer.js
  30. 0 7
      dist/preview release/serializers/babylonjs.serializers.js
  31. 272 198
      dist/preview release/viewer/babylon.viewer.d.ts
  32. 1 1
      dist/preview release/viewer/babylon.viewer.js
  33. 2 2
      dist/preview release/viewer/babylon.viewer.max.js
  34. 283 205
      dist/preview release/viewer/babylon.viewer.module.d.ts
  35. 10 17
      loaders/src/OBJ/babylon.objFileLoader.ts
  36. 1 3
      loaders/src/STL/babylon.stlFileLoader.ts
  37. 3 3
      loaders/src/glTF/1.0/babylon.glTFBinaryExtension.ts
  38. 18 19
      loaders/src/glTF/1.0/babylon.glTFLoader.ts
  39. 9 9
      loaders/src/glTF/1.0/babylon.glTFLoaderExtension.ts
  40. 5 5
      loaders/src/glTF/1.0/babylon.glTFLoaderInterfaces.ts
  41. 14 14
      loaders/src/glTF/1.0/babylon.glTFMaterialsCommonExtension.ts
  42. 4 4
      loaders/src/glTF/2.0/Extensions/EXT_lights_image_based.ts
  43. 4 4
      loaders/src/glTF/2.0/Extensions/KHR_draco_mesh_compression.ts
  44. 3 4
      loaders/src/glTF/2.0/Extensions/KHR_lights_punctual.ts
  45. 3 3
      loaders/src/glTF/2.0/Extensions/KHR_materials_pbrSpecularGlossiness.ts
  46. 2 2
      loaders/src/glTF/2.0/Extensions/KHR_materials_unlit.ts
  47. 2 2
      loaders/src/glTF/2.0/Extensions/KHR_texture_transform.ts
  48. 10 10
      loaders/src/glTF/2.0/Extensions/MSFT_audio_emitter.ts
  49. 4 4
      loaders/src/glTF/2.0/Extensions/MSFT_lod.ts
  50. 1 1
      loaders/src/glTF/2.0/Extensions/MSFT_minecraftMesh.ts
  51. 2 2
      loaders/src/glTF/2.0/Extensions/MSFT_sRGBFactors.ts
  52. 56 56
      loaders/src/glTF/2.0/babylon.glTFLoader.ts
  53. 16 16
      loaders/src/glTF/babylon.glTFFileLoader.ts
  54. 8 9
      materialsLibrary/src/cell/babylon.cellMaterial.ts
  55. 16 17
      materialsLibrary/src/custom/babylon.customMaterial.ts
  56. 4 5
      materialsLibrary/src/fire/babylon.fireMaterial.ts
  57. 8 10
      materialsLibrary/src/fur/babylon.furMaterial.ts
  58. 6 8
      materialsLibrary/src/gradient/babylon.gradientMaterial.ts
  59. 4 4
      materialsLibrary/src/grid/babylon.gridmaterial.ts
  60. 9 10
      materialsLibrary/src/lava/babylon.lavaMaterial.ts
  61. 7 8
      materialsLibrary/src/mix/babylon.mixMaterial.ts
  62. 7 8
      materialsLibrary/src/normal/babylon.normalMaterial.ts
  63. 6 7
      materialsLibrary/src/shadowOnly/babylon.shadowOnlyMaterial.ts
  64. 7 8
      materialsLibrary/src/simple/babylon.simpleMaterial.ts
  65. 43 44
      materialsLibrary/src/sky/babylon.skyMaterial.ts
  66. 7 8
      materialsLibrary/src/terrain/babylon.terrainMaterial.ts
  67. 7 8
      materialsLibrary/src/triPlanar/babylon.triPlanarMaterial.ts
  68. 10 10
      materialsLibrary/src/water/babylon.waterMaterial.ts
  69. 33 33
      postProcessLibrary/src/asciiArt/babylon.asciiArtPostProcess.ts
  70. 36 36
      postProcessLibrary/src/digitalRain/babylon.digitalRainPostProcess.ts
  71. 2 2
      proceduralTexturesLibrary/src/brick/babylon.brickProceduralTexture.ts
  72. 6 6
      proceduralTexturesLibrary/src/cloud/babylon.cloudProceduralTexture.ts
  73. 1 1
      proceduralTexturesLibrary/src/fire/babylon.fireProceduralTexture.ts
  74. 1 1
      proceduralTexturesLibrary/src/marble/babylon.marbleProceduralTexture.ts
  75. 22 22
      proceduralTexturesLibrary/src/starfield/babylon.starfieldProceduralTexture.ts
  76. 1 1
      proceduralTexturesLibrary/src/wood/babylon.woodProceduralTexture.ts
  77. 3 3
      serializers/src/OBJ/babylon.objSerializer.ts
  78. 10 10
      serializers/src/glTF/2.0/Extensions/KHR_texture_transform.ts
  79. 51 51
      serializers/src/glTF/2.0/babylon.glTFAnimation.ts
  80. 25 26
      serializers/src/glTF/2.0/babylon.glTFExporter.ts
  81. 45 47
      serializers/src/glTF/2.0/babylon.glTFMaterialExporter.ts
  82. 2 2
      serializers/src/glTF/2.0/babylon.glTFSerializer.ts
  83. 1 1
      serializers/src/glTF/2.0/babylon.glTFUtilities.ts
  84. 29 29
      src/Actions/babylon.action.ts
  85. 107 80
      src/Actions/babylon.actionManager.ts
  86. 47 48
      src/Actions/babylon.condition.ts
  87. 2 2
      src/Actions/babylon.directActions.ts
  88. 8 6
      src/Actions/babylon.directAudioActions.ts
  89. 5 5
      src/Actions/babylon.interpolateValueAction.ts
  90. 10 11
      src/Animations/babylon.animatable.ts
  91. 5 7
      src/Animations/babylon.animation.ts
  92. 16 14
      src/Animations/babylon.animationGroup.ts
  93. 3 3
      src/Animations/babylon.easing.ts
  94. 3 5
      src/Animations/babylon.runtimeAnimation.ts
  95. 2 2
      src/Audio/babylon.analyser.ts
  96. 13 13
      src/Audio/babylon.audioEngine.ts
  97. 16 16
      src/Audio/babylon.audioSceneComponent.ts
  98. 15 14
      src/Audio/babylon.sound.ts
  99. 6 6
      src/Audio/babylon.soundtrack.ts
  100. 0 0
      src/Audio/babylon.weightedsound.ts

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 9300 - 9296
Playground/babylon.d.txt


+ 20 - 2
Tools/Gulp/gulpfile.js

@@ -30,6 +30,8 @@ var fs = require("fs");
 var dtsBundle = require('dts-bundle');
 const through = require('through2');
 var karmaServer = require('karma').Server;
+var gulpTslint = require("gulp-tslint");
+var tslint = require("tslint");
 
 //viewer declaration
 var processDeclaration = require('./processViewerDeclaration');
@@ -94,9 +96,11 @@ var externalTsConfig = {
 
 var minimist = require("minimist");
 var commandLineOptions = minimist(process.argv.slice(2), {
-    boolean: "public"
+    boolean: ["public", "tsLintFix"]
 });
 
+var tsLintFix = commandLineOptions.tsLintFix
+
 function processDependency(kind, dependency, filesToLoad, firstLevelOnly) {
     if (!firstLevelOnly && dependency.dependUpon) {
         for (var i = 0; i < dependency.dependUpon.length; i++) {
@@ -269,8 +273,16 @@ gulp.task("build", gulp.series("shaders", function build() {
 */
 gulp.task("typescript-compile", function () {
     var tsResult = gulp.src(config.typescript)
+        .pipe(gulpTslint({
+            formatter: "stylish",
+            configuration: "../../tslint.json",
+            fix: tsLintFix
+        }))
+        .pipe(gulpTslint.report())
         .pipe(sourcemaps.init())
-        .pipe(tsProject());
+        .pipe(tsProject({
+            summarizeFailureOutput: true
+        }));
 
     //If this gulp task is running on travis, file the build!
     if (process.env.TRAVIS) {
@@ -358,6 +370,12 @@ var buildExternalLibrary = function (library, settings, watch) {
     var tsProcess;
     if (library.files && library.files.length) {
         tsProcess = gulp.src(library.files, { base: settings.build.srcOutputDirectory })
+            .pipe(gulpTslint({
+                formatter: "stylish",
+                configuration: "../../tslint.json",
+                fix: tsLintFix
+            }))
+            .pipe(gulpTslint.report())
             .pipe(sourcemaps.init())
             .pipe(typescript(externalTsConfig));
     }

+ 3 - 1
Tools/Gulp/package.json

@@ -45,7 +45,9 @@
         "typedoc": "^0.12.0",
         "typescript": "^3.0.1",
         "webpack": "^4.16.3",
-        "webpack-stream": "5.0.0"
+        "webpack-stream": "5.0.0",
+        "tslint": "^5.11.0",
+        "gulp-tslint": "^8.1.3"
     },
     "scripts": {
         "install": "cd ../../gui && npm install && cd ../Tools/Gulp/ &&  cd ../../inspector && npm install && cd ../Tools/Gulp/ && npm --prefix ../../Playground/ install ../../Playground/ && npm --prefix ../../tests/unit/ install ../../tests/unit/ && npm --prefix ../../Viewer/tests/ install ../../Viewer/tests/ && cd ../../Viewer && npm install && cd ../Tools/Gulp/ && gulp deployLocalDev"

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 4063 - 4063
dist/preview release/babylon.d.ts


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 1 - 1
dist/preview release/babylon.js


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 116854 - 117222
dist/preview release/babylon.max.js


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 116781 - 117149
dist/preview release/babylon.no-module.max.js


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 116781 - 117149
dist/preview release/es6.js


+ 18 - 16
dist/preview release/loaders/babylon.glTF1FileLoader.js

@@ -647,14 +647,18 @@ var BABYLON;
             };
         };
         GLTFFileLoader._compareVersion = function (a, b) {
-            if (a.major > b.major)
+            if (a.major > b.major) {
                 return 1;
-            if (a.major < b.major)
+            }
+            if (a.major < b.major) {
                 return -1;
-            if (a.minor > b.minor)
+            }
+            if (a.minor > b.minor) {
                 return 1;
-            if (a.minor < b.minor)
+            }
+            if (a.minor < b.minor) {
                 return -1;
+            }
             return 0;
         };
         GLTFFileLoader._decodeBufferToText = function (buffer) {
@@ -867,8 +871,9 @@ var BABYLON;
                 this._maxPos = toParse.length;
             }
             Tokenizer.prototype.getNextToken = function () {
-                if (this.isEnd())
+                if (this.isEnd()) {
                     return ETokenType.END_OF_INPUT;
+                }
                 this.currentString = this.read();
                 this.currentToken = ETokenType.UNKNOWN;
                 if (this.currentString === "_" || this.isLetterOrDigitPattern.test(this.currentString)) {
@@ -2294,7 +2299,6 @@ var BABYLON;
                     onload();
                 }
             };
-            ;
             GLTFLoader.prototype._loadBuffersAsync = function (gltfRuntime, onLoad, onProgress) {
                 var hasBuffers = false;
                 var processBuffer = function (buf, buffer) {
@@ -2349,7 +2353,6 @@ var BABYLON;
             return GLTFLoader;
         }());
         GLTF1.GLTFLoader = GLTFLoader;
-        ;
         BABYLON.GLTFFileLoader._CreateGLTFLoaderV1 = function () { return new GLTFLoader(); };
     })(GLTF1 = BABYLON.GLTF1 || (BABYLON.GLTF1 = {}));
 })(BABYLON || (BABYLON = {}));
@@ -2758,8 +2761,6 @@ var BABYLON;
     var GLTF1;
     (function (GLTF1) {
         var BinaryExtensionBufferName = "binary_glTF";
-        ;
-        ;
         var GLTFBinaryExtension = /** @class */ (function (_super) {
             __extends(GLTFBinaryExtension, _super);
             function GLTFBinaryExtension() {
@@ -2837,20 +2838,19 @@ var BABYLON;
 (function (BABYLON) {
     var GLTF1;
     (function (GLTF1) {
-        ;
-        ;
-        ;
         var GLTFMaterialsCommonExtension = /** @class */ (function (_super) {
             __extends(GLTFMaterialsCommonExtension, _super);
             function GLTFMaterialsCommonExtension() {
                 return _super.call(this, "KHR_materials_common") || this;
             }
             GLTFMaterialsCommonExtension.prototype.loadRuntimeExtensionsAsync = function (gltfRuntime, onSuccess, onError) {
-                if (!gltfRuntime.extensions)
+                if (!gltfRuntime.extensions) {
                     return false;
+                }
                 var extension = gltfRuntime.extensions[this.name];
-                if (!extension)
+                if (!extension) {
                     return false;
+                }
                 // Create lights
                 var lights = extension.lights;
                 if (lights) {
@@ -2895,11 +2895,13 @@ var BABYLON;
             };
             GLTFMaterialsCommonExtension.prototype.loadMaterialAsync = function (gltfRuntime, id, onSuccess, onError) {
                 var material = gltfRuntime.materials[id];
-                if (!material || !material.extensions)
+                if (!material || !material.extensions) {
                     return false;
+                }
                 var extension = material.extensions[this.name];
-                if (!extension)
+                if (!extension) {
                     return false;
+                }
                 var standardMaterial = new BABYLON.StandardMaterial(id, gltfRuntime.scene);
                 standardMaterial.sideOrientation = BABYLON.Material.CounterClockWiseSideOrientation;
                 if (extension.technique === "CONSTANT") {

+ 20 - 11
dist/preview release/loaders/babylon.glTF2FileLoader.js

@@ -647,14 +647,18 @@ var BABYLON;
             };
         };
         GLTFFileLoader._compareVersion = function (a, b) {
-            if (a.major > b.major)
+            if (a.major > b.major) {
                 return 1;
-            if (a.major < b.major)
+            }
+            if (a.major < b.major) {
                 return -1;
-            if (a.minor > b.minor)
+            }
+            if (a.minor > b.minor) {
                 return 1;
-            if (a.minor < b.minor)
+            }
+            if (a.minor < b.minor) {
                 return -1;
+            }
             return 0;
         };
         GLTFFileLoader._decodeBufferToText = function (buffer) {
@@ -1446,12 +1450,15 @@ var BABYLON;
                     matrix.decompose(scaling, rotation, position);
                 }
                 else {
-                    if (node.translation)
+                    if (node.translation) {
                         position = BABYLON.Vector3.FromArray(node.translation);
-                    if (node.rotation)
+                    }
+                    if (node.rotation) {
                         rotation = BABYLON.Quaternion.FromArray(node.rotation);
-                    if (node.scale)
+                    }
+                    if (node.scale) {
                         scaling = BABYLON.Vector3.FromArray(node.scale);
+                    }
                 }
                 babylonNode.position = position;
                 babylonNode.rotationQuaternion = rotation;
@@ -2192,7 +2199,6 @@ var BABYLON;
                         wrapV: GLTFLoader._GetTextureWrapMode(context + "/wrapT", sampler.wrapT)
                     };
                 }
-                ;
                 return sampler._data;
             };
             /**
@@ -3093,12 +3099,15 @@ var BABYLON;
                             var promise = Promise.all(clipPromises).then(function () {
                                 var weights = emitter.clips.map(function (clip) { return clip.weight || 1; });
                                 var weightedSound = new BABYLON.WeightedSound(emitter.loop || false, emitter._babylonSounds, weights);
-                                if (emitter.innerAngle)
+                                if (emitter.innerAngle) {
                                     weightedSound.directionalConeInnerAngle = 2 * BABYLON.Tools.ToDegrees(emitter.innerAngle);
-                                if (emitter.outerAngle)
+                                }
+                                if (emitter.outerAngle) {
                                     weightedSound.directionalConeOuterAngle = 2 * BABYLON.Tools.ToDegrees(emitter.outerAngle);
-                                if (emitter.volume)
+                                }
+                                if (emitter.volume) {
                                     weightedSound.volume = emitter.volume;
+                                }
                                 emitter._babylonData.sound = weightedSound;
                             });
                             emitter._babylonData = {

+ 30 - 23
dist/preview release/loaders/babylon.glTFFileLoader.js

@@ -647,14 +647,18 @@ var BABYLON;
             };
         };
         GLTFFileLoader._compareVersion = function (a, b) {
-            if (a.major > b.major)
+            if (a.major > b.major) {
                 return 1;
-            if (a.major < b.major)
+            }
+            if (a.major < b.major) {
                 return -1;
-            if (a.minor > b.minor)
+            }
+            if (a.minor > b.minor) {
                 return 1;
-            if (a.minor < b.minor)
+            }
+            if (a.minor < b.minor) {
                 return -1;
+            }
             return 0;
         };
         GLTFFileLoader._decodeBufferToText = function (buffer) {
@@ -867,8 +871,9 @@ var BABYLON;
                 this._maxPos = toParse.length;
             }
             Tokenizer.prototype.getNextToken = function () {
-                if (this.isEnd())
+                if (this.isEnd()) {
                     return ETokenType.END_OF_INPUT;
+                }
                 this.currentString = this.read();
                 this.currentToken = ETokenType.UNKNOWN;
                 if (this.currentString === "_" || this.isLetterOrDigitPattern.test(this.currentString)) {
@@ -2294,7 +2299,6 @@ var BABYLON;
                     onload();
                 }
             };
-            ;
             GLTFLoader.prototype._loadBuffersAsync = function (gltfRuntime, onLoad, onProgress) {
                 var hasBuffers = false;
                 var processBuffer = function (buf, buffer) {
@@ -2349,7 +2353,6 @@ var BABYLON;
             return GLTFLoader;
         }());
         GLTF1.GLTFLoader = GLTFLoader;
-        ;
         BABYLON.GLTFFileLoader._CreateGLTFLoaderV1 = function () { return new GLTFLoader(); };
     })(GLTF1 = BABYLON.GLTF1 || (BABYLON.GLTF1 = {}));
 })(BABYLON || (BABYLON = {}));
@@ -2758,8 +2761,6 @@ var BABYLON;
     var GLTF1;
     (function (GLTF1) {
         var BinaryExtensionBufferName = "binary_glTF";
-        ;
-        ;
         var GLTFBinaryExtension = /** @class */ (function (_super) {
             __extends(GLTFBinaryExtension, _super);
             function GLTFBinaryExtension() {
@@ -2837,20 +2838,19 @@ var BABYLON;
 (function (BABYLON) {
     var GLTF1;
     (function (GLTF1) {
-        ;
-        ;
-        ;
         var GLTFMaterialsCommonExtension = /** @class */ (function (_super) {
             __extends(GLTFMaterialsCommonExtension, _super);
             function GLTFMaterialsCommonExtension() {
                 return _super.call(this, "KHR_materials_common") || this;
             }
             GLTFMaterialsCommonExtension.prototype.loadRuntimeExtensionsAsync = function (gltfRuntime, onSuccess, onError) {
-                if (!gltfRuntime.extensions)
+                if (!gltfRuntime.extensions) {
                     return false;
+                }
                 var extension = gltfRuntime.extensions[this.name];
-                if (!extension)
+                if (!extension) {
                     return false;
+                }
                 // Create lights
                 var lights = extension.lights;
                 if (lights) {
@@ -2895,11 +2895,13 @@ var BABYLON;
             };
             GLTFMaterialsCommonExtension.prototype.loadMaterialAsync = function (gltfRuntime, id, onSuccess, onError) {
                 var material = gltfRuntime.materials[id];
-                if (!material || !material.extensions)
+                if (!material || !material.extensions) {
                     return false;
+                }
                 var extension = material.extensions[this.name];
-                if (!extension)
+                if (!extension) {
                     return false;
+                }
                 var standardMaterial = new BABYLON.StandardMaterial(id, gltfRuntime.scene);
                 standardMaterial.sideOrientation = BABYLON.Material.CounterClockWiseSideOrientation;
                 if (extension.technique === "CONSTANT") {
@@ -3656,12 +3658,15 @@ var BABYLON;
                     matrix.decompose(scaling, rotation, position);
                 }
                 else {
-                    if (node.translation)
+                    if (node.translation) {
                         position = BABYLON.Vector3.FromArray(node.translation);
-                    if (node.rotation)
+                    }
+                    if (node.rotation) {
                         rotation = BABYLON.Quaternion.FromArray(node.rotation);
-                    if (node.scale)
+                    }
+                    if (node.scale) {
                         scaling = BABYLON.Vector3.FromArray(node.scale);
+                    }
                 }
                 babylonNode.position = position;
                 babylonNode.rotationQuaternion = rotation;
@@ -4402,7 +4407,6 @@ var BABYLON;
                         wrapV: GLTFLoader._GetTextureWrapMode(context + "/wrapT", sampler.wrapT)
                     };
                 }
-                ;
                 return sampler._data;
             };
             /**
@@ -5303,12 +5307,15 @@ var BABYLON;
                             var promise = Promise.all(clipPromises).then(function () {
                                 var weights = emitter.clips.map(function (clip) { return clip.weight || 1; });
                                 var weightedSound = new BABYLON.WeightedSound(emitter.loop || false, emitter._babylonSounds, weights);
-                                if (emitter.innerAngle)
+                                if (emitter.innerAngle) {
                                     weightedSound.directionalConeInnerAngle = 2 * BABYLON.Tools.ToDegrees(emitter.innerAngle);
-                                if (emitter.outerAngle)
+                                }
+                                if (emitter.outerAngle) {
                                     weightedSound.directionalConeOuterAngle = 2 * BABYLON.Tools.ToDegrees(emitter.outerAngle);
-                                if (emitter.volume)
+                                }
+                                if (emitter.volume) {
                                     weightedSound.volume = emitter.volume;
+                                }
                                 emitter._babylonData.sound = weightedSound;
                             });
                             emitter._babylonData = {

+ 6 - 3
dist/preview release/loaders/babylon.objFileLoader.js

@@ -350,14 +350,16 @@ var BABYLON;
              * @returns {boolean}
              */
             var isInArray = function (arr, obj) {
-                if (!arr[obj[0]])
+                if (!arr[obj[0]]) {
                     arr[obj[0]] = { normals: [], idx: [] };
+                }
                 var idx = arr[obj[0]].normals.indexOf(obj[1]);
                 return idx === -1 ? -1 : arr[obj[0]].idx[idx];
             };
             var isInArrayUV = function (arr, obj) {
-                if (!arr[obj[0]])
+                if (!arr[obj[0]]) {
                     arr[obj[0]] = { normals: [], idx: [], uv: [] };
+                }
                 var idx = arr[obj[0]].normals.indexOf(obj[1]);
                 if (idx != 1 && (obj[2] == arr[obj[0]].uv[idx])) {
                     return arr[obj[0]].idx[idx];
@@ -411,8 +413,9 @@ var BABYLON;
                     //Add the tuple in the comparison list
                     tuplePosNorm[indicePositionFromObj].normals.push(indiceNormalFromObj);
                     tuplePosNorm[indicePositionFromObj].idx.push(curPositionInIndices++);
-                    if (OBJFileLoader.OPTIMIZE_WITH_UV)
+                    if (OBJFileLoader.OPTIMIZE_WITH_UV) {
                         tuplePosNorm[indicePositionFromObj].uv.push(indiceUvsFromObj);
+                    }
                 }
                 else {
                     //The tuple already exists

+ 36 - 26
dist/preview release/loaders/babylonjs.loaders.js

@@ -549,14 +549,16 @@ var BABYLON;
              * @returns {boolean}
              */
             var isInArray = function (arr, obj) {
-                if (!arr[obj[0]])
+                if (!arr[obj[0]]) {
                     arr[obj[0]] = { normals: [], idx: [] };
+                }
                 var idx = arr[obj[0]].normals.indexOf(obj[1]);
                 return idx === -1 ? -1 : arr[obj[0]].idx[idx];
             };
             var isInArrayUV = function (arr, obj) {
-                if (!arr[obj[0]])
+                if (!arr[obj[0]]) {
                     arr[obj[0]] = { normals: [], idx: [], uv: [] };
+                }
                 var idx = arr[obj[0]].normals.indexOf(obj[1]);
                 if (idx != 1 && (obj[2] == arr[obj[0]].uv[idx])) {
                     return arr[obj[0]].idx[idx];
@@ -610,8 +612,9 @@ var BABYLON;
                     //Add the tuple in the comparison list
                     tuplePosNorm[indicePositionFromObj].normals.push(indiceNormalFromObj);
                     tuplePosNorm[indicePositionFromObj].idx.push(curPositionInIndices++);
-                    if (OBJFileLoader.OPTIMIZE_WITH_UV)
+                    if (OBJFileLoader.OPTIMIZE_WITH_UV) {
                         tuplePosNorm[indicePositionFromObj].uv.push(indiceUvsFromObj);
+                    }
                 }
                 else {
                     //The tuple already exists
@@ -1730,14 +1733,18 @@ var BABYLON;
             };
         };
         GLTFFileLoader._compareVersion = function (a, b) {
-            if (a.major > b.major)
+            if (a.major > b.major) {
                 return 1;
-            if (a.major < b.major)
+            }
+            if (a.major < b.major) {
                 return -1;
-            if (a.minor > b.minor)
+            }
+            if (a.minor > b.minor) {
                 return 1;
-            if (a.minor < b.minor)
+            }
+            if (a.minor < b.minor) {
                 return -1;
+            }
             return 0;
         };
         GLTFFileLoader._decodeBufferToText = function (buffer) {
@@ -1950,8 +1957,9 @@ var BABYLON;
                 this._maxPos = toParse.length;
             }
             Tokenizer.prototype.getNextToken = function () {
-                if (this.isEnd())
+                if (this.isEnd()) {
                     return ETokenType.END_OF_INPUT;
+                }
                 this.currentString = this.read();
                 this.currentToken = ETokenType.UNKNOWN;
                 if (this.currentString === "_" || this.isLetterOrDigitPattern.test(this.currentString)) {
@@ -3377,7 +3385,6 @@ var BABYLON;
                     onload();
                 }
             };
-            ;
             GLTFLoader.prototype._loadBuffersAsync = function (gltfRuntime, onLoad, onProgress) {
                 var hasBuffers = false;
                 var processBuffer = function (buf, buffer) {
@@ -3432,7 +3439,6 @@ var BABYLON;
             return GLTFLoader;
         }());
         GLTF1.GLTFLoader = GLTFLoader;
-        ;
         BABYLON.GLTFFileLoader._CreateGLTFLoaderV1 = function () { return new GLTFLoader(); };
     })(GLTF1 = BABYLON.GLTF1 || (BABYLON.GLTF1 = {}));
 })(BABYLON || (BABYLON = {}));
@@ -3829,8 +3835,6 @@ var BABYLON;
     var GLTF1;
     (function (GLTF1) {
         var BinaryExtensionBufferName = "binary_glTF";
-        ;
-        ;
         var GLTFBinaryExtension = /** @class */ (function (_super) {
             __extends(GLTFBinaryExtension, _super);
             function GLTFBinaryExtension() {
@@ -3896,20 +3900,19 @@ var BABYLON;
 (function (BABYLON) {
     var GLTF1;
     (function (GLTF1) {
-        ;
-        ;
-        ;
         var GLTFMaterialsCommonExtension = /** @class */ (function (_super) {
             __extends(GLTFMaterialsCommonExtension, _super);
             function GLTFMaterialsCommonExtension() {
                 return _super.call(this, "KHR_materials_common") || this;
             }
             GLTFMaterialsCommonExtension.prototype.loadRuntimeExtensionsAsync = function (gltfRuntime, onSuccess, onError) {
-                if (!gltfRuntime.extensions)
+                if (!gltfRuntime.extensions) {
                     return false;
+                }
                 var extension = gltfRuntime.extensions[this.name];
-                if (!extension)
+                if (!extension) {
                     return false;
+                }
                 // Create lights
                 var lights = extension.lights;
                 if (lights) {
@@ -3954,11 +3957,13 @@ var BABYLON;
             };
             GLTFMaterialsCommonExtension.prototype.loadMaterialAsync = function (gltfRuntime, id, onSuccess, onError) {
                 var material = gltfRuntime.materials[id];
-                if (!material || !material.extensions)
+                if (!material || !material.extensions) {
                     return false;
+                }
                 var extension = material.extensions[this.name];
-                if (!extension)
+                if (!extension) {
                     return false;
+                }
                 var standardMaterial = new BABYLON.StandardMaterial(id, gltfRuntime.scene);
                 standardMaterial.sideOrientation = BABYLON.Material.CounterClockWiseSideOrientation;
                 if (extension.technique === "CONSTANT") {
@@ -4715,12 +4720,15 @@ var BABYLON;
                     matrix.decompose(scaling, rotation, position);
                 }
                 else {
-                    if (node.translation)
+                    if (node.translation) {
                         position = BABYLON.Vector3.FromArray(node.translation);
-                    if (node.rotation)
+                    }
+                    if (node.rotation) {
                         rotation = BABYLON.Quaternion.FromArray(node.rotation);
-                    if (node.scale)
+                    }
+                    if (node.scale) {
                         scaling = BABYLON.Vector3.FromArray(node.scale);
+                    }
                 }
                 babylonNode.position = position;
                 babylonNode.rotationQuaternion = rotation;
@@ -5461,7 +5469,6 @@ var BABYLON;
                         wrapV: GLTFLoader._GetTextureWrapMode(context + "/wrapT", sampler.wrapT)
                     };
                 }
-                ;
                 return sampler._data;
             };
             /**
@@ -6362,12 +6369,15 @@ var BABYLON;
                             var promise = Promise.all(clipPromises).then(function () {
                                 var weights = emitter.clips.map(function (clip) { return clip.weight || 1; });
                                 var weightedSound = new BABYLON.WeightedSound(emitter.loop || false, emitter._babylonSounds, weights);
-                                if (emitter.innerAngle)
+                                if (emitter.innerAngle) {
                                     weightedSound.directionalConeInnerAngle = 2 * BABYLON.Tools.ToDegrees(emitter.innerAngle);
-                                if (emitter.outerAngle)
+                                }
+                                if (emitter.outerAngle) {
                                     weightedSound.directionalConeOuterAngle = 2 * BABYLON.Tools.ToDegrees(emitter.outerAngle);
-                                if (emitter.volume)
+                                }
+                                if (emitter.volume) {
                                     weightedSound.volume = emitter.volume;
+                                }
                                 emitter._babylonData.sound = weightedSound;
                             });
                             emitter._babylonData = {

+ 4 - 4
dist/preview release/materialsLibrary/babylon.cellMaterial.js

@@ -68,7 +68,7 @@ var BABYLON;
         CellMaterial.prototype.getAlphaTestTexture = function () {
             return null;
         };
-        // Methods   
+        // Methods
         CellMaterial.prototype.isReadyForSubMesh = function (mesh, subMesh, useInstances) {
             if (this.isFrozen) {
                 if (this._wasPreviouslyReady && subMesh.effect) {
@@ -111,7 +111,7 @@ var BABYLON;
             BABYLON.MaterialHelper.PrepareDefinesForFrameBoundValues(scene, engine, defines, useInstances ? true : false);
             // Attribs
             BABYLON.MaterialHelper.PrepareDefinesForAttributes(mesh, defines, true, true);
-            // Get correct effect      
+            // Get correct effect
             if (defines.isDirty) {
                 defines.markAsProcessed();
                 scene.resetCachedMaterial();
@@ -187,13 +187,13 @@ var BABYLON;
                 return;
             }
             this._activeEffect = effect;
-            // Matrices        
+            // Matrices
             this.bindOnlyWorldMatrix(world);
             this._activeEffect.setMatrix("viewProjection", scene.getTransformMatrix());
             // Bones
             BABYLON.MaterialHelper.BindBonesParameters(mesh, this._activeEffect);
             if (this._mustRebind(scene, effect)) {
-                // Textures        
+                // Textures
                 if (this._diffuseTexture && BABYLON.StandardMaterial.DiffuseTextureEnabled) {
                     this._activeEffect.setTexture("diffuseSampler", this._diffuseTexture);
                     this._activeEffect.setFloat2("vDiffuseInfos", this._diffuseTexture.coordinatesIndex, this._diffuseTexture.level);

+ 3 - 3
dist/preview release/materialsLibrary/babylon.fireMaterial.js

@@ -63,7 +63,7 @@ var BABYLON;
         FireMaterial.prototype.getAlphaTestTexture = function () {
             return null;
         };
-        // Methods   
+        // Methods
         FireMaterial.prototype.isReadyForSubMesh = function (mesh, subMesh, useInstances) {
             if (this.isFrozen) {
                 if (this._wasPreviouslyReady && subMesh.effect) {
@@ -104,7 +104,7 @@ var BABYLON;
             BABYLON.MaterialHelper.PrepareDefinesForFrameBoundValues(scene, engine, defines, useInstances ? true : false);
             // Attribs
             BABYLON.MaterialHelper.PrepareDefinesForAttributes(mesh, defines, false, true);
-            // Get correct effect      
+            // Get correct effect
             if (defines.isDirty) {
                 defines.markAsProcessed();
                 scene.resetCachedMaterial();
@@ -177,7 +177,7 @@ var BABYLON;
             // Bones
             BABYLON.MaterialHelper.BindBonesParameters(mesh, this._activeEffect);
             if (this._mustRebind(scene, effect)) {
-                // Textures        
+                // Textures
                 if (this._diffuseTexture && BABYLON.StandardMaterial.DiffuseTextureEnabled) {
                     this._activeEffect.setTexture("diffuseSampler", this._diffuseTexture);
                     this._activeEffect.setFloat2("vDiffuseInfos", this._diffuseTexture.coordinatesIndex, this._diffuseTexture.level);

+ 5 - 5
dist/preview release/materialsLibrary/babylon.furMaterial.js

@@ -103,7 +103,7 @@ var BABYLON;
                 offsetFur.furDensity = this.furDensity;
             }
         };
-        // Methods   
+        // Methods
         FurMaterial.prototype.isReadyForSubMesh = function (mesh, subMesh, useInstances) {
             if (this.isFrozen) {
                 if (this._wasPreviouslyReady && subMesh.effect) {
@@ -149,7 +149,7 @@ var BABYLON;
                 defines.HIGHLEVEL = true;
                 defines.markAsUnprocessed();
             }
-            // Misc.   
+            // Misc.
             BABYLON.MaterialHelper.PrepareDefinesForMisc(mesh, scene, false, this.pointsCloud, this.fogEnabled, this._shouldTurnAlphaTestOn(mesh), defines);
             // Lights
             defines._needNormals = BABYLON.MaterialHelper.PrepareDefinesForLights(scene, mesh, defines, false, this._maxSimultaneousLights, this._disableLighting);
@@ -157,7 +157,7 @@ var BABYLON;
             BABYLON.MaterialHelper.PrepareDefinesForFrameBoundValues(scene, engine, defines, useInstances ? true : false);
             // Attribs
             BABYLON.MaterialHelper.PrepareDefinesForAttributes(mesh, defines, true, true);
-            // Get correct effect      
+            // Get correct effect
             if (defines.isDirty) {
                 defines.markAsProcessed();
                 scene.resetCachedMaterial();
@@ -237,13 +237,13 @@ var BABYLON;
                 return;
             }
             this._activeEffect = effect;
-            // Matrices        
+            // Matrices
             this.bindOnlyWorldMatrix(world);
             this._activeEffect.setMatrix("viewProjection", scene.getTransformMatrix());
             // Bones
             BABYLON.MaterialHelper.BindBonesParameters(mesh, this._activeEffect);
             if (scene.getCachedMaterial() !== this) {
-                // Textures        
+                // Textures
                 if (this._diffuseTexture && BABYLON.StandardMaterial.DiffuseTextureEnabled) {
                     this._activeEffect.setTexture("diffuseSampler", this._diffuseTexture);
                     this._activeEffect.setFloat2("vDiffuseInfos", this._diffuseTexture.coordinatesIndex, this._diffuseTexture.level);

+ 3 - 3
dist/preview release/materialsLibrary/babylon.gradientMaterial.js

@@ -115,7 +115,7 @@ var BABYLON;
         GradientMaterial.prototype.getAlphaTestTexture = function () {
             return null;
         };
-        // Methods   
+        // Methods
         GradientMaterial.prototype.isReadyForSubMesh = function (mesh, subMesh, useInstances) {
             if (this.isFrozen) {
                 if (this._wasPreviouslyReady && subMesh.effect) {
@@ -138,7 +138,7 @@ var BABYLON;
             defines._needNormals = BABYLON.MaterialHelper.PrepareDefinesForLights(scene, mesh, defines, false, this._maxSimultaneousLights);
             // Attribs
             BABYLON.MaterialHelper.PrepareDefinesForAttributes(mesh, defines, false, true);
-            // Get correct effect      
+            // Get correct effect
             if (defines.isDirty) {
                 defines.markAsProcessed();
                 scene.resetCachedMaterial();
@@ -216,7 +216,7 @@ var BABYLON;
                 return;
             }
             this._activeEffect = effect;
-            // Matrices        
+            // Matrices
             this.bindOnlyWorldMatrix(world);
             this._activeEffect.setMatrix("viewProjection", scene.getTransformMatrix());
             // Bones

+ 1 - 1
dist/preview release/materialsLibrary/babylon.gridMaterial.js

@@ -114,7 +114,7 @@ var BABYLON;
                 defines.markAsUnprocessed();
             }
             BABYLON.MaterialHelper.PrepareDefinesForMisc(mesh, scene, false, false, this.fogEnabled, false, defines);
-            // Get correct effect      
+            // Get correct effect
             if (defines.isDirty) {
                 defines.markAsProcessed();
                 scene.resetCachedMaterial();

+ 4 - 4
dist/preview release/materialsLibrary/babylon.lavaMaterial.js

@@ -113,7 +113,7 @@ var BABYLON;
         LavaMaterial.prototype.getAlphaTestTexture = function () {
             return null;
         };
-        // Methods   
+        // Methods
         LavaMaterial.prototype.isReadyForSubMesh = function (mesh, subMesh, useInstances) {
             if (this.isFrozen) {
                 if (this._wasPreviouslyReady && subMesh.effect) {
@@ -155,7 +155,7 @@ var BABYLON;
             BABYLON.MaterialHelper.PrepareDefinesForFrameBoundValues(scene, engine, defines, useInstances ? true : false);
             // Attribs
             BABYLON.MaterialHelper.PrepareDefinesForAttributes(mesh, defines, true, true);
-            // Get correct effect      
+            // Get correct effect
             if (defines.isDirty) {
                 defines.markAsProcessed();
                 scene.resetCachedMaterial();
@@ -237,13 +237,13 @@ var BABYLON;
             }
             this._activeEffect = effect;
             defines.UNLIT = this._unlit;
-            // Matrices        
+            // Matrices
             this.bindOnlyWorldMatrix(world);
             this._activeEffect.setMatrix("viewProjection", scene.getTransformMatrix());
             // Bones
             BABYLON.MaterialHelper.BindBonesParameters(mesh, this._activeEffect);
             if (this._mustRebind(scene, effect)) {
-                // Textures        
+                // Textures
                 if (this.diffuseTexture && BABYLON.StandardMaterial.DiffuseTextureEnabled) {
                     this._activeEffect.setTexture("diffuseSampler", this.diffuseTexture);
                     this._activeEffect.setFloat2("vDiffuseInfos", this.diffuseTexture.coordinatesIndex, this.diffuseTexture.level);

+ 4 - 4
dist/preview release/materialsLibrary/babylon.mixMaterial.js

@@ -71,7 +71,7 @@ var BABYLON;
         MixMaterial.prototype.getAlphaTestTexture = function () {
             return null;
         };
-        // Methods   
+        // Methods
         MixMaterial.prototype.isReadyForSubMesh = function (mesh, subMesh, useInstances) {
             if (this.isFrozen) {
                 if (this._wasPreviouslyReady && subMesh.effect) {
@@ -119,7 +119,7 @@ var BABYLON;
             BABYLON.MaterialHelper.PrepareDefinesForFrameBoundValues(scene, engine, defines, useInstances ? true : false);
             // Attribs
             BABYLON.MaterialHelper.PrepareDefinesForAttributes(mesh, defines, true, true);
-            // Get correct effect      
+            // Get correct effect
             if (defines.isDirty) {
                 defines.markAsProcessed();
                 scene.resetCachedMaterial();
@@ -203,13 +203,13 @@ var BABYLON;
                 return;
             }
             this._activeEffect = effect;
-            // Matrices        
+            // Matrices
             this.bindOnlyWorldMatrix(world);
             this._activeEffect.setMatrix("viewProjection", scene.getTransformMatrix());
             // Bones
             BABYLON.MaterialHelper.BindBonesParameters(mesh, this._activeEffect);
             if (this._mustRebind(scene, effect)) {
-                // Textures        
+                // Textures
                 if (this._mixTexture1) {
                     this._activeEffect.setTexture("mixMap1Sampler", this._mixTexture1);
                     this._activeEffect.setFloat2("vTextureInfos", this._mixTexture1.coordinatesIndex, this._mixTexture1.level);

+ 4 - 4
dist/preview release/materialsLibrary/babylon.normalMaterial.js

@@ -105,7 +105,7 @@ var BABYLON;
         NormalMaterial.prototype.getAlphaTestTexture = function () {
             return null;
         };
-        // Methods   
+        // Methods
         NormalMaterial.prototype.isReadyForSubMesh = function (mesh, subMesh, useInstances) {
             if (this.isFrozen) {
                 if (this._wasPreviouslyReady && subMesh.effect) {
@@ -146,7 +146,7 @@ var BABYLON;
             BABYLON.MaterialHelper.PrepareDefinesForFrameBoundValues(scene, engine, defines, useInstances ? true : false);
             // Attribs
             BABYLON.MaterialHelper.PrepareDefinesForAttributes(mesh, defines, true, true);
-            // Get correct effect      
+            // Get correct effect
             if (defines.isDirty) {
                 defines.markAsProcessed();
                 scene.resetCachedMaterial();
@@ -222,13 +222,13 @@ var BABYLON;
                 return;
             }
             this._activeEffect = effect;
-            // Matrices        
+            // Matrices
             this.bindOnlyWorldMatrix(world);
             this._activeEffect.setMatrix("viewProjection", scene.getTransformMatrix());
             // Bones
             BABYLON.MaterialHelper.BindBonesParameters(mesh, this._activeEffect);
             if (this._mustRebind(scene, effect)) {
-                // Textures        
+                // Textures
                 if (this.diffuseTexture && BABYLON.StandardMaterial.DiffuseTextureEnabled) {
                     this._activeEffect.setTexture("diffuseSampler", this.diffuseTexture);
                     this._activeEffect.setFloat2("vDiffuseInfos", this.diffuseTexture.coordinatesIndex, this.diffuseTexture.level);

+ 3 - 3
dist/preview release/materialsLibrary/babylon.shadowOnlyMaterial.js

@@ -59,7 +59,7 @@ var BABYLON;
             enumerable: true,
             configurable: true
         });
-        // Methods   
+        // Methods
         ShadowOnlyMaterial.prototype.isReadyForSubMesh = function (mesh, subMesh, useInstances) {
             if (this.isFrozen) {
                 if (this._wasPreviouslyReady && subMesh.effect) {
@@ -99,7 +99,7 @@ var BABYLON;
             defines._needNormals = BABYLON.MaterialHelper.PrepareDefinesForLights(scene, mesh, defines, false, 1);
             // Attribs
             BABYLON.MaterialHelper.PrepareDefinesForAttributes(mesh, defines, false, true);
-            // Get correct effect      
+            // Get correct effect
             if (defines.isDirty) {
                 defines.markAsProcessed();
                 scene.resetCachedMaterial();
@@ -165,7 +165,7 @@ var BABYLON;
                 return;
             }
             this._activeEffect = effect;
-            // Matrices        
+            // Matrices
             this.bindOnlyWorldMatrix(world);
             this._activeEffect.setMatrix("viewProjection", scene.getTransformMatrix());
             // Bones

+ 4 - 4
dist/preview release/materialsLibrary/babylon.simpleMaterial.js

@@ -64,7 +64,7 @@ var BABYLON;
         SimpleMaterial.prototype.getAlphaTestTexture = function () {
             return null;
         };
-        // Methods   
+        // Methods
         SimpleMaterial.prototype.isReadyForSubMesh = function (mesh, subMesh, useInstances) {
             if (this.isFrozen) {
                 if (this._wasPreviouslyReady && subMesh.effect) {
@@ -105,7 +105,7 @@ var BABYLON;
             BABYLON.MaterialHelper.PrepareDefinesForFrameBoundValues(scene, engine, defines, useInstances ? true : false);
             // Attribs
             BABYLON.MaterialHelper.PrepareDefinesForAttributes(mesh, defines, true, true);
-            // Get correct effect      
+            // Get correct effect
             if (defines.isDirty) {
                 defines.markAsProcessed();
                 scene.resetCachedMaterial();
@@ -181,13 +181,13 @@ var BABYLON;
                 return;
             }
             this._activeEffect = effect;
-            // Matrices        
+            // Matrices
             this.bindOnlyWorldMatrix(world);
             this._activeEffect.setMatrix("viewProjection", scene.getTransformMatrix());
             // Bones
             BABYLON.MaterialHelper.BindBonesParameters(mesh, this._activeEffect);
             if (this._mustRebind(scene, effect)) {
-                // Textures        
+                // Textures
                 if (this._diffuseTexture && BABYLON.StandardMaterial.DiffuseTextureEnabled) {
                     this._activeEffect.setTexture("diffuseSampler", this._diffuseTexture);
                     this._activeEffect.setFloat2("vDiffuseInfos", this._diffuseTexture.coordinatesIndex, this._diffuseTexture.level);

+ 3 - 3
dist/preview release/materialsLibrary/babylon.skyMaterial.js

@@ -65,7 +65,7 @@ var BABYLON;
         SkyMaterial.prototype.getAlphaTestTexture = function () {
             return null;
         };
-        // Methods   
+        // Methods
         SkyMaterial.prototype.isReadyForSubMesh = function (mesh, subMesh, useInstances) {
             if (this.isFrozen) {
                 if (this._wasPreviouslyReady && subMesh.effect) {
@@ -85,7 +85,7 @@ var BABYLON;
             BABYLON.MaterialHelper.PrepareDefinesForMisc(mesh, scene, false, this.pointsCloud, this.fogEnabled, false, defines);
             // Attribs
             BABYLON.MaterialHelper.PrepareDefinesForAttributes(mesh, defines, true, false);
-            // Get correct effect      
+            // Get correct effect
             if (defines.isDirty) {
                 defines.markAsProcessed();
                 scene.resetCachedMaterial();
@@ -125,7 +125,7 @@ var BABYLON;
                 return;
             }
             this._activeEffect = effect;
-            // Matrices        
+            // Matrices
             this.bindOnlyWorldMatrix(world);
             this._activeEffect.setMatrix("viewProjection", scene.getTransformMatrix());
             if (this._mustRebind(scene, effect)) {

+ 4 - 4
dist/preview release/materialsLibrary/babylon.terrainMaterial.js

@@ -68,7 +68,7 @@ var BABYLON;
         TerrainMaterial.prototype.getAlphaTestTexture = function () {
             return null;
         };
-        // Methods   
+        // Methods
         TerrainMaterial.prototype.isReadyForSubMesh = function (mesh, subMesh, useInstances) {
             if (this.isFrozen) {
                 if (this._wasPreviouslyReady && subMesh.effect) {
@@ -111,7 +111,7 @@ var BABYLON;
             BABYLON.MaterialHelper.PrepareDefinesForFrameBoundValues(scene, engine, defines, useInstances ? true : false);
             // Attribs
             BABYLON.MaterialHelper.PrepareDefinesForAttributes(mesh, defines, true, true);
-            // Get correct effect      
+            // Get correct effect
             if (defines.isDirty) {
                 defines.markAsProcessed();
                 scene.resetCachedMaterial();
@@ -191,13 +191,13 @@ var BABYLON;
                 return;
             }
             this._activeEffect = effect;
-            // Matrices        
+            // Matrices
             this.bindOnlyWorldMatrix(world);
             this._activeEffect.setMatrix("viewProjection", scene.getTransformMatrix());
             // Bones
             BABYLON.MaterialHelper.BindBonesParameters(mesh, this._activeEffect);
             if (this._mustRebind(scene, effect)) {
-                // Textures        
+                // Textures
                 if (this.mixTexture) {
                     this._activeEffect.setTexture("textureSampler", this._mixTexture);
                     this._activeEffect.setFloat2("vTextureInfos", this._mixTexture.coordinatesIndex, this._mixTexture.level);

+ 4 - 4
dist/preview release/materialsLibrary/babylon.triPlanarMaterial.js

@@ -71,7 +71,7 @@ var BABYLON;
         TriPlanarMaterial.prototype.getAlphaTestTexture = function () {
             return null;
         };
-        // Methods   
+        // Methods
         TriPlanarMaterial.prototype.isReadyForSubMesh = function (mesh, subMesh, useInstances) {
             if (this.isFrozen) {
                 if (this._wasPreviouslyReady && subMesh.effect) {
@@ -130,7 +130,7 @@ var BABYLON;
             BABYLON.MaterialHelper.PrepareDefinesForFrameBoundValues(scene, engine, defines, useInstances ? true : false);
             // Attribs
             BABYLON.MaterialHelper.PrepareDefinesForAttributes(mesh, defines, true, true);
-            // Get correct effect      
+            // Get correct effect
             if (defines.isDirty) {
                 defines.markAsProcessed();
                 scene.resetCachedMaterial();
@@ -203,14 +203,14 @@ var BABYLON;
                 return;
             }
             this._activeEffect = effect;
-            // Matrices        
+            // Matrices
             this.bindOnlyWorldMatrix(world);
             this._activeEffect.setMatrix("viewProjection", scene.getTransformMatrix());
             // Bones
             BABYLON.MaterialHelper.BindBonesParameters(mesh, this._activeEffect);
             this._activeEffect.setFloat("tileSize", this.tileSize);
             if (scene.getCachedMaterial() !== this) {
-                // Textures        
+                // Textures
                 if (this.diffuseTextureX) {
                     this._activeEffect.setTexture("diffuseSamplerX", this.diffuseTextureX);
                 }

+ 4 - 4
dist/preview release/materialsLibrary/babylon.waterMaterial.js

@@ -269,7 +269,7 @@ var BABYLON;
                 }
                 this._waitingRenderList = null;
             }
-            // Get correct effect      
+            // Get correct effect
             if (defines.isDirty) {
                 defines.markAsProcessed();
                 scene.resetCachedMaterial();
@@ -356,13 +356,13 @@ var BABYLON;
                 return;
             }
             this._activeEffect = effect;
-            // Matrices        
+            // Matrices
             this.bindOnlyWorldMatrix(world);
             this._activeEffect.setMatrix("viewProjection", scene.getTransformMatrix());
             // Bones
             BABYLON.MaterialHelper.BindBonesParameters(mesh, this._activeEffect);
             if (this._mustRebind(scene, effect)) {
-                // Textures        
+                // Textures
                 if (this.bumpTexture && BABYLON.StandardMaterial.BumpTextureEnabled) {
                     this._activeEffect.setTexture("normalSampler", this.bumpTexture);
                     this._activeEffect.setFloat2("vNormalInfos", this.bumpTexture.coordinatesIndex, this.bumpTexture.level);
@@ -446,7 +446,7 @@ var BABYLON;
                 if (_this._mesh) {
                     _this._mesh.isVisible = isVisible;
                 }
-                // Clip plane 
+                // Clip plane
                 scene.clipPlane = clipPlane;
             };
             this._reflectionRTT.onBeforeRender = function () {

+ 50 - 50
dist/preview release/materialsLibrary/babylonjs.materials.js

@@ -72,7 +72,7 @@ var BABYLON;
             enumerable: true,
             configurable: true
         });
-        // Methods   
+        // Methods
         ShadowOnlyMaterial.prototype.isReadyForSubMesh = function (mesh, subMesh, useInstances) {
             if (this.isFrozen) {
                 if (this._wasPreviouslyReady && subMesh.effect) {
@@ -112,7 +112,7 @@ var BABYLON;
             defines._needNormals = BABYLON.MaterialHelper.PrepareDefinesForLights(scene, mesh, defines, false, 1);
             // Attribs
             BABYLON.MaterialHelper.PrepareDefinesForAttributes(mesh, defines, false, true);
-            // Get correct effect      
+            // Get correct effect
             if (defines.isDirty) {
                 defines.markAsProcessed();
                 scene.resetCachedMaterial();
@@ -178,7 +178,7 @@ var BABYLON;
                 return;
             }
             this._activeEffect = effect;
-            // Matrices        
+            // Matrices
             this.bindOnlyWorldMatrix(world);
             this._activeEffect.setMatrix("viewProjection", scene.getTransformMatrix());
             // Bones
@@ -332,7 +332,7 @@ var BABYLON;
         GradientMaterial.prototype.getAlphaTestTexture = function () {
             return null;
         };
-        // Methods   
+        // Methods
         GradientMaterial.prototype.isReadyForSubMesh = function (mesh, subMesh, useInstances) {
             if (this.isFrozen) {
                 if (this._wasPreviouslyReady && subMesh.effect) {
@@ -355,7 +355,7 @@ var BABYLON;
             defines._needNormals = BABYLON.MaterialHelper.PrepareDefinesForLights(scene, mesh, defines, false, this._maxSimultaneousLights);
             // Attribs
             BABYLON.MaterialHelper.PrepareDefinesForAttributes(mesh, defines, false, true);
-            // Get correct effect      
+            // Get correct effect
             if (defines.isDirty) {
                 defines.markAsProcessed();
                 scene.resetCachedMaterial();
@@ -433,7 +433,7 @@ var BABYLON;
                 return;
             }
             this._activeEffect = effect;
-            // Matrices        
+            // Matrices
             this.bindOnlyWorldMatrix(world);
             this._activeEffect.setMatrix("viewProjection", scene.getTransformMatrix());
             // Bones
@@ -616,7 +616,7 @@ var BABYLON;
         NormalMaterial.prototype.getAlphaTestTexture = function () {
             return null;
         };
-        // Methods   
+        // Methods
         NormalMaterial.prototype.isReadyForSubMesh = function (mesh, subMesh, useInstances) {
             if (this.isFrozen) {
                 if (this._wasPreviouslyReady && subMesh.effect) {
@@ -657,7 +657,7 @@ var BABYLON;
             BABYLON.MaterialHelper.PrepareDefinesForFrameBoundValues(scene, engine, defines, useInstances ? true : false);
             // Attribs
             BABYLON.MaterialHelper.PrepareDefinesForAttributes(mesh, defines, true, true);
-            // Get correct effect      
+            // Get correct effect
             if (defines.isDirty) {
                 defines.markAsProcessed();
                 scene.resetCachedMaterial();
@@ -733,13 +733,13 @@ var BABYLON;
                 return;
             }
             this._activeEffect = effect;
-            // Matrices        
+            // Matrices
             this.bindOnlyWorldMatrix(world);
             this._activeEffect.setMatrix("viewProjection", scene.getTransformMatrix());
             // Bones
             BABYLON.MaterialHelper.BindBonesParameters(mesh, this._activeEffect);
             if (this._mustRebind(scene, effect)) {
-                // Textures        
+                // Textures
                 if (this.diffuseTexture && BABYLON.StandardMaterial.DiffuseTextureEnabled) {
                     this._activeEffect.setTexture("diffuseSampler", this.diffuseTexture);
                     this._activeEffect.setFloat2("vDiffuseInfos", this.diffuseTexture.coordinatesIndex, this.diffuseTexture.level);
@@ -940,7 +940,7 @@ var BABYLON;
         LavaMaterial.prototype.getAlphaTestTexture = function () {
             return null;
         };
-        // Methods   
+        // Methods
         LavaMaterial.prototype.isReadyForSubMesh = function (mesh, subMesh, useInstances) {
             if (this.isFrozen) {
                 if (this._wasPreviouslyReady && subMesh.effect) {
@@ -982,7 +982,7 @@ var BABYLON;
             BABYLON.MaterialHelper.PrepareDefinesForFrameBoundValues(scene, engine, defines, useInstances ? true : false);
             // Attribs
             BABYLON.MaterialHelper.PrepareDefinesForAttributes(mesh, defines, true, true);
-            // Get correct effect      
+            // Get correct effect
             if (defines.isDirty) {
                 defines.markAsProcessed();
                 scene.resetCachedMaterial();
@@ -1064,13 +1064,13 @@ var BABYLON;
             }
             this._activeEffect = effect;
             defines.UNLIT = this._unlit;
-            // Matrices        
+            // Matrices
             this.bindOnlyWorldMatrix(world);
             this._activeEffect.setMatrix("viewProjection", scene.getTransformMatrix());
             // Bones
             BABYLON.MaterialHelper.BindBonesParameters(mesh, this._activeEffect);
             if (this._mustRebind(scene, effect)) {
-                // Textures        
+                // Textures
                 if (this.diffuseTexture && BABYLON.StandardMaterial.DiffuseTextureEnabled) {
                     this._activeEffect.setTexture("diffuseSampler", this.diffuseTexture);
                     this._activeEffect.setFloat2("vDiffuseInfos", this.diffuseTexture.coordinatesIndex, this.diffuseTexture.level);
@@ -1263,7 +1263,7 @@ var BABYLON;
         SimpleMaterial.prototype.getAlphaTestTexture = function () {
             return null;
         };
-        // Methods   
+        // Methods
         SimpleMaterial.prototype.isReadyForSubMesh = function (mesh, subMesh, useInstances) {
             if (this.isFrozen) {
                 if (this._wasPreviouslyReady && subMesh.effect) {
@@ -1304,7 +1304,7 @@ var BABYLON;
             BABYLON.MaterialHelper.PrepareDefinesForFrameBoundValues(scene, engine, defines, useInstances ? true : false);
             // Attribs
             BABYLON.MaterialHelper.PrepareDefinesForAttributes(mesh, defines, true, true);
-            // Get correct effect      
+            // Get correct effect
             if (defines.isDirty) {
                 defines.markAsProcessed();
                 scene.resetCachedMaterial();
@@ -1380,13 +1380,13 @@ var BABYLON;
                 return;
             }
             this._activeEffect = effect;
-            // Matrices        
+            // Matrices
             this.bindOnlyWorldMatrix(world);
             this._activeEffect.setMatrix("viewProjection", scene.getTransformMatrix());
             // Bones
             BABYLON.MaterialHelper.BindBonesParameters(mesh, this._activeEffect);
             if (this._mustRebind(scene, effect)) {
-                // Textures        
+                // Textures
                 if (this._diffuseTexture && BABYLON.StandardMaterial.DiffuseTextureEnabled) {
                     this._activeEffect.setTexture("diffuseSampler", this._diffuseTexture);
                     this._activeEffect.setFloat2("vDiffuseInfos", this._diffuseTexture.coordinatesIndex, this._diffuseTexture.level);
@@ -1743,7 +1743,7 @@ var BABYLON;
                 }
                 this._waitingRenderList = null;
             }
-            // Get correct effect      
+            // Get correct effect
             if (defines.isDirty) {
                 defines.markAsProcessed();
                 scene.resetCachedMaterial();
@@ -1830,13 +1830,13 @@ var BABYLON;
                 return;
             }
             this._activeEffect = effect;
-            // Matrices        
+            // Matrices
             this.bindOnlyWorldMatrix(world);
             this._activeEffect.setMatrix("viewProjection", scene.getTransformMatrix());
             // Bones
             BABYLON.MaterialHelper.BindBonesParameters(mesh, this._activeEffect);
             if (this._mustRebind(scene, effect)) {
-                // Textures        
+                // Textures
                 if (this.bumpTexture && BABYLON.StandardMaterial.BumpTextureEnabled) {
                     this._activeEffect.setTexture("normalSampler", this.bumpTexture);
                     this._activeEffect.setFloat2("vNormalInfos", this.bumpTexture.coordinatesIndex, this.bumpTexture.level);
@@ -1920,7 +1920,7 @@ var BABYLON;
                 if (_this._mesh) {
                     _this._mesh.isVisible = isVisible;
                 }
-                // Clip plane 
+                // Clip plane
                 scene.clipPlane = clipPlane;
             };
             this._reflectionRTT.onBeforeRender = function () {
@@ -2166,7 +2166,7 @@ var BABYLON;
         FireMaterial.prototype.getAlphaTestTexture = function () {
             return null;
         };
-        // Methods   
+        // Methods
         FireMaterial.prototype.isReadyForSubMesh = function (mesh, subMesh, useInstances) {
             if (this.isFrozen) {
                 if (this._wasPreviouslyReady && subMesh.effect) {
@@ -2207,7 +2207,7 @@ var BABYLON;
             BABYLON.MaterialHelper.PrepareDefinesForFrameBoundValues(scene, engine, defines, useInstances ? true : false);
             // Attribs
             BABYLON.MaterialHelper.PrepareDefinesForAttributes(mesh, defines, false, true);
-            // Get correct effect      
+            // Get correct effect
             if (defines.isDirty) {
                 defines.markAsProcessed();
                 scene.resetCachedMaterial();
@@ -2280,7 +2280,7 @@ var BABYLON;
             // Bones
             BABYLON.MaterialHelper.BindBonesParameters(mesh, this._activeEffect);
             if (this._mustRebind(scene, effect)) {
-                // Textures        
+                // Textures
                 if (this._diffuseTexture && BABYLON.StandardMaterial.DiffuseTextureEnabled) {
                     this._activeEffect.setTexture("diffuseSampler", this._diffuseTexture);
                     this._activeEffect.setFloat2("vDiffuseInfos", this._diffuseTexture.coordinatesIndex, this._diffuseTexture.level);
@@ -2528,7 +2528,7 @@ var BABYLON;
                 offsetFur.furDensity = this.furDensity;
             }
         };
-        // Methods   
+        // Methods
         FurMaterial.prototype.isReadyForSubMesh = function (mesh, subMesh, useInstances) {
             if (this.isFrozen) {
                 if (this._wasPreviouslyReady && subMesh.effect) {
@@ -2574,7 +2574,7 @@ var BABYLON;
                 defines.HIGHLEVEL = true;
                 defines.markAsUnprocessed();
             }
-            // Misc.   
+            // Misc.
             BABYLON.MaterialHelper.PrepareDefinesForMisc(mesh, scene, false, this.pointsCloud, this.fogEnabled, this._shouldTurnAlphaTestOn(mesh), defines);
             // Lights
             defines._needNormals = BABYLON.MaterialHelper.PrepareDefinesForLights(scene, mesh, defines, false, this._maxSimultaneousLights, this._disableLighting);
@@ -2582,7 +2582,7 @@ var BABYLON;
             BABYLON.MaterialHelper.PrepareDefinesForFrameBoundValues(scene, engine, defines, useInstances ? true : false);
             // Attribs
             BABYLON.MaterialHelper.PrepareDefinesForAttributes(mesh, defines, true, true);
-            // Get correct effect      
+            // Get correct effect
             if (defines.isDirty) {
                 defines.markAsProcessed();
                 scene.resetCachedMaterial();
@@ -2662,13 +2662,13 @@ var BABYLON;
                 return;
             }
             this._activeEffect = effect;
-            // Matrices        
+            // Matrices
             this.bindOnlyWorldMatrix(world);
             this._activeEffect.setMatrix("viewProjection", scene.getTransformMatrix());
             // Bones
             BABYLON.MaterialHelper.BindBonesParameters(mesh, this._activeEffect);
             if (scene.getCachedMaterial() !== this) {
-                // Textures        
+                // Textures
                 if (this._diffuseTexture && BABYLON.StandardMaterial.DiffuseTextureEnabled) {
                     this._activeEffect.setTexture("diffuseSampler", this._diffuseTexture);
                     this._activeEffect.setFloat2("vDiffuseInfos", this._diffuseTexture.coordinatesIndex, this._diffuseTexture.level);
@@ -2963,7 +2963,7 @@ var BABYLON;
         TerrainMaterial.prototype.getAlphaTestTexture = function () {
             return null;
         };
-        // Methods   
+        // Methods
         TerrainMaterial.prototype.isReadyForSubMesh = function (mesh, subMesh, useInstances) {
             if (this.isFrozen) {
                 if (this._wasPreviouslyReady && subMesh.effect) {
@@ -3006,7 +3006,7 @@ var BABYLON;
             BABYLON.MaterialHelper.PrepareDefinesForFrameBoundValues(scene, engine, defines, useInstances ? true : false);
             // Attribs
             BABYLON.MaterialHelper.PrepareDefinesForAttributes(mesh, defines, true, true);
-            // Get correct effect      
+            // Get correct effect
             if (defines.isDirty) {
                 defines.markAsProcessed();
                 scene.resetCachedMaterial();
@@ -3086,13 +3086,13 @@ var BABYLON;
                 return;
             }
             this._activeEffect = effect;
-            // Matrices        
+            // Matrices
             this.bindOnlyWorldMatrix(world);
             this._activeEffect.setMatrix("viewProjection", scene.getTransformMatrix());
             // Bones
             BABYLON.MaterialHelper.BindBonesParameters(mesh, this._activeEffect);
             if (this._mustRebind(scene, effect)) {
-                // Textures        
+                // Textures
                 if (this.mixTexture) {
                     this._activeEffect.setTexture("textureSampler", this._mixTexture);
                     this._activeEffect.setFloat2("vTextureInfos", this._mixTexture.coordinatesIndex, this._mixTexture.level);
@@ -3356,7 +3356,7 @@ var BABYLON;
         MixMaterial.prototype.getAlphaTestTexture = function () {
             return null;
         };
-        // Methods   
+        // Methods
         MixMaterial.prototype.isReadyForSubMesh = function (mesh, subMesh, useInstances) {
             if (this.isFrozen) {
                 if (this._wasPreviouslyReady && subMesh.effect) {
@@ -3404,7 +3404,7 @@ var BABYLON;
             BABYLON.MaterialHelper.PrepareDefinesForFrameBoundValues(scene, engine, defines, useInstances ? true : false);
             // Attribs
             BABYLON.MaterialHelper.PrepareDefinesForAttributes(mesh, defines, true, true);
-            // Get correct effect      
+            // Get correct effect
             if (defines.isDirty) {
                 defines.markAsProcessed();
                 scene.resetCachedMaterial();
@@ -3488,13 +3488,13 @@ var BABYLON;
                 return;
             }
             this._activeEffect = effect;
-            // Matrices        
+            // Matrices
             this.bindOnlyWorldMatrix(world);
             this._activeEffect.setMatrix("viewProjection", scene.getTransformMatrix());
             // Bones
             BABYLON.MaterialHelper.BindBonesParameters(mesh, this._activeEffect);
             if (this._mustRebind(scene, effect)) {
-                // Textures        
+                // Textures
                 if (this._mixTexture1) {
                     this._activeEffect.setTexture("mixMap1Sampler", this._mixTexture1);
                     this._activeEffect.setFloat2("vTextureInfos", this._mixTexture1.coordinatesIndex, this._mixTexture1.level);
@@ -3815,7 +3815,7 @@ var BABYLON;
         TriPlanarMaterial.prototype.getAlphaTestTexture = function () {
             return null;
         };
-        // Methods   
+        // Methods
         TriPlanarMaterial.prototype.isReadyForSubMesh = function (mesh, subMesh, useInstances) {
             if (this.isFrozen) {
                 if (this._wasPreviouslyReady && subMesh.effect) {
@@ -3874,7 +3874,7 @@ var BABYLON;
             BABYLON.MaterialHelper.PrepareDefinesForFrameBoundValues(scene, engine, defines, useInstances ? true : false);
             // Attribs
             BABYLON.MaterialHelper.PrepareDefinesForAttributes(mesh, defines, true, true);
-            // Get correct effect      
+            // Get correct effect
             if (defines.isDirty) {
                 defines.markAsProcessed();
                 scene.resetCachedMaterial();
@@ -3947,14 +3947,14 @@ var BABYLON;
                 return;
             }
             this._activeEffect = effect;
-            // Matrices        
+            // Matrices
             this.bindOnlyWorldMatrix(world);
             this._activeEffect.setMatrix("viewProjection", scene.getTransformMatrix());
             // Bones
             BABYLON.MaterialHelper.BindBonesParameters(mesh, this._activeEffect);
             this._activeEffect.setFloat("tileSize", this.tileSize);
             if (scene.getCachedMaterial() !== this) {
-                // Textures        
+                // Textures
                 if (this.diffuseTextureX) {
                     this._activeEffect.setTexture("diffuseSamplerX", this.diffuseTextureX);
                 }
@@ -4194,7 +4194,7 @@ var BABYLON;
         SkyMaterial.prototype.getAlphaTestTexture = function () {
             return null;
         };
-        // Methods   
+        // Methods
         SkyMaterial.prototype.isReadyForSubMesh = function (mesh, subMesh, useInstances) {
             if (this.isFrozen) {
                 if (this._wasPreviouslyReady && subMesh.effect) {
@@ -4214,7 +4214,7 @@ var BABYLON;
             BABYLON.MaterialHelper.PrepareDefinesForMisc(mesh, scene, false, this.pointsCloud, this.fogEnabled, false, defines);
             // Attribs
             BABYLON.MaterialHelper.PrepareDefinesForAttributes(mesh, defines, true, false);
-            // Get correct effect      
+            // Get correct effect
             if (defines.isDirty) {
                 defines.markAsProcessed();
                 scene.resetCachedMaterial();
@@ -4254,7 +4254,7 @@ var BABYLON;
                 return;
             }
             this._activeEffect = effect;
-            // Matrices        
+            // Matrices
             this.bindOnlyWorldMatrix(world);
             this._activeEffect.setMatrix("viewProjection", scene.getTransformMatrix());
             if (this._mustRebind(scene, effect)) {
@@ -4457,7 +4457,7 @@ var BABYLON;
                 defines.markAsUnprocessed();
             }
             BABYLON.MaterialHelper.PrepareDefinesForMisc(mesh, scene, false, false, this.fogEnabled, false, defines);
-            // Get correct effect      
+            // Get correct effect
             if (defines.isDirty) {
                 defines.markAsProcessed();
                 scene.resetCachedMaterial();
@@ -4791,7 +4791,7 @@ var BABYLON;
         CellMaterial.prototype.getAlphaTestTexture = function () {
             return null;
         };
-        // Methods   
+        // Methods
         CellMaterial.prototype.isReadyForSubMesh = function (mesh, subMesh, useInstances) {
             if (this.isFrozen) {
                 if (this._wasPreviouslyReady && subMesh.effect) {
@@ -4834,7 +4834,7 @@ var BABYLON;
             BABYLON.MaterialHelper.PrepareDefinesForFrameBoundValues(scene, engine, defines, useInstances ? true : false);
             // Attribs
             BABYLON.MaterialHelper.PrepareDefinesForAttributes(mesh, defines, true, true);
-            // Get correct effect      
+            // Get correct effect
             if (defines.isDirty) {
                 defines.markAsProcessed();
                 scene.resetCachedMaterial();
@@ -4910,13 +4910,13 @@ var BABYLON;
                 return;
             }
             this._activeEffect = effect;
-            // Matrices        
+            // Matrices
             this.bindOnlyWorldMatrix(world);
             this._activeEffect.setMatrix("viewProjection", scene.getTransformMatrix());
             // Bones
             BABYLON.MaterialHelper.BindBonesParameters(mesh, this._activeEffect);
             if (this._mustRebind(scene, effect)) {
-                // Textures        
+                // Textures
                 if (this._diffuseTexture && BABYLON.StandardMaterial.DiffuseTextureEnabled) {
                     this._activeEffect.setTexture("diffuseSampler", this._diffuseTexture);
                     this._activeEffect.setFloat2("vDiffuseInfos", this._diffuseTexture.coordinatesIndex, this._diffuseTexture.level);

+ 0 - 7
dist/preview release/serializers/babylon.glTF2Serializer.js

@@ -3,7 +3,6 @@ BABYLON.Effect.ShadersStore['textureTransformPixelShader'] = "precision highp fl
 /// <reference path="../../../../dist/preview release/babylon.d.ts"/>
 var BABYLON;
 (function (BABYLON) {
-    ;
     /**
      * Class for generating glTF data from a Babylon scene.
      */
@@ -1153,7 +1152,6 @@ var BABYLON;
                                     }
                                 }
                             }
-                            ;
                             if (scene.nodes.length) {
                                 _this._scenes.push(scene);
                             }
@@ -1203,7 +1201,6 @@ var BABYLON;
                         var babylonTransformNode = nodes_2[_i];
                         _loop_1(babylonTransformNode);
                     }
-                    ;
                     return promiseChain.then(function () {
                         if (runtimeGLTFAnimation.channels.length && runtimeGLTFAnimation.samplers.length) {
                             _this._animations.push(runtimeGLTFAnimation);
@@ -2749,7 +2746,6 @@ var BABYLON;
                                 }
                             }
                         }
-                        ;
                     }
                 };
                 /**
@@ -2787,12 +2783,10 @@ var BABYLON;
                                     }
                                 }
                             }
-                            ;
                             if (glTFAnimation.channels.length && glTFAnimation.samplers.length) {
                                 glTFAnimations.push(glTFAnimation);
                             }
                         }
-                        ;
                     }
                 };
                 _GLTFAnimation.AddAnimation = function (name, glTFAnimation, babylonTransformNode, animation, dataAccessorType, animationChannelTargetPath, nodeMap, binaryWriter, bufferViews, accessors, convertToRightHandedSystem, useQuaternion, animationSampleRate) {
@@ -3004,7 +2998,6 @@ var BABYLON;
                         inputs.push(keyFrame.frame / animation.framePerSecond); // keyframes in seconds.
                         _GLTFAnimation._AddKeyframeValue(keyFrame, animation, outputs, animationChannelTargetPath, babylonTransformNode, convertToRightHandedSystem, useQuaternion);
                     }
-                    ;
                 };
                 /**
                  * Creates cubic spline animation from the animation key frames

+ 0 - 7
dist/preview release/serializers/babylonjs.serializers.js

@@ -164,7 +164,6 @@ BABYLON.Effect.ShadersStore['textureTransformPixelShader'] = "precision highp fl
 
 var BABYLON;
 (function (BABYLON) {
-    ;
     /**
      * Class for generating glTF data from a Babylon scene.
      */
@@ -1314,7 +1313,6 @@ var BABYLON;
                                     }
                                 }
                             }
-                            ;
                             if (scene.nodes.length) {
                                 _this._scenes.push(scene);
                             }
@@ -1364,7 +1362,6 @@ var BABYLON;
                         var babylonTransformNode = nodes_2[_i];
                         _loop_1(babylonTransformNode);
                     }
-                    ;
                     return promiseChain.then(function () {
                         if (runtimeGLTFAnimation.channels.length && runtimeGLTFAnimation.samplers.length) {
                             _this._animations.push(runtimeGLTFAnimation);
@@ -2910,7 +2907,6 @@ var BABYLON;
                                 }
                             }
                         }
-                        ;
                     }
                 };
                 /**
@@ -2948,12 +2944,10 @@ var BABYLON;
                                     }
                                 }
                             }
-                            ;
                             if (glTFAnimation.channels.length && glTFAnimation.samplers.length) {
                                 glTFAnimations.push(glTFAnimation);
                             }
                         }
-                        ;
                     }
                 };
                 _GLTFAnimation.AddAnimation = function (name, glTFAnimation, babylonTransformNode, animation, dataAccessorType, animationChannelTargetPath, nodeMap, binaryWriter, bufferViews, accessors, convertToRightHandedSystem, useQuaternion, animationSampleRate) {
@@ -3165,7 +3159,6 @@ var BABYLON;
                         inputs.push(keyFrame.frame / animation.framePerSecond); // keyframes in seconds.
                         _GLTFAnimation._AddKeyframeValue(keyFrame, animation, outputs, animationChannelTargetPath, babylonTransformNode, convertToRightHandedSystem, useQuaternion);
                     }
-                    ;
                 };
                 /**
                  * Creates cubic spline animation from the animation key frames

+ 272 - 198
dist/preview release/viewer/babylon.viewer.d.ts

@@ -123,6 +123,80 @@ declare module BabylonViewer {
     export let viewerManager: ViewerManager;
 }
 declare module BabylonViewer {
+    /**
+        * The Default viewer is the default implementation of the AbstractViewer.
+        * It uses the templating system to render a new canvas and controls.
+        */
+    export class DefaultViewer extends AbstractViewer {
+            containerElement: HTMLElement;
+            fullscreenElement?: HTMLElement;
+            /**
+                * Create a new default viewer
+                * @param containerElement the element in which the templates will be rendered
+                * @param initialConfiguration the initial configuration. Defaults to extending the default configuration
+                */
+            constructor(containerElement: HTMLElement, initialConfiguration?: ViewerConfiguration);
+            registerTemplatePlugin(plugin: IViewerTemplatePlugin): void;
+            /**
+                * This will be executed when the templates initialize.
+                */
+            protected _onTemplatesLoaded(): Promise<AbstractViewer>;
+            protected _initVR(): void;
+            /**
+                * Toggle fullscreen of the entire viewer
+                */
+            toggleFullscreen: () => void;
+            /**
+                * Preparing the container element to present the viewer
+                */
+            protected _prepareContainerElement(): void;
+            /**
+                * This function will configure the templates and update them after a model was loaded
+                * It is mainly responsible to changing the title and subtitle etc'.
+                * @param model the model to be used to configure the templates by
+                */
+            protected _configureTemplate(model?: ViewerModel): void;
+            /**
+                * This will load a new model to the default viewer
+                * overriding the AbstractViewer's loadModel.
+                * The scene will automatically be cleared of the old models, if exist.
+                * @param model the configuration object (or URL) to load.
+                */
+            loadModel(model?: string | File | IModelConfiguration): Promise<ViewerModel>;
+            /**
+                * Show the overlay and the defined sub-screen.
+                * 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<Template> | Promise<string>;
+            /**
+                * Hide the overlay screen.
+                */
+            hideOverlayScreen(): Promise<Template> | Promise<string>;
+            /**
+                * show the viewer (in case it was hidden)
+                *
+                * @param visibilityFunction an optional function to execute in order to show the container
+                */
+            show(visibilityFunction?: ((template: Template) => Promise<Template>)): Promise<Template>;
+            /**
+                * hide the viewer (in case it is visible)
+                *
+                * @param visibilityFunction an optional function to execute in order to hide the container
+                */
+            hide(visibilityFunction?: ((template: Template) => Promise<Template>)): Promise<Template>;
+            /**
+                * Show the loading screen.
+                * The loading screen can be configured using the configuration object
+                */
+            showLoadingScreen(): Promise<Template> | Promise<string>;
+            /**
+                * Hide the loading screen
+                */
+            hideLoadingScreen(): Promise<Template> | Promise<string>;
+            dispose(): void;
+            protected _onConfigurationLoaded(configuration: ViewerConfiguration): void;
+    }
 }
 declare module BabylonViewer {
     /**
@@ -964,6 +1038,171 @@ declare module BabylonViewer {
     }
 }
 declare module BabylonViewer {
+    /**
+        * The object sent when an event is triggered
+        */
+    export interface EventCallback {
+            event: Event;
+            template: Template;
+            selector: string;
+            payload?: any;
+    }
+    /**
+        * The template manager, a member of the viewer class, will manage the viewer's templates and generate the HTML.
+        * The template manager managers a single viewer and can be seen as the collection of all sub-templates of the viewer.
+        */
+    export class TemplateManager {
+            containerElement: HTMLElement;
+            /**
+                * Will be triggered when any template is initialized
+                */
+            onTemplateInit: BABYLON.Observable<Template>;
+            /**
+                * Will be triggered when any template is fully loaded
+                */
+            onTemplateLoaded: BABYLON.Observable<Template>;
+            /**
+                * Will be triggered when a template state changes
+                */
+            onTemplateStateChange: BABYLON.Observable<Template>;
+            /**
+                * Will be triggered when all templates finished loading
+                */
+            onAllLoaded: BABYLON.Observable<TemplateManager>;
+            /**
+                * Will be triggered when any event on any template is triggered.
+                */
+            onEventTriggered: BABYLON.Observable<EventCallback>;
+            /**
+                * This template manager's event manager. In charge of callback registrations to native event types
+                */
+            eventManager: EventManager;
+            constructor(containerElement: HTMLElement);
+            /**
+                * Initialize the template(s) for the viewer. Called bay the Viewer class
+                * @param templates the templates to be used to initialize the main template
+                */
+            initTemplate(templates: {
+                    [key: string]: ITemplateConfiguration;
+            }): Promise<void>;
+            /**
+                * Get the canvas in the template tree.
+                * There must be one and only one canvas inthe template.
+                */
+            getCanvas(): HTMLCanvasElement | null;
+            /**
+                * Get a specific template from the template tree
+                * @param name the name of the template to load
+                */
+            getTemplate(name: string): Template | undefined;
+            /**
+                * Dispose the template manager
+                */
+            dispose(): void;
+    }
+    /**
+        * This class represents a single template in the viewer's template tree.
+        * 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 {
+            name: string;
+            /**
+                * Will be triggered when the template is loaded
+                */
+            onLoaded: BABYLON.Observable<Template>;
+            /**
+                * will be triggered when the template is appended to the tree
+                */
+            onAppended: BABYLON.Observable<Template>;
+            /**
+                * Will be triggered when the template's state changed (shown, hidden)
+                */
+            onStateChange: BABYLON.Observable<Template>;
+            /**
+                * Will be triggered when an event is triggered on ths template.
+                * The event is a native browser event (like mouse or pointer events)
+                */
+            onEventTriggered: BABYLON.Observable<EventCallback>;
+            onParamsUpdated: BABYLON.Observable<Template>;
+            onHTMLRendered: BABYLON.Observable<Template>;
+            /**
+                * is the template loaded?
+                */
+            isLoaded: boolean;
+            /**
+                * This is meant to be used to track the show and hide functions.
+                * This is NOT (!!) a flag to check if the element is actually visible to the user.
+                */
+            isShown: boolean;
+            /**
+                * Is this template a part of the HTML tree (the template manager injected it)
+                */
+            isInHtmlTree: boolean;
+            /**
+                * The HTML element containing this template
+                */
+            parent: HTMLElement;
+            /**
+                * A promise that is fulfilled when the template finished loading.
+                */
+            initPromise: Promise<Template>;
+            constructor(name: string, _configuration: ITemplateConfiguration);
+            /**
+                * 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
+                */
+            updateParams(params: {
+                    [key: string]: string | number | boolean | object;
+            }, append?: boolean): void;
+            redraw(): void;
+            /**
+                * Get the template'S configuration
+                */
+            readonly configuration: ITemplateConfiguration;
+            /**
+                * A template can be a parent element for other templates or HTML elements.
+                * This function will deliver all child HTML elements of this template.
+                */
+            getChildElements(): Array<string>;
+            /**
+                * Appending the template to a parent HTML element.
+                * If a parent is already set and you wish to replace the old HTML with new one, forceRemove should be true.
+                * @param parent the parent to which the template is added
+                * @param forceRemove if the parent already exists, shoud the template be removed from it?
+                */
+            appendTo(parent: HTMLElement, forceRemove?: boolean): void;
+            /**
+                * Show the template using the provided visibilityFunction, or natively using display: flex.
+                * 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.
+                */
+            show(visibilityFunction?: (template: Template) => Promise<Template>): Promise<Template>;
+            /**
+                * Hide the template using the provided visibilityFunction, or natively using display: none.
+                * 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.
+                */
+            hide(visibilityFunction?: (template: Template) => Promise<Template>): Promise<Template>;
+            /**
+                * Dispose this template
+                */
+            dispose(): void;
+    }
+}
+declare module BabylonViewer {
     export class ConfigurationContainer {
         configuration: ViewerConfiguration;
         viewerId: string;
@@ -1240,171 +1479,6 @@ declare module BabylonViewer {
     }
 }
 declare module BabylonViewer {
-    /**
-        * The object sent when an event is triggered
-        */
-    export interface EventCallback {
-            event: Event;
-            template: Template;
-            selector: string;
-            payload?: any;
-    }
-    /**
-        * The template manager, a member of the viewer class, will manage the viewer's templates and generate the HTML.
-        * The template manager managers a single viewer and can be seen as the collection of all sub-templates of the viewer.
-        */
-    export class TemplateManager {
-            containerElement: HTMLElement;
-            /**
-                * Will be triggered when any template is initialized
-                */
-            onTemplateInit: BABYLON.Observable<Template>;
-            /**
-                * Will be triggered when any template is fully loaded
-                */
-            onTemplateLoaded: BABYLON.Observable<Template>;
-            /**
-                * Will be triggered when a template state changes
-                */
-            onTemplateStateChange: BABYLON.Observable<Template>;
-            /**
-                * Will be triggered when all templates finished loading
-                */
-            onAllLoaded: BABYLON.Observable<TemplateManager>;
-            /**
-                * Will be triggered when any event on any template is triggered.
-                */
-            onEventTriggered: BABYLON.Observable<EventCallback>;
-            /**
-                * This template manager's event manager. In charge of callback registrations to native event types
-                */
-            eventManager: EventManager;
-            constructor(containerElement: HTMLElement);
-            /**
-                * Initialize the template(s) for the viewer. Called bay the Viewer class
-                * @param templates the templates to be used to initialize the main template
-                */
-            initTemplate(templates: {
-                    [key: string]: ITemplateConfiguration;
-            }): Promise<void>;
-            /**
-                * Get the canvas in the template tree.
-                * There must be one and only one canvas inthe template.
-                */
-            getCanvas(): HTMLCanvasElement | null;
-            /**
-                * Get a specific template from the template tree
-                * @param name the name of the template to load
-                */
-            getTemplate(name: string): Template | undefined;
-            /**
-                * Dispose the template manager
-                */
-            dispose(): void;
-    }
-    /**
-        * This class represents a single template in the viewer's template tree.
-        * 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 {
-            name: string;
-            /**
-                * Will be triggered when the template is loaded
-                */
-            onLoaded: BABYLON.Observable<Template>;
-            /**
-                * will be triggered when the template is appended to the tree
-                */
-            onAppended: BABYLON.Observable<Template>;
-            /**
-                * Will be triggered when the template's state changed (shown, hidden)
-                */
-            onStateChange: BABYLON.Observable<Template>;
-            /**
-                * Will be triggered when an event is triggered on ths template.
-                * The event is a native browser event (like mouse or pointer events)
-                */
-            onEventTriggered: BABYLON.Observable<EventCallback>;
-            onParamsUpdated: BABYLON.Observable<Template>;
-            onHTMLRendered: BABYLON.Observable<Template>;
-            /**
-                * is the template loaded?
-                */
-            isLoaded: boolean;
-            /**
-                * This is meant to be used to track the show and hide functions.
-                * This is NOT (!!) a flag to check if the element is actually visible to the user.
-                */
-            isShown: boolean;
-            /**
-                * Is this template a part of the HTML tree (the template manager injected it)
-                */
-            isInHtmlTree: boolean;
-            /**
-                * The HTML element containing this template
-                */
-            parent: HTMLElement;
-            /**
-                * A promise that is fulfilled when the template finished loading.
-                */
-            initPromise: Promise<Template>;
-            constructor(name: string, _configuration: ITemplateConfiguration);
-            /**
-                * 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
-                */
-            updateParams(params: {
-                    [key: string]: string | number | boolean | object;
-            }, append?: boolean): void;
-            redraw(): void;
-            /**
-                * Get the template'S configuration
-                */
-            readonly configuration: ITemplateConfiguration;
-            /**
-                * A template can be a parent element for other templates or HTML elements.
-                * This function will deliver all child HTML elements of this template.
-                */
-            getChildElements(): Array<string>;
-            /**
-                * Appending the template to a parent HTML element.
-                * If a parent is already set and you wish to replace the old HTML with new one, forceRemove should be true.
-                * @param parent the parent to which the template is added
-                * @param forceRemove if the parent already exists, shoud the template be removed from it?
-                */
-            appendTo(parent: HTMLElement, forceRemove?: boolean): void;
-            /**
-                * Show the template using the provided visibilityFunction, or natively using display: flex.
-                * 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.
-                */
-            show(visibilityFunction?: (template: Template) => Promise<Template>): Promise<Template>;
-            /**
-                * Hide the template using the provided visibilityFunction, or natively using display: none.
-                * 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.
-                */
-            hide(visibilityFunction?: (template: Template) => Promise<Template>): Promise<Template>;
-            /**
-                * Dispose this template
-                */
-            dispose(): void;
-    }
-}
-declare module BabylonViewer {
     export interface IModelConfiguration {
             id?: string;
             url?: string;
@@ -1525,6 +1599,39 @@ declare module BabylonViewer {
 }
 declare module BabylonViewer {
     /**
+        * The EventManager is in charge of registering user interctions with the viewer.
+        * It is used in the TemplateManager
+        */
+    export class EventManager {
+            constructor(_templateManager: TemplateManager);
+            /**
+                * 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
+                * @param selector an optional selector. if not defined the parent object in the template will be selected
+                */
+            registerCallback(templateName: string, callback: (eventData: EventCallback) => void, eventType?: string, selector?: string): void;
+            /**
+                * 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)
+                * @param selector the selector from which to remove the event (optional)
+                */
+            unregisterCallback(templateName: string, callback: (eventData: EventCallback) => void, eventType?: string, selector?: string): void;
+            /**
+                * Dispose the event manager
+                */
+            dispose(): void;
+    }
+}
+declare module BabylonViewer {
+    /**
         * The ViewerLabs class will hold functions that are not (!) backwards compatible.
         * The APIs in all labs-related classes and configuration  might change.
         * Once stable, lab features will be moved to the publis API and configuration object.
@@ -1573,39 +1680,6 @@ declare module BabylonViewer {
 }
 declare module BabylonViewer {
     /**
-        * The EventManager is in charge of registering user interctions with the viewer.
-        * It is used in the TemplateManager
-        */
-    export class EventManager {
-            constructor(_templateManager: TemplateManager);
-            /**
-                * 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
-                * @param selector an optional selector. if not defined the parent object in the template will be selected
-                */
-            registerCallback(templateName: string, callback: (eventData: EventCallback) => void, eventType?: string, selector?: string): void;
-            /**
-                * 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)
-                * @param selector the selector from which to remove the event (optional)
-                */
-            unregisterCallback(templateName: string, callback: (eventData: EventCallback) => void, eventType?: string, selector?: string): void;
-            /**
-                * Dispose the event manager
-                */
-            dispose(): void;
-    }
-}
-declare module BabylonViewer {
-    /**
         * Defines an animation to be applied to a model (translation, scale or rotation).
         */
     export interface IModelAnimationConfiguration {

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 1 - 1
dist/preview release/viewer/babylon.viewer.js


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 2 - 2
dist/preview release/viewer/babylon.viewer.max.js


+ 283 - 205
dist/preview release/viewer/babylon.viewer.module.d.ts

@@ -150,7 +150,85 @@ declare module 'babylonjs-viewer/viewer/viewerManager' {
 }
 
 declare module 'babylonjs-viewer/viewer/defaultViewer' {
-    
+    import { ViewerConfiguration, IModelConfiguration } from 'babylonjs-viewer/configuration';
+    import { Template } from 'babylonjs-viewer/templating/templateManager';
+    import { AbstractViewer } from 'babylonjs-viewer/viewer/viewer';
+    import { ViewerModel } from 'babylonjs-viewer/model/viewerModel';
+    import { IViewerTemplatePlugin } from 'babylonjs-viewer/templating/viewerTemplatePlugin';
+    /**
+        * The Default viewer is the default implementation of the AbstractViewer.
+        * It uses the templating system to render a new canvas and controls.
+        */
+    export class DefaultViewer extends AbstractViewer {
+            containerElement: HTMLElement;
+            fullscreenElement?: HTMLElement;
+            /**
+                * Create a new default viewer
+                * @param containerElement the element in which the templates will be rendered
+                * @param initialConfiguration the initial configuration. Defaults to extending the default configuration
+                */
+            constructor(containerElement: HTMLElement, initialConfiguration?: ViewerConfiguration);
+            registerTemplatePlugin(plugin: IViewerTemplatePlugin): void;
+            /**
+                * This will be executed when the templates initialize.
+                */
+            protected _onTemplatesLoaded(): Promise<AbstractViewer>;
+            protected _initVR(): void;
+            /**
+                * Toggle fullscreen of the entire viewer
+                */
+            toggleFullscreen: () => void;
+            /**
+                * Preparing the container element to present the viewer
+                */
+            protected _prepareContainerElement(): void;
+            /**
+                * This function will configure the templates and update them after a model was loaded
+                * It is mainly responsible to changing the title and subtitle etc'.
+                * @param model the model to be used to configure the templates by
+                */
+            protected _configureTemplate(model?: ViewerModel): void;
+            /**
+                * This will load a new model to the default viewer
+                * overriding the AbstractViewer's loadModel.
+                * The scene will automatically be cleared of the old models, if exist.
+                * @param model the configuration object (or URL) to load.
+                */
+            loadModel(model?: string | File | IModelConfiguration): Promise<ViewerModel>;
+            /**
+                * Show the overlay and the defined sub-screen.
+                * 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<Template> | Promise<string>;
+            /**
+                * Hide the overlay screen.
+                */
+            hideOverlayScreen(): Promise<Template> | Promise<string>;
+            /**
+                * show the viewer (in case it was hidden)
+                *
+                * @param visibilityFunction an optional function to execute in order to show the container
+                */
+            show(visibilityFunction?: ((template: Template) => Promise<Template>)): Promise<Template>;
+            /**
+                * hide the viewer (in case it is visible)
+                *
+                * @param visibilityFunction an optional function to execute in order to hide the container
+                */
+            hide(visibilityFunction?: ((template: Template) => Promise<Template>)): Promise<Template>;
+            /**
+                * Show the loading screen.
+                * The loading screen can be configured using the configuration object
+                */
+            showLoadingScreen(): Promise<Template> | Promise<string>;
+            /**
+                * Hide the loading screen
+                */
+            hideLoadingScreen(): Promise<Template> | Promise<string>;
+            dispose(): void;
+            protected _onConfigurationLoaded(configuration: ViewerConfiguration): void;
+    }
 }
 
 declare module 'babylonjs-viewer/viewer/viewer' {
@@ -1036,6 +1114,175 @@ declare module 'babylonjs-viewer/configuration/configuration' {
     }
 }
 
+declare module 'babylonjs-viewer/templating/templateManager' {
+    import { Observable } from 'babylonjs';
+    import { EventManager } from 'babylonjs-viewer/templating/eventManager';
+    import { ITemplateConfiguration } from 'babylonjs-viewer/configuration/interfaces';
+    /**
+        * The object sent when an event is triggered
+        */
+    export interface EventCallback {
+            event: Event;
+            template: Template;
+            selector: string;
+            payload?: any;
+    }
+    /**
+        * The template manager, a member of the viewer class, will manage the viewer's templates and generate the HTML.
+        * The template manager managers a single viewer and can be seen as the collection of all sub-templates of the viewer.
+        */
+    export class TemplateManager {
+            containerElement: HTMLElement;
+            /**
+                * Will be triggered when any template is initialized
+                */
+            onTemplateInit: Observable<Template>;
+            /**
+                * Will be triggered when any template is fully loaded
+                */
+            onTemplateLoaded: Observable<Template>;
+            /**
+                * Will be triggered when a template state changes
+                */
+            onTemplateStateChange: Observable<Template>;
+            /**
+                * Will be triggered when all templates finished loading
+                */
+            onAllLoaded: Observable<TemplateManager>;
+            /**
+                * Will be triggered when any event on any template is triggered.
+                */
+            onEventTriggered: Observable<EventCallback>;
+            /**
+                * This template manager's event manager. In charge of callback registrations to native event types
+                */
+            eventManager: EventManager;
+            constructor(containerElement: HTMLElement);
+            /**
+                * Initialize the template(s) for the viewer. Called bay the Viewer class
+                * @param templates the templates to be used to initialize the main template
+                */
+            initTemplate(templates: {
+                    [key: string]: ITemplateConfiguration;
+            }): Promise<void>;
+            /**
+                * Get the canvas in the template tree.
+                * There must be one and only one canvas inthe template.
+                */
+            getCanvas(): HTMLCanvasElement | null;
+            /**
+                * Get a specific template from the template tree
+                * @param name the name of the template to load
+                */
+            getTemplate(name: string): Template | undefined;
+            /**
+                * Dispose the template manager
+                */
+            dispose(): void;
+    }
+    /**
+        * This class represents a single template in the viewer's template tree.
+        * 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 {
+            name: string;
+            /**
+                * Will be triggered when the template is loaded
+                */
+            onLoaded: Observable<Template>;
+            /**
+                * will be triggered when the template is appended to the tree
+                */
+            onAppended: Observable<Template>;
+            /**
+                * Will be triggered when the template's state changed (shown, hidden)
+                */
+            onStateChange: Observable<Template>;
+            /**
+                * Will be triggered when an event is triggered on ths template.
+                * The event is a native browser event (like mouse or pointer events)
+                */
+            onEventTriggered: Observable<EventCallback>;
+            onParamsUpdated: Observable<Template>;
+            onHTMLRendered: Observable<Template>;
+            /**
+                * is the template loaded?
+                */
+            isLoaded: boolean;
+            /**
+                * This is meant to be used to track the show and hide functions.
+                * This is NOT (!!) a flag to check if the element is actually visible to the user.
+                */
+            isShown: boolean;
+            /**
+                * Is this template a part of the HTML tree (the template manager injected it)
+                */
+            isInHtmlTree: boolean;
+            /**
+                * The HTML element containing this template
+                */
+            parent: HTMLElement;
+            /**
+                * A promise that is fulfilled when the template finished loading.
+                */
+            initPromise: Promise<Template>;
+            constructor(name: string, _configuration: ITemplateConfiguration);
+            /**
+                * 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
+                */
+            updateParams(params: {
+                    [key: string]: string | number | boolean | object;
+            }, append?: boolean): void;
+            redraw(): void;
+            /**
+                * Get the template'S configuration
+                */
+            readonly configuration: ITemplateConfiguration;
+            /**
+                * A template can be a parent element for other templates or HTML elements.
+                * This function will deliver all child HTML elements of this template.
+                */
+            getChildElements(): Array<string>;
+            /**
+                * Appending the template to a parent HTML element.
+                * If a parent is already set and you wish to replace the old HTML with new one, forceRemove should be true.
+                * @param parent the parent to which the template is added
+                * @param forceRemove if the parent already exists, shoud the template be removed from it?
+                */
+            appendTo(parent: HTMLElement, forceRemove?: boolean): void;
+            /**
+                * Show the template using the provided visibilityFunction, or natively using display: flex.
+                * 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.
+                */
+            show(visibilityFunction?: (template: Template) => Promise<Template>): Promise<Template>;
+            /**
+                * Hide the template using the provided visibilityFunction, or natively using display: none.
+                * 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.
+                */
+            hide(visibilityFunction?: (template: Template) => Promise<Template>): Promise<Template>;
+            /**
+                * Dispose this template
+                */
+            dispose(): void;
+    }
+}
+
 declare module 'babylonjs-viewer/configuration/configurationContainer' {
     import { ViewerConfiguration } from 'babylonjs-viewer/configuration/configuration';
     import { Color3, Scene } from 'babylonjs';
@@ -1328,175 +1575,6 @@ declare module 'babylonjs-viewer/managers/sceneManager' {
     }
 }
 
-declare module 'babylonjs-viewer/templating/templateManager' {
-    import { Observable } from 'babylonjs';
-    import { EventManager } from 'babylonjs-viewer/templating/eventManager';
-    import { ITemplateConfiguration } from 'babylonjs-viewer/configuration/interfaces';
-    /**
-        * The object sent when an event is triggered
-        */
-    export interface EventCallback {
-            event: Event;
-            template: Template;
-            selector: string;
-            payload?: any;
-    }
-    /**
-        * The template manager, a member of the viewer class, will manage the viewer's templates and generate the HTML.
-        * The template manager managers a single viewer and can be seen as the collection of all sub-templates of the viewer.
-        */
-    export class TemplateManager {
-            containerElement: HTMLElement;
-            /**
-                * Will be triggered when any template is initialized
-                */
-            onTemplateInit: Observable<Template>;
-            /**
-                * Will be triggered when any template is fully loaded
-                */
-            onTemplateLoaded: Observable<Template>;
-            /**
-                * Will be triggered when a template state changes
-                */
-            onTemplateStateChange: Observable<Template>;
-            /**
-                * Will be triggered when all templates finished loading
-                */
-            onAllLoaded: Observable<TemplateManager>;
-            /**
-                * Will be triggered when any event on any template is triggered.
-                */
-            onEventTriggered: Observable<EventCallback>;
-            /**
-                * This template manager's event manager. In charge of callback registrations to native event types
-                */
-            eventManager: EventManager;
-            constructor(containerElement: HTMLElement);
-            /**
-                * Initialize the template(s) for the viewer. Called bay the Viewer class
-                * @param templates the templates to be used to initialize the main template
-                */
-            initTemplate(templates: {
-                    [key: string]: ITemplateConfiguration;
-            }): Promise<void>;
-            /**
-                * Get the canvas in the template tree.
-                * There must be one and only one canvas inthe template.
-                */
-            getCanvas(): HTMLCanvasElement | null;
-            /**
-                * Get a specific template from the template tree
-                * @param name the name of the template to load
-                */
-            getTemplate(name: string): Template | undefined;
-            /**
-                * Dispose the template manager
-                */
-            dispose(): void;
-    }
-    /**
-        * This class represents a single template in the viewer's template tree.
-        * 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 {
-            name: string;
-            /**
-                * Will be triggered when the template is loaded
-                */
-            onLoaded: Observable<Template>;
-            /**
-                * will be triggered when the template is appended to the tree
-                */
-            onAppended: Observable<Template>;
-            /**
-                * Will be triggered when the template's state changed (shown, hidden)
-                */
-            onStateChange: Observable<Template>;
-            /**
-                * Will be triggered when an event is triggered on ths template.
-                * The event is a native browser event (like mouse or pointer events)
-                */
-            onEventTriggered: Observable<EventCallback>;
-            onParamsUpdated: Observable<Template>;
-            onHTMLRendered: Observable<Template>;
-            /**
-                * is the template loaded?
-                */
-            isLoaded: boolean;
-            /**
-                * This is meant to be used to track the show and hide functions.
-                * This is NOT (!!) a flag to check if the element is actually visible to the user.
-                */
-            isShown: boolean;
-            /**
-                * Is this template a part of the HTML tree (the template manager injected it)
-                */
-            isInHtmlTree: boolean;
-            /**
-                * The HTML element containing this template
-                */
-            parent: HTMLElement;
-            /**
-                * A promise that is fulfilled when the template finished loading.
-                */
-            initPromise: Promise<Template>;
-            constructor(name: string, _configuration: ITemplateConfiguration);
-            /**
-                * 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
-                */
-            updateParams(params: {
-                    [key: string]: string | number | boolean | object;
-            }, append?: boolean): void;
-            redraw(): void;
-            /**
-                * Get the template'S configuration
-                */
-            readonly configuration: ITemplateConfiguration;
-            /**
-                * A template can be a parent element for other templates or HTML elements.
-                * This function will deliver all child HTML elements of this template.
-                */
-            getChildElements(): Array<string>;
-            /**
-                * Appending the template to a parent HTML element.
-                * If a parent is already set and you wish to replace the old HTML with new one, forceRemove should be true.
-                * @param parent the parent to which the template is added
-                * @param forceRemove if the parent already exists, shoud the template be removed from it?
-                */
-            appendTo(parent: HTMLElement, forceRemove?: boolean): void;
-            /**
-                * Show the template using the provided visibilityFunction, or natively using display: flex.
-                * 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.
-                */
-            show(visibilityFunction?: (template: Template) => Promise<Template>): Promise<Template>;
-            /**
-                * Hide the template using the provided visibilityFunction, or natively using display: none.
-                * 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.
-                */
-            hide(visibilityFunction?: (template: Template) => Promise<Template>): Promise<Template>;
-            /**
-                * Dispose this template
-                */
-            dispose(): void;
-    }
-}
-
 declare module 'babylonjs-viewer/configuration/interfaces/modelConfiguration' {
     import { IModelAnimationConfiguration } from "babylonjs-viewer/configuration/interfaces/modelAnimationConfiguration";
     export interface IModelConfiguration {
@@ -1644,6 +1722,41 @@ declare module 'babylonjs-viewer/configuration/interfaces/environmentMapConfigur
     }
 }
 
+declare module 'babylonjs-viewer/templating/eventManager' {
+    import { EventCallback, TemplateManager } from "babylonjs-viewer/templating/templateManager";
+    /**
+        * The EventManager is in charge of registering user interctions with the viewer.
+        * It is used in the TemplateManager
+        */
+    export class EventManager {
+            constructor(_templateManager: TemplateManager);
+            /**
+                * 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
+                * @param selector an optional selector. if not defined the parent object in the template will be selected
+                */
+            registerCallback(templateName: string, callback: (eventData: EventCallback) => void, eventType?: string, selector?: string): void;
+            /**
+                * 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)
+                * @param selector the selector from which to remove the event (optional)
+                */
+            unregisterCallback(templateName: string, callback: (eventData: EventCallback) => void, eventType?: string, selector?: string): void;
+            /**
+                * Dispose the event manager
+                */
+            dispose(): void;
+    }
+}
+
 declare module 'babylonjs-viewer/labs/viewerLabs' {
     import { PBREnvironment } from "babylonjs-viewer/labs/environmentSerializer";
     import { ShadowLight, Vector3, Scene } from 'babylonjs';
@@ -1695,41 +1808,6 @@ declare module 'babylonjs-viewer/labs/viewerLabs' {
     }
 }
 
-declare module 'babylonjs-viewer/templating/eventManager' {
-    import { EventCallback, TemplateManager } from "babylonjs-viewer/templating/templateManager";
-    /**
-        * The EventManager is in charge of registering user interctions with the viewer.
-        * It is used in the TemplateManager
-        */
-    export class EventManager {
-            constructor(_templateManager: TemplateManager);
-            /**
-                * 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
-                * @param selector an optional selector. if not defined the parent object in the template will be selected
-                */
-            registerCallback(templateName: string, callback: (eventData: EventCallback) => void, eventType?: string, selector?: string): void;
-            /**
-                * 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)
-                * @param selector the selector from which to remove the event (optional)
-                */
-            unregisterCallback(templateName: string, callback: (eventData: EventCallback) => void, eventType?: string, selector?: string): void;
-            /**
-                * Dispose the event manager
-                */
-            dispose(): void;
-    }
-}
-
 declare module 'babylonjs-viewer/configuration/interfaces/modelAnimationConfiguration' {
     /**
         * Defines an animation to be applied to a model (translation, scale or rotation).

+ 10 - 17
loaders/src/OBJ/babylon.objFileLoader.ts

@@ -126,7 +126,6 @@ module BABYLON {
                     // The dissolve of the material
                     material.opacityTexture = MTLFileLoader._getTexture(rootUrl, value, scene);
 
-
                     //Options for illumination
                 } else if (key === "illum") {
                     //Illumination
@@ -165,10 +164,10 @@ module BABYLON {
 
         /**
          * Gets the texture for the material.
-         * 
+         *
          * If the material is imported from input file,
          * We sanitize the url to ensure it takes the textre from aside the material.
-         * 
+         *
          * @param rootUrl The root url to load from
          * @param value The value stored in the mtl
          * @return The Texture
@@ -229,7 +228,6 @@ module BABYLON {
         // f -vertex/-uvs/-normal -vertex/-uvs/-normal -vertex/-uvs/-normal ...
         public facePattern5 = /f\s+(((-[\d]{1,}\/-[\d]{1,}\/-[\d]{1,}[\s]?){3,})+)/;
 
-
         /**
          * Calls synchronously the MTL file attached to this obj.
          * Load function or importMesh function don't enable to load 2 files in the same time asynchronously.
@@ -266,13 +264,13 @@ module BABYLON {
          */
         public importMeshAsync(meshesNames: any, scene: Scene, data: any, rootUrl: string, onProgress?: (event: SceneLoaderProgressEvent) => void, fileName?: string): Promise<{ meshes: AbstractMesh[], particleSystems: IParticleSystem[], skeletons: Skeleton[], animationGroups: AnimationGroup[] }> {
             //get the meshes from OBJ file
-            return this._parseSolid(meshesNames, scene, data, rootUrl).then(meshes => {
+            return this._parseSolid(meshesNames, scene, data, rootUrl).then((meshes) => {
                 return {
                     meshes,
                     particleSystems: [],
                     skeletons: [],
                     animationGroups: []
-                }
+                };
             });
         }
 
@@ -302,9 +300,9 @@ module BABYLON {
          * @returns The loaded asset container
          */
         public loadAssetContainerAsync(scene: Scene, data: string, rootUrl: string, onProgress?: (event: SceneLoaderProgressEvent) => void, fileName?: string): Promise<AssetContainer> {
-            return this.importMeshAsync(null, scene, data, rootUrl).then(result => {
+            return this.importMeshAsync(null, scene, data, rootUrl).then((result) => {
                 var container = new AssetContainer(scene);
-                result.meshes.forEach(mesh => container.meshes.push(mesh));
+                result.meshes.forEach((mesh) => container.meshes.push(mesh));
                 container.removeAllFromScene();
                 return container;
             });
@@ -357,13 +355,13 @@ module BABYLON {
              * @returns {boolean}
              */
             var isInArray = (arr: Array<{ normals: Array<number>; idx: Array<number> }>, obj: Array<number>) => {
-                if (!arr[obj[0]]) arr[obj[0]] = { normals: [], idx: [] };
+                if (!arr[obj[0]]) { arr[obj[0]] = { normals: [], idx: [] }; }
                 var idx = arr[obj[0]].normals.indexOf(obj[1]);
 
                 return idx === -1 ? -1 : arr[obj[0]].idx[idx];
             };
             var isInArrayUV = (arr: Array<{ normals: Array<number>; idx: Array<number>; uv: Array<number> }>, obj: Array<number>) => {
-                if (!arr[obj[0]]) arr[obj[0]] = { normals: [], idx: [], uv: [] };
+                if (!arr[obj[0]]) { arr[obj[0]] = { normals: [], idx: [], uv: [] }; }
                 var idx = arr[obj[0]].normals.indexOf(obj[1]);
 
                 if (idx != 1 && (obj[2] == arr[obj[0]].uv[idx])) {
@@ -426,7 +424,7 @@ module BABYLON {
                     //Add the tuple in the comparison list
                     tuplePosNorm[indicePositionFromObj].normals.push(indiceNormalFromObj);
                     tuplePosNorm[indicePositionFromObj].idx.push(curPositionInIndices++);
-                    if (OBJFileLoader.OPTIMIZE_WITH_UV) tuplePosNorm[indicePositionFromObj].uv.push(indiceUvsFromObj);
+                    if (OBJFileLoader.OPTIMIZE_WITH_UV) { tuplePosNorm[indicePositionFromObj].uv.push(indiceUvsFromObj); }
                 } else {
                     //The tuple already exists
                     //Add the index of the already existing tuple
@@ -513,7 +511,6 @@ module BABYLON {
                 triangles = [];
             };
 
-
             /**
              * Create triangles and push the data for each polygon for the pattern 2
              * In this pattern we get vertice positions and uvsu
@@ -577,7 +574,6 @@ module BABYLON {
                 triangles = [];
             };
 
-
             /**
              * Create triangles and push the data for each polygon for the pattern 4
              * In this pattern we get vertice positions and normals
@@ -712,7 +708,6 @@ module BABYLON {
                         parseFloat(result[2])
                     ));
 
-
                     //Identify patterns of faces
                     //Face could be defined in different type of pattern
                 } else if ((result = this.facePattern3.exec(line)) !== null) {
@@ -725,7 +720,6 @@ module BABYLON {
                         1
                     );
 
-
                 } else if ((result = this.facePattern4.exec(line)) !== null) {
                     //Value of result:
                     //["f 1//1 2//2 3//3", "1//1 2//2 3//3"...]
@@ -746,7 +740,6 @@ module BABYLON {
                         1
                     );
 
-
                 } else if ((result = this.facePattern2.exec(line)) !== null) {
                     //Value of result:
                     //["f 1/1 2/2 3/3", "1/1 2/2 3/3"...]
@@ -938,7 +931,7 @@ module BABYLON {
             if (fileToLoad !== "") {
                 //Load the file synchronously
                 mtlPromises.push(new Promise((resolve, reject) => {
-                    this._loadMTL(fileToLoad, rootUrl, function (dataLoaded) {
+                    this._loadMTL(fileToLoad, rootUrl, function(dataLoaded) {
                         try {
                             //Create materials thanks MTLLoader function
                             materialsFromMTLFile.parseMTL(scene, dataLoaded, rootUrl);

+ 1 - 3
loaders/src/STL/babylon.stlFileLoader.ts

@@ -1,4 +1,4 @@
-/// <reference path="../../../dist/preview release/babylon.d.ts"/>
+/// <reference path="../../../dist/preview release/babylon.d.ts"/>
 
 module BABYLON {
 
@@ -9,7 +9,6 @@ module BABYLON {
         public normalPattern = /normal[\s]+([\-+]?[0-9]+\.?[0-9]*([eE][\-+]?[0-9]+)?)+[\s]+([\-+]?[0-9]*\.?[0-9]+([eE][\-+]?[0-9]+)?)+[\s]+([\-+]?[0-9]*\.?[0-9]+([eE][\-+]?[0-9]+)?)+/g;
         public vertexPattern = /vertex[\s]+([\-+]?[0-9]+\.?[0-9]*([eE][\-+]?[0-9]+)?)+[\s]+([\-+]?[0-9]*\.?[0-9]+([eE][\-+]?[0-9]+)?)+[\s]+([\-+]?[0-9]*\.?[0-9]+([eE][\-+]?[0-9]+)?)+/g;
 
-
         public name = "stl";
 
         // force data to come in as an ArrayBuffer
@@ -143,7 +142,6 @@ module BABYLON {
                 var normalY = reader.getFloat32(start + 4, true);
                 var normalZ = reader.getFloat32(start + 8, true);
 
-
                 for (var i = 1; i <= 3; i++) {
 
                     var vertexstart = start + i * 12;

+ 3 - 3
loaders/src/glTF/1.0/babylon.glTFBinaryExtension.ts

@@ -1,18 +1,18 @@
-/// <reference path="../../../../dist/preview release/babylon.d.ts"/>
+/// <reference path="../../../../dist/preview release/babylon.d.ts"/>
 
 module BABYLON.GLTF1 {
     const BinaryExtensionBufferName = "binary_glTF";
 
     interface IGLTFBinaryExtensionShader {
         bufferView: string;
-    };
+    }
 
     interface IGLTFBinaryExtensionImage {
         bufferView: string;
         mimeType: string;
         height: number;
         width: number;
-    };
+    }
 
     export class GLTFBinaryExtension extends GLTFLoaderExtension {
         private _bin : ArrayBufferView;

+ 18 - 19
loaders/src/glTF/1.0/babylon.glTFLoader.ts

@@ -1,4 +1,4 @@
-/// <reference path="../../../../dist/preview release/babylon.d.ts"/>
+/// <reference path="../../../../dist/preview release/babylon.d.ts"/>
 
 module BABYLON.GLTF1 {
     /**
@@ -28,7 +28,7 @@ module BABYLON.GLTF1 {
         }
 
         public getNextToken(): ETokenType {
-            if (this.isEnd()) return ETokenType.END_OF_INPUT;
+            if (this.isEnd()) { return ETokenType.END_OF_INPUT; }
 
             this.currentString = this.read();
             this.currentToken = ETokenType.UNKNOWN;
@@ -129,7 +129,6 @@ module BABYLON.GLTF1 {
         return null;
     };
 
-
     /**
     * Loads and creates animations
     */
@@ -340,7 +339,7 @@ module BABYLON.GLTF1 {
         }
 
         return null;
-    }
+    };
 
     /**
     * Returns the appropriate root node
@@ -384,7 +383,7 @@ module BABYLON.GLTF1 {
         }
 
         return null;
-    }
+    };
 
     /**
     * Checks if a nodes is in joints
@@ -397,7 +396,7 @@ module BABYLON.GLTF1 {
         }
 
         return false;
-    }
+    };
 
     /**
     * Fills the nodes to root for bones and builds hierarchy
@@ -1092,7 +1091,7 @@ module BABYLON.GLTF1 {
                         shaderMaterial.setTexture(uniformName, texture);
                         delete unTreatedUniforms[uniformName];
                     }
-                }
+                };
             };
 
             // Texture (sampler2D)
@@ -1206,7 +1205,7 @@ module BABYLON.GLTF1 {
                 importOnlyMeshes: false,
 
                 dummyNodes: []
-            }
+            };
 
             // Parse
             if (parsedData.extensions) {
@@ -1299,7 +1298,7 @@ module BABYLON.GLTF1 {
                 setTimeout(() => onSuccess(new Uint8Array(Tools.DecodeBase64(buffer.uri))));
             }
             else {
-                Tools.LoadFile(gltfRuntime.rootUrl + buffer.uri, data => onSuccess(new Uint8Array(data as ArrayBuffer)), onProgress, undefined, true, request => {
+                Tools.LoadFile(gltfRuntime.rootUrl + buffer.uri, (data) => onSuccess(new Uint8Array(data as ArrayBuffer)), onProgress, undefined, true, (request) => {
                     if (request) {
                         onError(request.status + " " + request.statusText);
                     }
@@ -1326,7 +1325,7 @@ module BABYLON.GLTF1 {
                 setTimeout(() => onSuccess(new Uint8Array(Tools.DecodeBase64(source.uri))));
             }
             else {
-                Tools.LoadFile(gltfRuntime.rootUrl + source.uri, data => onSuccess(new Uint8Array(data as ArrayBuffer)), undefined, undefined, true, request => {
+                Tools.LoadFile(gltfRuntime.rootUrl + source.uri, (data) => onSuccess(new Uint8Array(data as ArrayBuffer)), undefined, undefined, true, (request) => {
                     if (request) {
                         onError(request.status + " " + request.statusText);
                     }
@@ -1378,7 +1377,7 @@ module BABYLON.GLTF1 {
                 }
             }
             else {
-                Tools.LoadFile(gltfRuntime.rootUrl + shader.uri, onSuccess, undefined, undefined, false, request => {
+                Tools.LoadFile(gltfRuntime.rootUrl + shader.uri, onSuccess, undefined, undefined, false, (request) => {
                     if (request && onError) {
                         onError(request.status + " " + request.statusText);
                     }
@@ -1574,7 +1573,7 @@ module BABYLON.GLTF1 {
         private _importMeshAsync(meshesNames: any, scene: Scene, data: IGLTFLoaderData, rootUrl: string, onSuccess: (meshes: AbstractMesh[], skeletons: Skeleton[]) => void, onProgress?: (event: SceneLoaderProgressEvent) => void, onError?: (message: string) => void): boolean {
             scene.useRightHandedSystem = true;
 
-            GLTFLoaderExtension.LoadRuntimeAsync(scene, data, rootUrl, gltfRuntime => {
+            GLTFLoaderExtension.LoadRuntimeAsync(scene, data, rootUrl, (gltfRuntime) => {
                 gltfRuntime.importOnlyMeshes = true;
 
                 if (meshesNames === "") {
@@ -1652,7 +1651,7 @@ module BABYLON.GLTF1 {
                         skeletons: skeletons,
                         animationGroups: []
                     });
-                }, onProgress, message => {
+                }, onProgress, (message) => {
                     reject(new Error(message));
                 });
             });
@@ -1661,7 +1660,7 @@ module BABYLON.GLTF1 {
         private _loadAsync(scene: Scene, data: IGLTFLoaderData, rootUrl: string, onSuccess: () => void, onProgress?: (event: SceneLoaderProgressEvent) => void, onError?: (message: string) => void): void {
             scene.useRightHandedSystem = true;
 
-            GLTFLoaderExtension.LoadRuntimeAsync(scene, data, rootUrl, gltfRuntime => {
+            GLTFLoaderExtension.LoadRuntimeAsync(scene, data, rootUrl, (gltfRuntime) => {
                 // Load runtime extensios
                 GLTFLoaderExtension.LoadRuntimeExtensionsAsync(gltfRuntime, () => {
                     // Create nodes
@@ -1698,7 +1697,7 @@ module BABYLON.GLTF1 {
             return new Promise((resolve, reject) => {
                 this._loadAsync(scene, data, rootUrl, () => {
                     resolve();
-                }, onProgress, message => {
+                }, onProgress, (message) => {
                     reject(new Error(message));
                 });
             });
@@ -1708,7 +1707,7 @@ module BABYLON.GLTF1 {
             var hasShaders = false;
 
             var processShader = (sha: string, shader: IGLTFShader) => {
-                GLTFLoaderExtension.LoadShaderStringAsync(gltfRuntime, sha, shaderString => {
+                GLTFLoaderExtension.LoadShaderStringAsync(gltfRuntime, sha, (shaderString) => {
                     if (shaderString instanceof ArrayBuffer) {
                         return;
                     }
@@ -1742,13 +1741,13 @@ module BABYLON.GLTF1 {
             if (!hasShaders) {
                 onload();
             }
-        };
+        }
 
         private _loadBuffersAsync(gltfRuntime: IGLTFRuntime, onLoad: () => void, onProgress?: (event: SceneLoaderProgressEvent) => void): void {
             var hasBuffers = false;
 
             var processBuffer = (buf: string, buffer: IGLTFBuffer) => {
-                GLTFLoaderExtension.LoadBufferAsync(gltfRuntime, buf, bufferView => {
+                GLTFLoaderExtension.LoadBufferAsync(gltfRuntime, buf, (bufferView) => {
                     gltfRuntime.loadedBufferCount++;
 
                     if (bufferView) {
@@ -1804,7 +1803,7 @@ module BABYLON.GLTF1 {
                 }
             }
         }
-    };
+    }
 
     GLTFFileLoader._CreateGLTFLoaderV1 = () => new GLTFLoader();
 }

+ 9 - 9
loaders/src/glTF/1.0/babylon.glTFLoaderExtension.ts

@@ -1,4 +1,4 @@
-/// <reference path="../../../../dist/preview release/babylon.d.ts"/>
+/// <reference path="../../../../dist/preview release/babylon.d.ts"/>
 
 module BABYLON.GLTF1 {
     export abstract class GLTFLoaderExtension {
@@ -73,7 +73,7 @@ module BABYLON.GLTF1 {
         // ---------
 
         public static LoadRuntimeAsync(scene: Scene, data: IGLTFLoaderData, rootUrl: string, onSuccess?: (gltfRuntime: IGLTFRuntime) => void, onError?: (message: string) => void): void {
-            GLTFLoaderExtension.ApplyExtensions(loaderExtension => {
+            GLTFLoaderExtension.ApplyExtensions((loaderExtension) => {
                 return loaderExtension.loadRuntimeAsync(scene, data, rootUrl, onSuccess, onError);
             }, () => {
                 setTimeout(() => {
@@ -86,7 +86,7 @@ module BABYLON.GLTF1 {
         }
 
         public static LoadRuntimeExtensionsAsync(gltfRuntime: IGLTFRuntime, onSuccess: () => void, onError?: (message: string) => void): void {
-            GLTFLoaderExtension.ApplyExtensions(loaderExtension => {
+            GLTFLoaderExtension.ApplyExtensions((loaderExtension) => {
                 return loaderExtension.loadRuntimeExtensionsAsync(gltfRuntime, onSuccess, onError);
             }, () => {
                 setTimeout(() => {
@@ -96,7 +96,7 @@ module BABYLON.GLTF1 {
         }
 
         public static LoadBufferAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (bufferView: ArrayBufferView) => void, onError: (message: string) => void, onProgress?: () => void): void {
-            GLTFLoaderExtension.ApplyExtensions(loaderExtension => {
+            GLTFLoaderExtension.ApplyExtensions((loaderExtension) => {
                 return loaderExtension.loadBufferAsync(gltfRuntime, id, onSuccess, onError, onProgress);
             }, () => {
                 GLTFLoaderBase.LoadBufferAsync(gltfRuntime, id, onSuccess, onError, onProgress);
@@ -107,13 +107,13 @@ module BABYLON.GLTF1 {
             GLTFLoaderExtension.LoadTextureBufferAsync(gltfRuntime, id,
                (buffer) => {
                     if (buffer) {
-                        GLTFLoaderExtension.CreateTextureAsync(gltfRuntime, id, buffer, onSuccess, onError)
+                        GLTFLoaderExtension.CreateTextureAsync(gltfRuntime, id, buffer, onSuccess, onError);
                     }
                 }, onError);
         }
 
         public static LoadShaderStringAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (shaderData: string | ArrayBuffer) => void, onError: (message: string) => void): void {
-            GLTFLoaderExtension.ApplyExtensions(loaderExtension => {
+            GLTFLoaderExtension.ApplyExtensions((loaderExtension) => {
                 return loaderExtension.loadShaderStringAsync(gltfRuntime, id, onSuccess, onError);
             }, () => {
                 GLTFLoaderBase.LoadShaderStringAsync(gltfRuntime, id, onSuccess, onError);
@@ -121,7 +121,7 @@ module BABYLON.GLTF1 {
         }
 
         public static LoadMaterialAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (material: Material) => void, onError: (message: string) => void): void {
-            GLTFLoaderExtension.ApplyExtensions(loaderExtension => {
+            GLTFLoaderExtension.ApplyExtensions((loaderExtension) => {
                 return loaderExtension.loadMaterialAsync(gltfRuntime, id, onSuccess, onError);
             }, () => {
                 GLTFLoaderBase.LoadMaterialAsync(gltfRuntime, id, onSuccess, onError);
@@ -129,7 +129,7 @@ module BABYLON.GLTF1 {
         }
 
         private static LoadTextureBufferAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (buffer: Nullable<ArrayBufferView>) => void, onError: (message: string) => void): void {
-            GLTFLoaderExtension.ApplyExtensions(loaderExtension => {
+            GLTFLoaderExtension.ApplyExtensions((loaderExtension) => {
                 return loaderExtension.loadTextureBufferAsync(gltfRuntime, id, onSuccess, onError);
             }, () => {
                 GLTFLoaderBase.LoadTextureBufferAsync(gltfRuntime, id, onSuccess, onError);
@@ -137,7 +137,7 @@ module BABYLON.GLTF1 {
         }
 
         private static CreateTextureAsync(gltfRuntime: IGLTFRuntime, id: string, buffer: ArrayBufferView, onSuccess: (texture: Texture) => void, onError: (message: string) => void): void {
-            GLTFLoaderExtension.ApplyExtensions(loaderExtension => {
+            GLTFLoaderExtension.ApplyExtensions((loaderExtension) => {
                 return loaderExtension.createTextureAsync(gltfRuntime, id, buffer, onSuccess, onError);
             }, () => {
                 GLTFLoaderBase.CreateTextureAsync(gltfRuntime, id, buffer, onSuccess, onError);

+ 5 - 5
loaders/src/glTF/1.0/babylon.glTFLoaderInterfaces.ts

@@ -1,4 +1,4 @@
-/// <reference path="../../../../dist/preview release/babylon.d.ts"/>
+/// <reference path="../../../../dist/preview release/babylon.d.ts"/>
 
 module BABYLON.GLTF1 {
     /**
@@ -108,8 +108,8 @@ module BABYLON.GLTF1 {
         type: string;
         componentType: EComponentType;
 
-        max?: number[],
-        min?: number[],
+        max?: number[];
+        min?: number[];
         name?: string;
     }
 
@@ -146,7 +146,7 @@ module BABYLON.GLTF1 {
         count?: number;
         semantic?: string;
         node?: string;
-        value?: number|boolean|string|Array<any>;
+        value?: number | boolean | string | Array<any>;
         source?: string;
 
         babylonValue?: any;
@@ -217,7 +217,7 @@ module BABYLON.GLTF1 {
         internalFormat?: ETextureFormat;
         target?: number;
         type?: number;
-        
+
         // Babylon.js values (optimize)
         babylonTexture?: Texture;
     }

+ 14 - 14
loaders/src/glTF/1.0/babylon.glTFMaterialsCommonExtension.ts

@@ -2,20 +2,20 @@
 
 module BABYLON.GLTF1 {
     interface IGLTFMaterialsCommonExtensionValues {
-        ambient?: number[] | string;
-        diffuse?: number[] | string;
+        ambient?: number[] | string;
+        diffuse?: number[] | string;
         emission?: number[] | string;
         specular?: number[] | string;
         shininess?: number;
         transparency?: number;
-    };
+    }
 
     interface IGLTFMaterialsCommonExtension {
         technique: string;
         transparent?: number;
         doubleSided?: boolean;
         values: IGLTFMaterialsCommonExtensionValues;
-    };
+    }
 
     interface IGLTFRuntimeCommonExtension {
         lights: {[key: string]: IGLTFLightCommonExtension};
@@ -29,7 +29,7 @@ module BABYLON.GLTF1 {
         point?: IGLTFPointLightCommonExtension;
         directional?: IGLTFDirectionalLightCommonExtension;
         spot?: IGLTFSpotLightCommonExtension;
-    };
+    }
 
     interface IGLTFPointLightCommonExtension {
         color: number[];
@@ -62,10 +62,10 @@ module BABYLON.GLTF1 {
         }
 
         public loadRuntimeExtensionsAsync(gltfRuntime: IGLTFRuntime, onSuccess: () => void, onError: (message: string) => void): boolean {
-            if (!gltfRuntime.extensions) return false;
+            if (!gltfRuntime.extensions) { return false; }
 
             var extension: IGLTFRuntimeCommonExtension = gltfRuntime.extensions[this.name];
-            if (!extension) return false;
+            if (!extension) { return false; }
 
             // Create lights
             var lights = extension.lights;
@@ -78,21 +78,21 @@ module BABYLON.GLTF1 {
                             var ambientLight = new HemisphericLight(light.name, new Vector3(0, 1, 0), gltfRuntime.scene);
                             var ambient = light.ambient;
                             if (ambient) {
-                                ambientLight.diffuse = Color3.FromArray(ambient.color || [1, 1, 1]);
+                                ambientLight.diffuse = Color3.FromArray(ambient.color || [1, 1, 1]);
                             }
                             break;
                         case "point":
                             var pointLight = new PointLight(light.name, new Vector3(10, 10, 10), gltfRuntime.scene);
                             var point = light.point;
                             if (point) {
-                                pointLight.diffuse = Color3.FromArray(point.color || [1, 1, 1]);
+                                pointLight.diffuse = Color3.FromArray(point.color || [1, 1, 1]);
                             }
                             break;
                         case "directional":
                             var dirLight = new DirectionalLight(light.name, new Vector3(0, -1, 0), gltfRuntime.scene);
                             var directional = light.directional;
                             if (directional) {
-                                dirLight.diffuse = Color3.FromArray(directional.color || [1, 1, 1]);
+                                dirLight.diffuse = Color3.FromArray(directional.color || [1, 1, 1]);
                             }
                             break;
                         case "spot":
@@ -102,7 +102,7 @@ module BABYLON.GLTF1 {
                                                             spot.fallOffAngle || Math.PI,
                                                             spot.fallOffExponent || 0.0,
                                                             gltfRuntime.scene);
-                                spotLight.diffuse = Color3.FromArray(spot.color || [1, 1, 1]);
+                                spotLight.diffuse = Color3.FromArray(spot.color || [1, 1, 1]);
                             }
                             break;
                         default: Tools.Warn("GLTF Material Common extension: light type \"" + light.type + "\” not supported"); break;
@@ -115,10 +115,10 @@ module BABYLON.GLTF1 {
 
         public loadMaterialAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (material: Material) => void, onError: (message: string) => void): boolean {
             var material: IGLTFMaterial = gltfRuntime.materials[id];
-            if (!material || !material.extensions) return false;
+            if (!material || !material.extensions) { return false; }
 
             var extension: IGLTFMaterialsCommonExtension = material.extensions[this.name];
-            if (!extension) return false;
+            if (!extension) { return false; }
 
             var standardMaterial = new StandardMaterial(id, gltfRuntime.scene);
             standardMaterial.sideOrientation = Material.CounterClockWiseSideOrientation;
@@ -130,7 +130,7 @@ module BABYLON.GLTF1 {
             standardMaterial.backFaceCulling = extension.doubleSided === undefined ? false : !extension.doubleSided;
             standardMaterial.alpha = extension.values.transparency === undefined ? 1.0 : extension.values.transparency;
             standardMaterial.specularPower = extension.values.shininess === undefined ? 0.0 : extension.values.shininess;
-            
+
             // Ambient
             if (typeof extension.values.ambient === "string") {
                 this._loadTexture(gltfRuntime, extension.values.ambient, standardMaterial, "ambientTexture", onError);

+ 4 - 4
loaders/src/glTF/2.0/Extensions/EXT_lights_image_based.ts

@@ -56,7 +56,7 @@ module BABYLON.GLTF2.Loader.Extensions {
         }
 
         /** @hidden */
-        public loadSceneAsync(context: string, scene: IScene): Nullable<Promise<void>> { 
+        public loadSceneAsync(context: string, scene: IScene): Nullable<Promise<void>> {
             return GLTFLoader.LoadExtensionAsync<ILightReference>(context, scene, this.name, (extensionContext, extension) => {
                 const promises = new Array<Promise<any>>();
 
@@ -65,7 +65,7 @@ module BABYLON.GLTF2.Loader.Extensions {
                 this._loader.logOpen(`${extensionContext}`);
 
                 const light = ArrayItem.Get(`${extensionContext}/light`, this._lights, extension.light);
-                promises.push(this._loadLightAsync(`#/extensions/${this.name}/lights/${extension.light}`, light).then(texture => {
+                promises.push(this._loadLightAsync(`#/extensions/${this.name}/lights/${extension.light}`, light).then((texture) => {
                     this._loader.babylonScene.environmentTexture = texture;
                 }));
 
@@ -91,7 +91,7 @@ module BABYLON.GLTF2.Loader.Extensions {
 
                         const index = faces[face];
                         const image = ArrayItem.Get(specularImageContext, this._loader.gltf.images, index);
-                        promises.push(this._loader.loadImageAsync(`#/images/${index}`, image).then(data => {
+                        promises.push(this._loader.loadImageAsync(`#/images/${index}`, image).then((data) => {
                             imageData[mipmap][face] = data;
                         }));
 
@@ -138,5 +138,5 @@ module BABYLON.GLTF2.Loader.Extensions {
         }
     }
 
-    GLTFLoader.RegisterExtension(NAME, loader => new EXT_lights_image_based(loader));
+    GLTFLoader.RegisterExtension(NAME, (loader) => new EXT_lights_image_based(loader));
 }

+ 4 - 4
loaders/src/glTF/2.0/Extensions/KHR_draco_mesh_compression.ts

@@ -81,16 +81,16 @@ module BABYLON.GLTF2.Loader.Extensions {
 
                 var bufferView = ArrayItem.Get(extensionContext, this._loader.gltf.bufferViews, extension.bufferView) as IBufferViewDraco;
                 if (!bufferView._dracoBabylonGeometry) {
-                    bufferView._dracoBabylonGeometry = this._loader.loadBufferViewAsync(`#/bufferViews/${bufferView.index}`, bufferView).then(data => {
+                    bufferView._dracoBabylonGeometry = this._loader.loadBufferViewAsync(`#/bufferViews/${bufferView.index}`, bufferView).then((data) => {
                         if (!this._dracoCompression) {
                             this._dracoCompression = new DracoCompression();
                         }
 
-                        return this._dracoCompression.decodeMeshAsync(data, attributes).then(babylonVertexData => {
+                        return this._dracoCompression.decodeMeshAsync(data, attributes).then((babylonVertexData) => {
                             const babylonGeometry = new Geometry(babylonMesh.name, this._loader.babylonScene);
                             babylonVertexData.applyToGeometry(babylonGeometry);
                             return babylonGeometry;
-                        }).catch(error => {
+                        }).catch((error) => {
                             throw new Error(`${context}: ${error.message}`);
                         });
                     });
@@ -101,5 +101,5 @@ module BABYLON.GLTF2.Loader.Extensions {
         }
     }
 
-    GLTFLoader.RegisterExtension(NAME, loader => new KHR_draco_mesh_compression(loader));
+    GLTFLoader.RegisterExtension(NAME, (loader) => new KHR_draco_mesh_compression(loader));
 }

+ 3 - 4
loaders/src/glTF/2.0/Extensions/KHR_lights_punctual.ts

@@ -23,7 +23,6 @@ module BABYLON.GLTF2.Loader.Extensions {
             outerConeAngle?: number;
         };
     }
-    
 
     interface ILights {
         lights: ILight[];
@@ -63,9 +62,9 @@ module BABYLON.GLTF2.Loader.Extensions {
         }
 
         /** @hidden */
-        public loadNodeAsync(context: string, node: INode, assign: (babylonMesh: Mesh) => void): Nullable<Promise<Mesh>> { 
+        public loadNodeAsync(context: string, node: INode, assign: (babylonMesh: Mesh) => void): Nullable<Promise<Mesh>> {
             return GLTFLoader.LoadExtensionAsync<ILightReference, Mesh>(context, node, this.name, (extensionContext, extension) => {
-                return this._loader.loadNodeAsync(context, node, babylonMesh => {
+                return this._loader.loadNodeAsync(context, node, (babylonMesh) => {
                     let babylonLight: Light;
 
                     const light = ArrayItem.Get(extensionContext, this._lights, extension.light);
@@ -104,5 +103,5 @@ module BABYLON.GLTF2.Loader.Extensions {
         }
     }
 
-    GLTFLoader.RegisterExtension(NAME, loader => new KHR_lights(loader));
+    GLTFLoader.RegisterExtension(NAME, (loader) => new KHR_lights(loader));
 }

+ 3 - 3
loaders/src/glTF/2.0/Extensions/KHR_materials_pbrSpecularGlossiness.ts

@@ -66,14 +66,14 @@ module BABYLON.GLTF2.Loader.Extensions {
             babylonMaterial.microSurface = properties.glossinessFactor == undefined ? 1 : properties.glossinessFactor;
 
             if (properties.diffuseTexture) {
-                promises.push(this._loader.loadTextureInfoAsync(`${context}/diffuseTexture`, properties.diffuseTexture, texture => {
+                promises.push(this._loader.loadTextureInfoAsync(`${context}/diffuseTexture`, properties.diffuseTexture, (texture) => {
                     babylonMaterial.albedoTexture = texture;
                     return Promise.resolve();
                 }));
             }
 
             if (properties.specularGlossinessTexture) {
-                promises.push(this._loader.loadTextureInfoAsync(`${context}/specularGlossinessTexture`, properties.specularGlossinessTexture, texture => {
+                promises.push(this._loader.loadTextureInfoAsync(`${context}/specularGlossinessTexture`, properties.specularGlossinessTexture, (texture) => {
                     babylonMaterial.reflectivityTexture = texture;
                     return Promise.resolve();
                 }));
@@ -86,5 +86,5 @@ module BABYLON.GLTF2.Loader.Extensions {
         }
     }
 
-    GLTFLoader.RegisterExtension(NAME, loader => new KHR_materials_pbrSpecularGlossiness(loader));
+    GLTFLoader.RegisterExtension(NAME, (loader) => new KHR_materials_pbrSpecularGlossiness(loader));
 }

+ 2 - 2
loaders/src/glTF/2.0/Extensions/KHR_materials_unlit.ts

@@ -52,7 +52,7 @@ module BABYLON.GLTF2.Loader.Extensions {
                 }
 
                 if (properties.baseColorTexture) {
-                    promises.push(this._loader.loadTextureInfoAsync(`${context}/baseColorTexture`, properties.baseColorTexture, texture => {
+                    promises.push(this._loader.loadTextureInfoAsync(`${context}/baseColorTexture`, properties.baseColorTexture, (texture) => {
                         babylonMaterial.albedoTexture = texture;
                         return Promise.resolve();
                     }));
@@ -70,5 +70,5 @@ module BABYLON.GLTF2.Loader.Extensions {
         }
     }
 
-    GLTFLoader.RegisterExtension(NAME, loader => new KHR_materials_unlit(loader));
+    GLTFLoader.RegisterExtension(NAME, (loader) => new KHR_materials_unlit(loader));
 }

+ 2 - 2
loaders/src/glTF/2.0/Extensions/KHR_texture_transform.ts

@@ -35,7 +35,7 @@ module BABYLON.GLTF2.Loader.Extensions {
         /** @hidden */
         public loadTextureInfoAsync(context: string, textureInfo: ITextureInfo, assign: (babylonTexture: BaseTexture) => void): Nullable<Promise<BaseTexture>> {
             return GLTFLoader.LoadExtensionAsync<IKHRTextureTransform, BaseTexture>(context, textureInfo, this.name, (extensionContext, extension) => {
-                return this._loader.loadTextureInfoAsync(context, textureInfo, babylonTexture => {
+                return this._loader.loadTextureInfoAsync(context, textureInfo, (babylonTexture) => {
                     if (!(babylonTexture instanceof Texture)) {
                         throw new Error(`${extensionContext}: Texture type not supported`);
                     }
@@ -68,5 +68,5 @@ module BABYLON.GLTF2.Loader.Extensions {
         }
     }
 
-    GLTFLoader.RegisterExtension(NAME, loader => new KHR_texture_transform(loader));
+    GLTFLoader.RegisterExtension(NAME, (loader) => new KHR_texture_transform(loader));
 }

+ 10 - 10
loaders/src/glTF/2.0/Extensions/MSFT_audio_emitter.ts

@@ -65,7 +65,7 @@ module BABYLON.GLTF2.Loader.Extensions {
     }
 
     interface IAnimationEvent {
-        action: AnimationEventAction,
+        action: AnimationEventAction;
         emitter: number;
         time: number;
         startOffset?: number;
@@ -144,7 +144,7 @@ module BABYLON.GLTF2.Loader.Extensions {
             return GLTFLoader.LoadExtensionAsync<IEmittersReference, Mesh>(context, node, this.name, (extensionContext, extension) => {
                 const promises = new Array<Promise<any>>();
 
-                return this._loader.loadNodeAsync(extensionContext, node, babylonMesh => {
+                return this._loader.loadNodeAsync(extensionContext, node, (babylonMesh) => {
                     for (const emitterIndex of extension.emitters) {
                         const emitter = ArrayItem.Get(`${extensionContext}/emitters`, this._emitters, emitterIndex);
                         promises.push(this._loadEmitterAsync(`${extensionContext}/emitters/${emitter.index}`, emitter).then(() => {
@@ -162,7 +162,7 @@ module BABYLON.GLTF2.Loader.Extensions {
                     }
 
                     assign(babylonMesh);
-                }).then(babylonMesh => {
+                }).then((babylonMesh) => {
                     return Promise.all(promises).then(() => {
                         return babylonMesh;
                     });
@@ -173,7 +173,7 @@ module BABYLON.GLTF2.Loader.Extensions {
         /** @hidden */
         public loadAnimationAsync(context: string, animation: IAnimation): Nullable<Promise<AnimationGroup>> {
             return GLTFLoader.LoadExtensionAsync<ILoaderAnimationEvents, AnimationGroup>(context, animation, this.name, (extensionContext, extension) => {
-                return this._loader.loadAnimationAsync(context, animation).then(babylonAnimationGroup => {
+                return this._loader.loadAnimationAsync(context, animation).then((babylonAnimationGroup) => {
                     const promises = new Array<Promise<any>>();
 
                     ArrayItem.Assign(extension.events);
@@ -202,7 +202,7 @@ module BABYLON.GLTF2.Loader.Extensions {
                 promise = this._loader.loadBufferViewAsync(`#/bufferViews/${bufferView.index}`, bufferView);
             }
 
-            clip._objectURL = promise.then(data => {
+            clip._objectURL = promise.then((data) => {
                 return URL.createObjectURL(new Blob([data], { type: clip.mimeType }));
             });
 
@@ -234,11 +234,11 @@ module BABYLON.GLTF2.Loader.Extensions {
                 }
 
                 const promise = Promise.all(clipPromises).then(() => {
-                    const weights = emitter.clips.map(clip => { return clip.weight || 1; });
+                    const weights = emitter.clips.map((clip) => { return clip.weight || 1; });
                     const weightedSound = new WeightedSound(emitter.loop || false, emitter._babylonSounds, weights);
-                    if (emitter.innerAngle) weightedSound.directionalConeInnerAngle = 2 * Tools.ToDegrees(emitter.innerAngle);
-                    if (emitter.outerAngle) weightedSound.directionalConeOuterAngle = 2 * Tools.ToDegrees(emitter.outerAngle);
-                    if (emitter.volume) weightedSound.volume = emitter.volume;
+                    if (emitter.innerAngle) { weightedSound.directionalConeInnerAngle = 2 * Tools.ToDegrees(emitter.innerAngle); }
+                    if (emitter.outerAngle) { weightedSound.directionalConeOuterAngle = 2 * Tools.ToDegrees(emitter.outerAngle); }
+                    if (emitter.volume) { weightedSound.volume = emitter.volume; }
                     emitter._babylonData!.sound = weightedSound;
                 });
 
@@ -298,5 +298,5 @@ module BABYLON.GLTF2.Loader.Extensions {
         }
     }
 
-    GLTFLoader.RegisterExtension(NAME, loader => new MSFT_audio_emitter(loader));
+    GLTFLoader.RegisterExtension(NAME, (loader) => new MSFT_audio_emitter(loader));
 }

+ 4 - 4
loaders/src/glTF/2.0/Extensions/MSFT_lod.ts

@@ -126,7 +126,7 @@ module BABYLON.GLTF2.Loader.Extensions {
                         this._nodeSignalLODs[indexLOD] = this._nodeSignalLODs[indexLOD] || new Deferred();
                     }
 
-                    const promise = this._loader.loadNodeAsync(`#/nodes/${nodeLOD.index}`, nodeLOD).then(babylonMesh => {
+                    const promise = this._loader.loadNodeAsync(`#/nodes/${nodeLOD.index}`, nodeLOD).then((babylonMesh) => {
                         if (indexLOD !== 0) {
                             // TODO: should not rely on _babylonMesh
                             const previousNodeLOD = nodeLODs[indexLOD - 1];
@@ -176,11 +176,11 @@ module BABYLON.GLTF2.Loader.Extensions {
                         this._materialIndexLOD = indexLOD;
                     }
 
-                    const promise = this._loader._loadMaterialAsync(`#/materials/${materialLOD.index}`, materialLOD, babylonMesh, babylonDrawMode, babylonMaterial => {
+                    const promise = this._loader._loadMaterialAsync(`#/materials/${materialLOD.index}`, materialLOD, babylonMesh, babylonDrawMode, (babylonMaterial) => {
                         if (indexLOD === 0) {
                             assign(babylonMaterial);
                         }
-                    }).then(babylonMaterial => {
+                    }).then((babylonMaterial) => {
                         if (indexLOD !== 0) {
                             assign(babylonMaterial);
 
@@ -274,5 +274,5 @@ module BABYLON.GLTF2.Loader.Extensions {
         }
     }
 
-    GLTFLoader.RegisterExtension(NAME, loader => new MSFT_lod(loader));
+    GLTFLoader.RegisterExtension(NAME, (loader) => new MSFT_lod(loader));
 }

+ 1 - 1
loaders/src/glTF/2.0/Extensions/MSFT_minecraftMesh.ts

@@ -43,5 +43,5 @@ module BABYLON.GLTF2.Loader.Extensions {
         }
     }
 
-    GLTFLoader.RegisterExtension(NAME, loader => new MSFT_minecraftMesh(loader));
+    GLTFLoader.RegisterExtension(NAME, (loader) => new MSFT_minecraftMesh(loader));
 }

+ 2 - 2
loaders/src/glTF/2.0/Extensions/MSFT_sRGBFactors.ts

@@ -24,7 +24,7 @@ module BABYLON.GLTF2.Loader.Extensions {
                     if (!(babylonMaterial instanceof PBRMaterial)) {
                         throw new Error(`${extraContext}: Material type not supported`);
                     }
-        
+
                     const promise = this._loader.loadMaterialPropertiesAsync(context, material, babylonMaterial);
 
                     if (!babylonMaterial.albedoTexture) {
@@ -43,5 +43,5 @@ module BABYLON.GLTF2.Loader.Extensions {
         }
     }
 
-    GLTFLoader.RegisterExtension(NAME, loader => new MSFT_sRGBFactors(loader));
+    GLTFLoader.RegisterExtension(NAME, (loader) => new MSFT_sRGBFactors(loader));
 }

+ 56 - 56
loaders/src/glTF/2.0/babylon.glTFLoader.ts

@@ -1,4 +1,4 @@
-/// <reference path="../../../../dist/preview release/babylon.d.ts"/>
+/// <reference path="../../../../dist/preview release/babylon.d.ts"/>
 
 /**
  * Defines the module for importing and exporting glTF 2.0 assets
@@ -179,7 +179,7 @@ module BABYLON.GLTF2 {
                     }
 
                     const names = (meshesNames instanceof Array) ? meshesNames : [meshesNames];
-                    nodes = names.map(name => {
+                    nodes = names.map((name) => {
                         const node = nodeMap[name];
                         if (node === undefined) {
                             throw new Error(`Failed to find node '${name}'`);
@@ -269,7 +269,7 @@ module BABYLON.GLTF2 {
                                 this._parent.onCompleteObservable.clear();
 
                                 this.dispose();
-                            }, error => {
+                            }, (error) => {
                                 this._parent.onErrorObservable.notifyObservers(error);
                                 this._parent.onErrorObservable.clear();
 
@@ -280,7 +280,7 @@ module BABYLON.GLTF2 {
                 });
 
                 return resultPromise;
-            }, error => {
+            }, (error) => {
                 if (!this._disposed) {
                     this._parent.onErrorObservable.notifyObservers(error);
                     this._parent.onErrorObservable.clear();
@@ -421,7 +421,7 @@ module BABYLON.GLTF2 {
             if (scene.nodes) {
                 for (let index of scene.nodes) {
                     const node = ArrayItem.Get(`${context}/nodes/${index}`, this.gltf.nodes, index);
-                    promises.push(this.loadNodeAsync(`#/nodes/${node.index}`, node, babylonMesh => {
+                    promises.push(this.loadNodeAsync(`#/nodes/${node.index}`, node, (babylonMesh) => {
                         babylonMesh.parent = this._rootBabylonMesh;
                     }));
                 }
@@ -560,7 +560,7 @@ module BABYLON.GLTF2 {
 
             if (node.camera != undefined) {
                 const camera = ArrayItem.Get(`${context}/camera`, this.gltf.cameras, node.camera);
-                promises.push(this.loadCameraAsync(`#/cameras/${camera.index}`, camera, babylonCamera => {
+                promises.push(this.loadCameraAsync(`#/cameras/${camera.index}`, camera, (babylonCamera) => {
                     babylonCamera.parent = babylonMesh;
                 }));
             }
@@ -568,7 +568,7 @@ module BABYLON.GLTF2 {
             if (node.children) {
                 for (const index of node.children) {
                     const childNode = ArrayItem.Get(`${context}/children/${index}`, this.gltf.nodes, index);
-                    promises.push(this.loadNodeAsync(`#/nodes/${node.index}`, childNode, childBabylonMesh => {
+                    promises.push(this.loadNodeAsync(`#/nodes/${node.index}`, childNode, (childBabylonMesh) => {
                         // See https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#skins (second implementation note)
                         if (childNode.skin != undefined) {
                             childBabylonMesh.parent = this._rootBabylonMesh;
@@ -624,7 +624,7 @@ module BABYLON.GLTF2 {
             this.logClose();
 
             return Promise.all(promises).then(() => {
-                this._forEachPrimitive(node, babylonMesh => {
+                this._forEachPrimitive(node, (babylonMesh) => {
                     babylonMesh._refreshBoundingInfo(true);
                 });
             });
@@ -636,7 +636,7 @@ module BABYLON.GLTF2 {
             this.logOpen(`${context}`);
 
             this._createMorphTargets(context, node, mesh, primitive, babylonMesh);
-            promises.push(this._loadVertexDataAsync(context, primitive, babylonMesh).then(babylonGeometry => {
+            promises.push(this._loadVertexDataAsync(context, primitive, babylonMesh).then((babylonGeometry) => {
                 return this._loadMorphTargetsAsync(context, primitive, babylonMesh, babylonGeometry).then(() => {
                     babylonGeometry.applyToMesh(babylonMesh);
                 });
@@ -654,7 +654,7 @@ module BABYLON.GLTF2 {
             }
             else {
                 const material = ArrayItem.Get(`${context}/material`, this.gltf.materials, primitive.material);
-                promises.push(this._loadMaterialAsync(`#/materials/${material.index}`, material, babylonMesh, babylonDrawMode, babylonMaterial => {
+                promises.push(this._loadMaterialAsync(`#/materials/${material.index}`, material, babylonMesh, babylonDrawMode, (babylonMaterial) => {
                     babylonMesh.material = babylonMaterial;
                 }));
             }
@@ -684,7 +684,7 @@ module BABYLON.GLTF2 {
             }
             else {
                 const accessor = ArrayItem.Get(`${context}/indices`, this.gltf.accessors, primitive.indices);
-                promises.push(this._loadIndicesAccessorAsync(`#/accessors/${accessor.index}`, accessor).then(data => {
+                promises.push(this._loadIndicesAccessorAsync(`#/accessors/${accessor.index}`, accessor).then((data) => {
                     babylonGeometry.setIndices(data);
                 }));
             }
@@ -700,7 +700,7 @@ module BABYLON.GLTF2 {
                 }
 
                 const accessor = ArrayItem.Get(`${context}/attributes/${attribute}`, this.gltf.accessors, attributes[attribute]);
-                promises.push(this._loadVertexAccessorAsync(`#/accessors/${accessor.index}`, accessor, kind).then(babylonVertexBuffer => {
+                promises.push(this._loadVertexAccessorAsync(`#/accessors/${accessor.index}`, accessor, kind).then((babylonVertexBuffer) => {
                     babylonGeometry.setVerticesBuffer(babylonVertexBuffer, accessor.count);
                 }));
 
@@ -716,7 +716,7 @@ module BABYLON.GLTF2 {
             loadAttribute("TEXCOORD_1", VertexBuffer.UV2Kind);
             loadAttribute("JOINTS_0", VertexBuffer.MatricesIndicesKind);
             loadAttribute("WEIGHTS_0", VertexBuffer.MatricesWeightsKind);
-            loadAttribute("COLOR_0", VertexBuffer.ColorKind, accessor => {
+            loadAttribute("COLOR_0", VertexBuffer.ColorKind, (accessor) => {
                 if (accessor.type === AccessorType.VEC4) {
                     babylonMesh.hasVertexAlpha = true;
                 }
@@ -777,7 +777,7 @@ module BABYLON.GLTF2 {
                 }
 
                 const accessor = ArrayItem.Get(`${context}/${attribute}`, this.gltf.accessors, attributes[attribute]);
-                promises.push(this._loadFloatAccessorAsync(`#/accessors/${accessor.index}`, accessor).then(data => {
+                promises.push(this._loadFloatAccessorAsync(`#/accessors/${accessor.index}`, accessor).then((data) => {
                     setData(babylonVertexBuffer, data);
                 }));
             };
@@ -824,9 +824,9 @@ module BABYLON.GLTF2 {
                 matrix.decompose(scaling, rotation, position);
             }
             else {
-                if (node.translation) position = Vector3.FromArray(node.translation);
-                if (node.rotation) rotation = Quaternion.FromArray(node.rotation);
-                if (node.scale) scaling = Vector3.FromArray(node.scale);
+                if (node.translation) { position = Vector3.FromArray(node.translation); }
+                if (node.rotation) { rotation = Quaternion.FromArray(node.rotation); }
+                if (node.scale) { scaling = Vector3.FromArray(node.scale); }
             }
 
             babylonNode.position = position;
@@ -836,7 +836,7 @@ module BABYLON.GLTF2 {
 
         private _loadSkinAsync(context: string, node: Loader.INode, skin: Loader.ISkin): Promise<void> {
             const assignSkeleton = (skeleton: Skeleton) => {
-                this._forEachPrimitive(node, babylonMesh => {
+                this._forEachPrimitive(node, (babylonMesh) => {
                     babylonMesh.skeleton = skeleton;
                 });
 
@@ -859,7 +859,7 @@ module BABYLON.GLTF2 {
             this._loadBones(context, skin);
             assignSkeleton(babylonSkeleton);
 
-            return (skin._promise = this._loadSkinInverseBindMatricesDataAsync(context, skin).then(inverseBindMatricesData => {
+            return (skin._promise = this._loadSkinInverseBindMatricesDataAsync(context, skin).then((inverseBindMatricesData) => {
                 this._updateBoneMatrices(babylonSkeleton, inverseBindMatricesData);
             }));
         }
@@ -1052,7 +1052,7 @@ module BABYLON.GLTF2 {
             }
 
             const sampler = ArrayItem.Get(`${context}/sampler`, animation.samplers, channel.sampler);
-            return this._loadAnimationSamplerAsync(`${animationContext}/samplers/${channel.sampler}`, sampler).then(data => {
+            return this._loadAnimationSamplerAsync(`${animationContext}/samplers/${channel.sampler}`, sampler).then((data) => {
                 let targetPath: string;
                 let animationType: number;
                 switch (channel.target.path) {
@@ -1123,7 +1123,7 @@ module BABYLON.GLTF2 {
                 let getNextKey: (frameIndex: number) => IAnimationKey;
                 switch (data.interpolation) {
                     case AnimationSamplerInterpolation.STEP: {
-                        getNextKey = frameIndex => ({
+                        getNextKey = (frameIndex) => ({
                             frame: data.input[frameIndex],
                             value: getNextOutputValue(),
                             interpolation: AnimationKeyInterpolation.STEP
@@ -1131,14 +1131,14 @@ module BABYLON.GLTF2 {
                         break;
                     }
                     case AnimationSamplerInterpolation.LINEAR: {
-                        getNextKey = frameIndex => ({
+                        getNextKey = (frameIndex) => ({
                             frame: data.input[frameIndex],
                             value: getNextOutputValue()
                         });
                         break;
                     }
                     case AnimationSamplerInterpolation.CUBICSPLINE: {
-                        getNextKey = frameIndex => ({
+                        getNextKey = (frameIndex) => ({
                             frame: data.input[frameIndex],
                             inTangent: getNextOutputValue(),
                             value: getNextOutputValue(),
@@ -1157,14 +1157,14 @@ module BABYLON.GLTF2 {
                     for (let targetIndex = 0; targetIndex < targetNode._numMorphTargets!; targetIndex++) {
                         const animationName = `${babylonAnimationGroup.name}_channel${babylonAnimationGroup.targetedAnimations.length}`;
                         const babylonAnimation = new Animation(animationName, targetPath, 1, animationType);
-                        babylonAnimation.setKeys(keys.map(key => ({
+                        babylonAnimation.setKeys(keys.map((key) => ({
                             frame: key.frame,
                             inTangent: key.inTangent ? key.inTangent[targetIndex] : undefined,
                             value: key.value[targetIndex],
                             outTangent: key.outTangent ? key.outTangent[targetIndex] : undefined
                         })));
 
-                        this._forEachPrimitive(targetNode, babylonMesh => {
+                        this._forEachPrimitive(targetNode, (babylonMesh) => {
                             const morphTarget = babylonMesh.morphTargetManager!.getTarget(targetIndex);
                             const babylonAnimationClone = babylonAnimation.clone();
                             morphTarget.animations.push(babylonAnimationClone);
@@ -1251,7 +1251,7 @@ module BABYLON.GLTF2 {
             }
 
             const buffer = ArrayItem.Get(`${context}/buffer`, this.gltf.buffers, bufferView.buffer);
-            bufferView._data = this._loadBufferAsync(`#/buffers/${buffer.index}`, buffer).then(data => {
+            bufferView._data = this._loadBufferAsync(`#/buffers/${buffer.index}`, buffer).then((data) => {
                 try {
                     return new Uint8Array(data.buffer, data.byteOffset + (bufferView.byteOffset || 0), bufferView.byteLength);
                 }
@@ -1279,7 +1279,7 @@ module BABYLON.GLTF2 {
             }
 
             const bufferView = ArrayItem.Get(`${context}/bufferView`, this.gltf.bufferViews, accessor.bufferView);
-            accessor._data = this.loadBufferViewAsync(`#/bufferViews/${bufferView.index}`, bufferView).then(data => {
+            accessor._data = this.loadBufferViewAsync(`#/bufferViews/${bufferView.index}`, bufferView).then((data) => {
                 return GLTFLoader._GetTypedArray(context, accessor.componentType, data, accessor.byteOffset, accessor.count);
             });
 
@@ -1305,7 +1305,7 @@ module BABYLON.GLTF2 {
             }
             else {
                 const bufferView = ArrayItem.Get(`${context}/bufferView`, this.gltf.bufferViews, accessor.bufferView);
-                accessor._data = this.loadBufferViewAsync(`#/bufferViews/${bufferView.index}`, bufferView).then(data => {
+                accessor._data = this.loadBufferViewAsync(`#/bufferViews/${bufferView.index}`, bufferView).then((data) => {
                     return GLTFLoader._GetTypedArray(context, accessor.componentType, data, accessor.byteOffset, length);
                 });
             }
@@ -1343,7 +1343,7 @@ module BABYLON.GLTF2 {
                 return bufferView._babylonBuffer;
             }
 
-            bufferView._babylonBuffer = this.loadBufferViewAsync(`#/bufferViews/${bufferView.index}`, bufferView).then(data => {
+            bufferView._babylonBuffer = this.loadBufferViewAsync(`#/bufferViews/${bufferView.index}`, bufferView).then((data) => {
                 return new Buffer(this.babylonScene.getEngine(), data, false);
             });
 
@@ -1356,20 +1356,20 @@ module BABYLON.GLTF2 {
             }
 
             if (accessor.sparse) {
-                accessor._babylonVertexBuffer = this._loadFloatAccessorAsync(`#/accessors/${accessor.index}`, accessor).then(data => {
+                accessor._babylonVertexBuffer = this._loadFloatAccessorAsync(`#/accessors/${accessor.index}`, accessor).then((data) => {
                     return new VertexBuffer(this.babylonScene.getEngine(), data, kind, false);
                 });
             }
             // HACK: If byte offset is not a multiple of component type byte length then load as a float array instead of using Babylon buffers.
             else if (accessor.byteOffset && accessor.byteOffset % VertexBuffer.GetTypeByteLength(accessor.componentType) !== 0) {
                 Tools.Warn("Accessor byte offset is not a multiple of component type byte length");
-                accessor._babylonVertexBuffer = this._loadFloatAccessorAsync(`#/accessors/${accessor.index}`, accessor).then(data => {
+                accessor._babylonVertexBuffer = this._loadFloatAccessorAsync(`#/accessors/${accessor.index}`, accessor).then((data) => {
                     return new VertexBuffer(this.babylonScene.getEngine(), data, kind, false);
                 });
             }
             else {
                 const bufferView = ArrayItem.Get(`${context}/bufferView`, this.gltf.bufferViews, accessor.bufferView);
-                accessor._babylonVertexBuffer = this._loadVertexBufferViewAsync(bufferView, kind).then(babylonBuffer => {
+                accessor._babylonVertexBuffer = this._loadVertexBufferViewAsync(bufferView, kind).then((babylonBuffer) => {
                     const size = GLTFLoader._GetNumComponents(context, accessor.type);
                     return new VertexBuffer(this.babylonScene.getEngine(), babylonBuffer, kind, false, false, bufferView.byteStride,
                         false, accessor.byteOffset, size, accessor.componentType, accessor.normalized, true);
@@ -1399,13 +1399,13 @@ module BABYLON.GLTF2 {
                 babylonMaterial.roughness = properties.roughnessFactor == undefined ? 1 : properties.roughnessFactor;
 
                 if (properties.baseColorTexture) {
-                    promises.push(this.loadTextureInfoAsync(`${context}/baseColorTexture`, properties.baseColorTexture, texture => {
+                    promises.push(this.loadTextureInfoAsync(`${context}/baseColorTexture`, properties.baseColorTexture, (texture) => {
                         babylonMaterial.albedoTexture = texture;
                     }));
                 }
 
                 if (properties.metallicRoughnessTexture) {
-                    promises.push(this.loadTextureInfoAsync(`${context}/metallicRoughnessTexture`, properties.metallicRoughnessTexture, texture => {
+                    promises.push(this.loadTextureInfoAsync(`${context}/metallicRoughnessTexture`, properties.metallicRoughnessTexture, (texture) => {
                         babylonMaterial.metallicTexture = texture;
                     }));
 
@@ -1538,7 +1538,7 @@ module BABYLON.GLTF2 {
             }
 
             if (material.normalTexture) {
-                promises.push(this.loadTextureInfoAsync(`${context}/normalTexture`, material.normalTexture, texture => {
+                promises.push(this.loadTextureInfoAsync(`${context}/normalTexture`, material.normalTexture, (texture) => {
                     babylonMaterial.bumpTexture = texture;
                 }));
 
@@ -1550,7 +1550,7 @@ module BABYLON.GLTF2 {
             }
 
             if (material.occlusionTexture) {
-                promises.push(this.loadTextureInfoAsync(`${context}/occlusionTexture`, material.occlusionTexture, texture => {
+                promises.push(this.loadTextureInfoAsync(`${context}/occlusionTexture`, material.occlusionTexture, (texture) => {
                     babylonMaterial.ambientTexture = texture;
                 }));
 
@@ -1561,7 +1561,7 @@ module BABYLON.GLTF2 {
             }
 
             if (material.emissiveTexture) {
-                promises.push(this.loadTextureInfoAsync(`${context}/emissiveTexture`, material.emissiveTexture, texture => {
+                promises.push(this.loadTextureInfoAsync(`${context}/emissiveTexture`, material.emissiveTexture, (texture) => {
                     babylonMaterial.emissiveTexture = texture;
                 }));
             }
@@ -1625,7 +1625,7 @@ module BABYLON.GLTF2 {
             this.logOpen(`${context}`);
 
             const texture = ArrayItem.Get(`${context}/index`, this.gltf.textures, textureInfo.index);
-            const promise = this._loadTextureAsync(`#/textures/${textureInfo.index}`, texture, babylonTexture => {
+            const promise = this._loadTextureAsync(`#/textures/${textureInfo.index}`, texture, (babylonTexture) => {
                 babylonTexture.coordinatesIndex = textureInfo.texCoord || 0;
                 assign(babylonTexture);
             });
@@ -1660,7 +1660,7 @@ module BABYLON.GLTF2 {
             babylonTexture.wrapV = samplerData.wrapV;
 
             const image = ArrayItem.Get(`${context}/source`, this.gltf.images, texture.source);
-            promises.push(this.loadImageAsync(`#/images/${image.index}`, image).then(data => {
+            promises.push(this.loadImageAsync(`#/images/${image.index}`, image).then((data) => {
                 const name = image.uri || `${this._fileName}#image${image.index}`;
                 const dataUrl = `data:${this._uniqueRootUrl}${name}`;
                 babylonTexture.updateURL(dataUrl, new Blob([data], { type: image.mimeType }));
@@ -1684,7 +1684,7 @@ module BABYLON.GLTF2 {
                     wrapU: GLTFLoader._GetTextureWrapMode(`${context}/wrapS`, sampler.wrapS),
                     wrapV: GLTFLoader._GetTextureWrapMode(`${context}/wrapT`, sampler.wrapT)
                 };
-            };
+            }
 
             return sampler._data;
         }
@@ -1737,16 +1737,16 @@ module BABYLON.GLTF2 {
 
             this.log(`Loading ${uri}`);
 
-            return this._parent.preprocessUrlAsync(this._rootUrl + uri).then(url => {
+            return this._parent.preprocessUrlAsync(this._rootUrl + uri).then((url) => {
                 return new Promise<ArrayBufferView>((resolve, reject) => {
                     if (!this._disposed) {
-                        const request = Tools.LoadFile(url, fileData => {
+                        const request = Tools.LoadFile(url, (fileData) => {
                             if (!this._disposed) {
                                 const data = new Uint8Array(fileData as ArrayBuffer);
                                 this.log(`Loaded ${uri} (${data.length} bytes)`);
                                 resolve(data);
                             }
-                        }, event => {
+                        }, (event) => {
                             if (!this._disposed) {
                                 if (request) {
                                     request._lengthComputable = event.lengthComputable;
@@ -1987,51 +1987,51 @@ module BABYLON.GLTF2 {
         }
 
         private _extensionsOnLoading(): void {
-            this._forEachExtensions(extension => extension.onLoading && extension.onLoading());
+            this._forEachExtensions((extension) => extension.onLoading && extension.onLoading());
         }
 
         private _extensionsOnReady(): void {
-            this._forEachExtensions(extension => extension.onReady && extension.onReady());
+            this._forEachExtensions((extension) => extension.onReady && extension.onReady());
         }
 
         private _extensionsLoadSceneAsync(context: string, scene: Loader.IScene): Nullable<Promise<void>> {
-            return this._applyExtensions(scene, extension => extension.loadSceneAsync && extension.loadSceneAsync(context, scene));
+            return this._applyExtensions(scene, (extension) => extension.loadSceneAsync && extension.loadSceneAsync(context, scene));
         }
 
         private _extensionsLoadNodeAsync(context: string, node: Loader.INode, assign: (babylonMesh: Mesh) => void): Nullable<Promise<Mesh>> {
-            return this._applyExtensions(node, extension => extension.loadNodeAsync && extension.loadNodeAsync(context, node, assign));
+            return this._applyExtensions(node, (extension) => extension.loadNodeAsync && extension.loadNodeAsync(context, node, assign));
         }
 
         private _extensionsLoadCameraAsync(context: string, camera: Loader.ICamera, assign: (babylonCamera: Camera) => void): Nullable<Promise<Camera>> {
-            return this._applyExtensions(camera, extension => extension.loadCameraAsync && extension.loadCameraAsync(context, camera, assign));
+            return this._applyExtensions(camera, (extension) => extension.loadCameraAsync && extension.loadCameraAsync(context, camera, assign));
         }
 
         private _extensionsLoadVertexDataAsync(context: string, primitive: Loader.IMeshPrimitive, babylonMesh: Mesh): Nullable<Promise<Geometry>> {
-            return this._applyExtensions(primitive, extension => extension._loadVertexDataAsync && extension._loadVertexDataAsync(context, primitive, babylonMesh));
+            return this._applyExtensions(primitive, (extension) => extension._loadVertexDataAsync && extension._loadVertexDataAsync(context, primitive, babylonMesh));
         }
 
         private _extensionsLoadMaterialAsync(context: string, material: Loader.IMaterial, babylonMesh: Mesh, babylonDrawMode: number, assign: (babylonMaterial: Material) => void): Nullable<Promise<Material>> {
-            return this._applyExtensions(material, extension => extension._loadMaterialAsync && extension._loadMaterialAsync(context, material, babylonMesh, babylonDrawMode, assign));
+            return this._applyExtensions(material, (extension) => extension._loadMaterialAsync && extension._loadMaterialAsync(context, material, babylonMesh, babylonDrawMode, assign));
         }
 
         private _extensionsCreateMaterial(context: string, material: Loader.IMaterial, babylonDrawMode: number): Nullable<Material> {
-            return this._applyExtensions({}, extension => extension.createMaterial && extension.createMaterial(context, material, babylonDrawMode));
+            return this._applyExtensions({}, (extension) => extension.createMaterial && extension.createMaterial(context, material, babylonDrawMode));
         }
 
         private _extensionsLoadMaterialPropertiesAsync(context: string, material: Loader.IMaterial, babylonMaterial: Material): Nullable<Promise<void>> {
-            return this._applyExtensions(material, extension => extension.loadMaterialPropertiesAsync && extension.loadMaterialPropertiesAsync(context, material, babylonMaterial));
+            return this._applyExtensions(material, (extension) => extension.loadMaterialPropertiesAsync && extension.loadMaterialPropertiesAsync(context, material, babylonMaterial));
         }
 
         private _extensionsLoadTextureInfoAsync(context: string, textureInfo: Loader.ITextureInfo, assign: (babylonTexture: BaseTexture) => void): Nullable<Promise<BaseTexture>> {
-            return this._applyExtensions(textureInfo, extension => extension.loadTextureInfoAsync && extension.loadTextureInfoAsync(context, textureInfo, assign));
+            return this._applyExtensions(textureInfo, (extension) => extension.loadTextureInfoAsync && extension.loadTextureInfoAsync(context, textureInfo, assign));
         }
 
         private _extensionsLoadAnimationAsync(context: string, animation: Loader.IAnimation): Nullable<Promise<AnimationGroup>> {
-            return this._applyExtensions(animation, extension => extension.loadAnimationAsync && extension.loadAnimationAsync(context, animation));
+            return this._applyExtensions(animation, (extension) => extension.loadAnimationAsync && extension.loadAnimationAsync(context, animation));
         }
 
         private _extensionsLoadUriAsync(context: string, uri: string): Nullable<Promise<ArrayBufferView>> {
-            return this._applyExtensions({}, extension => extension._loadUriAsync && extension._loadUriAsync(context, uri));
+            return this._applyExtensions({}, (extension) => extension._loadUriAsync && extension._loadUriAsync(context, uri));
         }
 
         /**
@@ -2120,5 +2120,5 @@ module BABYLON.GLTF2 {
         }
     }
 
-    GLTFFileLoader._CreateGLTFLoaderV2 = parent => new GLTFLoader(parent);
+    GLTFFileLoader._CreateGLTFLoaderV2 = (parent) => new GLTFLoader(parent);
 }

+ 16 - 16
loaders/src/glTF/babylon.glTFFileLoader.ts

@@ -1,4 +1,4 @@
-/// <reference path="../../../dist/preview release/babylon.d.ts"/>
+/// <reference path="../../../dist/preview release/babylon.d.ts"/>
 /// <reference path="../../../dist/preview release/glTF2Interface/babylon.glTF2Interface.d.ts"/>
 
 module BABYLON {
@@ -174,7 +174,7 @@ module BABYLON {
         public compileShadowGenerators = false;
 
         /**
-         * Defines if the Alpha blended materials are only applied as coverage. 
+         * Defines if the Alpha blended materials are only applied as coverage.
          * If false, (default) The luminance of each pixel will reduce its opacity to simulate the behaviour of most physical materials.
          * If true, no extra effects are applied to transparent pixels.
          */
@@ -426,7 +426,7 @@ module BABYLON {
 
         /** @hidden */
         public _clear(): void {
-            this.preprocessUrlAsync = url => Promise.resolve(url);
+            this.preprocessUrlAsync = (url) => Promise.resolve(url);
 
             this.onMeshLoadedObservable.clear();
             this.onTextureLoadedObservable.clear();
@@ -447,7 +447,7 @@ module BABYLON {
          * @returns a promise containg the loaded meshes, particles, skeletons and animations
          */
         public importMeshAsync(meshesNames: any, scene: Scene, data: any, rootUrl: string, onProgress?: (event: SceneLoaderProgressEvent) => void, fileName?: string): Promise<{ meshes: AbstractMesh[], particleSystems: IParticleSystem[], skeletons: Skeleton[], animationGroups: AnimationGroup[] }> {
-            return this._parseAsync(scene, data, rootUrl, fileName).then(loaderData => {
+            return this._parseAsync(scene, data, rootUrl, fileName).then((loaderData) => {
                 this._log(`Loading ${fileName || ""}`);
                 this._loader = this._getLoader(loaderData);
                 return this._loader.importMeshAsync(meshesNames, scene, loaderData, rootUrl, onProgress, fileName);
@@ -464,7 +464,7 @@ module BABYLON {
          * @returns a promise which completes when objects have been loaded to the scene
          */
         public loadAsync(scene: Scene, data: string | ArrayBuffer, rootUrl: string, onProgress?: (event: SceneLoaderProgressEvent) => void, fileName?: string): Promise<void> {
-            return this._parseAsync(scene, data, rootUrl, fileName).then(loaderData => {
+            return this._parseAsync(scene, data, rootUrl, fileName).then((loaderData) => {
                 this._log(`Loading ${fileName || ""}`);
                 this._loader = this._getLoader(loaderData);
                 return this._loader.loadAsync(scene, loaderData, rootUrl, onProgress, fileName);
@@ -481,10 +481,10 @@ module BABYLON {
          * @returns The loaded asset container
          */
         public loadAssetContainerAsync(scene: Scene, data: string | ArrayBuffer, rootUrl: string, onProgress?: (event: SceneLoaderProgressEvent) => void, fileName?: string): Promise<AssetContainer> {
-            return this._parseAsync(scene, data, rootUrl, fileName).then(loaderData => {
+            return this._parseAsync(scene, data, rootUrl, fileName).then((loaderData) => {
                 this._log(`Loading ${fileName || ""}`);
                 this._loader = this._getLoader(loaderData);
-                return this._loader.importMeshAsync(null, scene, loaderData, rootUrl, onProgress, fileName).then(result => {
+                return this._loader.importMeshAsync(null, scene, loaderData, rootUrl, onProgress, fileName).then((result) => {
                     const container = new AssetContainer(scene);
                     Array.prototype.push.apply(container.meshes, result.meshes);
                     Array.prototype.push.apply(container.particleSystems, result.particleSystems);
@@ -534,7 +534,7 @@ module BABYLON {
                 this.onCompleteObservable.addOnce(() => {
                     resolve();
                 });
-                this.onErrorObservable.addOnce(reason => {
+                this.onErrorObservable.addOnce((reason) => {
                     reject(reason);
                 });
             });
@@ -571,10 +571,10 @@ module BABYLON {
             this._startPerformanceCounter("Validate JSON");
 
             const options: IGLTFValidationOptions = {
-                externalResourceFunction: uri => {
+                externalResourceFunction: (uri) => {
                     return this.preprocessUrlAsync(rootUrl + uri)
-                        .then(url => scene._loadFileAsync(url, true, true))
-                        .then(data => new Uint8Array(data as ArrayBuffer));
+                        .then((url) => scene._loadFileAsync(url, true, true))
+                        .then((data) => new Uint8Array(data as ArrayBuffer));
                 }
             };
 
@@ -582,7 +582,7 @@ module BABYLON {
                 options.uri = (rootUrl === "file:" ? fileName : `${rootUrl}${fileName}`);
             }
 
-            return GLTFValidator.validateString(json, options).then(result => {
+            return GLTFValidator.validateString(json, options).then((result) => {
                 this._endPerformanceCounter("Validate JSON");
 
                 this.onValidatedObservable.notifyObservers(result);
@@ -765,10 +765,10 @@ module BABYLON {
         }
 
         private static _compareVersion(a: { major: number, minor: number }, b: { major: number, minor: number }): number {
-            if (a.major > b.major) return 1;
-            if (a.major < b.major) return -1;
-            if (a.minor > b.minor) return 1;
-            if (a.minor < b.minor) return -1;
+            if (a.major > b.major) { return 1; }
+            if (a.major < b.major) { return -1; }
+            if (a.minor > b.minor) { return 1; }
+            if (a.minor < b.minor) { return -1; }
             return 0;
         }
 

+ 8 - 9
materialsLibrary/src/cell/babylon.cellMaterial.ts

@@ -1,4 +1,4 @@
-/// <reference path="../../../dist/preview release/babylon.d.ts"/>
+/// <reference path="../../../dist/preview release/babylon.d.ts"/>
 
 module BABYLON {
     class CellMaterialDefines extends MaterialDefines {
@@ -6,7 +6,7 @@ module BABYLON {
         public CLIPPLANE = false;
         public CLIPPLANE2 = false;
         public CLIPPLANE3 = false;
-        public CLIPPLANE4 = false;        
+        public CLIPPLANE4 = false;
         public ALPHATEST = false;
         public POINTSIZE = false;
         public FOG = false;
@@ -71,7 +71,7 @@ module BABYLON {
             return null;
         }
 
-        // Methods   
+        // Methods
         public isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean {
             if (this.isFrozen) {
                 if (this._wasPreviouslyReady && subMesh.effect) {
@@ -124,7 +124,7 @@ module BABYLON {
             // Attribs
             MaterialHelper.PrepareDefinesForAttributes(mesh, defines, true, true);
 
-            // Get correct effect      
+            // Get correct effect
             if (defines.isDirty) {
                 defines.markAsProcessed();
                 scene.resetCachedMaterial();
@@ -169,10 +169,10 @@ module BABYLON {
                     "vFogInfos", "vFogColor", "pointSize",
                     "vDiffuseInfos",
                     "mBones",
-                    "vClipPlane", "vClipPlane2", "vClipPlane3", "vClipPlane4","diffuseMatrix"
+                    "vClipPlane", "vClipPlane2", "vClipPlane3", "vClipPlane4", "diffuseMatrix"
                 ];
                 var samplers = ["diffuseSampler"];
-                var uniformBuffers = new Array<string>()
+                var uniformBuffers = new Array<string>();
 
                 MaterialHelper.PrepareUniformsAndSamplersList(<EffectCreationOptions>{
                     uniformsNames: uniforms,
@@ -219,7 +219,7 @@ module BABYLON {
             }
             this._activeEffect = effect;
 
-            // Matrices        
+            // Matrices
             this.bindOnlyWorldMatrix(world);
             this._activeEffect.setMatrix("viewProjection", scene.getTransformMatrix());
 
@@ -227,7 +227,7 @@ module BABYLON {
             MaterialHelper.BindBonesParameters(mesh, this._activeEffect);
 
             if (this._mustRebind(scene, effect)) {
-                // Textures        
+                // Textures
                 if (this._diffuseTexture && StandardMaterial.DiffuseTextureEnabled) {
                     this._activeEffect.setTexture("diffuseSampler", this._diffuseTexture);
 
@@ -320,4 +320,3 @@ module BABYLON {
         }
     }
 }
-

+ 16 - 17
materialsLibrary/src/custom/babylon.customMaterial.ts

@@ -1,7 +1,7 @@
 /// <reference path="../../../dist/preview release/babylon.d.ts"/>
 
 module BABYLON {
-    
+
     export class CustomShaderStructure {
 
         public FragmentStore: string;
@@ -39,7 +39,7 @@ module BABYLON {
 
     export class CustomMaterial extends StandardMaterial {
         public static ShaderIndexer = 1;
-        public CustomParts: ShaderSpecialParts; 
+        public CustomParts: ShaderSpecialParts;
         _isCreatedShader: boolean;
         _createdShaderName: string;
         _customUniform: string[];
@@ -94,7 +94,7 @@ module BABYLON {
             }
             return arr;
         }
-        
+
         public Builder(shaderName: string, uniforms: string[], uniformBuffers: string[], samplers: string[], defines: StandardMaterialDefines): string {
 
             if (this._isCreatedShader) {
@@ -141,9 +141,9 @@ module BABYLON {
 
             this._isCreatedShader = true;
             this._createdShaderName = name;
-            
+
             return name;
-        }        
+        }
 
         constructor(name: string, scene: Scene) {
             super(name, scene);
@@ -151,9 +151,9 @@ module BABYLON {
             this.customShaderNameResolve = this.Builder;
 
             this.FragmentShader = BABYLON.Effect.ShadersStore["defaultPixelShader"];
-            this.VertexShader = BABYLON.Effect.ShadersStore["defaultVertexShader"];             
+            this.VertexShader = BABYLON.Effect.ShadersStore["defaultVertexShader"];
         }
-        
+
         public AddUniform(name: string, kind: string, param: any): CustomMaterial {
             if (!this._customUniform) {
                 this._customUniform = new Array();
@@ -174,7 +174,7 @@ module BABYLON {
 
             return this;
         }
-        
+
         public Fragment_Begin(shaderPart: string): CustomMaterial {
             this.CustomParts.Fragment_Begin = shaderPart;
             return this;
@@ -189,37 +189,37 @@ module BABYLON {
             this.CustomParts.Fragment_MainBegin = shaderPart;
             return this;
         }
-        
+
         public Fragment_Custom_Diffuse(shaderPart: string): CustomMaterial {
             this.CustomParts.Fragment_Custom_Diffuse = shaderPart.replace("result", "diffuseColor");
             return this;
         }
-        
+
         public Fragment_Custom_Alpha(shaderPart: string): CustomMaterial {
             this.CustomParts.Fragment_Custom_Alpha = shaderPart.replace("result", "alpha");
             return this;
         }
-        
+
         public Fragment_Before_FragColor(shaderPart: string): CustomMaterial {
             this.CustomParts.Fragment_Before_FragColor = shaderPart.replace("result", "color");
             return this;
         }
-        
+
         public Vertex_Begin(shaderPart: string): CustomMaterial {
             this.CustomParts.Vertex_Begin = shaderPart;
             return this;
         }
-        
+
         public Vertex_Definitions(shaderPart: string): CustomMaterial {
             this.CustomParts.Vertex_Definitions = shaderPart;
             return this;
         }
-        
+
         public Vertex_MainBegin(shaderPart: string): CustomMaterial {
             this.CustomParts.Vertex_MainBegin = shaderPart;
             return this;
         }
-        
+
         public Vertex_Before_PositionUpdated(shaderPart: string): CustomMaterial {
             this.CustomParts.Vertex_Before_PositionUpdated = shaderPart.replace("result", "positionUpdated");
             return this;
@@ -228,7 +228,6 @@ module BABYLON {
         public Vertex_Before_NormalUpdated(shaderPart: string): CustomMaterial {
             this.CustomParts.Vertex_Before_NormalUpdated = shaderPart.replace("result", "normalUpdated");
             return this;
-        }            
+        }
     }
 }
-

+ 4 - 5
materialsLibrary/src/fire/babylon.fireMaterial.ts

@@ -7,7 +7,7 @@ module BABYLON {
         public CLIPPLANE = false;
         public CLIPPLANE2 = false;
         public CLIPPLANE3 = false;
-        public CLIPPLANE4 = false;        
+        public CLIPPLANE4 = false;
         public ALPHATEST = false;
         public DEPTHPREPASS = false;
         public POINTSIZE = false;
@@ -67,7 +67,7 @@ module BABYLON {
             return null;
         }
 
-        // Methods   
+        // Methods
         public isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean {
             if (this.isFrozen) {
                 if (this._wasPreviouslyReady && subMesh.effect) {
@@ -117,7 +117,7 @@ module BABYLON {
             // Attribs
             MaterialHelper.PrepareDefinesForAttributes(mesh, defines, false, true);
 
-            // Get correct effect      
+            // Get correct effect
             if (defines.isDirty) {
                 defines.markAsProcessed();
 
@@ -209,7 +209,7 @@ module BABYLON {
             MaterialHelper.BindBonesParameters(mesh, this._activeEffect);
 
             if (this._mustRebind(scene, effect)) {
-                // Textures        
+                // Textures
                 if (this._diffuseTexture && StandardMaterial.DiffuseTextureEnabled) {
                     this._activeEffect.setTexture("diffuseSampler", this._diffuseTexture);
 
@@ -380,4 +380,3 @@ module BABYLON {
         }
     }
 }
-

+ 8 - 10
materialsLibrary/src/fur/babylon.furMaterial.ts

@@ -1,4 +1,4 @@
-/// <reference path="../../../dist/preview release/babylon.d.ts"/>
+/// <reference path="../../../dist/preview release/babylon.d.ts"/>
 
 module BABYLON {
     class FurMaterialDefines extends MaterialDefines {
@@ -7,7 +7,7 @@ module BABYLON {
         public CLIPPLANE = false;
         public CLIPPLANE2 = false;
         public CLIPPLANE3 = false;
-        public CLIPPLANE4 = false;        
+        public CLIPPLANE4 = false;
         public ALPHATEST = false;
         public DEPTHPREPASS = false;
         public POINTSIZE = false;
@@ -72,7 +72,6 @@ module BABYLON {
 
         public furTexture: DynamicTexture;
 
-
         @serialize("disableLighting")
         private _disableLighting = false;
         @expandToProperty("_markAllSubMeshesAsLightsDirty")
@@ -135,7 +134,7 @@ module BABYLON {
             }
         }
 
-        // Methods   
+        // Methods
         public isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean {
             if (this.isFrozen) {
                 if (this._wasPreviouslyReady && subMesh.effect) {
@@ -186,7 +185,7 @@ module BABYLON {
                 defines.markAsUnprocessed();
             }
 
-            // Misc.   
+            // Misc.
             MaterialHelper.PrepareDefinesForMisc(mesh, scene, false, this.pointsCloud, this.fogEnabled, this._shouldTurnAlphaTestOn(mesh), defines);
 
             // Lights
@@ -198,7 +197,7 @@ module BABYLON {
             // Attribs
             MaterialHelper.PrepareDefinesForAttributes(mesh, defines, true, true);
 
-            // Get correct effect      
+            // Get correct effect
             if (defines.isDirty) {
                 defines.markAsProcessed();
 
@@ -252,7 +251,7 @@ module BABYLON {
                     "heightTexture", "furTexture"
                 ];
 
-                var uniformBuffers = new Array<string>()
+                var uniformBuffers = new Array<string>();
 
                 MaterialHelper.PrepareUniformsAndSamplersList(<EffectCreationOptions>{
                     uniformsNames: uniforms,
@@ -299,7 +298,7 @@ module BABYLON {
             }
             this._activeEffect = effect;
 
-            // Matrices        
+            // Matrices
             this.bindOnlyWorldMatrix(world);
             this._activeEffect.setMatrix("viewProjection", scene.getTransformMatrix());
 
@@ -307,7 +306,7 @@ module BABYLON {
             MaterialHelper.BindBonesParameters(mesh, this._activeEffect);
 
             if (scene.getCachedMaterial() !== this) {
-                // Textures        
+                // Textures
                 if (this._diffuseTexture && StandardMaterial.DiffuseTextureEnabled) {
                     this._activeEffect.setTexture("diffuseSampler", this._diffuseTexture);
 
@@ -531,4 +530,3 @@ module BABYLON {
         }
     }
 }
-

+ 6 - 8
materialsLibrary/src/gradient/babylon.gradientMaterial.ts

@@ -1,4 +1,4 @@
-/// <reference path="../../../dist/preview release/babylon.d.ts"/>
+/// <reference path="../../../dist/preview release/babylon.d.ts"/>
 
 module BABYLON {
     class GradientMaterialDefines extends MaterialDefines {
@@ -6,7 +6,7 @@ module BABYLON {
         public CLIPPLANE = false;
         public CLIPPLANE2 = false;
         public CLIPPLANE3 = false;
-        public CLIPPLANE4 = false;        
+        public CLIPPLANE4 = false;
         public ALPHATEST = false;
         public DEPTHPREPASS = false;
         public POINTSIZE = false;
@@ -93,7 +93,7 @@ module BABYLON {
         public offset = 0;
 
         @serialize()
-        public scale = 1.0;        
+        public scale = 1.0;
 
         @serialize()
         public smoothness = 1.0;
@@ -119,7 +119,7 @@ module BABYLON {
             return null;
         }
 
-        // Methods   
+        // Methods
         public isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean {
             if (this.isFrozen) {
                 if (this._wasPreviouslyReady && subMesh.effect) {
@@ -151,7 +151,7 @@ module BABYLON {
             // Attribs
             MaterialHelper.PrepareDefinesForAttributes(mesh, defines, false, true);
 
-            // Get correct effect      
+            // Get correct effect
             if (defines.isDirty) {
                 defines.markAsProcessed();
 
@@ -191,7 +191,6 @@ module BABYLON {
                 MaterialHelper.PrepareAttributesForBones(attribs, mesh, defines, fallbacks);
                 MaterialHelper.PrepareAttributesForInstances(attribs, defines);
 
-
                 // Legacy browser patch
                 var shaderName = "gradient";
                 var join = defines.toString();
@@ -252,7 +251,7 @@ module BABYLON {
 
             this._activeEffect = effect;
 
-            // Matrices        
+            // Matrices
             this.bindOnlyWorldMatrix(world);
             this._activeEffect.setMatrix("viewProjection", scene.getTransformMatrix());
 
@@ -323,4 +322,3 @@ module BABYLON {
         }
     }
 }
-

+ 4 - 4
materialsLibrary/src/grid/babylon.gridmaterial.ts

@@ -1,4 +1,4 @@
-/// <reference path="../../../dist/preview release/babylon.d.ts"/>
+/// <reference path="../../../dist/preview release/babylon.d.ts"/>
 
 module BABYLON {
     class GridMaterialDefines extends MaterialDefines {
@@ -64,7 +64,7 @@ module BABYLON {
          * Determine RBG output is premultiplied by alpha value.
          */
         @serialize()
-        public preMultiplyAlpha = false;        
+        public preMultiplyAlpha = false;
 
         private _gridControl: Vector4 = new Vector4(this.gridRatio, this.majorUnitFrequency, this.minorUnitVisibility, this.opacity);
 
@@ -90,7 +90,7 @@ module BABYLON {
             return this.needAlphaBlending();
         }
 
-        public isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean {   
+        public isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean {
             if (this.isFrozen) {
                 if (this._wasPreviouslyReady && subMesh.effect) {
                     return true;
@@ -122,7 +122,7 @@ module BABYLON {
 
             MaterialHelper.PrepareDefinesForMisc(mesh, scene, false, false, this.fogEnabled, false, defines);
 
-            // Get correct effect      
+            // Get correct effect
             if (defines.isDirty) {
                 defines.markAsProcessed();
                 scene.resetCachedMaterial();

+ 9 - 10
materialsLibrary/src/lava/babylon.lavaMaterial.ts

@@ -1,4 +1,4 @@
-/// <reference path="../../../dist/preview release/babylon.d.ts"/>
+/// <reference path="../../../dist/preview release/babylon.d.ts"/>
 
 module BABYLON {
     class LavaMaterialDefines extends MaterialDefines {
@@ -6,7 +6,7 @@ module BABYLON {
         public CLIPPLANE = false;
         public CLIPPLANE2 = false;
         public CLIPPLANE3 = false;
-        public CLIPPLANE4 = false;        
+        public CLIPPLANE4 = false;
         public ALPHATEST = false;
         public DEPTHPREPASS = false;
         public POINTSIZE = false;
@@ -131,7 +131,7 @@ module BABYLON {
             return null;
         }
 
-        // Methods   
+        // Methods
         public isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean {
             if (this.isFrozen) {
                 if (this._wasPreviouslyReady && subMesh.effect) {
@@ -174,7 +174,7 @@ module BABYLON {
 
             // Lights
             defines._needNormals = true;
-            
+
             MaterialHelper.PrepareDefinesForLights(scene, mesh, defines, false, this._maxSimultaneousLights, this._disableLighting);
 
             // Values that need to be evaluated on every frame
@@ -183,7 +183,7 @@ module BABYLON {
             // Attribs
             MaterialHelper.PrepareDefinesForAttributes(mesh, defines, true, true);
 
-            // Get correct effect      
+            // Get correct effect
             if (defines.isDirty) {
                 defines.markAsProcessed();
                 scene.resetCachedMaterial();
@@ -238,7 +238,7 @@ module BABYLON {
                 var samplers = ["diffuseSampler",
                     "noiseTexture"
                 ];
-                var uniformBuffers = new Array<string>()
+                var uniformBuffers = new Array<string>();
 
                 MaterialHelper.PrepareUniformsAndSamplersList(<EffectCreationOptions>{
                     uniformsNames: uniforms,
@@ -288,7 +288,7 @@ module BABYLON {
 
             defines.UNLIT = this._unlit;
 
-            // Matrices        
+            // Matrices
             this.bindOnlyWorldMatrix(world);
             this._activeEffect.setMatrix("viewProjection", scene.getTransformMatrix());
 
@@ -296,7 +296,7 @@ module BABYLON {
             MaterialHelper.BindBonesParameters(mesh, this._activeEffect);
 
             if (this._mustRebind(scene, effect)) {
-                // Textures        
+                // Textures
                 if (this.diffuseTexture && StandardMaterial.DiffuseTextureEnabled) {
                     this._activeEffect.setTexture("diffuseSampler", this.diffuseTexture);
 
@@ -333,7 +333,6 @@ module BABYLON {
             // Fog
             MaterialHelper.BindFogParameters(scene, mesh, this._activeEffect);
 
-
             this._lastTime += scene.getEngine().getDeltaTime();
             this._activeEffect.setFloat("time", this._lastTime * this.speed / 1000);
 
@@ -415,4 +414,4 @@ module BABYLON {
             return SerializationHelper.Parse(() => new LavaMaterial(source.name, scene), source, scene, rootUrl);
         }
     }
-} 
+}

+ 7 - 8
materialsLibrary/src/mix/babylon.mixMaterial.ts

@@ -1,4 +1,4 @@
-/// <reference path="../../../dist/preview release/babylon.d.ts"/>
+/// <reference path="../../../dist/preview release/babylon.d.ts"/>
 
 module BABYLON {
     class MixMaterialDefines extends MaterialDefines {
@@ -6,7 +6,7 @@ module BABYLON {
         public CLIPPLANE = false;
         public CLIPPLANE2 = false;
         public CLIPPLANE3 = false;
-        public CLIPPLANE4 = false;        
+        public CLIPPLANE4 = false;
         public ALPHATEST = false;
         public DEPTHPREPASS = false;
         public POINTSIZE = false;
@@ -128,7 +128,7 @@ module BABYLON {
             return null;
         }
 
-        // Methods   
+        // Methods
         public isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean {
             if (this.isFrozen) {
                 if (this._wasPreviouslyReady && subMesh.effect) {
@@ -184,7 +184,7 @@ module BABYLON {
             // Attribs
             MaterialHelper.PrepareDefinesForAttributes(mesh, defines, true, true);
 
-            // Get correct effect      
+            // Get correct effect
             if (defines.isDirty) {
                 defines.markAsProcessed();
                 scene.resetCachedMaterial();
@@ -241,7 +241,7 @@ module BABYLON {
                     "diffuse5Sampler", "diffuse6Sampler", "diffuse7Sampler", "diffuse8Sampler"
                 ];
 
-                var uniformBuffers = new Array<string>()
+                var uniformBuffers = new Array<string>();
 
                 MaterialHelper.PrepareUniformsAndSamplersList(<EffectCreationOptions>{
                     uniformsNames: uniforms,
@@ -288,7 +288,7 @@ module BABYLON {
             }
             this._activeEffect = effect;
 
-            // Matrices        
+            // Matrices
             this.bindOnlyWorldMatrix(world);
             this._activeEffect.setMatrix("viewProjection", scene.getTransformMatrix());
 
@@ -296,7 +296,7 @@ module BABYLON {
             MaterialHelper.BindBonesParameters(mesh, this._activeEffect);
 
             if (this._mustRebind(scene, effect)) {
-                // Textures        
+                // Textures
                 if (this._mixTexture1) {
                     this._activeEffect.setTexture("mixMap1Sampler", this._mixTexture1);
                     this._activeEffect.setFloat2("vTextureInfos", this._mixTexture1.coordinatesIndex, this._mixTexture1.level);
@@ -517,4 +517,3 @@ module BABYLON {
         }
     }
 }
-

+ 7 - 8
materialsLibrary/src/normal/babylon.normalMaterial.ts

@@ -1,4 +1,4 @@
-/// <reference path="../../../dist/preview release/babylon.d.ts"/>
+/// <reference path="../../../dist/preview release/babylon.d.ts"/>
 
 module BABYLON {
     class NormalMaterialDefines extends MaterialDefines {
@@ -6,7 +6,7 @@ module BABYLON {
         public CLIPPLANE = false;
         public CLIPPLANE2 = false;
         public CLIPPLANE3 = false;
-        public CLIPPLANE4 = false;        
+        public CLIPPLANE4 = false;
         public ALPHATEST = false;
         public DEPTHPREPASS = false;
         public POINTSIZE = false;
@@ -104,7 +104,7 @@ module BABYLON {
             return null;
         }
 
-        // Methods   
+        // Methods
         public isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean {
             if (this.isFrozen) {
                 if (this._wasPreviouslyReady && subMesh.effect) {
@@ -154,7 +154,7 @@ module BABYLON {
             // Attribs
             MaterialHelper.PrepareDefinesForAttributes(mesh, defines, true, true);
 
-            // Get correct effect      
+            // Get correct effect
             if (defines.isDirty) {
                 defines.markAsProcessed();
 
@@ -204,7 +204,7 @@ module BABYLON {
                     "vClipPlane", "vClipPlane2", "vClipPlane3", "vClipPlane4", "diffuseMatrix"
                 ];
                 var samplers = ["diffuseSampler"];
-                var uniformBuffers = new Array<string>()
+                var uniformBuffers = new Array<string>();
 
                 MaterialHelper.PrepareUniformsAndSamplersList(<EffectCreationOptions>{
                     uniformsNames: uniforms,
@@ -251,7 +251,7 @@ module BABYLON {
             }
             this._activeEffect = effect;
 
-            // Matrices        
+            // Matrices
             this.bindOnlyWorldMatrix(world);
             this._activeEffect.setMatrix("viewProjection", scene.getTransformMatrix());
 
@@ -259,7 +259,7 @@ module BABYLON {
             MaterialHelper.BindBonesParameters(mesh, this._activeEffect);
 
             if (this._mustRebind(scene, effect)) {
-                // Textures        
+                // Textures
                 if (this.diffuseTexture && StandardMaterial.DiffuseTextureEnabled) {
                     this._activeEffect.setTexture("diffuseSampler", this.diffuseTexture);
 
@@ -355,4 +355,3 @@ module BABYLON {
         }
     }
 }
-

+ 6 - 7
materialsLibrary/src/shadowOnly/babylon.shadowOnlyMaterial.ts

@@ -1,11 +1,11 @@
-/// <reference path="../../../dist/preview release/babylon.d.ts"/>
+/// <reference path="../../../dist/preview release/babylon.d.ts"/>
 
 module BABYLON {
     class ShadowOnlyMaterialDefines extends MaterialDefines {
         public CLIPPLANE = false;
         public CLIPPLANE2 = false;
         public CLIPPLANE3 = false;
-        public CLIPPLANE4 = false;        
+        public CLIPPLANE4 = false;
         public POINTSIZE = false;
         public FOG = false;
         public NORMAL = false;
@@ -49,7 +49,7 @@ module BABYLON {
             this._activeLight = light;
         }
 
-        // Methods   
+        // Methods
         public isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean {
             if (this.isFrozen) {
                 if (this._wasPreviouslyReady && subMesh.effect) {
@@ -100,7 +100,7 @@ module BABYLON {
             // Attribs
             MaterialHelper.PrepareDefinesForAttributes(mesh, defines, false, true);
 
-            // Get correct effect      
+            // Get correct effect
             if (defines.isDirty) {
                 defines.markAsProcessed();
 
@@ -137,7 +137,7 @@ module BABYLON {
                 ];
                 var samplers = new Array<string>();
 
-                var uniformBuffers = new Array<string>()
+                var uniformBuffers = new Array<string>();
 
                 MaterialHelper.PrepareUniformsAndSamplersList(<EffectCreationOptions>{
                     uniformsNames: uniforms,
@@ -184,7 +184,7 @@ module BABYLON {
             }
             this._activeEffect = effect;
 
-            // Matrices        
+            // Matrices
             this.bindOnlyWorldMatrix(world);
             this._activeEffect.setMatrix("viewProjection", scene.getTransformMatrix());
 
@@ -242,4 +242,3 @@ module BABYLON {
         }
     }
 }
-

+ 7 - 8
materialsLibrary/src/simple/babylon.simpleMaterial.ts

@@ -1,4 +1,4 @@
-/// <reference path="../../../dist/preview release/babylon.d.ts"/>
+/// <reference path="../../../dist/preview release/babylon.d.ts"/>
 
 module BABYLON {
     class SimpleMaterialDefines extends MaterialDefines {
@@ -6,7 +6,7 @@ module BABYLON {
         public CLIPPLANE = false;
         public CLIPPLANE2 = false;
         public CLIPPLANE3 = false;
-        public CLIPPLANE4 = false;        
+        public CLIPPLANE4 = false;
         public ALPHATEST = false;
         public DEPTHPREPASS = false;
         public POINTSIZE = false;
@@ -63,7 +63,7 @@ module BABYLON {
             return null;
         }
 
-        // Methods   
+        // Methods
         public isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean {
             if (this.isFrozen) {
                 if (this._wasPreviouslyReady && subMesh.effect) {
@@ -113,7 +113,7 @@ module BABYLON {
             // Attribs
             MaterialHelper.PrepareDefinesForAttributes(mesh, defines, true, true);
 
-            // Get correct effect      
+            // Get correct effect
             if (defines.isDirty) {
                 defines.markAsProcessed();
                 scene.resetCachedMaterial();
@@ -161,7 +161,7 @@ module BABYLON {
                     "vClipPlane", "vClipPlane2", "vClipPlane3", "vClipPlane4", "diffuseMatrix"
                 ];
                 var samplers = ["diffuseSampler"];
-                var uniformBuffers = new Array<string>()
+                var uniformBuffers = new Array<string>();
 
                 MaterialHelper.PrepareUniformsAndSamplersList(<EffectCreationOptions>{
                     uniformsNames: uniforms,
@@ -208,7 +208,7 @@ module BABYLON {
             }
             this._activeEffect = effect;
 
-            // Matrices        
+            // Matrices
             this.bindOnlyWorldMatrix(world);
             this._activeEffect.setMatrix("viewProjection", scene.getTransformMatrix());
 
@@ -216,7 +216,7 @@ module BABYLON {
             MaterialHelper.BindBonesParameters(mesh, this._activeEffect);
 
             if (this._mustRebind(scene, effect)) {
-                // Textures        
+                // Textures
                 if (this._diffuseTexture && StandardMaterial.DiffuseTextureEnabled) {
                     this._activeEffect.setTexture("diffuseSampler", this._diffuseTexture);
 
@@ -313,4 +313,3 @@ module BABYLON {
         }
     }
 }
-

+ 43 - 44
materialsLibrary/src/sky/babylon.skyMaterial.ts

@@ -5,7 +5,7 @@ module BABYLON {
         public CLIPPLANE = false;
         public CLIPPLANE2 = false;
         public CLIPPLANE3 = false;
-        public CLIPPLANE4 = false;        
+        public CLIPPLANE4 = false;
         public POINTSIZE = false;
         public FOG = false;
         public VERTEXCOLOR = false;
@@ -16,43 +16,43 @@ module BABYLON {
             this.rebuild();
         }
     }
-    
+
     export class SkyMaterial extends PushMaterial {
         // Public members
         @serialize()
         public luminance: number = 1.0;
-        
+
         @serialize()
-		public turbidity: number = 10.0;
-        
+        public turbidity: number = 10.0;
+
         @serialize()
-		public rayleigh: number = 2.0;
-		
+        public rayleigh: number = 2.0;
+
         @serialize()
         public mieCoefficient: number = 0.005;
-		
+
         @serialize()
         public mieDirectionalG: number = 0.8;
-        
+
         @serialize()
         public distance: number = 500;
-        
+
         @serialize()
         public inclination: number = 0.49;
-		
+
         @serialize()
         public azimuth: number = 0.25;
-        
+
         @serializeAsVector3()
         public sunPosition: Vector3 = new Vector3(0, 100, 0);
-        
+
         @serialize()
         public useSunPosition: boolean = false;
-        
+
         // Private members
         private _cameraPosition: Vector3 = Vector3.Zero();
-        
-        private _renderId: number;        
+
+        private _renderId: number;
 
         constructor(name: string, scene: Scene) {
             super(name, scene);
@@ -70,8 +70,8 @@ module BABYLON {
             return null;
         }
 
-        // Methods   
-        public isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean {   
+        // Methods
+        public isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean {
             if (this.isFrozen) {
                 if (this._wasPreviouslyReady && subMesh.effect) {
                     return true;
@@ -92,22 +92,22 @@ module BABYLON {
             }
 
             MaterialHelper.PrepareDefinesForMisc(mesh, scene, false, this.pointsCloud, this.fogEnabled, false, defines);
-            
+
             // Attribs
             MaterialHelper.PrepareDefinesForAttributes(mesh, defines, true, false);
 
-            // Get correct effect      
+            // Get correct effect
             if (defines.isDirty) {
                 defines.markAsProcessed();
-                
+
                 scene.resetCachedMaterial();
-                
+
                 // Fallbacks
-                var fallbacks = new EffectFallbacks();             
+                var fallbacks = new EffectFallbacks();
                 if (defines.FOG) {
                     fallbacks.addFallback(1, "FOG");
                 }
-                
+
                 //Attributes
                 var attribs = [VertexBuffer.PositionKind];
 
@@ -116,7 +116,7 @@ module BABYLON {
                 }
 
                 var shaderName = "sky";
-                
+
                 var join = defines.toString();
                 subMesh.setEffect(scene.getEngine().createEffect(shaderName,
                     attribs,
@@ -128,7 +128,7 @@ module BABYLON {
                     [],
                     join, fallbacks, this.onCompiled, this.onError), defines);
             }
-            
+
             if (!subMesh.effect || !subMesh.effect.isReady()) {
                 return false;
             }
@@ -153,7 +153,7 @@ module BABYLON {
             }
             this._activeEffect = effect;
 
-            // Matrices        
+            // Matrices
             this.bindOnlyWorldMatrix(world);
             this._activeEffect.setMatrix("viewProjection", scene.getTransformMatrix());
 
@@ -164,17 +164,17 @@ module BABYLON {
                 // Point size
                 if (this.pointsCloud) {
                     this._activeEffect.setFloat("pointSize", this.pointSize);
-                }               
+                }
             }
 
             // View
             if (scene.fogEnabled && mesh.applyFog && scene.fogMode !== Scene.FOGMODE_NONE) {
                 this._activeEffect.setMatrix("view", scene.getViewMatrix());
             }
-            
+
             // Fog
             MaterialHelper.BindFogParameters(scene, mesh, this._activeEffect);
-            
+
             // Sky
             var camera = scene.activeCamera;
             if (camera) {
@@ -184,26 +184,26 @@ module BABYLON {
                 this._cameraPosition.z = cameraWorldMatrix.m[14];
                 this._activeEffect.setVector3("cameraPosition", this._cameraPosition);
             }
-            
+
             if (this.luminance > 0) {
                 this._activeEffect.setFloat("luminance", this.luminance);
             }
-            
-			this._activeEffect.setFloat("turbidity", this.turbidity);
-			this._activeEffect.setFloat("rayleigh", this.rayleigh);
-			this._activeEffect.setFloat("mieCoefficient", this.mieCoefficient);
-			this._activeEffect.setFloat("mieDirectionalG", this.mieDirectionalG);
-            
+
+            this._activeEffect.setFloat("turbidity", this.turbidity);
+            this._activeEffect.setFloat("rayleigh", this.rayleigh);
+            this._activeEffect.setFloat("mieCoefficient", this.mieCoefficient);
+            this._activeEffect.setFloat("mieDirectionalG", this.mieDirectionalG);
+
             if (!this.useSunPosition) {
                 var theta = Math.PI * (this.inclination - 0.5);
                 var phi = 2 * Math.PI * (this.azimuth - 0.5);
-                
+
                 this.sunPosition.x = this.distance * Math.cos(phi);
                 this.sunPosition.y = this.distance * Math.sin(phi) * Math.sin(theta);
                 this.sunPosition.z = this.distance * Math.sin(phi) * Math.cos(theta);
             }
-            
-			this._activeEffect.setVector3("sunPosition", this.sunPosition);
+
+            this._activeEffect.setVector3("sunPosition", this.sunPosition);
 
             this._afterBind(mesh, this._activeEffect);
         }
@@ -219,7 +219,7 @@ module BABYLON {
         public clone(name: string): SkyMaterial {
             return SerializationHelper.Clone<SkyMaterial>(() => new SkyMaterial(name, this.getScene()), this);
         }
-        
+
         public serialize(): any {
             var serializationObject = SerializationHelper.Serialize(this);
             serializationObject.customType  = "BABYLON.SkyMaterial";
@@ -228,12 +228,11 @@ module BABYLON {
 
         public getClassName(): string {
             return "SkyMaterial";
-        }            
+        }
 
         // Statics
         public static Parse(source: any, scene: Scene, rootUrl: string): SkyMaterial {
             return SerializationHelper.Parse(() => new SkyMaterial(source.name, scene), source, scene, rootUrl);
         }
     }
-} 
-
+}

+ 7 - 8
materialsLibrary/src/terrain/babylon.terrainMaterial.ts

@@ -1,4 +1,4 @@
-/// <reference path="../../../dist/preview release/babylon.d.ts"/>
+/// <reference path="../../../dist/preview release/babylon.d.ts"/>
 
 module BABYLON {
 
@@ -8,7 +8,7 @@ module BABYLON {
         public CLIPPLANE = false;
         public CLIPPLANE2 = false;
         public CLIPPLANE3 = false;
-        public CLIPPLANE4 = false;        
+        public CLIPPLANE4 = false;
         public ALPHATEST = false;
         public DEPTHPREPASS = false;
         public POINTSIZE = false;
@@ -102,7 +102,7 @@ module BABYLON {
             return null;
         }
 
-        // Methods   
+        // Methods
         public isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean {
             if (this.isFrozen) {
                 if (this._wasPreviouslyReady && subMesh.effect) {
@@ -154,7 +154,7 @@ module BABYLON {
             // Attribs
             MaterialHelper.PrepareDefinesForAttributes(mesh, defines, true, true);
 
-            // Get correct effect      
+            // Get correct effect
             if (defines.isDirty) {
                 defines.markAsProcessed();
                 scene.resetCachedMaterial();
@@ -207,7 +207,7 @@ module BABYLON {
                     "bump1Sampler", "bump2Sampler", "bump3Sampler"
                 ];
 
-                var uniformBuffers = new Array<string>()
+                var uniformBuffers = new Array<string>();
 
                 MaterialHelper.PrepareUniformsAndSamplersList(<EffectCreationOptions>{
                     uniformsNames: uniforms,
@@ -254,7 +254,7 @@ module BABYLON {
             }
             this._activeEffect = effect;
 
-            // Matrices        
+            // Matrices
             this.bindOnlyWorldMatrix(world);
             this._activeEffect.setMatrix("viewProjection", scene.getTransformMatrix());
 
@@ -262,7 +262,7 @@ module BABYLON {
             MaterialHelper.BindBonesParameters(mesh, this._activeEffect);
 
             if (this._mustRebind(scene, effect)) {
-                // Textures        
+                // Textures
                 if (this.mixTexture) {
                     this._activeEffect.setTexture("textureSampler", this._mixTexture);
                     this._activeEffect.setFloat2("vTextureInfos", this._mixTexture.coordinatesIndex, this._mixTexture.level);
@@ -435,4 +435,3 @@ module BABYLON {
         }
     }
 }
-

+ 7 - 8
materialsLibrary/src/triPlanar/babylon.triPlanarMaterial.ts

@@ -1,4 +1,4 @@
-/// <reference path="../../../dist/preview release/babylon.d.ts"/>
+/// <reference path="../../../dist/preview release/babylon.d.ts"/>
 
 module BABYLON {
     class TriPlanarMaterialDefines extends MaterialDefines {
@@ -13,7 +13,7 @@ module BABYLON {
         public CLIPPLANE = false;
         public CLIPPLANE2 = false;
         public CLIPPLANE3 = false;
-        public CLIPPLANE4 = false;        
+        public CLIPPLANE4 = false;
         public ALPHATEST = false;
         public DEPTHPREPASS = false;
         public POINTSIZE = false;
@@ -106,7 +106,7 @@ module BABYLON {
             return null;
         }
 
-        // Methods   
+        // Methods
         public isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean {
             if (this.isFrozen) {
                 if (this._wasPreviouslyReady && subMesh.effect) {
@@ -175,7 +175,7 @@ module BABYLON {
             // Attribs
             MaterialHelper.PrepareDefinesForAttributes(mesh, defines, true, true);
 
-            // Get correct effect      
+            // Get correct effect
             if (defines.isDirty) {
                 defines.markAsProcessed();
                 scene.resetCachedMaterial();
@@ -219,7 +219,7 @@ module BABYLON {
                     "normalSamplerX", "normalSamplerY", "normalSamplerZ"
                 ];
 
-                var uniformBuffers = new Array<string>()
+                var uniformBuffers = new Array<string>();
 
                 MaterialHelper.PrepareUniformsAndSamplersList(<EffectCreationOptions>{
                     uniformsNames: uniforms,
@@ -266,7 +266,7 @@ module BABYLON {
             }
             this._activeEffect = effect;
 
-            // Matrices        
+            // Matrices
             this.bindOnlyWorldMatrix(world);
             this._activeEffect.setMatrix("viewProjection", scene.getTransformMatrix());
 
@@ -276,7 +276,7 @@ module BABYLON {
             this._activeEffect.setFloat("tileSize", this.tileSize);
 
             if (scene.getCachedMaterial() !== this) {
-                // Textures        
+                // Textures
                 if (this.diffuseTextureX) {
                     this._activeEffect.setTexture("diffuseSamplerX", this.diffuseTextureX);
                 }
@@ -426,4 +426,3 @@ module BABYLON {
         }
     }
 }
-

+ 10 - 10
materialsLibrary/src/water/babylon.waterMaterial.ts

@@ -33,7 +33,7 @@ module BABYLON {
     }
 
     export class WaterMaterial extends PushMaterial {
-		/*
+        /*
 		* Public members
 		*/
         @serializeAsTexture("bumpTexture")
@@ -138,7 +138,7 @@ module BABYLON {
 
         protected _renderTargets = new SmartArray<RenderTargetTexture>(16);
 
-		/*
+        /*
 		* Private members
 		*/
         private _mesh: Nullable<AbstractMesh> = null;
@@ -161,7 +161,7 @@ module BABYLON {
          */
         public get hasRenderTargetTextures(): boolean {
             return true;
-          }        
+          }
 
         /**
 		* Constructor
@@ -178,7 +178,7 @@ module BABYLON {
                 this._renderTargets.push(<RenderTargetTexture>this._refractionRTT);
 
                 return this._renderTargets;
-            }
+            };
         }
 
         @serialize()
@@ -319,7 +319,7 @@ module BABYLON {
                 this._waitingRenderList = null;
             }
 
-            // Get correct effect      
+            // Get correct effect
             if (defines.isDirty) {
                 defines.markAsProcessed();
                 scene.resetCachedMaterial();
@@ -375,12 +375,12 @@ module BABYLON {
                     // Water
                     "worldReflectionViewProjection", "windDirection", "waveLength", "time", "windForce",
                     "cameraPosition", "bumpHeight", "waveHeight", "waterColor", "waterColor2", "colorBlendFactor", "colorBlendFactor2", "waveSpeed"
-                ]
+                ];
                 var samplers = ["normalSampler",
                     // Water
                     "refractionSampler", "reflectionSampler"
                 ];
-                var uniformBuffers = new Array<string>()
+                var uniformBuffers = new Array<string>();
 
                 MaterialHelper.PrepareUniformsAndSamplersList(<EffectCreationOptions>{
                     uniformsNames: uniforms,
@@ -427,7 +427,7 @@ module BABYLON {
             }
             this._activeEffect = effect;
 
-            // Matrices        
+            // Matrices
             this.bindOnlyWorldMatrix(world);
             this._activeEffect.setMatrix("viewProjection", scene.getTransformMatrix());
 
@@ -435,7 +435,7 @@ module BABYLON {
             MaterialHelper.BindBonesParameters(mesh, this._activeEffect);
 
             if (this._mustRebind(scene, effect)) {
-                // Textures        
+                // Textures
                 if (this.bumpTexture && StandardMaterial.BumpTextureEnabled) {
                     this._activeEffect.setTexture("normalSampler", this.bumpTexture);
 
@@ -539,7 +539,7 @@ module BABYLON {
                     this._mesh.isVisible = isVisible;
                 }
 
-                // Clip plane 
+                // Clip plane
                 scene.clipPlane = clipPlane;
             };
 

+ 33 - 33
postProcessLibrary/src/asciiArt/babylon.asciiArtPostProcess.ts

@@ -1,15 +1,15 @@
-/// <reference path="../../../dist/preview release/babylon.d.ts"/>
+/// <reference path="../../../dist/preview release/babylon.d.ts"/>
 
 module BABYLON {
 
     /**
      * AsciiArtFontTexture is the helper class used to easily create your ascii art font texture.
-     * 
+     *
      * It basically takes care rendering the font front the given font size to a texture.
      * This is used later on in the postprocess.
      */
     export class AsciiArtFontTexture extends BaseTexture {
-        
+
         @serialize("font")
         private _font: string;
 
@@ -19,7 +19,7 @@ module BABYLON {
         private _charSize: number;
 
         /**
-         * Gets the size of one char in the texture (each char fits in size * size space in the texture). 
+         * Gets the size of one char in the texture (each char fits in size * size space in the texture).
          */
         public get charSize(): number {
             return this._charSize;
@@ -51,7 +51,7 @@ module BABYLON {
 
             // Get the font specific info.
             var maxCharHeight = this.getFontHeight(font);
-            var maxCharWidth = this.getFontWidth(font); 
+            var maxCharWidth = this.getFontWidth(font);
 
             this._charSize = Math.max(maxCharHeight.height, maxCharWidth);
 
@@ -77,10 +77,10 @@ module BABYLON {
             // Sets the text in the texture.
             for (var i = 0; i < text.length; i++) {
                 context.fillText(text[i], i * this._charSize, -maxCharHeight.offset);
-            }        
+            }
 
             // Flush the text in the dynamic texture.
-          
+
             scene.getEngine().updateDynamicTexture(this._texture, canvas, false, true);
         }
 
@@ -134,7 +134,7 @@ module BABYLON {
                     }
                 }
             }
-            return { height: (end - start)+1, offset: start-1}
+            return { height: (end - start) + 1, offset: start - 1};
         }
 
         /**
@@ -152,7 +152,7 @@ module BABYLON {
          * @return the parsed texture
          */
         public static Parse(source: any, scene: Scene): AsciiArtFontTexture {
-            var texture = SerializationHelper.Parse(() => new AsciiArtFontTexture(source.name, source.font, source.text, scene), 
+            var texture = SerializationHelper.Parse(() => new AsciiArtFontTexture(source.name, source.font, source.text, scene),
                 source, scene, null);
 
             return texture;
@@ -178,18 +178,18 @@ module BABYLON {
          * This defines the amount you want to mix the "tile" or caracter space colored in the ascii art.
          * This number is defined between 0 and 1;
          */
-        mixToTile?:number;
+        mixToTile?: number;
 
         /**
          * This defines the amount you want to mix the normal rendering pass in the ascii art.
          * This number is defined between 0 and 1;
          */
-        mixToNormal?:number;
+        mixToNormal?: number;
     }
 
     /**
      * AsciiArtPostProcess helps rendering everithing in Ascii Art.
-     * 
+     *
      * Simmply add it to your scene and let the nerd that lives in you have fun.
      * Example usage: var pp = new AsciiArtPostProcess("myAscii", "20px Monospace", camera);
      */
@@ -204,13 +204,13 @@ module BABYLON {
          * This defines the amount you want to mix the "tile" or caracter space colored in the ascii art.
          * This number is defined between 0 and 1;
          */
-        public mixToTile:number = 0;
+        public mixToTile: number = 0;
 
         /**
          * This defines the amount you want to mix the normal rendering pass in the ascii art.
          * This number is defined between 0 and 1;
          */
-        public mixToNormal:number = 0;
+        public mixToNormal: number = 0;
 
         /**
          * Instantiates a new Ascii Art Post Process.
@@ -219,17 +219,17 @@ module BABYLON {
          * @param options can either be the font name or an option object following the IAsciiArtPostProcessOptions format
          */
         constructor(name: string, camera: Camera, options?: string | IAsciiArtPostProcessOptions) {
-            super(name, 
-                'asciiart', 
-                ['asciiArtFontInfos', 'asciiArtOptions'], 
+            super(name,
+                'asciiart',
+                ['asciiArtFontInfos', 'asciiArtOptions'],
                 ['asciiArtFont'],
-                { 
-                    width: camera.getEngine().getRenderWidth(), 
+                {
+                    width: camera.getEngine().getRenderWidth(),
                     height: camera.getEngine().getRenderHeight()
-                }, 
-                camera, 
-                Texture.TRILINEAR_SAMPLINGMODE, 
-                camera.getEngine(), 
+                },
+                camera,
+                Texture.TRILINEAR_SAMPLINGMODE,
+                camera.getEngine(),
                 true);
 
             // Default values.
@@ -240,13 +240,13 @@ module BABYLON {
             if (options) {
                 if (typeof(options) === "string") {
                     font = <string>options;
-                }   
+                }
                 else {
                     font = (<IAsciiArtPostProcessOptions>options).font || font;
                     characterSet = (<IAsciiArtPostProcessOptions>options).characterSet || characterSet;
                     this.mixToTile = (<IAsciiArtPostProcessOptions>options).mixToTile || this.mixToTile;
                     this.mixToNormal = (<IAsciiArtPostProcessOptions>options).mixToNormal || this.mixToNormal;
-                } 
+                }
             }
 
             this._asciiArtFontTexture = new AsciiArtFontTexture(name, font, characterSet, camera.getScene());
@@ -254,19 +254,19 @@ module BABYLON {
 
             this.onApply = (effect: Effect) => {
                 effect.setTexture("asciiArtFont", this._asciiArtFontTexture);
-				
-                effect.setFloat4("asciiArtFontInfos", 
-                    this._asciiArtFontTexture.charSize, 
-                    characterSet.length, 
-                    textureSize.width, 
+
+                effect.setFloat4("asciiArtFontInfos",
+                    this._asciiArtFontTexture.charSize,
+                    characterSet.length,
+                    textureSize.width,
                     textureSize.height);
 
                 effect.setFloat4("asciiArtOptions",
-                    this.width, 
+                    this.width,
                     this.height,
-                    this.mixToNormal, 
+                    this.mixToNormal,
                     this.mixToTile);
             };
         }
     }
-} 
+}

+ 36 - 36
postProcessLibrary/src/digitalRain/babylon.digitalRainPostProcess.ts

@@ -1,15 +1,15 @@
-/// <reference path="../../../dist/preview release/babylon.d.ts"/>
+/// <reference path="../../../dist/preview release/babylon.d.ts"/>
 
 module BABYLON {
 
     /**
      * DigitalRainFontTexture is the helper class used to easily create your digital rain font texture.
-     * 
+     *
      * It basically takes care rendering the font front the given font size to a texture.
      * This is used later on in the postprocess.
      */
     export class DigitalRainFontTexture extends BaseTexture {
-        
+
         @serialize("font")
         private _font: string;
 
@@ -19,7 +19,7 @@ module BABYLON {
         private _charSize: number;
 
         /**
-         * Gets the size of one char in the texture (each char fits in size * size space in the texture). 
+         * Gets the size of one char in the texture (each char fits in size * size space in the texture).
          */
         public get charSize(): number {
             return this._charSize;
@@ -36,10 +36,10 @@ module BABYLON {
             super(scene);
 
             scene = this.getScene();
-            
+
             if (!scene) {
                 return;
-            }                        
+            }
 
             this.name = name;
             this._text == text;
@@ -51,7 +51,7 @@ module BABYLON {
 
             // Get the font specific info.
             var maxCharHeight = this.getFontHeight(font);
-            var maxCharWidth = this.getFontWidth(font); 
+            var maxCharWidth = this.getFontWidth(font);
 
             this._charSize = Math.max(maxCharHeight.height, maxCharWidth);
 
@@ -77,7 +77,7 @@ module BABYLON {
             // Sets the text in the texture.
             for (var i = 0; i < text.length; i++) {
                 context.fillText(text[i], 0, i * this._charSize - maxCharHeight.offset);
-            }        
+            }
 
             // Flush the text in the dynamic texture.
             scene.getEngine().updateDynamicTexture(this._texture, canvas, false, true);
@@ -133,7 +133,7 @@ module BABYLON {
                     }
                 }
             }
-            return { height: (end - start)+1, offset: start-1}
+            return { height: (end - start) + 1, offset: start - 1};
         }
 
         /**
@@ -151,7 +151,7 @@ module BABYLON {
          * @return the parsed texture
          */
         public static Parse(source: any, scene: Scene): DigitalRainFontTexture {
-            var texture = SerializationHelper.Parse(() => new DigitalRainFontTexture(source.name, source.font, source.text, scene), 
+            var texture = SerializationHelper.Parse(() => new DigitalRainFontTexture(source.name, source.font, source.text, scene),
                 source, scene, null);
 
             return texture;
@@ -172,18 +172,18 @@ module BABYLON {
          * This defines the amount you want to mix the "tile" or caracter space colored in the digital rain.
          * This number is defined between 0 and 1;
          */
-        mixToTile?:number;
+        mixToTile?: number;
 
         /**
          * This defines the amount you want to mix the normal rendering pass in the digital rain.
          * This number is defined between 0 and 1;
          */
-        mixToNormal?:number;
+        mixToNormal?: number;
     }
 
     /**
      * DigitalRainPostProcess helps rendering everithing in digital rain.
-     * 
+     *
      * Simmply add it to your scene and let the nerd that lives in you have fun.
      * Example usage: var pp = new DigitalRainPostProcess("digitalRain", "20px Monospace", camera);
      */
@@ -198,13 +198,13 @@ module BABYLON {
          * This defines the amount you want to mix the "tile" or caracter space colored in the digital rain.
          * This number is defined between 0 and 1;
          */
-        public mixToTile:number = 0;
+        public mixToTile: number = 0;
 
         /**
          * This defines the amount you want to mix the normal rendering pass in the digital rain.
          * This number is defined between 0 and 1;
          */
-        public mixToNormal:number = 0;
+        public mixToNormal: number = 0;
 
         /**
          * Instantiates a new Digital Rain Post Process.
@@ -213,17 +213,17 @@ module BABYLON {
          * @param options can either be the font name or an option object following the IDigitalRainPostProcessOptions format
          */
         constructor(name: string, camera: Camera, options?: string | IDigitalRainPostProcessOptions) {
-            super(name, 
-                'digitalrain', 
-                ['digitalRainFontInfos', 'digitalRainOptions', 'cosTimeZeroOne', 'matrixSpeed'], 
+            super(name,
+                'digitalrain',
+                ['digitalRainFontInfos', 'digitalRainOptions', 'cosTimeZeroOne', 'matrixSpeed'],
                 ['digitalRainFont'],
-                { 
-                    width: camera.getEngine().getRenderWidth(), 
+                {
+                    width: camera.getEngine().getRenderWidth(),
                     height: camera.getEngine().getRenderHeight()
-                }, 
-                camera, 
-                Texture.TRILINEAR_SAMPLINGMODE, 
-                camera.getEngine(), 
+                },
+                camera,
+                Texture.TRILINEAR_SAMPLINGMODE,
+                camera.getEngine(),
                 true);
 
             // Default values.
@@ -234,12 +234,12 @@ module BABYLON {
             if (options) {
                 if (typeof(options) === "string") {
                     font = <string>options;
-                }   
+                }
                 else {
                     font = (<IDigitalRainPostProcessOptions>options).font || font;
                     this.mixToTile = (<IDigitalRainPostProcessOptions>options).mixToTile || this.mixToTile;
                     this.mixToNormal = (<IDigitalRainPostProcessOptions>options).mixToNormal || this.mixToNormal;
-                } 
+                }
             }
 
             this._digitalRainFontTexture = new DigitalRainFontTexture(name, font, characterSet, camera.getScene());
@@ -248,25 +248,25 @@ module BABYLON {
             var alpha = 0.0;
             var cosTimeZeroOne = 0.0;
             var matrix = new Matrix();
-            for (let i = 0; i < 16; i++) {    
+            for (let i = 0; i < 16; i++) {
                 matrix.m[i] = Math.random();
             }
 
             this.onApply = (effect: Effect) => {
                 effect.setTexture("digitalRainFont", this._digitalRainFontTexture);
-				
-                effect.setFloat4("digitalRainFontInfos", 
-                    this._digitalRainFontTexture.charSize, 
-                    characterSet.length, 
-                    textureSize.width, 
+
+                effect.setFloat4("digitalRainFontInfos",
+                    this._digitalRainFontTexture.charSize,
+                    characterSet.length,
+                    textureSize.width,
                     textureSize.height);
 
                 effect.setFloat4("digitalRainOptions",
-                    this.width, 
+                    this.width,
                     this.height,
-                    this.mixToNormal, 
+                    this.mixToNormal,
                     this.mixToTile);
-                
+
                 effect.setMatrix("matrixSpeed",
                     matrix);
 
@@ -276,4 +276,4 @@ module BABYLON {
             };
         }
     }
-} 
+}

+ 2 - 2
proceduralTexturesLibrary/src/brick/babylon.brickProceduralTexture.ts

@@ -1,7 +1,7 @@
  /// <reference path="../../../dist/preview release/babylon.d.ts"/>
 
 module BABYLON {
-	export class BrickProceduralTexture extends ProceduralTexture {
+    export class BrickProceduralTexture extends ProceduralTexture {
         private _numberOfBricksHeight: number = 15;
         private _numberOfBricksWidth: number = 5;
         private _jointColor = new Color3(0.72, 0.72, 0.72);
@@ -82,5 +82,5 @@ module BABYLON {
 
             return texture;
         }
-    }	
+    }
 }

+ 6 - 6
proceduralTexturesLibrary/src/cloud/babylon.cloudProceduralTexture.ts

@@ -4,32 +4,32 @@ module BABYLON {
     export class CloudProceduralTexture extends ProceduralTexture {
         private _skyColor = new Color4(0.15, 0.68, 1.0, 1.0);
         private _cloudColor = new Color4(1, 1, 1, 1.0);
-    
+
         constructor(name: string, size: number, scene: Scene, fallbackTexture?: Texture, generateMipMaps?: boolean) {
             super(name, size, "cloudProceduralTexture", scene, fallbackTexture, generateMipMaps);
             this.updateShaderUniforms();
         }
-    
+
         public updateShaderUniforms() {
             this.setColor4("skyColor", this._skyColor);
             this.setColor4("cloudColor", this._cloudColor);
         }
-    
+
         @serializeAsColor4()
         public get skyColor(): Color4 {
             return this._skyColor;
         }
-    
+
         public set skyColor(value: Color4) {
             this._skyColor = value;
             this.updateShaderUniforms();
         }
-    
+
         @serializeAsColor4()
         public get cloudColor(): Color4 {
             return this._cloudColor;
         }
-    
+
         public set cloudColor(value: Color4) {
             this._cloudColor = value;
             this.updateShaderUniforms();

+ 1 - 1
proceduralTexturesLibrary/src/fire/babylon.fireProceduralTexture.ts

@@ -87,7 +87,7 @@ module BABYLON {
         public set autoGenerateTime(value: boolean) {
             this._autoGenerateTime = value;
         }
-        
+
         public get fireColors(): Color3[] {
             return this._fireColors;
         }

+ 1 - 1
proceduralTexturesLibrary/src/marble/babylon.marbleProceduralTexture.ts

@@ -28,7 +28,7 @@ module BABYLON {
             this._numberOfTilesHeight = value;
             this.updateShaderUniforms();
         }
-        
+
         @serialize()
         public get amplitude(): number {
             return this._amplitude;

+ 22 - 22
proceduralTexturesLibrary/src/starfield/babylon.starfieldProceduralTexture.ts

@@ -20,17 +20,17 @@ module BABYLON {
         }
 
         public updateShaderUniforms() {
-            this.setFloat("time", this._time);      
-            this.setFloat("alpha", this._alpha);  
-            this.setFloat("beta", this._beta);  
-            this.setFloat("zoom", this._zoom); 
-            this.setFloat("formuparam", this._formuparam); 
-            this.setFloat("stepsize", this._stepsize); 
-            this.setFloat("tile", this._tile); 
-            this.setFloat("brightness", this._brightness); 
-            this.setFloat("darkmatter", this._darkmatter); 
-            this.setFloat("distfading", this._distfading); 
-            this.setFloat("saturation", this._saturation); 
+            this.setFloat("time", this._time);
+            this.setFloat("alpha", this._alpha);
+            this.setFloat("beta", this._beta);
+            this.setFloat("zoom", this._zoom);
+            this.setFloat("formuparam", this._formuparam);
+            this.setFloat("stepsize", this._stepsize);
+            this.setFloat("tile", this._tile);
+            this.setFloat("brightness", this._brightness);
+            this.setFloat("darkmatter", this._darkmatter);
+            this.setFloat("distfading", this._distfading);
+            this.setFloat("saturation", this._saturation);
         }
 
         @serialize()
@@ -41,8 +41,8 @@ module BABYLON {
         public set time(value: number) {
             this._time = value;
             this.updateShaderUniforms();
-        }      
-        
+        }
+
         @serialize()
         public get alpha(): number {
             return this._alpha;
@@ -51,7 +51,7 @@ module BABYLON {
         public set alpha(value: number) {
             this._alpha = value;
             this.updateShaderUniforms();
-        }    
+        }
 
         @serialize()
         public get beta(): number {
@@ -61,7 +61,7 @@ module BABYLON {
         public set beta(value: number) {
             this._beta = value;
             this.updateShaderUniforms();
-        } 
+        }
 
         @serialize()
         public get formuparam(): number {
@@ -72,7 +72,7 @@ module BABYLON {
             this._formuparam = value;
             this.updateShaderUniforms();
         }
-        
+
         @serialize()
         public get stepsize(): number {
             return this._stepsize;
@@ -82,7 +82,7 @@ module BABYLON {
             this._stepsize = value;
             this.updateShaderUniforms();
         }
-        
+
         @serialize()
         public get zoom(): number {
             return this._zoom;
@@ -92,7 +92,7 @@ module BABYLON {
             this._zoom = value;
             this.updateShaderUniforms();
         }
-        
+
         @serialize()
         public get tile(): number {
             return this._tile;
@@ -102,7 +102,7 @@ module BABYLON {
             this._tile = value;
             this.updateShaderUniforms();
         }
-        
+
         @serialize()
         public get brightness(): number {
             return this._brightness;
@@ -112,7 +112,7 @@ module BABYLON {
             this._brightness = value;
             this.updateShaderUniforms();
         }
-        
+
         @serialize()
         public get darkmatter(): number {
             return this._darkmatter;
@@ -122,7 +122,7 @@ module BABYLON {
             this._darkmatter = value;
             this.updateShaderUniforms();
         }
-        
+
         @serialize()
         public get distfading(): number {
             return this._distfading;
@@ -132,7 +132,7 @@ module BABYLON {
             this._distfading = value;
             this.updateShaderUniforms();
         }
-        
+
         @serialize()
         public get saturation(): number {
             return this._saturation;

+ 1 - 1
proceduralTexturesLibrary/src/wood/babylon.woodProceduralTexture.ts

@@ -1,7 +1,7 @@
 /// <reference path="../../../dist/preview release/babylon.d.ts"/>
 
 module BABYLON {
-	export class WoodProceduralTexture extends ProceduralTexture {
+    export class WoodProceduralTexture extends ProceduralTexture {
         private _ampScale: number = 100.0;
         private _woodColor: Color3 = new Color3(0.32, 0.17, 0.09);
 

+ 3 - 3
serializers/src/OBJ/babylon.objSerializer.ts

@@ -4,7 +4,7 @@ module BABYLON {
     export class OBJExport {
         //Exports the geometry of a Mesh array in .OBJ file format (text)
         public static OBJ(mesh: Mesh[], materials?: boolean, matlibname?: string, globalposition?: boolean): string {
-            const output:string[] = [];
+            const output: string[] = [];
             let v = 1;
             if (materials) {
                 if (!matlibname) {
@@ -70,12 +70,12 @@ module BABYLON {
 
                 for (i = 0; i < trunkFaces.length; i += 3) {
                     const indices = [String(trunkFaces[i + 2] + v), String(trunkFaces[i + 1] + v), String(trunkFaces[i] + v)];
-                    const blanks: string[] = ["","",""];
+                    const blanks: string[] = ["", "", ""];
 
                     const facePositions = indices;
                     const faceUVs = trunkUV != null ? indices : blanks;
                     const faceNormals = trunkNormals != null ? indices : blanks;
-                         
+
                     output.push(
                         "f " + facePositions[0] + "/" + faceUVs[0] + "/" + faceNormals[0] +
                         " " + facePositions[1] + "/" + faceUVs[1] + "/" + faceNormals[1] +

+ 10 - 10
serializers/src/glTF/2.0/Extensions/KHR_texture_transform.ts

@@ -69,7 +69,7 @@ module BABYLON.GLTF2.Exporter.Extensions {
                     reject(`${context}: "scene" is not defined for Babylon texture ${babylonTexture.name}!`);
                 }
                 else {
-                    this.textureTransformTextureAsync(babylonTexture, offset, rotation, scale, scene).then(texture => {
+                    this.textureTransformTextureAsync(babylonTexture, offset, rotation, scale, scene).then((texture) => {
                         resolve(texture as Texture);
                     });
                 }
@@ -78,11 +78,11 @@ module BABYLON.GLTF2.Exporter.Extensions {
 
         /**
          * Transform the babylon texture by the offset, rotation and scale parameters using a procedural texture
-         * @param babylonTexture 
-         * @param offset 
-         * @param rotation 
-         * @param scale 
-         * @param scene 
+         * @param babylonTexture
+         * @param offset
+         * @param rotation
+         * @param scale
+         * @param scene
          */
         public textureTransformTextureAsync(babylonTexture: Texture, offset: Vector2, rotation: number, scale: Vector2, scene: Scene): Promise<BaseTexture> {
             return new Promise((resolve, reject) => {
@@ -96,10 +96,10 @@ module BABYLON.GLTF2.Exporter.Extensions {
                 proceduralTexture.setMatrix("textureTransformMat", babylonTexture.getTextureMatrix());
 
                 // isReady trigger creation of effect if it doesnt exist yet
-                if(proceduralTexture.isReady()){
+                if (proceduralTexture.isReady()) {
                     proceduralTexture.render();
-                    resolve(proceduralTexture)
-                }else{
+                    resolve(proceduralTexture);
+                }else {
                     (proceduralTexture as any)._effect.onCompileObservable.add(() => {
                         proceduralTexture.render();
                         resolve(proceduralTexture);
@@ -109,5 +109,5 @@ module BABYLON.GLTF2.Exporter.Extensions {
         }
     }
 
-    _Exporter.RegisterExtension(NAME, exporter => new KHR_texture_transform(exporter));
+    _Exporter.RegisterExtension(NAME, (exporter) => new KHR_texture_transform(exporter));
 }

+ 51 - 51
serializers/src/glTF/2.0/babylon.glTFAnimation.ts

@@ -9,23 +9,23 @@ module BABYLON.GLTF2.Exporter {
         /**
          * Keyframe data.
          */
-        inputs: number[],
+        inputs: number[];
         /**
          * Value data.
          */
-        outputs: number[][],
+        outputs: number[][];
         /**
          * Animation interpolation data.
          */
-        samplerInterpolation: AnimationSamplerInterpolation,
+        samplerInterpolation: AnimationSamplerInterpolation;
         /**
          * Minimum keyframe value.
          */
-        inputsMin: number,
+        inputsMin: number;
         /**
          * Maximum keyframe value.
          */
-        inputsMax: number,
+        inputsMax: number;
     }
 
     /**
@@ -35,15 +35,15 @@ module BABYLON.GLTF2.Exporter {
         /**
          * The target channel for the animation
          */
-        animationChannelTargetPath: AnimationChannelTargetPath,
+        animationChannelTargetPath: AnimationChannelTargetPath;
         /**
          * The glTF accessor type for the data.
          */
-        dataAccessorType: AccessorType.VEC3 | AccessorType.VEC4,
+        dataAccessorType: AccessorType.VEC3 | AccessorType.VEC4;
         /**
          * Specifies if quaternions should be used.
          */
-        useQuaternion: boolean
+        useQuaternion: boolean;
     }
 
     /**
@@ -67,11 +67,11 @@ module BABYLON.GLTF2.Exporter {
     export class _GLTFAnimation {
         /**
          * @ignore
-         * 
+         *
          * Creates glTF channel animation from BabylonJS animation.
          * @param babylonTransformNode - BabylonJS mesh.
          * @param animation - animation.
-         * @param animationChannelTargetPath - The target animation channel. 
+         * @param animationChannelTargetPath - The target animation channel.
          * @param convertToRightHandedSystem - Specifies if the values should be converted to right-handed.
          * @param useQuaternion - Specifies if quaternions are used.
          * @returns nullable IAnimationData
@@ -110,7 +110,7 @@ module BABYLON.GLTF2.Exporter {
                     samplerInterpolation: interpolation,
                     inputsMin: shouldBakeAnimation ? minMaxKeyFrames.min : Tools.FloatRound(minMaxKeyFrames.min / animation.framePerSecond),
                     inputsMax: shouldBakeAnimation ? minMaxKeyFrames.max : Tools.FloatRound(minMaxKeyFrames.max / animation.framePerSecond)
-                }
+                };
 
                 return result;
             }
@@ -159,15 +159,15 @@ module BABYLON.GLTF2.Exporter {
         /**
          * @ignore
          * Create node animations from the transform node animations
-         * @param babylonTransformNode 
-         * @param runtimeGLTFAnimation 
-         * @param idleGLTFAnimations 
-         * @param nodeMap 
-         * @param nodes 
-         * @param binaryWriter 
-         * @param bufferViews 
-         * @param accessors 
-         * @param convertToRightHandedSystem 
+         * @param babylonTransformNode
+         * @param runtimeGLTFAnimation
+         * @param idleGLTFAnimations
+         * @param nodeMap
+         * @param nodes
+         * @param binaryWriter
+         * @param bufferViews
+         * @param accessors
+         * @param convertToRightHandedSystem
          */
         public static _CreateNodeAnimationFromTransformNodeAnimations(babylonTransformNode: TransformNode, runtimeGLTFAnimation: IAnimation, idleGLTFAnimations: IAnimation[], nodeMap: { [key: number]: number }, nodes: INode[], binaryWriter: _BinaryWriter, bufferViews: IBufferView[], accessors: IAccessor[], convertToRightHandedSystem: boolean, animationSampleRate: number) {
             let glTFAnimation: IAnimation;
@@ -179,7 +179,7 @@ module BABYLON.GLTF2.Exporter {
                             name: animation.name,
                             samplers: [],
                             channels: []
-                        }
+                        };
                         _GLTFAnimation.AddAnimation(`${animation.name}`,
                             animation.hasRunningRuntimeAnimations ? runtimeGLTFAnimation : glTFAnimation,
                             babylonTransformNode,
@@ -198,21 +198,21 @@ module BABYLON.GLTF2.Exporter {
                             idleGLTFAnimations.push(glTFAnimation);
                         }
                     }
-                };
+                }
             }
         }
 
         /**
          * @ignore
          * Create node animations from the animation groups
-         * @param babylonScene 
-         * @param glTFAnimations 
-         * @param nodeMap 
-         * @param nodes 
-         * @param binaryWriter 
-         * @param bufferViews 
-         * @param accessors 
-         * @param convertToRightHandedSystem 
+         * @param babylonScene
+         * @param glTFAnimations
+         * @param nodeMap
+         * @param nodes
+         * @param binaryWriter
+         * @param bufferViews
+         * @param accessors
+         * @param convertToRightHandedSystem
          */
         public static _CreateNodeAnimationFromAnimationGroups(babylonScene: Scene, glTFAnimations: IAnimation[], nodeMap: { [key: number]: number }, nodes: INode[], binaryWriter: _BinaryWriter, bufferViews: IBufferView[], accessors: IAccessor[], convertToRightHandedSystem: boolean, animationSampleRate: number) {
             let glTFAnimation: IAnimation;
@@ -224,7 +224,7 @@ module BABYLON.GLTF2.Exporter {
                         name: animationGroup.name,
                         channels: [],
                         samplers: []
-                    }
+                    };
                     for (let targetAnimation of animationGroup.targetedAnimations) {
                         let target = targetAnimation.target;
                         let animation = targetAnimation.animation;
@@ -248,11 +248,11 @@ module BABYLON.GLTF2.Exporter {
                                 );
                             }
                         }
-                    };
+                    }
                     if (glTFAnimation.channels.length && glTFAnimation.samplers.length) {
                         glTFAnimations.push(glTFAnimation);
                     }
-                };
+                }
             }
         }
 
@@ -274,7 +274,7 @@ module BABYLON.GLTF2.Exporter {
                 bufferView = _GLTFUtilities._CreateBufferView(0, binaryWriter.getByteOffset(), byteLength, undefined, `${name}  keyframe data view`);
                 bufferViews.push(bufferView);
 
-                animationData.inputs.forEach(function (input) {
+                animationData.inputs.forEach(function(input) {
                     binaryWriter.setFloat32(input);
                 });
 
@@ -290,8 +290,8 @@ module BABYLON.GLTF2.Exporter {
                 bufferView = _GLTFUtilities._CreateBufferView(0, binaryWriter.getByteOffset(), byteLength, undefined, `${name}  data view`);
                 bufferViews.push(bufferView);
 
-                animationData.outputs.forEach(function (output) {
-                    output.forEach(function (entry) {
+                animationData.outputs.forEach(function(output) {
+                    output.forEach(function(entry) {
                         binaryWriter.setFloat32(entry);
                     });
                 });
@@ -305,7 +305,7 @@ module BABYLON.GLTF2.Exporter {
                     interpolation: animationData.samplerInterpolation,
                     input: keyframeAccessorIndex,
                     output: dataAccessorIndex
-                }
+                };
                 glTFAnimation.samplers.push(animationSampler);
 
                 // create channel
@@ -315,7 +315,7 @@ module BABYLON.GLTF2.Exporter {
                         node: nodeIndex,
                         path: animationChannelTargetPath
                     }
-                }
+                };
                 glTFAnimation.channels.push(animationChannel);
             }
         }
@@ -485,7 +485,7 @@ module BABYLON.GLTF2.Exporter {
             for (let keyFrame of animation.getKeys()) {
                 inputs.push(keyFrame.frame / animation.framePerSecond); // keyframes in seconds.
                 _GLTFAnimation._AddKeyframeValue(keyFrame, animation, outputs, animationChannelTargetPath, babylonTransformNode, convertToRightHandedSystem, useQuaternion);
-            };
+            }
         }
 
         /**
@@ -500,7 +500,7 @@ module BABYLON.GLTF2.Exporter {
          * @param useQuaternion Specifies if quaternions are used in the animation
          */
         private static _CreateCubicSplineAnimation(babylonTransformNode: TransformNode, animation: Animation, animationChannelTargetPath: AnimationChannelTargetPath, frameDelta: number, inputs: number[], outputs: number[][], convertToRightHandedSystem: boolean, useQuaternion: boolean) {
-            animation.getKeys().forEach(function (keyFrame) {
+            animation.getKeys().forEach(function(keyFrame) {
                 inputs.push(keyFrame.frame / animation.framePerSecond); // keyframes in seconds.
                 _GLTFAnimation.AddSplineTangent(
                     babylonTransformNode,
@@ -565,13 +565,13 @@ module BABYLON.GLTF2.Exporter {
 
         /**
          * Adds a key frame value
-         * @param keyFrame 
-         * @param animation 
-         * @param outputs 
-         * @param animationChannelTargetPath 
-         * @param basePositionRotationOrScale 
-         * @param convertToRightHandedSystem 
-         * @param useQuaternion 
+         * @param keyFrame
+         * @param animation
+         * @param outputs
+         * @param animationChannelTargetPath
+         * @param basePositionRotationOrScale
+         * @param convertToRightHandedSystem
+         * @param useQuaternion
          */
         private static _AddKeyframeValue(keyFrame: IAnimationKey, animation: Animation, outputs: number[][], animationChannelTargetPath: AnimationChannelTargetPath, babylonTransformNode: TransformNode, convertToRightHandedSystem: boolean, useQuaternion: boolean) {
             let value: number[];
@@ -650,9 +650,9 @@ module BABYLON.GLTF2.Exporter {
 
         /**
          * Determine the interpolation based on the key frames
-         * @param keyFrames 
-         * @param animationChannelTargetPath 
-         * @param useQuaternion 
+         * @param keyFrames
+         * @param animationChannelTargetPath
+         * @param useQuaternion
          */
         private static _DeduceInterpolation(keyFrames: IAnimationKey[], animationChannelTargetPath: AnimationChannelTargetPath, useQuaternion: boolean): { interpolationType: AnimationSamplerInterpolation, shouldBakeAnimation: boolean } {
             let interpolationType: AnimationSamplerInterpolation | undefined;
@@ -770,7 +770,7 @@ module BABYLON.GLTF2.Exporter {
         private static calculateMinMaxKeyFrames(keyFrames: IAnimationKey[]): { min: number, max: number } {
             let min: number = Infinity;
             let max: number = -Infinity;
-            keyFrames.forEach(function (keyFrame) {
+            keyFrames.forEach(function(keyFrame) {
                 min = Math.min(min, keyFrame.frame);
                 max = Math.max(max, keyFrame.frame);
             });

+ 25 - 26
serializers/src/glTF/2.0/babylon.glTFExporter.ts

@@ -1,23 +1,23 @@
 /// <reference path="../../../../dist/preview release/glTF2Interface/babylon.glTF2Interface.d.ts"/>
 
 module BABYLON.GLTF2.Exporter {
-    /** 
+    /**
      * Utility interface for storing vertex attribute data
      * @hidden
      */
 
     interface _IVertexAttributeData {
-        /** 
+        /**
          * Specifies the Babylon Vertex Buffer Type (Position, Normal, Color, etc.)
         */
         kind: string;
 
-        /** 
+        /**
          * Specifies the glTF Accessor Type (VEC2, VEC3, etc.)
         */
         accessorType: AccessorType;
 
-        /** 
+        /**
          * Specifies the BufferView index for the vertex attribute data
         */
         bufferViewIndex?: number;
@@ -153,11 +153,11 @@ module BABYLON.GLTF2.Exporter {
         }
 
         public _extensionsPreExportTextureAsync(context: string, babylonTexture: Texture, mimeType: ImageMimeType): Nullable<Promise<BaseTexture>> {
-            return this._applyExtensions(babylonTexture, extension => extension.preExportTextureAsync && extension.preExportTextureAsync(context, babylonTexture, mimeType));
+            return this._applyExtensions(babylonTexture, (extension) => extension.preExportTextureAsync && extension.preExportTextureAsync(context, babylonTexture, mimeType));
         }
-        
+
         public _extensionsPostExportMeshPrimitiveAsync(context: string, meshPrimitive: IMeshPrimitive, babylonSubMesh: SubMesh, binaryWriter: _BinaryWriter): Nullable<Promise<IMeshPrimitive>> {
-            return this._applyExtensions(meshPrimitive, extension => extension.postExportMeshPrimitiveAsync && extension.postExportMeshPrimitiveAsync(context, meshPrimitive, babylonSubMesh, binaryWriter));
+            return this._applyExtensions(meshPrimitive, (extension) => extension.postExportMeshPrimitiveAsync && extension.postExportMeshPrimitiveAsync(context, meshPrimitive, babylonSubMesh, binaryWriter));
         }
 
         /**
@@ -282,7 +282,7 @@ module BABYLON.GLTF2.Exporter {
         }
 
         /**
-         * Reorders the vertex attribute data based on the primitive mode.  This is necessary when indices are not available and the winding order is 
+         * Reorders the vertex attribute data based on the primitive mode.  This is necessary when indices are not available and the winding order is
          * clock-wise during export to glTF
          * @param submesh BabylonJS submesh
          * @param primitiveMode Primitive mode of the mesh
@@ -312,7 +312,7 @@ module BABYLON.GLTF2.Exporter {
         }
 
         /**
-         * Reorders the vertex attributes in the correct triangle mode order .  This is necessary when indices are not available and the winding order is 
+         * Reorders the vertex attributes in the correct triangle mode order .  This is necessary when indices are not available and the winding order is
          * clock-wise during export to glTF
          * @param submesh BabylonJS submesh
          * @param primitiveMode Primitive mode of the mesh
@@ -392,7 +392,7 @@ module BABYLON.GLTF2.Exporter {
         }
 
         /**
-         * Reorders the vertex attributes in the correct triangle strip order.  This is necessary when indices are not available and the winding order is 
+         * Reorders the vertex attributes in the correct triangle strip order.  This is necessary when indices are not available and the winding order is
          * clock-wise during export to glTF
          * @param submesh BabylonJS submesh
          * @param primitiveMode Primitive mode of the mesh
@@ -451,7 +451,7 @@ module BABYLON.GLTF2.Exporter {
         }
 
         /**
-         * Reorders the vertex attributes in the correct triangle fan order.  This is necessary when indices are not available and the winding order is 
+         * Reorders the vertex attributes in the correct triangle fan order.  This is necessary when indices are not available and the winding order is
          * clock-wise during export to glTF
          * @param submesh BabylonJS submesh
          * @param primitiveMode Primitive mode of the mesh
@@ -728,7 +728,7 @@ module BABYLON.GLTF2.Exporter {
          * @returns GLTFData with glTF file data
          */
         public _generateGLTFAsync(glTFPrefix: string): Promise<GLTFData> {
-            return this._generateBinaryAsync().then(binaryBuffer => {
+            return this._generateBinaryAsync().then((binaryBuffer) => {
                 const jsonText = this.generateJSON(false, glTFPrefix, true);
                 const bin = new Blob([binaryBuffer], { type: 'application/octet-stream' });
 
@@ -780,11 +780,11 @@ module BABYLON.GLTF2.Exporter {
         /**
          * Generates a glb file from the json and binary data
          * Returns an object with the glb file name as the key and data as the value
-         * @param glTFPrefix 
+         * @param glTFPrefix
          * @returns object with glb filename as key and data as value
          */
         public _generateGLBAsync(glTFPrefix: string): Promise<GLTFData> {
-            return this._generateBinaryAsync().then(binaryBuffer => {
+            return this._generateBinaryAsync().then((binaryBuffer) => {
                 const jsonText = this.generateJSON(true);
                 const glbFileName = glTFPrefix + '.glb';
                 const headerLength = 12;
@@ -1102,11 +1102,11 @@ module BABYLON.GLTF2.Exporter {
                                 // get the color from the lines mesh and set it in the material
                                 const material: IMaterial = {
                                     name: bufferMesh.name + ' material'
-                                }
+                                };
                                 if (!bufferMesh.color.equals(Color3.White()) || bufferMesh.alpha < 1) {
                                     material.pbrMetallicRoughness = {
                                         baseColorFactor: bufferMesh.color.asArray().concat([bufferMesh.alpha])
-                                    }
+                                    };
                                 }
                                 this._materials.push(material);
                                 materialIndex = this._materials.length - 1;
@@ -1182,7 +1182,7 @@ module BABYLON.GLTF2.Exporter {
                                         if (vertexData) {
                                             let byteOffset = this._bufferViews[vertexAttributeBufferViews[attribute.kind]].byteOffset;
                                             if (!byteOffset) {
-                                                byteOffset = 0
+                                                byteOffset = 0;
                                             }
                                             this.reorderVertexAttributeDataBasedOnPrimitiveMode(submesh, primitiveMode, sideOrientation, attribute.kind, vertexData, byteOffset, binaryWriter);
                                         }
@@ -1235,7 +1235,6 @@ module BABYLON.GLTF2.Exporter {
                         throw new Error("undefined byte length!");
                     }
 
-
                     // Build Hierarchy with the node map.
                     for (let babylonTransformNode of nodes) {
                         glTFNodeIndex = this._nodeMap[babylonTransformNode.uniqueId];
@@ -1271,7 +1270,7 @@ module BABYLON.GLTF2.Exporter {
                                 }
                             }
                         }
-                    };
+                    }
                     if (scene.nodes.length) {
                         this._scenes.push(scene);
                     }
@@ -1318,7 +1317,7 @@ module BABYLON.GLTF2.Exporter {
                 else {
                     `Excluding mesh ${babylonTransformNode.name}`;
                 }
-            };
+            }
 
             return promiseChain.then(() => {
                 if (runtimeGLTFAnimation.channels.length && runtimeGLTFAnimation.samplers.length) {
@@ -1372,7 +1371,7 @@ module BABYLON.GLTF2.Exporter {
 
     /**
      * @hidden
-     * 
+     *
      * Stores glTF binary data.  If the array buffer byte length is exceeded, it doubles in size dynamically
      */
     export class _BinaryWriter {
@@ -1399,7 +1398,7 @@ module BABYLON.GLTF2.Exporter {
         }
         /**
          * Resize the array buffer to the specified byte length
-         * @param byteLength 
+         * @param byteLength
          */
         private resizeBuffer(byteLength: number): ArrayBuffer {
             let newBuffer = new ArrayBuffer(byteLength);
@@ -1432,7 +1431,7 @@ module BABYLON.GLTF2.Exporter {
         }
         /**
          * Stores an UInt8 in the array buffer
-         * @param entry 
+         * @param entry
          * @param byteOffset If defined, specifies where to set the value as an offset.
          */
         public setUInt8(entry: number, byteOffset?: number) {
@@ -1454,7 +1453,7 @@ module BABYLON.GLTF2.Exporter {
 
         /**
          * Gets an UInt32 in the array buffer
-         * @param entry 
+         * @param entry
          * @param byteOffset If defined, specifies where to set the value as an offset.
          */
         public getUInt32(byteOffset: number): number {
@@ -1514,7 +1513,7 @@ module BABYLON.GLTF2.Exporter {
         }
         /**
          * Stores a Float32 in the array buffer
-         * @param entry 
+         * @param entry
          */
         public setFloat32(entry: number, byteOffset?: number) {
             if (isNaN(entry)) {
@@ -1536,7 +1535,7 @@ module BABYLON.GLTF2.Exporter {
         }
         /**
          * Stores an UInt32 in the array buffer
-         * @param entry 
+         * @param entry
          * @param byteOffset If defined, specifies where to set the value as an offset.
          */
         public setUInt32(entry: number, byteOffset?: number) {

+ 45 - 47
serializers/src/glTF/2.0/babylon.glTFMaterialExporter.ts

@@ -1,47 +1,47 @@
 /// <reference path="../../../../dist/preview release/glTF2Interface/babylon.glTF2Interface.d.ts"/>
 
 module BABYLON.GLTF2.Exporter {
-    /** 
+    /**
      * Interface for storing specular glossiness factors
      * @hidden
      */
     interface _IPBRSpecularGlossiness {
-        /** 
+        /**
          * Represents the linear diffuse factors of the material
         */
         diffuseColor: BABYLON.Color3;
-        /** 
+        /**
          * Represents the linear specular factors of the material
         */
         specularColor: BABYLON.Color3;
-        /** 
+        /**
          * Represents the smoothness of the material
         */
         glossiness: number;
     }
 
-    /** 
+    /**
      * Interface for storing metallic roughness factors
      * @hidden
      */
     interface _IPBRMetallicRoughness {
-        /** 
+        /**
          * Represents the albedo color of the material
         */
         baseColor: BABYLON.Color3;
-        /** 
+        /**
          * Represents the metallness of the material
         */
         metallic: Nullable<number>;
-        /** 
+        /**
          * Represents the roughness of the material
         */
         roughness: Nullable<number>;
-        /** 
+        /**
          * The metallic roughness texture as a base64 string
         */
         metallicRoughnessTextureBase64?: Nullable<string>;
-        /** 
+        /**
          * The base color texture as a base64 string
         */
         baseColorTextureBase64?: Nullable<string>;
@@ -169,7 +169,7 @@ module BABYLON.GLTF2.Exporter {
 
         /**
          * Converts a Babylon StandardMaterial to a glTF Metallic Roughness Material
-         * @param babylonStandardMaterial 
+         * @param babylonStandardMaterial
          * @returns glTF Metallic Roughness Material representation
          */
         public _convertToGLTFPBRMetallicRoughness(babylonStandardMaterial: StandardMaterial): IMaterialPbrMetallicRoughness {
@@ -197,8 +197,8 @@ module BABYLON.GLTF2.Exporter {
             }
 
             /**
-             * Evaluates a specified specular power value to determine the appropriate roughness value, 
-             * based on a pre-defined cubic bezier curve with specular on the abscissa axis (x-axis) 
+             * Evaluates a specified specular power value to determine the appropriate roughness value,
+             * based on a pre-defined cubic bezier curve with specular on the abscissa axis (x-axis)
              * and roughness on the ordinant axis (y-axis)
              * @param specularPower specular power of standard material
              * @returns Number representing the roughness value
@@ -237,7 +237,7 @@ module BABYLON.GLTF2.Exporter {
          */
         public static _SolveMetallic(diffuse: number, specular: number, oneMinusSpecularStrength: number): number {
             if (specular < this._DielectricSpecular.r) {
-                this._DielectricSpecular
+                this._DielectricSpecular;
                 return 0;
             }
 
@@ -291,14 +291,14 @@ module BABYLON.GLTF2.Exporter {
             }
             if (hasTextureCoords) {
                 if (babylonStandardMaterial.diffuseTexture) {
-                    promises.push(this._exportTextureAsync(babylonStandardMaterial.diffuseTexture, mimeType).then(glTFTexture => {
+                    promises.push(this._exportTextureAsync(babylonStandardMaterial.diffuseTexture, mimeType).then((glTFTexture) => {
                         if (glTFTexture) {
                             glTFPbrMetallicRoughness.baseColorTexture = glTFTexture;
                         }
                     }));
                 }
                 if (babylonStandardMaterial.bumpTexture) {
-                    promises.push(this._exportTextureAsync(babylonStandardMaterial.bumpTexture, mimeType).then(glTFTexture => {
+                    promises.push(this._exportTextureAsync(babylonStandardMaterial.bumpTexture, mimeType).then((glTFTexture) => {
                         if (glTFTexture) {
                             glTFMaterial.normalTexture = glTFTexture;
                             if (babylonStandardMaterial.bumpTexture != null && babylonStandardMaterial.bumpTexture.level !== 1) {
@@ -310,14 +310,14 @@ module BABYLON.GLTF2.Exporter {
                 if (babylonStandardMaterial.emissiveTexture) {
                     glTFMaterial.emissiveFactor = [1.0, 1.0, 1.0];
 
-                    promises.push(this._exportTextureAsync(babylonStandardMaterial.emissiveTexture, mimeType).then(glTFEmissiveTexture => {
+                    promises.push(this._exportTextureAsync(babylonStandardMaterial.emissiveTexture, mimeType).then((glTFEmissiveTexture) => {
                         if (glTFEmissiveTexture) {
                             glTFMaterial.emissiveTexture = glTFEmissiveTexture;
                         }
                     }));
                 }
                 if (babylonStandardMaterial.ambientTexture) {
-                    promises.push(this._exportTextureAsync(babylonStandardMaterial.ambientTexture, mimeType).then(glTFTexture => {
+                    promises.push(this._exportTextureAsync(babylonStandardMaterial.ambientTexture, mimeType).then((glTFTexture) => {
                         if (glTFTexture) {
                             const occlusionTexture: IMaterialOcclusionTextureInfo = {
                                 index: glTFTexture.index
@@ -417,14 +417,14 @@ module BABYLON.GLTF2.Exporter {
             }
             if (hasTextureCoords) {
                 if (babylonPBRMetalRoughMaterial.baseTexture != null) {
-                    promises.push(this._exportTextureAsync(babylonPBRMetalRoughMaterial.baseTexture, mimeType).then(glTFTexture => {
+                    promises.push(this._exportTextureAsync(babylonPBRMetalRoughMaterial.baseTexture, mimeType).then((glTFTexture) => {
                         if (glTFTexture) {
                             glTFPbrMetallicRoughness.baseColorTexture = glTFTexture;
                         }
                     }));
                 }
                 if (babylonPBRMetalRoughMaterial.normalTexture) {
-                    promises.push(this._exportTextureAsync(babylonPBRMetalRoughMaterial.normalTexture, mimeType).then(glTFTexture => {
+                    promises.push(this._exportTextureAsync(babylonPBRMetalRoughMaterial.normalTexture, mimeType).then((glTFTexture) => {
                         if (glTFTexture) {
                             glTFMaterial.normalTexture = glTFTexture;
                             if (babylonPBRMetalRoughMaterial.normalTexture.level !== 1) {
@@ -435,7 +435,7 @@ module BABYLON.GLTF2.Exporter {
 
                 }
                 if (babylonPBRMetalRoughMaterial.occlusionTexture) {
-                    promises.push(this._exportTextureAsync(babylonPBRMetalRoughMaterial.occlusionTexture, mimeType).then(glTFTexture => {
+                    promises.push(this._exportTextureAsync(babylonPBRMetalRoughMaterial.occlusionTexture, mimeType).then((glTFTexture) => {
                         if (glTFTexture) {
                             glTFMaterial.occlusionTexture = glTFTexture;
                             if (babylonPBRMetalRoughMaterial.occlusionStrength != null) {
@@ -446,7 +446,7 @@ module BABYLON.GLTF2.Exporter {
 
                 }
                 if (babylonPBRMetalRoughMaterial.emissiveTexture) {
-                    promises.push(this._exportTextureAsync(babylonPBRMetalRoughMaterial.emissiveTexture, mimeType).then(glTFTexture => {
+                    promises.push(this._exportTextureAsync(babylonPBRMetalRoughMaterial.emissiveTexture, mimeType).then((glTFTexture) => {
                         if (glTFTexture) {
                             glTFMaterial.emissiveTexture = glTFTexture;
                         }
@@ -490,7 +490,7 @@ module BABYLON.GLTF2.Exporter {
                 postProcess.getEffect().executeWhenCompiled(() => {
                     postProcess.onApply = (effect) => {
                         effect._bindTexture("textureSampler", tempTexture);
-                    }
+                    };
 
                     // Set the size of the texture
                     engine.setSize(width, height);
@@ -505,9 +505,9 @@ module BABYLON.GLTF2.Exporter {
                         if (!canvas.toBlob) { // fallback for browsers without "canvas.toBlob"
                             const dataURL = canvas.toDataURL();
                             resolve(dataURL);
-                        } 
+                        }
                         else {
-                            BABYLON.Tools.ToBlob(canvas, blob => {
+                            BABYLON.Tools.ToBlob(canvas, (blob) => {
                                 if (blob) {
                                     let fileReader = new FileReader();
                                     fileReader.onload = (event: any) => {
@@ -588,7 +588,7 @@ module BABYLON.GLTF2.Exporter {
             return {
                 "texture1": resizedTexture1,
                 "texture2": resizedTexture2
-            }
+            };
         }
 
         /**
@@ -741,13 +741,13 @@ module BABYLON.GLTF2.Exporter {
                 }
 
                 if (writeOutMetallicRoughnessTexture) {
-                    let promise = this._createBase64FromCanvasAsync(metallicRoughnessBuffer, width, height, mimeType).then(metallicRoughnessBase64 => {
+                    let promise = this._createBase64FromCanvasAsync(metallicRoughnessBuffer, width, height, mimeType).then((metallicRoughnessBase64) => {
                         metallicRoughnessFactors.metallicRoughnessTextureBase64 = metallicRoughnessBase64;
                     });
                     promises.push(promise);
                 }
                 if (writeOutBaseColorTexture) {
-                    let promise = this._createBase64FromCanvasAsync(baseColorBuffer, width, height, mimeType).then(baseColorBase64 => {
+                    let promise = this._createBase64FromCanvasAsync(baseColorBuffer, width, height, mimeType).then((baseColorBase64) => {
                         metallicRoughnessFactors.baseColorTextureBase64 = baseColorBase64;
                     });
                     promises.push(promise);
@@ -781,7 +781,7 @@ module BABYLON.GLTF2.Exporter {
                 baseColor: baseColor,
                 metallic: metallic,
                 roughness: 1 - specularGlossiness.glossiness
-            }
+            };
 
             return metallicRoughness;
         }
@@ -800,7 +800,7 @@ module BABYLON.GLTF2.Exporter {
 
         /**
          * Returns the maximum color component value
-         * @param color 
+         * @param color
          * @returns maximum color component value, or zero if color is null or undefined
          */
         private _getMaxComponent(color: Color3): number {
@@ -831,14 +831,14 @@ module BABYLON.GLTF2.Exporter {
 
             if (hasTextureCoords) {
                 if (babylonPBRMaterial.albedoTexture) {
-                    promises.push(this._exportTextureAsync(babylonPBRMaterial.albedoTexture, mimeType).then(glTFTexture => {
+                    promises.push(this._exportTextureAsync(babylonPBRMaterial.albedoTexture, mimeType).then((glTFTexture) => {
                         if (glTFTexture) {
                             glTFPbrMetallicRoughness.baseColorTexture = glTFTexture;
                         }
                     }));
                 }
                 if (babylonPBRMaterial.metallicTexture) {
-                    promises.push(this._exportTextureAsync(babylonPBRMaterial.metallicTexture, mimeType).then(glTFTexture => {
+                    promises.push(this._exportTextureAsync(babylonPBRMaterial.metallicTexture, mimeType).then((glTFTexture) => {
                         if (glTFTexture) {
                             glTFPbrMetallicRoughness.metallicRoughnessTexture = glTFTexture;
                         }
@@ -980,7 +980,7 @@ module BABYLON.GLTF2.Exporter {
                     return Promise.reject("_ConvertPBRMaterial: Glossiness values not included in the reflectivity texture are currently not supported");
                 }
                 if ((babylonPBRMaterial.albedoTexture || babylonPBRMaterial.reflectivityTexture) && hasTextureCoords) {
-                    return this._convertSpecularGlossinessTexturesToMetallicRoughnessAsync(babylonPBRMaterial.albedoTexture, babylonPBRMaterial.reflectivityTexture, specGloss, mimeType).then(metallicRoughnessFactors => {
+                    return this._convertSpecularGlossinessTexturesToMetallicRoughnessAsync(babylonPBRMaterial.albedoTexture, babylonPBRMaterial.reflectivityTexture, specGloss, mimeType).then((metallicRoughnessFactors) => {
                         if (metallicRoughnessFactors.baseColorTextureBase64) {
                             const glTFBaseColorTexture = this._getTextureInfoFromBase64(metallicRoughnessFactors.baseColorTextureBase64, "bjsBaseColorTexture_" + (textures.length) + ".png", mimeType, babylonPBRMaterial.albedoTexture ? babylonPBRMaterial.albedoTexture.coordinatesIndex : null, samplerIndex);
                             if (glTFBaseColorTexture) {
@@ -1027,14 +1027,14 @@ module BABYLON.GLTF2.Exporter {
                         babylonPBRMaterial.albedoColor.g,
                         babylonPBRMaterial.albedoColor.b,
                         babylonPBRMaterial.alpha
-                    ]
+                    ];
                 }
-                return this._convertMetalRoughFactorsToMetallicRoughnessAsync(babylonPBRMaterial, mimeType, glTFPbrMetallicRoughness, hasTextureCoords).then(metallicRoughness => {
+                return this._convertMetalRoughFactorsToMetallicRoughnessAsync(babylonPBRMaterial, mimeType, glTFPbrMetallicRoughness, hasTextureCoords).then((metallicRoughness) => {
                     return this.setMetallicRoughnessPbrMaterial(metallicRoughness, babylonPBRMaterial, glTFMaterial, glTFPbrMetallicRoughness, mimeType, hasTextureCoords);
                 });
             }
             else {
-                return this._convertSpecGlossFactorsToMetallicRoughnessAsync(babylonPBRMaterial, mimeType, glTFPbrMetallicRoughness, hasTextureCoords).then(metallicRoughness => {
+                return this._convertSpecGlossFactorsToMetallicRoughnessAsync(babylonPBRMaterial, mimeType, glTFPbrMetallicRoughness, hasTextureCoords).then((metallicRoughness) => {
                     return this.setMetallicRoughnessPbrMaterial(metallicRoughness, babylonPBRMaterial, glTFMaterial, glTFPbrMetallicRoughness, mimeType, hasTextureCoords);
                 });
             }
@@ -1043,7 +1043,7 @@ module BABYLON.GLTF2.Exporter {
         private setMetallicRoughnessPbrMaterial(metallicRoughness: Nullable<_IPBRMetallicRoughness>, babylonPBRMaterial: PBRMaterial, glTFMaterial: IMaterial, glTFPbrMetallicRoughness: IMaterialPbrMetallicRoughness, mimeType: ImageMimeType, hasTextureCoords: boolean): Promise<void> {
             const materialMap = this._exporter._materialMap;
             const materials = this._exporter._materials;
-            let promises = [];  
+            let promises = [];
             if (metallicRoughness) {
                 let alphaMode: Nullable<MaterialAlphaMode> = null;
                 if (babylonPBRMaterial.transparencyMode != null) {
@@ -1082,7 +1082,7 @@ module BABYLON.GLTF2.Exporter {
 
                 if (hasTextureCoords) {
                     if (babylonPBRMaterial.bumpTexture) {
-                        let promise = this._exportTextureAsync(babylonPBRMaterial.bumpTexture, mimeType).then(glTFTexture => {
+                        let promise = this._exportTextureAsync(babylonPBRMaterial.bumpTexture, mimeType).then((glTFTexture) => {
                             if (glTFTexture) {
                                 glTFMaterial.normalTexture = glTFTexture;
                                 if (babylonPBRMaterial.bumpTexture.level !== 1) {
@@ -1093,10 +1093,9 @@ module BABYLON.GLTF2.Exporter {
                         );
                         promises.push(promise);
 
-
                     }
                     if (babylonPBRMaterial.ambientTexture) {
-                        let promise = this._exportTextureAsync(babylonPBRMaterial.ambientTexture, mimeType).then(glTFTexture => {
+                        let promise = this._exportTextureAsync(babylonPBRMaterial.ambientTexture, mimeType).then((glTFTexture) => {
                             if (glTFTexture) {
                                 let occlusionTexture: IMaterialOcclusionTextureInfo = {
                                     index: glTFTexture.index
@@ -1113,7 +1112,7 @@ module BABYLON.GLTF2.Exporter {
 
                     }
                     if (babylonPBRMaterial.emissiveTexture) {
-                        let promise = this._exportTextureAsync(babylonPBRMaterial.emissiveTexture, mimeType).then(glTFTexture => {
+                        let promise = this._exportTextureAsync(babylonPBRMaterial.emissiveTexture, mimeType).then((glTFTexture) => {
                             if (glTFTexture) {
                                 glTFMaterial.emissiveTexture = glTFTexture;
                             }
@@ -1129,7 +1128,7 @@ module BABYLON.GLTF2.Exporter {
                 materials.push(glTFMaterial);
                 materialMap[babylonPBRMaterial.uniqueId] = materials.length - 1;
             }
-            return Promise.all(promises).then(result => { /* do nothing */ });
+            return Promise.all(promises).then((result) => { /* do nothing */ });
         }
 
         private getPixelsFromTexture(babylonTexture: BaseTexture): Uint8Array | Float32Array {
@@ -1137,7 +1136,6 @@ module BABYLON.GLTF2.Exporter {
             return pixels;
         }
 
-
         /**
          * Extracts a texture from a Babylon texture into file data and glTF data
          * @param babylonTexture Babylon texture to extract
@@ -1150,7 +1148,7 @@ module BABYLON.GLTF2.Exporter {
                 return this._exportTextureInfoAsync(babylonTexture, mimeType);
             }
 
-            return extensionPromise.then(texture => {
+            return extensionPromise.then((texture) => {
                 if (!texture) {
                     return this._exportTextureInfoAsync(babylonTexture, mimeType);
                 }
@@ -1189,7 +1187,7 @@ module BABYLON.GLTF2.Exporter {
                     const pixels = this.getPixelsFromTexture(babylonTexture);
                     const size = babylonTexture.getSize();
 
-                    return this._createBase64FromCanvasAsync(pixels, size.width, size.height, mimeType).then(base64Data => {
+                    return this._createBase64FromCanvasAsync(pixels, size.width, size.height, mimeType).then((base64Data) => {
                         const textureInfo = this._getTextureInfoFromBase64(base64Data, babylonTexture.name.replace(/\.\/|\/|\.\\|\\/g, "_"), mimeType, babylonTexture.coordinatesIndex, samplerIndex);
                         if (textureInfo) {
                             this._textureMap[textureUid] = textureInfo;
@@ -1243,7 +1241,7 @@ module BABYLON.GLTF2.Exporter {
                 const glTFImage: IImage = {
                     name: baseTextureName,
                     uri: textureName
-                }
+                };
                 let foundIndex: Nullable<number> = null;
                 for (let i = 0; i < images.length; ++i) {
                     if (images[i].uri === textureName) {
@@ -1262,7 +1260,7 @@ module BABYLON.GLTF2.Exporter {
                 textures.push(glTFTexture);
                 textureInfo = {
                     index: textures.length - 1
-                }
+                };
                 if (texCoordIndex != null) {
                     textureInfo.texCoord = texCoordIndex;
                 }

+ 2 - 2
serializers/src/glTF/2.0/babylon.glTFSerializer.ts

@@ -20,7 +20,7 @@ module BABYLON {
          * Begin serialization without waiting for the scene to be ready
          */
         exportWithoutWaitingForScene?: boolean;
-    };
+    }
 
     /**
      * Class for generating glTF data from a Babylon scene.
@@ -75,7 +75,7 @@ module BABYLON {
             return this._PreExportAsync(scene, options).then(() => {
                 const glTFPrefix = filePrefix.replace(/\.[^/.]+$/, "");
                 const gltfGenerator = new GLTF2.Exporter._Exporter(scene, options);
-                return gltfGenerator._generateGLBAsync(glTFPrefix).then(glTFData => {
+                return gltfGenerator._generateGLBAsync(glTFPrefix).then((glTFData) => {
                     return this._PostExportAsync(scene, glTFData, options);
                 });
             });

+ 1 - 1
serializers/src/glTF/2.0/babylon.glTFUtilities.ts

@@ -39,7 +39,7 @@ module BABYLON.GLTF2.Exporter {
          * @param byteOffset The offset relative to the start of the bufferView in bytes
          * @param min Minimum value of each component in this attribute
          * @param max Maximum value of each component in this attribute
-         * @returns accessor for glTF 
+         * @returns accessor for glTF
          */
         public static _CreateAccessor(bufferviewIndex: number, name: string, type: AccessorType, componentType: AccessorComponentType, count: number, byteOffset: Nullable<number>, min: Nullable<number[]>, max: Nullable<number[]>): IAccessor {
             let accessor: IAccessor = { name: name, bufferView: bufferviewIndex, componentType: componentType, count: count, type: type };

+ 29 - 29
src/Actions/babylon.action.ts

@@ -1,4 +1,4 @@
-module BABYLON {
+module BABYLON {
     /**
      * The action to be carried out following a trigger
      * @see http://doc.babylonjs.com/how_to/how_to_use_actions#available-actions
@@ -11,7 +11,7 @@
 
         /**
          * Internal only - manager for action
-         * @hidden 
+         * @hidden
          */
         public _actionManager: ActionManager;
 
@@ -28,7 +28,7 @@
         /**
          * Creates a new Action
          * @param triggerOptions the trigger, with or without parameters, for the action
-         * @param condition an optional determinant of action 
+         * @param condition an optional determinant of action
          */
         constructor(
             /** the trigger, with or without parameters, for the action */
@@ -37,7 +37,7 @@
             if (triggerOptions.parameter) {
                 this.trigger = triggerOptions.trigger;
                 this._triggerParameter = triggerOptions.parameter;
-            } else if(triggerOptions.trigger) {
+            } else if (triggerOptions.trigger) {
                 this.trigger = triggerOptions.trigger;
             } else {
                 this.trigger = triggerOptions;
@@ -49,7 +49,7 @@
 
         /**
          * Internal only
-         * @hidden 
+         * @hidden
          */
         public _prepare(): void {
         }
@@ -64,7 +64,7 @@
 
         /**
          * Internal only - executes current action event
-         * @hidden 
+         * @hidden
          */
         public _executeCurrent(evt?: ActionEvent): void {
             if (this._nextActiveAction._condition) {
@@ -87,7 +87,7 @@
                     condition._currentResult = true;
                 }
             }
-            
+
             this.onBeforeExecuteObservable.notifyObservers(this);
             this._nextActiveAction.execute(evt);
 
@@ -135,7 +135,7 @@
 
         /**
          * Internal only
-         * @hidden 
+         * @hidden
          */
         public _getProperty(propertyPath: string): string {
             return this._actionManager._getProperty(propertyPath);
@@ -143,12 +143,12 @@
 
         /**
          * Internal only
-         * @hidden 
+         * @hidden
          */
         public _getEffectiveTarget(target: any, propertyPath: string): any {
             return this._actionManager._getEffectiveTarget(target, propertyPath);
         }
-        
+
         /**
          * Serialize placeholder for child classes
          * @param parent of child
@@ -156,74 +156,74 @@
          */
         public serialize(parent: any): any {
         }
-        
+
         /**
          * Internal only called by serialize
-         * @hidden 
+         * @hidden
          */
         protected _serialize(serializedAction: any, parent?: any): any {
-            var serializationObject: any = { 
+            var serializationObject: any = {
                 type: 1,
                 children: [],
                 name: serializedAction.name,
                 properties: serializedAction.properties || []
             };
-            
+
             // Serialize child
-            if (this._child) { 
+            if (this._child) {
                 this._child.serialize(serializationObject);
             }
-            
+
             // Check if "this" has a condition
             if (this._condition) {
                 var serializedCondition = this._condition.serialize();
                 serializedCondition.children.push(serializationObject);
-                
+
                 if (parent) {
                     parent.children.push(serializedCondition);
                 }
                 return serializedCondition;
             }
-            
+
             if (parent) {
                 parent.children.push(serializationObject);
             }
             return serializationObject;
         }
-        
+
         /**
          * Internal only
-         * @hidden 
+         * @hidden
          */
         public static _SerializeValueAsString = (value: any): string => {
             if (typeof value === "number") {
                 return value.toString();
             }
-            
+
             if (typeof value === "boolean") {
                 return value ? "true" : "false";
             }
-            
+
             if (value instanceof Vector2) {
                 return value.x + ", " + value.y;
             }
             if (value instanceof Vector3) {
                 return value.x + ", " + value.y + ", " + value.z;
             }
-            
+
             if (value instanceof Color3) {
                 return value.r + ", " + value.g + ", " + value.b;
             }
             if (value instanceof Color4) {
                 return value.r + ", " + value.g + ", " + value.b + ", " + value.a;
             }
-            
+
             return value; // string
-        };
-        
+        }
+
         /**
          * Internal only
-         * @hidden 
+         * @hidden
          */
         public static _GetTargetProperty = (target: Scene | Node) => {
             return {
@@ -233,7 +233,7 @@
                             : target instanceof Camera ? "CameraProperties"
                             : "SceneProperties",
                 value: target instanceof Scene ? "Scene" : (<Node>target).name
-            }  
-        };
+            };
+        }
     }
 }

+ 107 - 80
src/Actions/babylon.actionManager.ts

@@ -1,4 +1,4 @@
-module BABYLON {
+module BABYLON {
 
     /**
      * ActionEvent is the event being sent when an action is triggered.
@@ -88,43 +88,43 @@
          */
         public static readonly NothingTrigger = 0;
 
-        /** 
-         * On pick 
+        /**
+         * On pick
          * @see http://doc.babylonjs.com/how_to/how_to_use_actions#triggers
          */
         public static readonly OnPickTrigger = 1;
 
-        /** 
+        /**
          * On left pick
          * @see http://doc.babylonjs.com/how_to/how_to_use_actions#triggers
          */
         public static readonly OnLeftPickTrigger  = 2;
 
-        /** 
+        /**
          * On right pick
          * @see http://doc.babylonjs.com/how_to/how_to_use_actions#triggers
          */
         public static readonly OnRightPickTrigger = 3;
 
-        /** 
-         * On center pick 
+        /**
+         * On center pick
          * @see http://doc.babylonjs.com/how_to/how_to_use_actions#triggers
          */
         public static readonly OnCenterPickTrigger = 4;
 
-        /** 
+        /**
          * On pick down
          * @see http://doc.babylonjs.com/how_to/how_to_use_actions#triggers
          */
         public static readonly OnPickDownTrigger = 5;
 
-        /** 
+        /**
          * On double pick
          * @see http://doc.babylonjs.com/how_to/how_to_use_actions#triggers
          */
         public static readonly OnDoublePickTrigger = 6;
 
-        /** 
+        /**
          * On pick up
          * @see http://doc.babylonjs.com/how_to/how_to_use_actions#triggers
          */
@@ -136,36 +136,36 @@
          */
         public static readonly OnPickOutTrigger = 16;
 
-        /** 
+        /**
          * On long press
          * @see http://doc.babylonjs.com/how_to/how_to_use_actions#triggers
          */
         public static readonly OnLongPressTrigger = 8;
 
-        /** 
+        /**
          * On pointer over
          * @see http://doc.babylonjs.com/how_to/how_to_use_actions#triggers
          */
         public static readonly OnPointerOverTrigger = 9;
 
-        /** 
+        /**
          * On pointer out
          * @see http://doc.babylonjs.com/how_to/how_to_use_actions#triggers
          */
         public static readonly OnPointerOutTrigger = 10;
 
-        /** 
+        /**
          * On every frame
          * @see http://doc.babylonjs.com/how_to/how_to_use_actions#triggers
          */
         public static readonly OnEveryFrameTrigger = 11;
-        /** 
+        /**
          * On intersection enter
          * @see http://doc.babylonjs.com/how_to/how_to_use_actions#triggers
          */
         public static readonly OnIntersectionEnterTrigger = 12;
 
-        /** 
+        /**
          * On intersection exit
          * @see http://doc.babylonjs.com/how_to/how_to_use_actions#triggers
          */
@@ -217,7 +217,7 @@
                 var action = this.actions[i];
                 ActionManager.Triggers[action.trigger]--;
                 if (ActionManager.Triggers[action.trigger] === 0) {
-                    delete ActionManager.Triggers[action.trigger]
+                    delete ActionManager.Triggers[action.trigger];
                 }
             }
 
@@ -226,8 +226,8 @@
             }
         }
 
-        /** 
-         * Gets hosting scene 
+        /**
+         * Gets hosting scene
          * @returns the hosting scene
          */
         public getScene(): Scene {
@@ -237,7 +237,7 @@
         /**
          * Does this action manager handles actions of any of the given triggers
          * @param triggers defines the triggers to be tested
-         * @return a boolean indicating whether one (or more) of the triggers is handled 
+         * @return a boolean indicating whether one (or more) of the triggers is handled
          */
         public hasSpecificTriggers(triggers: number[]): boolean {
             for (var index = 0; index < this.actions.length; index++) {
@@ -252,11 +252,11 @@
         }
 
         /**
-         * Does this action manager handles actions of any of the given triggers. This function takes two arguments for 
+         * Does this action manager handles actions of any of the given triggers. This function takes two arguments for
          * speed.
          * @param triggerA defines the trigger to be tested
          * @param triggerB defines the trigger to be tested
-         * @return a boolean indicating whether one (or more) of the triggers is handled 
+         * @return a boolean indicating whether one (or more) of the triggers is handled
          */
         public hasSpecificTriggers2(triggerA: number, triggerB: number): boolean {
             for (var index = 0; index < this.actions.length; index++) {
@@ -274,7 +274,7 @@
          * Does this action manager handles actions of a given trigger
          * @param trigger defines the trigger to be tested
          * @param parameterPredicate defines an optional predicate to filter triggers by parameter
-         * @return whether the trigger is handled 
+         * @return whether the trigger is handled
          */
         public hasSpecificTrigger(trigger: number, parameterPredicate?: (parameter: any) => boolean): boolean {
             for (var index = 0; index < this.actions.length; index++) {
@@ -325,7 +325,7 @@
         }
 
         /**
-         * Does exist one action manager with at least one trigger 
+         * Does exist one action manager with at least one trigger
          **/
         public static get HasTriggers(): boolean {
             for (var t in ActionManager.Triggers) {
@@ -337,7 +337,7 @@
         }
 
         /**
-         * Does exist one action manager with at least one pick trigger 
+         * Does exist one action manager with at least one pick trigger
          **/
         public static get HasPickTriggers(): boolean {
             for (var t in ActionManager.Triggers) {
@@ -407,7 +407,7 @@
                 this.actions.splice(index, 1);
                 ActionManager.Triggers[action.trigger] -= 1;
                 if (ActionManager.Triggers[action.trigger] === 0) {
-                    delete ActionManager.Triggers[action.trigger]
+                    delete ActionManager.Triggers[action.trigger];
                 }
                 delete action._actionManager;
                 return true;
@@ -527,10 +527,12 @@
          */
         public static Parse(parsedActions: any, object: Nullable<AbstractMesh>, scene: Scene): void {
             var actionManager = new ActionManager(scene);
-            if (object === null)
-                scene.actionManager = actionManager;
-            else
-                object.actionManager = actionManager;
+            if (object === null) {
+                scene.actionManager = actionManager;
+            }
+            else {
+                object.actionManager = actionManager;
+            }
 
             // instanciate a new object
             var instanciate = (name: string, params: Array<any>): any => {
@@ -545,10 +547,12 @@
                     // String, boolean or float
                     var floatValue = parseFloat(value);
 
-                    if (value === "true" || value === "false")
-                        return value === "true";
-                    else
-                        return isNaN(floatValue) ? value : floatValue;
+                    if (value === "true" || value === "false") {
+                        return value === "true";
+                    }
+                    else {
+                        return isNaN(floatValue) ? value : floatValue;
+                    }
                 }
 
                 var effectiveTarget = propertyPath.split(".");
@@ -560,36 +564,44 @@
                 }
 
                 // Return appropriate value with its type
-                if (typeof (target) === "boolean")
-                    return values[0] === "true";
+                if (typeof (target) === "boolean") {
+                    return values[0] === "true";
+                }
 
-                if (typeof (target) === "string")
-                    return values[0];
+                if (typeof (target) === "string") {
+                    return values[0];
+                }
 
                 // Parameters with multiple values such as Vector3 etc.
                 var split = new Array<number>();
-                for (var i = 0; i < values.length; i++)
-                    split.push(parseFloat(values[i]));
+                for (var i = 0; i < values.length; i++) {
+                    split.push(parseFloat(values[i]));
+                }
 
-                if (target instanceof Vector3)
-                    return Vector3.FromArray(split);
+                if (target instanceof Vector3) {
+                    return Vector3.FromArray(split);
+                }
 
-                if (target instanceof Vector4)
-                    return Vector4.FromArray(split);
+                if (target instanceof Vector4) {
+                    return Vector4.FromArray(split);
+                }
 
-                if (target instanceof Color3)
-                    return Color3.FromArray(split);
+                if (target instanceof Color3) {
+                    return Color3.FromArray(split);
+                }
 
-                if (target instanceof Color4)
-                    return Color4.FromArray(split);
+                if (target instanceof Color4) {
+                    return Color4.FromArray(split);
+                }
 
                 return parseFloat(values[0]);
             };
 
             // traverse graph per trigger
             var traverse = (parsedAction: any, trigger: any, condition: Nullable<Condition>, action: Nullable<Action>, combineArray: Nullable<Array<Action>> = null) => {
-                if (parsedAction.detached)
-                    return;
+                if (parsedAction.detached) {
+                    return;
+                }
 
                 var parameters = new Array<any>();
                 var target: any = null;
@@ -597,10 +609,12 @@
                 var combine = parsedAction.combine && parsedAction.combine.length > 0;
 
                 // Parameters
-                if (parsedAction.type === 2)
-                    parameters.push(actionManager);
-                else
-                    parameters.push(trigger);
+                if (parsedAction.type === 2) {
+                    parameters.push(actionManager);
+                }
+                else {
+                    parameters.push(trigger);
+                }
 
                 if (combine) {
                     var actions = new Array<Action>();
@@ -615,13 +629,17 @@
                         var name = parsedAction.properties[i].name;
                         var targetType = parsedAction.properties[i].targetType;
 
-                        if (name === "target")
-                            if (targetType !== null && targetType === "SceneProperties")
-                                value = target = scene;
-                            else
-                                value = target = scene.getNodeByName(value);
-                        else if (name === "parent")
-                            value = scene.getNodeByName(value);
+                        if (name === "target") {
+                            if (targetType !== null && targetType === "SceneProperties") {
+                                value = target = scene;
+                            }
+                            else {
+                                value = target = scene.getNodeByName(value);
+                        }
+                            }
+                        else if (name === "parent") {
+                            value = scene.getNodeByName(value);
+                             }
                         else if (name === "sound") {
                             // Can not externalize to component, so only checks for the presence off the API.
                             if (scene.getSoundByName) {
@@ -629,10 +647,12 @@
                             }
                         }
                         else if (name !== "propertyPath") {
-                            if (parsedAction.type === 2 && name === "operator")
-                                value = (<any>ValueCondition)[value];
-                            else
-                                value = parseParameter(name, value, target, name === "value" ? propertyPath : null);
+                            if (parsedAction.type === 2 && name === "operator") {
+                                value = (<any>ValueCondition)[value];
+                            }
+                            else {
+                                value = parseParameter(name, value, target, name === "value" ? propertyPath : null);
+                            }
                         } else {
                             propertyPath = value;
                         }
@@ -661,10 +681,12 @@
                 if (newAction instanceof Condition && condition !== null) {
                     var nothing = new DoNothingAction(trigger, condition);
 
-                    if (action)
-                        action.then(nothing);
-                    else
-                        actionManager.registerAction(nothing);
+                    if (action) {
+                        action.then(nothing);
+                    }
+                    else {
+                        actionManager.registerAction(nothing);
+                    }
 
                     action = nothing;
                 }
@@ -675,18 +697,21 @@
                         newAction = action;
                     } else {
                         condition = null;
-                        if (action)
-                            action.then(newAction);
-                        else
-                            actionManager.registerAction(newAction);
+                        if (action) {
+                            action.then(newAction);
+                        }
+                        else {
+                            actionManager.registerAction(newAction);
+                        }
                     }
                 }
                 else {
                     combineArray.push(newAction);
                 }
 
-                for (var i = 0; i < parsedAction.children.length; i++)
-                    traverse(parsedAction.children[i], trigger, condition, newAction, null);
+                for (var i = 0; i < parsedAction.children.length; i++) {
+                    traverse(parsedAction.children[i], trigger, condition, newAction, null);
+                }
             };
 
             // triggers
@@ -704,12 +729,14 @@
 
                     triggerParams = { trigger: (<any>ActionManager)[trigger.name], parameter: value };
                 }
-                else
-                    triggerParams = (<any>ActionManager)[trigger.name];
+                else {
+                    triggerParams = (<any>ActionManager)[trigger.name];
+                }
 
                 for (var j = 0; j < trigger.children.length; j++) {
-                    if (!trigger.detached)
-                        traverse(trigger.children[j], triggerParams, null, null);
+                    if (!trigger.detached) {
+                        traverse(trigger.children[j], triggerParams, null, null);
+                    }
                 }
             }
         }
@@ -741,4 +768,4 @@
             }
         }
     }
-} 
+}

+ 47 - 48
src/Actions/babylon.condition.ts

@@ -1,29 +1,29 @@
-module BABYLON {
+module BABYLON {
     /**
-     * A Condition applied to an Action 
+     * A Condition applied to an Action
      */
     export class Condition {
         /**
          * Internal only - manager for action
-         * @hidden 
+         * @hidden
          */
         public _actionManager: ActionManager;
 
         /**
          * Internal only
-         * @hidden 
+         * @hidden
          */
         public _evaluationId: number;
 
         /**
          * Internal only
-         * @hidden 
+         * @hidden
          */
         public _currentResult: boolean;
 
         /**
          * Creates a new Condition
-         * @param actionManager the manager of the action the condition is applied to 
+         * @param actionManager the manager of the action the condition is applied to
          */
         constructor(actionManager: ActionManager) {
             this._actionManager = actionManager;
@@ -38,34 +38,34 @@
         }
 
         /**
-         * Internal only 
-         * @hidden 
+         * Internal only
+         * @hidden
          */
         public _getProperty(propertyPath: string): string {
             return this._actionManager._getProperty(propertyPath);
         }
 
         /**
-         * Internal only 
-         * @hidden 
+         * Internal only
+         * @hidden
          */
         public _getEffectiveTarget(target: any, propertyPath: string): any {
             return this._actionManager._getEffectiveTarget(target, propertyPath);
         }
-        
+
         /**
          * Serialize placeholder for child classes
          * @returns the serialized object
          */
         public serialize(): any {
         }
-        
+
         /**
-         * Internal only 
-         * @hidden 
+         * Internal only
+         * @hidden
          */
         protected _serialize(serializedCondition: any): any {
-            return { 
+            return {
                 type: 2, // Condition
                 children: [],
                 name: serializedCondition.name,
@@ -78,28 +78,28 @@
      * Defines specific conditional operators as extensions of Condition
      */
     export class ValueCondition extends Condition {
-        
+
         /**
-         * Internal only 
-         * @hidden 
+         * Internal only
+         * @hidden
          */
         private static _IsEqual = 0;
 
         /**
-         * Internal only 
-         * @hidden 
+         * Internal only
+         * @hidden
          */
         private static _IsDifferent = 1;
 
         /**
-         * Internal only 
-         * @hidden 
+         * Internal only
+         * @hidden
          */
         private static _IsGreater = 2;
 
         /**
-         * Internal only 
-         * @hidden 
+         * Internal only
+         * @hidden
          */
         private static _IsLesser = 3;
 
@@ -133,25 +133,25 @@
 
         /**
          * Internal only The action manager for the condition
-         * @hidden 
+         * @hidden
          */
         public _actionManager: ActionManager;
 
         /**
-         * Internal only 
-         * @hidden 
+         * Internal only
+         * @hidden
          */
         private _target: any;
 
         /**
-         * Internal only 
-         * @hidden 
+         * Internal only
+         * @hidden
          */
         private _effectiveTarget: any;
 
         /**
-         * Internal only 
-         * @hidden 
+         * Internal only
+         * @hidden
          */
         private _property: string;
 
@@ -159,15 +159,15 @@
          * Creates a new ValueCondition
          * @param actionManager manager for the action the condition applies to
          * @param target for the action
-         * @param propertyPath path to specify the property of the target the conditional operator uses 
+         * @param propertyPath path to specify the property of the target the conditional operator uses
          * @param value the value compared by the conditional operator against the current value of the property
          * @param operator the conditional operator, default ValueCondition.IsEqual
          */
-        constructor(actionManager: ActionManager, target: any, 
+        constructor(actionManager: ActionManager, target: any,
             /** path to specify the property of the target the conditional operator uses  */
-            public propertyPath: string, 
+            public propertyPath: string,
             /** the value compared by the conditional operator against the current value of the property */
-            public value: any, 
+            public value: any,
             /** the conditional operator, default ValueCondition.IsEqual */
             public operator: number = ValueCondition.IsEqual) {
             super(actionManager);
@@ -201,7 +201,7 @@
 
             return false;
         }
-        
+
         /**
          * Serialize the ValueCondition into a JSON compatible object
          * @returns serialization object
@@ -217,11 +217,11 @@
                 ]
             });
         }
-        
+
         /**
          * Gets the name of the conditional operator for the ValueCondition
          * @param operator the conditional operator
-         * @returns the name 
+         * @returns the name
          */
         public static GetOperatorName(operator: number): string {
             switch (operator) {
@@ -238,20 +238,19 @@
      * Defines a predicate condition as an extension of Condition
      */
     export class PredicateCondition extends Condition {
-        
+
         /**
          * Internal only - manager for action
-         * @hidden 
+         * @hidden
          */
         public _actionManager: ActionManager;
 
-
         /**
          * Creates a new PredicateCondition
          * @param actionManager manager for the action the condition applies to
          * @param predicate defines the predicate function used to validate the condition
          */
-        constructor(actionManager: ActionManager, 
+        constructor(actionManager: ActionManager,
             /** defines the predicate function used to validate the condition */
             public predicate: () => boolean) {
             super(actionManager);
@@ -269,16 +268,16 @@
      * Defines a state condition as an extension of Condition
      */
     export class StateCondition extends Condition {
-        
+
         /**
          * Internal only - manager for action
-         * @hidden 
+         * @hidden
          */
         public _actionManager: ActionManager;
 
         /**
          * Internal only
-         * @hidden 
+         * @hidden
          */
         private _target: any;
 
@@ -286,9 +285,9 @@
          * Creates a new StateCondition
          * @param actionManager manager for the action the condition applies to
          * @param target of the condition
-         * @param value to compare with target state 
+         * @param value to compare with target state
          */
-        constructor(actionManager: ActionManager, target: any, 
+        constructor(actionManager: ActionManager, target: any,
                 /** Value to compare with target state  */
                 public value: string) {
             super(actionManager);
@@ -303,7 +302,7 @@
         public isValid(): boolean {
             return this._target.state === this.value;
         }
-        
+
         /**
          * Serialize the StateCondition into a JSON compatible object
          * @returns serialization object

+ 2 - 2
src/Actions/babylon.directActions.ts

@@ -1,4 +1,4 @@
-module BABYLON {
+module BABYLON {
     /**
      * This defines an action responsible to toggle a boolean once triggered.
      * @see http://doc.babylonjs.com/how_to/how_to_use_actions
@@ -534,4 +534,4 @@
             }, parent);
         }
     }
-} 
+}

+ 8 - 6
src/Actions/babylon.directAudioActions.ts

@@ -1,4 +1,4 @@
-module BABYLON {
+module BABYLON {
     /**
      * This defines an action helpful to play a defined sound on a triggered action.
      */
@@ -24,8 +24,9 @@
          * Execute the action and play the sound.
          */
         public execute(): void {
-            if (this._sound !== undefined)
-                this._sound.play();
+            if (this._sound !== undefined) {
+                this._sound.play();
+            }
         }
 
         /**
@@ -66,8 +67,9 @@
          * Execute the action and stop the sound.
          */
         public execute(): void {
-            if (this._sound !== undefined)
-                this._sound.stop();
+            if (this._sound !== undefined) {
+                this._sound.stop();
+            }
         }
 
         /**
@@ -82,4 +84,4 @@
             }, parent);
         }
     }
-} 
+}

+ 5 - 5
src/Actions/babylon.interpolateValueAction.ts

@@ -1,4 +1,4 @@
-module BABYLON {
+module BABYLON {
     /**
      * This defines an action responsible to change the value of a property
      * by interpolating between its current value and the newly set one once triggered.
@@ -9,7 +9,7 @@
          * Defines the path of the property where the value should be interpolated
          */
         public propertyPath: string;
-        
+
         /**
          * Defines the target value at the end of the interpolation.
          */
@@ -29,7 +29,7 @@
          * Defines a callback raised once the interpolation animation has been done.
          */
         public onInterpolationDone?: () => void;
-        
+
         /**
          * Observable triggered once the interpolation animation has been done.
          */
@@ -112,7 +112,7 @@
                 if (this.onInterpolationDone) {
                     this.onInterpolationDone();
                 }
-            }
+            };
 
             scene.beginDirectAnimation(this._effectiveTarget, [animation], 0, 100, false, 1, wrapper);
         }
@@ -135,4 +135,4 @@
             }, parent);
         }
     }
-} 
+}

+ 10 - 11
src/Animations/babylon.animatable.ts

@@ -1,4 +1,4 @@
-module BABYLON {
+module BABYLON {
     /**
      * Class used to store an actual running animation
      */
@@ -80,7 +80,6 @@
             this._speedRatio = value;
         }
 
-
         /**
          * Creates a new Animatable
          * @param scene defines the hosting scene
@@ -92,18 +91,18 @@
          * @param onAnimationEnd defines a callback to call when animation ends if it is not looping
          * @param animations defines a group of animation to add to the new Animatable
          */
-        constructor(scene: Scene, 
+        constructor(scene: Scene,
             /** defines the target object */
-            public target: any, 
+            public target: any,
             /** defines the starting frame number (default is 0) */
-            public fromFrame: number = 0, 
+            public fromFrame: number = 0,
             /** defines the ending frame number (default is 100) */
-            public toFrame: number = 100, 
+            public toFrame: number = 100,
             /** defines if the animation must loop (default is false)  */
-            public loopAnimation: boolean = false, 
-            speedRatio: number = 1.0, 
+            public loopAnimation: boolean = false,
+            speedRatio: number = 1.0,
             /** defines a callback to call when animation ends if it is not looping */
-            public onAnimationEnd?: Nullable<() => void>, 
+            public onAnimationEnd?: Nullable<() => void>,
             animations?: Animation[]) {
             this._scene = scene;
             if (animations) {
@@ -390,7 +389,7 @@
                 this._raiseOnAnimationEnd();
 
                 if (this.disposeOnEnd) {
-                    this.onAnimationEnd = null
+                    this.onAnimationEnd = null;
                     this.onAnimationEndObservable.clear();
                 }
             }
@@ -398,4 +397,4 @@
             return running;
         }
     }
-} 
+}

+ 5 - 7
src/Animations/babylon.animation.ts

@@ -1,4 +1,4 @@
-module BABYLON {
+module BABYLON {
     /**
      * Represents the range of an animation
      */
@@ -153,7 +153,7 @@
          * @returns This path cursor
          */
         private raiseOnChange(): PathCursor {
-            this._onchange.forEach(f => f(this));
+            this._onchange.forEach((f) => f(this));
 
             return this;
         }
@@ -578,7 +578,7 @@
                     }
                 }
             }
-            this._ranges[name] = null; // said much faster than 'delete this._range[name]' 
+            this._ranges[name] = null; // said much faster than 'delete this._range[name]'
 
         }
 
@@ -889,7 +889,7 @@
          * Defines the function to use to interpolate matrices
          * @param startValue defines the start matrix
          * @param endValue defines the end matrix
-         * @param gradient defines the gradient between both matrices 
+         * @param gradient defines the gradient between both matrices
          * @param result defines an optional target matrix where to store the interpolation
          * @returns the interpolated matrix
          */
@@ -1200,7 +1200,7 @@
                 if (outTangent != undefined) {
                     keyData.outTangent = outTangent;
                 }
-                keys.push(keyData)
+                keys.push(keyData);
             }
 
             animation.setKeys(keys);
@@ -1232,5 +1232,3 @@
         }
     }
 }
-
-

+ 16 - 14
src/Animations/babylon.animationGroup.ts

@@ -101,14 +101,14 @@ module BABYLON {
 
         /**
          * Instantiates a new Animation Group.
-         * This helps managing several animations at once. 
+         * This helps managing several animations at once.
          * @see http://doc.babylonjs.com/how_to/group
          * @param name Defines the name of the group
          * @param scene Defines the scene the group belongs to
          */
         public constructor(
             /** The name of the animation group */
-            public name: string, 
+            public name: string,
             scene: Nullable<Scene> = null) {
             this._scene = scene || Engine.LastCreatedScene!;
 
@@ -149,8 +149,8 @@ module BABYLON {
          * @returns the animation group
          */
         public normalize(beginFrame: Nullable<number> = null, endFrame: Nullable<number> = null): AnimationGroup {
-            if (beginFrame == null) beginFrame = this._from;
-            if (endFrame == null) endFrame = this._to;
+            if (beginFrame == null) { beginFrame = this._from; }
+            if (endFrame == null) { endFrame = this._to; }
 
             for (var index = 0; index < this._targetedAnimations.length; index++) {
                 let targetedAnimation = this._targetedAnimations[index];
@@ -165,7 +165,7 @@ module BABYLON {
                         inTangent: startKey.inTangent,
                         outTangent: startKey.outTangent,
                         interpolation: startKey.interpolation
-                    }
+                    };
                     keys.splice(0, 0, newKey);
                 }
 
@@ -176,7 +176,7 @@ module BABYLON {
                         inTangent: endKey.outTangent,
                         outTangent: endKey.outTangent,
                         interpolation: endKey.interpolation
-                    }
+                    };
                     keys.push(newKey);
                 }
             }
@@ -205,7 +205,7 @@ module BABYLON {
                 animatable.onAnimationEnd = () => {
                     this.onAnimationEndObservable.notifyObservers(targetedAnimation);
                     this._checkAnimationGroupEnded(animatable);
-                }
+                };
                 this._animatables.push(animatable);
             }
 
@@ -397,18 +397,20 @@ module BABYLON {
          */
         public static Parse(parsedAnimationGroup: any, scene: Scene): AnimationGroup {
             var animationGroup = new BABYLON.AnimationGroup(parsedAnimationGroup.name, scene);
-            for (var i = 0; i < parsedAnimationGroup.targetedAnimations.length; i++){
+            for (var i = 0; i < parsedAnimationGroup.targetedAnimations.length; i++) {
                 var targetedAnimation = parsedAnimationGroup.targetedAnimations[i];
                 var animation = Animation.Parse(targetedAnimation.animation);
                 var id = targetedAnimation.targetId;
                 var targetNode = scene.getNodeByID(id);
-                
-                if(targetNode != null)
-                    animationGroup.addTargetedAnimation(animation,targetNode);
+
+                if (targetNode != null) {
+                    animationGroup.addTargetedAnimation(animation, targetNode);
+                }
+            }
+
+            if (parsedAnimationGroup.from !== null && parsedAnimationGroup.from !== null) {
+                animationGroup.normalize(parsedAnimationGroup.from, parsedAnimationGroup.to);
             }
-            
-            if(parsedAnimationGroup.from !== null && parsedAnimationGroup.from !== null)
-                animationGroup.normalize(parsedAnimationGroup.from, parsedAnimationGroup.to);
 
             return animationGroup;
         }

+ 3 - 3
src/Animations/babylon.easing.ts

@@ -1,4 +1,4 @@
-module BABYLON {
+module BABYLON {
 
     /**
      * This represents the main contract an easing function should follow.
@@ -8,7 +8,7 @@
     export interface IEasingFunction {
         /**
          * Given an input gradient between 0 and 1, this returns the corrseponding value
-         * of the easing function. 
+         * of the easing function.
          * The link below provides some of the most common examples of easing functions.
          * @see https://easings.net/
          * @param gradient Defines the value between 0 and 1 we want the easing value for
@@ -135,7 +135,7 @@
          */
         constructor(
             /** Defines the number of bounces */
-            public bounces: number= 3, 
+            public bounces: number= 3,
             /** Defines the amplitude of the bounce */
             public bounciness: number= 2) {
             super();

+ 3 - 5
src/Animations/babylon.runtimeAnimation.ts

@@ -1,4 +1,4 @@
-module BABYLON {
+module BABYLON {
 
     // Static values to help the garbage collector
 
@@ -277,7 +277,7 @@
             var path: any;
             var destination: any;
 
-            let targetPropertyPath = this._animation.targetPropertyPath
+            let targetPropertyPath = this._animation.targetPropertyPath;
 
             if (targetPropertyPath.length > 1) {
                 var property = target[targetPropertyPath[0]];
@@ -411,7 +411,7 @@
          * @returns a boolean indicating if the animation is running
          */
         public animate(delay: number, from: number, to: number, loop: boolean, speedRatio: number, weight = -1.0): boolean {
-            let targetPropertyPath = this._animation.targetPropertyPath
+            let targetPropertyPath = this._animation.targetPropertyPath;
             if (!targetPropertyPath || targetPropertyPath.length < 1) {
                 this._stopped = true;
                 return false;
@@ -589,5 +589,3 @@
         }
     }
 }
-
-

+ 2 - 2
src/Audio/babylon.analyser.ts

@@ -28,7 +28,7 @@ module BABYLON {
          * Gets or sets the debug canvas size
          * @ignorenaming
          */
-        public DEBUGCANVASSIZE = { width: 320, height: 200 }
+        public DEBUGCANVASSIZE = { width: 320, height: 200 };
 
         private _byteFreqs: Uint8Array;
         private _byteTime: Uint8Array;
@@ -103,7 +103,7 @@ module BABYLON {
          * Gets the current frequency data as a float array
          * @see https://developer.mozilla.org/en-US/docs/Web/API/AnalyserNode/getByteFrequencyData
          * @returns a Float32Array
-         */        
+         */
         public getFloatFrequencyData(): Float32Array {
             if (this._audioEngine.canUseWebAudio) {
                 this._webAudioAnalyser.smoothingTimeConstant = this.SMOOTHING;

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 13 - 13
src/Audio/babylon.audioEngine.ts


+ 16 - 16
src/Audio/babylon.audioSceneComponent.ts

@@ -9,7 +9,7 @@ module BABYLON {
             for (let index = 0, cache = parsedData.sounds.length; index < cache; index++) {
                 var parsedSound = parsedData.sounds[index];
                 if (Engine.audioEngine.canUseWebAudio) {
-                    if (!parsedSound.url) parsedSound.url = parsedSound.name;
+                    if (!parsedSound.url) { parsedSound.url = parsedSound.name; }
                     if (!loadedSounds[parsedSound.url]) {
                         loadedSound = Sound.Parse(parsedSound, scene, rootUrl);
                         loadedSounds[parsedSound.url] = loadedSound;
@@ -35,12 +35,12 @@ module BABYLON {
     }
 
     export interface Scene {
-        /** 
+        /**
          * @hidden
          * Backing field
          */
         _mainSoundTrack: SoundTrack;
-        /** 
+        /**
          * The main sound track played by the scene.
          * It cotains your primary collection of sounds.
          */
@@ -72,7 +72,7 @@ module BABYLON {
     }
 
     Object.defineProperty(Scene.prototype, "mainSoundTrack", {
-        get: function (this:Scene) {
+        get: function(this: Scene) {
             let compo = this._getComponent(SceneComponentConstants.NAME_AUDIO) as AudioSceneComponent;
             if (!compo) {
                 compo = new AudioSceneComponent(this);
@@ -108,10 +108,10 @@ module BABYLON {
         }
 
         return null;
-    }
+    };
 
     Object.defineProperty(Scene.prototype, "audioEnabled", {
-        get: function (this:Scene) {
+        get: function(this: Scene) {
             let compo = this._getComponent(SceneComponentConstants.NAME_AUDIO) as AudioSceneComponent;
             if (!compo) {
                 compo = new AudioSceneComponent(this);
@@ -120,7 +120,7 @@ module BABYLON {
 
             return compo.audioEnabled;
         },
-        set: function(this:Scene, value: boolean) {
+        set: function(this: Scene, value: boolean) {
             let compo = this._getComponent(SceneComponentConstants.NAME_AUDIO) as AudioSceneComponent;
             if (!compo) {
                 compo = new AudioSceneComponent(this);
@@ -139,7 +139,7 @@ module BABYLON {
     });
 
     Object.defineProperty(Scene.prototype, "headphone", {
-        get: function (this:Scene) {
+        get: function(this: Scene) {
             let compo = this._getComponent(SceneComponentConstants.NAME_AUDIO) as AudioSceneComponent;
             if (!compo) {
                 compo = new AudioSceneComponent(this);
@@ -148,13 +148,13 @@ module BABYLON {
 
             return compo.headphone;
         },
-        set: function(this:Scene, value: boolean) {
+        set: function(this: Scene, value: boolean) {
             let compo = this._getComponent(SceneComponentConstants.NAME_AUDIO) as AudioSceneComponent;
             if (!compo) {
                 compo = new AudioSceneComponent(this);
                 this._addComponent(compo);
             }
-            
+
             if (value) {
                 compo.switchAudioModeForHeadphones();
             }
@@ -260,7 +260,7 @@ module BABYLON {
 
         /**
          * Removes all the elements in the container from the scene
-         * @param container contains the elements to remove 
+         * @param container contains the elements to remove
          */
         public removeFromContainer(container: AbstractScene): void {
             if (!container.sounds) {
@@ -369,16 +369,16 @@ module BABYLON {
             if (!this._audioEnabled || !scene._mainSoundTrack || !scene.soundTracks || (scene._mainSoundTrack.soundCollection.length === 0 && scene.soundTracks.length === 1)) {
                 return;
             }
-    
+
             var listeningCamera: Nullable<Camera>;
             var audioEngine = Engine.audioEngine;
-    
+
             if (scene.activeCameras.length > 0) {
                 listeningCamera = scene.activeCameras[0];
             } else {
                 listeningCamera = scene.activeCamera;
             }
-    
+
             if (listeningCamera && audioEngine.audioContext) {
                 audioEngine.audioContext.listener.setPosition(listeningCamera.position.x, listeningCamera.position.y, listeningCamera.position.z);
                 // for VR cameras
@@ -392,7 +392,7 @@ module BABYLON {
                 if (!isNaN(cameraDirection.x) && !isNaN(cameraDirection.y) && !isNaN(cameraDirection.z)) {
                     audioEngine.audioContext.listener.setOrientation(cameraDirection.x, cameraDirection.y, cameraDirection.z, 0, 1, 0);
                 }
-    
+
                 var i: number;
                 for (i = 0; i < scene.mainSoundTrack.soundCollection.length; i++) {
                     var sound = scene.mainSoundTrack.soundCollection[i];
@@ -413,4 +413,4 @@ module BABYLON {
             }
         }
     }
-} 
+}

+ 15 - 14
src/Audio/babylon.sound.ts

@@ -60,7 +60,7 @@ module BABYLON {
          * @see http://doc.babylonjs.com/how_to/playing_sounds_and_music#creating-a-spatial-3d-sound
          */
         public distanceModel: string = "linear";
-        /** 
+        /**
          * @hidden
          * Back Compat
          **/
@@ -77,7 +77,7 @@ module BABYLON {
         private _startTime: number = 0;
         private _startOffset: number = 0;
         private _position: Vector3 = Vector3.Zero();
-        /** @hidden */ 
+        /** @hidden */
         public _positionInEmitterSpace: boolean = false;
         private _localDirection: Vector3 = new Vector3(1, 0, 0);
         private _volume: number = 1;
@@ -86,7 +86,7 @@ module BABYLON {
         private _readyToPlayCallback: Nullable<() => any>;
         private _audioBuffer: Nullable<AudioBuffer>;
         private _soundSource: Nullable<AudioBufferSourceNode>;
-        private _streamingSource: MediaElementAudioSourceNode
+        private _streamingSource: MediaElementAudioSourceNode;
         private _soundPanner: Nullable<PannerNode>;
         private _soundGain: Nullable<GainNode>;
         private _inputAudioNode: AudioNode;
@@ -106,7 +106,7 @@ module BABYLON {
 
         /**
         * Create a sound and attach it to a scene
-        * @param name Name of your sound 
+        * @param name Name of your sound
         * @param urlOrArrayBuffer Url to the sound to load async or ArrayBuffer, it also works with MediaStreams
         * @param readyToPlayCallback Provide a callback function if you'd like to load your code once the sound is ready to be played
         * @param options Objects to provide with the current available options: autoplay, loop, volume, spatialSound, maxDistance, rolloffFactor, refDistance, distanceModel, panningModel, streaming
@@ -197,7 +197,7 @@ module BABYLON {
                             case "String":
                                 urls.push(urlOrArrayBuffer);
                             case "Array":
-                                if (urls.length === 0) urls = urlOrArrayBuffer;
+                                if (urls.length === 0) { urls = urlOrArrayBuffer; }
                                 // If we found a supported format, we load it immediately and stop the loop
                                 for (var i = 0; i < urls.length; i++) {
                                     var url = urls[i];
@@ -414,7 +414,7 @@ module BABYLON {
         private _updateSpatialParameters() {
             if (this.spatialSound && this._soundPanner) {
                 if (this.useCustomAttenuation) {
-                    // Tricks to disable in a way embedded Web Audio attenuation 
+                    // Tricks to disable in a way embedded Web Audio attenuation
                     this._soundPanner.distanceModel = "linear";
                     this._soundPanner.maxDistance = Number.MAX_VALUE;
                     this._soundPanner.refDistance = 1;
@@ -655,7 +655,7 @@ module BABYLON {
                                 else {
                                     Engine.audioEngine.onAudioUnlockedObservable.addOnce(() => { tryToPlay(); });
                                 }
-                            }
+                            };
                             tryToPlay();
                         }
                     }
@@ -776,9 +776,9 @@ module BABYLON {
          * Gets the volume of the sound.
          * @returns the volume of the sound
          */
-        public getVolume(): number { 
-            return this._volume; 
-        } 
+        public getVolume(): number {
+            return this._volume;
+        }
 
         /**
          * Attach the sound to a dedicated mesh
@@ -825,7 +825,7 @@ module BABYLON {
                 mesh.worldMatrixFromCache.invertToRef(Tmp.Matrix[0]);
                 this.setPosition(Tmp.Matrix[0].getTranslation());
             }
-            else 
+            else
             {
                 let boundingInfo = mesh.getBoundingInfo();
                 this.setPosition(boundingInfo.boundingSphere.centerWorld);
@@ -905,8 +905,9 @@ module BABYLON {
             };
 
             if (this.spatialSound) {
-                if (this._connectedMesh)
-                    serializationObject.connectedMeshId = this._connectedMesh.id;
+                if (this._connectedMesh) {
+                    serializationObject.connectedMeshId = this._connectedMesh.id;
+                }
 
                 serializationObject.position = this._position.asArray();
                 serializationObject.refDistance = this.refDistance;
@@ -966,7 +967,7 @@ module BABYLON {
                     else {
                         window.setTimeout(setBufferAndRun, 300);
                     }
-                }
+                };
 
                 newSound = new Sound(soundName, new ArrayBuffer(0), scene, null, options);
                 setBufferAndRun();

+ 6 - 6
src/Audio/babylon.soundtrack.ts

@@ -1,4 +1,4 @@
-module BABYLON {
+module BABYLON {
     /**
      * Options allowed during the creation of a sound track.
      */
@@ -14,7 +14,7 @@
     }
 
     /**
-     * It could be useful to isolate your music & sounds on several tracks to better manage volume on a grouped instance of sounds. 
+     * It could be useful to isolate your music & sounds on several tracks to better manage volume on a grouped instance of sounds.
      * It will be also used in a future release to apply effects on a specific track.
      * @see http://doc.babylonjs.com/how_to/playing_sounds_and_music#using-sound-tracks
      */
@@ -39,7 +39,7 @@
          * Creates a new sound track.
          * @see http://doc.babylonjs.com/how_to/playing_sounds_and_music#using-sound-tracks
          * @param scene Define the scene the sound track belongs to
-         * @param options 
+         * @param options
          */
         constructor(scene: Scene, options: ISoundTrackOptions = { }) {
             this._scene = scene;
@@ -87,7 +87,7 @@
         /**
          * Adds a sound to this sound track
          * @param sound define the cound to add
-         * @ignoreNaming 
+         * @ignoreNaming
          */
         public AddSound(sound: Sound): void {
             if (!this._isInitialized) {
@@ -112,7 +112,7 @@
         /**
          * Removes a sound to this sound track
          * @param sound define the cound to remove
-         * @ignoreNaming 
+         * @ignoreNaming
          */
         public RemoveSound(sound: Sound): void {
             var index = this.soundCollection.indexOf(sound);
@@ -158,7 +158,7 @@
         }
 
         /**
-         * Connect the sound track to an audio analyser allowing some amazing 
+         * Connect the sound track to an audio analyser allowing some amazing
          * synchornization between the sounds/music and your visualization (VuMeter for instance).
          * @see http://doc.babylonjs.com/how_to/playing_sounds_and_music#using-the-analyser
          * @param analyser The analyser to connect to the engine

+ 0 - 0
src/Audio/babylon.weightedsound.ts


Daži faili netika attēloti, jo izmaiņu fails ir pārāk liels