Просмотр исходного кода

Merge remote-tracking branch 'BabylonJS/master' into extending-animations

Raanan Weber 7 лет назад
Родитель
Сommit
a5e214ff9d
35 измененных файлов с 13884 добавлено и 13765 удалено
  1. 14 1
      .vscode/launch.json
  2. 3942 3939
      Playground/babylon.d.txt
  3. 18 20
      Tools/Gulp/gulp-addModuleExports.js
  4. 3600 3597
      dist/preview release/babylon.d.ts
  5. 34 34
      dist/preview release/babylon.js
  6. 31 39
      dist/preview release/babylon.max.js
  7. 34 34
      dist/preview release/babylon.worker.js
  8. 5629 5626
      dist/preview release/customConfigurations/minimalGLTFViewer/babylon.d.ts
  9. 49 49
      dist/preview release/customConfigurations/minimalGLTFViewer/babylon.js
  10. 31 39
      dist/preview release/customConfigurations/minimalGLTFViewer/babylon.max.js
  11. 13 3
      dist/preview release/customConfigurations/minimalGLTFViewer/es6.js
  12. 13 3
      dist/preview release/es6.js
  13. 13 20
      dist/preview release/gui/babylon.gui.js
  14. 4 4
      dist/preview release/gui/babylon.gui.min.js
  15. 4 4
      dist/preview release/inspector/babylon.inspector.bundle.js
  16. 13 20
      dist/preview release/loaders/babylonjs.loaders.js
  17. 3 3
      dist/preview release/loaders/babylonjs.loaders.min.js
  18. 13 20
      dist/preview release/materialsLibrary/babylonjs.materials.js
  19. 2 2
      dist/preview release/materialsLibrary/babylonjs.materials.min.js
  20. 13 20
      dist/preview release/postProcessesLibrary/babylonjs.postProcess.js
  21. 1 1
      dist/preview release/postProcessesLibrary/babylonjs.postProcess.min.js
  22. 13 20
      dist/preview release/proceduralTexturesLibrary/babylonjs.proceduralTextures.js
  23. 1 1
      dist/preview release/proceduralTexturesLibrary/babylonjs.proceduralTextures.min.js
  24. 13 20
      dist/preview release/serializers/babylonjs.serializers.js
  25. 1 1
      dist/preview release/serializers/babylonjs.serializers.min.js
  26. 2 7
      dist/preview release/typedocValidationBaseline.json
  27. 63 63
      dist/preview release/viewer/babylon.viewer.js
  28. 141 163
      dist/preview release/viewer/babylon.viewer.max.js
  29. 12 2
      src/Animations/babylon.animationGroup.ts
  30. 1 0
      src/Engine/babylon.engine.ts
  31. 1 1
      src/Mesh/babylon.subMesh.ts
  32. 87 0
      tests/memoryChecks/index.css
  33. 15 0
      tests/memoryChecks/index.html
  34. 38 0
      tests/memoryChecks/index.js
  35. 22 9
      tests/validation/validation.js

+ 14 - 1
.vscode/launch.json

@@ -158,6 +158,19 @@
             "reAttach": true,
             "webRoot": "${workspaceRoot}/",
             "url": "http://localhost:1338/tests/validation/index.html"
-        }
+        },
+        {
+            "name": "Launch memory checks (Chrome)",
+            "type": "chrome",
+            "request": "launch",
+            "url": "http://localhost:1338/tests/memoryChecks/index.html",
+            "webRoot": "${workspaceRoot}/",
+            "sourceMaps": true,
+            "preLaunchTask": "run",
+            "userDataDir": "${workspaceRoot}/.tempChromeProfileForDebug",
+            "runtimeArgs": [
+                "--enable-unsafe-es3-apis"
+            ]
+        },        
     ]
 }

Разница между файлами не показана из-за своего большого размера
+ 3942 - 3939
Playground/babylon.d.txt


+ 18 - 20
Tools/Gulp/gulp-addModuleExports.js

@@ -34,26 +34,20 @@ module.exports = function (varName, config) {
 
             let dependenciesDefinition = `var amdDependencies = [];`;
             let functionVariables = '';
+            let requireText = '';
+            let amdText = '';
+            let afterInitText = '';
             if (config.dependencies) {
                 config.dependencies.forEach(dep => {
                     if (functionVariables) functionVariables += ',';
                     functionVariables += dep.name;
+                    requireText += `        ${dep.optional ? ' try { ' : ''} ${dep.name} = ${dep.name} || require("${dep.module}"); ${dep.optional ? ' } catch(e) {} ' : ''}
+`;
+                    amdText += `        ${dep.optional ? ' if(require.specified && require.specified("' + dep.module + '"))' : ''} amdDependencies.push("${dep.module}");
+`;
                     dependenciesDefinition += `
-    var ${dep.name} = root. ${dep.name};
-    if(!${dep.name}) {
-        if(typeof exports === 'object') {
-            ${dep.optional ? ' try { ' : ''} ${dep.name} = require("${dep.module}"); ${dep.optional ? ' } catch(e) {} ' : ''}
-        } else if(typeof define === 'function' && define.amd) {
-            ${dep.optional ? ' if(require.specified && require.specified("' + dep.module + '"))' : ''} amdDependencies.push("${dep.module}");
-        }
-    } else {
-        if(typeof define === 'function' && define.amd) {
-            if(!(require.specified && require.specified("' + dep.module + '"))) {
-                try { define("${dep.module}", [], function () { return ${dep.name}; }); } catch(e) { }
-            }
-            amdDependencies.push("${dep.module}");
-        }
-    }
+    var ${dep.name} = root.${dep.name};`;
+                    afterInitText += `  ${dep.name} = ${dep.name} || this.${dep.name};
 `
                 });
 
@@ -63,17 +57,21 @@ module.exports = function (varName, config) {
 
             return `\n\n(function universalModuleDefinition(root, factory) {
     ${dependenciesDefinition}
-    if(typeof exports === 'object' && typeof module === 'object')
+    if(typeof exports === 'object' && typeof module === 'object') {
+${requireText}
         module.exports = factory(${functionVariables});
-    else if(typeof define === 'function' && define.amd)
+    } else if(typeof define === 'function' && define.amd) {
+${amdText}
         define("${varName.module}", amdDependencies, factory);
-    else if(typeof exports === 'object')
+    } else if(typeof exports === 'object') {
+${requireText}
         exports["${varName.module}"] = factory(${functionVariables});
-    else {
+    } else {
         root["${base}"]${(config.subModule && !config.extendsRoot) ? '["' + varName.name + '"]' : ''} = factory(${functionVariables});
     }
 })(this, function(${functionVariables}) {
-    ${String(file.contents)}
+${afterInitText}
+${String(file.contents)}
     ${varName.name === 'BABYLON' || varName.name === 'INSPECTOR' ? `
 var globalObject = (typeof global !== 'undefined') ? global : ((typeof window !== 'undefined') ? window : this);
 globalObject["${varName.name}"] = ${varName.name}` : ''}

Разница между файлами не показана из-за своего большого размера
+ 3600 - 3597
dist/preview release/babylon.d.ts


Разница между файлами не показана из-за своего большого размера
+ 34 - 34
dist/preview release/babylon.js


+ 31 - 39
dist/preview release/babylon.max.js

@@ -4,49 +4,31 @@ var __extends=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__p
 
 (function universalModuleDefinition(root, factory) {
     var amdDependencies = [];
-    var CANNON = root. CANNON;
-    if(!CANNON) {
-        if(typeof exports === 'object') {
-             try {  CANNON = require("cannon");  } catch(e) {} 
-        } else if(typeof define === 'function' && define.amd) {
-             if(require.specified && require.specified("cannon")) amdDependencies.push("cannon");
-        }
-    } else {
-        if(typeof define === 'function' && define.amd) {
-            if(!(require.specified && require.specified("' + dep.module + '"))) {
-                try { define("cannon", [], function () { return CANNON; }); } catch(e) { }
-            }
-            amdDependencies.push("cannon");
-        }
-    }
+    var CANNON = root.CANNON;
+    var OIMO = root.OIMO;
+    if(typeof exports === 'object' && typeof module === 'object') {
+         try {  CANNON = CANNON || require("cannon");  } catch(e) {} 
+         try {  OIMO = OIMO || require("oimo");  } catch(e) {} 
 
-    var OIMO = root. OIMO;
-    if(!OIMO) {
-        if(typeof exports === 'object') {
-             try {  OIMO = require("oimo");  } catch(e) {} 
-        } else if(typeof define === 'function' && define.amd) {
-             if(require.specified && require.specified("oimo")) amdDependencies.push("oimo");
-        }
-    } else {
-        if(typeof define === 'function' && define.amd) {
-            if(!(require.specified && require.specified("' + dep.module + '"))) {
-                try { define("oimo", [], function () { return OIMO; }); } catch(e) { }
-            }
-            amdDependencies.push("oimo");
-        }
-    }
-
-    if(typeof exports === 'object' && typeof module === 'object')
         module.exports = factory(CANNON,OIMO);
-    else if(typeof define === 'function' && define.amd)
+    } else if(typeof define === 'function' && define.amd) {
+         if(require.specified && require.specified("cannon")) amdDependencies.push("cannon");
+         if(require.specified && require.specified("oimo")) amdDependencies.push("oimo");
+
         define("babylonjs", amdDependencies, factory);
-    else if(typeof exports === 'object')
+    } else if(typeof exports === 'object') {
+         try {  CANNON = CANNON || require("cannon");  } catch(e) {} 
+         try {  OIMO = OIMO || require("oimo");  } catch(e) {} 
+
         exports["babylonjs"] = factory(CANNON,OIMO);
-    else {
+    } else {
         root["BABYLON"] = factory(CANNON,OIMO);
     }
 })(this, function(CANNON,OIMO) {
-    "use strict";
+  CANNON = CANNON || this.CANNON;
+  OIMO = OIMO || this.OIMO;
+
+"use strict";
 var BABYLON;
 (function (BABYLON) {
     /**
@@ -15120,6 +15102,7 @@ var BABYLON;
             this.releaseEffects();
             // Unbind
             this.unbindAllAttributes();
+            this._boundUniforms = [];
             if (this._dummyFramebuffer) {
                 this._gl.deleteFramebuffer(this._dummyFramebuffer);
             }
@@ -31069,7 +31052,7 @@ var BABYLON;
             return this;
         };
         SubMesh.prototype._checkCollision = function (collider) {
-            var boundingInfo = this._renderingMesh.getBoundingInfo();
+            var boundingInfo = this.getBoundingInfo();
             return boundingInfo._checkCollision(collider);
         };
         /**
@@ -47863,8 +47846,11 @@ var BABYLON;
          * Start all animations on given targets
          * @param loop defines if animations must loop
          * @param speedRatio defines the ratio to apply to animation speed (1 by default)
+         * @param from defines the from key (optional)
+         * @param to defines the to key (optional)
+         * @returns the current animation group
          */
-        AnimationGroup.prototype.start = function (loop, speedRatio) {
+        AnimationGroup.prototype.start = function (loop, speedRatio, from, to) {
             var _this = this;
             if (loop === void 0) { loop = false; }
             if (speedRatio === void 0) { speedRatio = 1; }
@@ -47873,7 +47859,13 @@ var BABYLON;
             }
             var _loop_1 = function () {
                 var targetedAnimation = this_1._targetedAnimations[index];
-                this_1._animatables.push(this_1._scene.beginDirectAnimation(targetedAnimation.target, [targetedAnimation.animation], this_1._from, this_1._to, loop, speedRatio, function () {
+                if (!targetedAnimation.target.animations) {
+                    targetedAnimation.target.animations = [];
+                }
+                if (targetedAnimation.target.animations.indexOf(targetedAnimation.animation) === -1) {
+                    targetedAnimation.target.animations.push(targetedAnimation.animation);
+                }
+                this_1._animatables.push(this_1._scene.beginDirectAnimation(targetedAnimation.target, [targetedAnimation.animation], from !== undefined ? from : this_1._from, to !== undefined ? to : this_1._to, loop, speedRatio, function () {
                     _this.onAnimationEndObservable.notifyObservers(targetedAnimation);
                 }));
             };

Разница между файлами не показана из-за своего большого размера
+ 34 - 34
dist/preview release/babylon.worker.js


Разница между файлами не показана из-за своего большого размера
+ 5629 - 5626
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.d.ts


Разница между файлами не показана из-за своего большого размера
+ 49 - 49
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.js


+ 31 - 39
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.max.js

@@ -4,49 +4,31 @@ var __extends=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__p
 
 (function universalModuleDefinition(root, factory) {
     var amdDependencies = [];
-    var CANNON = root. CANNON;
-    if(!CANNON) {
-        if(typeof exports === 'object') {
-             try {  CANNON = require("cannon");  } catch(e) {} 
-        } else if(typeof define === 'function' && define.amd) {
-             if(require.specified && require.specified("cannon")) amdDependencies.push("cannon");
-        }
-    } else {
-        if(typeof define === 'function' && define.amd) {
-            if(!(require.specified && require.specified("' + dep.module + '"))) {
-                try { define("cannon", [], function () { return CANNON; }); } catch(e) { }
-            }
-            amdDependencies.push("cannon");
-        }
-    }
+    var CANNON = root.CANNON;
+    var OIMO = root.OIMO;
+    if(typeof exports === 'object' && typeof module === 'object') {
+         try {  CANNON = CANNON || require("cannon");  } catch(e) {} 
+         try {  OIMO = OIMO || require("oimo");  } catch(e) {} 
 
-    var OIMO = root. OIMO;
-    if(!OIMO) {
-        if(typeof exports === 'object') {
-             try {  OIMO = require("oimo");  } catch(e) {} 
-        } else if(typeof define === 'function' && define.amd) {
-             if(require.specified && require.specified("oimo")) amdDependencies.push("oimo");
-        }
-    } else {
-        if(typeof define === 'function' && define.amd) {
-            if(!(require.specified && require.specified("' + dep.module + '"))) {
-                try { define("oimo", [], function () { return OIMO; }); } catch(e) { }
-            }
-            amdDependencies.push("oimo");
-        }
-    }
-
-    if(typeof exports === 'object' && typeof module === 'object')
         module.exports = factory(CANNON,OIMO);
-    else if(typeof define === 'function' && define.amd)
+    } else if(typeof define === 'function' && define.amd) {
+         if(require.specified && require.specified("cannon")) amdDependencies.push("cannon");
+         if(require.specified && require.specified("oimo")) amdDependencies.push("oimo");
+
         define("babylonjs", amdDependencies, factory);
-    else if(typeof exports === 'object')
+    } else if(typeof exports === 'object') {
+         try {  CANNON = CANNON || require("cannon");  } catch(e) {} 
+         try {  OIMO = OIMO || require("oimo");  } catch(e) {} 
+
         exports["babylonjs"] = factory(CANNON,OIMO);
-    else {
+    } else {
         root["BABYLON"] = factory(CANNON,OIMO);
     }
 })(this, function(CANNON,OIMO) {
-    "use strict";
+  CANNON = CANNON || this.CANNON;
+  OIMO = OIMO || this.OIMO;
+
+"use strict";
 var BABYLON;
 (function (BABYLON) {
     /**
@@ -15120,6 +15102,7 @@ var BABYLON;
             this.releaseEffects();
             // Unbind
             this.unbindAllAttributes();
+            this._boundUniforms = [];
             if (this._dummyFramebuffer) {
                 this._gl.deleteFramebuffer(this._dummyFramebuffer);
             }
@@ -31069,7 +31052,7 @@ var BABYLON;
             return this;
         };
         SubMesh.prototype._checkCollision = function (collider) {
-            var boundingInfo = this._renderingMesh.getBoundingInfo();
+            var boundingInfo = this.getBoundingInfo();
             return boundingInfo._checkCollision(collider);
         };
         /**
@@ -47863,8 +47846,11 @@ var BABYLON;
          * Start all animations on given targets
          * @param loop defines if animations must loop
          * @param speedRatio defines the ratio to apply to animation speed (1 by default)
+         * @param from defines the from key (optional)
+         * @param to defines the to key (optional)
+         * @returns the current animation group
          */
-        AnimationGroup.prototype.start = function (loop, speedRatio) {
+        AnimationGroup.prototype.start = function (loop, speedRatio, from, to) {
             var _this = this;
             if (loop === void 0) { loop = false; }
             if (speedRatio === void 0) { speedRatio = 1; }
@@ -47873,7 +47859,13 @@ var BABYLON;
             }
             var _loop_1 = function () {
                 var targetedAnimation = this_1._targetedAnimations[index];
-                this_1._animatables.push(this_1._scene.beginDirectAnimation(targetedAnimation.target, [targetedAnimation.animation], this_1._from, this_1._to, loop, speedRatio, function () {
+                if (!targetedAnimation.target.animations) {
+                    targetedAnimation.target.animations = [];
+                }
+                if (targetedAnimation.target.animations.indexOf(targetedAnimation.animation) === -1) {
+                    targetedAnimation.target.animations.push(targetedAnimation.animation);
+                }
+                this_1._animatables.push(this_1._scene.beginDirectAnimation(targetedAnimation.target, [targetedAnimation.animation], from !== undefined ? from : this_1._from, to !== undefined ? to : this_1._to, loop, speedRatio, function () {
                     _this.onAnimationEndObservable.notifyObservers(targetedAnimation);
                 }));
             };

+ 13 - 3
dist/preview release/customConfigurations/minimalGLTFViewer/es6.js

@@ -15074,6 +15074,7 @@ var BABYLON;
             this.releaseEffects();
             // Unbind
             this.unbindAllAttributes();
+            this._boundUniforms = [];
             if (this._dummyFramebuffer) {
                 this._gl.deleteFramebuffer(this._dummyFramebuffer);
             }
@@ -31023,7 +31024,7 @@ var BABYLON;
             return this;
         };
         SubMesh.prototype._checkCollision = function (collider) {
-            var boundingInfo = this._renderingMesh.getBoundingInfo();
+            var boundingInfo = this.getBoundingInfo();
             return boundingInfo._checkCollision(collider);
         };
         /**
@@ -47817,8 +47818,11 @@ var BABYLON;
          * Start all animations on given targets
          * @param loop defines if animations must loop
          * @param speedRatio defines the ratio to apply to animation speed (1 by default)
+         * @param from defines the from key (optional)
+         * @param to defines the to key (optional)
+         * @returns the current animation group
          */
-        AnimationGroup.prototype.start = function (loop, speedRatio) {
+        AnimationGroup.prototype.start = function (loop, speedRatio, from, to) {
             var _this = this;
             if (loop === void 0) { loop = false; }
             if (speedRatio === void 0) { speedRatio = 1; }
@@ -47827,7 +47831,13 @@ var BABYLON;
             }
             var _loop_1 = function () {
                 var targetedAnimation = this_1._targetedAnimations[index];
-                this_1._animatables.push(this_1._scene.beginDirectAnimation(targetedAnimation.target, [targetedAnimation.animation], this_1._from, this_1._to, loop, speedRatio, function () {
+                if (!targetedAnimation.target.animations) {
+                    targetedAnimation.target.animations = [];
+                }
+                if (targetedAnimation.target.animations.indexOf(targetedAnimation.animation) === -1) {
+                    targetedAnimation.target.animations.push(targetedAnimation.animation);
+                }
+                this_1._animatables.push(this_1._scene.beginDirectAnimation(targetedAnimation.target, [targetedAnimation.animation], from !== undefined ? from : this_1._from, to !== undefined ? to : this_1._to, loop, speedRatio, function () {
                     _this.onAnimationEndObservable.notifyObservers(targetedAnimation);
                 }));
             };

+ 13 - 3
dist/preview release/es6.js

@@ -15074,6 +15074,7 @@ var BABYLON;
             this.releaseEffects();
             // Unbind
             this.unbindAllAttributes();
+            this._boundUniforms = [];
             if (this._dummyFramebuffer) {
                 this._gl.deleteFramebuffer(this._dummyFramebuffer);
             }
@@ -31023,7 +31024,7 @@ var BABYLON;
             return this;
         };
         SubMesh.prototype._checkCollision = function (collider) {
-            var boundingInfo = this._renderingMesh.getBoundingInfo();
+            var boundingInfo = this.getBoundingInfo();
             return boundingInfo._checkCollision(collider);
         };
         /**
@@ -47817,8 +47818,11 @@ var BABYLON;
          * Start all animations on given targets
          * @param loop defines if animations must loop
          * @param speedRatio defines the ratio to apply to animation speed (1 by default)
+         * @param from defines the from key (optional)
+         * @param to defines the to key (optional)
+         * @returns the current animation group
          */
-        AnimationGroup.prototype.start = function (loop, speedRatio) {
+        AnimationGroup.prototype.start = function (loop, speedRatio, from, to) {
             var _this = this;
             if (loop === void 0) { loop = false; }
             if (speedRatio === void 0) { speedRatio = 1; }
@@ -47827,7 +47831,13 @@ var BABYLON;
             }
             var _loop_1 = function () {
                 var targetedAnimation = this_1._targetedAnimations[index];
-                this_1._animatables.push(this_1._scene.beginDirectAnimation(targetedAnimation.target, [targetedAnimation.animation], this_1._from, this_1._to, loop, speedRatio, function () {
+                if (!targetedAnimation.target.animations) {
+                    targetedAnimation.target.animations = [];
+                }
+                if (targetedAnimation.target.animations.indexOf(targetedAnimation.animation) === -1) {
+                    targetedAnimation.target.animations.push(targetedAnimation.animation);
+                }
+                this_1._animatables.push(this_1._scene.beginDirectAnimation(targetedAnimation.target, [targetedAnimation.animation], from !== undefined ? from : this_1._from, to !== undefined ? to : this_1._to, loop, speedRatio, function () {
                     _this.onAnimationEndObservable.notifyObservers(targetedAnimation);
                 }));
             };

+ 13 - 20
dist/preview release/gui/babylon.gui.js

@@ -4,33 +4,26 @@ var __extends=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__p
 
 (function universalModuleDefinition(root, factory) {
     var amdDependencies = [];
-    var BABYLON = root. BABYLON;
-    if(!BABYLON) {
-        if(typeof exports === 'object') {
-             BABYLON = require("babylonjs"); 
-        } else if(typeof define === 'function' && define.amd) {
-             amdDependencies.push("babylonjs");
-        }
-    } else {
-        if(typeof define === 'function' && define.amd) {
-            if(!(require.specified && require.specified("' + dep.module + '"))) {
-                try { define("babylonjs", [], function () { return BABYLON; }); } catch(e) { }
-            }
-            amdDependencies.push("babylonjs");
-        }
-    }
+    var BABYLON = root.BABYLON;
+    if(typeof exports === 'object' && typeof module === 'object') {
+         BABYLON = BABYLON || require("babylonjs"); 
 
-    if(typeof exports === 'object' && typeof module === 'object')
         module.exports = factory(BABYLON);
-    else if(typeof define === 'function' && define.amd)
+    } else if(typeof define === 'function' && define.amd) {
+         amdDependencies.push("babylonjs");
+
         define("babylonjs-gui", amdDependencies, factory);
-    else if(typeof exports === 'object')
+    } else if(typeof exports === 'object') {
+         BABYLON = BABYLON || require("babylonjs"); 
+
         exports["babylonjs-gui"] = factory(BABYLON);
-    else {
+    } else {
         root["BABYLON"]["GUI"] = factory(BABYLON);
     }
 })(this, function(BABYLON) {
-    "use strict";
+  BABYLON = BABYLON || this.BABYLON;
+
+"use strict";
 /// <reference path="../../dist/preview release/babylon.d.ts"/>
 
 var BABYLON;

Разница между файлами не показана из-за своего большого размера
+ 4 - 4
dist/preview release/gui/babylon.gui.min.js


Разница между файлами не показана из-за своего большого размера
+ 4 - 4
dist/preview release/inspector/babylon.inspector.bundle.js


+ 13 - 20
dist/preview release/loaders/babylonjs.loaders.js

@@ -4,33 +4,26 @@ var __extends=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__p
 
 (function universalModuleDefinition(root, factory) {
     var amdDependencies = [];
-    var BABYLON = root. BABYLON;
-    if(!BABYLON) {
-        if(typeof exports === 'object') {
-             BABYLON = require("babylonjs"); 
-        } else if(typeof define === 'function' && define.amd) {
-             amdDependencies.push("babylonjs");
-        }
-    } else {
-        if(typeof define === 'function' && define.amd) {
-            if(!(require.specified && require.specified("' + dep.module + '"))) {
-                try { define("babylonjs", [], function () { return BABYLON; }); } catch(e) { }
-            }
-            amdDependencies.push("babylonjs");
-        }
-    }
+    var BABYLON = root.BABYLON;
+    if(typeof exports === 'object' && typeof module === 'object') {
+         BABYLON = BABYLON || require("babylonjs"); 
 
-    if(typeof exports === 'object' && typeof module === 'object')
         module.exports = factory(BABYLON);
-    else if(typeof define === 'function' && define.amd)
+    } else if(typeof define === 'function' && define.amd) {
+         amdDependencies.push("babylonjs");
+
         define("babylonjs-loaders", amdDependencies, factory);
-    else if(typeof exports === 'object')
+    } else if(typeof exports === 'object') {
+         BABYLON = BABYLON || require("babylonjs"); 
+
         exports["babylonjs-loaders"] = factory(BABYLON);
-    else {
+    } else {
         root["BABYLON"] = factory(BABYLON);
     }
 })(this, function(BABYLON) {
-    "use strict";
+  BABYLON = BABYLON || this.BABYLON;
+
+"use strict";
 
 var BABYLON;
 (function (BABYLON) {

Разница между файлами не показана из-за своего большого размера
+ 3 - 3
dist/preview release/loaders/babylonjs.loaders.min.js


+ 13 - 20
dist/preview release/materialsLibrary/babylonjs.materials.js

@@ -4,33 +4,26 @@ var __extends=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__p
 
 (function universalModuleDefinition(root, factory) {
     var amdDependencies = [];
-    var BABYLON = root. BABYLON;
-    if(!BABYLON) {
-        if(typeof exports === 'object') {
-             BABYLON = require("babylonjs"); 
-        } else if(typeof define === 'function' && define.amd) {
-             amdDependencies.push("babylonjs");
-        }
-    } else {
-        if(typeof define === 'function' && define.amd) {
-            if(!(require.specified && require.specified("' + dep.module + '"))) {
-                try { define("babylonjs", [], function () { return BABYLON; }); } catch(e) { }
-            }
-            amdDependencies.push("babylonjs");
-        }
-    }
+    var BABYLON = root.BABYLON;
+    if(typeof exports === 'object' && typeof module === 'object') {
+         BABYLON = BABYLON || require("babylonjs"); 
 
-    if(typeof exports === 'object' && typeof module === 'object')
         module.exports = factory(BABYLON);
-    else if(typeof define === 'function' && define.amd)
+    } else if(typeof define === 'function' && define.amd) {
+         amdDependencies.push("babylonjs");
+
         define("babylonjs-materials", amdDependencies, factory);
-    else if(typeof exports === 'object')
+    } else if(typeof exports === 'object') {
+         BABYLON = BABYLON || require("babylonjs"); 
+
         exports["babylonjs-materials"] = factory(BABYLON);
-    else {
+    } else {
         root["BABYLON"] = factory(BABYLON);
     }
 })(this, function(BABYLON) {
-    "use strict";
+  BABYLON = BABYLON || this.BABYLON;
+
+"use strict";
 
 
 var BABYLON;

Разница между файлами не показана из-за своего большого размера
+ 2 - 2
dist/preview release/materialsLibrary/babylonjs.materials.min.js


+ 13 - 20
dist/preview release/postProcessesLibrary/babylonjs.postProcess.js

@@ -4,33 +4,26 @@ var __extends=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__p
 
 (function universalModuleDefinition(root, factory) {
     var amdDependencies = [];
-    var BABYLON = root. BABYLON;
-    if(!BABYLON) {
-        if(typeof exports === 'object') {
-             BABYLON = require("babylonjs"); 
-        } else if(typeof define === 'function' && define.amd) {
-             amdDependencies.push("babylonjs");
-        }
-    } else {
-        if(typeof define === 'function' && define.amd) {
-            if(!(require.specified && require.specified("' + dep.module + '"))) {
-                try { define("babylonjs", [], function () { return BABYLON; }); } catch(e) { }
-            }
-            amdDependencies.push("babylonjs");
-        }
-    }
+    var BABYLON = root.BABYLON;
+    if(typeof exports === 'object' && typeof module === 'object') {
+         BABYLON = BABYLON || require("babylonjs"); 
 
-    if(typeof exports === 'object' && typeof module === 'object')
         module.exports = factory(BABYLON);
-    else if(typeof define === 'function' && define.amd)
+    } else if(typeof define === 'function' && define.amd) {
+         amdDependencies.push("babylonjs");
+
         define("babylonjs-post-process", amdDependencies, factory);
-    else if(typeof exports === 'object')
+    } else if(typeof exports === 'object') {
+         BABYLON = BABYLON || require("babylonjs"); 
+
         exports["babylonjs-post-process"] = factory(BABYLON);
-    else {
+    } else {
         root["BABYLON"] = factory(BABYLON);
     }
 })(this, function(BABYLON) {
-    "use strict";
+  BABYLON = BABYLON || this.BABYLON;
+
+"use strict";
 
 
 

Разница между файлами не показана из-за своего большого размера
+ 1 - 1
dist/preview release/postProcessesLibrary/babylonjs.postProcess.min.js


+ 13 - 20
dist/preview release/proceduralTexturesLibrary/babylonjs.proceduralTextures.js

@@ -4,33 +4,26 @@ var __extends=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__p
 
 (function universalModuleDefinition(root, factory) {
     var amdDependencies = [];
-    var BABYLON = root. BABYLON;
-    if(!BABYLON) {
-        if(typeof exports === 'object') {
-             BABYLON = require("babylonjs"); 
-        } else if(typeof define === 'function' && define.amd) {
-             amdDependencies.push("babylonjs");
-        }
-    } else {
-        if(typeof define === 'function' && define.amd) {
-            if(!(require.specified && require.specified("' + dep.module + '"))) {
-                try { define("babylonjs", [], function () { return BABYLON; }); } catch(e) { }
-            }
-            amdDependencies.push("babylonjs");
-        }
-    }
+    var BABYLON = root.BABYLON;
+    if(typeof exports === 'object' && typeof module === 'object') {
+         BABYLON = BABYLON || require("babylonjs"); 
 
-    if(typeof exports === 'object' && typeof module === 'object')
         module.exports = factory(BABYLON);
-    else if(typeof define === 'function' && define.amd)
+    } else if(typeof define === 'function' && define.amd) {
+         amdDependencies.push("babylonjs");
+
         define("babylonjs-procedural-textures", amdDependencies, factory);
-    else if(typeof exports === 'object')
+    } else if(typeof exports === 'object') {
+         BABYLON = BABYLON || require("babylonjs"); 
+
         exports["babylonjs-procedural-textures"] = factory(BABYLON);
-    else {
+    } else {
         root["BABYLON"] = factory(BABYLON);
     }
 })(this, function(BABYLON) {
-    "use strict";
+  BABYLON = BABYLON || this.BABYLON;
+
+"use strict";
 
 
 var BABYLON;

Разница между файлами не показана из-за своего большого размера
+ 1 - 1
dist/preview release/proceduralTexturesLibrary/babylonjs.proceduralTextures.min.js


+ 13 - 20
dist/preview release/serializers/babylonjs.serializers.js

@@ -4,33 +4,26 @@ var __extends=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__p
 
 (function universalModuleDefinition(root, factory) {
     var amdDependencies = [];
-    var BABYLON = root. BABYLON;
-    if(!BABYLON) {
-        if(typeof exports === 'object') {
-             BABYLON = require("babylonjs"); 
-        } else if(typeof define === 'function' && define.amd) {
-             amdDependencies.push("babylonjs");
-        }
-    } else {
-        if(typeof define === 'function' && define.amd) {
-            if(!(require.specified && require.specified("' + dep.module + '"))) {
-                try { define("babylonjs", [], function () { return BABYLON; }); } catch(e) { }
-            }
-            amdDependencies.push("babylonjs");
-        }
-    }
+    var BABYLON = root.BABYLON;
+    if(typeof exports === 'object' && typeof module === 'object') {
+         BABYLON = BABYLON || require("babylonjs"); 
 
-    if(typeof exports === 'object' && typeof module === 'object')
         module.exports = factory(BABYLON);
-    else if(typeof define === 'function' && define.amd)
+    } else if(typeof define === 'function' && define.amd) {
+         amdDependencies.push("babylonjs");
+
         define("babylonjs-serializers", amdDependencies, factory);
-    else if(typeof exports === 'object')
+    } else if(typeof exports === 'object') {
+         BABYLON = BABYLON || require("babylonjs"); 
+
         exports["babylonjs-serializers"] = factory(BABYLON);
-    else {
+    } else {
         root["BABYLON"] = factory(BABYLON);
     }
 })(this, function(BABYLON) {
-    "use strict";
+  BABYLON = BABYLON || this.BABYLON;
+
+"use strict";
 
 var BABYLON;
 (function (BABYLON) {

Разница между файлами не показана из-за своего большого размера
+ 1 - 1
dist/preview release/serializers/babylonjs.serializers.min.js


+ 2 - 7
dist/preview release/typedocValidationBaseline.json

@@ -1,7 +1,7 @@
 {
-  "errors": 7154,
+  "errors": 7153,
   "babylon.typedoc.json": {
-    "errors": 7154,
+    "errors": 7153,
     "AnimationKeyInterpolation": {
       "Enumeration": {
         "Comments": {
@@ -3143,11 +3143,6 @@
             "MissingReturn": true
           }
         },
-        "start": {
-          "Comments": {
-            "MissingReturn": true
-          }
-        },
         "stop": {
           "Comments": {
             "MissingReturn": true

Разница между файлами не показана из-за своего большого размера
+ 63 - 63
dist/preview release/viewer/babylon.viewer.js


Разница между файлами не показана из-за своего большого размера
+ 141 - 163
dist/preview release/viewer/babylon.viewer.max.js


+ 12 - 2
src/Animations/babylon.animationGroup.ts

@@ -144,15 +144,25 @@ module BABYLON {
          * Start all animations on given targets
          * @param loop defines if animations must loop
          * @param speedRatio defines the ratio to apply to animation speed (1 by default)
+         * @param from defines the from key (optional)
+         * @param to defines the to key (optional)
+         * @returns the current animation group
          */
-        public start(loop = false, speedRatio = 1): AnimationGroup {
+        public start(loop = false, speedRatio = 1, from?: number, to?: number): AnimationGroup {
             if (this._isStarted || this._targetedAnimations.length === 0) {
                 return this;
             }
 
             for (var index = 0; index < this._targetedAnimations.length; index++) {
                 let targetedAnimation = this._targetedAnimations[index];
-                this._animatables.push(this._scene.beginDirectAnimation(targetedAnimation.target, [targetedAnimation.animation], this._from, this._to, loop, speedRatio, () => {
+                if (!targetedAnimation.target.animations) {
+                    targetedAnimation.target.animations = [];
+                }
+                if (targetedAnimation.target.animations.indexOf(targetedAnimation.animation) === -1) {
+                    targetedAnimation.target.animations.push(targetedAnimation.animation);
+                }
+                
+                this._animatables.push(this._scene.beginDirectAnimation(targetedAnimation.target, [targetedAnimation.animation], from !== undefined ? from : this._from, to !== undefined ? to : this._to, loop, speedRatio, () => {
                     this.onAnimationEndObservable.notifyObservers(targetedAnimation);
                 }));
             }

+ 1 - 0
src/Engine/babylon.engine.ts

@@ -5621,6 +5621,7 @@
 
             // Unbind
             this.unbindAllAttributes();
+            this._boundUniforms = [];
 
             if (this._dummyFramebuffer) {
                 this._gl.deleteFramebuffer(this._dummyFramebuffer);

+ 1 - 1
src/Mesh/babylon.subMesh.ts

@@ -153,7 +153,7 @@
         }
 
         public _checkCollision(collider: Collider): boolean {
-            let boundingInfo = this._renderingMesh.getBoundingInfo();
+            let boundingInfo = this.getBoundingInfo();
 
             return boundingInfo._checkCollision(collider);
         }

+ 87 - 0
tests/memoryChecks/index.css

@@ -0,0 +1,87 @@
+html, body {
+    width: 100%;
+    height: 100%;
+    padding: 0;
+    margin: 0;
+    background-color: white;
+}
+
+body {
+    background: url("LogoV3.png");    
+    background-position: center center;
+    background-repeat: no-repeat;
+}
+
+.container {
+    width: calc(100% - 50px);
+    display: flex;
+    flex-wrap: wrap;
+    justify-content: center;
+    align-items: center;
+    background: rgba(255, 255, 255, 0.6);
+    margin: auto;
+    margin-top: 10px;
+    margin-bottom: 10px;
+    outline: 2px solid black;
+    max-width: 1000px;   
+}
+
+.containerTitle {
+    width:100%;
+    order: 1;
+    display: flex;
+    background-color: rgba(0, 0, 0, 0.8);
+    height: 50px;
+}
+
+.title {
+    font-family: 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;
+    font-size: 40px;
+    color: white;
+    text-align: center;
+    margin-left: 20px;
+    order: 1;
+}
+
+.result {
+    color:green;
+    font-size: 30px;
+    order: 2;
+    text-align: center;
+    margin-top: 5px;
+    margin-left: 20px;
+}
+
+.result.failed {
+    color:red;
+}
+
+.waitRing {
+    order: 3;
+    height: 40px;
+    margin-top: 5px;
+    margin-bottom: 5px;
+}
+
+.waitRing.hidden {
+    display: none;
+}
+
+.renderCanvas {
+    position:absolute;
+    transform: translateX(-600px);
+    width: 600px;
+    height: 400px;
+}
+
+.renderImage {
+    order: 1;
+    flex-basis: 50%;
+    width: 50%;
+}
+
+.resultImage {
+    width: 50%;
+    flex-basis: 50%;
+    order: 2;
+}

+ 15 - 0
tests/memoryChecks/index.html

@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html>
+<head>
+	<title>BabylonJS - Build validation page</title>
+	<link href="index.css" rel="stylesheet" />
+	<script src="../../Tools/DevLoader/BabylonLoader.js"></script>
+	<script src="index.js"></script>
+</head>
+<body>
+	<div>
+		<input type="text" id="sceneName" value="sponza"></input>
+		<button id="run">Run</button>
+	</div>
+</body>
+</html>

+ 38 - 0
tests/memoryChecks/index.js

@@ -0,0 +1,38 @@
+BABYLONDEVTOOLS.Loader.require('../validation/validation.js')
+.load(function() {
+    var needInit = false;
+    document.getElementById("run").addEventListener("click", function() {
+        // Loading tests
+        var xhr = new XMLHttpRequest();
+
+        xhr.open("GET", "../validation/config.json", true);
+
+        xhr.addEventListener("load", function () {
+            if (xhr.status === 200) {
+
+                config = JSON.parse(xhr.responseText);
+
+                // Run tests
+                var index = 0;
+
+                if (needInit) {
+                    init();
+                }
+
+                var title = document.getElementById("sceneName").value.toLowerCase();
+                for (var index = 0; index < config.tests.length; index++) {
+                    if (config.tests[index].title.toLowerCase() === title) {
+                        break;
+                    }
+                }
+
+                runTest(index, function() {
+                    dispose();
+                    needInit = true;
+                });
+            }
+        }, false);
+
+        xhr.send();
+    });
+});

+ 22 - 9
tests/validation/validation.js

@@ -124,6 +124,7 @@ function evaluate(test, resultCanvas, result, renderImage, index, waitRing, done
     renderImage.src = renderB64;
 
     currentScene.dispose();
+    currentScene = null;
     engine.setHardwareScalingLevel(1);
 
     done(testRes, renderB64);
@@ -308,13 +309,25 @@ function runTest(index, done) {
     }
 }
 
-BABYLON.SceneLoader.ShowLoadingScreen = false;
-BABYLON.Database.IDBStorageEnabled = false;
-BABYLON.SceneLoader.ForceFullSceneLoadingForIncremental = true;
-BABYLON.DracoCompression.DecoderUrl = BABYLON.Tools.GetFolderPath(document.location.href) + "../../dist/preview%20release/draco_decoder.js";
+function init() {
+    BABYLON.SceneLoader.ShowLoadingScreen = false;
+    BABYLON.SceneLoader.ForceFullSceneLoadingForIncremental = true;
+    BABYLON.DracoCompression.DecoderUrl = BABYLON.Tools.GetFolderPath(document.location.href) + "../../dist/preview%20release/draco_decoder.js";
+
+    canvas = document.createElement("canvas");
+    canvas.className = "renderCanvas";
+    document.body.appendChild(canvas);
+    engine = new BABYLON.Engine(canvas, false);
+    engine.enableOfflineSupport = false;
+    engine.setDitheringState(false);
+}
+
+function dispose() {
+    engine.dispose();
+    currentScene = null;
+    engine = null;
+    document.body.removeChild(canvas);
+    canvas = null;
+}
 
-canvas = document.createElement("canvas");
-canvas.className = "renderCanvas";
-document.body.appendChild(canvas);
-engine = new BABYLON.Engine(canvas, false);
-engine.setDitheringState(false);
+init();