Bläddra i källkod

NoImplicitThis

David Catuhe 7 år sedan
förälder
incheckning
08783affe9
100 ändrade filer med 7664 tillägg och 8431 borttagningar
  1. 6 2
      Tools/Gulp/gulpfile.js
  2. 1746 1793
      dist/preview release/babylon.d.ts
  3. 42 42
      dist/preview release/babylon.js
  4. 122 199
      dist/preview release/babylon.max.js
  5. 1746 1793
      dist/preview release/babylon.module.d.ts
  6. 42 42
      dist/preview release/babylon.worker.js
  7. 1697 1746
      dist/preview release/customConfigurations/minimalGLTFViewer/babylon.d.ts
  8. 45 45
      dist/preview release/customConfigurations/minimalGLTFViewer/babylon.js
  9. 126 253
      dist/preview release/customConfigurations/minimalGLTFViewer/babylon.max.js
  10. 1697 1746
      dist/preview release/customConfigurations/minimalGLTFViewer/babylon.module.d.ts
  11. 0 4
      dist/preview release/gui/babylon.gui.d.ts
  12. 0 3
      dist/preview release/gui/babylon.gui.js
  13. 3 3
      dist/preview release/gui/babylon.gui.min.js
  14. 0 4
      dist/preview release/gui/babylon.gui.module.d.ts
  15. 4 4
      dist/preview release/inspector/babylon.inspector.bundle.js
  16. 0 8
      dist/preview release/inspector/babylon.inspector.d.ts
  17. 2 14
      dist/preview release/inspector/babylon.inspector.js
  18. 4 4
      dist/preview release/inspector/babylon.inspector.min.js
  19. 2 55
      dist/preview release/loaders/babylon.glTF1FileLoader.js
  20. 2 2
      dist/preview release/loaders/babylon.glTF1FileLoader.min.js
  21. 1 1
      dist/preview release/loaders/babylon.glTF2FileLoader.js
  22. 1 1
      dist/preview release/loaders/babylon.glTF2FileLoader.min.js
  23. 3 56
      dist/preview release/loaders/babylon.glTFFileLoader.js
  24. 3 3
      dist/preview release/loaders/babylon.glTFFileLoader.min.js
  25. 1 1
      dist/preview release/loaders/babylon.objFileLoader.d.ts
  26. 146 146
      dist/preview release/loaders/babylon.objFileLoader.js
  27. 1 1
      dist/preview release/loaders/babylon.objFileLoader.min.js
  28. 160 213
      dist/preview release/loaders/babylonjs.loaders.js
  29. 3 3
      dist/preview release/loaders/babylonjs.loaders.min.js
  30. 1 1
      dist/preview release/loaders/babylonjs.loaders.module.d.ts
  31. 0 2
      dist/preview release/materialsLibrary/babylon.cellMaterial.d.ts
  32. 0 2
      dist/preview release/materialsLibrary/babylon.cellMaterial.js
  33. 1 1
      dist/preview release/materialsLibrary/babylon.cellMaterial.min.js
  34. 2 2
      dist/preview release/materialsLibrary/babylon.customMaterial.js
  35. 1 1
      dist/preview release/materialsLibrary/babylon.customMaterial.min.js
  36. 0 1
      dist/preview release/materialsLibrary/babylon.furMaterial.d.ts
  37. 0 1
      dist/preview release/materialsLibrary/babylon.furMaterial.js
  38. 1 1
      dist/preview release/materialsLibrary/babylon.furMaterial.min.js
  39. 0 1
      dist/preview release/materialsLibrary/babylon.gradientMaterial.d.ts
  40. 0 1
      dist/preview release/materialsLibrary/babylon.gradientMaterial.js
  41. 1 1
      dist/preview release/materialsLibrary/babylon.gradientMaterial.min.js
  42. 0 1
      dist/preview release/materialsLibrary/babylon.gridMaterial.js
  43. 1 1
      dist/preview release/materialsLibrary/babylon.gridMaterial.min.js
  44. 0 1
      dist/preview release/materialsLibrary/babylon.lavaMaterial.d.ts
  45. 0 1
      dist/preview release/materialsLibrary/babylon.lavaMaterial.js
  46. 1 1
      dist/preview release/materialsLibrary/babylon.lavaMaterial.min.js
  47. 0 2
      dist/preview release/materialsLibrary/babylon.legacyPbrMaterial.d.ts
  48. 5 6
      dist/preview release/materialsLibrary/babylon.legacyPbrMaterial.js
  49. 2 2
      dist/preview release/materialsLibrary/babylon.legacyPbrMaterial.min.js
  50. 0 2
      dist/preview release/materialsLibrary/babylon.normalMaterial.d.ts
  51. 0 2
      dist/preview release/materialsLibrary/babylon.normalMaterial.js
  52. 1 1
      dist/preview release/materialsLibrary/babylon.normalMaterial.min.js
  53. 0 2
      dist/preview release/materialsLibrary/babylon.shadowOnlyMaterial.d.ts
  54. 1 13
      dist/preview release/materialsLibrary/babylon.shadowOnlyMaterial.js
  55. 1 1
      dist/preview release/materialsLibrary/babylon.shadowOnlyMaterial.min.js
  56. 0 2
      dist/preview release/materialsLibrary/babylon.simpleMaterial.d.ts
  57. 0 2
      dist/preview release/materialsLibrary/babylon.simpleMaterial.js
  58. 1 1
      dist/preview release/materialsLibrary/babylon.simpleMaterial.min.js
  59. 0 1
      dist/preview release/materialsLibrary/babylon.skyMaterial.js
  60. 1 1
      dist/preview release/materialsLibrary/babylon.skyMaterial.min.js
  61. 0 1
      dist/preview release/materialsLibrary/babylon.terrainMaterial.d.ts
  62. 0 1
      dist/preview release/materialsLibrary/babylon.terrainMaterial.js
  63. 1 1
      dist/preview release/materialsLibrary/babylon.terrainMaterial.min.js
  64. 0 1
      dist/preview release/materialsLibrary/babylon.triPlanarMaterial.d.ts
  65. 0 1
      dist/preview release/materialsLibrary/babylon.triPlanarMaterial.js
  66. 1 1
      dist/preview release/materialsLibrary/babylon.triPlanarMaterial.min.js
  67. 0 1
      dist/preview release/materialsLibrary/babylon.waterMaterial.d.ts
  68. 8 29
      dist/preview release/materialsLibrary/babylonjs.materials.js
  69. 8 8
      dist/preview release/materialsLibrary/babylonjs.materials.min.js
  70. 0 16
      dist/preview release/materialsLibrary/babylonjs.materials.module.d.ts
  71. 0 3
      dist/preview release/proceduralTexturesLibrary/babylon.grassProceduralTexture.d.ts
  72. 0 3
      dist/preview release/proceduralTexturesLibrary/babylon.grassProceduralTexture.js
  73. 1 1
      dist/preview release/proceduralTexturesLibrary/babylon.grassProceduralTexture.min.js
  74. 0 3
      dist/preview release/proceduralTexturesLibrary/babylonjs.proceduralTextures.js
  75. 1 1
      dist/preview release/proceduralTexturesLibrary/babylonjs.proceduralTextures.min.js
  76. 0 3
      dist/preview release/proceduralTexturesLibrary/babylonjs.proceduralTextures.module.d.ts
  77. 1 1
      dist/preview release/what's new.md
  78. 0 1
      gui/src/advancedDynamicTexture.ts
  79. 0 2
      gui/src/controls/control.ts
  80. 0 1
      gui/src/controls/line.ts
  81. 0 3
      gui/src/controls/textBlock.ts
  82. 3 1
      gui/src/tsconfig.json
  83. 0 3
      inspector/src/Inspector.ts
  84. 0 1
      inspector/src/adapters/MeshAdapter.ts
  85. 0 12
      inspector/src/details/PropertyLine.ts
  86. 1 1
      inspector/src/gui/ColorElement.ts
  87. 1 1
      inspector/src/gui/ColorPickerElement.ts
  88. 0 2
      inspector/src/gui/CubeTextureElement.ts
  89. 3 1
      inspector/src/tsconfig.json
  90. 1 1
      loaders/src/OBJ/babylon.objFileLoader.ts
  91. 0 32
      loaders/src/glTF/1.0/babylon.glTFBinaryExtension.ts
  92. 2 38
      loaders/src/glTF/1.0/babylon.glTFLoader.ts
  93. 1 1
      loaders/src/glTF/2.0/babylon.glTFLoader.ts
  94. 3 1
      loaders/src/tsconfig.json
  95. 0 2
      materialsLibrary/src/cell/babylon.cellMaterial.ts
  96. 2 2
      materialsLibrary/src/custom/babylon.customMaterial.ts
  97. 0 1
      materialsLibrary/src/fur/babylon.furMaterial.ts
  98. 0 2
      materialsLibrary/src/gradient/babylon.gradientMaterial.ts
  99. 0 2
      materialsLibrary/src/grid/babylon.gridmaterial.ts
  100. 0 0
      materialsLibrary/src/lava/babylon.lavaMaterial.ts

+ 6 - 2
Tools/Gulp/gulpfile.js

@@ -47,7 +47,9 @@ var tsConfig = {
     experimentalDecorators: true,
     isolatedModules: false,
     noImplicitAny: true,
-    noImplicitReturns: true
+    noImplicitReturns: true,
+    noImplicitThis: true,
+    noUnusedLocals: true
 };
 var tsProject = typescript.createProject(tsConfig);
 
@@ -59,7 +61,9 @@ var externalTsConfig = {
     experimentalDecorators: true,
     isolatedModules: false,
     noImplicitAny: true,
-    noImplicitReturns: true
+    noImplicitReturns: true,
+    noImplicitThis: true,
+    noUnusedLocals: true
 };
 
 function processDependency(kind, dependency, filesToLoad) {

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 1746 - 1793
dist/preview release/babylon.d.ts


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 42 - 42
dist/preview release/babylon.js


+ 122 - 199
dist/preview release/babylon.max.js

@@ -6086,7 +6086,6 @@ var BABYLON;
             var script = document.createElement('script');
             script.type = 'text/javascript';
             script.src = scriptUrl;
-            var self = this;
             script.onload = function () {
                 if (onSuccess) {
                     onSuccess();
@@ -6194,7 +6193,9 @@ var BABYLON;
         };
         Tools.IsEmpty = function (obj) {
             for (var i in obj) {
-                return false;
+                if (obj.hasOwnProperty(i)) {
+                    return false;
+                }
             }
             return true;
         };
@@ -7777,7 +7778,6 @@ var BABYLON;
             this._alphaMode = Engine.ALPHA_DISABLE;
             // Cache
             this._internalTexturesCache = new Array();
-            this._maxTextureChannels = 16;
             this._activeTexturesCache = {};
             this._compiledEffects = {};
             this._vertexAttribArraysEnabled = [];
@@ -7797,7 +7797,6 @@ var BABYLON;
                     _this._oldHardwareScaleFactor = _this.getHardwareScalingLevel();
                     //get the width and height, change the render size
                     var leftEye = _this._vrDisplay.getEyeParameters('left');
-                    var width, height;
                     _this.setHardwareScalingLevel(1);
                     _this.setSize(leftEye.renderWidth * 2, leftEye.renderHeight);
                 }
@@ -10802,7 +10801,6 @@ var BABYLON;
             }
             var textureType = this._getWebGLTextureType(type);
             var internalFormat = this._getInternalFormat(format);
-            var internalSizedFomat = this._getRGBABufferInternalSizedFormat(type);
             var needConversion = false;
             if (internalFormat === gl.RGB) {
                 internalFormat = gl.RGBA;
@@ -10863,7 +10861,6 @@ var BABYLON;
             };
             var internalCallback = function (data) {
                 var width = texture.width;
-                var height = texture.height;
                 var faceDataArrays = callback(data);
                 if (mipmmapGenerator) {
                     var textureType = _this._getWebGLTextureType(type);
@@ -11618,7 +11615,6 @@ var BABYLON;
             this.doNotSerialize = false;
             this.animations = new Array();
             this._ranges = {};
-            this._childrenFlag = -1;
             this._isEnabled = true;
             this._isReady = true;
             this._currentRenderId = -1;
@@ -12417,7 +12413,6 @@ var BABYLON;
             _this.ellipsoidOffset = new BABYLON.Vector3(0, 0, 0);
             _this._oldPositionForCollisions = new BABYLON.Vector3(0, 0, 0);
             _this._diffPositionForCollisions = new BABYLON.Vector3(0, 0, 0);
-            _this._newPositionForCollisions = new BABYLON.Vector3(0, 0, 0);
             // Edges
             _this.edgesWidth = 1;
             _this.edgesColor = new BABYLON.Color4(1, 0, 0, 1);
@@ -15148,7 +15143,7 @@ var BABYLON;
         };
         Light.prototype._reorderLightsInScene = function () {
             var scene = this.getScene();
-            if (this.renderPriority != 0) {
+            if (this._renderPriority != 0) {
                 scene.requireLightSorting = true;
             }
             this.getScene().sortLightsByPriority();
@@ -15422,7 +15417,6 @@ var BABYLON;
             if (!ignoreParentClass) {
                 _super.prototype._updateCache.call(this);
             }
-            var engine = this.getEngine();
             this._cache.position.copyFrom(this.position);
             this._cache.upVector.copyFrom(this.upVector);
         };
@@ -17599,6 +17593,7 @@ var BABYLON;
             return this._processPointerDown(pickResult, evt);
         };
         Scene.prototype._processPointerDown = function (pickResult, evt) {
+            var _this = this;
             if (pickResult && pickResult.hit && pickResult.pickedMesh) {
                 this._pickedDownMesh = pickResult.pickedMesh;
                 var actionManager = pickResult.pickedMesh.actionManager;
@@ -17618,19 +17613,18 @@ var BABYLON;
                         }
                     }
                     if (actionManager.hasSpecificTrigger(BABYLON.ActionManager.OnLongPressTrigger)) {
-                        window.setTimeout((function () {
-                            var _this = this;
-                            var pickResult = this.pick(this._unTranslatedPointerX, this._unTranslatedPointerY, function (mesh) { return mesh.isPickable && mesh.isVisible && mesh.isReady() && mesh.actionManager && mesh.actionManager.hasSpecificTrigger(BABYLON.ActionManager.OnLongPressTrigger) && mesh == _this._pickedDownMesh; }, false, this.cameraToUseForPointers);
+                        window.setTimeout(function () {
+                            var pickResult = _this.pick(_this._unTranslatedPointerX, _this._unTranslatedPointerY, function (mesh) { return mesh.isPickable && mesh.isVisible && mesh.isReady() && mesh.actionManager && mesh.actionManager.hasSpecificTrigger(BABYLON.ActionManager.OnLongPressTrigger) && mesh == _this._pickedDownMesh; }, false, _this.cameraToUseForPointers);
                             if (pickResult && pickResult.hit && pickResult.pickedMesh) {
-                                if (this._totalPointersPressed !== 0 &&
-                                    ((new Date().getTime() - this._startingPointerTime) > Scene.LongPressDelay) &&
-                                    (Math.abs(this._startingPointerPosition.x - this._pointerX) < Scene.DragMovementThreshold &&
-                                        Math.abs(this._startingPointerPosition.y - this._pointerY) < Scene.DragMovementThreshold)) {
-                                    this._startingPointerTime = 0;
+                                if (_this._totalPointersPressed !== 0 &&
+                                    ((new Date().getTime() - _this._startingPointerTime) > Scene.LongPressDelay) &&
+                                    (Math.abs(_this._startingPointerPosition.x - _this._pointerX) < Scene.DragMovementThreshold &&
+                                        Math.abs(_this._startingPointerPosition.y - _this._pointerY) < Scene.DragMovementThreshold)) {
+                                    _this._startingPointerTime = 0;
                                     actionManager.processTrigger(BABYLON.ActionManager.OnLongPressTrigger, BABYLON.ActionEvent.CreateNew(pickResult.pickedMesh, evt));
                                 }
                             }
-                        }).bind(this), Scene.LongPressDelay);
+                        }, Scene.LongPressDelay);
                     }
                 }
             }
@@ -17928,23 +17922,23 @@ var BABYLON;
                 _this._pickedUpMesh = null;
                 _this._meshPickProceed = false;
                 _this._updatePointerPosition(evt);
-                _this._initClickEvent(_this.onPrePointerObservable, _this.onPointerObservable, evt, (function (clickInfo, pickResult) {
+                _this._initClickEvent(_this.onPrePointerObservable, _this.onPointerObservable, evt, function (clickInfo, pickResult) {
                     // PreObservable support
-                    if (this.onPrePointerObservable.hasObservers()) {
+                    if (_this.onPrePointerObservable.hasObservers()) {
                         if (!clickInfo.ignore) {
                             if (!clickInfo.hasSwiped) {
-                                if (clickInfo.singleClick && this.onPrePointerObservable.hasSpecificMask(BABYLON.PointerEventTypes.POINTERTAP)) {
+                                if (clickInfo.singleClick && _this.onPrePointerObservable.hasSpecificMask(BABYLON.PointerEventTypes.POINTERTAP)) {
                                     var type = BABYLON.PointerEventTypes.POINTERTAP;
-                                    var pi = new BABYLON.PointerInfoPre(type, evt, this._unTranslatedPointerX, this._unTranslatedPointerY);
-                                    this.onPrePointerObservable.notifyObservers(pi, type);
+                                    var pi = new BABYLON.PointerInfoPre(type, evt, _this._unTranslatedPointerX, _this._unTranslatedPointerY);
+                                    _this.onPrePointerObservable.notifyObservers(pi, type);
                                     if (pi.skipOnPointerObservable) {
                                         return;
                                     }
                                 }
-                                if (clickInfo.doubleClick && this.onPrePointerObservable.hasSpecificMask(BABYLON.PointerEventTypes.POINTERDOUBLETAP)) {
+                                if (clickInfo.doubleClick && _this.onPrePointerObservable.hasSpecificMask(BABYLON.PointerEventTypes.POINTERDOUBLETAP)) {
                                     var type = BABYLON.PointerEventTypes.POINTERDOUBLETAP;
-                                    var pi = new BABYLON.PointerInfoPre(type, evt, this._unTranslatedPointerX, this._unTranslatedPointerY);
-                                    this.onPrePointerObservable.notifyObservers(pi, type);
+                                    var pi = new BABYLON.PointerInfoPre(type, evt, _this._unTranslatedPointerX, _this._unTranslatedPointerY);
+                                    _this.onPrePointerObservable.notifyObservers(pi, type);
                                     if (pi.skipOnPointerObservable) {
                                         return;
                                     }
@@ -17953,48 +17947,48 @@ var BABYLON;
                         }
                         else {
                             var type = BABYLON.PointerEventTypes.POINTERUP;
-                            var pi = new BABYLON.PointerInfoPre(type, evt, this._unTranslatedPointerX, this._unTranslatedPointerY);
-                            this.onPrePointerObservable.notifyObservers(pi, type);
+                            var pi = new BABYLON.PointerInfoPre(type, evt, _this._unTranslatedPointerX, _this._unTranslatedPointerY);
+                            _this.onPrePointerObservable.notifyObservers(pi, type);
                             if (pi.skipOnPointerObservable) {
                                 return;
                             }
                         }
                     }
-                    if (!this.cameraToUseForPointers && !this.activeCamera) {
+                    if (!_this.cameraToUseForPointers && !_this.activeCamera) {
                         return;
                     }
-                    if (!this.pointerUpPredicate) {
-                        this.pointerUpPredicate = function (mesh) {
+                    if (!_this.pointerUpPredicate) {
+                        _this.pointerUpPredicate = function (mesh) {
                             return mesh.isPickable && mesh.isVisible && mesh.isReady() && mesh.isEnabled();
                         };
                     }
                     // Meshes
-                    if (!this._meshPickProceed && (BABYLON.ActionManager && BABYLON.ActionManager.HasTriggers || this.onPointerObservable.hasObservers())) {
-                        this._initActionManager(null, clickInfo);
+                    if (!_this._meshPickProceed && (BABYLON.ActionManager && BABYLON.ActionManager.HasTriggers || _this.onPointerObservable.hasObservers())) {
+                        _this._initActionManager(null, clickInfo);
                     }
                     if (!pickResult) {
-                        pickResult = this._currentPickResult;
+                        pickResult = _this._currentPickResult;
                     }
-                    this._processPointerUp(pickResult, evt, clickInfo);
+                    _this._processPointerUp(pickResult, evt, clickInfo);
                     // Sprites
-                    if (this.spriteManagers.length > 0) {
-                        pickResult = this.pickSprite(this._unTranslatedPointerX, this._unTranslatedPointerY, this._spritePredicate, false, this.cameraToUseForPointers);
+                    if (_this.spriteManagers.length > 0) {
+                        pickResult = _this.pickSprite(_this._unTranslatedPointerX, _this._unTranslatedPointerY, _this._spritePredicate, false, _this.cameraToUseForPointers);
                         if (pickResult.hit && pickResult.pickedSprite) {
                             if (pickResult.pickedSprite.actionManager) {
-                                pickResult.pickedSprite.actionManager.processTrigger(BABYLON.ActionManager.OnPickUpTrigger, BABYLON.ActionEvent.CreateNewFromSprite(pickResult.pickedSprite, this, evt));
+                                pickResult.pickedSprite.actionManager.processTrigger(BABYLON.ActionManager.OnPickUpTrigger, BABYLON.ActionEvent.CreateNewFromSprite(pickResult.pickedSprite, _this, evt));
                                 if (pickResult.pickedSprite.actionManager) {
-                                    if (Math.abs(this._startingPointerPosition.x - this._pointerX) < Scene.DragMovementThreshold && Math.abs(this._startingPointerPosition.y - this._pointerY) < Scene.DragMovementThreshold) {
-                                        pickResult.pickedSprite.actionManager.processTrigger(BABYLON.ActionManager.OnPickTrigger, BABYLON.ActionEvent.CreateNewFromSprite(pickResult.pickedSprite, this, evt));
+                                    if (Math.abs(_this._startingPointerPosition.x - _this._pointerX) < Scene.DragMovementThreshold && Math.abs(_this._startingPointerPosition.y - _this._pointerY) < Scene.DragMovementThreshold) {
+                                        pickResult.pickedSprite.actionManager.processTrigger(BABYLON.ActionManager.OnPickTrigger, BABYLON.ActionEvent.CreateNewFromSprite(pickResult.pickedSprite, _this, evt));
                                     }
                                 }
                             }
                         }
-                        if (this._pickedDownSprite && this._pickedDownSprite.actionManager && this._pickedDownSprite !== pickResult.pickedSprite) {
-                            this._pickedDownSprite.actionManager.processTrigger(BABYLON.ActionManager.OnPickOutTrigger, BABYLON.ActionEvent.CreateNewFromSprite(this._pickedDownSprite, this, evt));
+                        if (_this._pickedDownSprite && _this._pickedDownSprite.actionManager && _this._pickedDownSprite !== pickResult.pickedSprite) {
+                            _this._pickedDownSprite.actionManager.processTrigger(BABYLON.ActionManager.OnPickOutTrigger, BABYLON.ActionEvent.CreateNewFromSprite(_this._pickedDownSprite, _this, evt));
                         }
                     }
-                    this._previousPickResult = this._currentPickResult;
-                }).bind(_this));
+                    _this._previousPickResult = _this._currentPickResult;
+                });
             };
             this._onKeyDown = function (evt) {
                 var type = BABYLON.KeyboardEventTypes.KEYDOWN;
@@ -18325,7 +18319,7 @@ var BABYLON;
             return result;
         };
         Scene.prototype.addMesh = function (newMesh) {
-            var position = this.meshes.push(newMesh);
+            this.meshes.push(newMesh);
             //notify the collision coordinator
             if (this.collisionCoordinator) {
                 this.collisionCoordinator.onMeshAdded(newMesh);
@@ -18406,7 +18400,7 @@ var BABYLON;
             }
         };
         Scene.prototype.addCamera = function (newCamera) {
-            var position = this.cameras.push(newCamera);
+            this.cameras.push(newCamera);
             this.onNewCameraAddedObservable.notifyObservers(newCamera);
         };
         /**
@@ -18986,7 +18980,6 @@ var BABYLON;
             }
             // Particle systems
             this._particlesDuration.beginMonitoring();
-            var beforeParticlesDate = BABYLON.Tools.Now;
             if (this.particlesEnabled) {
                 BABYLON.Tools.StartPerformanceCounter("Particles", this.particleSystems.length > 0);
                 for (var particleIndex = 0; particleIndex < this.particleSystems.length; particleIndex++) {
@@ -19047,7 +19040,6 @@ var BABYLON;
                 return;
             }
             var engine = this._engine;
-            var startTime = BABYLON.Tools.Now;
             this.activeCamera = camera;
             if (!this.activeCamera)
                 throw new Error("Active camera not set");
@@ -19078,7 +19070,6 @@ var BABYLON;
             // Render targets
             this._renderTargetsDuration.beginMonitoring();
             var needsRestoreFrameBuffer = false;
-            var beforeRenderTargetDate = BABYLON.Tools.Now;
             if (camera.customRenderTargets && camera.customRenderTargets.length > 0) {
                 this._renderTargets.concatWithNoDuplicate(camera.customRenderTargets);
             }
@@ -19319,7 +19310,6 @@ var BABYLON;
             this.onBeforeRenderObservable.notifyObservers(this);
             // Customs render targets
             this._renderTargetsDuration.beginMonitoring();
-            var beforeRenderTargetDate = BABYLON.Tools.Now;
             var engine = this.getEngine();
             var currentActiveCamera = this.activeCamera;
             if (this.renderTargetsEnabled) {
@@ -21619,7 +21609,7 @@ var BABYLON;
                         var mesh = scene.meshes[index];
                         if (mesh.parent === source) {
                             // doNotCloneChildren is always going to be False
-                            var newChild = mesh.clone(name + "." + mesh.name, _this, doNotCloneChildren);
+                            mesh.clone(name + "." + mesh.name, _this, doNotCloneChildren);
                         }
                     }
                 }
@@ -22588,7 +22578,6 @@ var BABYLON;
             if (!this._geometry || !this._geometry.getVertexBuffers() || !this._geometry.getIndexBuffer()) {
                 return this;
             }
-            var callbackIndex;
             this.onBeforeRenderObservable.notifyObservers(this);
             var engine = scene.getEngine();
             var hardwareInstancedRendering = (engine.getCaps().instancedArrays) && (batch.visibleInstances[subMesh._id] !== null) && (batch.visibleInstances[subMesh._id] !== undefined);
@@ -23076,7 +23065,7 @@ var BABYLON;
             this.releaseSubMeshes();
             for (var submeshIndex = 0; submeshIndex < previousSubmeshes.length; submeshIndex++) {
                 var previousOne = previousSubmeshes[submeshIndex];
-                var subMesh = new BABYLON.SubMesh(previousOne.materialIndex, previousOne.indexStart, previousOne.indexCount, previousOne.indexStart, previousOne.indexCount, this);
+                BABYLON.SubMesh.AddToMesh(previousOne.materialIndex, previousOne.indexStart, previousOne.indexCount, previousOne.indexStart, previousOne.indexCount, this);
             }
             this.synchronizeInstances();
             return this;
@@ -23094,7 +23083,6 @@ var BABYLON;
             var vbs = {};
             var data = {};
             var newdata = {};
-            var updatableNormals = false;
             var kindIndex;
             var kind;
             for (kindIndex = 0; kindIndex < kinds.length; kindIndex++) {
@@ -23136,7 +23124,7 @@ var BABYLON;
             this.releaseSubMeshes();
             for (var submeshIndex = 0; submeshIndex < previousSubmeshes.length; submeshIndex++) {
                 var previousOne = previousSubmeshes[submeshIndex];
-                var subMesh = new BABYLON.SubMesh(previousOne.materialIndex, previousOne.indexStart, previousOne.indexCount, previousOne.indexStart, previousOne.indexCount, this);
+                BABYLON.SubMesh.AddToMesh(previousOne.materialIndex, previousOne.indexStart, previousOne.indexCount, previousOne.indexStart, previousOne.indexCount, this);
             }
             this._unIndexed = true;
             this.synchronizeInstances();
@@ -24400,6 +24388,10 @@ var BABYLON;
             }
             return _this;
         }
+        SubMesh.AddToMesh = function (materialIndex, verticesStart, verticesCount, indexStart, indexCount, mesh, renderingMesh, createBoundingBox) {
+            if (createBoundingBox === void 0) { createBoundingBox = true; }
+            return new SubMesh(materialIndex, verticesStart, verticesCount, indexStart, indexCount, mesh, renderingMesh, createBoundingBox);
+        };
         Object.defineProperty(SubMesh.prototype, "IsGlobal", {
             get: function () {
                 return (this.verticesStart === 0 && this.verticesCount == this._mesh.getTotalVertices());
@@ -29930,7 +29922,7 @@ var BABYLON;
                         var verticesCount = subMeshesData[(i * 5) + 2];
                         var indexStart = subMeshesData[(i * 5) + 3];
                         var indexCount = subMeshesData[(i * 5) + 4];
-                        var subMesh = new BABYLON.SubMesh(materialIndex, verticesStart, verticesCount, indexStart, indexCount, mesh);
+                        BABYLON.SubMesh.AddToMesh(materialIndex, verticesStart, verticesCount, indexStart, indexCount, mesh);
                     }
                 }
             }
@@ -30006,7 +29998,7 @@ var BABYLON;
                 mesh.subMeshes = [];
                 for (var subIndex = 0; subIndex < parsedGeometry.subMeshes.length; subIndex++) {
                     var parsedSubMesh = parsedGeometry.subMeshes[subIndex];
-                    var subMesh = new BABYLON.SubMesh(parsedSubMesh.materialIndex, parsedSubMesh.verticesStart, parsedSubMesh.verticesCount, parsedSubMesh.indexStart, parsedSubMesh.indexCount, mesh);
+                    BABYLON.SubMesh.AddToMesh(parsedSubMesh.materialIndex, parsedSubMesh.verticesStart, parsedSubMesh.verticesCount, parsedSubMesh.indexStart, parsedSubMesh.indexCount, mesh);
                 }
             }
             // Flat shading
@@ -31425,8 +31417,6 @@ var BABYLON;
          */
         ColorGradingTexture.prototype.load3dlTexture = function () {
             var _this = this;
-            var mipLevels = 0;
-            var floatArrayView = null;
             var texture = this.getScene().getEngine().createRawTexture(null, 1, 1, BABYLON.Engine.TEXTUREFORMAT_RGBA, false, false, BABYLON.Texture.BILINEAR_SAMPLINGMODE);
             this._texture = texture;
             var callback = function (text) {
@@ -32922,10 +32912,10 @@ var BABYLON;
                             this._uniformBuffer.updateFloat3("vBumpInfos", this._bumpTexture.coordinatesIndex, 1.0 / this._bumpTexture.level, this.parallaxScaleBias);
                             BABYLON.MaterialHelper.BindTextureMatrix(this._bumpTexture, this._uniformBuffer, "bump");
                             if (scene._mirroredCameraPosition) {
-                                this._uniformBuffer.updateFloat2("vTangentSpaceParams", this.invertNormalMapX ? 1.0 : -1.0, this.invertNormalMapY ? 1.0 : -1.0);
+                                this._uniformBuffer.updateFloat2("vTangentSpaceParams", this._invertNormalMapX ? 1.0 : -1.0, this._invertNormalMapY ? 1.0 : -1.0);
                             }
                             else {
-                                this._uniformBuffer.updateFloat2("vTangentSpaceParams", this.invertNormalMapX ? -1.0 : 1.0, this.invertNormalMapY ? -1.0 : 1.0);
+                                this._uniformBuffer.updateFloat2("vTangentSpaceParams", this._invertNormalMapX ? -1.0 : 1.0, this._invertNormalMapY ? -1.0 : 1.0);
                             }
                         }
                         if (this._refractionTexture && StandardMaterial.RefractionTextureEnabled) {
@@ -33857,9 +33847,7 @@ var BABYLON;
              */
             _this._forceNormalForward = false;
             _this._renderTargets = new BABYLON.SmartArray(16);
-            _this._worldViewProjectionMatrix = BABYLON.Matrix.Zero();
             _this._globalAmbientColor = new BABYLON.Color3(0, 0, 0);
-            _this._tempColor = new BABYLON.Color3();
             // Setup the default processing configuration to the scene.
             _this._attachImageProcessingConfiguration(null);
             _this.getRenderTargetTextures = function () {
@@ -33935,6 +33923,7 @@ var BABYLON;
             return this._albedoTexture;
         };
         PBRBaseMaterial.prototype.isReadyForSubMesh = function (mesh, subMesh, useInstances) {
+            var _this = this;
             if (this.isFrozen) {
                 if (this._wasPreviouslyReady) {
                     return true;
@@ -34299,11 +34288,11 @@ var BABYLON;
                     maxSimultaneousLights: this._maxSimultaneousLights
                 });
                 var onCompiled = function (effect) {
-                    if (this.onCompiled) {
-                        this.onCompiled(effect);
+                    if (_this.onCompiled) {
+                        _this.onCompiled(effect);
                     }
-                    this.bindSceneUniformBuffer(effect, scene.getSceneUniformBuffer());
-                }.bind(this);
+                    _this.bindSceneUniformBuffer(effect, scene.getSceneUniformBuffer());
+                };
                 var join = defines.toString();
                 subMesh.setEffect(scene.getEngine().createEffect("pbr", {
                     attributes: attribs,
@@ -35877,7 +35866,6 @@ var BABYLON;
             this.attachedElement = element;
             this.noPreventDefault = noPreventDefault;
             for (var cam in this.attached) {
-                var input = this.attached[cam];
                 this.attached[cam].attachControl(element, noPreventDefault);
             }
         };
@@ -35887,7 +35875,6 @@ var BABYLON;
                 return;
             }
             for (var cam in this.attached) {
-                var input = this.attached[cam];
                 this.attached[cam].detachControl(element);
                 if (disconnect) {
                     this.attached[cam].camera = null;
@@ -36586,7 +36573,6 @@ var BABYLON;
                 var updatePosition = function (newPos) {
                     _this._newPosition.copyFrom(newPos);
                     _this._newPosition.subtractToRef(_this._oldPosition, _this._diffPosition);
-                    var oldPosition = _this.position.clone();
                     if (_this._diffPosition.length() > BABYLON.Engine.CollisionsEpsilon) {
                         _this.position.addInPlace(_this._diffPosition);
                         if (_this.onCollide && collidedMesh) {
@@ -36987,7 +36973,6 @@ var BABYLON;
 
 var BABYLON;
 (function (BABYLON) {
-    var eventPrefix = BABYLON.Tools.GetPointerPrefix();
     var ArcRotateCameraPointersInput = (function () {
         function ArcRotateCameraPointersInput() {
             this.buttons = [0, 1, 2];
@@ -38895,11 +38880,6 @@ var BABYLON;
             return this;
         };
         // used by animation engine
-        PathCursor.prototype.markAsDirty = function (propertyName) {
-            this.ensureLimits();
-            this.raiseOnChange();
-            return this;
-        };
         PathCursor.prototype.raiseOnChange = function () {
             var _this = this;
             this._onchange.forEach(function (f) { return f(_this); });
@@ -41735,7 +41715,6 @@ var BABYLON;
             this._toIndex = 0;
             this._delay = 0;
             this._direction = 1;
-            this._frameCount = 0;
             this._time = 0;
             this._manager = manager;
             this._manager.sprites.push(this);
@@ -43611,8 +43590,6 @@ var BABYLON;
             this._cam_axisZ = BABYLON.Vector3.Zero();
             this._cam_axisY = BABYLON.Vector3.Zero();
             this._cam_axisX = BABYLON.Vector3.Zero();
-            this._axisX = BABYLON.Axis.X;
-            this._axisY = BABYLON.Axis.Y;
             this._axisZ = BABYLON.Axis.Z;
             this._camDir = BABYLON.Vector3.Zero();
             this._rotMatrix = new BABYLON.Matrix();
@@ -43740,7 +43717,6 @@ var BABYLON;
             var facetUV = []; // submesh UV
             var facetCol = []; // submesh colors
             var barycenter = BABYLON.Tmp.Vector3[0];
-            var rand;
             var sizeO = size;
             while (f < totalFacets) {
                 size = sizeO + Math.floor((1 + delta) * Math.random());
@@ -44563,7 +44539,6 @@ var BABYLON;
         function GroundMesh(name, scene) {
             var _this = _super.call(this, name, scene) || this;
             _this.generateOctree = false;
-            _this._worldInverse = new BABYLON.Matrix();
             return _this;
         }
         GroundMesh.prototype.getClassName = function () {
@@ -44674,8 +44649,6 @@ var BABYLON;
         // Returns the element "facet" from the heightQuads array relative to (x, z) local coordinates
         GroundMesh.prototype._getFacetAt = function (x, z) {
             // retrieve col and row from x, z coordinates in the ground local system
-            var subdivisionsX = this._subdivisionsX;
-            var subdivisionsY = this._subdivisionsY;
             var col = Math.floor((x + this._maxX) * this._subdivisionsX / this._width);
             var row = Math.floor(-(z + this._maxZ) * this._subdivisionsY / this._height + this._subdivisionsY);
             var quad = this._heightQuads[row * this._subdivisionsX + col];
@@ -45823,7 +45796,6 @@ var BABYLON;
             var pathArray = options.pathArray;
             var closeArray = options.closeArray;
             var closePath = options.closePath;
-            var offset = options.offset;
             var sideOrientation = MeshBuilder.updateSideOrientation(options.sideOrientation, scene);
             var instance = options.instance;
             var updatable = options.updatable;
@@ -49399,9 +49371,6 @@ var BABYLON;
                 if (this._shareOutputWithPostProcess) {
                     return this._shareOutputWithPostProcess.aspectRatio;
                 }
-                if (this._forcedOutputTexture) {
-                    var size = this._forcedOutputTexture.width / this._forcedOutputTexture.height;
-                }
                 return this.width / this.height;
             },
             enumerable: true,
@@ -49534,10 +49503,8 @@ var BABYLON;
             this._viewMatrix = BABYLON.Matrix.Zero();
             this._projectionMatrix = BABYLON.Matrix.Zero();
             this._transformMatrix = BABYLON.Matrix.Zero();
-            this._worldViewProjection = BABYLON.Matrix.Zero();
             this._currentFaceIndex = 0;
             this._currentFaceIndexCache = 0;
-            this._isCube = false;
             this._defaultTextureMatrix = BABYLON.Matrix.Identity();
             this._mapSize = mapSize;
             this._light = light;
@@ -50043,8 +50010,6 @@ var BABYLON;
          */
         ShadowGenerator.prototype.forceCompilation = function (onCompiled, options) {
             var _this = this;
-            var scene = this._scene;
-            var engine = scene.getEngine();
             var subMeshes = new Array();
             var currentIndex = 0;
             for (var _i = 0, _a = this.getShadowMap().renderList; _i < _a.length; _i++) {
@@ -51164,7 +51129,7 @@ var BABYLON;
                     if (parsedData.morphTargetManagers !== undefined && parsedData.morphTargetManagers !== null) {
                         for (var _i = 0, _a = parsedData.morphTargetManagers; _i < _a.length; _i++) {
                             var managerData = _a[_i];
-                            var parsedManager = BABYLON.MorphTargetManager.Parse(managerData, scene);
+                            BABYLON.MorphTargetManager.Parse(managerData, scene);
                         }
                     }
                     // Skeletons
@@ -51298,7 +51263,7 @@ var BABYLON;
                                 }
                             }
                             else {
-                                var emptySound = new BABYLON.Sound(parsedSound.name, null, scene);
+                                new BABYLON.Sound(parsedSound.name, null, scene);
                             }
                         }
                     }
@@ -51529,7 +51494,6 @@ var BABYLON;
                 for (var i = 0; i < this._filesToLoad.length; i++) {
                     var fileToLoad = this._filesToLoad[i];
                     var name_1 = fileToLoad.name.toLowerCase();
-                    var type = fileToLoad.type;
                     var entry = void 0;
                     fileToLoad.correctName = name_1;
                     if (items) {
@@ -52106,9 +52070,9 @@ var BABYLON;
                     request.onupgradeneeded = function (event) {
                         _this.db = (event.target).result;
                         try {
-                            var scenesStore = _this.db.createObjectStore("scenes", { keyPath: "sceneUrl" });
-                            var versionsStore = _this.db.createObjectStore("versions", { keyPath: "sceneUrl" });
-                            var texturesStore = _this.db.createObjectStore("textures", { keyPath: "textureUrl" });
+                            _this.db.createObjectStore("scenes", { keyPath: "sceneUrl" });
+                            _this.db.createObjectStore("versions", { keyPath: "sceneUrl" });
+                            _this.db.createObjectStore("textures", { keyPath: "textureUrl" });
                         }
                         catch (ex) {
                             BABYLON.Tools.Error("Error while creating object stores. Exception: " + ex.message);
@@ -55239,7 +55203,6 @@ var BABYLON;
 (function (BABYLON) {
     var PostProcessRenderPass = (function () {
         function PostProcessRenderPass(scene, name, size, renderList, beforeRender, afterRender) {
-            this._enabled = true;
             this._refCount = 0;
             this._name = name;
             this._renderTexture = new BABYLON.RenderTargetTexture(name, size, scene);
@@ -55602,10 +55565,6 @@ var BABYLON;
         function DepthRenderer(scene, type) {
             if (type === void 0) { type = BABYLON.Engine.TEXTURETYPE_FLOAT; }
             var _this = this;
-            this._viewMatrix = BABYLON.Matrix.Zero();
-            this._projectionMatrix = BABYLON.Matrix.Zero();
-            this._transformMatrix = BABYLON.Matrix.Zero();
-            this._worldViewProjection = BABYLON.Matrix.Zero();
             this._scene = scene;
             var engine = scene.getEngine();
             // Render target
@@ -55677,7 +55636,6 @@ var BABYLON;
             var defines = [];
             var attribs = [BABYLON.VertexBuffer.PositionKind];
             var mesh = subMesh.getMesh();
-            var scene = mesh.getScene();
             // Alpha test
             if (material && material.needAlphaTesting()) {
                 defines.push("#define ALPHATEST");
@@ -55866,7 +55824,6 @@ var BABYLON;
                 2.0, 4.0, 6.0, 8.0
             ];
             */
-            var samples = 16;
             var samplerOffsets = new Array();
             for (var i = -8; i < 8; i++) {
                 samplerOffsets.push(i * 2);
@@ -55919,7 +55876,6 @@ var BABYLON;
                 "sampleSphere", "samplesFactor", "randTextureTiles", "totalStrength", "radius",
                 "area", "fallOff", "base", "range", "viewport"
             ], ["randomSampler"], ratio, null, BABYLON.Texture.BILINEAR_SAMPLINGMODE, this._scene.getEngine(), false, "#define SAMPLES " + numSamples + "\n#define SSAO");
-            var viewport = new BABYLON.Vector2(0, 0);
             this._ssaoPostProcess.onApply = function (effect) {
                 if (_this._firstUpdate) {
                     effect.setArray3("sampleSphere", sampleSphere);
@@ -56162,7 +56118,6 @@ var BABYLON;
         // Private Methods
         SSAO2RenderingPipeline.prototype._createBlurPostProcess = function (ssaoRatio, blurRatio) {
             var _this = this;
-            var samples = 16;
             this._samplerOffsets = [];
             var expensive = this.expensiveBlur;
             for (var i = -8; i < 8; i++) {
@@ -56204,7 +56159,6 @@ var BABYLON;
                 return Math.random() * (max - min) + min;
             };
             var i = 0;
-            var normal = new BABYLON.Vector3(0, 0, 1);
             while (i < numSamples) {
                 vector = new BABYLON.Vector3(rand(-1.0, 1.0), rand(-1.0, 1.0), rand(0.30, 1.0));
                 vector.normalize();
@@ -57651,10 +57605,6 @@ var BABYLON;
     var GeometryBufferRenderer = (function () {
         function GeometryBufferRenderer(scene, ratio) {
             if (ratio === void 0) { ratio = 1; }
-            this._viewMatrix = BABYLON.Matrix.Zero();
-            this._projectionMatrix = BABYLON.Matrix.Zero();
-            this._transformMatrix = BABYLON.Matrix.Zero();
-            this._worldViewProjection = BABYLON.Matrix.Zero();
             this._enablePosition = false;
             this._scene = scene;
             this._ratio = ratio;
@@ -57695,7 +57645,6 @@ var BABYLON;
             var defines = [];
             var attribs = [BABYLON.VertexBuffer.PositionKind, BABYLON.VertexBuffer.NormalKind];
             var mesh = subMesh.getMesh();
-            var scene = mesh.getScene();
             // Alpha test
             if (material && material.needAlphaTesting()) {
                 defines.push("#define ALPHATEST");
@@ -58041,7 +57990,6 @@ var BABYLON;
             var defines = [];
             var attribs = [BABYLON.VertexBuffer.PositionKind];
             var material = subMesh.getMaterial();
-            var needUV = false;
             // Alpha test
             if (material) {
                 if (material.needAlphaTesting()) {
@@ -63113,9 +63061,6 @@ var BABYLON;
             csg.copyTransformAttributes(this);
             return csg;
         };
-        CSG.prototype.toPolygons = function () {
-            return this.polygons;
-        };
         CSG.prototype.union = function (csg) {
             var a = new Node(this.clone().polygons);
             var b = new Node(csg.clone().polygons);
@@ -63317,19 +63262,23 @@ var BABYLON;
             this.size = size;
             this.position = position;
             this.alphaMode = BABYLON.Engine.ALPHA_ONEONE;
-            this.dispose = function () {
-                if (this.texture) {
-                    this.texture.dispose();
-                }
-                // Remove from scene
-                var index = this._system.lensFlares.indexOf(this);
-                this._system.lensFlares.splice(index, 1);
-            };
             this.color = color || new BABYLON.Color3(1, 1, 1);
             this.texture = imgUrl ? new BABYLON.Texture(imgUrl, system.getScene(), true) : null;
             this._system = system;
             system.lensFlares.push(this);
         }
+        LensFlare.AddFlare = function (size, position, color, imgUrl, system) {
+            return new LensFlare(size, position, color, imgUrl, system);
+        };
+        LensFlare.prototype.dispose = function () {
+            if (this.texture) {
+                this.texture.dispose();
+            }
+            // Remove from scene
+            var index = this._system.lensFlares.indexOf(this);
+            this._system.lensFlares.splice(index, 1);
+        };
+        ;
         return LensFlare;
     }());
     BABYLON.LensFlare = LensFlare;
@@ -63546,7 +63495,7 @@ var BABYLON;
             lensFlareSystem.borderLimit = parsedLensFlareSystem.borderLimit;
             for (var index = 0; index < parsedLensFlareSystem.flares.length; index++) {
                 var parsedFlare = parsedLensFlareSystem.flares[index];
-                var flare = new BABYLON.LensFlare(parsedFlare.size, parsedFlare.position, BABYLON.Color3.FromArray(parsedFlare.color), parsedFlare.textureName ? rootUrl + parsedFlare.textureName : "", lensFlareSystem);
+                BABYLON.LensFlare.AddFlare(parsedFlare.size, parsedFlare.position, BABYLON.Color3.FromArray(parsedFlare.color), parsedFlare.textureName ? rootUrl + parsedFlare.textureName : "", lensFlareSystem);
             }
             return lensFlareSystem;
         };
@@ -64427,14 +64376,11 @@ var BABYLON;
             this._physicsMaterials = new Array();
             this._fixedTimeStep = 1 / 60;
             //See https://github.com/schteppe/CANNON.js/blob/gh-pages/demos/collisionFilter.html
-            this._currentCollisionGroup = 2;
             this.BJSCANNON = typeof CANNON !== 'undefined' ? CANNON : (typeof require !== 'undefined' ? require('cannon') : undefined);
             this._minus90X = new BABYLON.Quaternion(-0.7071067811865475, 0, 0, 0.7071067811865475);
             this._plus90X = new BABYLON.Quaternion(0.7071067811865475, 0, 0, 0.7071067811865475);
             this._tmpPosition = BABYLON.Vector3.Zero();
-            this._tmpQuaternion = new BABYLON.Quaternion();
             this._tmpDeltaPosition = BABYLON.Vector3.Zero();
-            this._tmpDeltaRotation = new BABYLON.Quaternion();
             this._tmpUnityRotation = new BABYLON.Quaternion();
             if (!this.isSupported()) {
                 BABYLON.Tools.Error("CannonJS is not available. Please make sure you included the js file.");
@@ -64823,16 +64769,16 @@ var BABYLON;
         CannonJSPlugin.prototype.updateDistanceJoint = function (joint, maxDistance, minDistance) {
             joint.physicsJoint.distance = maxDistance;
         };
-        CannonJSPlugin.prototype.enableMotor = function (joint, motorIndex) {
-            if (!motorIndex) {
-                joint.physicsJoint.enableMotor();
-            }
-        };
-        CannonJSPlugin.prototype.disableMotor = function (joint, motorIndex) {
-            if (!motorIndex) {
-                joint.physicsJoint.disableMotor();
-            }
-        };
+        // private enableMotor(joint: IMotorEnabledJoint, motorIndex?: number) {
+        //     if (!motorIndex) {
+        //         joint.physicsJoint.enableMotor();
+        //     }
+        // }
+        // private disableMotor(joint: IMotorEnabledJoint, motorIndex?: number) {
+        //     if (!motorIndex) {
+        //         joint.physicsJoint.disableMotor();
+        //     }
+        // }
         CannonJSPlugin.prototype.setMotor = function (joint, speed, maxForce, motorIndex) {
             if (!motorIndex) {
                 joint.physicsJoint.enableMotor();
@@ -65324,7 +65270,7 @@ var BABYLON;
                         break;
                 }
                 var pixel_data;
-                var numAlphaBits = header.flags & 0xf;
+                // var numAlphaBits = header.flags & 0xf;
                 var pixel_size = header.pixel_size >> 3;
                 var pixel_total = header.width * header.height * pixel_size;
                 // Read palettes
@@ -65500,7 +65446,7 @@ var BABYLON;
                 }
                 return imageData;
             };
-            TGATools._TYPE_NO_DATA = 0;
+            //private static _TYPE_NO_DATA = 0;
             TGATools._TYPE_INDEXED = 1;
             TGATools._TYPE_RGB = 2;
             TGATools._TYPE_GREY = 3;
@@ -65529,10 +65475,32 @@ var BABYLON;
         // All values and structures referenced from:
         // http://msdn.microsoft.com/en-us/library/bb943991.aspx/
         var DDS_MAGIC = 0x20534444;
-        var DDSD_CAPS = 0x1, DDSD_HEIGHT = 0x2, DDSD_WIDTH = 0x4, DDSD_PITCH = 0x8, DDSD_PIXELFORMAT = 0x1000, DDSD_MIPMAPCOUNT = 0x20000, DDSD_LINEARSIZE = 0x80000, DDSD_DEPTH = 0x800000;
-        var DDSCAPS_COMPLEX = 0x8, DDSCAPS_MIPMAP = 0x400000, DDSCAPS_TEXTURE = 0x1000;
-        var DDSCAPS2_CUBEMAP = 0x200, DDSCAPS2_CUBEMAP_POSITIVEX = 0x400, DDSCAPS2_CUBEMAP_NEGATIVEX = 0x800, DDSCAPS2_CUBEMAP_POSITIVEY = 0x1000, DDSCAPS2_CUBEMAP_NEGATIVEY = 0x2000, DDSCAPS2_CUBEMAP_POSITIVEZ = 0x4000, DDSCAPS2_CUBEMAP_NEGATIVEZ = 0x8000, DDSCAPS2_VOLUME = 0x200000;
-        var DDPF_ALPHAPIXELS = 0x1, DDPF_ALPHA = 0x2, DDPF_FOURCC = 0x4, DDPF_RGB = 0x40, DDPF_YUV = 0x200, DDPF_LUMINANCE = 0x20000;
+        var 
+        //DDSD_CAPS = 0x1,
+        //DDSD_HEIGHT = 0x2,
+        //DDSD_WIDTH = 0x4,
+        //DDSD_PITCH = 0x8,
+        //DDSD_PIXELFORMAT = 0x1000,
+        DDSD_MIPMAPCOUNT = 0x20000;
+        //DDSD_LINEARSIZE = 0x80000,
+        //DDSD_DEPTH = 0x800000;
+        // var DDSCAPS_COMPLEX = 0x8,
+        //     DDSCAPS_MIPMAP = 0x400000,
+        //     DDSCAPS_TEXTURE = 0x1000;
+        var DDSCAPS2_CUBEMAP = 0x200;
+        // DDSCAPS2_CUBEMAP_POSITIVEX = 0x400,
+        // DDSCAPS2_CUBEMAP_NEGATIVEX = 0x800,
+        // DDSCAPS2_CUBEMAP_POSITIVEY = 0x1000,
+        // DDSCAPS2_CUBEMAP_NEGATIVEY = 0x2000,
+        // DDSCAPS2_CUBEMAP_POSITIVEZ = 0x4000,
+        // DDSCAPS2_CUBEMAP_NEGATIVEZ = 0x8000,
+        // DDSCAPS2_VOLUME = 0x200000;
+        var 
+        //DDPF_ALPHAPIXELS = 0x1,
+        //DDPF_ALPHA = 0x2,
+        DDPF_FOURCC = 0x4, DDPF_RGB = 0x40, 
+        //DDPF_YUV = 0x200,
+        DDPF_LUMINANCE = 0x20000;
         function FourCCToInt32(value) {
             return value.charCodeAt(0) +
                 (value.charCodeAt(1) << 8) +
@@ -65561,14 +65529,14 @@ var BABYLON;
         var off_pfFlags = 20;
         var off_pfFourCC = 21;
         var off_RGBbpp = 22;
-        var off_RMask = 23;
-        var off_GMask = 24;
-        var off_BMask = 25;
-        var off_AMask = 26;
-        var off_caps1 = 27;
+        // var off_RMask = 23;
+        // var off_GMask = 24;
+        // var off_BMask = 25;
+        // var off_AMask = 26;
+        // var off_caps1 = 27;
         var off_caps2 = 28;
-        var off_caps3 = 29;
-        var off_caps4 = 30;
+        // var off_caps3 = 29;
+        // var off_caps4 = 30;
         var off_dxgiFormat = 32;
         ;
         var DDSTools = (function () {
@@ -66899,8 +66867,6 @@ var BABYLON;
                 return this._debugSphereMesh.createInstance('physicsBodyBoxViewInstance');
             };
             PhysicsViewer.prototype._getDebugMesh = function (impostor, scene) {
-                var body = impostor.physicsBody;
-                var shape = body.shapes[0];
                 var mesh;
                 if (impostor.type == BABYLON.PhysicsImpostor.BoxImpostor) {
                     mesh = this._getDebugBoxMesh(scene);
@@ -67294,9 +67260,6 @@ var BABYLON;
             }
             return serializationObject;
         };
-        MorphTargetManager.prototype._onInfluenceChanged = function (needUpdate) {
-            this._syncActiveTargets(needUpdate);
-        };
         MorphTargetManager.prototype._syncActiveTargets = function (needUpdate) {
             var influenceCount = 0;
             this._activeTargets.reset();
@@ -67980,7 +67943,6 @@ var BABYLON;
             window.addEventListener("deviceorientation", this._deviceOrientationHandler);
         };
         ArcRotateCameraVRDeviceOrientationInput.prototype._onOrientationEvent = function (evt) {
-            var camera = this.camera;
             this._alpha = +evt.alpha | 0;
             this._beta = +evt.beta | 0;
             this._gamma = +evt.gamma | 0;
@@ -68101,7 +68063,6 @@ var BABYLON;
             _this.rawPose = null;
             _this._specsVersion = "1.1";
             _this._attached = false;
-            _this._positionOffset = BABYLON.Vector3.Zero();
             _this._descendants = [];
             _this.devicePosition = BABYLON.Vector3.Zero();
             _this.deviceScaleFactor = 1;
@@ -69120,14 +69081,6 @@ var BABYLON;
                     break;
             }
         };
-        VirtualJoystick.prototype._clearCanvas = function () {
-            if (this._leftJoystick) {
-                VirtualJoystick.vjCanvasContext.clearRect(0, 0, VirtualJoystick.vjCanvasWidth / 2, VirtualJoystick.vjCanvasHeight);
-            }
-            else {
-                VirtualJoystick.vjCanvasContext.clearRect(VirtualJoystick.vjCanvasWidth / 2, 0, VirtualJoystick.vjCanvasWidth, VirtualJoystick.vjCanvasHeight);
-            }
-        };
         VirtualJoystick.prototype._drawVirtualJoystick = function () {
             var _this = this;
             if (this.pressed) {
@@ -69471,29 +69424,6 @@ var BABYLON;
                 }, 0);
             });
         };
-        QuadraticErrorSimplification.prototype.isTriangleOnBoundingBox = function (triangle) {
-            var _this = this;
-            var gCount = 0;
-            triangle.vertices.forEach(function (vertex) {
-                var count = 0;
-                var vPos = vertex.position;
-                var bbox = _this._mesh.getBoundingInfo().boundingBox;
-                if (bbox.maximum.x - vPos.x < _this.boundingBoxEpsilon || vPos.x - bbox.minimum.x > _this.boundingBoxEpsilon)
-                    ++count;
-                if (bbox.maximum.y === vPos.y || vPos.y === bbox.minimum.y)
-                    ++count;
-                if (bbox.maximum.z === vPos.z || vPos.z === bbox.minimum.z)
-                    ++count;
-                if (count > 1) {
-                    ++gCount;
-                }
-                ;
-            });
-            if (gCount > 1) {
-                console.log(triangle, gCount);
-            }
-            return gCount > 1;
-        };
         QuadraticErrorSimplification.prototype.runDecimation = function (settings, submeshIndex, successCallback) {
             var _this = this;
             var targetCount = ~~(this.triangles.length * settings.quality);
@@ -69737,9 +69667,9 @@ var BABYLON;
             if (submeshIndex > 0) {
                 this._reconstructedMesh.subMeshes = [];
                 submeshesArray.forEach(function (submesh) {
-                    new BABYLON.SubMesh(submesh.materialIndex, submesh.verticesStart, submesh.verticesCount, /* 0, newPositionData.length/3, */ submesh.indexStart, submesh.indexCount, submesh.getMesh());
+                    BABYLON.SubMesh.AddToMesh(submesh.materialIndex, submesh.verticesStart, submesh.verticesCount, /* 0, newPositionData.length/3, */ submesh.indexStart, submesh.indexCount, submesh.getMesh());
                 });
-                var newSubmesh = new BABYLON.SubMesh(originalSubmesh.materialIndex, startingVertex, vertexCount, /* 0, newPositionData.length / 3, */ startingIndex, newTriangles.length * 3, this._reconstructedMesh);
+                BABYLON.SubMesh.AddToMesh(originalSubmesh.materialIndex, startingVertex, vertexCount, /* 0, newPositionData.length / 3, */ startingIndex, newTriangles.length * 3, this._reconstructedMesh);
             }
         };
         QuadraticErrorSimplification.prototype.initDecimatedMesh = function () {
@@ -72670,12 +72600,10 @@ var BABYLON;
             this._zoomStopsAnimation = false;
             this._framingTime = 1500;
             this._isPointerDown = false;
-            this._lastFrameTime = null;
             this._lastInteractionTime = -Infinity;
             // Framing control
             this._animatables = new Array();
             this._betaIsAnimating = false;
-            this._lastFrameRadius = 0;
         }
         Object.defineProperty(FramingBehavior.prototype, "name", {
             get: function () {
@@ -72897,7 +72825,6 @@ var BABYLON;
             this._animatables.push(BABYLON.Animation.TransitionTo("target", zoomTarget, this._attachedCamera, this._attachedCamera.getScene(), 60, this._vectorTransition, this._framingTime));
             // sets the radius and lower radius bounds
             // Small delta ensures camera is not always at lower zoom limit.
-            var delta = 0.1;
             var radius = 0;
             if (this._mode === FramingBehavior.FitFrustumSidesMode) {
                 var position = this._calculateLowerRadiusFromModelBoundingSphere(minimumWorld, maximumWorld);
@@ -73483,10 +73410,6 @@ var BABYLON;
             return this._options.renderHeight;
         };
         NullEngine.prototype.setViewport = function (viewport, requiredWidth, requiredHeight) {
-            var width = requiredWidth || this.getRenderWidth();
-            var height = requiredHeight || this.getRenderHeight();
-            var x = viewport.x || 0;
-            var y = viewport.y || 0;
             this._cachedViewport = viewport;
         };
         NullEngine.prototype.createShaderProgram = function (vertexCode, fragmentCode, defines, context) {

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 1746 - 1793
dist/preview release/babylon.module.d.ts


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 42 - 42
dist/preview release/babylon.worker.js


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 1697 - 1746
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.d.ts


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 45 - 45
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.js


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 126 - 253
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.max.js


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 1697 - 1746
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.module.d.ts


+ 0 - 4
dist/preview release/gui/babylon.gui.d.ts

@@ -139,7 +139,6 @@ declare module BABYLON.GUI {
         private _font;
         _width: ValueAndUnit;
         _height: ValueAndUnit;
-        private _lastMeasuredFont;
         protected _fontOffset: {
             ascent: number;
             height: number;
@@ -395,7 +394,6 @@ declare module BABYLON.GUI {
     class Line extends Control {
         name: string;
         private _lineWidth;
-        private _background;
         private _x1;
         private _y1;
         private _x2;
@@ -501,12 +499,10 @@ declare module BABYLON.GUI {
     class TextBlock extends Control {
         name: string;
         private _text;
-        private _textY;
         private _textWrapping;
         private _textHorizontalAlignment;
         private _textVerticalAlignment;
         private _lines;
-        private _totalHeight;
         private _resizeToFit;
         /**
         * An event triggered after the text is changed

+ 0 - 3
dist/preview release/gui/babylon.gui.js

@@ -262,7 +262,6 @@ var BABYLON;
                 this.update();
             };
             AdvancedDynamicTexture.prototype._render = function () {
-                var engine = this.getScene().getEngine();
                 var textureSize = this.getSize();
                 var renderWidth = textureSize.width;
                 var renderHeight = textureSize.height;
@@ -1284,7 +1283,6 @@ var BABYLON;
                 }
                 this.horizontalAlignment = BABYLON.GUI.Control.HORIZONTAL_ALIGNMENT_LEFT;
                 this.verticalAlignment = BABYLON.GUI.Control.VERTICAL_ALIGNMENT_TOP;
-                var engine = scene.getEngine();
                 var globalViewport = this._host._getGlobalViewport(scene);
                 var projectedPosition = BABYLON.Vector3.Project(position, BABYLON.Matrix.Identity(), scene.getTransformMatrix(), globalViewport);
                 this._moveToProjectedPosition(projectedPosition);
@@ -3096,7 +3094,6 @@ var BABYLON;
                 return { text: line, width: lineWidth };
             };
             TextBlock.prototype._renderLines = function (context) {
-                var width = this._currentMeasure.width;
                 var height = this._currentMeasure.height;
                 if (!this._fontOffset) {
                     this._fontOffset = GUI.Control._GetFontOffset(context.font);

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 3 - 3
dist/preview release/gui/babylon.gui.min.js


+ 0 - 4
dist/preview release/gui/babylon.gui.module.d.ts

@@ -144,7 +144,6 @@ declare module BABYLON.GUI {
         private _font;
         _width: ValueAndUnit;
         _height: ValueAndUnit;
-        private _lastMeasuredFont;
         protected _fontOffset: {
             ascent: number;
             height: number;
@@ -400,7 +399,6 @@ declare module BABYLON.GUI {
     class Line extends Control {
         name: string;
         private _lineWidth;
-        private _background;
         private _x1;
         private _y1;
         private _x2;
@@ -506,12 +504,10 @@ declare module BABYLON.GUI {
     class TextBlock extends Control {
         name: string;
         private _text;
-        private _textY;
         private _textWrapping;
         private _textHorizontalAlignment;
         private _textVerticalAlignment;
         private _lines;
-        private _totalHeight;
         private _resizeToFit;
         /**
         * An event triggered after the text is changed

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 4 - 4
dist/preview release/inspector/babylon.inspector.bundle.js


+ 0 - 8
dist/preview release/inspector/babylon.inspector.d.ts

@@ -6,8 +6,6 @@ declare module INSPECTOR {
         /** The div containing the content of the active tab */
         private _tabPanel;
         /** The panel containing the list if items */
-        /** The list if tree items displayed in the tree panel. */
-        private _items;
         private _tabbar;
         private _scene;
         /** The HTML document relative to this inspector (the window or the popup depending on its mode) */
@@ -519,8 +517,6 @@ declare module INSPECTOR {
         private _onMouseDownHandler;
         private _onMouseDragHandler;
         private _onMouseUpHandler;
-        private _sliderfill;
-        private _slidertrack;
         private _textValue;
         /** Save previous Y mouse position */
         private _prevY;
@@ -578,10 +574,6 @@ declare module INSPECTOR {
          */
         update(): void;
         /**
-         * Returns true if the given instance is a simple type
-         */
-        private static _IS_TYPE_SIMPLE(inst);
-        /**
          * Returns true if the type of this property is simple, false otherwise.
          * Returns true if the value is null
          */

+ 2 - 14
dist/preview release/inspector/babylon.inspector.js

@@ -40,7 +40,6 @@ var INSPECTOR;
                 // Get canvas and its DOM parent
                 var canvas = this._scene.getEngine().getRenderingCanvas();
                 var canvasParent = canvas.parentElement;
-                var canvasParentComputedStyle = Inspector.WINDOW.getComputedStyle(canvasParent);
                 // get canvas style                
                 var canvasComputedStyle = Inspector.WINDOW.getComputedStyle(canvas);
                 this._canvasStyle = {
@@ -1288,7 +1287,6 @@ var INSPECTOR;
          */
         MeshAdapter.prototype._drawAxis = function () {
             this._obj.computeWorldMatrix();
-            var m = this._obj.getWorldMatrix();
             // Axis
             var x = new BABYLON.Vector3(8 / this._obj.scaling.x, 0, 0);
             var y = new BABYLON.Vector3(0, 8 / this._obj.scaling.y, 0);
@@ -1809,13 +1807,6 @@ var INSPECTOR;
             this._updateValue();
         };
         /**
-         * Returns true if the given instance is a simple type
-         */
-        PropertyLine._IS_TYPE_SIMPLE = function (inst) {
-            var type = INSPECTOR.Helpers.GET_TYPE(inst);
-            return PropertyLine._SIMPLE_TYPE.indexOf(type) != -1;
-        };
-        /**
          * Returns true if the type of this property is simple, false otherwise.
          * Returns true if the value is null
          */
@@ -1867,7 +1858,6 @@ var INSPECTOR;
                 if (this._children.length == 0) {
                     var objToDetail = this.value;
                     var propToDisplay = INSPECTOR.PROPERTIES[INSPECTOR.Helpers.GET_TYPE(objToDetail)].properties.slice().reverse();
-                    var propertyLine = null;
                     for (var _b = 0, propToDisplay_1 = propToDisplay; _b < propToDisplay_1.length; _b++) {
                         var prop = propToDisplay_1[_b];
                         var infos = new INSPECTOR.Property(prop, this._property.value);
@@ -2006,7 +1996,7 @@ var INSPECTOR;
                 var b = (color.b * 255) | 0;
                 var a = 1;
                 if (color instanceof BABYLON.Color4) {
-                    var a_1 = color.a;
+                    a = color.a;
                 }
                 return "rgba(" + r + ", " + g + ", " + b + ", " + a + ")";
             }
@@ -2076,7 +2066,7 @@ var INSPECTOR;
                 var b = (color.b * 255) | 0;
                 var a = 1;
                 if (color instanceof BABYLON.Color4) {
-                    var a_1 = color.a;
+                    a = color.a;
                 }
                 return "rgba(" + r + ", " + g + ", " + b + ", " + a + ")";
             }
@@ -2167,8 +2157,6 @@ var INSPECTOR;
             this._engine = new BABYLON.Engine(this._canvas);
             this._scene = new BABYLON.Scene(this._engine);
             this._scene.clearColor = new BABYLON.Color4(0, 0, 0, 0);
-            var cam = new BABYLON.FreeCamera('cam', new BABYLON.Vector3(0, 0, -20), this._scene);
-            var light = new BABYLON.HemisphericLight('', new BABYLON.Vector3(0, 1, 0), this._scene);
             this._engine.runRenderLoop(function () {
                 if (!_this._pause) {
                     _this._scene.render();

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 4 - 4
dist/preview release/inspector/babylon.inspector.min.js


+ 2 - 55
dist/preview release/loaders/babylon.glTF1FileLoader.js

@@ -441,12 +441,6 @@ var BABYLON;
                 buffer[i * 2 + 1] = 1.0 - buffer[i * 2 + 1];
             }
         };
-        var replaceInString = function (str, searchValue, replaceValue) {
-            while (str.indexOf(searchValue) !== -1) {
-                str = str.replace(searchValue, replaceValue);
-            }
-            return str;
-        };
         var getAttribute = function (attributeParameter) {
             if (attributeParameter.semantic === "NORMAL") {
                 return "normal";
@@ -470,16 +464,6 @@ var BABYLON;
             return null;
         };
         /**
-        * Returns the animation path (glTF -> Babylon)
-        */
-        var getAnimationPath = function (path) {
-            var index = glTFAnimationPaths.indexOf(path);
-            if (index !== -1) {
-                return babylonAnimationPaths[index];
-            }
-            return path;
-        };
-        /**
         * Loads and creates animations
         */
         var loadAnimations = function (gltfRuntime) {
@@ -732,12 +716,6 @@ var BABYLON;
                 }
             }
         };
-        var printMat = function (m) {
-            console.log(m[0] + "\t" + m[1] + "\t" + m[2] + "\t" + m[3] + "\n" +
-                m[4] + "\t" + m[5] + "\t" + m[6] + "\t" + m[7] + "\n" +
-                m[8] + "\t" + m[9] + "\t" + m[10] + "\t" + m[11] + "\n" +
-                m[12] + "\t" + m[13] + "\t" + m[14] + "\t" + m[15] + "\n");
-        };
         /**
         * Imports a skeleton
         */
@@ -748,10 +726,6 @@ var BABYLON;
             if (!skins.babylonSkeleton) {
                 return newSkeleton;
             }
-            // Matrices
-            var accessor = gltfRuntime.accessors[skins.inverseBindMatrices];
-            var buffer = GLTF1.GLTFUtils.GetBufferFromAccessor(gltfRuntime, accessor);
-            var bindShapeMatrix = BABYLON.Matrix.FromArray(skins.bindShapeMatrix);
             // Find the root bones
             var nodesToRoot = [];
             var nodesToRootToAdd = [];
@@ -958,7 +932,7 @@ var BABYLON;
                     if (mesh.primitives[i].mode !== 4) {
                         //continue;
                     }
-                    var subMesh = new BABYLON.SubMesh(index, verticesStarts[index], verticesCounts[index], indexStarts[index], indexCounts[index], newMesh, newMesh, true);
+                    BABYLON.SubMesh.AddToMesh(index, verticesStarts[index], verticesCounts[index], indexStarts[index], indexCounts[index], newMesh, newMesh, true);
                     index++;
                 }
             }
@@ -1079,7 +1053,6 @@ var BABYLON;
                 var camera = gltfRuntime.cameras[node.camera];
                 if (camera) {
                     if (camera.type === "orthographic") {
-                        var orthographicCamera = camera[camera.type];
                         var orthoCamera = new BABYLON.FreeCamera(node.camera, BABYLON.Vector3.Zero(), gltfRuntime.scene);
                         orthoCamera.name = node.name;
                         orthoCamera.mode = BABYLON.Camera.ORTHOGRAPHIC_CAMERA;
@@ -1627,7 +1600,7 @@ var BABYLON;
             GLTFLoader.prototype.importMeshAsync = function (meshesNames, scene, data, rootUrl, onSuccess, onProgress, onError) {
                 var _this = this;
                 scene.useRightHandedSystem = true;
-                var gltfRuntime = GLTF1.GLTFLoaderExtension.LoadRuntimeAsync(scene, data, rootUrl, function (gltfRuntime) {
+                GLTF1.GLTFLoaderExtension.LoadRuntimeAsync(scene, data, rootUrl, function (gltfRuntime) {
                     gltfRuntime.importOnlyMeshes = true;
                     if (meshesNames === "") {
                         gltfRuntime.importMeshesNames = [];
@@ -2200,11 +2173,6 @@ var BABYLON;
     var GLTF1;
     (function (GLTF1) {
         var BinaryExtensionBufferName = "binary_glTF";
-        var EContentFormat;
-        (function (EContentFormat) {
-            EContentFormat[EContentFormat["JSON"] = 0] = "JSON";
-        })(EContentFormat || (EContentFormat = {}));
-        ;
         ;
         ;
         var GLTFBinaryExtension = (function (_super) {
@@ -2260,27 +2228,6 @@ var BABYLON;
             return GLTFBinaryExtension;
         }(GLTF1.GLTFLoaderExtension));
         GLTF1.GLTFBinaryExtension = GLTFBinaryExtension;
-        var BinaryReader = (function () {
-            function BinaryReader(arrayBuffer) {
-                this._arrayBuffer = arrayBuffer;
-                this._dataView = new DataView(arrayBuffer);
-                this._byteOffset = 0;
-            }
-            BinaryReader.prototype.getUint32 = function () {
-                var value = this._dataView.getUint32(this._byteOffset, true);
-                this._byteOffset += 4;
-                return value;
-            };
-            BinaryReader.prototype.getUint8Array = function (length) {
-                if (!length) {
-                    length = this._arrayBuffer.byteLength - this._byteOffset;
-                }
-                var value = new Uint8Array(this._arrayBuffer, this._byteOffset, length);
-                this._byteOffset += length;
-                return value;
-            };
-            return BinaryReader;
-        }());
         GLTF1.GLTFLoader.RegisterExtension(new GLTFBinaryExtension());
     })(GLTF1 = BABYLON.GLTF1 || (BABYLON.GLTF1 = {}));
 })(BABYLON || (BABYLON = {}));

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 2 - 2
dist/preview release/loaders/babylon.glTF1FileLoader.min.js


+ 1 - 1
dist/preview release/loaders/babylon.glTF2FileLoader.js

@@ -618,7 +618,7 @@ var BABYLON;
                             node.babylonMesh.subMeshes = [];
                             for (var index = 0; index < subMeshInfos.length; index++) {
                                 var info = subMeshInfos[index];
-                                new BABYLON.SubMesh(index, info.verticesStart, info.verticesCount, info.indicesStart, info.indicesCount, node.babylonMesh);
+                                BABYLON.SubMesh.AddToMesh(index, info.verticesStart, info.verticesCount, info.indicesStart, info.indicesCount, node.babylonMesh);
                                 info.loadMaterial(index);
                             }
                         }

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 1 - 1
dist/preview release/loaders/babylon.glTF2FileLoader.min.js


+ 3 - 56
dist/preview release/loaders/babylon.glTFFileLoader.js

@@ -441,12 +441,6 @@ var BABYLON;
                 buffer[i * 2 + 1] = 1.0 - buffer[i * 2 + 1];
             }
         };
-        var replaceInString = function (str, searchValue, replaceValue) {
-            while (str.indexOf(searchValue) !== -1) {
-                str = str.replace(searchValue, replaceValue);
-            }
-            return str;
-        };
         var getAttribute = function (attributeParameter) {
             if (attributeParameter.semantic === "NORMAL") {
                 return "normal";
@@ -470,16 +464,6 @@ var BABYLON;
             return null;
         };
         /**
-        * Returns the animation path (glTF -> Babylon)
-        */
-        var getAnimationPath = function (path) {
-            var index = glTFAnimationPaths.indexOf(path);
-            if (index !== -1) {
-                return babylonAnimationPaths[index];
-            }
-            return path;
-        };
-        /**
         * Loads and creates animations
         */
         var loadAnimations = function (gltfRuntime) {
@@ -732,12 +716,6 @@ var BABYLON;
                 }
             }
         };
-        var printMat = function (m) {
-            console.log(m[0] + "\t" + m[1] + "\t" + m[2] + "\t" + m[3] + "\n" +
-                m[4] + "\t" + m[5] + "\t" + m[6] + "\t" + m[7] + "\n" +
-                m[8] + "\t" + m[9] + "\t" + m[10] + "\t" + m[11] + "\n" +
-                m[12] + "\t" + m[13] + "\t" + m[14] + "\t" + m[15] + "\n");
-        };
         /**
         * Imports a skeleton
         */
@@ -748,10 +726,6 @@ var BABYLON;
             if (!skins.babylonSkeleton) {
                 return newSkeleton;
             }
-            // Matrices
-            var accessor = gltfRuntime.accessors[skins.inverseBindMatrices];
-            var buffer = GLTF1.GLTFUtils.GetBufferFromAccessor(gltfRuntime, accessor);
-            var bindShapeMatrix = BABYLON.Matrix.FromArray(skins.bindShapeMatrix);
             // Find the root bones
             var nodesToRoot = [];
             var nodesToRootToAdd = [];
@@ -958,7 +932,7 @@ var BABYLON;
                     if (mesh.primitives[i].mode !== 4) {
                         //continue;
                     }
-                    var subMesh = new BABYLON.SubMesh(index, verticesStarts[index], verticesCounts[index], indexStarts[index], indexCounts[index], newMesh, newMesh, true);
+                    BABYLON.SubMesh.AddToMesh(index, verticesStarts[index], verticesCounts[index], indexStarts[index], indexCounts[index], newMesh, newMesh, true);
                     index++;
                 }
             }
@@ -1079,7 +1053,6 @@ var BABYLON;
                 var camera = gltfRuntime.cameras[node.camera];
                 if (camera) {
                     if (camera.type === "orthographic") {
-                        var orthographicCamera = camera[camera.type];
                         var orthoCamera = new BABYLON.FreeCamera(node.camera, BABYLON.Vector3.Zero(), gltfRuntime.scene);
                         orthoCamera.name = node.name;
                         orthoCamera.mode = BABYLON.Camera.ORTHOGRAPHIC_CAMERA;
@@ -1627,7 +1600,7 @@ var BABYLON;
             GLTFLoader.prototype.importMeshAsync = function (meshesNames, scene, data, rootUrl, onSuccess, onProgress, onError) {
                 var _this = this;
                 scene.useRightHandedSystem = true;
-                var gltfRuntime = GLTF1.GLTFLoaderExtension.LoadRuntimeAsync(scene, data, rootUrl, function (gltfRuntime) {
+                GLTF1.GLTFLoaderExtension.LoadRuntimeAsync(scene, data, rootUrl, function (gltfRuntime) {
                     gltfRuntime.importOnlyMeshes = true;
                     if (meshesNames === "") {
                         gltfRuntime.importMeshesNames = [];
@@ -2200,11 +2173,6 @@ var BABYLON;
     var GLTF1;
     (function (GLTF1) {
         var BinaryExtensionBufferName = "binary_glTF";
-        var EContentFormat;
-        (function (EContentFormat) {
-            EContentFormat[EContentFormat["JSON"] = 0] = "JSON";
-        })(EContentFormat || (EContentFormat = {}));
-        ;
         ;
         ;
         var GLTFBinaryExtension = (function (_super) {
@@ -2260,27 +2228,6 @@ var BABYLON;
             return GLTFBinaryExtension;
         }(GLTF1.GLTFLoaderExtension));
         GLTF1.GLTFBinaryExtension = GLTFBinaryExtension;
-        var BinaryReader = (function () {
-            function BinaryReader(arrayBuffer) {
-                this._arrayBuffer = arrayBuffer;
-                this._dataView = new DataView(arrayBuffer);
-                this._byteOffset = 0;
-            }
-            BinaryReader.prototype.getUint32 = function () {
-                var value = this._dataView.getUint32(this._byteOffset, true);
-                this._byteOffset += 4;
-                return value;
-            };
-            BinaryReader.prototype.getUint8Array = function (length) {
-                if (!length) {
-                    length = this._arrayBuffer.byteLength - this._byteOffset;
-                }
-                var value = new Uint8Array(this._arrayBuffer, this._byteOffset, length);
-                this._byteOffset += length;
-                return value;
-            };
-            return BinaryReader;
-        }());
         GLTF1.GLTFLoader.RegisterExtension(new GLTFBinaryExtension());
     })(GLTF1 = BABYLON.GLTF1 || (BABYLON.GLTF1 = {}));
 })(BABYLON || (BABYLON = {}));
@@ -2777,7 +2724,7 @@ var BABYLON;
                             node.babylonMesh.subMeshes = [];
                             for (var index = 0; index < subMeshInfos.length; index++) {
                                 var info = subMeshInfos[index];
-                                new BABYLON.SubMesh(index, info.verticesStart, info.verticesCount, info.indicesStart, info.indicesCount, node.babylonMesh);
+                                BABYLON.SubMesh.AddToMesh(index, info.verticesStart, info.verticesCount, info.indicesStart, info.indicesCount, node.babylonMesh);
                                 info.loadMaterial(index);
                             }
                         }

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 3 - 3
dist/preview release/loaders/babylon.glTFFileLoader.min.js


+ 1 - 1
dist/preview release/loaders/babylon.objFileLoader.d.ts

@@ -15,7 +15,7 @@ declare module BABYLON {
          * @param data
          * @param rootUrl
          */
-        parseMTL: (scene: Scene, data: string, rootUrl: string) => void;
+        parseMTL(scene: BABYLON.Scene, data: string, rootUrl: string): void;
         /**
          * Gets the texture for the material.
          *

+ 146 - 146
dist/preview release/loaders/babylon.objFileLoader.js

@@ -8,165 +8,165 @@ var BABYLON;
         function MTLFileLoader() {
             // All material loaded from the mtl will be set here
             this.materials = [];
-            /**
-             * This function will read the mtl file and create each material described inside
-             * This function could be improve by adding :
-             * -some component missing (Ni, Tf...)
-             * -including the specific options available
-             *
-             * @param scene
-             * @param data
-             * @param rootUrl
-             */
-            this.parseMTL = function (scene, data, rootUrl) {
-                //Split the lines from the file
-                var lines = data.split('\n');
-                //Space char
-                var delimiter_pattern = /\s+/;
-                //Array with RGB colors
-                var color;
-                //New material
-                var material;
-                //Look at each line
-                for (var i = 0; i < lines.length; i++) {
-                    var line = lines[i].trim();
-                    // Blank line or comment
-                    if (line.length === 0 || line.charAt(0) === '#') {
-                        continue;
-                    }
-                    //Get the first parameter (keyword)
-                    var pos = line.indexOf(' ');
-                    var key = (pos >= 0) ? line.substring(0, pos) : line;
-                    key = key.toLowerCase();
-                    //Get the data following the key
-                    var value = (pos >= 0) ? line.substring(pos + 1).trim() : "";
-                    //This mtl keyword will create the new material
-                    if (key === "newmtl") {
-                        //Check if it is the first material.
-                        // Materials specifications are described after this keyword.
-                        if (material) {
-                            //Add the previous material in the material array.
-                            this.materials.push(material);
-                        }
-                        //Create a new material.
-                        // value is the name of the material read in the mtl file
-                        material = new BABYLON.StandardMaterial(value, scene);
-                    }
-                    else if (key === "kd") {
-                        // Diffuse color (color under white light) using RGB values
-                        //value  = "r g b"
-                        color = value.split(delimiter_pattern, 3).map(parseFloat);
-                        //color = [r,g,b]
-                        //Set tghe color into the material
-                        material.diffuseColor = BABYLON.Color3.FromArray(color);
-                    }
-                    else if (key === "ka") {
-                        // Ambient color (color under shadow) using RGB values
-                        //value = "r g b"
-                        color = value.split(delimiter_pattern, 3).map(parseFloat);
-                        //color = [r,g,b]
-                        //Set tghe color into the material
-                        material.ambientColor = BABYLON.Color3.FromArray(color);
-                    }
-                    else if (key === "ks") {
-                        // Specular color (color when light is reflected from shiny surface) using RGB values
-                        //value = "r g b"
-                        color = value.split(delimiter_pattern, 3).map(parseFloat);
-                        //color = [r,g,b]
-                        //Set the color into the material
-                        material.specularColor = BABYLON.Color3.FromArray(color);
+        }
+        /**
+         * This function will read the mtl file and create each material described inside
+         * This function could be improve by adding :
+         * -some component missing (Ni, Tf...)
+         * -including the specific options available
+         *
+         * @param scene
+         * @param data
+         * @param rootUrl
+         */
+        MTLFileLoader.prototype.parseMTL = function (scene, data, rootUrl) {
+            //Split the lines from the file
+            var lines = data.split('\n');
+            //Space char
+            var delimiter_pattern = /\s+/;
+            //Array with RGB colors
+            var color;
+            //New material
+            var material;
+            //Look at each line
+            for (var i = 0; i < lines.length; i++) {
+                var line = lines[i].trim();
+                // Blank line or comment
+                if (line.length === 0 || line.charAt(0) === '#') {
+                    continue;
+                }
+                //Get the first parameter (keyword)
+                var pos = line.indexOf(' ');
+                var key = (pos >= 0) ? line.substring(0, pos) : line;
+                key = key.toLowerCase();
+                //Get the data following the key
+                var value = (pos >= 0) ? line.substring(pos + 1).trim() : "";
+                //This mtl keyword will create the new material
+                if (key === "newmtl") {
+                    //Check if it is the first material.
+                    // Materials specifications are described after this keyword.
+                    if (material) {
+                        //Add the previous material in the material array.
+                        this.materials.push(material);
                     }
-                    else if (key === "ke") {
-                        // Emissive color using RGB values
-                        color = value.split(delimiter_pattern, 3).map(parseFloat);
-                        material.emissiveColor = BABYLON.Color3.FromArray(color);
+                    //Create a new material.
+                    // value is the name of the material read in the mtl file
+                    material = new BABYLON.StandardMaterial(value, scene);
+                }
+                else if (key === "kd") {
+                    // Diffuse color (color under white light) using RGB values
+                    //value  = "r g b"
+                    color = value.split(delimiter_pattern, 3).map(parseFloat);
+                    //color = [r,g,b]
+                    //Set tghe color into the material
+                    material.diffuseColor = BABYLON.Color3.FromArray(color);
+                }
+                else if (key === "ka") {
+                    // Ambient color (color under shadow) using RGB values
+                    //value = "r g b"
+                    color = value.split(delimiter_pattern, 3).map(parseFloat);
+                    //color = [r,g,b]
+                    //Set tghe color into the material
+                    material.ambientColor = BABYLON.Color3.FromArray(color);
+                }
+                else if (key === "ks") {
+                    // Specular color (color when light is reflected from shiny surface) using RGB values
+                    //value = "r g b"
+                    color = value.split(delimiter_pattern, 3).map(parseFloat);
+                    //color = [r,g,b]
+                    //Set the color into the material
+                    material.specularColor = BABYLON.Color3.FromArray(color);
+                }
+                else if (key === "ke") {
+                    // Emissive color using RGB values
+                    color = value.split(delimiter_pattern, 3).map(parseFloat);
+                    material.emissiveColor = BABYLON.Color3.FromArray(color);
+                }
+                else if (key === "ns") {
+                    //value = "Integer"
+                    material.specularPower = parseFloat(value);
+                }
+                else if (key === "d") {
+                    //d is dissolve for current material. It mean alpha for BABYLON
+                    material.alpha = parseFloat(value);
+                    //Texture
+                    //This part can be improved by adding the possible options of texture
+                }
+                else if (key === "map_ka") {
+                    // ambient texture map with a loaded image
+                    //We must first get the folder of the image
+                    material.ambientTexture = MTLFileLoader._getTexture(rootUrl, value, scene);
+                }
+                else if (key === "map_kd") {
+                    // Diffuse texture map with a loaded image
+                    material.diffuseTexture = MTLFileLoader._getTexture(rootUrl, value, scene);
+                }
+                else if (key === "map_ks") {
+                    // Specular texture map with a loaded image
+                    //We must first get the folder of the image
+                    material.specularTexture = MTLFileLoader._getTexture(rootUrl, value, scene);
+                }
+                else if (key === "map_ns") {
+                    //Specular
+                    //Specular highlight component
+                    //We must first get the folder of the image
+                    //
+                    //Not supported by BABYLON
+                    //
+                    //    continue;
+                }
+                else if (key === "map_bump") {
+                    //The bump texture
+                    material.bumpTexture = MTLFileLoader._getTexture(rootUrl, value, scene);
+                }
+                else if (key === "map_d") {
+                    // The dissolve of the material
+                    material.opacityTexture = MTLFileLoader._getTexture(rootUrl, value, scene);
+                    //Options for illumination
+                }
+                else if (key === "illum") {
+                    //Illumination
+                    if (value === "0") {
+                        //That mean Kd == Kd
                     }
-                    else if (key === "ns") {
-                        //value = "Integer"
-                        material.specularPower = parseFloat(value);
+                    else if (value === "1") {
+                        //Color on and Ambient on
                     }
-                    else if (key === "d") {
-                        //d is dissolve for current material. It mean alpha for BABYLON
-                        material.alpha = parseFloat(value);
-                        //Texture
-                        //This part can be improved by adding the possible options of texture
+                    else if (value === "2") {
+                        //Highlight on
                     }
-                    else if (key === "map_ka") {
-                        // ambient texture map with a loaded image
-                        //We must first get the folder of the image
-                        material.ambientTexture = MTLFileLoader._getTexture(rootUrl, value, scene);
+                    else if (value === "3") {
+                        //Reflection on and Ray trace on
                     }
-                    else if (key === "map_kd") {
-                        // Diffuse texture map with a loaded image
-                        material.diffuseTexture = MTLFileLoader._getTexture(rootUrl, value, scene);
+                    else if (value === "4") {
+                        //Transparency: Glass on, Reflection: Ray trace on
                     }
-                    else if (key === "map_ks") {
-                        // Specular texture map with a loaded image
-                        //We must first get the folder of the image
-                        material.specularTexture = MTLFileLoader._getTexture(rootUrl, value, scene);
+                    else if (value === "5") {
+                        //Reflection: Fresnel on and Ray trace on
                     }
-                    else if (key === "map_ns") {
-                        //Specular
-                        //Specular highlight component
-                        //We must first get the folder of the image
-                        //
-                        //Not supported by BABYLON
-                        //
-                        //    continue;
+                    else if (value === "6") {
+                        //Transparency: Refraction on, Reflection: Fresnel off and Ray trace on
                     }
-                    else if (key === "map_bump") {
-                        //The bump texture
-                        material.bumpTexture = MTLFileLoader._getTexture(rootUrl, value, scene);
+                    else if (value === "7") {
+                        //Transparency: Refraction on, Reflection: Fresnel on and Ray trace on
                     }
-                    else if (key === "map_d") {
-                        // The dissolve of the material
-                        material.opacityTexture = MTLFileLoader._getTexture(rootUrl, value, scene);
-                        //Options for illumination
+                    else if (value === "8") {
+                        //Reflection on and Ray trace off
                     }
-                    else if (key === "illum") {
-                        //Illumination
-                        if (value === "0") {
-                            //That mean Kd == Kd
-                        }
-                        else if (value === "1") {
-                            //Color on and Ambient on
-                        }
-                        else if (value === "2") {
-                            //Highlight on
-                        }
-                        else if (value === "3") {
-                            //Reflection on and Ray trace on
-                        }
-                        else if (value === "4") {
-                            //Transparency: Glass on, Reflection: Ray trace on
-                        }
-                        else if (value === "5") {
-                            //Reflection: Fresnel on and Ray trace on
-                        }
-                        else if (value === "6") {
-                            //Transparency: Refraction on, Reflection: Fresnel off and Ray trace on
-                        }
-                        else if (value === "7") {
-                            //Transparency: Refraction on, Reflection: Fresnel on and Ray trace on
-                        }
-                        else if (value === "8") {
-                            //Reflection on and Ray trace off
-                        }
-                        else if (value === "9") {
-                            //Transparency: Glass on, Reflection: Ray trace off
-                        }
-                        else if (value === "10") {
-                            //Casts shadows onto invisible surfaces
-                        }
+                    else if (value === "9") {
+                        //Transparency: Glass on, Reflection: Ray trace off
                     }
-                    else {
-                        // console.log("Unhandled expression at line : " + i +'\n' + "with value : " + line);
+                    else if (value === "10") {
+                        //Casts shadows onto invisible surfaces
                     }
                 }
-                //At the end of the file, add the last material
-                this.materials.push(material);
-            };
-        }
+                else {
+                    // console.log("Unhandled expression at line : " + i +'\n' + "with value : " + line);
+                }
+            }
+            //At the end of the file, add the last material
+            this.materials.push(material);
+        };
         /**
          * Gets the texture for the material.
          *

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 1 - 1
dist/preview release/loaders/babylon.objFileLoader.min.js


+ 160 - 213
dist/preview release/loaders/babylonjs.loaders.js

@@ -191,165 +191,165 @@ var BABYLON;
         function MTLFileLoader() {
             // All material loaded from the mtl will be set here
             this.materials = [];
-            /**
-             * This function will read the mtl file and create each material described inside
-             * This function could be improve by adding :
-             * -some component missing (Ni, Tf...)
-             * -including the specific options available
-             *
-             * @param scene
-             * @param data
-             * @param rootUrl
-             */
-            this.parseMTL = function (scene, data, rootUrl) {
-                //Split the lines from the file
-                var lines = data.split('\n');
-                //Space char
-                var delimiter_pattern = /\s+/;
-                //Array with RGB colors
-                var color;
-                //New material
-                var material;
-                //Look at each line
-                for (var i = 0; i < lines.length; i++) {
-                    var line = lines[i].trim();
-                    // Blank line or comment
-                    if (line.length === 0 || line.charAt(0) === '#') {
-                        continue;
-                    }
-                    //Get the first parameter (keyword)
-                    var pos = line.indexOf(' ');
-                    var key = (pos >= 0) ? line.substring(0, pos) : line;
-                    key = key.toLowerCase();
-                    //Get the data following the key
-                    var value = (pos >= 0) ? line.substring(pos + 1).trim() : "";
-                    //This mtl keyword will create the new material
-                    if (key === "newmtl") {
-                        //Check if it is the first material.
-                        // Materials specifications are described after this keyword.
-                        if (material) {
-                            //Add the previous material in the material array.
-                            this.materials.push(material);
-                        }
-                        //Create a new material.
-                        // value is the name of the material read in the mtl file
-                        material = new BABYLON.StandardMaterial(value, scene);
-                    }
-                    else if (key === "kd") {
-                        // Diffuse color (color under white light) using RGB values
-                        //value  = "r g b"
-                        color = value.split(delimiter_pattern, 3).map(parseFloat);
-                        //color = [r,g,b]
-                        //Set tghe color into the material
-                        material.diffuseColor = BABYLON.Color3.FromArray(color);
-                    }
-                    else if (key === "ka") {
-                        // Ambient color (color under shadow) using RGB values
-                        //value = "r g b"
-                        color = value.split(delimiter_pattern, 3).map(parseFloat);
-                        //color = [r,g,b]
-                        //Set tghe color into the material
-                        material.ambientColor = BABYLON.Color3.FromArray(color);
-                    }
-                    else if (key === "ks") {
-                        // Specular color (color when light is reflected from shiny surface) using RGB values
-                        //value = "r g b"
-                        color = value.split(delimiter_pattern, 3).map(parseFloat);
-                        //color = [r,g,b]
-                        //Set the color into the material
-                        material.specularColor = BABYLON.Color3.FromArray(color);
-                    }
-                    else if (key === "ke") {
-                        // Emissive color using RGB values
-                        color = value.split(delimiter_pattern, 3).map(parseFloat);
-                        material.emissiveColor = BABYLON.Color3.FromArray(color);
-                    }
-                    else if (key === "ns") {
-                        //value = "Integer"
-                        material.specularPower = parseFloat(value);
-                    }
-                    else if (key === "d") {
-                        //d is dissolve for current material. It mean alpha for BABYLON
-                        material.alpha = parseFloat(value);
-                        //Texture
-                        //This part can be improved by adding the possible options of texture
-                    }
-                    else if (key === "map_ka") {
-                        // ambient texture map with a loaded image
-                        //We must first get the folder of the image
-                        material.ambientTexture = MTLFileLoader._getTexture(rootUrl, value, scene);
-                    }
-                    else if (key === "map_kd") {
-                        // Diffuse texture map with a loaded image
-                        material.diffuseTexture = MTLFileLoader._getTexture(rootUrl, value, scene);
-                    }
-                    else if (key === "map_ks") {
-                        // Specular texture map with a loaded image
-                        //We must first get the folder of the image
-                        material.specularTexture = MTLFileLoader._getTexture(rootUrl, value, scene);
-                    }
-                    else if (key === "map_ns") {
-                        //Specular
-                        //Specular highlight component
-                        //We must first get the folder of the image
-                        //
-                        //Not supported by BABYLON
-                        //
-                        //    continue;
-                    }
-                    else if (key === "map_bump") {
-                        //The bump texture
-                        material.bumpTexture = MTLFileLoader._getTexture(rootUrl, value, scene);
-                    }
-                    else if (key === "map_d") {
-                        // The dissolve of the material
-                        material.opacityTexture = MTLFileLoader._getTexture(rootUrl, value, scene);
-                        //Options for illumination
-                    }
-                    else if (key === "illum") {
-                        //Illumination
-                        if (value === "0") {
-                            //That mean Kd == Kd
-                        }
-                        else if (value === "1") {
-                            //Color on and Ambient on
-                        }
-                        else if (value === "2") {
-                            //Highlight on
-                        }
-                        else if (value === "3") {
-                            //Reflection on and Ray trace on
-                        }
-                        else if (value === "4") {
-                            //Transparency: Glass on, Reflection: Ray trace on
-                        }
-                        else if (value === "5") {
-                            //Reflection: Fresnel on and Ray trace on
-                        }
-                        else if (value === "6") {
-                            //Transparency: Refraction on, Reflection: Fresnel off and Ray trace on
-                        }
-                        else if (value === "7") {
-                            //Transparency: Refraction on, Reflection: Fresnel on and Ray trace on
-                        }
-                        else if (value === "8") {
-                            //Reflection on and Ray trace off
-                        }
-                        else if (value === "9") {
-                            //Transparency: Glass on, Reflection: Ray trace off
-                        }
-                        else if (value === "10") {
-                            //Casts shadows onto invisible surfaces
-                        }
-                    }
-                    else {
-                        // console.log("Unhandled expression at line : " + i +'\n' + "with value : " + line);
+        }
+        /**
+         * This function will read the mtl file and create each material described inside
+         * This function could be improve by adding :
+         * -some component missing (Ni, Tf...)
+         * -including the specific options available
+         *
+         * @param scene
+         * @param data
+         * @param rootUrl
+         */
+        MTLFileLoader.prototype.parseMTL = function (scene, data, rootUrl) {
+            //Split the lines from the file
+            var lines = data.split('\n');
+            //Space char
+            var delimiter_pattern = /\s+/;
+            //Array with RGB colors
+            var color;
+            //New material
+            var material;
+            //Look at each line
+            for (var i = 0; i < lines.length; i++) {
+                var line = lines[i].trim();
+                // Blank line or comment
+                if (line.length === 0 || line.charAt(0) === '#') {
+                    continue;
+                }
+                //Get the first parameter (keyword)
+                var pos = line.indexOf(' ');
+                var key = (pos >= 0) ? line.substring(0, pos) : line;
+                key = key.toLowerCase();
+                //Get the data following the key
+                var value = (pos >= 0) ? line.substring(pos + 1).trim() : "";
+                //This mtl keyword will create the new material
+                if (key === "newmtl") {
+                    //Check if it is the first material.
+                    // Materials specifications are described after this keyword.
+                    if (material) {
+                        //Add the previous material in the material array.
+                        this.materials.push(material);
+                    }
+                    //Create a new material.
+                    // value is the name of the material read in the mtl file
+                    material = new BABYLON.StandardMaterial(value, scene);
+                }
+                else if (key === "kd") {
+                    // Diffuse color (color under white light) using RGB values
+                    //value  = "r g b"
+                    color = value.split(delimiter_pattern, 3).map(parseFloat);
+                    //color = [r,g,b]
+                    //Set tghe color into the material
+                    material.diffuseColor = BABYLON.Color3.FromArray(color);
+                }
+                else if (key === "ka") {
+                    // Ambient color (color under shadow) using RGB values
+                    //value = "r g b"
+                    color = value.split(delimiter_pattern, 3).map(parseFloat);
+                    //color = [r,g,b]
+                    //Set tghe color into the material
+                    material.ambientColor = BABYLON.Color3.FromArray(color);
+                }
+                else if (key === "ks") {
+                    // Specular color (color when light is reflected from shiny surface) using RGB values
+                    //value = "r g b"
+                    color = value.split(delimiter_pattern, 3).map(parseFloat);
+                    //color = [r,g,b]
+                    //Set the color into the material
+                    material.specularColor = BABYLON.Color3.FromArray(color);
+                }
+                else if (key === "ke") {
+                    // Emissive color using RGB values
+                    color = value.split(delimiter_pattern, 3).map(parseFloat);
+                    material.emissiveColor = BABYLON.Color3.FromArray(color);
+                }
+                else if (key === "ns") {
+                    //value = "Integer"
+                    material.specularPower = parseFloat(value);
+                }
+                else if (key === "d") {
+                    //d is dissolve for current material. It mean alpha for BABYLON
+                    material.alpha = parseFloat(value);
+                    //Texture
+                    //This part can be improved by adding the possible options of texture
+                }
+                else if (key === "map_ka") {
+                    // ambient texture map with a loaded image
+                    //We must first get the folder of the image
+                    material.ambientTexture = MTLFileLoader._getTexture(rootUrl, value, scene);
+                }
+                else if (key === "map_kd") {
+                    // Diffuse texture map with a loaded image
+                    material.diffuseTexture = MTLFileLoader._getTexture(rootUrl, value, scene);
+                }
+                else if (key === "map_ks") {
+                    // Specular texture map with a loaded image
+                    //We must first get the folder of the image
+                    material.specularTexture = MTLFileLoader._getTexture(rootUrl, value, scene);
+                }
+                else if (key === "map_ns") {
+                    //Specular
+                    //Specular highlight component
+                    //We must first get the folder of the image
+                    //
+                    //Not supported by BABYLON
+                    //
+                    //    continue;
+                }
+                else if (key === "map_bump") {
+                    //The bump texture
+                    material.bumpTexture = MTLFileLoader._getTexture(rootUrl, value, scene);
+                }
+                else if (key === "map_d") {
+                    // The dissolve of the material
+                    material.opacityTexture = MTLFileLoader._getTexture(rootUrl, value, scene);
+                    //Options for illumination
+                }
+                else if (key === "illum") {
+                    //Illumination
+                    if (value === "0") {
+                        //That mean Kd == Kd
+                    }
+                    else if (value === "1") {
+                        //Color on and Ambient on
+                    }
+                    else if (value === "2") {
+                        //Highlight on
+                    }
+                    else if (value === "3") {
+                        //Reflection on and Ray trace on
+                    }
+                    else if (value === "4") {
+                        //Transparency: Glass on, Reflection: Ray trace on
+                    }
+                    else if (value === "5") {
+                        //Reflection: Fresnel on and Ray trace on
+                    }
+                    else if (value === "6") {
+                        //Transparency: Refraction on, Reflection: Fresnel off and Ray trace on
+                    }
+                    else if (value === "7") {
+                        //Transparency: Refraction on, Reflection: Fresnel on and Ray trace on
+                    }
+                    else if (value === "8") {
+                        //Reflection on and Ray trace off
+                    }
+                    else if (value === "9") {
+                        //Transparency: Glass on, Reflection: Ray trace off
+                    }
+                    else if (value === "10") {
+                        //Casts shadows onto invisible surfaces
                     }
                 }
-                //At the end of the file, add the last material
-                this.materials.push(material);
-            };
-        }
+                else {
+                    // console.log("Unhandled expression at line : " + i +'\n' + "with value : " + line);
+                }
+            }
+            //At the end of the file, add the last material
+            this.materials.push(material);
+        };
         /**
          * Gets the texture for the material.
          *
@@ -1412,12 +1412,6 @@ var BABYLON;
                 buffer[i * 2 + 1] = 1.0 - buffer[i * 2 + 1];
             }
         };
-        var replaceInString = function (str, searchValue, replaceValue) {
-            while (str.indexOf(searchValue) !== -1) {
-                str = str.replace(searchValue, replaceValue);
-            }
-            return str;
-        };
         var getAttribute = function (attributeParameter) {
             if (attributeParameter.semantic === "NORMAL") {
                 return "normal";
@@ -1441,16 +1435,6 @@ var BABYLON;
             return null;
         };
         /**
-        * Returns the animation path (glTF -> Babylon)
-        */
-        var getAnimationPath = function (path) {
-            var index = glTFAnimationPaths.indexOf(path);
-            if (index !== -1) {
-                return babylonAnimationPaths[index];
-            }
-            return path;
-        };
-        /**
         * Loads and creates animations
         */
         var loadAnimations = function (gltfRuntime) {
@@ -1703,12 +1687,6 @@ var BABYLON;
                 }
             }
         };
-        var printMat = function (m) {
-            console.log(m[0] + "\t" + m[1] + "\t" + m[2] + "\t" + m[3] + "\n" +
-                m[4] + "\t" + m[5] + "\t" + m[6] + "\t" + m[7] + "\n" +
-                m[8] + "\t" + m[9] + "\t" + m[10] + "\t" + m[11] + "\n" +
-                m[12] + "\t" + m[13] + "\t" + m[14] + "\t" + m[15] + "\n");
-        };
         /**
         * Imports a skeleton
         */
@@ -1719,10 +1697,6 @@ var BABYLON;
             if (!skins.babylonSkeleton) {
                 return newSkeleton;
             }
-            // Matrices
-            var accessor = gltfRuntime.accessors[skins.inverseBindMatrices];
-            var buffer = GLTF1.GLTFUtils.GetBufferFromAccessor(gltfRuntime, accessor);
-            var bindShapeMatrix = BABYLON.Matrix.FromArray(skins.bindShapeMatrix);
             // Find the root bones
             var nodesToRoot = [];
             var nodesToRootToAdd = [];
@@ -1929,7 +1903,7 @@ var BABYLON;
                     if (mesh.primitives[i].mode !== 4) {
                         //continue;
                     }
-                    var subMesh = new BABYLON.SubMesh(index, verticesStarts[index], verticesCounts[index], indexStarts[index], indexCounts[index], newMesh, newMesh, true);
+                    BABYLON.SubMesh.AddToMesh(index, verticesStarts[index], verticesCounts[index], indexStarts[index], indexCounts[index], newMesh, newMesh, true);
                     index++;
                 }
             }
@@ -2050,7 +2024,6 @@ var BABYLON;
                 var camera = gltfRuntime.cameras[node.camera];
                 if (camera) {
                     if (camera.type === "orthographic") {
-                        var orthographicCamera = camera[camera.type];
                         var orthoCamera = new BABYLON.FreeCamera(node.camera, BABYLON.Vector3.Zero(), gltfRuntime.scene);
                         orthoCamera.name = node.name;
                         orthoCamera.mode = BABYLON.Camera.ORTHOGRAPHIC_CAMERA;
@@ -2598,7 +2571,7 @@ var BABYLON;
             GLTFLoader.prototype.importMeshAsync = function (meshesNames, scene, data, rootUrl, onSuccess, onProgress, onError) {
                 var _this = this;
                 scene.useRightHandedSystem = true;
-                var gltfRuntime = GLTF1.GLTFLoaderExtension.LoadRuntimeAsync(scene, data, rootUrl, function (gltfRuntime) {
+                GLTF1.GLTFLoaderExtension.LoadRuntimeAsync(scene, data, rootUrl, function (gltfRuntime) {
                     gltfRuntime.importOnlyMeshes = true;
                     if (meshesNames === "") {
                         gltfRuntime.importMeshesNames = [];
@@ -3162,11 +3135,6 @@ var BABYLON;
     var GLTF1;
     (function (GLTF1) {
         var BinaryExtensionBufferName = "binary_glTF";
-        var EContentFormat;
-        (function (EContentFormat) {
-            EContentFormat[EContentFormat["JSON"] = 0] = "JSON";
-        })(EContentFormat || (EContentFormat = {}));
-        ;
         ;
         ;
         var GLTFBinaryExtension = (function (_super) {
@@ -3222,27 +3190,6 @@ var BABYLON;
             return GLTFBinaryExtension;
         }(GLTF1.GLTFLoaderExtension));
         GLTF1.GLTFBinaryExtension = GLTFBinaryExtension;
-        var BinaryReader = (function () {
-            function BinaryReader(arrayBuffer) {
-                this._arrayBuffer = arrayBuffer;
-                this._dataView = new DataView(arrayBuffer);
-                this._byteOffset = 0;
-            }
-            BinaryReader.prototype.getUint32 = function () {
-                var value = this._dataView.getUint32(this._byteOffset, true);
-                this._byteOffset += 4;
-                return value;
-            };
-            BinaryReader.prototype.getUint8Array = function (length) {
-                if (!length) {
-                    length = this._arrayBuffer.byteLength - this._byteOffset;
-                }
-                var value = new Uint8Array(this._arrayBuffer, this._byteOffset, length);
-                this._byteOffset += length;
-                return value;
-            };
-            return BinaryReader;
-        }());
         GLTF1.GLTFLoader.RegisterExtension(new GLTFBinaryExtension());
     })(GLTF1 = BABYLON.GLTF1 || (BABYLON.GLTF1 = {}));
 })(BABYLON || (BABYLON = {}));
@@ -3730,7 +3677,7 @@ var BABYLON;
                             node.babylonMesh.subMeshes = [];
                             for (var index = 0; index < subMeshInfos.length; index++) {
                                 var info = subMeshInfos[index];
-                                new BABYLON.SubMesh(index, info.verticesStart, info.verticesCount, info.indicesStart, info.indicesCount, node.babylonMesh);
+                                BABYLON.SubMesh.AddToMesh(index, info.verticesStart, info.verticesCount, info.indicesStart, info.indicesCount, node.babylonMesh);
                                 info.loadMaterial(index);
                             }
                         }

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 3 - 3
dist/preview release/loaders/babylonjs.loaders.min.js


+ 1 - 1
dist/preview release/loaders/babylonjs.loaders.module.d.ts

@@ -37,7 +37,7 @@ declare module BABYLON {
          * @param data
          * @param rootUrl
          */
-        parseMTL: (scene: Scene, data: string, rootUrl: string) => void;
+        parseMTL(scene: BABYLON.Scene, data: string, rootUrl: string): void;
         /**
          * Gets the texture for the material.
          *

+ 0 - 2
dist/preview release/materialsLibrary/babylon.cellMaterial.d.ts

@@ -10,8 +10,6 @@ declare module BABYLON {
         disableLighting: boolean;
         private _maxSimultaneousLights;
         maxSimultaneousLights: number;
-        private _worldViewProjectionMatrix;
-        private _scaledDiffuse;
         private _renderId;
         constructor(name: string, scene: Scene);
         needAlphaBlending(): boolean;

+ 0 - 2
dist/preview release/materialsLibrary/babylon.cellMaterial.js

@@ -51,8 +51,6 @@ var BABYLON;
             _this._computeHighLevel = false;
             _this._disableLighting = false;
             _this._maxSimultaneousLights = 4;
-            _this._worldViewProjectionMatrix = BABYLON.Matrix.Zero();
-            _this._scaledDiffuse = new BABYLON.Color3();
             return _this;
         }
         CellMaterial.prototype.needAlphaBlending = function () {

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 1 - 1
dist/preview release/materialsLibrary/babylon.cellMaterial.min.js


+ 2 - 2
dist/preview release/materialsLibrary/babylon.customMaterial.js

@@ -796,10 +796,10 @@ var BABYLON;
                             this._uniformBuffer.updateFloat3("vBumpInfos", this._bumpTexture.coordinatesIndex, 1.0 / this._bumpTexture.level, this.parallaxScaleBias);
                             this._uniformBuffer.updateMatrix("bumpMatrix", this._bumpTexture.getTextureMatrix());
                             if (scene._mirroredCameraPosition) {
-                                this._uniformBuffer.updateFloat2("vTangentSpaceParams", this.invertNormalMapX ? 1.0 : -1.0, this.invertNormalMapY ? 1.0 : -1.0);
+                                this._uniformBuffer.updateFloat2("vTangentSpaceParams", this._invertNormalMapX ? 1.0 : -1.0, this._invertNormalMapY ? 1.0 : -1.0);
                             }
                             else {
-                                this._uniformBuffer.updateFloat2("vTangentSpaceParams", this.invertNormalMapX ? -1.0 : 1.0, this.invertNormalMapY ? -1.0 : 1.0);
+                                this._uniformBuffer.updateFloat2("vTangentSpaceParams", this._invertNormalMapX ? -1.0 : 1.0, this._invertNormalMapY ? -1.0 : 1.0);
                             }
                         }
                         if (this._refractionTexture && StandardMaterial_OldVer.RefractionTextureEnabled) {

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 1 - 1
dist/preview release/materialsLibrary/babylon.customMaterial.min.js


+ 0 - 1
dist/preview release/materialsLibrary/babylon.furMaterial.d.ts

@@ -21,7 +21,6 @@ declare module BABYLON {
         maxSimultaneousLights: number;
         highLevelFur: boolean;
         _meshes: AbstractMesh[];
-        private _worldViewProjectionMatrix;
         private _renderId;
         private _furTime;
         constructor(name: string, scene: Scene);

+ 0 - 1
dist/preview release/materialsLibrary/babylon.furMaterial.js

@@ -58,7 +58,6 @@ var BABYLON;
             _this._disableLighting = false;
             _this._maxSimultaneousLights = 4;
             _this.highLevelFur = true;
-            _this._worldViewProjectionMatrix = BABYLON.Matrix.Zero();
             _this._furTime = 0;
             return _this;
         }

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 1 - 1
dist/preview release/materialsLibrary/babylon.furMaterial.min.js


+ 0 - 1
dist/preview release/materialsLibrary/babylon.gradientMaterial.d.ts

@@ -10,7 +10,6 @@ declare module BABYLON {
         offset: number;
         smoothness: number;
         disableLighting: boolean;
-        private _worldViewProjectionMatrix;
         private _scaledDiffuse;
         private _renderId;
         constructor(name: string, scene: Scene);

+ 0 - 1
dist/preview release/materialsLibrary/babylon.gradientMaterial.js

@@ -88,7 +88,6 @@ var BABYLON;
             _this.offset = 0;
             _this.smoothness = 1.0;
             _this.disableLighting = false;
-            _this._worldViewProjectionMatrix = BABYLON.Matrix.Zero();
             _this._scaledDiffuse = new BABYLON.Color3();
             return _this;
         }

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 1 - 1
dist/preview release/materialsLibrary/babylon.gradientMaterial.min.js


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

@@ -99,7 +99,6 @@ var BABYLON;
                     return true;
                 }
             }
-            var engine = scene.getEngine();
             if (defines.TRANSPARENT !== (this.opacity < 1.0)) {
                 defines.TRANSPARENT = !defines.TRANSPARENT;
                 defines.markAsUnprocessed();

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 1 - 1
dist/preview release/materialsLibrary/babylon.gridMaterial.min.js


+ 0 - 1
dist/preview release/materialsLibrary/babylon.lavaMaterial.d.ts

@@ -15,7 +15,6 @@ declare module BABYLON {
         disableLighting: boolean;
         private _maxSimultaneousLights;
         maxSimultaneousLights: number;
-        private _worldViewProjectionMatrix;
         private _scaledDiffuse;
         private _renderId;
         constructor(name: string, scene: Scene);

+ 0 - 1
dist/preview release/materialsLibrary/babylon.lavaMaterial.js

@@ -85,7 +85,6 @@ var BABYLON;
             _this.diffuseColor = new BABYLON.Color3(1, 1, 1);
             _this._disableLighting = false;
             _this._maxSimultaneousLights = 4;
-            _this._worldViewProjectionMatrix = BABYLON.Matrix.Zero();
             _this._scaledDiffuse = new BABYLON.Color3();
             return _this;
         }

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 1 - 1
dist/preview release/materialsLibrary/babylon.lavaMaterial.min.js


+ 0 - 2
dist/preview release/materialsLibrary/babylon.legacyPbrMaterial.d.ts

@@ -293,7 +293,6 @@ declare module BABYLON {
          */
         twoSidedLighting: boolean;
         private _renderTargets;
-        private _worldViewProjectionMatrix;
         private _globalAmbientColor;
         private _tempColor;
         private _renderId;
@@ -326,7 +325,6 @@ declare module BABYLON {
         unbind(): void;
         bindOnlyWorldMatrix(world: Matrix): void;
         private _myScene;
-        private _myShadowGenerator;
         bind(world: Matrix, mesh?: Mesh): void;
         getAnimatables(): IAnimatable[];
         dispose(forceDisposeEffect?: boolean, forceDisposeTextures?: boolean): void;

+ 5 - 6
dist/preview release/materialsLibrary/babylon.legacyPbrMaterial.js

@@ -366,13 +366,11 @@ var BABYLON;
              */
             _this.twoSidedLighting = false;
             _this._renderTargets = new BABYLON.SmartArray(16);
-            _this._worldViewProjectionMatrix = BABYLON.Matrix.Zero();
             _this._globalAmbientColor = new BABYLON.Color3(0, 0, 0);
             _this._tempColor = new BABYLON.Color3();
             _this._defines = new LegacyPBRMaterialDefines();
             _this._cachedDefines = new LegacyPBRMaterialDefines();
             _this._myScene = null;
-            _this._myShadowGenerator = null;
             _this._cachedDefines.BonesPerMesh = -1;
             _this.getRenderTargetTextures = function () {
                 _this._renderTargets.reset();
@@ -466,6 +464,7 @@ var BABYLON;
             }
         };
         LegacyPBRMaterial.prototype.isReady = function (mesh, useInstances) {
+            var _this = this;
             if (this.isFrozen) {
                 if (this._wasPreviouslyReady) {
                     return true;
@@ -865,11 +864,11 @@ var BABYLON;
                     maxSimultaneousLights: this.maxSimultaneousLights
                 });
                 var onCompiled = function (effect) {
-                    if (this.onCompiled) {
-                        this.onCompiled(effect);
+                    if (_this.onCompiled) {
+                        _this.onCompiled(effect);
                     }
-                    this.bindSceneUniformBuffer(effect, scene.getSceneUniformBuffer());
-                }.bind(this);
+                    _this.bindSceneUniformBuffer(effect, scene.getSceneUniformBuffer());
+                };
                 this._effect = scene.getEngine().createEffect("legacyPbr", {
                     attributes: attribs,
                     uniformsNames: uniforms,

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 2 - 2
dist/preview release/materialsLibrary/babylon.legacyPbrMaterial.min.js


+ 0 - 2
dist/preview release/materialsLibrary/babylon.normalMaterial.d.ts

@@ -8,8 +8,6 @@ declare module BABYLON {
         disableLighting: boolean;
         private _maxSimultaneousLights;
         maxSimultaneousLights: number;
-        private _worldViewProjectionMatrix;
-        private _scaledDiffuse;
         private _renderId;
         constructor(name: string, scene: Scene);
         needAlphaBlending(): boolean;

+ 0 - 2
dist/preview release/materialsLibrary/babylon.normalMaterial.js

@@ -80,8 +80,6 @@ var BABYLON;
             _this.diffuseColor = new BABYLON.Color3(1, 1, 1);
             _this._disableLighting = false;
             _this._maxSimultaneousLights = 4;
-            _this._worldViewProjectionMatrix = BABYLON.Matrix.Zero();
-            _this._scaledDiffuse = new BABYLON.Color3();
             return _this;
         }
         NormalMaterial.prototype.needAlphaBlending = function () {

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 1 - 1
dist/preview release/materialsLibrary/babylon.normalMaterial.min.js


+ 0 - 2
dist/preview release/materialsLibrary/babylon.shadowOnlyMaterial.d.ts

@@ -1,8 +1,6 @@
 
 declare module BABYLON {
     class ShadowOnlyMaterial extends PushMaterial {
-        private _worldViewProjectionMatrix;
-        private _scaledDiffuse;
         private _renderId;
         private _activeLight;
         constructor(name: string, scene: Scene);

+ 1 - 13
dist/preview release/materialsLibrary/babylon.shadowOnlyMaterial.js

@@ -9,12 +9,6 @@ var __extends = (this && this.__extends) || (function () {
         d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
     };
 })();
-var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
-    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
-    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
-    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
-    return c > 3 && r && Object.defineProperty(target, key, r), r;
-};
 var BABYLON;
 (function (BABYLON) {
     var ShadowOnlyMaterialDefines = (function (_super) {
@@ -36,10 +30,7 @@ var BABYLON;
     var ShadowOnlyMaterial = (function (_super) {
         __extends(ShadowOnlyMaterial, _super);
         function ShadowOnlyMaterial(name, scene) {
-            var _this = _super.call(this, name, scene) || this;
-            _this._worldViewProjectionMatrix = BABYLON.Matrix.Zero();
-            _this._scaledDiffuse = new BABYLON.Color3();
-            return _this;
+            return _super.call(this, name, scene) || this;
         }
         ShadowOnlyMaterial.prototype.needAlphaBlending = function () {
             return true;
@@ -206,9 +197,6 @@ var BABYLON;
         ShadowOnlyMaterial.Parse = function (source, scene, rootUrl) {
             return BABYLON.SerializationHelper.Parse(function () { return new ShadowOnlyMaterial(source.name, scene); }, source, scene, rootUrl);
         };
-        __decorate([
-            BABYLON.serialize()
-        ], ShadowOnlyMaterial.prototype, "_worldViewProjectionMatrix", void 0);
         return ShadowOnlyMaterial;
     }(BABYLON.PushMaterial));
     BABYLON.ShadowOnlyMaterial = ShadowOnlyMaterial;

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 1 - 1
dist/preview release/materialsLibrary/babylon.shadowOnlyMaterial.min.js


+ 0 - 2
dist/preview release/materialsLibrary/babylon.simpleMaterial.d.ts

@@ -8,8 +8,6 @@ declare module BABYLON {
         disableLighting: boolean;
         private _maxSimultaneousLights;
         maxSimultaneousLights: number;
-        private _worldViewProjectionMatrix;
-        private _scaledDiffuse;
         private _renderId;
         constructor(name: string, scene: Scene);
         needAlphaBlending(): boolean;

+ 0 - 2
dist/preview release/materialsLibrary/babylon.simpleMaterial.js

@@ -47,8 +47,6 @@ var BABYLON;
             _this.diffuseColor = new BABYLON.Color3(1, 1, 1);
             _this._disableLighting = false;
             _this._maxSimultaneousLights = 4;
-            _this._worldViewProjectionMatrix = BABYLON.Matrix.Zero();
-            _this._scaledDiffuse = new BABYLON.Color3();
             return _this;
         }
         SimpleMaterial.prototype.needAlphaBlending = function () {

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 1 - 1
dist/preview release/materialsLibrary/babylon.simpleMaterial.min.js


+ 0 - 1
dist/preview release/materialsLibrary/babylon.skyMaterial.js

@@ -76,7 +76,6 @@ var BABYLON;
                     return true;
                 }
             }
-            var engine = scene.getEngine();
             BABYLON.MaterialHelper.PrepareDefinesForMisc(mesh, scene, false, this.pointsCloud, this.fogEnabled, defines);
             // Attribs
             BABYLON.MaterialHelper.PrepareDefinesForAttributes(mesh, defines, true, false);

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 1 - 1
dist/preview release/materialsLibrary/babylon.skyMaterial.min.js


+ 0 - 1
dist/preview release/materialsLibrary/babylon.terrainMaterial.d.ts

@@ -22,7 +22,6 @@ declare module BABYLON {
         disableLighting: boolean;
         private _maxSimultaneousLights;
         maxSimultaneousLights: number;
-        private _worldViewProjectionMatrix;
         private _renderId;
         constructor(name: string, scene: Scene);
         needAlphaBlending(): boolean;

+ 0 - 1
dist/preview release/materialsLibrary/babylon.terrainMaterial.js

@@ -51,7 +51,6 @@ var BABYLON;
             _this.specularPower = 64;
             _this._disableLighting = false;
             _this._maxSimultaneousLights = 4;
-            _this._worldViewProjectionMatrix = BABYLON.Matrix.Zero();
             return _this;
         }
         TerrainMaterial.prototype.needAlphaBlending = function () {

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 1 - 1
dist/preview release/materialsLibrary/babylon.terrainMaterial.min.js


+ 0 - 1
dist/preview release/materialsLibrary/babylon.triPlanarMaterial.d.ts

@@ -22,7 +22,6 @@ declare module BABYLON {
         disableLighting: boolean;
         private _maxSimultaneousLights;
         maxSimultaneousLights: number;
-        private _worldViewProjectionMatrix;
         private _renderId;
         constructor(name: string, scene: Scene);
         needAlphaBlending(): boolean;

+ 0 - 1
dist/preview release/materialsLibrary/babylon.triPlanarMaterial.js

@@ -54,7 +54,6 @@ var BABYLON;
             _this.specularPower = 64;
             _this._disableLighting = false;
             _this._maxSimultaneousLights = 4;
-            _this._worldViewProjectionMatrix = BABYLON.Matrix.Zero();
             return _this;
         }
         TriPlanarMaterial.prototype.needAlphaBlending = function () {

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 1 - 1
dist/preview release/materialsLibrary/babylon.triPlanarMaterial.min.js


+ 0 - 1
dist/preview release/materialsLibrary/babylon.waterMaterial.d.ts

@@ -70,7 +70,6 @@ declare module BABYLON {
         private _mesh;
         private _refractionRTT;
         private _reflectionRTT;
-        private _material;
         private _reflectionTransform;
         private _lastTime;
         private _lastDeltaTime;

+ 8 - 29
dist/preview release/materialsLibrary/babylonjs.materials.js

@@ -18,7 +18,6 @@ var __extends = (this && this.__extends) || (function () {
         })();
         
 
-
 var BABYLON;
 (function (BABYLON) {
     var ShadowOnlyMaterialDefines = (function (_super) {
@@ -40,10 +39,7 @@ var BABYLON;
     var ShadowOnlyMaterial = (function (_super) {
         __extends(ShadowOnlyMaterial, _super);
         function ShadowOnlyMaterial(name, scene) {
-            var _this = _super.call(this, name, scene) || this;
-            _this._worldViewProjectionMatrix = BABYLON.Matrix.Zero();
-            _this._scaledDiffuse = new BABYLON.Color3();
-            return _this;
+            return _super.call(this, name, scene) || this;
         }
         ShadowOnlyMaterial.prototype.needAlphaBlending = function () {
             return true;
@@ -210,9 +206,6 @@ var BABYLON;
         ShadowOnlyMaterial.Parse = function (source, scene, rootUrl) {
             return BABYLON.SerializationHelper.Parse(function () { return new ShadowOnlyMaterial(source.name, scene); }, source, scene, rootUrl);
         };
-        __decorate([
-            BABYLON.serialize()
-        ], ShadowOnlyMaterial.prototype, "_worldViewProjectionMatrix", void 0);
         return ShadowOnlyMaterial;
     }(BABYLON.PushMaterial));
     BABYLON.ShadowOnlyMaterial = ShadowOnlyMaterial;
@@ -299,7 +292,6 @@ var BABYLON;
             _this.offset = 0;
             _this.smoothness = 1.0;
             _this.disableLighting = false;
-            _this._worldViewProjectionMatrix = BABYLON.Matrix.Zero();
             _this._scaledDiffuse = new BABYLON.Color3();
             return _this;
         }
@@ -567,8 +559,6 @@ var BABYLON;
             _this.diffuseColor = new BABYLON.Color3(1, 1, 1);
             _this._disableLighting = false;
             _this._maxSimultaneousLights = 4;
-            _this._worldViewProjectionMatrix = BABYLON.Matrix.Zero();
-            _this._scaledDiffuse = new BABYLON.Color3();
             return _this;
         }
         NormalMaterial.prototype.needAlphaBlending = function () {
@@ -876,7 +866,6 @@ var BABYLON;
             _this.diffuseColor = new BABYLON.Color3(1, 1, 1);
             _this._disableLighting = false;
             _this._maxSimultaneousLights = 4;
-            _this._worldViewProjectionMatrix = BABYLON.Matrix.Zero();
             _this._scaledDiffuse = new BABYLON.Color3();
             return _this;
         }
@@ -1187,8 +1176,6 @@ var BABYLON;
             _this.diffuseColor = new BABYLON.Color3(1, 1, 1);
             _this._disableLighting = false;
             _this._maxSimultaneousLights = 4;
-            _this._worldViewProjectionMatrix = BABYLON.Matrix.Zero();
-            _this._scaledDiffuse = new BABYLON.Color3();
             return _this;
         }
         SimpleMaterial.prototype.needAlphaBlending = function () {
@@ -2376,7 +2363,6 @@ var BABYLON;
             _this._disableLighting = false;
             _this._maxSimultaneousLights = 4;
             _this.highLevelFur = true;
-            _this._worldViewProjectionMatrix = BABYLON.Matrix.Zero();
             _this._furTime = 0;
             return _this;
         }
@@ -2826,7 +2812,6 @@ var BABYLON;
             _this.specularPower = 64;
             _this._disableLighting = false;
             _this._maxSimultaneousLights = 4;
-            _this._worldViewProjectionMatrix = BABYLON.Matrix.Zero();
             return _this;
         }
         TerrainMaterial.prototype.needAlphaBlending = function () {
@@ -3214,7 +3199,6 @@ var BABYLON;
             _this.specularPower = 64;
             _this._disableLighting = false;
             _this._maxSimultaneousLights = 4;
-            _this._worldViewProjectionMatrix = BABYLON.Matrix.Zero();
             return _this;
         }
         TriPlanarMaterial.prototype.needAlphaBlending = function () {
@@ -3616,7 +3600,6 @@ var BABYLON;
                     return true;
                 }
             }
-            var engine = scene.getEngine();
             BABYLON.MaterialHelper.PrepareDefinesForMisc(mesh, scene, false, this.pointsCloud, this.fogEnabled, defines);
             // Attribs
             BABYLON.MaterialHelper.PrepareDefinesForAttributes(mesh, defines, true, false);
@@ -3852,7 +3835,6 @@ var BABYLON;
                     return true;
                 }
             }
-            var engine = scene.getEngine();
             if (defines.TRANSPARENT !== (this.opacity < 1.0)) {
                 defines.TRANSPARENT = !defines.TRANSPARENT;
                 defines.markAsUnprocessed();
@@ -4743,10 +4725,10 @@ var BABYLON;
                             this._uniformBuffer.updateFloat3("vBumpInfos", this._bumpTexture.coordinatesIndex, 1.0 / this._bumpTexture.level, this.parallaxScaleBias);
                             this._uniformBuffer.updateMatrix("bumpMatrix", this._bumpTexture.getTextureMatrix());
                             if (scene._mirroredCameraPosition) {
-                                this._uniformBuffer.updateFloat2("vTangentSpaceParams", this.invertNormalMapX ? 1.0 : -1.0, this.invertNormalMapY ? 1.0 : -1.0);
+                                this._uniformBuffer.updateFloat2("vTangentSpaceParams", this._invertNormalMapX ? 1.0 : -1.0, this._invertNormalMapY ? 1.0 : -1.0);
                             }
                             else {
-                                this._uniformBuffer.updateFloat2("vTangentSpaceParams", this.invertNormalMapX ? -1.0 : 1.0, this.invertNormalMapY ? -1.0 : 1.0);
+                                this._uniformBuffer.updateFloat2("vTangentSpaceParams", this._invertNormalMapX ? -1.0 : 1.0, this._invertNormalMapY ? -1.0 : 1.0);
                             }
                         }
                         if (this._refractionTexture && StandardMaterial_OldVer.RefractionTextureEnabled) {
@@ -6042,8 +6024,6 @@ var BABYLON;
             _this._computeHighLevel = false;
             _this._disableLighting = false;
             _this._maxSimultaneousLights = 4;
-            _this._worldViewProjectionMatrix = BABYLON.Matrix.Zero();
-            _this._scaledDiffuse = new BABYLON.Color3();
             return _this;
         }
         CellMaterial.prototype.needAlphaBlending = function () {
@@ -6637,13 +6617,11 @@ var BABYLON;
              */
             _this.twoSidedLighting = false;
             _this._renderTargets = new BABYLON.SmartArray(16);
-            _this._worldViewProjectionMatrix = BABYLON.Matrix.Zero();
             _this._globalAmbientColor = new BABYLON.Color3(0, 0, 0);
             _this._tempColor = new BABYLON.Color3();
             _this._defines = new LegacyPBRMaterialDefines();
             _this._cachedDefines = new LegacyPBRMaterialDefines();
             _this._myScene = null;
-            _this._myShadowGenerator = null;
             _this._cachedDefines.BonesPerMesh = -1;
             _this.getRenderTargetTextures = function () {
                 _this._renderTargets.reset();
@@ -6737,6 +6715,7 @@ var BABYLON;
             }
         };
         LegacyPBRMaterial.prototype.isReady = function (mesh, useInstances) {
+            var _this = this;
             if (this.isFrozen) {
                 if (this._wasPreviouslyReady) {
                     return true;
@@ -7136,11 +7115,11 @@ var BABYLON;
                     maxSimultaneousLights: this.maxSimultaneousLights
                 });
                 var onCompiled = function (effect) {
-                    if (this.onCompiled) {
-                        this.onCompiled(effect);
+                    if (_this.onCompiled) {
+                        _this.onCompiled(effect);
                     }
-                    this.bindSceneUniformBuffer(effect, scene.getSceneUniformBuffer());
-                }.bind(this);
+                    _this.bindSceneUniformBuffer(effect, scene.getSceneUniformBuffer());
+                };
                 this._effect = scene.getEngine().createEffect("legacyPbr", {
                     attributes: attribs,
                     uniformsNames: uniforms,

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 8 - 8
dist/preview release/materialsLibrary/babylonjs.materials.min.js


+ 0 - 16
dist/preview release/materialsLibrary/babylonjs.materials.module.d.ts

@@ -6,8 +6,6 @@ declare module 'babylonjs-materials' {
 
 declare module BABYLON {
     class ShadowOnlyMaterial extends PushMaterial {
-        private _worldViewProjectionMatrix;
-        private _scaledDiffuse;
         private _renderId;
         private _activeLight;
         constructor(name: string, scene: Scene);
@@ -36,7 +34,6 @@ declare module BABYLON {
         offset: number;
         smoothness: number;
         disableLighting: boolean;
-        private _worldViewProjectionMatrix;
         private _scaledDiffuse;
         private _renderId;
         constructor(name: string, scene: Scene);
@@ -64,8 +61,6 @@ declare module BABYLON {
         disableLighting: boolean;
         private _maxSimultaneousLights;
         maxSimultaneousLights: number;
-        private _worldViewProjectionMatrix;
-        private _scaledDiffuse;
         private _renderId;
         constructor(name: string, scene: Scene);
         needAlphaBlending(): boolean;
@@ -101,7 +96,6 @@ declare module BABYLON {
         disableLighting: boolean;
         private _maxSimultaneousLights;
         maxSimultaneousLights: number;
-        private _worldViewProjectionMatrix;
         private _scaledDiffuse;
         private _renderId;
         constructor(name: string, scene: Scene);
@@ -131,8 +125,6 @@ declare module BABYLON {
         disableLighting: boolean;
         private _maxSimultaneousLights;
         maxSimultaneousLights: number;
-        private _worldViewProjectionMatrix;
-        private _scaledDiffuse;
         private _renderId;
         constructor(name: string, scene: Scene);
         needAlphaBlending(): boolean;
@@ -223,7 +215,6 @@ declare module BABYLON {
         private _mesh;
         private _refractionRTT;
         private _reflectionRTT;
-        private _material;
         private _reflectionTransform;
         private _lastTime;
         private _lastDeltaTime;
@@ -312,7 +303,6 @@ declare module BABYLON {
         maxSimultaneousLights: number;
         highLevelFur: boolean;
         _meshes: AbstractMesh[];
-        private _worldViewProjectionMatrix;
         private _renderId;
         private _furTime;
         constructor(name: string, scene: Scene);
@@ -360,7 +350,6 @@ declare module BABYLON {
         disableLighting: boolean;
         private _maxSimultaneousLights;
         maxSimultaneousLights: number;
-        private _worldViewProjectionMatrix;
         private _renderId;
         constructor(name: string, scene: Scene);
         needAlphaBlending(): boolean;
@@ -403,7 +392,6 @@ declare module BABYLON {
         disableLighting: boolean;
         private _maxSimultaneousLights;
         maxSimultaneousLights: number;
-        private _worldViewProjectionMatrix;
         private _renderId;
         constructor(name: string, scene: Scene);
         needAlphaBlending(): boolean;
@@ -851,8 +839,6 @@ declare module BABYLON {
         disableLighting: boolean;
         private _maxSimultaneousLights;
         maxSimultaneousLights: number;
-        private _worldViewProjectionMatrix;
-        private _scaledDiffuse;
         private _renderId;
         constructor(name: string, scene: Scene);
         needAlphaBlending(): boolean;
@@ -1166,7 +1152,6 @@ declare module BABYLON {
          */
         twoSidedLighting: boolean;
         private _renderTargets;
-        private _worldViewProjectionMatrix;
         private _globalAmbientColor;
         private _tempColor;
         private _renderId;
@@ -1199,7 +1184,6 @@ declare module BABYLON {
         unbind(): void;
         bindOnlyWorldMatrix(world: Matrix): void;
         private _myScene;
-        private _myShadowGenerator;
         bind(world: Matrix, mesh?: Mesh): void;
         getAnimatables(): IAnimatable[];
         dispose(forceDisposeEffect?: boolean, forceDisposeTextures?: boolean): void;

+ 0 - 3
dist/preview release/proceduralTexturesLibrary/babylon.grassProceduralTexture.d.ts

@@ -2,9 +2,6 @@
 declare module BABYLON {
     class GrassProceduralTexture extends ProceduralTexture {
         private _grassColors;
-        private _herb1;
-        private _herb2;
-        private _herb3;
         private _groundColor;
         constructor(name: string, size: number, scene: Scene, fallbackTexture?: Texture, generateMipMaps?: boolean);
         updateShaderUniforms(): void;

+ 0 - 3
dist/preview release/proceduralTexturesLibrary/babylon.grassProceduralTexture.js

@@ -15,9 +15,6 @@ var BABYLON;
         __extends(GrassProceduralTexture, _super);
         function GrassProceduralTexture(name, size, scene, fallbackTexture, generateMipMaps) {
             var _this = _super.call(this, name, size, "grassProceduralTexture", scene, fallbackTexture, generateMipMaps) || this;
-            _this._herb1 = new BABYLON.Color3(0.29, 0.38, 0.02);
-            _this._herb2 = new BABYLON.Color3(0.36, 0.49, 0.09);
-            _this._herb3 = new BABYLON.Color3(0.51, 0.6, 0.28);
             _this._groundColor = new BABYLON.Color3(1, 1, 1);
             _this._grassColors = [
                 new BABYLON.Color3(0.29, 0.38, 0.02),

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 1 - 1
dist/preview release/proceduralTexturesLibrary/babylon.grassProceduralTexture.min.js


+ 0 - 3
dist/preview release/proceduralTexturesLibrary/babylonjs.proceduralTextures.js

@@ -263,9 +263,6 @@ var BABYLON;
         __extends(GrassProceduralTexture, _super);
         function GrassProceduralTexture(name, size, scene, fallbackTexture, generateMipMaps) {
             var _this = _super.call(this, name, size, "grassProceduralTexture", scene, fallbackTexture, generateMipMaps) || this;
-            _this._herb1 = new BABYLON.Color3(0.29, 0.38, 0.02);
-            _this._herb2 = new BABYLON.Color3(0.36, 0.49, 0.09);
-            _this._herb3 = new BABYLON.Color3(0.51, 0.6, 0.28);
             _this._groundColor = new BABYLON.Color3(1, 1, 1);
             _this._grassColors = [
                 new BABYLON.Color3(0.29, 0.38, 0.02),

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 1 - 1
dist/preview release/proceduralTexturesLibrary/babylonjs.proceduralTextures.min.js


+ 0 - 3
dist/preview release/proceduralTexturesLibrary/babylonjs.proceduralTextures.module.d.ts

@@ -53,9 +53,6 @@ declare module BABYLON {
 declare module BABYLON {
     class GrassProceduralTexture extends ProceduralTexture {
         private _grassColors;
-        private _herb1;
-        private _herb2;
-        private _herb3;
         private _groundColor;
         constructor(name: string, size: number, scene: Scene, fallbackTexture?: Texture, generateMipMaps?: boolean);
         updateShaderUniforms(): void;

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

@@ -16,7 +16,7 @@
 - Added support for `material.separateCullingPass`. [Doc here](http://doc.babylonjs.com/tutorials/transparency_and_how_meshes_are_rendered#things-to-do-and-not-to-do) ([sebavan](https://github.com/sebavan))
 - Added support for Windows Motion Controllers ([Lewis Weaver](https://github.com/leweaver))
 - Added support for Particle animation in ParticleSystem. [Doc here](http://doc.babylonjs.com/tutorials/particles#particle-animation) ([Ibraheem Osama](https://github.com/IbraheemOsama))
-- More robust TypeScript code with noImplicitAny and noImplicitReturns compiler options ([deltakosh](https://github.com/deltakosh))
+- More robust TypeScript code with *noImplicitAny*, *noImplicitThis* and *noImplicitReturns* compiler options ([deltakosh](https://github.com/deltakosh))
 
 ## Updates
 - Added `MultiObserver`. [Doc here](http://doc.babylonjs.com/overviews/observables#multiobserver) ([deltakosh](https://github.com/deltakosh))

+ 0 - 1
gui/src/advancedDynamicTexture.ts

@@ -282,7 +282,6 @@ module BABYLON.GUI {
         }
 
         private _render(): void {
-            var engine = this.getScene().getEngine();
             var textureSize = this.getSize();
             var renderWidth = textureSize.width;
             var renderHeight = textureSize.height;

+ 0 - 2
gui/src/controls/control.ts

@@ -14,7 +14,6 @@ module BABYLON.GUI {
         private _font: string;
         public _width = new ValueAndUnit(1, ValueAndUnit.UNITMODE_PERCENTAGE, false);
         public _height = new ValueAndUnit(1, ValueAndUnit.UNITMODE_PERCENTAGE, false);
-        private _lastMeasuredFont: string;
         protected _fontOffset: {ascent: number, height: number, descent: number};
         private _color = "";
         protected _horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_CENTER;
@@ -510,7 +509,6 @@ module BABYLON.GUI {
             this.horizontalAlignment = BABYLON.GUI.Control.HORIZONTAL_ALIGNMENT_LEFT;
             this.verticalAlignment = BABYLON.GUI.Control.VERTICAL_ALIGNMENT_TOP;
 
-            var engine = scene.getEngine();
             var globalViewport = this._host._getGlobalViewport(scene);
             var projectedPosition = Vector3.Project(position, Matrix.Identity(), scene.getTransformMatrix(), globalViewport);
 

+ 0 - 1
gui/src/controls/line.ts

@@ -3,7 +3,6 @@
 module BABYLON.GUI {
     export class Line extends Control {
         private _lineWidth = 1;
-        private _background: string;
         private _x1 = new ValueAndUnit(0);
         private _y1 = new ValueAndUnit(0);
         private _x2 = new ValueAndUnit(0);

+ 0 - 3
gui/src/controls/textBlock.ts

@@ -3,13 +3,11 @@
 module BABYLON.GUI {
     export class TextBlock extends Control {
         private _text = "";
-        private _textY: number;
         private _textWrapping = false;
         private _textHorizontalAlignment = Control.HORIZONTAL_ALIGNMENT_CENTER;
         private _textVerticalAlignment = Control.VERTICAL_ALIGNMENT_CENTER;
 
         private _lines: any[];
-        private _totalHeight: number;
         private _resizeToFit: boolean = false;
 
         /**
@@ -167,7 +165,6 @@ module BABYLON.GUI {
         }
 
         protected _renderLines(context: CanvasRenderingContext2D): void {
-            var width = this._currentMeasure.width;
             var height = this._currentMeasure.height;
 
             if (!this._fontOffset) {

+ 3 - 1
gui/src/tsconfig.json

@@ -4,6 +4,8 @@
     "module": "commonjs",
     "target": "es5",
     "noImplicitAny": true,
-    "noImplicitReturns": true
+    "noImplicitReturns": true,
+    "noImplicitThis": true,
+    "noUnusedLocals": true
   }
 }

+ 0 - 3
inspector/src/Inspector.ts

@@ -9,8 +9,6 @@ module INSPECTOR {
         private _tabPanel: HTMLElement;
         /** The panel containing the list if items */
         // private _treePanel   : HTMLElement;
-        /** The list if tree items displayed in the tree panel. */
-        private _items: Array<TreeItem>;
         private _tabbar: TabBar;
         private _scene: BABYLON.Scene;
         /** The HTML document relative to this inspector (the window or the popup depending on its mode) */
@@ -75,7 +73,6 @@ module INSPECTOR {
                 // Get canvas and its DOM parent
                 let canvas = this._scene.getEngine().getRenderingCanvas();
                 let canvasParent = canvas.parentElement;
-                let canvasParentComputedStyle = Inspector.WINDOW.getComputedStyle(canvasParent);
 
                 // get canvas style                
                 let canvasComputedStyle = Inspector.WINDOW.getComputedStyle(canvas);

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

@@ -78,7 +78,6 @@ module INSPECTOR {
          */
         private _drawAxis() {
             this._obj.computeWorldMatrix();
-            var m = this._obj.getWorldMatrix();
 
             // Axis
             var x = new BABYLON.Vector3(8 / (this._obj as BABYLON.AbstractMesh).scaling.x, 0, 0);

+ 0 - 12
inspector/src/details/PropertyLine.ts

@@ -61,9 +61,6 @@ module INSPECTOR {
         private _onMouseDragHandler: EventListener;
         private _onMouseUpHandler: EventListener;
 
-        private _sliderfill: HTMLElement;
-        private _slidertrack: HTMLElement;
-
         private _textValue: HTMLElement;
         /** Save previous Y mouse position */
         private _prevY: number;
@@ -337,14 +334,6 @@ module INSPECTOR {
         }
 
         /**
-         * Returns true if the given instance is a simple type  
-         */
-        private static _IS_TYPE_SIMPLE(inst: any) {
-            let type = Helpers.GET_TYPE(inst);
-            return PropertyLine._SIMPLE_TYPE.indexOf(type) != -1;
-        }
-
-        /**
          * Returns true if the type of this property is simple, false otherwise.
          * Returns true if the value is null
          */
@@ -394,7 +383,6 @@ module INSPECTOR {
                 if (this._children.length == 0) {
                     let objToDetail = this.value;
                     let propToDisplay = (<any>PROPERTIES)[Helpers.GET_TYPE(objToDetail)].properties.slice().reverse();
-                    let propertyLine = null;
 
                     for (let prop of propToDisplay) {
                         let infos = new Property(prop, this._property.value);

+ 1 - 1
inspector/src/gui/ColorElement.ts

@@ -24,7 +24,7 @@
                 let b = (color.b * 255) | 0;
                 let a = 1;
                 if (color instanceof BABYLON.Color4) {
-                    let a = (color as BABYLON.Color4).a;
+                    a = (color as BABYLON.Color4).a;
                 }
                 return `rgba(${r}, ${g}, ${b}, ${a})`;
             } else {

+ 1 - 1
inspector/src/gui/ColorPickerElement.ts

@@ -52,7 +52,7 @@ module INSPECTOR {
                 let b = (color.b * 255) | 0;
                 let a = 1;
                 if (color instanceof BABYLON.Color4) {
-                    let a = (color as BABYLON.Color4).a;
+                    a = (color as BABYLON.Color4).a;
                 }
                 return `rgba(${r}, ${g}, ${b}, ${a})`;
             } else {

+ 0 - 2
inspector/src/gui/CubeTextureElement.ts

@@ -78,8 +78,6 @@
             this._engine           = new BABYLON.Engine(this._canvas);
             this._scene            = new BABYLON.Scene(this._engine);
             this._scene.clearColor = new BABYLON.Color4(0,0,0, 0);
-            let cam                = new BABYLON.FreeCamera('cam', new BABYLON.Vector3(0,0,-20), this._scene);
-            let light              = new BABYLON.HemisphericLight('', new BABYLON.Vector3(0,1,0), this._scene);
             
             this._engine.runRenderLoop(() => {
                 if (!this._pause) {

+ 3 - 1
inspector/src/tsconfig.json

@@ -4,6 +4,8 @@
         "module": "commonjs", 
         "target": "es5",
         "noImplicitAny": true,
-        "noImplicitReturns": true
+        "noImplicitReturns": true,
+        "noImplicitThis": true,
+        "noUnusedLocals": true
     }
 }

+ 1 - 1
loaders/src/OBJ/babylon.objFileLoader.ts

@@ -20,7 +20,7 @@ module BABYLON {
          * @param data
          * @param rootUrl
          */
-        public parseMTL = function (scene: BABYLON.Scene, data: string, rootUrl: string) {
+        public parseMTL(scene: BABYLON.Scene, data: string, rootUrl: string) {
             //Split the lines from the file
             var lines = data.split('\n');
             //Space char

+ 0 - 32
loaders/src/glTF/1.0/babylon.glTFBinaryExtension.ts

@@ -3,10 +3,6 @@
 module BABYLON.GLTF1 {
     const BinaryExtensionBufferName = "binary_glTF";
 
-    enum EContentFormat {
-        JSON = 0
-    };
-
     interface IGLTFBinaryExtensionShader {
         bufferView: string;
     };
@@ -82,33 +78,5 @@ module BABYLON.GLTF1 {
         }
     }
 
-    class BinaryReader {
-        private _arrayBuffer: ArrayBuffer;
-        private _dataView: DataView;
-        private _byteOffset: number;
-
-        constructor(arrayBuffer: ArrayBuffer) {
-            this._arrayBuffer = arrayBuffer;
-            this._dataView = new DataView(arrayBuffer);
-            this._byteOffset = 0;
-        }
-
-        public getUint32(): number {
-            var value = this._dataView.getUint32(this._byteOffset, true);
-            this._byteOffset += 4;
-            return value;
-        }
-
-        public getUint8Array(length?: number): Uint8Array {
-            if (!length) {
-                length = this._arrayBuffer.byteLength - this._byteOffset;
-            }
-
-            var value = new Uint8Array(this._arrayBuffer, this._byteOffset, length);
-            this._byteOffset += length;
-            return value;
-        }
-    }
-
     GLTFLoader.RegisterExtension(new GLTFBinaryExtension());
 }

+ 2 - 38
loaders/src/glTF/1.0/babylon.glTFLoader.ts

@@ -110,14 +110,6 @@ module BABYLON.GLTF1 {
         }
     };
 
-    var replaceInString = (str: string, searchValue: string, replaceValue: string) => {
-        while (str.indexOf(searchValue) !== -1) {
-            str = str.replace(searchValue, replaceValue);
-        }
-
-        return str;
-    };
-
     var getAttribute = (attributeParameter: IGLTFTechniqueParameter): string => {
         if (attributeParameter.semantic === "NORMAL") {
             return "normal";
@@ -137,18 +129,6 @@ module BABYLON.GLTF1 {
         return null;
     };
 
-    /**
-    * Returns the animation path (glTF -> Babylon)
-    */
-    var getAnimationPath = (path: string): string => {
-        var index = glTFAnimationPaths.indexOf(path);
-
-        if (index !== -1) {
-            return babylonAnimationPaths[index];
-        }
-
-        return path;
-    };
 
     /**
     * Loads and creates animations
@@ -458,15 +438,6 @@ module BABYLON.GLTF1 {
         }
     };
 
-    var printMat = (m: Float32Array) => {
-        console.log(
-            m[0] + "\t" + m[1] + "\t" + m[2] + "\t" + m[3] + "\n" +
-            m[4] + "\t" + m[5] + "\t" + m[6] + "\t" + m[7] + "\n" +
-            m[8] + "\t" + m[9] + "\t" + m[10] + "\t" + m[11] + "\n" +
-            m[12] + "\t" + m[13] + "\t" + m[14] + "\t" + m[15] + "\n"
-        );
-    }
-
     /**
     * Imports a skeleton
     */
@@ -480,12 +451,6 @@ module BABYLON.GLTF1 {
             return newSkeleton;
         }
 
-        // Matrices
-        var accessor = gltfRuntime.accessors[skins.inverseBindMatrices];
-        var buffer = GLTFUtils.GetBufferFromAccessor(gltfRuntime, accessor);
-
-        var bindShapeMatrix = Matrix.FromArray(skins.bindShapeMatrix);
-
         // Find the root bones
         var nodesToRoot: INodeToRoot[] = [];
         var nodesToRootToAdd: Bone[] = [];
@@ -740,7 +705,7 @@ module BABYLON.GLTF1 {
                     //continue;
                 }
 
-                var subMesh = new SubMesh(index, verticesStarts[index], verticesCounts[index], indexStarts[index], indexCounts[index], newMesh, newMesh, true);
+                SubMesh.AddToMesh(index, verticesStarts[index], verticesCounts[index], indexStarts[index], indexCounts[index], newMesh, newMesh, true);
                 index++;
             }
         }
@@ -889,7 +854,6 @@ module BABYLON.GLTF1 {
 
             if (camera) {
                 if (camera.type === "orthographic") {
-                    var orthographicCamera: IGLTFCameraOrthographic = (<any>camera)[camera.type];
                     var orthoCamera = new FreeCamera(node.camera, Vector3.Zero(), gltfRuntime.scene);
 
                     orthoCamera.name = node.name;
@@ -1551,7 +1515,7 @@ module BABYLON.GLTF1 {
         public importMeshAsync(meshesNames: any, scene: Scene, data: IGLTFLoaderData, rootUrl: string, onSuccess: (meshes: AbstractMesh[], particleSystems: ParticleSystem[], skeletons: Skeleton[]) => void, onProgress: (event: ProgressEvent) => void, onError: (message: string) => void): boolean {
             scene.useRightHandedSystem = true;
 
-            var gltfRuntime = GLTFLoaderExtension.LoadRuntimeAsync(scene, data, rootUrl, gltfRuntime => {
+            GLTFLoaderExtension.LoadRuntimeAsync(scene, data, rootUrl, gltfRuntime => {
                 gltfRuntime.importOnlyMeshes = true;
 
                 if (meshesNames === "") {

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

@@ -413,7 +413,7 @@ module BABYLON.GLTF2 {
 
                         for (var index = 0; index < subMeshInfos.length; index++) {
                             var info = subMeshInfos[index];
-                            new SubMesh(index, info.verticesStart, info.verticesCount, info.indicesStart, info.indicesCount, node.babylonMesh);
+                            SubMesh.AddToMesh(index, info.verticesStart, info.verticesCount, info.indicesStart, info.indicesCount, node.babylonMesh);
                             info.loadMaterial(index);
                         }
                     }

+ 3 - 1
loaders/src/tsconfig.json

@@ -7,6 +7,8 @@
     "sourceMap": true,
     "lib": ["dom", "es2015.promise", "es5"],
     "noImplicitAny": true,
-    "noImplicitReturns": true
+    "noImplicitReturns": true,
+    "noImplicitThis": true,
+    "noUnusedLocals": true
   }
 }

+ 0 - 2
materialsLibrary/src/cell/babylon.cellMaterial.ts

@@ -50,8 +50,6 @@ module BABYLON {
         @expandToProperty("_markAllSubMeshesAsLightsDirty")
         public maxSimultaneousLights: number; 
 
-        private _worldViewProjectionMatrix = Matrix.Zero();
-        private _scaledDiffuse = new Color3();
         private _renderId: number;
 
         constructor(name: string, scene: Scene) {

+ 2 - 2
materialsLibrary/src/custom/babylon.customMaterial.ts

@@ -1015,9 +1015,9 @@ module BABYLON {
                             this._uniformBuffer.updateMatrix("bumpMatrix", this._bumpTexture.getTextureMatrix());
 
                             if (scene._mirroredCameraPosition) {
-                                this._uniformBuffer.updateFloat2("vTangentSpaceParams", this.invertNormalMapX ? 1.0 : -1.0, this.invertNormalMapY ? 1.0 : -1.0);
+                                this._uniformBuffer.updateFloat2("vTangentSpaceParams", this._invertNormalMapX ? 1.0 : -1.0, this._invertNormalMapY ? 1.0 : -1.0);
                             } else {
-                                this._uniformBuffer.updateFloat2("vTangentSpaceParams", this.invertNormalMapX ? -1.0 : 1.0, this.invertNormalMapY ? -1.0 : 1.0);
+                                this._uniformBuffer.updateFloat2("vTangentSpaceParams", this._invertNormalMapX ? -1.0 : 1.0, this._invertNormalMapY ? -1.0 : 1.0);
                             }
                         }
 

+ 0 - 1
materialsLibrary/src/fur/babylon.furMaterial.ts

@@ -82,7 +82,6 @@ module BABYLON {
                
         public _meshes: AbstractMesh[];
 
-        private _worldViewProjectionMatrix = Matrix.Zero();
         private _renderId: number;
         
         private _furTime: number = 0;

+ 0 - 2
materialsLibrary/src/gradient/babylon.gradientMaterial.ts

@@ -86,8 +86,6 @@ module BABYLON {
 
         @serialize()
         public disableLighting = false;
-
-        private _worldViewProjectionMatrix = Matrix.Zero();
         private _scaledDiffuse = new Color3();
         private _renderId: number;
 

+ 0 - 2
materialsLibrary/src/grid/babylon.gridmaterial.ts

@@ -106,8 +106,6 @@ module BABYLON {
                 }
             }
 
-            var engine = scene.getEngine();
-
             if (defines.TRANSPARENT !== (this.opacity < 1.0)) {
                 defines.TRANSPARENT = !defines.TRANSPARENT;
                 defines.markAsUnprocessed();

+ 0 - 0
materialsLibrary/src/lava/babylon.lavaMaterial.ts


Vissa filer visades inte eftersom för många filer har ändrats