Raanan Weber 7 rokov pred
rodič
commit
5dc97d4515
40 zmenil súbory, kde vykonal 43100 pridanie a 20560 odobranie
  1. 3589 3171
      Playground/babylon.d.txt
  2. 1 0
      Tools/Gulp/config.json
  3. 2 2
      Tools/Publisher/index.js
  4. 10330 9907
      dist/preview release/babylon.d.ts
  5. 45 45
      dist/preview release/babylon.js
  6. 537 45
      dist/preview release/babylon.max.js
  7. 19088 0
      dist/preview release/babylon.module.d.ts
  8. 45 45
      dist/preview release/babylon.worker.js
  9. 5142 4724
      dist/preview release/customConfigurations/minimalGLTFViewer/babylon.d.ts
  10. 45 45
      dist/preview release/customConfigurations/minimalGLTFViewer/babylon.js
  11. 537 45
      dist/preview release/customConfigurations/minimalGLTFViewer/babylon.max.js
  12. 539 47
      dist/preview release/customConfigurations/minimalGLTFViewer/es6.js
  13. 539 47
      dist/preview release/es6.js
  14. 2 2
      dist/preview release/loaders/babylon.glTF2FileLoader.d.ts
  15. 2 2
      dist/preview release/loaders/babylon.glTFFileLoader.d.ts
  16. 2 2
      dist/preview release/loaders/babylonjs.loaders.module.d.ts
  17. 1 3
      dist/preview release/loaders/package.json
  18. 1 3
      dist/preview release/materialsLibrary/package.json
  19. 1 3
      dist/preview release/postProcessesLibrary/package.json
  20. 1 3
      dist/preview release/proceduralTexturesLibrary/package.json
  21. 104 53
      dist/preview release/serializers/babylon.glTF2Serializer.d.ts
  22. 917 889
      dist/preview release/serializers/babylon.glTF2Serializer.js
  23. 1 1
      dist/preview release/serializers/babylon.glTF2Serializer.min.js
  24. 917 889
      dist/preview release/serializers/babylonjs.serializers.js
  25. 1 1
      dist/preview release/serializers/babylonjs.serializers.min.js
  26. 104 53
      dist/preview release/serializers/babylonjs.serializers.module.d.ts
  27. 1 3
      dist/preview release/serializers/package.json
  28. 0 439
      dist/preview release/typedocValidationBaseline.json
  29. 59 59
      dist/preview release/viewer/babylon.viewer.js
  30. 3 1
      dist/preview release/what's new.md
  31. 2 2
      package.json
  32. 98 5
      src/Cameras/VR/babylon.vrExperienceHelper.ts
  33. 200 22
      src/Cameras/VR/babylon.webVRCamera.ts
  34. 4 0
      src/Engine/babylon.engine.ts
  35. 9 1
      src/Mesh/babylon.mesh.ts
  36. 1 1
      src/Tools/babylon.dds.ts
  37. 149 0
      src/Tools/babylon.promise.ts
  38. 13 0
      src/Tools/babylon.tools.ts
  39. 7 0
      src/babylon.mixins.ts
  40. 61 0
      tests/unit/babylon/promises/babylon.promises.tests.ts

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 3589 - 3171
Playground/babylon.d.txt


+ 1 - 0
Tools/Gulp/config.json

@@ -177,6 +177,7 @@
                 "../../src/Tools/babylon.observable.js",
                 "../../src/Tools/babylon.smartArray.js",
                 "../../src/Tools/babylon.tools.js",
+                "../../src/Tools/babylon.promise.js",
                 "../../src/States/babylon.alphaCullingState.js",
                 "../../src/States/babylon.depthCullingState.js",
                 "../../src/States/babylon.stencilState.js",

+ 2 - 2
Tools/Publisher/index.js

@@ -166,7 +166,7 @@ function processCore(package, version) {
     });
     console.log("updating package.json");
     packageJson.files = packageFiles;
-    packageJson.main = "babylon.max.js";
+    packageJson.main = "babylon.js";
     packageJson.typings = "babylon.d.ts";
 
     fs.writeFileSync(basePath + '/package/' + 'package.json', JSON.stringify(packageJson, null, 4));
@@ -186,7 +186,7 @@ function processCore(package, version) {
             return file;
         }
     });
-    packageJson.main = "dist/preview release/babylon.max.js";
+    packageJson.main = "dist/preview release/babylon.js";
     packageJson.typings = "dist/preview release/babylon.d.ts";
 
     fs.writeFileSync(package.path + 'package.json', JSON.stringify(packageJson, null, 4));

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 10330 - 9907
dist/preview release/babylon.d.ts


Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 45 - 45
dist/preview release/babylon.js


+ 537 - 45
dist/preview release/babylon.max.js

@@ -6768,6 +6768,17 @@ var BABYLON;
             }
             return fn;
         };
+        /**
+         * Provides a slice function that will work even on IE
+         * @param data defines the array to slice
+         * @returns the new sliced array
+         */
+        Tools.Slice = function (data) {
+            if (data.slice) {
+                return data.slice();
+            }
+            return Array.prototype.slice.call(data);
+        };
         Tools.SetImmediate = function (action) {
             if (window.setImmediate) {
                 window.setImmediate(action);
@@ -8263,6 +8274,136 @@ var BABYLON;
 
 var BABYLON;
 (function (BABYLON) {
+    var PromiseStates;
+    (function (PromiseStates) {
+        PromiseStates[PromiseStates["Pending"] = 0] = "Pending";
+        PromiseStates[PromiseStates["Fulfilled"] = 1] = "Fulfilled";
+        PromiseStates[PromiseStates["Rejected"] = 2] = "Rejected";
+    })(PromiseStates || (PromiseStates = {}));
+    var InternalPromise = /** @class */ (function () {
+        function InternalPromise(resolver) {
+            var _this = this;
+            this._state = PromiseStates.Pending;
+            if (!resolver) {
+                return;
+            }
+            try {
+                resolver(function (value) {
+                    _this._resolve(value);
+                }, function (reason) {
+                    _this._reject(reason);
+                });
+            }
+            catch (e) {
+                this._reject(e.message);
+            }
+        }
+        Object.defineProperty(InternalPromise.prototype, "state", {
+            get: function () {
+                return this._state;
+            },
+            enumerable: true,
+            configurable: true
+        });
+        InternalPromise.prototype.isFulfilled = function () {
+            return this._state === PromiseStates.Fulfilled;
+        };
+        InternalPromise.prototype.isRejected = function () {
+            return this._state === PromiseStates.Rejected;
+        };
+        InternalPromise.prototype.isPending = function () {
+            return this._state === PromiseStates.Pending;
+        };
+        InternalPromise.prototype.value = function () {
+            if (!this.isFulfilled()) {
+                throw new Error("Promise is not fulfilled");
+            }
+            return this._result;
+        };
+        InternalPromise.prototype.reason = function () {
+            if (!this.isRejected()) {
+                throw new Error("Promise is not rejected");
+            }
+            return this._reason;
+        };
+        InternalPromise.prototype.catch = function (onRejected) {
+            return this.then(undefined, onRejected);
+        };
+        InternalPromise.prototype.then = function (onFulfilled, onRejected) {
+            var newPromise = new InternalPromise();
+            newPromise._onFulfilled = onFulfilled;
+            newPromise._onRejected = onRejected;
+            // Composition
+            this._child = newPromise;
+            switch (this._state) {
+                case PromiseStates.Fulfilled:
+                    var returnedPromise = newPromise._resolve(this._result);
+                    if (returnedPromise) {
+                        newPromise._child = returnedPromise;
+                        newPromise = returnedPromise;
+                    }
+                    break;
+                case PromiseStates.Rejected:
+                    newPromise._reject(this._reason);
+                    newPromise._state = PromiseStates.Fulfilled;
+                    break;
+            }
+            return newPromise;
+        };
+        InternalPromise.prototype._resolve = function (value) {
+            try {
+                this._state = PromiseStates.Fulfilled;
+                this._result = value;
+                var returnedPromise = null;
+                if (this._onFulfilled) {
+                    returnedPromise = this._onFulfilled(value);
+                }
+                if (this._child) {
+                    this._child._resolve(value);
+                }
+                return returnedPromise;
+            }
+            catch (e) {
+                this._reject(e.message);
+            }
+            return null;
+        };
+        InternalPromise.prototype._reject = function (reason) {
+            this._state = PromiseStates.Rejected;
+            this._reason = reason;
+            if (this._onRejected) {
+                this._onRejected(reason);
+            }
+            if (this._child) {
+                this._child._resolve(null);
+            }
+        };
+        InternalPromise.resolve = function (value) {
+            var newPromise = new InternalPromise();
+            newPromise._resolve(value);
+            return newPromise;
+        };
+        return InternalPromise;
+    }());
+    var PromisePolyfill = /** @class */ (function () {
+        function PromisePolyfill() {
+        }
+        PromisePolyfill.Apply = function (force) {
+            if (force === void 0) { force = false; }
+            if (force || typeof Promise === 'undefined') {
+                var root = window;
+                root.Promise = InternalPromise;
+            }
+        };
+        return PromisePolyfill;
+    }());
+    BABYLON.PromisePolyfill = PromisePolyfill;
+})(BABYLON || (BABYLON = {}));
+
+//# sourceMappingURL=babylon.promise.js.map
+
+var BABYLON;
+(function (BABYLON) {
     var _AlphaState = /** @class */ (function () {
         /**
          * Initializes the state.
@@ -9095,6 +9236,8 @@ var BABYLON;
                 }
             };
             this._boundUniforms = {};
+            // Register promises
+            BABYLON.PromisePolyfill.Apply();
             var canvas = null;
             Engine.Instances.push(this);
             if (!canvasOrContext) {
@@ -23377,26 +23520,150 @@ var BABYLON;
 
 var BABYLON;
 (function (BABYLON) {
+    /**
+     * Set of assets to keep when moving a scene into an asset container.
+     */
+    var KeepAssets = /** @class */ (function () {
+        function KeepAssets() {
+            /**
+             * Cameras to keep.
+             */
+            this.cameras = new Array();
+            /**
+             * Lights to keep.
+             */
+            this.lights = new Array();
+            /**
+             * Meshes to keep.
+             */
+            this.meshes = new Array();
+            /**
+             * Skeletons to keep.
+             */
+            this.skeletons = new Array();
+            /**
+             * ParticleSystems to keep.
+             */
+            this.particleSystems = new Array();
+            /**
+             * Animations to keep.
+             */
+            this.animations = new Array();
+            /**
+             * MultiMaterials to keep.
+             */
+            this.multiMaterials = new Array();
+            /**
+             * Materials to keep.
+             */
+            this.materials = new Array();
+            /**
+             * MorphTargetManagers to keep.
+             */
+            this.morphTargetManagers = new Array();
+            /**
+             * Geometries to keep.
+             */
+            this.geometries = new Array();
+            /**
+             * TransformNodes to keep.
+             */
+            this.transformNodes = new Array();
+            /**
+             * LensFlareSystems to keep.
+             */
+            this.lensFlareSystems = new Array();
+            /**
+             * ShadowGenerators to keep.
+             */
+            this.shadowGenerators = new Array();
+            /**
+             * ActionManagers to keep.
+             */
+            this.actionManagers = new Array();
+            /**
+             * Sounds to keep.
+             */
+            this.sounds = new Array();
+        }
+        return KeepAssets;
+    }());
+    BABYLON.KeepAssets = KeepAssets;
+    /**
+     * Container with a set of assets that can be added or removed from a scene.
+     */
     var AssetContainer = /** @class */ (function () {
+        /**
+         * Instantiates an AssetContainer.
+         * @param scene The scene the AssetContainer belongs to.
+         */
         function AssetContainer(scene) {
             // Objects
+            /**
+             * Cameras populated in the container.
+             */
             this.cameras = new Array();
+            /**
+             * Lights populated in the container.
+             */
             this.lights = new Array();
+            /**
+             * Meshes populated in the container.
+             */
             this.meshes = new Array();
+            /**
+             * Skeletons populated in the container.
+             */
             this.skeletons = new Array();
+            /**
+             * ParticleSystems populated in the container.
+             */
             this.particleSystems = new Array();
+            /**
+             * Animations populated in the container.
+             */
             this.animations = new Array();
+            /**
+             * MultiMaterials populated in the container.
+             */
             this.multiMaterials = new Array();
+            /**
+             * Materials populated in the container.
+             */
             this.materials = new Array();
+            /**
+             * MorphTargetManagers populated in the container.
+             */
             this.morphTargetManagers = new Array();
+            /**
+             * Geometries populated in the container.
+             */
             this.geometries = new Array();
+            /**
+             * TransformNodes populated in the container.
+             */
             this.transformNodes = new Array();
+            /**
+             * LensFlareSystems populated in the container.
+             */
             this.lensFlareSystems = new Array();
+            /**
+             * ShadowGenerators populated in the container.
+             */
             this.shadowGenerators = new Array();
+            /**
+             * ActionManagers populated in the container.
+             */
             this.actionManagers = new Array();
+            /**
+             * Sounds populated in the container.
+             */
             this.sounds = new Array();
             this.scene = scene;
         }
+        /**
+         * Adds all the assets from the container to the scene.
+         */
         AssetContainer.prototype.addAllToScene = function () {
             var _this = this;
             this.cameras.forEach(function (o) {
@@ -23444,6 +23711,9 @@ var BABYLON;
                 _this.scene.mainSoundTrack.AddSound(o);
             });
         };
+        /**
+         * Removes all the assets in the container from the scene
+         */
         AssetContainer.prototype.removeAllFromScene = function () {
             var _this = this;
             this.cameras.forEach(function (o) {
@@ -23491,6 +23761,46 @@ var BABYLON;
                 _this.scene.mainSoundTrack.RemoveSound(o);
             });
         };
+        AssetContainer.prototype._moveAssets = function (sourceAssets, targetAssets, keepAssets) {
+            for (var _i = 0, sourceAssets_1 = sourceAssets; _i < sourceAssets_1.length; _i++) {
+                var asset = sourceAssets_1[_i];
+                var move = true;
+                for (var _a = 0, keepAssets_1 = keepAssets; _a < keepAssets_1.length; _a++) {
+                    var keepAsset = keepAssets_1[_a];
+                    if (asset === keepAsset) {
+                        move = false;
+                        break;
+                    }
+                }
+                if (move) {
+                    targetAssets.push(asset);
+                }
+            }
+        };
+        /**
+         * Removes all the assets contained in the scene and adds them to the container.
+         * @param keepAssets Set of assets to keep in the scene. (default: empty)
+         */
+        AssetContainer.prototype.moveAllFromScene = function (keepAssets) {
+            if (keepAssets === undefined) {
+                keepAssets = new KeepAssets();
+            }
+            this._moveAssets(this.scene.cameras, this.cameras, keepAssets.cameras);
+            this._moveAssets(this.scene.meshes, this.meshes, keepAssets.meshes);
+            this._moveAssets(this.scene.getGeometries(), this.geometries, keepAssets.geometries);
+            this._moveAssets(this.scene.materials, this.materials, keepAssets.materials);
+            Array.prototype.push.apply(this.actionManagers, this.scene._actionManagers);
+            Array.prototype.push.apply(this.animations, this.scene.animations);
+            Array.prototype.push.apply(this.lensFlareSystems, this.scene.lensFlareSystems);
+            Array.prototype.push.apply(this.lights, this.scene.lights);
+            Array.prototype.push.apply(this.morphTargetManagers, this.scene.morphTargetManagers);
+            Array.prototype.push.apply(this.multiMaterials, this.scene.multiMaterials);
+            Array.prototype.push.apply(this.skeletons, this.scene.skeletons);
+            Array.prototype.push.apply(this.particleSystems, this.scene.particleSystems);
+            Array.prototype.push.apply(this.sounds, this.scene.mainSoundTrack.soundCollection);
+            Array.prototype.push.apply(this.transformNodes, this.scene.transformNodes);
+            this.removeAllFromScene();
+        };
         return AssetContainer;
     }());
     BABYLON.AssetContainer = AssetContainer;
@@ -25274,6 +25584,13 @@ var BABYLON;
             enumerable: true,
             configurable: true
         });
+        /**
+         * Gets the list of {BABYLON.MeshLODLevel} associated with the current mesh
+         * @returns an array of {BABYLON.MeshLODLevel}
+         */
+        Mesh.prototype.getLODLevels = function () {
+            return this._LODLevels;
+        };
         Mesh.prototype._sortLODLevels = function () {
             this._LODLevels.sort(function (a, b) {
                 if (a.distance < b.distance) {
@@ -25710,7 +26027,7 @@ var BABYLON;
         Mesh.prototype._getPositionData = function (applySkeleton) {
             var data = this.getVerticesData(BABYLON.VertexBuffer.PositionKind);
             if (data && applySkeleton && this.skeleton) {
-                data = data.slice();
+                data = BABYLON.Tools.Slice(data);
                 var matricesIndicesData = this.getVerticesData(BABYLON.VertexBuffer.MatricesIndicesKind);
                 var matricesWeightsData = this.getVerticesData(BABYLON.VertexBuffer.MatricesWeightsKind);
                 if (matricesWeightsData && matricesIndicesData) {
@@ -72939,7 +73256,7 @@ var BABYLON;
             return byteArray;
         };
         DDSTools._ExtractLongWordOrder = function (value) {
-            if (value === 255 || value === -16777216) {
+            if (value === 0 || value === 255 || value === -16777216) {
                 return 0;
             }
             return 1 + DDSTools._ExtractLongWordOrder(value >> 8);
@@ -74738,13 +75055,31 @@ var BABYLON;
 
 var BABYLON;
 (function (BABYLON) {
+    /**
+     * This represents a WebVR camera.
+     * The WebVR camera is Babylon's simple interface to interaction with Windows Mixed Reality, HTC Vive and Oculus Rift.
+     * @example http://doc.babylonjs.com/how_to/webvr_camera
+     */
     var WebVRFreeCamera = /** @class */ (function (_super) {
         __extends(WebVRFreeCamera, _super);
+        /**
+         * Instantiates a WebVRFreeCamera.
+         * @param name The name of the WebVRFreeCamera
+         * @param position The starting anchor position for the camera
+         * @param scene The scene the camera belongs to
+         * @param webVROptions a set of customizable options for the webVRCamera
+         */
         function WebVRFreeCamera(name, position, scene, webVROptions) {
             if (webVROptions === void 0) { webVROptions = {}; }
             var _this = _super.call(this, name, position, scene) || this;
             _this.webVROptions = webVROptions;
+            /**
+             * The vrDisplay tied to the camera. See https://developer.mozilla.org/en-US/docs/Web/API/VRDisplay
+             */
             _this._vrDevice = null;
+            /**
+             * The rawPose of the vrDevice.
+             */
             _this.rawPose = null;
             _this._specsVersion = "1.1";
             _this._attached = false;
@@ -74753,52 +75088,37 @@ var BABYLON;
             _this._deviceRoomPosition = BABYLON.Vector3.Zero();
             _this._deviceRoomRotationQuaternion = BABYLON.Quaternion.Identity();
             _this._standingMatrix = null;
-            // Represents device position and rotation in babylon space
+            /**
+             * Represents device position in babylon space.
+             */
             _this.devicePosition = BABYLON.Vector3.Zero();
+            /**
+             * Represents device rotation in babylon space.
+             */
             _this.deviceRotationQuaternion = BABYLON.Quaternion.Identity();
+            /**
+             * The scale of the device to be used when translating from device space to babylon space.
+             */
             _this.deviceScaleFactor = 1;
             _this._deviceToWorld = BABYLON.Matrix.Identity();
             _this._worldToDevice = BABYLON.Matrix.Identity();
+            /**
+             * References to the webVR controllers for the vrDevice.
+             */
             _this.controllers = [];
+            /**
+             * Emits an event when a controller is attached.
+             */
             _this.onControllersAttachedObservable = new BABYLON.Observable();
+            /**
+             * Emits an event when a controller's mesh has been loaded;
+             */
             _this.onControllerMeshLoadedObservable = new BABYLON.Observable();
-            _this.rigParenting = true; // should the rig cameras be used as parent instead of this camera.
+            /**
+             * If the rig cameras be used as parent instead of this camera.
+             */
+            _this.rigParenting = true;
             _this._defaultHeight = undefined;
-            _this.deviceDistanceToRoomGround = function () {
-                if (_this._standingMatrix && _this._defaultHeight === undefined) {
-                    // Add standing matrix offset to get real offset from ground in room
-                    _this._standingMatrix.getTranslationToRef(_this._workingVector);
-                    return _this._deviceRoomPosition.y + _this._workingVector.y;
-                }
-                //If VRDisplay does not inform stage parameters and no default height is set we fallback to zero.
-                return _this._defaultHeight || 0;
-            };
-            _this.useStandingMatrix = function (callback) {
-                if (callback === void 0) { callback = function (bool) { }; }
-                // Use standing matrix if availible
-                if (!navigator || !navigator.getVRDisplays) {
-                    callback(false);
-                }
-                else {
-                    navigator.getVRDisplays().then(function (displays) {
-                        if (!displays || !displays[0] || !displays[0].stageParameters || !displays[0].stageParameters.sittingToStandingTransform) {
-                            callback(false);
-                        }
-                        else {
-                            _this._standingMatrix = new BABYLON.Matrix();
-                            BABYLON.Matrix.FromFloat32ArrayToRefScaled(displays[0].stageParameters.sittingToStandingTransform, 0, 1, _this._standingMatrix);
-                            if (!_this.getScene().useRightHandedSystem) {
-                                [2, 6, 8, 9, 14].forEach(function (num) {
-                                    if (_this._standingMatrix) {
-                                        _this._standingMatrix.m[num] *= -1;
-                                    }
-                                });
-                            }
-                            callback(true);
-                        }
-                    });
-                }
-            };
             _this._workingVector = BABYLON.Vector3.Zero();
             _this._oneVector = BABYLON.Vector3.One();
             _this._workingMatrix = BABYLON.Matrix.Identity();
@@ -74878,10 +75198,62 @@ var BABYLON;
             });
             return _this;
         }
+        /**
+         * Gets the device distance from the ground.
+         * @returns the distance from the vrDevice to ground in device space. If standing matrix is not supported for the vrDevice 0 is returned.
+         */
+        WebVRFreeCamera.prototype.deviceDistanceToRoomGround = function () {
+            if (this._standingMatrix && this._defaultHeight === undefined) {
+                // Add standing matrix offset to get real offset from ground in room
+                this._standingMatrix.getTranslationToRef(this._workingVector);
+                return this._deviceRoomPosition.y + this._workingVector.y;
+            }
+            //If VRDisplay does not inform stage parameters and no default height is set we fallback to zero.
+            return this._defaultHeight || 0;
+        };
+        /**
+         * Enables the standing matrix when supported. This can be used to position the user's view the correct height from the ground.
+         * @param callback will be called when the standing matrix is set. Callback parameter is if the standing matrix is supported.
+         */
+        WebVRFreeCamera.prototype.useStandingMatrix = function (callback) {
+            var _this = this;
+            if (callback === void 0) { callback = function (bool) { }; }
+            // Use standing matrix if available
+            if (!navigator || !navigator.getVRDisplays) {
+                callback(false);
+            }
+            else {
+                navigator.getVRDisplays().then(function (displays) {
+                    if (!displays || !displays[0] || !displays[0].stageParameters || !displays[0].stageParameters.sittingToStandingTransform) {
+                        callback(false);
+                    }
+                    else {
+                        _this._standingMatrix = new BABYLON.Matrix();
+                        BABYLON.Matrix.FromFloat32ArrayToRefScaled(displays[0].stageParameters.sittingToStandingTransform, 0, 1, _this._standingMatrix);
+                        if (!_this.getScene().useRightHandedSystem) {
+                            [2, 6, 8, 9, 14].forEach(function (num) {
+                                if (_this._standingMatrix) {
+                                    _this._standingMatrix.m[num] *= -1;
+                                }
+                            });
+                        }
+                        callback(true);
+                    }
+                });
+            }
+        };
+        /**
+         * Disposes the camera
+         */
         WebVRFreeCamera.prototype.dispose = function () {
             this.getEngine().onVRRequestPresentComplete.removeCallback(this._onVREnabled);
             _super.prototype.dispose.call(this);
         };
+        /**
+         * Gets a vrController by name.
+         * @param name The name of the controller to retreive
+         * @returns the controller matching the name specified or null if not found
+         */
         WebVRFreeCamera.prototype.getControllerByName = function (name) {
             for (var _i = 0, _a = this.controllers; _i < _a.length; _i++) {
                 var gp = _a[_i];
@@ -74892,6 +75264,9 @@ var BABYLON;
             return null;
         };
         Object.defineProperty(WebVRFreeCamera.prototype, "leftController", {
+            /**
+             * The controller corrisponding to the users left hand.
+             */
             get: function () {
                 if (!this._leftController) {
                     this._leftController = this.getControllerByName("left");
@@ -74903,6 +75278,9 @@ var BABYLON;
         });
         ;
         Object.defineProperty(WebVRFreeCamera.prototype, "rightController", {
+            /**
+             * The controller corrisponding to the users right hand.
+             */
             get: function () {
                 if (!this._rightController) {
                     this._rightController = this.getControllerByName("right");
@@ -74913,6 +75291,11 @@ var BABYLON;
             configurable: true
         });
         ;
+        /**
+         * Casts a ray forward from the vrCamera's gaze.
+         * @param length Length of the ray (default: 100)
+         * @returns the ray corrisponding to the gaze
+         */
         WebVRFreeCamera.prototype.getForwardRay = function (length) {
             if (length === void 0) { length = 100; }
             if (this.leftCamera) {
@@ -74923,6 +75306,9 @@ var BABYLON;
                 return _super.prototype.getForwardRay.call(this, length);
             }
         };
+        /**
+         * Updates the camera based on device's frame data
+         */
         WebVRFreeCamera.prototype._checkInputs = function () {
             if (this._vrDevice && this._vrDevice.isPresenting) {
                 this._vrDevice.getFrameData(this._frameData);
@@ -74930,6 +75316,10 @@ var BABYLON;
             }
             _super.prototype._checkInputs.call(this);
         };
+        /**
+         * Updates the poseControlled values based on the input device pose.
+         * @param poseData Pose coming from the device
+         */
         WebVRFreeCamera.prototype.updateFromDevice = function (poseData) {
             if (poseData && poseData.orientation) {
                 this.rawPose = poseData;
@@ -74952,10 +75342,8 @@ var BABYLON;
          * within a user-interaction callback. Example:
          * <pre> scene.onPointerDown = function() { camera.attachControl(canvas); }</pre>
          *
-         * @param {HTMLElement} element
-         * @param {boolean} [noPreventDefault]
-         *
-         * @memberOf WebVRFreeCamera
+         * @param element html element to attach the vrDevice to
+         * @param noPreventDefault prevent the default html element operation when attaching the vrDevice
          */
         WebVRFreeCamera.prototype.attachControl = function (element, noPreventDefault) {
             _super.prototype.attachControl.call(this, element, noPreventDefault);
@@ -74965,6 +75353,11 @@ var BABYLON;
                 this.getEngine().enableVR();
             }
         };
+        /**
+         * Detaches the camera from the html element and disables VR
+         *
+         * @param element html element to detach from
+         */
         WebVRFreeCamera.prototype.detachControl = function (element) {
             this.getScene().gamepadManager.onGamepadConnectedObservable.remove(this._onGamepadConnectedObserver);
             this.getScene().gamepadManager.onGamepadDisconnectedObservable.remove(this._onGamepadDisconnectedObserver);
@@ -74972,14 +75365,24 @@ var BABYLON;
             this._attached = false;
             this.getEngine().disableVR();
         };
+        /**
+         * @returns the name of this class
+         */
         WebVRFreeCamera.prototype.getClassName = function () {
             return "WebVRFreeCamera";
         };
+        /**
+         * Calls resetPose on the vrDisplay
+         * See: https://developer.mozilla.org/en-US/docs/Web/API/VRDisplay/resetPose
+         */
         WebVRFreeCamera.prototype.resetToCurrentRotation = function () {
             //uses the vrDisplay's "resetPose()".
             //pitch and roll won't be affected.
             this._vrDevice.resetPose();
         };
+        /**
+         * Updates the rig cameras (left and right eye)
+         */
         WebVRFreeCamera.prototype._updateRigCameras = function () {
             var camLeft = this._rigCameras[0];
             var camRight = this._rigCameras[1];
@@ -74988,6 +75391,10 @@ var BABYLON;
             camLeft.position.copyFrom(this._deviceRoomPosition);
             camRight.position.copyFrom(this._deviceRoomPosition);
         };
+        /**
+         * Updates the cached values of the camera
+         * @param ignoreParentClass ignores updating the parent class's cache (default: false)
+         */
         WebVRFreeCamera.prototype._updateCache = function (ignoreParentClass) {
             var _this = this;
             if (!this.rotationQuaternion.equals(this._cache.rotationQuaternion) || !this.position.equals(this._cache.position)) {
@@ -75021,6 +75428,9 @@ var BABYLON;
             }
             this.updateCacheCalled = false;
         };
+        /**
+         * Updates the current device position and rotation in the babylon world
+         */
         WebVRFreeCamera.prototype.update = function () {
             // Get current device position in babylon world
             BABYLON.Vector3.TransformCoordinatesToRef(this._deviceRoomPosition, this._deviceToWorld, this.devicePosition);
@@ -75030,6 +75440,10 @@ var BABYLON;
             BABYLON.Quaternion.FromRotationMatrixToRef(this._workingMatrix, this.deviceRotationQuaternion);
             _super.prototype.update.call(this);
         };
+        /**
+         * Gets the view matrix of this camera (Always set to identity as left and right eye cameras contain the actual view matrix)
+         * @returns an identity matrix
+         */
         WebVRFreeCamera.prototype._getViewMatrix = function () {
             return BABYLON.Matrix.Identity();
         };
@@ -75082,6 +75496,9 @@ var BABYLON;
             }
             return this._projectionMatrix;
         };
+        /**
+         * Initializes the controllers and their meshes
+         */
         WebVRFreeCamera.prototype.initControllers = function () {
             var _this = this;
             this.controllers = [];
@@ -75423,8 +75840,18 @@ var BABYLON;
 
 var BABYLON;
 (function (BABYLON) {
+    /**
+     * Helps to quickly add VR support to an existing scene.
+     * See http://doc.babylonjs.com/how_to/webvr_helper
+     */
     var VRExperienceHelper = /** @class */ (function () {
-        function VRExperienceHelper(scene, webVROptions) {
+        /**
+         * Instantiates a VRExperienceHelper.
+         * Helps to quickly add VR support to an existing scene.
+         * @param scene The scene the VRExperienceHelper belongs to.
+         * @param webVROptions Options to modify the vr experience helper's behavior.
+         */
+        function VRExperienceHelper(scene, /** Options to modify the vr experience helper's behavior. */ webVROptions) {
             if (webVROptions === void 0) { webVROptions = {}; }
             var _this = this;
             this.webVROptions = webVROptions;
@@ -75800,9 +76227,15 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(VRExperienceHelper.prototype, "teleportationTarget", {
+            /**
+             * The mesh used to display where the user is going to teleport.
+             */
             get: function () {
                 return this._teleportationTarget;
             },
+            /**
+             * Sets the mesh to be used to display where the user is going to teleport.
+             */
             set: function (value) {
                 if (value) {
                     value.name = "teleportationTarget";
@@ -75814,9 +76247,15 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(VRExperienceHelper.prototype, "displayGaze", {
+            /**
+             * If the ray of the gaze should be displayed.
+             */
             get: function () {
                 return this._displayGaze;
             },
+            /**
+             * Sets if the ray of the gaze should be displayed.
+             */
             set: function (value) {
                 this._displayGaze = value;
                 if (!value) {
@@ -75827,9 +76266,15 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(VRExperienceHelper.prototype, "displayLaserPointer", {
+            /**
+             * If the ray of the LaserPointer should be displayed.
+             */
             get: function () {
                 return this._displayLaserPointer;
             },
+            /**
+             * Sets if the ray of the LaserPointer should be displayed.
+             */
             set: function (value) {
                 this._displayLaserPointer = value;
                 if (!value) {
@@ -75853,6 +76298,9 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(VRExperienceHelper.prototype, "deviceOrientationCamera", {
+            /**
+             * The deviceOrientationCamera used as the camera when not in VR.
+             */
             get: function () {
                 return this._deviceOrientationCamera;
             },
@@ -75860,7 +76308,9 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(VRExperienceHelper.prototype, "currentVRCamera", {
-            // Based on the current WebVR support, returns the current VR camera used
+            /**
+             * Based on the current WebVR support, returns the current VR camera used.
+             */
             get: function () {
                 if (this._webVRready) {
                     return this._webVRCamera;
@@ -75873,6 +76323,9 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(VRExperienceHelper.prototype, "webVRCamera", {
+            /**
+             * The webVRCamera which is used when in VR.
+             */
             get: function () {
                 return this._webVRCamera;
             },
@@ -75880,6 +76333,9 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(VRExperienceHelper.prototype, "vrDeviceOrientationCamera", {
+            /**
+             * The deviceOrientationCamera that is used as a fallback when vr device is not connected.
+             */
             get: function () {
                 return this._vrDeviceOrientationCamera;
             },
@@ -76030,9 +76486,15 @@ var BABYLON;
             }
         };
         Object.defineProperty(VRExperienceHelper.prototype, "position", {
+            /**
+             * The position of the vr experience helper.
+             */
             get: function () {
                 return this._position;
             },
+            /**
+             * Sets the position of the vr experience helper.
+             */
             set: function (value) {
                 this._position = value;
                 if (this._scene.activeCamera) {
@@ -76042,6 +76504,9 @@ var BABYLON;
             enumerable: true,
             configurable: true
         });
+        /**
+         * Enables controllers and user interactions suck as selecting and object or clicking on an object.
+         */
         VRExperienceHelper.prototype.enableInteractions = function () {
             var _this = this;
             if (!this._interactionsEnabled) {
@@ -76082,6 +76547,10 @@ var BABYLON;
             }
             return false;
         };
+        /**
+         * Adds a floor mesh to be used for teleportation.
+         * @param floorMesh the mesh to be used for teleportation.
+         */
         VRExperienceHelper.prototype.addFloorMesh = function (floorMesh) {
             if (!this._floorMeshesCollection) {
                 return;
@@ -76091,6 +76560,10 @@ var BABYLON;
             }
             this._floorMeshesCollection.push(floorMesh);
         };
+        /**
+         * Removes a floor mesh from being used for teleportation.
+         * @param floorMesh the mesh to be removed.
+         */
         VRExperienceHelper.prototype.removeFloorMesh = function (floorMesh) {
             if (!this._floorMeshesCollection) {
                 return;
@@ -76100,6 +76573,10 @@ var BABYLON;
                 this._floorMeshesCollection.splice(meshIndex, 1);
             }
         };
+        /**
+         * Enables interactions and teleportation using the VR controllers and gaze.
+         * @param vrTeleportationOptions options to modify teleportation behavior.
+         */
         VRExperienceHelper.prototype.enableTeleportation = function (vrTeleportationOptions) {
             if (vrTeleportationOptions === void 0) { vrTeleportationOptions = {}; }
             if (!this._teleportationInitialized) {
@@ -76732,6 +77209,10 @@ var BABYLON;
                 this.changeLaserColor(new BABYLON.Color3(0.7, 0.7, 0.7));
             }
         };
+        /**
+         * Sets the color of the laser ray from the vr controllers.
+         * @param color new color for the ray.
+         */
         VRExperienceHelper.prototype.changeLaserColor = function (color) {
             if (this._leftLaserPointer && this._leftLaserPointer.material) {
                 this._leftLaserPointer.material.emissiveColor = color;
@@ -76740,11 +77221,18 @@ var BABYLON;
                 this._rightLaserPointer.material.emissiveColor = color;
             }
         };
+        /**
+         * Sets the color of the ray from the vr headsets gaze.
+         * @param color new color for the ray.
+         */
         VRExperienceHelper.prototype.changeGazeColor = function (color) {
             if (this._gazeTracker.material) {
                 this._gazeTracker.material.emissiveColor = color;
             }
         };
+        /**
+         * Exits VR and disposes of the vr experience helper
+         */
         VRExperienceHelper.prototype.dispose = function () {
             if (this.isInVRMode) {
                 this.exitVR();
@@ -76789,6 +77277,10 @@ var BABYLON;
             this._scene.gamepadManager.onGamepadDisconnectedObservable.removeCallback(this._onNewGamepadDisconnected);
             this._scene.unregisterBeforeRender(this.beforeRender);
         };
+        /**
+         * Gets the name of the VRExperienceHelper class
+         * @returns "VRExperienceHelper"
+         */
         VRExperienceHelper.prototype.getClassName = function () {
             return "VRExperienceHelper";
         };

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 19088 - 0
dist/preview release/babylon.module.d.ts


Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 45 - 45
dist/preview release/babylon.worker.js


Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 5142 - 4724
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.d.ts


Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 45 - 45
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.js


+ 537 - 45
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.max.js

@@ -6768,6 +6768,17 @@ var BABYLON;
             }
             return fn;
         };
+        /**
+         * Provides a slice function that will work even on IE
+         * @param data defines the array to slice
+         * @returns the new sliced array
+         */
+        Tools.Slice = function (data) {
+            if (data.slice) {
+                return data.slice();
+            }
+            return Array.prototype.slice.call(data);
+        };
         Tools.SetImmediate = function (action) {
             if (window.setImmediate) {
                 window.setImmediate(action);
@@ -8263,6 +8274,136 @@ var BABYLON;
 
 var BABYLON;
 (function (BABYLON) {
+    var PromiseStates;
+    (function (PromiseStates) {
+        PromiseStates[PromiseStates["Pending"] = 0] = "Pending";
+        PromiseStates[PromiseStates["Fulfilled"] = 1] = "Fulfilled";
+        PromiseStates[PromiseStates["Rejected"] = 2] = "Rejected";
+    })(PromiseStates || (PromiseStates = {}));
+    var Promise = /** @class */ (function () {
+        function Promise(resolver) {
+            var _this = this;
+            this._state = PromiseStates.Pending;
+            if (!resolver) {
+                return;
+            }
+            try {
+                resolver(function (value) {
+                    _this._resolve(value);
+                }, function (reason) {
+                    _this._reject(reason);
+                });
+            }
+            catch (e) {
+                this._reject(e.message);
+            }
+        }
+        Object.defineProperty(Promise.prototype, "state", {
+            get: function () {
+                return this._state;
+            },
+            enumerable: true,
+            configurable: true
+        });
+        Promise.prototype.isFulfilled = function () {
+            return this._state === PromiseStates.Fulfilled;
+        };
+        Promise.prototype.isRejected = function () {
+            return this._state === PromiseStates.Rejected;
+        };
+        Promise.prototype.isPending = function () {
+            return this._state === PromiseStates.Pending;
+        };
+        Promise.prototype.value = function () {
+            if (!this.isFulfilled()) {
+                throw new Error("Promise is not fulfilled");
+            }
+            return this._result;
+        };
+        Promise.prototype.reason = function () {
+            if (!this.isRejected()) {
+                throw new Error("Promise is not rejected");
+            }
+            return this._reason;
+        };
+        Promise.prototype.catch = function (onRejected) {
+            return this.then(undefined, onRejected);
+        };
+        Promise.prototype.then = function (onFulfilled, onRejected) {
+            var newPromise = new Promise();
+            newPromise._onFulfilled = onFulfilled;
+            newPromise._onRejected = onRejected;
+            // Composition
+            this._child = newPromise;
+            switch (this._state) {
+                case PromiseStates.Fulfilled:
+                    var returnedPromise = newPromise._resolve(this._result);
+                    if (returnedPromise) {
+                        newPromise._child = returnedPromise;
+                        newPromise = returnedPromise;
+                    }
+                    break;
+                case PromiseStates.Rejected:
+                    newPromise._reject(this._reason);
+                    newPromise._state = PromiseStates.Fulfilled;
+                    break;
+            }
+            return newPromise;
+        };
+        Promise.prototype._resolve = function (value) {
+            try {
+                this._state = PromiseStates.Fulfilled;
+                this._result = value;
+                var returnedPromise = null;
+                if (this._onFulfilled) {
+                    returnedPromise = this._onFulfilled(value);
+                }
+                if (this._child) {
+                    this._child._resolve(value);
+                }
+                return returnedPromise;
+            }
+            catch (e) {
+                this._reject(e.message);
+            }
+            return null;
+        };
+        Promise.prototype._reject = function (reason) {
+            this._state = PromiseStates.Rejected;
+            this._reason = reason;
+            if (this._onRejected) {
+                this._onRejected(reason);
+            }
+            if (this._child) {
+                this._child._resolve(null);
+            }
+        };
+        Promise.resolve = function (value) {
+            var newPromise = new Promise();
+            newPromise._resolve(value);
+            return newPromise;
+        };
+        return Promise;
+    }());
+    var PromisePolyfill = /** @class */ (function () {
+        function PromisePolyfill() {
+        }
+        PromisePolyfill.Apply = function (force) {
+            if (force === void 0) { force = false; }
+            if (force || typeof Promise === 'undefined') {
+                var root = window;
+                root.Promise = Promise;
+            }
+        };
+        return PromisePolyfill;
+    }());
+    BABYLON.PromisePolyfill = PromisePolyfill;
+})(BABYLON || (BABYLON = {}));
+
+//# sourceMappingURL=babylon.promise.js.map
+
+var BABYLON;
+(function (BABYLON) {
     var _AlphaState = /** @class */ (function () {
         /**
          * Initializes the state.
@@ -9095,6 +9236,8 @@ var BABYLON;
                 }
             };
             this._boundUniforms = {};
+            // Register promises
+            BABYLON.PromisePolyfill.Apply();
             var canvas = null;
             Engine.Instances.push(this);
             if (!canvasOrContext) {
@@ -23377,26 +23520,150 @@ var BABYLON;
 
 var BABYLON;
 (function (BABYLON) {
+    /**
+     * Set of assets to keep when moving a scene into an asset container.
+     */
+    var KeepAssets = /** @class */ (function () {
+        function KeepAssets() {
+            /**
+             * Cameras to keep.
+             */
+            this.cameras = new Array();
+            /**
+             * Lights to keep.
+             */
+            this.lights = new Array();
+            /**
+             * Meshes to keep.
+             */
+            this.meshes = new Array();
+            /**
+             * Skeletons to keep.
+             */
+            this.skeletons = new Array();
+            /**
+             * ParticleSystems to keep.
+             */
+            this.particleSystems = new Array();
+            /**
+             * Animations to keep.
+             */
+            this.animations = new Array();
+            /**
+             * MultiMaterials to keep.
+             */
+            this.multiMaterials = new Array();
+            /**
+             * Materials to keep.
+             */
+            this.materials = new Array();
+            /**
+             * MorphTargetManagers to keep.
+             */
+            this.morphTargetManagers = new Array();
+            /**
+             * Geometries to keep.
+             */
+            this.geometries = new Array();
+            /**
+             * TransformNodes to keep.
+             */
+            this.transformNodes = new Array();
+            /**
+             * LensFlareSystems to keep.
+             */
+            this.lensFlareSystems = new Array();
+            /**
+             * ShadowGenerators to keep.
+             */
+            this.shadowGenerators = new Array();
+            /**
+             * ActionManagers to keep.
+             */
+            this.actionManagers = new Array();
+            /**
+             * Sounds to keep.
+             */
+            this.sounds = new Array();
+        }
+        return KeepAssets;
+    }());
+    BABYLON.KeepAssets = KeepAssets;
+    /**
+     * Container with a set of assets that can be added or removed from a scene.
+     */
     var AssetContainer = /** @class */ (function () {
+        /**
+         * Instantiates an AssetContainer.
+         * @param scene The scene the AssetContainer belongs to.
+         */
         function AssetContainer(scene) {
             // Objects
+            /**
+             * Cameras populated in the container.
+             */
             this.cameras = new Array();
+            /**
+             * Lights populated in the container.
+             */
             this.lights = new Array();
+            /**
+             * Meshes populated in the container.
+             */
             this.meshes = new Array();
+            /**
+             * Skeletons populated in the container.
+             */
             this.skeletons = new Array();
+            /**
+             * ParticleSystems populated in the container.
+             */
             this.particleSystems = new Array();
+            /**
+             * Animations populated in the container.
+             */
             this.animations = new Array();
+            /**
+             * MultiMaterials populated in the container.
+             */
             this.multiMaterials = new Array();
+            /**
+             * Materials populated in the container.
+             */
             this.materials = new Array();
+            /**
+             * MorphTargetManagers populated in the container.
+             */
             this.morphTargetManagers = new Array();
+            /**
+             * Geometries populated in the container.
+             */
             this.geometries = new Array();
+            /**
+             * TransformNodes populated in the container.
+             */
             this.transformNodes = new Array();
+            /**
+             * LensFlareSystems populated in the container.
+             */
             this.lensFlareSystems = new Array();
+            /**
+             * ShadowGenerators populated in the container.
+             */
             this.shadowGenerators = new Array();
+            /**
+             * ActionManagers populated in the container.
+             */
             this.actionManagers = new Array();
+            /**
+             * Sounds populated in the container.
+             */
             this.sounds = new Array();
             this.scene = scene;
         }
+        /**
+         * Adds all the assets from the container to the scene.
+         */
         AssetContainer.prototype.addAllToScene = function () {
             var _this = this;
             this.cameras.forEach(function (o) {
@@ -23444,6 +23711,9 @@ var BABYLON;
                 _this.scene.mainSoundTrack.AddSound(o);
             });
         };
+        /**
+         * Removes all the assets in the container from the scene
+         */
         AssetContainer.prototype.removeAllFromScene = function () {
             var _this = this;
             this.cameras.forEach(function (o) {
@@ -23491,6 +23761,46 @@ var BABYLON;
                 _this.scene.mainSoundTrack.RemoveSound(o);
             });
         };
+        AssetContainer.prototype._moveAssets = function (sourceAssets, targetAssets, keepAssets) {
+            for (var _i = 0, sourceAssets_1 = sourceAssets; _i < sourceAssets_1.length; _i++) {
+                var asset = sourceAssets_1[_i];
+                var move = true;
+                for (var _a = 0, keepAssets_1 = keepAssets; _a < keepAssets_1.length; _a++) {
+                    var keepAsset = keepAssets_1[_a];
+                    if (asset === keepAsset) {
+                        move = false;
+                        break;
+                    }
+                }
+                if (move) {
+                    targetAssets.push(asset);
+                }
+            }
+        };
+        /**
+         * Removes all the assets contained in the scene and adds them to the container.
+         * @param keepAssets Set of assets to keep in the scene. (default: empty)
+         */
+        AssetContainer.prototype.moveAllFromScene = function (keepAssets) {
+            if (keepAssets === undefined) {
+                keepAssets = new KeepAssets();
+            }
+            this._moveAssets(this.scene.cameras, this.cameras, keepAssets.cameras);
+            this._moveAssets(this.scene.meshes, this.meshes, keepAssets.meshes);
+            this._moveAssets(this.scene.getGeometries(), this.geometries, keepAssets.geometries);
+            this._moveAssets(this.scene.materials, this.materials, keepAssets.materials);
+            Array.prototype.push.apply(this.actionManagers, this.scene._actionManagers);
+            Array.prototype.push.apply(this.animations, this.scene.animations);
+            Array.prototype.push.apply(this.lensFlareSystems, this.scene.lensFlareSystems);
+            Array.prototype.push.apply(this.lights, this.scene.lights);
+            Array.prototype.push.apply(this.morphTargetManagers, this.scene.morphTargetManagers);
+            Array.prototype.push.apply(this.multiMaterials, this.scene.multiMaterials);
+            Array.prototype.push.apply(this.skeletons, this.scene.skeletons);
+            Array.prototype.push.apply(this.particleSystems, this.scene.particleSystems);
+            Array.prototype.push.apply(this.sounds, this.scene.mainSoundTrack.soundCollection);
+            Array.prototype.push.apply(this.transformNodes, this.scene.transformNodes);
+            this.removeAllFromScene();
+        };
         return AssetContainer;
     }());
     BABYLON.AssetContainer = AssetContainer;
@@ -25274,6 +25584,13 @@ var BABYLON;
             enumerable: true,
             configurable: true
         });
+        /**
+         * Gets the list of {BABYLON.MeshLODLevel} associated with the current mesh
+         * @returns an array of {BABYLON.MeshLODLevel}
+         */
+        Mesh.prototype.getLODLevels = function () {
+            return this._LODLevels;
+        };
         Mesh.prototype._sortLODLevels = function () {
             this._LODLevels.sort(function (a, b) {
                 if (a.distance < b.distance) {
@@ -25710,7 +26027,7 @@ var BABYLON;
         Mesh.prototype._getPositionData = function (applySkeleton) {
             var data = this.getVerticesData(BABYLON.VertexBuffer.PositionKind);
             if (data && applySkeleton && this.skeleton) {
-                data = data.slice();
+                data = BABYLON.Tools.Slice(data);
                 var matricesIndicesData = this.getVerticesData(BABYLON.VertexBuffer.MatricesIndicesKind);
                 var matricesWeightsData = this.getVerticesData(BABYLON.VertexBuffer.MatricesWeightsKind);
                 if (matricesWeightsData && matricesIndicesData) {
@@ -72733,7 +73050,7 @@ var BABYLON;
             return byteArray;
         };
         DDSTools._ExtractLongWordOrder = function (value) {
-            if (value === 255 || value === -16777216) {
+            if (value === 0 || value === 255 || value === -16777216) {
                 return 0;
             }
             return 1 + DDSTools._ExtractLongWordOrder(value >> 8);
@@ -74532,13 +74849,31 @@ var BABYLON;
 
 var BABYLON;
 (function (BABYLON) {
+    /**
+     * This represents a WebVR camera.
+     * The WebVR camera is Babylon's simple interface to interaction with Windows Mixed Reality, HTC Vive and Oculus Rift.
+     * @example http://doc.babylonjs.com/how_to/webvr_camera
+     */
     var WebVRFreeCamera = /** @class */ (function (_super) {
         __extends(WebVRFreeCamera, _super);
+        /**
+         * Instantiates a WebVRFreeCamera.
+         * @param name The name of the WebVRFreeCamera
+         * @param position The starting anchor position for the camera
+         * @param scene The scene the camera belongs to
+         * @param webVROptions a set of customizable options for the webVRCamera
+         */
         function WebVRFreeCamera(name, position, scene, webVROptions) {
             if (webVROptions === void 0) { webVROptions = {}; }
             var _this = _super.call(this, name, position, scene) || this;
             _this.webVROptions = webVROptions;
+            /**
+             * The vrDisplay tied to the camera. See https://developer.mozilla.org/en-US/docs/Web/API/VRDisplay
+             */
             _this._vrDevice = null;
+            /**
+             * The rawPose of the vrDevice.
+             */
             _this.rawPose = null;
             _this._specsVersion = "1.1";
             _this._attached = false;
@@ -74547,52 +74882,37 @@ var BABYLON;
             _this._deviceRoomPosition = BABYLON.Vector3.Zero();
             _this._deviceRoomRotationQuaternion = BABYLON.Quaternion.Identity();
             _this._standingMatrix = null;
-            // Represents device position and rotation in babylon space
+            /**
+             * Represents device position in babylon space.
+             */
             _this.devicePosition = BABYLON.Vector3.Zero();
+            /**
+             * Represents device rotation in babylon space.
+             */
             _this.deviceRotationQuaternion = BABYLON.Quaternion.Identity();
+            /**
+             * The scale of the device to be used when translating from device space to babylon space.
+             */
             _this.deviceScaleFactor = 1;
             _this._deviceToWorld = BABYLON.Matrix.Identity();
             _this._worldToDevice = BABYLON.Matrix.Identity();
+            /**
+             * References to the webVR controllers for the vrDevice.
+             */
             _this.controllers = [];
+            /**
+             * Emits an event when a controller is attached.
+             */
             _this.onControllersAttachedObservable = new BABYLON.Observable();
+            /**
+             * Emits an event when a controller's mesh has been loaded;
+             */
             _this.onControllerMeshLoadedObservable = new BABYLON.Observable();
-            _this.rigParenting = true; // should the rig cameras be used as parent instead of this camera.
+            /**
+             * If the rig cameras be used as parent instead of this camera.
+             */
+            _this.rigParenting = true;
             _this._defaultHeight = undefined;
-            _this.deviceDistanceToRoomGround = function () {
-                if (_this._standingMatrix && _this._defaultHeight === undefined) {
-                    // Add standing matrix offset to get real offset from ground in room
-                    _this._standingMatrix.getTranslationToRef(_this._workingVector);
-                    return _this._deviceRoomPosition.y + _this._workingVector.y;
-                }
-                //If VRDisplay does not inform stage parameters and no default height is set we fallback to zero.
-                return _this._defaultHeight || 0;
-            };
-            _this.useStandingMatrix = function (callback) {
-                if (callback === void 0) { callback = function (bool) { }; }
-                // Use standing matrix if availible
-                if (!navigator || !navigator.getVRDisplays) {
-                    callback(false);
-                }
-                else {
-                    navigator.getVRDisplays().then(function (displays) {
-                        if (!displays || !displays[0] || !displays[0].stageParameters || !displays[0].stageParameters.sittingToStandingTransform) {
-                            callback(false);
-                        }
-                        else {
-                            _this._standingMatrix = new BABYLON.Matrix();
-                            BABYLON.Matrix.FromFloat32ArrayToRefScaled(displays[0].stageParameters.sittingToStandingTransform, 0, 1, _this._standingMatrix);
-                            if (!_this.getScene().useRightHandedSystem) {
-                                [2, 6, 8, 9, 14].forEach(function (num) {
-                                    if (_this._standingMatrix) {
-                                        _this._standingMatrix.m[num] *= -1;
-                                    }
-                                });
-                            }
-                            callback(true);
-                        }
-                    });
-                }
-            };
             _this._workingVector = BABYLON.Vector3.Zero();
             _this._oneVector = BABYLON.Vector3.One();
             _this._workingMatrix = BABYLON.Matrix.Identity();
@@ -74672,10 +74992,62 @@ var BABYLON;
             });
             return _this;
         }
+        /**
+         * Gets the device distance from the ground.
+         * @returns the distance from the vrDevice to ground in device space. If standing matrix is not supported for the vrDevice 0 is returned.
+         */
+        WebVRFreeCamera.prototype.deviceDistanceToRoomGround = function () {
+            if (this._standingMatrix && this._defaultHeight === undefined) {
+                // Add standing matrix offset to get real offset from ground in room
+                this._standingMatrix.getTranslationToRef(this._workingVector);
+                return this._deviceRoomPosition.y + this._workingVector.y;
+            }
+            //If VRDisplay does not inform stage parameters and no default height is set we fallback to zero.
+            return this._defaultHeight || 0;
+        };
+        /**
+         * Enables the standing matrix when supported. This can be used to position the user's view the correct height from the ground.
+         * @param callback will be called when the standing matrix is set. Callback parameter is if the standing matrix is supported.
+         */
+        WebVRFreeCamera.prototype.useStandingMatrix = function (callback) {
+            var _this = this;
+            if (callback === void 0) { callback = function (bool) { }; }
+            // Use standing matrix if available
+            if (!navigator || !navigator.getVRDisplays) {
+                callback(false);
+            }
+            else {
+                navigator.getVRDisplays().then(function (displays) {
+                    if (!displays || !displays[0] || !displays[0].stageParameters || !displays[0].stageParameters.sittingToStandingTransform) {
+                        callback(false);
+                    }
+                    else {
+                        _this._standingMatrix = new BABYLON.Matrix();
+                        BABYLON.Matrix.FromFloat32ArrayToRefScaled(displays[0].stageParameters.sittingToStandingTransform, 0, 1, _this._standingMatrix);
+                        if (!_this.getScene().useRightHandedSystem) {
+                            [2, 6, 8, 9, 14].forEach(function (num) {
+                                if (_this._standingMatrix) {
+                                    _this._standingMatrix.m[num] *= -1;
+                                }
+                            });
+                        }
+                        callback(true);
+                    }
+                });
+            }
+        };
+        /**
+         * Disposes the camera
+         */
         WebVRFreeCamera.prototype.dispose = function () {
             this.getEngine().onVRRequestPresentComplete.removeCallback(this._onVREnabled);
             _super.prototype.dispose.call(this);
         };
+        /**
+         * Gets a vrController by name.
+         * @param name The name of the controller to retreive
+         * @returns the controller matching the name specified or null if not found
+         */
         WebVRFreeCamera.prototype.getControllerByName = function (name) {
             for (var _i = 0, _a = this.controllers; _i < _a.length; _i++) {
                 var gp = _a[_i];
@@ -74686,6 +75058,9 @@ var BABYLON;
             return null;
         };
         Object.defineProperty(WebVRFreeCamera.prototype, "leftController", {
+            /**
+             * The controller corrisponding to the users left hand.
+             */
             get: function () {
                 if (!this._leftController) {
                     this._leftController = this.getControllerByName("left");
@@ -74697,6 +75072,9 @@ var BABYLON;
         });
         ;
         Object.defineProperty(WebVRFreeCamera.prototype, "rightController", {
+            /**
+             * The controller corrisponding to the users right hand.
+             */
             get: function () {
                 if (!this._rightController) {
                     this._rightController = this.getControllerByName("right");
@@ -74707,6 +75085,11 @@ var BABYLON;
             configurable: true
         });
         ;
+        /**
+         * Casts a ray forward from the vrCamera's gaze.
+         * @param length Length of the ray (default: 100)
+         * @returns the ray corrisponding to the gaze
+         */
         WebVRFreeCamera.prototype.getForwardRay = function (length) {
             if (length === void 0) { length = 100; }
             if (this.leftCamera) {
@@ -74717,6 +75100,9 @@ var BABYLON;
                 return _super.prototype.getForwardRay.call(this, length);
             }
         };
+        /**
+         * Updates the camera based on device's frame data
+         */
         WebVRFreeCamera.prototype._checkInputs = function () {
             if (this._vrDevice && this._vrDevice.isPresenting) {
                 this._vrDevice.getFrameData(this._frameData);
@@ -74724,6 +75110,10 @@ var BABYLON;
             }
             _super.prototype._checkInputs.call(this);
         };
+        /**
+         * Updates the poseControlled values based on the input device pose.
+         * @param poseData Pose coming from the device
+         */
         WebVRFreeCamera.prototype.updateFromDevice = function (poseData) {
             if (poseData && poseData.orientation) {
                 this.rawPose = poseData;
@@ -74746,10 +75136,8 @@ var BABYLON;
          * within a user-interaction callback. Example:
          * <pre> scene.onPointerDown = function() { camera.attachControl(canvas); }</pre>
          *
-         * @param {HTMLElement} element
-         * @param {boolean} [noPreventDefault]
-         *
-         * @memberOf WebVRFreeCamera
+         * @param element html element to attach the vrDevice to
+         * @param noPreventDefault prevent the default html element operation when attaching the vrDevice
          */
         WebVRFreeCamera.prototype.attachControl = function (element, noPreventDefault) {
             _super.prototype.attachControl.call(this, element, noPreventDefault);
@@ -74759,6 +75147,11 @@ var BABYLON;
                 this.getEngine().enableVR();
             }
         };
+        /**
+         * Detaches the camera from the html element and disables VR
+         *
+         * @param element html element to detach from
+         */
         WebVRFreeCamera.prototype.detachControl = function (element) {
             this.getScene().gamepadManager.onGamepadConnectedObservable.remove(this._onGamepadConnectedObserver);
             this.getScene().gamepadManager.onGamepadDisconnectedObservable.remove(this._onGamepadDisconnectedObserver);
@@ -74766,14 +75159,24 @@ var BABYLON;
             this._attached = false;
             this.getEngine().disableVR();
         };
+        /**
+         * @returns the name of this class
+         */
         WebVRFreeCamera.prototype.getClassName = function () {
             return "WebVRFreeCamera";
         };
+        /**
+         * Calls resetPose on the vrDisplay
+         * See: https://developer.mozilla.org/en-US/docs/Web/API/VRDisplay/resetPose
+         */
         WebVRFreeCamera.prototype.resetToCurrentRotation = function () {
             //uses the vrDisplay's "resetPose()".
             //pitch and roll won't be affected.
             this._vrDevice.resetPose();
         };
+        /**
+         * Updates the rig cameras (left and right eye)
+         */
         WebVRFreeCamera.prototype._updateRigCameras = function () {
             var camLeft = this._rigCameras[0];
             var camRight = this._rigCameras[1];
@@ -74782,6 +75185,10 @@ var BABYLON;
             camLeft.position.copyFrom(this._deviceRoomPosition);
             camRight.position.copyFrom(this._deviceRoomPosition);
         };
+        /**
+         * Updates the cached values of the camera
+         * @param ignoreParentClass ignores updating the parent class's cache (default: false)
+         */
         WebVRFreeCamera.prototype._updateCache = function (ignoreParentClass) {
             var _this = this;
             if (!this.rotationQuaternion.equals(this._cache.rotationQuaternion) || !this.position.equals(this._cache.position)) {
@@ -74815,6 +75222,9 @@ var BABYLON;
             }
             this.updateCacheCalled = false;
         };
+        /**
+         * Updates the current device position and rotation in the babylon world
+         */
         WebVRFreeCamera.prototype.update = function () {
             // Get current device position in babylon world
             BABYLON.Vector3.TransformCoordinatesToRef(this._deviceRoomPosition, this._deviceToWorld, this.devicePosition);
@@ -74824,6 +75234,10 @@ var BABYLON;
             BABYLON.Quaternion.FromRotationMatrixToRef(this._workingMatrix, this.deviceRotationQuaternion);
             _super.prototype.update.call(this);
         };
+        /**
+         * Gets the view matrix of this camera (Always set to identity as left and right eye cameras contain the actual view matrix)
+         * @returns an identity matrix
+         */
         WebVRFreeCamera.prototype._getViewMatrix = function () {
             return BABYLON.Matrix.Identity();
         };
@@ -74876,6 +75290,9 @@ var BABYLON;
             }
             return this._projectionMatrix;
         };
+        /**
+         * Initializes the controllers and their meshes
+         */
         WebVRFreeCamera.prototype.initControllers = function () {
             var _this = this;
             this.controllers = [];
@@ -75217,8 +75634,18 @@ var BABYLON;
 
 var BABYLON;
 (function (BABYLON) {
+    /**
+     * Helps to quickly add VR support to an existing scene.
+     * See http://doc.babylonjs.com/how_to/webvr_helper
+     */
     var VRExperienceHelper = /** @class */ (function () {
-        function VRExperienceHelper(scene, webVROptions) {
+        /**
+         * Instantiates a VRExperienceHelper.
+         * Helps to quickly add VR support to an existing scene.
+         * @param scene The scene the VRExperienceHelper belongs to.
+         * @param webVROptions Options to modify the vr experience helper's behavior.
+         */
+        function VRExperienceHelper(scene, /** Options to modify the vr experience helper's behavior. */ webVROptions) {
             if (webVROptions === void 0) { webVROptions = {}; }
             var _this = this;
             this.webVROptions = webVROptions;
@@ -75594,9 +76021,15 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(VRExperienceHelper.prototype, "teleportationTarget", {
+            /**
+             * The mesh used to display where the user is going to teleport.
+             */
             get: function () {
                 return this._teleportationTarget;
             },
+            /**
+             * Sets the mesh to be used to display where the user is going to teleport.
+             */
             set: function (value) {
                 if (value) {
                     value.name = "teleportationTarget";
@@ -75608,9 +76041,15 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(VRExperienceHelper.prototype, "displayGaze", {
+            /**
+             * If the ray of the gaze should be displayed.
+             */
             get: function () {
                 return this._displayGaze;
             },
+            /**
+             * Sets if the ray of the gaze should be displayed.
+             */
             set: function (value) {
                 this._displayGaze = value;
                 if (!value) {
@@ -75621,9 +76060,15 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(VRExperienceHelper.prototype, "displayLaserPointer", {
+            /**
+             * If the ray of the LaserPointer should be displayed.
+             */
             get: function () {
                 return this._displayLaserPointer;
             },
+            /**
+             * Sets if the ray of the LaserPointer should be displayed.
+             */
             set: function (value) {
                 this._displayLaserPointer = value;
                 if (!value) {
@@ -75647,6 +76092,9 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(VRExperienceHelper.prototype, "deviceOrientationCamera", {
+            /**
+             * The deviceOrientationCamera used as the camera when not in VR.
+             */
             get: function () {
                 return this._deviceOrientationCamera;
             },
@@ -75654,7 +76102,9 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(VRExperienceHelper.prototype, "currentVRCamera", {
-            // Based on the current WebVR support, returns the current VR camera used
+            /**
+             * Based on the current WebVR support, returns the current VR camera used.
+             */
             get: function () {
                 if (this._webVRready) {
                     return this._webVRCamera;
@@ -75667,6 +76117,9 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(VRExperienceHelper.prototype, "webVRCamera", {
+            /**
+             * The webVRCamera which is used when in VR.
+             */
             get: function () {
                 return this._webVRCamera;
             },
@@ -75674,6 +76127,9 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(VRExperienceHelper.prototype, "vrDeviceOrientationCamera", {
+            /**
+             * The deviceOrientationCamera that is used as a fallback when vr device is not connected.
+             */
             get: function () {
                 return this._vrDeviceOrientationCamera;
             },
@@ -75824,9 +76280,15 @@ var BABYLON;
             }
         };
         Object.defineProperty(VRExperienceHelper.prototype, "position", {
+            /**
+             * The position of the vr experience helper.
+             */
             get: function () {
                 return this._position;
             },
+            /**
+             * Sets the position of the vr experience helper.
+             */
             set: function (value) {
                 this._position = value;
                 if (this._scene.activeCamera) {
@@ -75836,6 +76298,9 @@ var BABYLON;
             enumerable: true,
             configurable: true
         });
+        /**
+         * Enables controllers and user interactions suck as selecting and object or clicking on an object.
+         */
         VRExperienceHelper.prototype.enableInteractions = function () {
             var _this = this;
             if (!this._interactionsEnabled) {
@@ -75876,6 +76341,10 @@ var BABYLON;
             }
             return false;
         };
+        /**
+         * Adds a floor mesh to be used for teleportation.
+         * @param floorMesh the mesh to be used for teleportation.
+         */
         VRExperienceHelper.prototype.addFloorMesh = function (floorMesh) {
             if (!this._floorMeshesCollection) {
                 return;
@@ -75885,6 +76354,10 @@ var BABYLON;
             }
             this._floorMeshesCollection.push(floorMesh);
         };
+        /**
+         * Removes a floor mesh from being used for teleportation.
+         * @param floorMesh the mesh to be removed.
+         */
         VRExperienceHelper.prototype.removeFloorMesh = function (floorMesh) {
             if (!this._floorMeshesCollection) {
                 return;
@@ -75894,6 +76367,10 @@ var BABYLON;
                 this._floorMeshesCollection.splice(meshIndex, 1);
             }
         };
+        /**
+         * Enables interactions and teleportation using the VR controllers and gaze.
+         * @param vrTeleportationOptions options to modify teleportation behavior.
+         */
         VRExperienceHelper.prototype.enableTeleportation = function (vrTeleportationOptions) {
             if (vrTeleportationOptions === void 0) { vrTeleportationOptions = {}; }
             if (!this._teleportationInitialized) {
@@ -76526,6 +77003,10 @@ var BABYLON;
                 this.changeLaserColor(new BABYLON.Color3(0.7, 0.7, 0.7));
             }
         };
+        /**
+         * Sets the color of the laser ray from the vr controllers.
+         * @param color new color for the ray.
+         */
         VRExperienceHelper.prototype.changeLaserColor = function (color) {
             if (this._leftLaserPointer && this._leftLaserPointer.material) {
                 this._leftLaserPointer.material.emissiveColor = color;
@@ -76534,11 +77015,18 @@ var BABYLON;
                 this._rightLaserPointer.material.emissiveColor = color;
             }
         };
+        /**
+         * Sets the color of the ray from the vr headsets gaze.
+         * @param color new color for the ray.
+         */
         VRExperienceHelper.prototype.changeGazeColor = function (color) {
             if (this._gazeTracker.material) {
                 this._gazeTracker.material.emissiveColor = color;
             }
         };
+        /**
+         * Exits VR and disposes of the vr experience helper
+         */
         VRExperienceHelper.prototype.dispose = function () {
             if (this.isInVRMode) {
                 this.exitVR();
@@ -76583,6 +77071,10 @@ var BABYLON;
             this._scene.gamepadManager.onGamepadDisconnectedObservable.removeCallback(this._onNewGamepadDisconnected);
             this._scene.unregisterBeforeRender(this.beforeRender);
         };
+        /**
+         * Gets the name of the VRExperienceHelper class
+         * @returns "VRExperienceHelper"
+         */
         VRExperienceHelper.prototype.getClassName = function () {
             return "VRExperienceHelper";
         };

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 539 - 47
dist/preview release/customConfigurations/minimalGLTFViewer/es6.js


Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 539 - 47
dist/preview release/es6.js


+ 2 - 2
dist/preview release/loaders/babylon.glTF2FileLoader.d.ts

@@ -362,7 +362,7 @@ declare module BABYLON.GLTF2 {
         index: number;
         texCoord?: number;
     }
-    interface IGLTF extends IGLTFProperty {
+    interface _IGLTF extends IGLTFProperty {
         accessors?: IGLTFAccessor[];
         animations?: IGLTFAnimation[];
         asset: IGLTFAsset;
@@ -386,7 +386,7 @@ declare module BABYLON.GLTF2 {
 
 declare module BABYLON.GLTF2 {
     class GLTFLoader implements IGLTFLoader {
-        _gltf: IGLTF;
+        _gltf: _IGLTF;
         _babylonScene: Scene;
         private _disposed;
         private _rootUrl;

+ 2 - 2
dist/preview release/loaders/babylon.glTFFileLoader.d.ts

@@ -919,7 +919,7 @@ declare module BABYLON.GLTF2 {
         index: number;
         texCoord?: number;
     }
-    interface IGLTF extends IGLTFProperty {
+    interface _IGLTF extends IGLTFProperty {
         accessors?: IGLTFAccessor[];
         animations?: IGLTFAnimation[];
         asset: IGLTFAsset;
@@ -943,7 +943,7 @@ declare module BABYLON.GLTF2 {
 
 declare module BABYLON.GLTF2 {
     class GLTFLoader implements IGLTFLoader {
-        _gltf: IGLTF;
+        _gltf: _IGLTF;
         _babylonScene: Scene;
         private _disposed;
         private _rootUrl;

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

@@ -1020,7 +1020,7 @@ declare module BABYLON.GLTF2 {
         index: number;
         texCoord?: number;
     }
-    interface IGLTF extends IGLTFProperty {
+    interface _IGLTF extends IGLTFProperty {
         accessors?: IGLTFAccessor[];
         animations?: IGLTFAnimation[];
         asset: IGLTFAsset;
@@ -1044,7 +1044,7 @@ declare module BABYLON.GLTF2 {
 
 declare module BABYLON.GLTF2 {
     class GLTFLoader implements IGLTFLoader {
-        _gltf: IGLTF;
+        _gltf: _IGLTF;
         _babylonScene: Scene;
         private _disposed;
         private _rootUrl;

+ 1 - 3
dist/preview release/loaders/package.json

@@ -31,7 +31,5 @@
     },
     "engines": {
         "node": "*"
-    },
-    "_id": "babylonjs-loaders@3.1.0-alpha1",
-    "_from": "babylonjs-loaders@"
+    }
 }

+ 1 - 3
dist/preview release/materialsLibrary/package.json

@@ -31,7 +31,5 @@
     },
     "engines": {
         "node": "*"
-    },
-    "_id": "babylonjs-materials@3.1.0-alpha1",
-    "_from": "babylonjs-materials@"
+    }
 }

+ 1 - 3
dist/preview release/postProcessesLibrary/package.json

@@ -31,7 +31,5 @@
     },
     "engines": {
         "node": "*"
-    },
-    "_id": "babylonjs-post-process@3.1.0-alpha1",
-    "_from": "babylonjs-post-process@"
+    }
 }

+ 1 - 3
dist/preview release/proceduralTexturesLibrary/package.json

@@ -31,7 +31,5 @@
     },
     "engines": {
         "node": "*"
-    },
-    "_id": "babylonjs-procedural-textures@3.1.0-alpha1",
-    "_from": "babylonjs-procedural-textures@"
+    }
 }

+ 104 - 53
dist/preview release/serializers/babylon.glTF2Serializer.d.ts

@@ -1,80 +1,110 @@
 
 declare module BABYLON {
-    interface IGLTFExporterOptions {
+    /**
+     * Holds a collection of exporter options and parameters
+     */
+    interface IExporterOptions {
         /**
-         * Interface function which indicates whether a babylon mesh should be exported or not.
-         * @param mesh
+         * Function which indicates whether a babylon mesh should be exported or not.
+         * @param mesh - source Babylon mesh. It is used to check whether it should be
+         * exported to glTF or not.
          * @returns boolean, which indicates whether the mesh should be exported (true) or not (false)
          */
         shouldExportMesh?(mesh: AbstractMesh): boolean;
     }
+    /**
+     * Class for generating glTF data from a Babylon scene.
+     */
     class GLTF2Export {
         /**
-         * Exports the geometry of a Mesh array in .gltf file format.
-         * @param meshes
-         * @param materials
-         * @param options
-         *
-         * @returns - Returns an object with a .gltf, .glb and associates textures
+         * Exports the geometry of the scene to .gltf file format.
+         * @param scene - Babylon scene with scene hierarchy information.
+         * @param filePrefix - File prefix to use when generating the glTF file.
+         * @param options - Exporter options.
+         * @returns - Returns an object with a .gltf file and associates texture names
          * as keys and their data and paths as values.
          */
-        static GLTF(scene: Scene, filename: string, options?: IGLTFExporterOptions): _GLTFData;
+        static GLTF(scene: Scene, filePrefix: string, options?: IExporterOptions): _GLTFData;
         /**
-         *
-         * @param meshes
-         * @param filename
-         *
+         * Exports the geometry of the scene to .glb file format.
+         * @param scene - Babylon scene with scene hierarchy information.
+         * @param filePrefix - File prefix to use when generating glb file.
+         * @param options - Exporter options.
          * @returns - Returns an object with a .glb filename as key and data as value
          */
-        static GLB(scene: Scene, filename: string, options?: IGLTFExporterOptions): _GLTFData;
+        static GLB(scene: Scene, filePrefix: string, options?: IExporterOptions): _GLTFData;
     }
 }
 
-declare module BABYLON {
-    /**
-     * glTF Alpha Mode Enum
-     */
-    enum _EGLTFAlphaModeEnum {
-        OPAQUE = "OPAQUE",
-        MASK = "MASK",
-        BLEND = "BLEND",
-    }
-    /**
-     * Babylon Specular Glossiness interface
-     */
-    interface _IBabylonSpecularGlossiness {
-        diffuse: Color3;
-        opacity: number;
-        specular: Color3;
-        glossiness: number;
-    }
-    /**
-     * Babylon Metallic Roughness interface
-     */
-    interface _IBabylonMetallicRoughness {
-        baseColor: Color3;
-        opacity: number;
-        metallic: number;
-        roughness: number;
-    }
+
+/**
+ * Module for the Babylon glTF 2.0 exporter.  Should ONLY be used internally.
+ * @ignore - capitalization of GLTF2 module.
+ */
+declare module BABYLON.GLTF2 {
     /**
-     * Converts Babylon Scene into glTF 2.0
+     * Converts Babylon Scene into glTF 2.0.
      */
-    class _GLTF2Exporter {
+    class _Exporter {
+        /**
+         * Stores all generated buffer views, which represents views into the main glTF buffer data.
+         */
         private bufferViews;
+        /**
+         * Stores all the generated accessors, which is used for accessing the data within the buffer views in glTF.
+         */
         private accessors;
+        /**
+         * Stores all the generated nodes, which contains transform and/or mesh information per node.
+         */
         private nodes;
+        /**
+         * Stores the glTF asset information, which represents the glTF version and this file generator.
+         */
         private asset;
+        /**
+         * Stores all the generated glTF scenes, which stores multiple node hierarchies.
+         */
         private scenes;
+        /**
+         * Stores all the generated mesh information, each containing a set of primitives to render in glTF.
+         */
         private meshes;
+        /**
+         * Stores all the generated material information, which represents the appearance of each primitive.
+         */
         private materials;
+        /**
+         * Stores all the generated texture information, which is referenced by glTF materials.
+         */
         private textures;
+        /**
+         * Stores all the generated image information, which is referenced by glTF textures.
+         */
         private images;
+        /**
+         * Stores the total amount of bytes stored in the glTF buffer.
+         */
         private totalByteLength;
+        /**
+         * Stores a reference to the Babylon scene containing the source geometry and material information.
+         */
         private babylonScene;
+        /**
+         * Stores the exporter options, which are optionally passed in from the glTF serializer.
+         */
         private options?;
+        /**
+         * Stores a map of the image data, where the key is the file name and the value
+         * is the image data.
+         */
         private imageData;
-        constructor(babylonScene: Scene, options?: IGLTFExporterOptions);
+        /**
+         * Creates a glTF Exporter instance, which can accept optional exporter options.
+         * @param babylonScene - Babylon scene object
+         * @param options - Options to modify the behavior of the exporter.
+         */
+        constructor(babylonScene: Scene, options?: IExporterOptions);
         /**
          * Creates a buffer view based on teh supplied arguments
          * @param {number} bufferIndex - index value of the specified buffer
@@ -189,35 +219,56 @@ declare module BABYLON {
     }
 }
 
+
 declare module BABYLON {
     /**
      * Class for holding and downloading glTF file data
      */
     class _GLTFData {
+        /**
+         * Object which contains the file name as the key and its data as the value.
+         */
         glTFFiles: {
             [fileName: string]: string | Blob;
         };
+        /**
+         * Initializes the glTF file object.
+         */
         constructor();
         /**
-         * Downloads glTF data.
+         * Downloads the glTF data as files based on their names and data.
          */
         downloadFiles(): void;
     }
 }
 
-declare module BABYLON {
+
+declare module BABYLON.GLTF2 {
     /**
-     * Utility methods for working with glTF material conversion properties
+     * Utility methods for working with glTF material conversion properties.  This class should only be used internally.
      */
     class _GLTFMaterial {
-        private static dielectricSpecular;
-        private static epsilon;
         /**
-         * Converts Specular Glossiness to Metallic Roughness
+         * Represents the dielectric specular values for R, G and B.
+         */
+        private static readonly dielectricSpecular;
+        /**
+         * Epsilon value, used as a small tolerance value for a numeric value.
+         */
+        private static readonly epsilon;
+        /**
+         * Converts a Babylon StandardMaterial to a glTF Metallic Roughness Material.
+         * @param babylonStandardMaterial
+         * @returns - glTF Metallic Roughness Material representation
+         */
+        static ConvertToGLTFPBRMetallicRoughness(babylonStandardMaterial: StandardMaterial): IMaterialPbrMetallicRoughness;
+        /**
+         * Converts Specular Glossiness to Metallic Roughness.  This is based on the algorithm used in the Babylon glTF 3ds Max Exporter.
+         * {@link https://github.com/BabylonJS/Exporters/blob/master/3ds%20Max/Max2Babylon/Exporter/BabylonExporter.GLTFExporter.Material.cs}
          * @param  babylonSpecularGlossiness - Babylon specular glossiness parameters
          * @returns - Babylon metallic roughness values
          */
-        static ConvertToMetallicRoughness(babylonSpecularGlossiness: _IBabylonSpecularGlossiness): _IBabylonMetallicRoughness;
+        private static _ConvertToMetallicRoughness(babylonSpecularGlossiness);
         /**
          * Returns the perceived brightness value based on the provided color
          * @param color - color used in calculating the perceived brightness
@@ -237,6 +288,6 @@ declare module BABYLON {
          * @param babylonMaterial - Babylon Material
          * @returns - The Babylon alpha mode value
          */
-        static GetAlphaMode(babylonMaterial: Material): string;
+        static GetAlphaMode(babylonMaterial: Material): MaterialAlphaMode;
     }
 }

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 917 - 889
dist/preview release/serializers/babylon.glTF2Serializer.js


Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 1 - 1
dist/preview release/serializers/babylon.glTF2Serializer.min.js


Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 917 - 889
dist/preview release/serializers/babylonjs.serializers.js


Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 1 - 1
dist/preview release/serializers/babylonjs.serializers.min.js


+ 104 - 53
dist/preview release/serializers/babylonjs.serializers.module.d.ts

@@ -14,81 +14,111 @@ declare module BABYLON {
 
 
 declare module BABYLON {
-    interface IGLTFExporterOptions {
+    /**
+     * Holds a collection of exporter options and parameters
+     */
+    interface IExporterOptions {
         /**
-         * Interface function which indicates whether a babylon mesh should be exported or not.
-         * @param mesh
+         * Function which indicates whether a babylon mesh should be exported or not.
+         * @param mesh - source Babylon mesh. It is used to check whether it should be
+         * exported to glTF or not.
          * @returns boolean, which indicates whether the mesh should be exported (true) or not (false)
          */
         shouldExportMesh?(mesh: AbstractMesh): boolean;
     }
+    /**
+     * Class for generating glTF data from a Babylon scene.
+     */
     class GLTF2Export {
         /**
-         * Exports the geometry of a Mesh array in .gltf file format.
-         * @param meshes
-         * @param materials
-         * @param options
-         *
-         * @returns - Returns an object with a .gltf, .glb and associates textures
+         * Exports the geometry of the scene to .gltf file format.
+         * @param scene - Babylon scene with scene hierarchy information.
+         * @param filePrefix - File prefix to use when generating the glTF file.
+         * @param options - Exporter options.
+         * @returns - Returns an object with a .gltf file and associates texture names
          * as keys and their data and paths as values.
          */
-        static GLTF(scene: Scene, filename: string, options?: IGLTFExporterOptions): _GLTFData;
+        static GLTF(scene: Scene, filePrefix: string, options?: IExporterOptions): _GLTFData;
         /**
-         *
-         * @param meshes
-         * @param filename
-         *
+         * Exports the geometry of the scene to .glb file format.
+         * @param scene - Babylon scene with scene hierarchy information.
+         * @param filePrefix - File prefix to use when generating glb file.
+         * @param options - Exporter options.
          * @returns - Returns an object with a .glb filename as key and data as value
          */
-        static GLB(scene: Scene, filename: string, options?: IGLTFExporterOptions): _GLTFData;
+        static GLB(scene: Scene, filePrefix: string, options?: IExporterOptions): _GLTFData;
     }
 }
 
-declare module BABYLON {
-    /**
-     * glTF Alpha Mode Enum
-     */
-    enum _EGLTFAlphaModeEnum {
-        OPAQUE = "OPAQUE",
-        MASK = "MASK",
-        BLEND = "BLEND",
-    }
-    /**
-     * Babylon Specular Glossiness interface
-     */
-    interface _IBabylonSpecularGlossiness {
-        diffuse: Color3;
-        opacity: number;
-        specular: Color3;
-        glossiness: number;
-    }
-    /**
-     * Babylon Metallic Roughness interface
-     */
-    interface _IBabylonMetallicRoughness {
-        baseColor: Color3;
-        opacity: number;
-        metallic: number;
-        roughness: number;
-    }
+
+/**
+ * Module for the Babylon glTF 2.0 exporter.  Should ONLY be used internally.
+ * @ignore - capitalization of GLTF2 module.
+ */
+declare module BABYLON.GLTF2 {
     /**
-     * Converts Babylon Scene into glTF 2.0
+     * Converts Babylon Scene into glTF 2.0.
      */
-    class _GLTF2Exporter {
+    class _Exporter {
+        /**
+         * Stores all generated buffer views, which represents views into the main glTF buffer data.
+         */
         private bufferViews;
+        /**
+         * Stores all the generated accessors, which is used for accessing the data within the buffer views in glTF.
+         */
         private accessors;
+        /**
+         * Stores all the generated nodes, which contains transform and/or mesh information per node.
+         */
         private nodes;
+        /**
+         * Stores the glTF asset information, which represents the glTF version and this file generator.
+         */
         private asset;
+        /**
+         * Stores all the generated glTF scenes, which stores multiple node hierarchies.
+         */
         private scenes;
+        /**
+         * Stores all the generated mesh information, each containing a set of primitives to render in glTF.
+         */
         private meshes;
+        /**
+         * Stores all the generated material information, which represents the appearance of each primitive.
+         */
         private materials;
+        /**
+         * Stores all the generated texture information, which is referenced by glTF materials.
+         */
         private textures;
+        /**
+         * Stores all the generated image information, which is referenced by glTF textures.
+         */
         private images;
+        /**
+         * Stores the total amount of bytes stored in the glTF buffer.
+         */
         private totalByteLength;
+        /**
+         * Stores a reference to the Babylon scene containing the source geometry and material information.
+         */
         private babylonScene;
+        /**
+         * Stores the exporter options, which are optionally passed in from the glTF serializer.
+         */
         private options?;
+        /**
+         * Stores a map of the image data, where the key is the file name and the value
+         * is the image data.
+         */
         private imageData;
-        constructor(babylonScene: Scene, options?: IGLTFExporterOptions);
+        /**
+         * Creates a glTF Exporter instance, which can accept optional exporter options.
+         * @param babylonScene - Babylon scene object
+         * @param options - Options to modify the behavior of the exporter.
+         */
+        constructor(babylonScene: Scene, options?: IExporterOptions);
         /**
          * Creates a buffer view based on teh supplied arguments
          * @param {number} bufferIndex - index value of the specified buffer
@@ -203,35 +233,56 @@ declare module BABYLON {
     }
 }
 
+
 declare module BABYLON {
     /**
      * Class for holding and downloading glTF file data
      */
     class _GLTFData {
+        /**
+         * Object which contains the file name as the key and its data as the value.
+         */
         glTFFiles: {
             [fileName: string]: string | Blob;
         };
+        /**
+         * Initializes the glTF file object.
+         */
         constructor();
         /**
-         * Downloads glTF data.
+         * Downloads the glTF data as files based on their names and data.
          */
         downloadFiles(): void;
     }
 }
 
-declare module BABYLON {
+
+declare module BABYLON.GLTF2 {
     /**
-     * Utility methods for working with glTF material conversion properties
+     * Utility methods for working with glTF material conversion properties.  This class should only be used internally.
      */
     class _GLTFMaterial {
-        private static dielectricSpecular;
-        private static epsilon;
         /**
-         * Converts Specular Glossiness to Metallic Roughness
+         * Represents the dielectric specular values for R, G and B.
+         */
+        private static readonly dielectricSpecular;
+        /**
+         * Epsilon value, used as a small tolerance value for a numeric value.
+         */
+        private static readonly epsilon;
+        /**
+         * Converts a Babylon StandardMaterial to a glTF Metallic Roughness Material.
+         * @param babylonStandardMaterial
+         * @returns - glTF Metallic Roughness Material representation
+         */
+        static ConvertToGLTFPBRMetallicRoughness(babylonStandardMaterial: StandardMaterial): IMaterialPbrMetallicRoughness;
+        /**
+         * Converts Specular Glossiness to Metallic Roughness.  This is based on the algorithm used in the Babylon glTF 3ds Max Exporter.
+         * {@link https://github.com/BabylonJS/Exporters/blob/master/3ds%20Max/Max2Babylon/Exporter/BabylonExporter.GLTFExporter.Material.cs}
          * @param  babylonSpecularGlossiness - Babylon specular glossiness parameters
          * @returns - Babylon metallic roughness values
          */
-        static ConvertToMetallicRoughness(babylonSpecularGlossiness: _IBabylonSpecularGlossiness): _IBabylonMetallicRoughness;
+        private static _ConvertToMetallicRoughness(babylonSpecularGlossiness);
         /**
          * Returns the perceived brightness value based on the provided color
          * @param color - color used in calculating the perceived brightness
@@ -251,6 +302,6 @@ declare module BABYLON {
          * @param babylonMaterial - Babylon Material
          * @returns - The Babylon alpha mode value
          */
-        static GetAlphaMode(babylonMaterial: Material): string;
+        static GetAlphaMode(babylonMaterial: Material): MaterialAlphaMode;
     }
 }

+ 1 - 3
dist/preview release/serializers/package.json

@@ -31,7 +31,5 @@
     },
     "engines": {
         "node": "*"
-    },
-    "_id": "babylonjs-serializers@3.1.0-alpha1",
-    "_from": "babylonjs-serializers@"
+    }
 }

+ 0 - 439
dist/preview release/typedocValidationBaseline.json

@@ -41496,156 +41496,6 @@
         }
       }
     },
-    "VRExperienceHelper": {
-      "Class": {
-        "Comments": {
-          "MissingText": true
-        }
-      },
-      "Constructor": {
-        "new VRExperienceHelper": {
-          "Comments": {
-            "MissingText": true
-          },
-          "Parameter": {
-            "scene": {
-              "Comments": {
-                "MissingText": true
-              }
-            },
-            "webVROptions": {
-              "Comments": {
-                "MissingText": true
-              }
-            }
-          }
-        }
-      },
-      "Property": {
-        "currentVRCamera": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "deviceOrientationCamera": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "displayGaze": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "displayLaserPointer": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "position": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "teleportationTarget": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "vrDeviceOrientationCamera": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "webVRCamera": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "webVROptions": {
-          "Comments": {
-            "MissingText": true
-          }
-        }
-      },
-      "Method": {
-        "addFloorMesh": {
-          "Comments": {
-            "MissingText": true
-          },
-          "Parameter": {
-            "floorMesh": {
-              "Comments": {
-                "MissingText": true
-              }
-            }
-          }
-        },
-        "changeGazeColor": {
-          "Comments": {
-            "MissingText": true
-          },
-          "Parameter": {
-            "color": {
-              "Comments": {
-                "MissingText": true
-              }
-            }
-          }
-        },
-        "changeLaserColor": {
-          "Comments": {
-            "MissingText": true
-          },
-          "Parameter": {
-            "color": {
-              "Comments": {
-                "MissingText": true
-              }
-            }
-          }
-        },
-        "dispose": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "enableInteractions": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "enableTeleportation": {
-          "Comments": {
-            "MissingText": true
-          },
-          "Parameter": {
-            "vrTeleportationOptions": {
-              "Comments": {
-                "MissingText": true
-              }
-            }
-          }
-        },
-        "getClassName": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "removeFloorMesh": {
-          "Comments": {
-            "MissingText": true
-          },
-          "Parameter": {
-            "floorMesh": {
-              "Comments": {
-                "MissingText": true
-              }
-            }
-          }
-        }
-      }
-    },
     "ValueCondition": {
       "Class": {
         "Comments": {
@@ -45672,116 +45522,6 @@
         }
       }
     },
-    "WebVRFreeCamera": {
-      "Class": {
-        "Comments": {
-          "MissingText": true
-        }
-      },
-      "Property": {
-        "_vrDevice": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "controllers": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "deviceDistanceToRoomGround": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "devicePosition": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "deviceRotationQuaternion": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "deviceScaleFactor": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "leftController": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "onControllerMeshLoadedObservable": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "onControllersAttachedObservable": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "rawPose": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "rigParenting": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "rightController": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "useStandingMatrix": {
-          "Comments": {
-            "MissingText": true
-          }
-        }
-      },
-      "Method": {
-        "getControllerByName": {
-          "Comments": {
-            "MissingText": true
-          },
-          "Parameter": {
-            "name": {
-              "Comments": {
-                "MissingText": true
-              }
-            }
-          }
-        },
-        "initControllers": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "resetToCurrentRotation": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "updateFromDevice": {
-          "Comments": {
-            "MissingText": true
-          },
-          "Parameter": {
-            "poseData": {
-              "Comments": {
-                "MissingText": true
-              }
-            }
-          }
-        }
-      }
-    },
     "WindowsMotionController": {
       "Class": {
         "Comments": {
@@ -46542,40 +46282,6 @@
         }
       }
     },
-    "DevicePose": {
-      "Property": {
-        "angularAcceleration": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "angularVelocity": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "linearAcceleration": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "linearVelocity": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "orientation": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "position": {
-          "Comments": {
-            "MissingText": true
-          }
-        }
-      }
-    },
     "DistanceJointData": {
       "Interface": {
         "Comments": {
@@ -48747,59 +48453,6 @@
         }
       }
     },
-    "PoseControlled": {
-      "Interface": {
-        "Comments": {
-          "MissingText": true
-        }
-      },
-      "Property": {
-        "devicePosition": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "deviceRotationQuaternion": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "deviceScaleFactor": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "position": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "rawPose": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "rotationQuaternion": {
-          "Comments": {
-            "MissingText": true
-          }
-        }
-      },
-      "Method": {
-        "updateFromDevice": {
-          "Comments": {
-            "MissingText": true
-          },
-          "Parameter": {
-            "poseData": {
-              "Comments": {
-                "MissingText": true
-              }
-            }
-          }
-        }
-      }
-    },
     "SerializedColliderToWorker": {
       "Interface": {
         "Comments": {
@@ -49000,98 +48653,6 @@
         }
       }
     },
-    "VRExperienceHelperOptions": {
-      "Interface": {
-        "Comments": {
-          "MissingText": true
-        }
-      },
-      "Property": {
-        "createDeviceOrientationCamera": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "createFallbackVRDeviceOrientationFreeCamera": {
-          "Comments": {
-            "MissingText": true
-          }
-        }
-      }
-    },
-    "VRTeleportationOptions": {
-      "Interface": {
-        "Comments": {
-          "MissingText": true
-        }
-      },
-      "Property": {
-        "floorMeshName": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "floorMeshes": {
-          "Comments": {
-            "MissingText": true
-          }
-        }
-      }
-    },
-    "WebVROptions": {
-      "Interface": {
-        "Comments": {
-          "MissingText": true
-        }
-      },
-      "Property": {
-        "controllerMeshes": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "customVRButton": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "defaultHeight": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "defaultLightingOnControllers": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "displayName": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "positionScale": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "rayLength": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "trackPosition": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "useCustomVRButton": {
-          "Comments": {
-            "MissingText": true
-          }
-        }
-      }
-    },
     "WorkerReply": {
       "Interface": {
         "Comments": {

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 59 - 59
dist/preview release/viewer/babylon.viewer.js


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

@@ -23,7 +23,9 @@
    ([carloslanderas](https://github.com/carloslanderas))
 - VRHelper now exposes onNewMeshPicked observable that will notify a PickingInfo object after meshSelectionPredicate evaluation
    ([carloslanderas](https://github.com/carloslanderas))
-- `AssetsManager` will now clear its `tasks` lsit from all successfully loaded tasks ([deltakosh](https://github.com/deltakosh))
+- `AssetsManager` will now clear its `tasks` lsit from all successfully loaded tasks ([deltakosh](https://github.com/deltakosh))tasks ([deltakosh](https://github.com/deltakosh))
+- Added documentation to WebVRCamera and VRExperienceHelper ([trevordev](https://github.com/trevordev))
+- Introduced `isStroke` on `HighlightLayerOptions` which makes the highlight solid ([PixelsCommander](https://github.com/pixelscommander))
 - (Viewer) There is now an option to paste payload instead of a URL for configuration ([RaananW](https://github.com/RaananW))
 - (Viewer) Models can be loaded async using JavaScript ([RaananW](https://github.com/RaananW))
 

+ 2 - 2
package.json

@@ -14,7 +14,7 @@
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"
     },
-    "main": "dist/preview release/babylon.max.js",
+    "main": "dist/preview release/babylon.js",
     "files": [
         "package.json",
         "dist/preview release/babylon.d.ts",
@@ -41,4 +41,4 @@
     },
     "readme": "Babylon.js is a 3D engine based on webgl and javascript",
     "readmeFilename": "README.md"
-}
+}

+ 98 - 5
src/Cameras/VR/babylon.vrExperienceHelper.ts

@@ -1,14 +1,36 @@
 module BABYLON {
+    /**
+     * Options to modify the vr teleportation behavior.
+     */
     export interface VRTeleportationOptions {
-        floorMeshName?: string; // If you'd like to provide a mesh acting as the floor
+        /**
+         * The name of the mesh which should be used as the teleportation floor. (default: null)
+         */
+        floorMeshName?: string;
+        /**
+         * A list of meshes to be used as the teleportation floor. (default: empty)
+         */
         floorMeshes?: Mesh[];
     }
 
+    /**
+     * Options to modify the vr experience helper's behavior.
+     */
     export interface VRExperienceHelperOptions extends WebVROptions {
-        createDeviceOrientationCamera?: boolean; // Create a DeviceOrientationCamera to be used as your out of vr camera.
-        createFallbackVRDeviceOrientationFreeCamera?: boolean; // Create a VRDeviceOrientationFreeCamera to be used for VR when no external HMD is found
+        /**
+         * Create a DeviceOrientationCamera to be used as your out of vr camera.
+         */
+        createDeviceOrientationCamera?: boolean;
+        /**
+         * Create a VRDeviceOrientationFreeCamera to be used for VR when no external HMD is found.
+         */
+        createFallbackVRDeviceOrientationFreeCamera?: boolean;
     }
 
+    /**
+     * Helps to quickly add VR support to an existing scene.
+     * See http://doc.babylonjs.com/how_to/webvr_helper
+     */
     export class VRExperienceHelper {
         private _scene: Scene;
         private _position: Vector3;
@@ -166,10 +188,16 @@ module BABYLON {
 
         private _dpadPressed = true;
 
+        /**
+         * The mesh used to display where the user is going to teleport.
+         */
         public get teleportationTarget(): Mesh {
             return this._teleportationTarget;
         }
 
+        /**
+         * Sets the mesh to be used to display where the user is going to teleport.
+         */
         public set teleportationTarget(value: Mesh) {
             if (value) {
                 value.name = "teleportationTarget";
@@ -178,10 +206,16 @@ module BABYLON {
             }
         }
 
+        /**
+         * If the ray of the gaze should be displayed.
+         */
         public get displayGaze(): boolean {
             return this._displayGaze;
         }
 
+        /**
+         * Sets if the ray of the gaze should be displayed.
+         */
         public set displayGaze(value: boolean) {
             this._displayGaze = value;
             if (!value) {
@@ -189,10 +223,16 @@ module BABYLON {
             }
         }
 
+        /**
+         * If the ray of the LaserPointer should be displayed.
+         */
         public get displayLaserPointer(): boolean {
             return this._displayLaserPointer;
         }
 
+        /**
+         * Sets if the ray of the LaserPointer should be displayed.
+         */
         public set displayLaserPointer(value: boolean) {
             this._displayLaserPointer = value;
             if (!value) {
@@ -213,11 +253,16 @@ module BABYLON {
             }
         }
 
+        /**
+         * The deviceOrientationCamera used as the camera when not in VR.
+         */
         public get deviceOrientationCamera(): Nullable<DeviceOrientationCamera> {
             return this._deviceOrientationCamera;
         }
 
-        // Based on the current WebVR support, returns the current VR camera used
+        /**
+         * Based on the current WebVR support, returns the current VR camera used.
+         */
         public get currentVRCamera(): Nullable<Camera> {
             if (this._webVRready) {
                 return this._webVRCamera;
@@ -227,15 +272,27 @@ module BABYLON {
             }
         }
 
+        /**
+         * The webVRCamera which is used when in VR.
+         */
         public get webVRCamera(): WebVRFreeCamera {
             return this._webVRCamera;
         }
 
+        /**
+         * The deviceOrientationCamera that is used as a fallback when vr device is not connected.
+         */
         public get vrDeviceOrientationCamera(): Nullable<VRDeviceOrientationFreeCamera> {
             return this._vrDeviceOrientationCamera;
         }
 
-        constructor(scene: Scene, public webVROptions: VRExperienceHelperOptions = {}) {
+        /**
+         * Instantiates a VRExperienceHelper.
+         * Helps to quickly add VR support to an existing scene.
+         * @param scene The scene the VRExperienceHelper belongs to.
+         * @param webVROptions Options to modify the vr experience helper's behavior.
+         */
+        constructor(scene: Scene, /** Options to modify the vr experience helper's behavior. */public webVROptions: VRExperienceHelperOptions = {}) {
             this._scene = scene;
             this._canvas = scene.getEngine().getRenderingCanvas();
 
@@ -581,10 +638,16 @@ module BABYLON {
             }
         }
 
+        /**
+         * The position of the vr experience helper.
+         */
         public get position(): Vector3 {
             return this._position;
         }
 
+        /**
+         * Sets the position of the vr experience helper.
+         */
         public set position(value: Vector3) {
             this._position = value;
 
@@ -593,6 +656,9 @@ module BABYLON {
             }
         }
 
+        /**
+         * Enables controllers and user interactions suck as selecting and object or clicking on an object.
+         */
         public enableInteractions() {
             if (!this._interactionsEnabled) {
                 this._interactionsRequested = true;
@@ -644,6 +710,10 @@ module BABYLON {
             return false;
         }
 
+        /**
+         * Adds a floor mesh to be used for teleportation.
+         * @param floorMesh the mesh to be used for teleportation.
+         */
         public addFloorMesh(floorMesh: Mesh): void {
             if (!this._floorMeshesCollection) {
                 return;
@@ -656,6 +726,10 @@ module BABYLON {
             this._floorMeshesCollection.push(floorMesh);
         }
 
+        /**
+         * Removes a floor mesh from being used for teleportation.
+         * @param floorMesh the mesh to be removed.
+         */
         public removeFloorMesh(floorMesh: Mesh): void {
             if (!this._floorMeshesCollection) {
                 return
@@ -667,6 +741,10 @@ module BABYLON {
             }
         }
 
+        /**
+         * Enables interactions and teleportation using the VR controllers and gaze.
+         * @param vrTeleportationOptions options to modify teleportation behavior.
+         */
         public enableTeleportation(vrTeleportationOptions: VRTeleportationOptions = {}) {
             if (!this._teleportationInitialized) {
                 this._teleportationRequested = true;
@@ -1463,6 +1541,10 @@ module BABYLON {
             }
         }
 
+        /**
+         * Sets the color of the laser ray from the vr controllers.
+         * @param color new color for the ray.
+         */
         public changeLaserColor(color: Color3) {
             if (this._leftLaserPointer && this._leftLaserPointer.material) {
                 (<StandardMaterial>this._leftLaserPointer.material).emissiveColor = color;
@@ -1472,12 +1554,19 @@ module BABYLON {
             }
         }
 
+        /**
+         * Sets the color of the ray from the vr headsets gaze.
+         * @param color new color for the ray.
+         */
         public changeGazeColor(color: Color3) {
             if (this._gazeTracker.material) {
                 (<StandardMaterial>this._gazeTracker.material).emissiveColor = color;
             }
         }
 
+        /**
+         * Exits VR and disposes of the vr experience helper
+         */
         public dispose() {
             if (this.isInVRMode) {
                 this.exitVR();
@@ -1535,6 +1624,10 @@ module BABYLON {
             this._scene.unregisterBeforeRender(this.beforeRender);
         }
 
+        /**
+         * Gets the name of the VRExperienceHelper class
+         * @returns "VRExperienceHelper"
+         */
         public getClassName(): string {
             return "VRExperienceHelper";
         }

+ 200 - 22
src/Cameras/VR/babylon.webVRCamera.ts

@@ -4,45 +4,135 @@ declare var VRFrameData: any;
 
 module BABYLON {
     /**
-     * This is a copy of VRPose.
+     * This is a copy of VRPose. See https://developer.mozilla.org/en-US/docs/Web/API/VRPose
      * IMPORTANT!! The data is right-hand data.
      * @export
      * @interface DevicePose
      */
     export interface DevicePose {
+        /**
+         * The position of the device, values in array are [x,y,z].
+         */
         readonly position?: Float32Array;
+        /**
+         * The linearVelocity of the device, values in array are [x,y,z].
+         */
         readonly linearVelocity?: Float32Array;
+        /**
+         * The linearAcceleration of the device, values in array are [x,y,z].
+         */
         readonly linearAcceleration?: Float32Array;
 
+        /**
+         * The orientation of the device in a quaternion array, values in array are [x,y,z,w].
+         */
         readonly orientation?: Float32Array;
+        /**
+         * The angularVelocity of the device, values in array are [x,y,z].
+         */
         readonly angularVelocity?: Float32Array;
+        /**
+         * The angularAcceleration of the device, values in array are [x,y,z].
+         */
         readonly angularAcceleration?: Float32Array;
     }
 
+     /**
+     * Interface representing a pose controlled object in Babylon.
+     * A pose controlled object has both regular pose values as well as pose values 
+     * from an external device such as a VR head mounted display
+     */
     export interface PoseControlled {
+        /**
+         * The position of the object in babylon space.
+         */
         position: Vector3;
+        /**
+         * The rotation quaternion of the object in babylon space.
+         */
         rotationQuaternion: Quaternion;
+        /**
+         * The position of the device in babylon space.
+         */
         devicePosition?: Vector3;
+        /**
+         * The rotation quaternion of the device in babylon space.
+         */
         deviceRotationQuaternion: Quaternion;
+        /**
+         * The raw pose coming from the device.
+         */
         rawPose: Nullable<DevicePose>;
+        /**
+         * The scale of the device to be used when translating from device space to babylon space.
+         */
         deviceScaleFactor: number;
+        /**
+         * Updates the poseControlled values based on the input device pose.
+         * @param poseData the pose data to update the object with
+         */
         updateFromDevice(poseData: DevicePose): void;
     }
 
+    /**
+     * Set of options to customize the webVRCamera
+     */
     export interface WebVROptions {
-        trackPosition?: boolean; //for the sake of your users - set it to true.
+        /**
+         * Sets if the webVR camera should be tracked to the vrDevice. (default: true)
+         */
+        trackPosition?: boolean;
+        /**
+         * Sets the scale of the vrDevice in babylon space. (default: 1)
+         */
         positionScale?: number;
-        displayName?: string; //if there are more than one VRDisplays.
-        controllerMeshes?: boolean; // should the native controller meshes be initialized
-        defaultLightingOnControllers?: boolean; // creating a default HemiLight only on controllers
-        useCustomVRButton?: boolean; // if you don't want to use the default VR button of the helper
-        customVRButton?: HTMLButtonElement; //if you'd like to provide your own button to the VRHelper
-        rayLength?: number; // to change the length of the ray for gaze/controllers.
-        defaultHeight?: number; // to change the default offset from the ground to account for user's height
+        /**
+         * If there are more than one VRDisplays, this will choose the display matching this name. (default: pick first vrDisplay)
+         */
+        displayName?: string;
+        /**
+         * Should the native controller meshes be initialized. (default: true)
+         */
+        controllerMeshes?: boolean;
+        /**
+         * Creating a default HemiLight only on controllers. (default: true)
+         */
+        defaultLightingOnControllers?: boolean;
+        /**
+         * If you don't want to use the default VR button of the helper. (default: false)
+         */
+        useCustomVRButton?: boolean;
+
+        /**
+         * If you'd like to provide your own button to the VRHelper. (default: standard babylon vr button)
+         */
+        customVRButton?: HTMLButtonElement;
+
+        /**
+         * To change the length of the ray for gaze/controllers. (default: 100)
+         */
+        rayLength?: number;
+
+        /**
+         * To change the default offset from the ground to account for user's height. (default: 1.7)
+         */
+        defaultHeight?: number;
+
     }
 
+    /**
+     * This represents a WebVR camera.
+     * The WebVR camera is Babylon's simple interface to interaction with Windows Mixed Reality, HTC Vive and Oculus Rift.
+     * @example http://doc.babylonjs.com/how_to/webvr_camera
+     */
     export class WebVRFreeCamera extends FreeCamera implements PoseControlled {
+        /**
+         * The vrDisplay tied to the camera. See https://developer.mozilla.org/en-US/docs/Web/API/VRDisplay
+         */
         public _vrDevice: any = null;
+        /**
+         * The rawPose of the vrDevice.
+         */
         public rawPose: Nullable<DevicePose> = null;
         private _onVREnabled: (success: boolean) => void;
         private _specsVersion: string = "1.1";
@@ -58,24 +148,51 @@ module BABYLON {
 
         private _standingMatrix: Nullable<Matrix> = null;
 
-        // Represents device position and rotation in babylon space
+        /**
+         * Represents device position in babylon space.
+         */
         public devicePosition = Vector3.Zero();
+        /**
+         * Represents device rotation in babylon space.
+         */
         public deviceRotationQuaternion = Quaternion.Identity();
 
+        /**
+         * The scale of the device to be used when translating from device space to babylon space.
+         */
         public deviceScaleFactor: number = 1;
 
         private _deviceToWorld = Matrix.Identity();
         private _worldToDevice = Matrix.Identity();
 
+        /**
+         * References to the webVR controllers for the vrDevice.
+         */
         public controllers: Array<WebVRController> = [];
+        /**
+         * Emits an event when a controller is attached.
+         */
         public onControllersAttachedObservable = new Observable<Array<WebVRController>>();
+        /**
+         * Emits an event when a controller's mesh has been loaded;
+         */
         public onControllerMeshLoadedObservable = new Observable<WebVRController>();
-
-        public rigParenting: boolean = true; // should the rig cameras be used as parent instead of this camera.
+        /**
+         * If the rig cameras be used as parent instead of this camera.
+         */
+        public rigParenting: boolean = true;
 
         private _lightOnControllers: HemisphericLight;
 
         private _defaultHeight?: number = undefined;
+
+        /**
+         * Instantiates a WebVRFreeCamera.
+         * @param name The name of the WebVRFreeCamera
+         * @param position The starting anchor position for the camera
+         * @param scene The scene the camera belongs to
+         * @param webVROptions a set of customizable options for the webVRCamera
+         */
         constructor(name: string, position: Vector3, scene: Scene, private webVROptions: WebVROptions = {}) {
             super(name, position, scene);
             this._cache.position = Vector3.Zero();
@@ -164,7 +281,11 @@ module BABYLON {
             });
         }
 
-        public deviceDistanceToRoomGround = () => {
+        /**
+         * Gets the device distance from the ground.
+         * @returns the distance from the vrDevice to ground in device space. If standing matrix is not supported for the vrDevice 0 is returned.
+         */
+        public deviceDistanceToRoomGround(): number {
             if (this._standingMatrix && this._defaultHeight === undefined) {
                 // Add standing matrix offset to get real offset from ground in room
                 this._standingMatrix.getTranslationToRef(this._workingVector);
@@ -174,8 +295,12 @@ module BABYLON {
             return this._defaultHeight || 0;            
         }
 
-        public useStandingMatrix = (callback = (bool: boolean) => { }) => {
-            // Use standing matrix if availible
+        /**
+         * Enables the standing matrix when supported. This can be used to position the user's view the correct height from the ground.
+         * @param callback will be called when the standing matrix is set. Callback parameter is if the standing matrix is supported.
+         */
+        public useStandingMatrix(callback = (bool: boolean) => { }) {
+            // Use standing matrix if available
             if (!navigator || !navigator.getVRDisplays) {
                 callback(false);
             } else {
@@ -192,17 +317,25 @@ module BABYLON {
                                 }
                             });
                         }
-                        callback(true)
+                        callback(true);
                     }
-                })
+                });
             }
         }
 
+        /**
+         * Disposes the camera
+         */
         public dispose(): void {
             this.getEngine().onVRRequestPresentComplete.removeCallback(this._onVREnabled);
             super.dispose();
         }
 
+        /**
+         * Gets a vrController by name.
+         * @param name The name of the controller to retreive
+         * @returns the controller matching the name specified or null if not found
+         */
         public getControllerByName(name: string): Nullable<WebVRController> {
             for (var gp of this.controllers) {
                 if (gp.hand === name) {
@@ -214,6 +347,9 @@ module BABYLON {
         }
 
         private _leftController: Nullable<WebVRController>;
+        /**
+         * The controller corrisponding to the users left hand.
+         */
         public get leftController(): Nullable<WebVRController> {
             if (!this._leftController) {
                 this._leftController = this.getControllerByName("left");
@@ -223,6 +359,9 @@ module BABYLON {
         };
 
         private _rightController: Nullable<WebVRController>;
+        /**
+         * The controller corrisponding to the users right hand.
+         */
         public get rightController(): Nullable<WebVRController> {
             if (!this._rightController) {
                 this._rightController = this.getControllerByName("right");
@@ -232,7 +371,11 @@ module BABYLON {
         };
 
 
-
+        /**
+         * Casts a ray forward from the vrCamera's gaze.
+         * @param length Length of the ray (default: 100)
+         * @returns the ray corrisponding to the gaze
+         */
         public getForwardRay(length = 100): Ray {
             if (this.leftCamera) {
                 // Use left eye to avoid computation to compute center on every call
@@ -243,6 +386,9 @@ module BABYLON {
             }
         }
 
+        /**
+         * Updates the camera based on device's frame data
+         */
         public _checkInputs(): void {
             if (this._vrDevice && this._vrDevice.isPresenting) {
                 this._vrDevice.getFrameData(this._frameData);
@@ -253,6 +399,10 @@ module BABYLON {
             super._checkInputs();
         }
 
+        /**
+         * Updates the poseControlled values based on the input device pose.
+         * @param poseData Pose coming from the device
+         */
         updateFromDevice(poseData: DevicePose) {
             if (poseData && poseData.orientation) {
                 this.rawPose = poseData;
@@ -277,10 +427,8 @@ module BABYLON {
          * within a user-interaction callback. Example:
          * <pre> scene.onPointerDown = function() { camera.attachControl(canvas); }</pre>
          * 
-         * @param {HTMLElement} element 
-         * @param {boolean} [noPreventDefault] 
-         * 
-         * @memberOf WebVRFreeCamera
+         * @param element html element to attach the vrDevice to
+         * @param noPreventDefault prevent the default html element operation when attaching the vrDevice
          */
         public attachControl(element: HTMLElement, noPreventDefault?: boolean): void {
             super.attachControl(element, noPreventDefault);
@@ -293,6 +441,11 @@ module BABYLON {
             }
         }
 
+        /**
+         * Detaches the camera from the html element and disables VR
+         * 
+         * @param element html element to detach from
+         */
         public detachControl(element: HTMLElement): void {
             this.getScene().gamepadManager.onGamepadConnectedObservable.remove(this._onGamepadConnectedObserver);
             this.getScene().gamepadManager.onGamepadDisconnectedObservable.remove(this._onGamepadDisconnectedObserver);
@@ -302,16 +455,26 @@ module BABYLON {
             this.getEngine().disableVR();
         }
 
+        /**
+         * @returns the name of this class
+         */
         public getClassName(): string {
             return "WebVRFreeCamera";
         }
 
+        /**
+         * Calls resetPose on the vrDisplay
+         * See: https://developer.mozilla.org/en-US/docs/Web/API/VRDisplay/resetPose
+         */
         public resetToCurrentRotation() {
             //uses the vrDisplay's "resetPose()".
             //pitch and roll won't be affected.
             this._vrDevice.resetPose();
         }
 
+        /**
+         * Updates the rig cameras (left and right eye)
+         */
         public _updateRigCameras() {
             var camLeft = <TargetCamera>this._rigCameras[0];
             var camRight = <TargetCamera>this._rigCameras[1];
@@ -328,6 +491,10 @@ module BABYLON {
 
         private updateCacheCalled: boolean;
 
+        /**
+         * Updates the cached values of the camera
+         * @param ignoreParentClass ignores updating the parent class's cache (default: false)
+         */
         public _updateCache(ignoreParentClass?: boolean): void {
             if (!this.rotationQuaternion.equals(this._cache.rotationQuaternion) || !this.position.equals(this._cache.position)) {
                 // Update to ensure devicePosition is up to date with most recent _deviceRoomPosition
@@ -367,6 +534,9 @@ module BABYLON {
             this.updateCacheCalled = false;
         }
 
+        /**
+         * Updates the current device position and rotation in the babylon world
+         */
         public update() {
             // Get current device position in babylon world
             Vector3.TransformCoordinatesToRef(this._deviceRoomPosition, this._deviceToWorld, this.devicePosition);
@@ -378,6 +548,11 @@ module BABYLON {
 
             super.update();
         }
+
+        /**
+         * Gets the view matrix of this camera (Always set to identity as left and right eye cameras contain the actual view matrix)
+         * @returns an identity matrix
+         */
         public _getViewMatrix(): Matrix {
             return Matrix.Identity();
         }
@@ -447,6 +622,9 @@ module BABYLON {
         private _onGamepadConnectedObserver: Nullable<Observer<Gamepad>>;
         private _onGamepadDisconnectedObserver: Nullable<Observer<Gamepad>>;
 
+        /**
+         * Initializes the controllers and their meshes
+         */
         public initControllers() {
             this.controllers = [];
 

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

@@ -825,6 +825,10 @@
          * @param adaptToDeviceRatio defines whether to adapt to the device's viewport characteristics (default: false)
          */
         constructor(canvasOrContext: Nullable<HTMLCanvasElement | WebGLRenderingContext>, antialias?: boolean, options?: EngineOptions, adaptToDeviceRatio: boolean = false) {
+
+            // Register promises
+            PromisePolyfill.Apply();
+
             let canvas: Nullable<HTMLCanvasElement> = null;
             Engine.Instances.push(this);
 

+ 9 - 1
src/Mesh/babylon.mesh.ts

@@ -297,6 +297,14 @@
             return this._LODLevels.length > 0;
         }
 
+        /**
+         * Gets the list of {BABYLON.MeshLODLevel} associated with the current mesh
+         * @returns an array of {BABYLON.MeshLODLevel} 
+         */
+        public getLODLevels(): MeshLODLevel[] {
+            return this._LODLevels;
+        }
+
         private _sortLODLevels(): void {
             this._LODLevels.sort((a, b) => {
                 if (a.distance < b.distance) {
@@ -767,7 +775,7 @@
             var data = this.getVerticesData(VertexBuffer.PositionKind);
 
             if (data && applySkeleton && this.skeleton) {
-                data = data.slice();
+                data = Tools.Slice(data);
 
                 var matricesIndicesData = this.getVerticesData(VertexBuffer.MatricesIndicesKind);
                 var matricesWeightsData = this.getVerticesData(VertexBuffer.MatricesWeightsKind);

+ 1 - 1
src/Tools/babylon.dds.ts

@@ -331,7 +331,7 @@
         }
 
         private static _ExtractLongWordOrder(value: number): number {
-            if (value === 255 || value === -16777216) {
+            if (value === 0 ||value === 255 || value === -16777216) {
                 return 0;
             }
 

+ 149 - 0
src/Tools/babylon.promise.ts

@@ -0,0 +1,149 @@
+module BABYLON {
+
+    enum PromiseStates {
+        Pending,
+        Fulfilled,
+        Rejected
+    }
+
+    class InternalPromise<T> {
+        private _state = PromiseStates.Pending;
+        private _result?: Nullable<T>;
+        private _reason: string;
+        private _child: InternalPromise<T>;
+        private _onFulfilled?: (fulfillment?: Nullable<T>) => Nullable<InternalPromise<T>>;
+        private _onRejected?: (reason: string) => void;
+
+        public get state(): PromiseStates {
+            return this._state;
+        }
+
+        public isFulfilled(): boolean {
+            return this._state === PromiseStates.Fulfilled;
+        }            
+
+        public isRejected(): boolean {
+            return this._state === PromiseStates.Rejected;
+        }
+    
+        public isPending(): boolean {
+            return this._state === PromiseStates.Pending;
+        }
+    
+        public value(): Nullable<T> | undefined {
+            if (!this.isFulfilled()) {
+                throw new Error("Promise is not fulfilled");
+            }
+            return this._result;
+        }     
+        
+        public reason(): string {
+            if (!this.isRejected()) {
+                throw new Error("Promise is not rejected");
+            }
+            return this._reason;
+        }            
+
+        public constructor(resolver?: (
+            resolve:(value?: Nullable<T>) => void, 
+            reject: (reason: string) => void
+        ) => void) {
+
+            if (!resolver) {
+                return;
+            }
+
+            try {
+                resolver((value?: Nullable<T>) => {
+                    this._resolve(value);
+                }, (reason: string) => {
+                    this._reject(reason);
+                });
+            } catch(e) {
+                this._reject((<Error>e).message);
+            }
+        }
+
+        public catch(onRejected: (reason: string) => void): InternalPromise<T> {
+            return this.then(undefined, onRejected);
+        }
+
+        public then(onFulfilled?: (fulfillment?: Nullable<T>) => Nullable<InternalPromise<T>>, onRejected?: (reason: string) => void): InternalPromise<T> {
+            let newPromise = new InternalPromise<T>();
+            newPromise._onFulfilled = onFulfilled;
+            newPromise._onRejected = onRejected;
+
+            // Composition
+            this._child = newPromise;
+
+            switch (this._state) {
+                case PromiseStates.Fulfilled:
+                    let returnedPromise = newPromise._resolve(this._result);
+
+                    if (returnedPromise) {
+                        newPromise._child = returnedPromise;
+                        newPromise = returnedPromise;
+                    }
+                    break;
+                case PromiseStates.Rejected:
+                    newPromise._reject(this._reason);
+                    newPromise._state = PromiseStates.Fulfilled;
+                    break;
+            }
+
+            return newPromise;
+        }       
+        
+        private _resolve(value?: Nullable<T>): Nullable<InternalPromise<T>> {
+            try {
+                this._state = PromiseStates.Fulfilled;
+                this._result = value;
+                let returnedPromise: Nullable<InternalPromise<T>> = null;
+
+                if (this._onFulfilled) {
+                    returnedPromise = this._onFulfilled(value);
+                }
+
+                if (this._child) {
+                    this._child._resolve(value);
+                }                
+
+                return returnedPromise;
+            } catch(e) {
+                this._reject((<Error>e).message);
+            }
+
+            return null;
+        }
+
+        private _reject(reason: string): void {
+            this._state = PromiseStates.Rejected;
+            this._reason = reason;
+
+            if (this._onRejected) {
+                this._onRejected(reason);
+            }
+
+            if (this._child) {
+                this._child._resolve(null);
+            }                
+        }
+
+        public static resolve<T>(value: T): InternalPromise<T> {
+            let newPromise = new InternalPromise<T>();
+
+            newPromise._resolve(value);
+
+            return newPromise;
+        }
+    }
+
+    export class PromisePolyfill {
+        public static Apply(force = false) {
+            if (force || typeof Promise === 'undefined') {
+                let root:any = window;
+                root.Promise = InternalPromise;
+            }
+        }
+    }
+}

+ 13 - 0
src/Tools/babylon.tools.ts

@@ -113,6 +113,19 @@
             return fn;
         }
 
+        /**
+         * Provides a slice function that will work even on IE
+         * @param data defines the array to slice
+         * @returns the new sliced array
+         */
+        public static Slice(data: FloatArray): FloatArray {
+            if (data.slice) {
+                return data.slice();
+            }
+
+            return Array.prototype.slice.call(data);
+        }
+
         public static SetImmediate(action: () => void) {
             if (window.setImmediate) {
                 window.setImmediate(action);

+ 7 - 0
src/babylon.mixins.ts

@@ -169,3 +169,10 @@ interface EXT_disjoint_timer_query {
 interface WebGLUniformLocation {
     _currentState: any;
 }
+
+interface Promise<T> {
+    new (executor: (resolve: (value?: T | PromiseLike<T>) => void, reject: (reason?: any) => void) => void): Promise<T>;
+    then(onFulfilled?: (fulfillment?: BABYLON.Nullable<T>) => BABYLON.Nullable<Promise<T>>, onRejected?: (reason: string) => void): Promise<T>
+}
+
+declare var Promise: Promise<any>;

+ 61 - 0
tests/unit/babylon/promises/babylon.promises.tests.ts

@@ -0,0 +1,61 @@
+/**
+ * Describes the test suite.
+ */
+describe('Babylon.Promise', () => {
+    var subject : BABYLON.Engine;
+
+    /**
+     * Loads the dependencies.
+     */
+    before(function (done) {
+        this.timeout(180000);
+        (BABYLONDEVTOOLS).Loader
+            .useDist()
+            .load(function () {
+                BABYLON.PromisePolyfill.Apply(true);
+                done();
+            });
+    });
+
+    /**
+     * Create a nu engine subject before each test.
+     */
+    beforeEach(function () {
+        subject = new BABYLON.NullEngine({
+            renderHeight: 256,
+            renderWidth: 256,
+            textureSize: 256,
+            deterministicLockstep: false,
+            lockstepMaxSteps: 1
+        });
+    });
+
+    /**
+     * This test is more an integration test than a regular unit test but highlights how to rely
+     * on the BABYLON.NullEngine in order to create complex test cases.
+     */
+    describe('#Composition', () => {
+        it('should chain promises correctly', (done) => {
+            mocha.timeout(10000);
+            var tempString = "";
+            var p1 = new Promise((resolve, reject) => {
+                tempString = "Initial";
+            
+                resolve();
+            })
+            .then(() => {
+                tempString += " message";
+            })
+            .then(() => {
+                throw new Error('Something failed');
+            })
+            .catch(() => {
+                tempString += " to check promises";
+            })
+            .then(() => {
+                expect(tempString).to.eq("Initial message to check promises");
+                done();
+            });
+        });
+    });
+});