Browse Source

Merge branch 'master' of https://github.com/BabylonJS/Babylon.js

David 7 years ago
parent
commit
dab14b8cbb

File diff suppressed because it is too large
+ 739 - 711
Playground/babylon.d.txt


+ 1 - 0
Tools/Gulp/config.json

@@ -332,6 +332,7 @@
         "animations": {
         "animations": {
             "files": [
             "files": [
                 "../../src/Animations/babylon.animation.js",
                 "../../src/Animations/babylon.animation.js",
+                "../../src/Animations/babylon.animationGroup.js",
                 "../../src/Animations/babylon.runtimeAnimation.js",
                 "../../src/Animations/babylon.runtimeAnimation.js",
                 "../../src/Animations/babylon.animatable.js",
                 "../../src/Animations/babylon.animatable.js",
                 "../../src/Animations/babylon.easing.js"
                 "../../src/Animations/babylon.easing.js"

File diff suppressed because it is too large
+ 737 - 711
dist/preview release/babylon.d.ts


File diff suppressed because it is too large
+ 32 - 32
dist/preview release/babylon.js


+ 118 - 43
dist/preview release/babylon.max.js

@@ -2862,8 +2862,8 @@ var BABYLON;
          */
          */
         Quaternion.RotationQuaternionFromAxisToRef = function (axis1, axis2, axis3, ref) {
         Quaternion.RotationQuaternionFromAxisToRef = function (axis1, axis2, axis3, ref) {
             var rotMat = MathTmp.Matrix[0];
             var rotMat = MathTmp.Matrix[0];
-            BABYLON.Matrix.FromXYZAxesToRef(axis1.normalize(), axis2.normalize(), axis3.normalize(), rotMat);
-            BABYLON.Quaternion.FromRotationMatrixToRef(rotMat, ref);
+            Matrix.FromXYZAxesToRef(axis1.normalize(), axis2.normalize(), axis3.normalize(), rotMat);
+            Quaternion.FromRotationMatrixToRef(rotMat, ref);
         };
         };
         Quaternion.Slerp = function (left, right, amount) {
         Quaternion.Slerp = function (left, right, amount) {
             var result = Quaternion.Identity();
             var result = Quaternion.Identity();
@@ -3801,7 +3801,7 @@ var BABYLON;
             var b = 2.0 / height;
             var b = 2.0 / height;
             var c = 2.0 / (f - n);
             var c = 2.0 / (f - n);
             var d = -(f + n) / (f - n);
             var d = -(f + n) / (f - n);
-            BABYLON.Matrix.FromValuesToRef(a, 0.0, 0.0, 0.0, 0.0, b, 0.0, 0.0, 0.0, 0.0, c, 0.0, 0.0, 0.0, d, 1.0, result);
+            Matrix.FromValuesToRef(a, 0.0, 0.0, 0.0, 0.0, b, 0.0, 0.0, 0.0, 0.0, c, 0.0, 0.0, 0.0, d, 1.0, result);
         };
         };
         /**
         /**
          * Returns a new Matrix as a left-handed orthographic projection matrix computed from the passed floats : left, right, top and bottom being the coordinates of the projection plane, z near and far limits.
          * Returns a new Matrix as a left-handed orthographic projection matrix computed from the passed floats : left, right, top and bottom being the coordinates of the projection plane, z near and far limits.
@@ -3823,7 +3823,7 @@ var BABYLON;
             var d = -(f + n) / (f - n);
             var d = -(f + n) / (f - n);
             var i0 = (left + right) / (left - right);
             var i0 = (left + right) / (left - right);
             var i1 = (top + bottom) / (bottom - top);
             var i1 = (top + bottom) / (bottom - top);
-            BABYLON.Matrix.FromValuesToRef(a, 0.0, 0.0, 0.0, 0.0, b, 0.0, 0.0, 0.0, 0.0, c, 0.0, i0, i1, d, 1.0, result);
+            Matrix.FromValuesToRef(a, 0.0, 0.0, 0.0, 0.0, b, 0.0, 0.0, 0.0, 0.0, c, 0.0, i0, i1, d, 1.0, result);
         };
         };
         /**
         /**
          * Returns a new Matrix as a right-handed orthographic projection matrix computed from the passed floats : left, right, top and bottom being the coordinates of the projection plane, z near and far limits.
          * Returns a new Matrix as a right-handed orthographic projection matrix computed from the passed floats : left, right, top and bottom being the coordinates of the projection plane, z near and far limits.
@@ -3851,7 +3851,7 @@ var BABYLON;
             var b = 2.0 * n / height;
             var b = 2.0 * n / height;
             var c = (f + n) / (f - n);
             var c = (f + n) / (f - n);
             var d = -2.0 * f * n / (f - n);
             var d = -2.0 * f * n / (f - n);
-            BABYLON.Matrix.FromValuesToRef(a, 0.0, 0.0, 0.0, 0.0, b, 0.0, 0.0, 0.0, 0.0, c, 1.0, 0.0, 0.0, d, 0.0, matrix);
+            Matrix.FromValuesToRef(a, 0.0, 0.0, 0.0, 0.0, b, 0.0, 0.0, 0.0, 0.0, c, 1.0, 0.0, 0.0, d, 0.0, matrix);
             return matrix;
             return matrix;
         };
         };
         /**
         /**
@@ -3874,7 +3874,7 @@ var BABYLON;
             var b = isVerticalFovFixed ? t : (t * aspect);
             var b = isVerticalFovFixed ? t : (t * aspect);
             var c = (f + n) / (f - n);
             var c = (f + n) / (f - n);
             var d = -2.0 * f * n / (f - n);
             var d = -2.0 * f * n / (f - n);
-            BABYLON.Matrix.FromValuesToRef(a, 0.0, 0.0, 0.0, 0.0, b, 0.0, 0.0, 0.0, 0.0, c, 1.0, 0.0, 0.0, d, 0.0, result);
+            Matrix.FromValuesToRef(a, 0.0, 0.0, 0.0, 0.0, b, 0.0, 0.0, 0.0, 0.0, c, 1.0, 0.0, 0.0, d, 0.0, result);
         };
         };
         /**
         /**
          * Returns a new Matrix as a right-handed perspective projection matrix computed from the passed floats : vertical angle of view (fov), width/height ratio (aspect), z near and far limits.
          * Returns a new Matrix as a right-handed perspective projection matrix computed from the passed floats : vertical angle of view (fov), width/height ratio (aspect), z near and far limits.
@@ -3900,7 +3900,7 @@ var BABYLON;
             var b = isVerticalFovFixed ? t : (t * aspect);
             var b = isVerticalFovFixed ? t : (t * aspect);
             var c = -(f + n) / (f - n);
             var c = -(f + n) / (f - n);
             var d = -2 * f * n / (f - n);
             var d = -2 * f * n / (f - n);
-            BABYLON.Matrix.FromValuesToRef(a, 0.0, 0.0, 0.0, 0.0, b, 0.0, 0.0, 0.0, 0.0, c, -1.0, 0.0, 0.0, d, 0.0, result);
+            Matrix.FromValuesToRef(a, 0.0, 0.0, 0.0, 0.0, b, 0.0, 0.0, 0.0, 0.0, c, -1.0, 0.0, 0.0, d, 0.0, result);
         };
         };
         /**
         /**
          * Sets the passed matrix "result" as a left-handed perspective projection matrix  for WebVR computed from the passed floats : vertical angle of view (fov), width/height ratio (aspect), z near and far limits.
          * Sets the passed matrix "result" as a left-handed perspective projection matrix  for WebVR computed from the passed floats : vertical angle of view (fov), width/height ratio (aspect), z near and far limits.
@@ -8722,7 +8722,7 @@ var BABYLON;
             // Empty texture
             // Empty texture
             get: function () {
             get: function () {
                 if (!this._emptyTexture) {
                 if (!this._emptyTexture) {
-                    this._emptyTexture = this.createRawTexture(new Uint8Array(4), 1, 1, BABYLON.Engine.TEXTUREFORMAT_RGBA, false, false, BABYLON.Texture.NEAREST_SAMPLINGMODE);
+                    this._emptyTexture = this.createRawTexture(new Uint8Array(4), 1, 1, Engine.TEXTUREFORMAT_RGBA, false, false, BABYLON.Texture.NEAREST_SAMPLINGMODE);
                 }
                 }
                 return this._emptyTexture;
                 return this._emptyTexture;
             },
             },
@@ -8732,7 +8732,7 @@ var BABYLON;
         Object.defineProperty(Engine.prototype, "emptyTexture3D", {
         Object.defineProperty(Engine.prototype, "emptyTexture3D", {
             get: function () {
             get: function () {
                 if (!this._emptyTexture3D) {
                 if (!this._emptyTexture3D) {
-                    this._emptyTexture3D = this.createRawTexture3D(new Uint8Array(4), 1, 1, 1, BABYLON.Engine.TEXTUREFORMAT_RGBA, false, false, BABYLON.Texture.NEAREST_SAMPLINGMODE);
+                    this._emptyTexture3D = this.createRawTexture3D(new Uint8Array(4), 1, 1, 1, Engine.TEXTUREFORMAT_RGBA, false, false, BABYLON.Texture.NEAREST_SAMPLINGMODE);
                 }
                 }
                 return this._emptyTexture3D;
                 return this._emptyTexture3D;
             },
             },
@@ -8744,7 +8744,7 @@ var BABYLON;
                 if (!this._emptyCubeTexture) {
                 if (!this._emptyCubeTexture) {
                     var faceData = new Uint8Array(4);
                     var faceData = new Uint8Array(4);
                     var cubeData = [faceData, faceData, faceData, faceData, faceData, faceData];
                     var cubeData = [faceData, faceData, faceData, faceData, faceData, faceData];
-                    this._emptyCubeTexture = this.createRawCubeTexture(cubeData, 1, BABYLON.Engine.TEXTUREFORMAT_RGBA, BABYLON.Engine.TEXTURETYPE_UNSIGNED_INT, false, false, BABYLON.Texture.NEAREST_SAMPLINGMODE);
+                    this._emptyCubeTexture = this.createRawCubeTexture(cubeData, 1, Engine.TEXTUREFORMAT_RGBA, Engine.TEXTURETYPE_UNSIGNED_INT, false, false, BABYLON.Texture.NEAREST_SAMPLINGMODE);
                 }
                 }
                 return this._emptyCubeTexture;
                 return this._emptyCubeTexture;
             },
             },
@@ -10638,7 +10638,7 @@ var BABYLON;
         };
         };
         Engine.prototype.createRawTexture = function (data, width, height, format, generateMipMaps, invertY, samplingMode, compression, type) {
         Engine.prototype.createRawTexture = function (data, width, height, format, generateMipMaps, invertY, samplingMode, compression, type) {
             if (compression === void 0) { compression = null; }
             if (compression === void 0) { compression = null; }
-            if (type === void 0) { type = BABYLON.Engine.TEXTURETYPE_UNSIGNED_INT; }
+            if (type === void 0) { type = Engine.TEXTURETYPE_UNSIGNED_INT; }
             var texture = new BABYLON.InternalTexture(this, BABYLON.InternalTexture.DATASOURCE_RAW);
             var texture = new BABYLON.InternalTexture(this, BABYLON.InternalTexture.DATASOURCE_RAW);
             texture.baseWidth = width;
             texture.baseWidth = width;
             texture.baseHeight = height;
             texture.baseHeight = height;
@@ -12212,13 +12212,13 @@ var BABYLON;
             if (this._webGLVersion > 1) {
             if (this._webGLVersion > 1) {
                 return this._caps.colorBufferFloat;
                 return this._caps.colorBufferFloat;
             }
             }
-            return this._canRenderToFramebuffer(BABYLON.Engine.TEXTURETYPE_FLOAT);
+            return this._canRenderToFramebuffer(Engine.TEXTURETYPE_FLOAT);
         };
         };
         Engine.prototype._canRenderToHalfFloatFramebuffer = function () {
         Engine.prototype._canRenderToHalfFloatFramebuffer = function () {
             if (this._webGLVersion > 1) {
             if (this._webGLVersion > 1) {
                 return this._caps.colorBufferFloat;
                 return this._caps.colorBufferFloat;
             }
             }
-            return this._canRenderToFramebuffer(BABYLON.Engine.TEXTURETYPE_HALF_FLOAT);
+            return this._canRenderToFramebuffer(Engine.TEXTURETYPE_HALF_FLOAT);
         };
         };
         // Thank you : http://stackoverflow.com/questions/28827511/webgl-ios-render-to-floating-point-texture
         // Thank you : http://stackoverflow.com/questions/28827511/webgl-ios-render-to-floating-point-texture
         Engine.prototype._canRenderToFramebuffer = function (type) {
         Engine.prototype._canRenderToFramebuffer = function (type) {
@@ -15049,11 +15049,12 @@ var BABYLON;
                 for (var _i = 0, descendants_1 = descendants; _i < descendants_1.length; _i++) {
                 for (var _i = 0, descendants_1 = descendants; _i < descendants_1.length; _i++) {
                     var descendant = descendants_1[_i];
                     var descendant = descendants_1[_i];
                     var childMesh = descendant;
                     var childMesh = descendant;
-                    childMesh.computeWorldMatrix(true);
-                    var childBoundingInfo = childMesh.getBoundingInfo();
-                    if (childMesh.getTotalVertices() === 0) {
+                    //make sure we have the needed params to get mix and max
+                    if (!childMesh.getBoundingInfo || childMesh.getTotalVertices() === 0) {
                         continue;
                         continue;
                     }
                     }
+                    childMesh.computeWorldMatrix(true);
+                    var childBoundingInfo = childMesh.getBoundingInfo();
                     var boundingBox = childBoundingInfo.boundingBox;
                     var boundingBox = childBoundingInfo.boundingBox;
                     var minBox = boundingBox.minimumWorld;
                     var minBox = boundingBox.minimumWorld;
                     var maxBox = boundingBox.maximumWorld;
                     var maxBox = boundingBox.maximumWorld;
@@ -26167,7 +26168,7 @@ var BABYLON;
          * Returns a Vector3, the center of the `{min:` Vector3`, max:` Vector3`}` or the center of MinMax vector3 computed from a mesh array.
          * Returns a Vector3, the center of the `{min:` Vector3`, max:` Vector3`}` or the center of MinMax vector3 computed from a mesh array.
          */
          */
         Mesh.Center = function (meshesOrMinMaxVector) {
         Mesh.Center = function (meshesOrMinMaxVector) {
-            var minMaxVector = (meshesOrMinMaxVector instanceof Array) ? BABYLON.Mesh.MinMax(meshesOrMinMaxVector) : meshesOrMinMaxVector;
+            var minMaxVector = (meshesOrMinMaxVector instanceof Array) ? Mesh.MinMax(meshesOrMinMaxVector) : meshesOrMinMaxVector;
             return BABYLON.Vector3.Center(minMaxVector.min, minMaxVector.max);
             return BABYLON.Vector3.Center(minMaxVector.min, minMaxVector.max);
         };
         };
         /**
         /**
@@ -33352,7 +33353,7 @@ var BABYLON;
         ColorGradingTexture.Parse = function (parsedTexture, scene, rootUrl) {
         ColorGradingTexture.Parse = function (parsedTexture, scene, rootUrl) {
             var texture = null;
             var texture = null;
             if (parsedTexture.name && !parsedTexture.isRenderTarget) {
             if (parsedTexture.name && !parsedTexture.isRenderTarget) {
-                texture = new BABYLON.ColorGradingTexture(parsedTexture.name, scene);
+                texture = new ColorGradingTexture(parsedTexture.name, scene);
                 texture.name = parsedTexture.name;
                 texture.name = parsedTexture.name;
                 texture.level = parsedTexture.level;
                 texture.level = parsedTexture.level;
             }
             }
@@ -41392,7 +41393,7 @@ var BABYLON;
          * @returns The created animation
          * @returns The created animation
          */
          */
         Animation.CreateAnimation = function (property, animationType, framePerSecond, easingFunction) {
         Animation.CreateAnimation = function (property, animationType, framePerSecond, easingFunction) {
-            var animation = new BABYLON.Animation(property + "Animation", property, framePerSecond, animationType, BABYLON.Animation.ANIMATIONLOOPMODE_CONSTANT);
+            var animation = new Animation(property + "Animation", property, framePerSecond, animationType, Animation.ANIMATIONLOOPMODE_CONSTANT);
             animation.setEasingFunction(easingFunction);
             animation.setEasingFunction(easingFunction);
             return animation;
             return animation;
         };
         };
@@ -41830,6 +41831,18 @@ var BABYLON;
 
 
 var BABYLON;
 var BABYLON;
 (function (BABYLON) {
 (function (BABYLON) {
+    var AnimationGroup = /** @class */ (function () {
+        function AnimationGroup() {
+        }
+        return AnimationGroup;
+    }());
+    BABYLON.AnimationGroup = AnimationGroup;
+})(BABYLON || (BABYLON = {}));
+
+//# sourceMappingURL=babylon.animationGroup.js.map
+
+var BABYLON;
+(function (BABYLON) {
     var RuntimeAnimation = /** @class */ (function () {
     var RuntimeAnimation = /** @class */ (function () {
         function RuntimeAnimation(target, animation) {
         function RuntimeAnimation(target, animation) {
             this._offsetsCache = {};
             this._offsetsCache = {};
@@ -43352,13 +43365,14 @@ var BABYLON;
             return root;
             return root;
         };
         };
         ActionManager.Parse = function (parsedActions, object, scene) {
         ActionManager.Parse = function (parsedActions, object, scene) {
-            var actionManager = new BABYLON.ActionManager(scene);
+            var actionManager = new ActionManager(scene);
             if (object === null)
             if (object === null)
                 scene.actionManager = actionManager;
                 scene.actionManager = actionManager;
             else
             else
                 object.actionManager = actionManager;
                 object.actionManager = actionManager;
             // instanciate a new object
             // instanciate a new object
             var instanciate = function (name, params) {
             var instanciate = function (name, params) {
+                // TODO: We will need to find a solution for the next line when using commonjs / es6 .
                 var newInstance = Object.create(BABYLON.Tools.Instantiate("BABYLON." + name).prototype);
                 var newInstance = Object.create(BABYLON.Tools.Instantiate("BABYLON." + name).prototype);
                 newInstance.constructor.apply(newInstance, params);
                 newInstance.constructor.apply(newInstance, params);
                 return newInstance;
                 return newInstance;
@@ -45875,6 +45889,13 @@ var BABYLON;
             serializationObject.blendMode = this.blendMode;
             serializationObject.blendMode = this.blendMode;
             serializationObject.customShader = this.customShader;
             serializationObject.customShader = this.customShader;
             serializationObject.preventAutoStart = this.preventAutoStart;
             serializationObject.preventAutoStart = this.preventAutoStart;
+            serializationObject.startSpriteCellID = this.startSpriteCellID;
+            serializationObject.endSpriteCellID = this.endSpriteCellID;
+            serializationObject.spriteCellLoop = this.spriteCellLoop;
+            serializationObject.spriteCellChangeSpeed = this.spriteCellChangeSpeed;
+            serializationObject.spriteCellWidth = this.spriteCellWidth;
+            serializationObject.spriteCellHeight = this.spriteCellHeight;
+            serializationObject.isAnimationSheetEnabled = this._isAnimationSheetEnabled;
             return serializationObject;
             return serializationObject;
         };
         };
         ParticleSystem.Parse = function (parsedParticleSystem, scene, rootUrl) {
         ParticleSystem.Parse = function (parsedParticleSystem, scene, rootUrl) {
@@ -45886,7 +45907,7 @@ var BABYLON;
                 var defines = (program.shaderOptions.defines.length > 0) ? program.shaderOptions.defines.join("\n") : "";
                 var defines = (program.shaderOptions.defines.length > 0) ? program.shaderOptions.defines.join("\n") : "";
                 custom = scene.getEngine().createEffectForParticles(program.shaderPath.fragmentElement, program.shaderOptions.uniforms, program.shaderOptions.samplers, defines);
                 custom = scene.getEngine().createEffectForParticles(program.shaderPath.fragmentElement, program.shaderOptions.uniforms, program.shaderOptions.samplers, defines);
             }
             }
-            var particleSystem = new ParticleSystem(name, parsedParticleSystem.capacity, scene, custom);
+            var particleSystem = new ParticleSystem(name, parsedParticleSystem.capacity, scene, custom, parsedParticleSystem.isAnimationSheetEnabled);
             particleSystem.customShader = program;
             particleSystem.customShader = program;
             if (parsedParticleSystem.id) {
             if (parsedParticleSystem.id) {
                 particleSystem.id = parsedParticleSystem.id;
                 particleSystem.id = parsedParticleSystem.id;
@@ -45939,6 +45960,12 @@ var BABYLON;
             particleSystem.targetStopDuration = parsedParticleSystem.targetStopDuration;
             particleSystem.targetStopDuration = parsedParticleSystem.targetStopDuration;
             particleSystem.textureMask = BABYLON.Color4.FromArray(parsedParticleSystem.textureMask);
             particleSystem.textureMask = BABYLON.Color4.FromArray(parsedParticleSystem.textureMask);
             particleSystem.blendMode = parsedParticleSystem.blendMode;
             particleSystem.blendMode = parsedParticleSystem.blendMode;
+            particleSystem.startSpriteCellID = parsedParticleSystem.startSpriteCellID;
+            particleSystem.endSpriteCellID = parsedParticleSystem.endSpriteCellID;
+            particleSystem.spriteCellLoop = parsedParticleSystem.spriteCellLoop;
+            particleSystem.spriteCellChangeSpeed = parsedParticleSystem.spriteCellChangeSpeed;
+            particleSystem.spriteCellWidth = parsedParticleSystem.spriteCellWidth;
+            particleSystem.spriteCellHeight = parsedParticleSystem.spriteCellHeight;
             if (!particleSystem.preventAutoStart) {
             if (!particleSystem.preventAutoStart) {
                 particleSystem.start();
                 particleSystem.start();
             }
             }
@@ -50828,7 +50855,7 @@ var BABYLON;
         };
         };
         CubeTexture.Parse = function (parsedTexture, scene, rootUrl) {
         CubeTexture.Parse = function (parsedTexture, scene, rootUrl) {
             var texture = BABYLON.SerializationHelper.Parse(function () {
             var texture = BABYLON.SerializationHelper.Parse(function () {
-                return new BABYLON.CubeTexture(rootUrl + parsedTexture.name, scene, parsedTexture.extensions);
+                return new CubeTexture(rootUrl + parsedTexture.name, scene, parsedTexture.extensions);
             }, parsedTexture, scene);
             }, parsedTexture, scene);
             // Animations
             // Animations
             if (parsedTexture.animations) {
             if (parsedTexture.animations) {
@@ -52083,7 +52110,7 @@ var BABYLON;
                     }
                     }
                     video.play();
                     video.play();
                     if (onReady) {
                     if (onReady) {
-                        onReady(new BABYLON.VideoTexture("video", video, scene, true, true));
+                        onReady(new VideoTexture("video", video, scene, true, true));
                     }
                     }
                 }, function (e) {
                 }, function (e) {
                     BABYLON.Tools.Error(e.name);
                     BABYLON.Tools.Error(e.name);
@@ -60567,6 +60594,9 @@ var BABYLON;
         ], StandardRenderingPipeline.prototype, "motionStrength", void 0);
         ], StandardRenderingPipeline.prototype, "motionStrength", void 0);
         __decorate([
         __decorate([
             BABYLON.serialize()
             BABYLON.serialize()
+        ], StandardRenderingPipeline.prototype, "_ratio", void 0);
+        __decorate([
+            BABYLON.serialize()
         ], StandardRenderingPipeline.prototype, "BloomEnabled", null);
         ], StandardRenderingPipeline.prototype, "BloomEnabled", null);
         __decorate([
         __decorate([
             BABYLON.serialize()
             BABYLON.serialize()
@@ -61071,7 +61101,7 @@ var BABYLON;
                     return;
                     return;
                 }
                 }
                 // Culling
                 // Culling
-                engine.setState(material.backFaceCulling);
+                engine.setState(material.backFaceCulling, 0, false, scene.useRightHandedSystem);
                 // Managing instances
                 // Managing instances
                 var batch = mesh._getInstancesRenderList(subMesh._id);
                 var batch = mesh._getInstancesRenderList(subMesh._id);
                 if (batch.mustReturn) {
                 if (batch.mustReturn) {
@@ -63746,7 +63776,7 @@ var BABYLON;
                         if (this._transformYawPitch) {
                         if (this._transformYawPitch) {
                             BABYLON.Vector3.TransformCoordinatesToRef(boneFwd, this._transformYawPitchInv, boneFwd);
                             BABYLON.Vector3.TransformCoordinatesToRef(boneFwd, this._transformYawPitchInv, boneFwd);
                         }
                         }
-                        var boneRotMat = BABYLON.BoneLookController._tmpMats[4];
+                        var boneRotMat = BoneLookController._tmpMats[4];
                         this._boneQuat.toRotationMatrix(boneRotMat);
                         this._boneQuat.toRotationMatrix(boneRotMat);
                         this.mesh.getWorldMatrix().multiplyToRef(boneRotMat, boneRotMat);
                         this.mesh.getWorldMatrix().multiplyToRef(boneRotMat, boneRotMat);
                         BABYLON.Vector3.TransformCoordinatesToRef(boneFwd, boneRotMat, boneFwd);
                         BABYLON.Vector3.TransformCoordinatesToRef(boneFwd, boneRotMat, boneFwd);
@@ -65284,7 +65314,7 @@ var BABYLON;
             var texture = null;
             var texture = null;
             if (parsedTexture.name && !parsedTexture.isRenderTarget) {
             if (parsedTexture.name && !parsedTexture.isRenderTarget) {
                 var size = parsedTexture.isBABYLONPreprocessed ? null : parsedTexture.size;
                 var size = parsedTexture.isBABYLONPreprocessed ? null : parsedTexture.size;
-                texture = new BABYLON.HDRCubeTexture(rootUrl + parsedTexture.name, scene, size, parsedTexture.noMipmap, parsedTexture.generateHarmonics, parsedTexture.useInGammaSpace, parsedTexture.usePMREMGenerator);
+                texture = new HDRCubeTexture(rootUrl + parsedTexture.name, scene, size, parsedTexture.noMipmap, parsedTexture.generateHarmonics, parsedTexture.useInGammaSpace, parsedTexture.usePMREMGenerator);
                 texture.name = parsedTexture.name;
                 texture.name = parsedTexture.name;
                 texture.hasAlpha = parsedTexture.hasAlpha;
                 texture.hasAlpha = parsedTexture.hasAlpha;
                 texture.level = parsedTexture.level;
                 texture.level = parsedTexture.level;
@@ -70738,7 +70768,7 @@ var BABYLON;
                 this._colorShader.setColor4("color", this.frontColor.toColor4());
                 this._colorShader.setColor4("color", this.frontColor.toColor4());
                 this._colorShader.bind(worldMatrix);
                 this._colorShader.bind(worldMatrix);
                 // Draw order
                 // Draw order
-                engine.drawElementsType(BABYLON.Material.TriangleFillMode, 0, 24);
+                engine.drawElementsType(BABYLON.Material.LineListDrawMode, 0, 24);
             }
             }
             this._colorShader.unbind();
             this._colorShader.unbind();
             engine.setDepthFunctionToLessOrEqual();
             engine.setDepthFunctionToLessOrEqual();
@@ -72509,9 +72539,18 @@ var BABYLON;
             this._webVRpresenting = false;
             this._webVRpresenting = false;
             // Are we presenting in the fullscreen fallback?
             // Are we presenting in the fullscreen fallback?
             this._fullscreenVRpresenting = false;
             this._fullscreenVRpresenting = false;
-            this.onEnteringVR = new BABYLON.Observable();
-            this.onExitingVR = new BABYLON.Observable();
-            this.onControllerMeshLoaded = new BABYLON.Observable();
+            /**
+             * Observable raised when entering VR.
+             */
+            this.onEnteringVRObservable = new BABYLON.Observable();
+            /**
+             * Observable raised when exiting VR.
+             */
+            this.onExitingVRObservable = new BABYLON.Observable();
+            /**
+             * Observable raised when controller mesh is loaded.
+             */
+            this.onControllerMeshLoadedObservable = new BABYLON.Observable();
             this._useCustomVRButton = false;
             this._useCustomVRButton = false;
             this._teleportationRequested = false;
             this._teleportationRequested = false;
             this._teleportationEnabledOnLeftController = false;
             this._teleportationEnabledOnLeftController = false;
@@ -72808,6 +72847,36 @@ var BABYLON;
             this._circleEase = new BABYLON.CircleEase();
             this._circleEase = new BABYLON.CircleEase();
             this._circleEase.setEasingMode(BABYLON.EasingFunction.EASINGMODE_EASEINOUT);
             this._circleEase.setEasingMode(BABYLON.EasingFunction.EASINGMODE_EASEINOUT);
         }
         }
+        Object.defineProperty(VRExperienceHelper.prototype, "onEnteringVR", {
+            /** Return this.onEnteringVRObservable
+             * Note: This one is for backward compatibility. Please use onEnteringVRObservable directly
+             */
+            get: function () {
+                return this.onEnteringVRObservable;
+            },
+            enumerable: true,
+            configurable: true
+        });
+        Object.defineProperty(VRExperienceHelper.prototype, "onExitingVR", {
+            /** Return this.onExitingVRObservable
+             * Note: This one is for backward compatibility. Please use onExitingVRObservable directly
+             */
+            get: function () {
+                return this.onExitingVRObservable;
+            },
+            enumerable: true,
+            configurable: true
+        });
+        Object.defineProperty(VRExperienceHelper.prototype, "onControllerMeshLoaded", {
+            /** Return this.onControllerMeshLoadedObservable
+             * Note: This one is for backward compatibility. Please use onControllerMeshLoadedObservable directly
+             */
+            get: function () {
+                return this.onControllerMeshLoadedObservable;
+            },
+            enumerable: true,
+            configurable: true
+        });
         Object.defineProperty(VRExperienceHelper.prototype, "teleportationTarget", {
         Object.defineProperty(VRExperienceHelper.prototype, "teleportationTarget", {
             get: function () {
             get: function () {
                 return this._teleportationTarget;
                 return this._teleportationTarget;
@@ -72899,7 +72968,7 @@ var BABYLON;
         VRExperienceHelper.prototype._onDefaultMeshLoaded = function (webVRController) {
         VRExperienceHelper.prototype._onDefaultMeshLoaded = function (webVRController) {
             this._tryEnableInteractionOnController(webVRController);
             this._tryEnableInteractionOnController(webVRController);
             try {
             try {
-                this.onControllerMeshLoaded.notifyObservers(webVRController);
+                this.onControllerMeshLoadedObservable.notifyObservers(webVRController);
             }
             }
             catch (err) {
             catch (err) {
                 BABYLON.Tools.Warn("Error in your custom logic onControllerMeshLoaded: " + err);
                 BABYLON.Tools.Warn("Error in your custom logic onControllerMeshLoaded: " + err);
@@ -72969,9 +73038,9 @@ var BABYLON;
          * Otherwise, will use the fullscreen API.
          * Otherwise, will use the fullscreen API.
          */
          */
         VRExperienceHelper.prototype.enterVR = function () {
         VRExperienceHelper.prototype.enterVR = function () {
-            if (this.onEnteringVR) {
+            if (this.onEnteringVRObservable) {
                 try {
                 try {
-                    this.onEnteringVR.notifyObservers(this);
+                    this.onEnteringVRObservable.notifyObservers(this);
                 }
                 }
                 catch (err) {
                 catch (err) {
                     BABYLON.Tools.Warn("Error in your custom logic onEnteringVR: " + err);
                     BABYLON.Tools.Warn("Error in your custom logic onEnteringVR: " + err);
@@ -73003,9 +73072,9 @@ var BABYLON;
          * Attempt to exit VR, or fullscreen.
          * Attempt to exit VR, or fullscreen.
          */
          */
         VRExperienceHelper.prototype.exitVR = function () {
         VRExperienceHelper.prototype.exitVR = function () {
-            if (this.onExitingVR) {
+            if (this.onExitingVRObservable) {
                 try {
                 try {
-                    this.onExitingVR.notifyObservers(this);
+                    this.onExitingVRObservable.notifyObservers(this);
                 }
                 }
                 catch (err) {
                 catch (err) {
                     BABYLON.Tools.Warn("Error in your custom logic onExitingVR: " + err);
                     BABYLON.Tools.Warn("Error in your custom logic onExitingVR: " + err);
@@ -80211,9 +80280,11 @@ var BABYLON;
                 this._groundMaterial.dispose();
                 this._groundMaterial.dispose();
                 this._groundMaterial = null;
                 this._groundMaterial = null;
             }
             }
-            if (this._options.groundTexture && !newOptions.groundTexture && this._groundTexture) {
-                this._groundTexture.dispose();
-                this._groundTexture = null;
+            if (this._groundTexture) {
+                if (this._options.groundTexture != newOptions.groundTexture) {
+                    this._groundTexture.dispose();
+                    this._groundTexture = null;
+                }
             }
             }
             if (this._skybox && !newOptions.createSkybox) {
             if (this._skybox && !newOptions.createSkybox) {
                 this._skybox.dispose();
                 this._skybox.dispose();
@@ -80223,16 +80294,20 @@ var BABYLON;
                 this._skyboxMaterial.dispose();
                 this._skyboxMaterial.dispose();
                 this._skyboxMaterial = null;
                 this._skyboxMaterial = null;
             }
             }
-            if (this._options.skyboxTexture && !newOptions.skyboxTexture && this._skyboxTexture) {
-                this._skyboxTexture.dispose();
-                this._skyboxTexture = null;
+            if (this._skyboxTexture) {
+                if (this._options.skyboxTexture != newOptions.skyboxTexture) {
+                    this._skyboxTexture.dispose();
+                    this._skyboxTexture = null;
+                }
             }
             }
             if (this._groundMirror && !newOptions.enableGroundMirror) {
             if (this._groundMirror && !newOptions.enableGroundMirror) {
                 this._groundMirror.dispose();
                 this._groundMirror.dispose();
                 this._groundMirror = null;
                 this._groundMirror = null;
             }
             }
-            if (this._options.environmentTexture && !newOptions.environmentTexture && this._scene.environmentTexture) {
-                this._scene.environmentTexture.dispose();
+            if (this._scene.environmentTexture) {
+                if (this._options.environmentTexture != newOptions.environmentTexture) {
+                    this._scene.environmentTexture.dispose();
+                }
             }
             }
             this._options = newOptions;
             this._options = newOptions;
             this._setupBackground();
             this._setupBackground();

File diff suppressed because it is too large
+ 40 - 40
dist/preview release/babylon.worker.js


File diff suppressed because it is too large
+ 36 - 36
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.js


+ 86 - 33
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.max.js

@@ -2862,8 +2862,8 @@ var BABYLON;
          */
          */
         Quaternion.RotationQuaternionFromAxisToRef = function (axis1, axis2, axis3, ref) {
         Quaternion.RotationQuaternionFromAxisToRef = function (axis1, axis2, axis3, ref) {
             var rotMat = MathTmp.Matrix[0];
             var rotMat = MathTmp.Matrix[0];
-            BABYLON.Matrix.FromXYZAxesToRef(axis1.normalize(), axis2.normalize(), axis3.normalize(), rotMat);
-            BABYLON.Quaternion.FromRotationMatrixToRef(rotMat, ref);
+            Matrix.FromXYZAxesToRef(axis1.normalize(), axis2.normalize(), axis3.normalize(), rotMat);
+            Quaternion.FromRotationMatrixToRef(rotMat, ref);
         };
         };
         Quaternion.Slerp = function (left, right, amount) {
         Quaternion.Slerp = function (left, right, amount) {
             var result = Quaternion.Identity();
             var result = Quaternion.Identity();
@@ -3801,7 +3801,7 @@ var BABYLON;
             var b = 2.0 / height;
             var b = 2.0 / height;
             var c = 2.0 / (f - n);
             var c = 2.0 / (f - n);
             var d = -(f + n) / (f - n);
             var d = -(f + n) / (f - n);
-            BABYLON.Matrix.FromValuesToRef(a, 0.0, 0.0, 0.0, 0.0, b, 0.0, 0.0, 0.0, 0.0, c, 0.0, 0.0, 0.0, d, 1.0, result);
+            Matrix.FromValuesToRef(a, 0.0, 0.0, 0.0, 0.0, b, 0.0, 0.0, 0.0, 0.0, c, 0.0, 0.0, 0.0, d, 1.0, result);
         };
         };
         /**
         /**
          * Returns a new Matrix as a left-handed orthographic projection matrix computed from the passed floats : left, right, top and bottom being the coordinates of the projection plane, z near and far limits.
          * Returns a new Matrix as a left-handed orthographic projection matrix computed from the passed floats : left, right, top and bottom being the coordinates of the projection plane, z near and far limits.
@@ -3823,7 +3823,7 @@ var BABYLON;
             var d = -(f + n) / (f - n);
             var d = -(f + n) / (f - n);
             var i0 = (left + right) / (left - right);
             var i0 = (left + right) / (left - right);
             var i1 = (top + bottom) / (bottom - top);
             var i1 = (top + bottom) / (bottom - top);
-            BABYLON.Matrix.FromValuesToRef(a, 0.0, 0.0, 0.0, 0.0, b, 0.0, 0.0, 0.0, 0.0, c, 0.0, i0, i1, d, 1.0, result);
+            Matrix.FromValuesToRef(a, 0.0, 0.0, 0.0, 0.0, b, 0.0, 0.0, 0.0, 0.0, c, 0.0, i0, i1, d, 1.0, result);
         };
         };
         /**
         /**
          * Returns a new Matrix as a right-handed orthographic projection matrix computed from the passed floats : left, right, top and bottom being the coordinates of the projection plane, z near and far limits.
          * Returns a new Matrix as a right-handed orthographic projection matrix computed from the passed floats : left, right, top and bottom being the coordinates of the projection plane, z near and far limits.
@@ -3851,7 +3851,7 @@ var BABYLON;
             var b = 2.0 * n / height;
             var b = 2.0 * n / height;
             var c = (f + n) / (f - n);
             var c = (f + n) / (f - n);
             var d = -2.0 * f * n / (f - n);
             var d = -2.0 * f * n / (f - n);
-            BABYLON.Matrix.FromValuesToRef(a, 0.0, 0.0, 0.0, 0.0, b, 0.0, 0.0, 0.0, 0.0, c, 1.0, 0.0, 0.0, d, 0.0, matrix);
+            Matrix.FromValuesToRef(a, 0.0, 0.0, 0.0, 0.0, b, 0.0, 0.0, 0.0, 0.0, c, 1.0, 0.0, 0.0, d, 0.0, matrix);
             return matrix;
             return matrix;
         };
         };
         /**
         /**
@@ -3874,7 +3874,7 @@ var BABYLON;
             var b = isVerticalFovFixed ? t : (t * aspect);
             var b = isVerticalFovFixed ? t : (t * aspect);
             var c = (f + n) / (f - n);
             var c = (f + n) / (f - n);
             var d = -2.0 * f * n / (f - n);
             var d = -2.0 * f * n / (f - n);
-            BABYLON.Matrix.FromValuesToRef(a, 0.0, 0.0, 0.0, 0.0, b, 0.0, 0.0, 0.0, 0.0, c, 1.0, 0.0, 0.0, d, 0.0, result);
+            Matrix.FromValuesToRef(a, 0.0, 0.0, 0.0, 0.0, b, 0.0, 0.0, 0.0, 0.0, c, 1.0, 0.0, 0.0, d, 0.0, result);
         };
         };
         /**
         /**
          * Returns a new Matrix as a right-handed perspective projection matrix computed from the passed floats : vertical angle of view (fov), width/height ratio (aspect), z near and far limits.
          * Returns a new Matrix as a right-handed perspective projection matrix computed from the passed floats : vertical angle of view (fov), width/height ratio (aspect), z near and far limits.
@@ -3900,7 +3900,7 @@ var BABYLON;
             var b = isVerticalFovFixed ? t : (t * aspect);
             var b = isVerticalFovFixed ? t : (t * aspect);
             var c = -(f + n) / (f - n);
             var c = -(f + n) / (f - n);
             var d = -2 * f * n / (f - n);
             var d = -2 * f * n / (f - n);
-            BABYLON.Matrix.FromValuesToRef(a, 0.0, 0.0, 0.0, 0.0, b, 0.0, 0.0, 0.0, 0.0, c, -1.0, 0.0, 0.0, d, 0.0, result);
+            Matrix.FromValuesToRef(a, 0.0, 0.0, 0.0, 0.0, b, 0.0, 0.0, 0.0, 0.0, c, -1.0, 0.0, 0.0, d, 0.0, result);
         };
         };
         /**
         /**
          * Sets the passed matrix "result" as a left-handed perspective projection matrix  for WebVR computed from the passed floats : vertical angle of view (fov), width/height ratio (aspect), z near and far limits.
          * Sets the passed matrix "result" as a left-handed perspective projection matrix  for WebVR computed from the passed floats : vertical angle of view (fov), width/height ratio (aspect), z near and far limits.
@@ -8722,7 +8722,7 @@ var BABYLON;
             // Empty texture
             // Empty texture
             get: function () {
             get: function () {
                 if (!this._emptyTexture) {
                 if (!this._emptyTexture) {
-                    this._emptyTexture = this.createRawTexture(new Uint8Array(4), 1, 1, BABYLON.Engine.TEXTUREFORMAT_RGBA, false, false, BABYLON.Texture.NEAREST_SAMPLINGMODE);
+                    this._emptyTexture = this.createRawTexture(new Uint8Array(4), 1, 1, Engine.TEXTUREFORMAT_RGBA, false, false, BABYLON.Texture.NEAREST_SAMPLINGMODE);
                 }
                 }
                 return this._emptyTexture;
                 return this._emptyTexture;
             },
             },
@@ -8732,7 +8732,7 @@ var BABYLON;
         Object.defineProperty(Engine.prototype, "emptyTexture3D", {
         Object.defineProperty(Engine.prototype, "emptyTexture3D", {
             get: function () {
             get: function () {
                 if (!this._emptyTexture3D) {
                 if (!this._emptyTexture3D) {
-                    this._emptyTexture3D = this.createRawTexture3D(new Uint8Array(4), 1, 1, 1, BABYLON.Engine.TEXTUREFORMAT_RGBA, false, false, BABYLON.Texture.NEAREST_SAMPLINGMODE);
+                    this._emptyTexture3D = this.createRawTexture3D(new Uint8Array(4), 1, 1, 1, Engine.TEXTUREFORMAT_RGBA, false, false, BABYLON.Texture.NEAREST_SAMPLINGMODE);
                 }
                 }
                 return this._emptyTexture3D;
                 return this._emptyTexture3D;
             },
             },
@@ -8744,7 +8744,7 @@ var BABYLON;
                 if (!this._emptyCubeTexture) {
                 if (!this._emptyCubeTexture) {
                     var faceData = new Uint8Array(4);
                     var faceData = new Uint8Array(4);
                     var cubeData = [faceData, faceData, faceData, faceData, faceData, faceData];
                     var cubeData = [faceData, faceData, faceData, faceData, faceData, faceData];
-                    this._emptyCubeTexture = this.createRawCubeTexture(cubeData, 1, BABYLON.Engine.TEXTUREFORMAT_RGBA, BABYLON.Engine.TEXTURETYPE_UNSIGNED_INT, false, false, BABYLON.Texture.NEAREST_SAMPLINGMODE);
+                    this._emptyCubeTexture = this.createRawCubeTexture(cubeData, 1, Engine.TEXTUREFORMAT_RGBA, Engine.TEXTURETYPE_UNSIGNED_INT, false, false, BABYLON.Texture.NEAREST_SAMPLINGMODE);
                 }
                 }
                 return this._emptyCubeTexture;
                 return this._emptyCubeTexture;
             },
             },
@@ -10638,7 +10638,7 @@ var BABYLON;
         };
         };
         Engine.prototype.createRawTexture = function (data, width, height, format, generateMipMaps, invertY, samplingMode, compression, type) {
         Engine.prototype.createRawTexture = function (data, width, height, format, generateMipMaps, invertY, samplingMode, compression, type) {
             if (compression === void 0) { compression = null; }
             if (compression === void 0) { compression = null; }
-            if (type === void 0) { type = BABYLON.Engine.TEXTURETYPE_UNSIGNED_INT; }
+            if (type === void 0) { type = Engine.TEXTURETYPE_UNSIGNED_INT; }
             var texture = new BABYLON.InternalTexture(this, BABYLON.InternalTexture.DATASOURCE_RAW);
             var texture = new BABYLON.InternalTexture(this, BABYLON.InternalTexture.DATASOURCE_RAW);
             texture.baseWidth = width;
             texture.baseWidth = width;
             texture.baseHeight = height;
             texture.baseHeight = height;
@@ -12212,13 +12212,13 @@ var BABYLON;
             if (this._webGLVersion > 1) {
             if (this._webGLVersion > 1) {
                 return this._caps.colorBufferFloat;
                 return this._caps.colorBufferFloat;
             }
             }
-            return this._canRenderToFramebuffer(BABYLON.Engine.TEXTURETYPE_FLOAT);
+            return this._canRenderToFramebuffer(Engine.TEXTURETYPE_FLOAT);
         };
         };
         Engine.prototype._canRenderToHalfFloatFramebuffer = function () {
         Engine.prototype._canRenderToHalfFloatFramebuffer = function () {
             if (this._webGLVersion > 1) {
             if (this._webGLVersion > 1) {
                 return this._caps.colorBufferFloat;
                 return this._caps.colorBufferFloat;
             }
             }
-            return this._canRenderToFramebuffer(BABYLON.Engine.TEXTURETYPE_HALF_FLOAT);
+            return this._canRenderToFramebuffer(Engine.TEXTURETYPE_HALF_FLOAT);
         };
         };
         // Thank you : http://stackoverflow.com/questions/28827511/webgl-ios-render-to-floating-point-texture
         // Thank you : http://stackoverflow.com/questions/28827511/webgl-ios-render-to-floating-point-texture
         Engine.prototype._canRenderToFramebuffer = function (type) {
         Engine.prototype._canRenderToFramebuffer = function (type) {
@@ -15049,11 +15049,12 @@ var BABYLON;
                 for (var _i = 0, descendants_1 = descendants; _i < descendants_1.length; _i++) {
                 for (var _i = 0, descendants_1 = descendants; _i < descendants_1.length; _i++) {
                     var descendant = descendants_1[_i];
                     var descendant = descendants_1[_i];
                     var childMesh = descendant;
                     var childMesh = descendant;
-                    childMesh.computeWorldMatrix(true);
-                    var childBoundingInfo = childMesh.getBoundingInfo();
-                    if (childMesh.getTotalVertices() === 0) {
+                    //make sure we have the needed params to get mix and max
+                    if (!childMesh.getBoundingInfo || childMesh.getTotalVertices() === 0) {
                         continue;
                         continue;
                     }
                     }
+                    childMesh.computeWorldMatrix(true);
+                    var childBoundingInfo = childMesh.getBoundingInfo();
                     var boundingBox = childBoundingInfo.boundingBox;
                     var boundingBox = childBoundingInfo.boundingBox;
                     var minBox = boundingBox.minimumWorld;
                     var minBox = boundingBox.minimumWorld;
                     var maxBox = boundingBox.maximumWorld;
                     var maxBox = boundingBox.maximumWorld;
@@ -26167,7 +26168,7 @@ var BABYLON;
          * Returns a Vector3, the center of the `{min:` Vector3`, max:` Vector3`}` or the center of MinMax vector3 computed from a mesh array.
          * Returns a Vector3, the center of the `{min:` Vector3`, max:` Vector3`}` or the center of MinMax vector3 computed from a mesh array.
          */
          */
         Mesh.Center = function (meshesOrMinMaxVector) {
         Mesh.Center = function (meshesOrMinMaxVector) {
-            var minMaxVector = (meshesOrMinMaxVector instanceof Array) ? BABYLON.Mesh.MinMax(meshesOrMinMaxVector) : meshesOrMinMaxVector;
+            var minMaxVector = (meshesOrMinMaxVector instanceof Array) ? Mesh.MinMax(meshesOrMinMaxVector) : meshesOrMinMaxVector;
             return BABYLON.Vector3.Center(minMaxVector.min, minMaxVector.max);
             return BABYLON.Vector3.Center(minMaxVector.min, minMaxVector.max);
         };
         };
         /**
         /**
@@ -33352,7 +33353,7 @@ var BABYLON;
         ColorGradingTexture.Parse = function (parsedTexture, scene, rootUrl) {
         ColorGradingTexture.Parse = function (parsedTexture, scene, rootUrl) {
             var texture = null;
             var texture = null;
             if (parsedTexture.name && !parsedTexture.isRenderTarget) {
             if (parsedTexture.name && !parsedTexture.isRenderTarget) {
-                texture = new BABYLON.ColorGradingTexture(parsedTexture.name, scene);
+                texture = new ColorGradingTexture(parsedTexture.name, scene);
                 texture.name = parsedTexture.name;
                 texture.name = parsedTexture.name;
                 texture.level = parsedTexture.level;
                 texture.level = parsedTexture.level;
             }
             }
@@ -41392,7 +41393,7 @@ var BABYLON;
          * @returns The created animation
          * @returns The created animation
          */
          */
         Animation.CreateAnimation = function (property, animationType, framePerSecond, easingFunction) {
         Animation.CreateAnimation = function (property, animationType, framePerSecond, easingFunction) {
-            var animation = new BABYLON.Animation(property + "Animation", property, framePerSecond, animationType, BABYLON.Animation.ANIMATIONLOOPMODE_CONSTANT);
+            var animation = new Animation(property + "Animation", property, framePerSecond, animationType, Animation.ANIMATIONLOOPMODE_CONSTANT);
             animation.setEasingFunction(easingFunction);
             animation.setEasingFunction(easingFunction);
             return animation;
             return animation;
         };
         };
@@ -41830,6 +41831,18 @@ var BABYLON;
 
 
 var BABYLON;
 var BABYLON;
 (function (BABYLON) {
 (function (BABYLON) {
+    var AnimationGroup = /** @class */ (function () {
+        function AnimationGroup() {
+        }
+        return AnimationGroup;
+    }());
+    BABYLON.AnimationGroup = AnimationGroup;
+})(BABYLON || (BABYLON = {}));
+
+//# sourceMappingURL=babylon.animationGroup.js.map
+
+var BABYLON;
+(function (BABYLON) {
     var RuntimeAnimation = /** @class */ (function () {
     var RuntimeAnimation = /** @class */ (function () {
         function RuntimeAnimation(target, animation) {
         function RuntimeAnimation(target, animation) {
             this._offsetsCache = {};
             this._offsetsCache = {};
@@ -43352,13 +43365,14 @@ var BABYLON;
             return root;
             return root;
         };
         };
         ActionManager.Parse = function (parsedActions, object, scene) {
         ActionManager.Parse = function (parsedActions, object, scene) {
-            var actionManager = new BABYLON.ActionManager(scene);
+            var actionManager = new ActionManager(scene);
             if (object === null)
             if (object === null)
                 scene.actionManager = actionManager;
                 scene.actionManager = actionManager;
             else
             else
                 object.actionManager = actionManager;
                 object.actionManager = actionManager;
             // instanciate a new object
             // instanciate a new object
             var instanciate = function (name, params) {
             var instanciate = function (name, params) {
+                // TODO: We will need to find a solution for the next line when using commonjs / es6 .
                 var newInstance = Object.create(BABYLON.Tools.Instantiate("BABYLON." + name).prototype);
                 var newInstance = Object.create(BABYLON.Tools.Instantiate("BABYLON." + name).prototype);
                 newInstance.constructor.apply(newInstance, params);
                 newInstance.constructor.apply(newInstance, params);
                 return newInstance;
                 return newInstance;
@@ -50687,7 +50701,7 @@ var BABYLON;
         };
         };
         CubeTexture.Parse = function (parsedTexture, scene, rootUrl) {
         CubeTexture.Parse = function (parsedTexture, scene, rootUrl) {
             var texture = BABYLON.SerializationHelper.Parse(function () {
             var texture = BABYLON.SerializationHelper.Parse(function () {
-                return new BABYLON.CubeTexture(rootUrl + parsedTexture.name, scene, parsedTexture.extensions);
+                return new CubeTexture(rootUrl + parsedTexture.name, scene, parsedTexture.extensions);
             }, parsedTexture, scene);
             }, parsedTexture, scene);
             // Animations
             // Animations
             if (parsedTexture.animations) {
             if (parsedTexture.animations) {
@@ -51942,7 +51956,7 @@ var BABYLON;
                     }
                     }
                     video.play();
                     video.play();
                     if (onReady) {
                     if (onReady) {
-                        onReady(new BABYLON.VideoTexture("video", video, scene, true, true));
+                        onReady(new VideoTexture("video", video, scene, true, true));
                     }
                     }
                 }, function (e) {
                 }, function (e) {
                     BABYLON.Tools.Error(e.name);
                     BABYLON.Tools.Error(e.name);
@@ -63608,7 +63622,7 @@ var BABYLON;
                         if (this._transformYawPitch) {
                         if (this._transformYawPitch) {
                             BABYLON.Vector3.TransformCoordinatesToRef(boneFwd, this._transformYawPitchInv, boneFwd);
                             BABYLON.Vector3.TransformCoordinatesToRef(boneFwd, this._transformYawPitchInv, boneFwd);
                         }
                         }
-                        var boneRotMat = BABYLON.BoneLookController._tmpMats[4];
+                        var boneRotMat = BoneLookController._tmpMats[4];
                         this._boneQuat.toRotationMatrix(boneRotMat);
                         this._boneQuat.toRotationMatrix(boneRotMat);
                         this.mesh.getWorldMatrix().multiplyToRef(boneRotMat, boneRotMat);
                         this.mesh.getWorldMatrix().multiplyToRef(boneRotMat, boneRotMat);
                         BABYLON.Vector3.TransformCoordinatesToRef(boneFwd, boneRotMat, boneFwd);
                         BABYLON.Vector3.TransformCoordinatesToRef(boneFwd, boneRotMat, boneFwd);
@@ -65146,7 +65160,7 @@ var BABYLON;
             var texture = null;
             var texture = null;
             if (parsedTexture.name && !parsedTexture.isRenderTarget) {
             if (parsedTexture.name && !parsedTexture.isRenderTarget) {
                 var size = parsedTexture.isBABYLONPreprocessed ? null : parsedTexture.size;
                 var size = parsedTexture.isBABYLONPreprocessed ? null : parsedTexture.size;
-                texture = new BABYLON.HDRCubeTexture(rootUrl + parsedTexture.name, scene, size, parsedTexture.noMipmap, parsedTexture.generateHarmonics, parsedTexture.useInGammaSpace, parsedTexture.usePMREMGenerator);
+                texture = new HDRCubeTexture(rootUrl + parsedTexture.name, scene, size, parsedTexture.noMipmap, parsedTexture.generateHarmonics, parsedTexture.useInGammaSpace, parsedTexture.usePMREMGenerator);
                 texture.name = parsedTexture.name;
                 texture.name = parsedTexture.name;
                 texture.hasAlpha = parsedTexture.hasAlpha;
                 texture.hasAlpha = parsedTexture.hasAlpha;
                 texture.level = parsedTexture.level;
                 texture.level = parsedTexture.level;
@@ -70600,7 +70614,7 @@ var BABYLON;
                 this._colorShader.setColor4("color", this.frontColor.toColor4());
                 this._colorShader.setColor4("color", this.frontColor.toColor4());
                 this._colorShader.bind(worldMatrix);
                 this._colorShader.bind(worldMatrix);
                 // Draw order
                 // Draw order
-                engine.drawElementsType(BABYLON.Material.TriangleFillMode, 0, 24);
+                engine.drawElementsType(BABYLON.Material.LineListDrawMode, 0, 24);
             }
             }
             this._colorShader.unbind();
             this._colorShader.unbind();
             engine.setDepthFunctionToLessOrEqual();
             engine.setDepthFunctionToLessOrEqual();
@@ -72371,9 +72385,18 @@ var BABYLON;
             this._webVRpresenting = false;
             this._webVRpresenting = false;
             // Are we presenting in the fullscreen fallback?
             // Are we presenting in the fullscreen fallback?
             this._fullscreenVRpresenting = false;
             this._fullscreenVRpresenting = false;
-            this.onEnteringVR = new BABYLON.Observable();
-            this.onExitingVR = new BABYLON.Observable();
-            this.onControllerMeshLoaded = new BABYLON.Observable();
+            /**
+             * Observable raised when entering VR.
+             */
+            this.onEnteringVRObservable = new BABYLON.Observable();
+            /**
+             * Observable raised when exiting VR.
+             */
+            this.onExitingVRObservable = new BABYLON.Observable();
+            /**
+             * Observable raised when controller mesh is loaded.
+             */
+            this.onControllerMeshLoadedObservable = new BABYLON.Observable();
             this._useCustomVRButton = false;
             this._useCustomVRButton = false;
             this._teleportationRequested = false;
             this._teleportationRequested = false;
             this._teleportationEnabledOnLeftController = false;
             this._teleportationEnabledOnLeftController = false;
@@ -72670,6 +72693,36 @@ var BABYLON;
             this._circleEase = new BABYLON.CircleEase();
             this._circleEase = new BABYLON.CircleEase();
             this._circleEase.setEasingMode(BABYLON.EasingFunction.EASINGMODE_EASEINOUT);
             this._circleEase.setEasingMode(BABYLON.EasingFunction.EASINGMODE_EASEINOUT);
         }
         }
+        Object.defineProperty(VRExperienceHelper.prototype, "onEnteringVR", {
+            /** Return this.onEnteringVRObservable
+             * Note: This one is for backward compatibility. Please use onEnteringVRObservable directly
+             */
+            get: function () {
+                return this.onEnteringVRObservable;
+            },
+            enumerable: true,
+            configurable: true
+        });
+        Object.defineProperty(VRExperienceHelper.prototype, "onExitingVR", {
+            /** Return this.onExitingVRObservable
+             * Note: This one is for backward compatibility. Please use onExitingVRObservable directly
+             */
+            get: function () {
+                return this.onExitingVRObservable;
+            },
+            enumerable: true,
+            configurable: true
+        });
+        Object.defineProperty(VRExperienceHelper.prototype, "onControllerMeshLoaded", {
+            /** Return this.onControllerMeshLoadedObservable
+             * Note: This one is for backward compatibility. Please use onControllerMeshLoadedObservable directly
+             */
+            get: function () {
+                return this.onControllerMeshLoadedObservable;
+            },
+            enumerable: true,
+            configurable: true
+        });
         Object.defineProperty(VRExperienceHelper.prototype, "teleportationTarget", {
         Object.defineProperty(VRExperienceHelper.prototype, "teleportationTarget", {
             get: function () {
             get: function () {
                 return this._teleportationTarget;
                 return this._teleportationTarget;
@@ -72761,7 +72814,7 @@ var BABYLON;
         VRExperienceHelper.prototype._onDefaultMeshLoaded = function (webVRController) {
         VRExperienceHelper.prototype._onDefaultMeshLoaded = function (webVRController) {
             this._tryEnableInteractionOnController(webVRController);
             this._tryEnableInteractionOnController(webVRController);
             try {
             try {
-                this.onControllerMeshLoaded.notifyObservers(webVRController);
+                this.onControllerMeshLoadedObservable.notifyObservers(webVRController);
             }
             }
             catch (err) {
             catch (err) {
                 BABYLON.Tools.Warn("Error in your custom logic onControllerMeshLoaded: " + err);
                 BABYLON.Tools.Warn("Error in your custom logic onControllerMeshLoaded: " + err);
@@ -72831,9 +72884,9 @@ var BABYLON;
          * Otherwise, will use the fullscreen API.
          * Otherwise, will use the fullscreen API.
          */
          */
         VRExperienceHelper.prototype.enterVR = function () {
         VRExperienceHelper.prototype.enterVR = function () {
-            if (this.onEnteringVR) {
+            if (this.onEnteringVRObservable) {
                 try {
                 try {
-                    this.onEnteringVR.notifyObservers(this);
+                    this.onEnteringVRObservable.notifyObservers(this);
                 }
                 }
                 catch (err) {
                 catch (err) {
                     BABYLON.Tools.Warn("Error in your custom logic onEnteringVR: " + err);
                     BABYLON.Tools.Warn("Error in your custom logic onEnteringVR: " + err);
@@ -72865,9 +72918,9 @@ var BABYLON;
          * Attempt to exit VR, or fullscreen.
          * Attempt to exit VR, or fullscreen.
          */
          */
         VRExperienceHelper.prototype.exitVR = function () {
         VRExperienceHelper.prototype.exitVR = function () {
-            if (this.onExitingVR) {
+            if (this.onExitingVRObservable) {
                 try {
                 try {
-                    this.onExitingVR.notifyObservers(this);
+                    this.onExitingVRObservable.notifyObservers(this);
                 }
                 }
                 catch (err) {
                 catch (err) {
                     BABYLON.Tools.Warn("Error in your custom logic onExitingVR: " + err);
                     BABYLON.Tools.Warn("Error in your custom logic onExitingVR: " + err);

File diff suppressed because it is too large
+ 36 - 36
dist/preview release/viewer/babylon.viewer.js


+ 4 - 0
src/Animations/babylon.animationGroup.ts

@@ -0,0 +1,4 @@
+module BABYLON {
+    export class AnimationGroup {
+    }
+}

+ 42 - 8
src/Cameras/VR/babylon.vrExperienceHelper.ts

@@ -39,9 +39,43 @@ module BABYLON {
         private _onVRRequestPresentStart: () => void;
         private _onVRRequestPresentStart: () => void;
         private _onVRRequestPresentComplete: (success: boolean) => void;
         private _onVRRequestPresentComplete: (success: boolean) => void;
 
 
-        public onEnteringVR = new Observable<VRExperienceHelper>();
-        public onExitingVR = new Observable<VRExperienceHelper>();
-        public onControllerMeshLoaded = new Observable<WebVRController>();
+        /**
+         * Observable raised when entering VR.
+         */
+        public onEnteringVRObservable = new Observable<VRExperienceHelper>();
+
+
+        /**
+         * Observable raised when exiting VR.
+         */
+        public onExitingVRObservable = new Observable<VRExperienceHelper>();
+
+
+        /**
+         * Observable raised when controller mesh is loaded.
+         */
+        public onControllerMeshLoadedObservable = new Observable<WebVRController>();
+
+        /** Return this.onEnteringVRObservable
+         * Note: This one is for backward compatibility. Please use onEnteringVRObservable directly
+         */
+        public get onEnteringVR(): Observable<VRExperienceHelper> {
+            return this.onEnteringVRObservable;
+        }
+
+        /** Return this.onExitingVRObservable
+         * Note: This one is for backward compatibility. Please use onExitingVRObservable directly
+         */
+        public get onExitingVR(): Observable<VRExperienceHelper> {
+            return this.onExitingVRObservable;
+        }
+
+        /** Return this.onControllerMeshLoadedObservable
+         * Note: This one is for backward compatibility. Please use onControllerMeshLoadedObservable directly
+         */
+        public get onControllerMeshLoaded(): Observable<WebVRController> {
+            return this.onControllerMeshLoadedObservable;
+        }
 
 
         private _rayLength: number;
         private _rayLength: number;
         private _useCustomVRButton: boolean = false;
         private _useCustomVRButton: boolean = false;
@@ -340,7 +374,7 @@ module BABYLON {
         private _onDefaultMeshLoaded(webVRController: WebVRController) {
         private _onDefaultMeshLoaded(webVRController: WebVRController) {
             this._tryEnableInteractionOnController(webVRController);
             this._tryEnableInteractionOnController(webVRController);
             try {
             try {
-                this.onControllerMeshLoaded.notifyObservers(webVRController);
+                this.onControllerMeshLoadedObservable.notifyObservers(webVRController);
             }
             }
             catch (err) {
             catch (err) {
                 Tools.Warn("Error in your custom logic onControllerMeshLoaded: " + err);
                 Tools.Warn("Error in your custom logic onControllerMeshLoaded: " + err);
@@ -438,9 +472,9 @@ module BABYLON {
          * Otherwise, will use the fullscreen API.
          * Otherwise, will use the fullscreen API.
          */
          */
         public enterVR() {
         public enterVR() {
-            if (this.onEnteringVR) {
+            if (this.onEnteringVRObservable) {
                 try {
                 try {
-                    this.onEnteringVR.notifyObservers(this);
+                    this.onEnteringVRObservable.notifyObservers(this);
                 }
                 }
                 catch (err) {
                 catch (err) {
                     Tools.Warn("Error in your custom logic onEnteringVR: " + err);
                     Tools.Warn("Error in your custom logic onEnteringVR: " + err);
@@ -477,9 +511,9 @@ module BABYLON {
          * Attempt to exit VR, or fullscreen.
          * Attempt to exit VR, or fullscreen.
          */
          */
         public exitVR() {
         public exitVR() {
-            if (this.onExitingVR) {
+            if (this.onExitingVRObservable) {
                 try {
                 try {
-                    this.onExitingVR.notifyObservers(this);
+                    this.onExitingVRObservable.notifyObservers(this);
                 }
                 }
                 catch (err) {
                 catch (err) {
                     Tools.Warn("Error in your custom logic onExitingVR: " + err);
                     Tools.Warn("Error in your custom logic onExitingVR: " + err);

+ 1 - 1
src/Rendering/babylon.boundingBoxRenderer.ts

@@ -95,7 +95,7 @@
                 this._colorShader.bind(worldMatrix);
                 this._colorShader.bind(worldMatrix);
 
 
                 // Draw order
                 // Draw order
-                engine.drawElementsType(Material.TriangleFillMode, 0, 24);
+                engine.drawElementsType(Material.LineListDrawMode, 0, 24);
             }
             }
             this._colorShader.unbind();
             this._colorShader.unbind();
             engine.setDepthFunctionToLessOrEqual();
             engine.setDepthFunctionToLessOrEqual();