Browse Source

3.3.0-rc.2

David Catuhe 7 years ago
parent
commit
d8045ae89f

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


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


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


+ 111 - 128
dist/preview release/babylon.max.js

@@ -12507,7 +12507,7 @@ var BABYLON;
              * Returns the current version of the framework
              */
             get: function () {
-                return "3.3.0-rc.1";
+                return "3.3.0-rc.2";
             },
             enumerable: true,
             configurable: true
@@ -29682,6 +29682,9 @@ var BABYLON;
 
 var BABYLON;
 (function (BABYLON) {
+    /**
+     * Class used to store data that will be store in GPU memory
+     */
     var Buffer = /** @class */ (function () {
         /**
          * Constructor
@@ -29730,12 +29733,24 @@ var BABYLON;
             return new BABYLON.VertexBuffer(this._engine, this, kind, this._updatable, true, byteStride, instanced === undefined ? this._instanced : instanced, byteOffset, size, undefined, undefined, true);
         };
         // Properties
+        /**
+         * Gets a boolean indicating if the Buffer is updatable?
+         * @returns true if the buffer is updatable
+         */
         Buffer.prototype.isUpdatable = function () {
             return this._updatable;
         };
+        /**
+         * Gets current buffer's data
+         * @returns a DataArray or null
+         */
         Buffer.prototype.getData = function () {
             return this._data;
         };
+        /**
+         * Gets underlying native buffer
+         * @returns underlying native buffer
+         */
         Buffer.prototype.getBuffer = function () {
             return this._buffer;
         };
@@ -29749,6 +29764,10 @@ var BABYLON;
             return this.byteStride / Float32Array.BYTES_PER_ELEMENT;
         };
         // Methods
+        /**
+         * Store data into the buffer. If the buffer was already used it will be either recreated or updated depending on isUpdatable property
+         * @param data defines the data to store
+         */
         Buffer.prototype.create = function (data) {
             if (data === void 0) { data = null; }
             if (!data && this._buffer) {
@@ -29777,6 +29796,10 @@ var BABYLON;
             this._buffer = null;
             this.create(this._data);
         };
+        /**
+         * Update current buffer data
+         * @param data defines the data to store
+         */
         Buffer.prototype.update = function (data) {
             this.create(data);
         };
@@ -29797,6 +29820,9 @@ var BABYLON;
                 this._data = null;
             }
         };
+        /**
+         * Release all resources
+         */
         Buffer.prototype.dispose = function () {
             if (!this._buffer) {
                 return;
@@ -29814,6 +29840,9 @@ var BABYLON;
 
 var BABYLON;
 (function (BABYLON) {
+    /**
+     * Specialized buffer used to store vertex data
+     */
     var VertexBuffer = /** @class */ (function () {
         /**
          * Constructor
@@ -29903,33 +29932,39 @@ var BABYLON;
             this._buffer._rebuild();
         };
         /**
-         * Returns the kind of the VertexBuffer (string).
+         * Returns the kind of the VertexBuffer (string)
+         * @returns a string
          */
         VertexBuffer.prototype.getKind = function () {
             return this._kind;
         };
         // Properties
         /**
-         * Boolean : is the VertexBuffer updatable ?
+         * Gets a boolean indicating if the VertexBuffer is updatable?
+         * @returns true if the buffer is updatable
          */
         VertexBuffer.prototype.isUpdatable = function () {
             return this._buffer.isUpdatable();
         };
         /**
-         * Returns an array of numbers or a typed array containing the VertexBuffer data.
+         * Gets current buffer's data
+         * @returns a DataArray or null
          */
         VertexBuffer.prototype.getData = function () {
             return this._buffer.getData();
         };
         /**
-         * Returns the WebGLBuffer associated to the VertexBuffer.
+         * Gets underlying native buffer
+         * @returns underlying native buffer
          */
         VertexBuffer.prototype.getBuffer = function () {
             return this._buffer.getBuffer();
         };
         /**
-         * Returns the stride as a multiple of the type byte length.
+         * Gets the stride in float32 units (i.e. byte stride / 4).
+         * May not be an integer if the byte stride is not divisible by 4.
          * DEPRECATED. Use byteStride instead.
+         * @returns the stride in float32 units
          */
         VertexBuffer.prototype.getStrideSize = function () {
             return this.byteStride / VertexBuffer.GetTypeByteLength(this.type);
@@ -29937,43 +29972,47 @@ var BABYLON;
         /**
          * Returns the offset as a multiple of the type byte length.
          * DEPRECATED. Use byteOffset instead.
+         * @returns the offset in bytes
          */
         VertexBuffer.prototype.getOffset = function () {
             return this.byteOffset / VertexBuffer.GetTypeByteLength(this.type);
         };
         /**
-         * Returns the number of components per vertex attribute (integer).
+         * Returns the number of components per vertex attribute (integer)
+         * @returns the size in float
          */
         VertexBuffer.prototype.getSize = function () {
             return this._size;
         };
         /**
-         * Boolean : is the WebGLBuffer of the VertexBuffer instanced now ?
+         * Gets a boolean indicating is the internal buffer of the VertexBuffer is instanced
+         * @returns true if this buffer is instanced
          */
         VertexBuffer.prototype.getIsInstanced = function () {
             return this._instanced;
         };
         /**
          * Returns the instancing divisor, zero for non-instanced (integer).
+         * @returns a number
          */
         VertexBuffer.prototype.getInstanceDivisor = function () {
             return this._instanceDivisor;
         };
         // Methods
         /**
-         * Creates the underlying WebGLBuffer from the passed numeric array or Float32Array.
-         * Returns the created WebGLBuffer.
+         * Store data into the buffer. If the buffer was already used it will be either recreated or updated depending on isUpdatable property
+         * @param data defines the data to store
          */
         VertexBuffer.prototype.create = function (data) {
-            return this._buffer.create(data);
+            this._buffer.create(data);
         };
         /**
-         * Updates the underlying WebGLBuffer according to the passed numeric array or Float32Array.
+         * Updates the underlying buffer according to the passed numeric array or Float32Array.
          * This function will create a new buffer if the current one is not updatable
-         * Returns the updated WebGLBuffer.
+         * @param data defines the data to store
          */
         VertexBuffer.prototype.update = function (data) {
-            return this._buffer.update(data);
+            this._buffer.update(data);
         };
         /**
          * Updates directly the underlying WebGLBuffer according to the passed numeric array or Float32Array.
@@ -30002,104 +30041,6 @@ var BABYLON;
         VertexBuffer.prototype.forEach = function (count, callback) {
             VertexBuffer.ForEach(this._buffer.getData(), this.byteOffset, this.byteStride, this._size, this.type, count, this.normalized, callback);
         };
-        Object.defineProperty(VertexBuffer, "PositionKind", {
-            get: function () {
-                return VertexBuffer._PositionKind;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(VertexBuffer, "NormalKind", {
-            get: function () {
-                return VertexBuffer._NormalKind;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(VertexBuffer, "TangentKind", {
-            get: function () {
-                return VertexBuffer._TangentKind;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(VertexBuffer, "UVKind", {
-            get: function () {
-                return VertexBuffer._UVKind;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(VertexBuffer, "UV2Kind", {
-            get: function () {
-                return VertexBuffer._UV2Kind;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(VertexBuffer, "UV3Kind", {
-            get: function () {
-                return VertexBuffer._UV3Kind;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(VertexBuffer, "UV4Kind", {
-            get: function () {
-                return VertexBuffer._UV4Kind;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(VertexBuffer, "UV5Kind", {
-            get: function () {
-                return VertexBuffer._UV5Kind;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(VertexBuffer, "UV6Kind", {
-            get: function () {
-                return VertexBuffer._UV6Kind;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(VertexBuffer, "ColorKind", {
-            get: function () {
-                return VertexBuffer._ColorKind;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(VertexBuffer, "MatricesIndicesKind", {
-            get: function () {
-                return VertexBuffer._MatricesIndicesKind;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(VertexBuffer, "MatricesWeightsKind", {
-            get: function () {
-                return VertexBuffer._MatricesWeightsKind;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(VertexBuffer, "MatricesIndicesExtraKind", {
-            get: function () {
-                return VertexBuffer._MatricesIndicesExtraKind;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(VertexBuffer, "MatricesWeightsExtraKind", {
-            get: function () {
-                return VertexBuffer._MatricesWeightsExtraKind;
-            },
-            enumerable: true,
-            configurable: true
-        });
         /**
          * Deduces the stride given a kind.
          * @param kind The kind string to deduce
@@ -30251,20 +30192,62 @@ var BABYLON;
          */
         VertexBuffer.FLOAT = 5126;
         // Enums
-        VertexBuffer._PositionKind = "position";
-        VertexBuffer._NormalKind = "normal";
-        VertexBuffer._TangentKind = "tangent";
-        VertexBuffer._UVKind = "uv";
-        VertexBuffer._UV2Kind = "uv2";
-        VertexBuffer._UV3Kind = "uv3";
-        VertexBuffer._UV4Kind = "uv4";
-        VertexBuffer._UV5Kind = "uv5";
-        VertexBuffer._UV6Kind = "uv6";
-        VertexBuffer._ColorKind = "color";
-        VertexBuffer._MatricesIndicesKind = "matricesIndices";
-        VertexBuffer._MatricesWeightsKind = "matricesWeights";
-        VertexBuffer._MatricesIndicesExtraKind = "matricesIndicesExtra";
-        VertexBuffer._MatricesWeightsExtraKind = "matricesWeightsExtra";
+        /**
+         * Positions
+         */
+        VertexBuffer.PositionKind = "position";
+        /**
+         * Normals
+         */
+        VertexBuffer.NormalKind = "normal";
+        /**
+         * Tangents
+         */
+        VertexBuffer.TangentKind = "tangent";
+        /**
+         * Texture coordinates
+         */
+        VertexBuffer.UVKind = "uv";
+        /**
+         * Texture coordinates 2
+         */
+        VertexBuffer.UV2Kind = "uv2";
+        /**
+         * Texture coordinates 3
+         */
+        VertexBuffer.UV3Kind = "uv3";
+        /**
+         * Texture coordinates 4
+         */
+        VertexBuffer.UV4Kind = "uv4";
+        /**
+         * Texture coordinates 5
+         */
+        VertexBuffer.UV5Kind = "uv5";
+        /**
+         * Texture coordinates 6
+         */
+        VertexBuffer.UV6Kind = "uv6";
+        /**
+         * Colors
+         */
+        VertexBuffer.ColorKind = "color";
+        /**
+         * Matrix indices (for bones)
+         */
+        VertexBuffer.MatricesIndicesKind = "matricesIndices";
+        /**
+         * Matrix weights (for bones)
+         */
+        VertexBuffer.MatricesWeightsKind = "matricesWeights";
+        /**
+         * Additional matrix indices (for bones)
+         */
+        VertexBuffer.MatricesIndicesExtraKind = "matricesIndicesExtra";
+        /**
+         * Additional matrix weights (for bones)
+         */
+        VertexBuffer.MatricesWeightsExtraKind = "matricesWeightsExtra";
         return VertexBuffer;
     }());
     BABYLON.VertexBuffer = VertexBuffer;
@@ -31603,8 +31586,8 @@ var BABYLON;
     }());
     BABYLON._CreationDataStorage = _CreationDataStorage;
     /**
- * @hidden
- **/
+     * @hidden
+     **/
     var _InstanceDataStorage = /** @class */ (function () {
         function _InstanceDataStorage() {
             this.visibleInstances = {};

+ 111 - 128
dist/preview release/babylon.no-module.max.js

@@ -12474,7 +12474,7 @@ var BABYLON;
              * Returns the current version of the framework
              */
             get: function () {
-                return "3.3.0-rc.1";
+                return "3.3.0-rc.2";
             },
             enumerable: true,
             configurable: true
@@ -29649,6 +29649,9 @@ var BABYLON;
 
 var BABYLON;
 (function (BABYLON) {
+    /**
+     * Class used to store data that will be store in GPU memory
+     */
     var Buffer = /** @class */ (function () {
         /**
          * Constructor
@@ -29697,12 +29700,24 @@ var BABYLON;
             return new BABYLON.VertexBuffer(this._engine, this, kind, this._updatable, true, byteStride, instanced === undefined ? this._instanced : instanced, byteOffset, size, undefined, undefined, true);
         };
         // Properties
+        /**
+         * Gets a boolean indicating if the Buffer is updatable?
+         * @returns true if the buffer is updatable
+         */
         Buffer.prototype.isUpdatable = function () {
             return this._updatable;
         };
+        /**
+         * Gets current buffer's data
+         * @returns a DataArray or null
+         */
         Buffer.prototype.getData = function () {
             return this._data;
         };
+        /**
+         * Gets underlying native buffer
+         * @returns underlying native buffer
+         */
         Buffer.prototype.getBuffer = function () {
             return this._buffer;
         };
@@ -29716,6 +29731,10 @@ var BABYLON;
             return this.byteStride / Float32Array.BYTES_PER_ELEMENT;
         };
         // Methods
+        /**
+         * Store data into the buffer. If the buffer was already used it will be either recreated or updated depending on isUpdatable property
+         * @param data defines the data to store
+         */
         Buffer.prototype.create = function (data) {
             if (data === void 0) { data = null; }
             if (!data && this._buffer) {
@@ -29744,6 +29763,10 @@ var BABYLON;
             this._buffer = null;
             this.create(this._data);
         };
+        /**
+         * Update current buffer data
+         * @param data defines the data to store
+         */
         Buffer.prototype.update = function (data) {
             this.create(data);
         };
@@ -29764,6 +29787,9 @@ var BABYLON;
                 this._data = null;
             }
         };
+        /**
+         * Release all resources
+         */
         Buffer.prototype.dispose = function () {
             if (!this._buffer) {
                 return;
@@ -29781,6 +29807,9 @@ var BABYLON;
 
 var BABYLON;
 (function (BABYLON) {
+    /**
+     * Specialized buffer used to store vertex data
+     */
     var VertexBuffer = /** @class */ (function () {
         /**
          * Constructor
@@ -29870,33 +29899,39 @@ var BABYLON;
             this._buffer._rebuild();
         };
         /**
-         * Returns the kind of the VertexBuffer (string).
+         * Returns the kind of the VertexBuffer (string)
+         * @returns a string
          */
         VertexBuffer.prototype.getKind = function () {
             return this._kind;
         };
         // Properties
         /**
-         * Boolean : is the VertexBuffer updatable ?
+         * Gets a boolean indicating if the VertexBuffer is updatable?
+         * @returns true if the buffer is updatable
          */
         VertexBuffer.prototype.isUpdatable = function () {
             return this._buffer.isUpdatable();
         };
         /**
-         * Returns an array of numbers or a typed array containing the VertexBuffer data.
+         * Gets current buffer's data
+         * @returns a DataArray or null
          */
         VertexBuffer.prototype.getData = function () {
             return this._buffer.getData();
         };
         /**
-         * Returns the WebGLBuffer associated to the VertexBuffer.
+         * Gets underlying native buffer
+         * @returns underlying native buffer
          */
         VertexBuffer.prototype.getBuffer = function () {
             return this._buffer.getBuffer();
         };
         /**
-         * Returns the stride as a multiple of the type byte length.
+         * Gets the stride in float32 units (i.e. byte stride / 4).
+         * May not be an integer if the byte stride is not divisible by 4.
          * DEPRECATED. Use byteStride instead.
+         * @returns the stride in float32 units
          */
         VertexBuffer.prototype.getStrideSize = function () {
             return this.byteStride / VertexBuffer.GetTypeByteLength(this.type);
@@ -29904,43 +29939,47 @@ var BABYLON;
         /**
          * Returns the offset as a multiple of the type byte length.
          * DEPRECATED. Use byteOffset instead.
+         * @returns the offset in bytes
          */
         VertexBuffer.prototype.getOffset = function () {
             return this.byteOffset / VertexBuffer.GetTypeByteLength(this.type);
         };
         /**
-         * Returns the number of components per vertex attribute (integer).
+         * Returns the number of components per vertex attribute (integer)
+         * @returns the size in float
          */
         VertexBuffer.prototype.getSize = function () {
             return this._size;
         };
         /**
-         * Boolean : is the WebGLBuffer of the VertexBuffer instanced now ?
+         * Gets a boolean indicating is the internal buffer of the VertexBuffer is instanced
+         * @returns true if this buffer is instanced
          */
         VertexBuffer.prototype.getIsInstanced = function () {
             return this._instanced;
         };
         /**
          * Returns the instancing divisor, zero for non-instanced (integer).
+         * @returns a number
          */
         VertexBuffer.prototype.getInstanceDivisor = function () {
             return this._instanceDivisor;
         };
         // Methods
         /**
-         * Creates the underlying WebGLBuffer from the passed numeric array or Float32Array.
-         * Returns the created WebGLBuffer.
+         * Store data into the buffer. If the buffer was already used it will be either recreated or updated depending on isUpdatable property
+         * @param data defines the data to store
          */
         VertexBuffer.prototype.create = function (data) {
-            return this._buffer.create(data);
+            this._buffer.create(data);
         };
         /**
-         * Updates the underlying WebGLBuffer according to the passed numeric array or Float32Array.
+         * Updates the underlying buffer according to the passed numeric array or Float32Array.
          * This function will create a new buffer if the current one is not updatable
-         * Returns the updated WebGLBuffer.
+         * @param data defines the data to store
          */
         VertexBuffer.prototype.update = function (data) {
-            return this._buffer.update(data);
+            this._buffer.update(data);
         };
         /**
          * Updates directly the underlying WebGLBuffer according to the passed numeric array or Float32Array.
@@ -29969,104 +30008,6 @@ var BABYLON;
         VertexBuffer.prototype.forEach = function (count, callback) {
             VertexBuffer.ForEach(this._buffer.getData(), this.byteOffset, this.byteStride, this._size, this.type, count, this.normalized, callback);
         };
-        Object.defineProperty(VertexBuffer, "PositionKind", {
-            get: function () {
-                return VertexBuffer._PositionKind;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(VertexBuffer, "NormalKind", {
-            get: function () {
-                return VertexBuffer._NormalKind;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(VertexBuffer, "TangentKind", {
-            get: function () {
-                return VertexBuffer._TangentKind;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(VertexBuffer, "UVKind", {
-            get: function () {
-                return VertexBuffer._UVKind;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(VertexBuffer, "UV2Kind", {
-            get: function () {
-                return VertexBuffer._UV2Kind;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(VertexBuffer, "UV3Kind", {
-            get: function () {
-                return VertexBuffer._UV3Kind;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(VertexBuffer, "UV4Kind", {
-            get: function () {
-                return VertexBuffer._UV4Kind;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(VertexBuffer, "UV5Kind", {
-            get: function () {
-                return VertexBuffer._UV5Kind;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(VertexBuffer, "UV6Kind", {
-            get: function () {
-                return VertexBuffer._UV6Kind;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(VertexBuffer, "ColorKind", {
-            get: function () {
-                return VertexBuffer._ColorKind;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(VertexBuffer, "MatricesIndicesKind", {
-            get: function () {
-                return VertexBuffer._MatricesIndicesKind;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(VertexBuffer, "MatricesWeightsKind", {
-            get: function () {
-                return VertexBuffer._MatricesWeightsKind;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(VertexBuffer, "MatricesIndicesExtraKind", {
-            get: function () {
-                return VertexBuffer._MatricesIndicesExtraKind;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(VertexBuffer, "MatricesWeightsExtraKind", {
-            get: function () {
-                return VertexBuffer._MatricesWeightsExtraKind;
-            },
-            enumerable: true,
-            configurable: true
-        });
         /**
          * Deduces the stride given a kind.
          * @param kind The kind string to deduce
@@ -30218,20 +30159,62 @@ var BABYLON;
          */
         VertexBuffer.FLOAT = 5126;
         // Enums
-        VertexBuffer._PositionKind = "position";
-        VertexBuffer._NormalKind = "normal";
-        VertexBuffer._TangentKind = "tangent";
-        VertexBuffer._UVKind = "uv";
-        VertexBuffer._UV2Kind = "uv2";
-        VertexBuffer._UV3Kind = "uv3";
-        VertexBuffer._UV4Kind = "uv4";
-        VertexBuffer._UV5Kind = "uv5";
-        VertexBuffer._UV6Kind = "uv6";
-        VertexBuffer._ColorKind = "color";
-        VertexBuffer._MatricesIndicesKind = "matricesIndices";
-        VertexBuffer._MatricesWeightsKind = "matricesWeights";
-        VertexBuffer._MatricesIndicesExtraKind = "matricesIndicesExtra";
-        VertexBuffer._MatricesWeightsExtraKind = "matricesWeightsExtra";
+        /**
+         * Positions
+         */
+        VertexBuffer.PositionKind = "position";
+        /**
+         * Normals
+         */
+        VertexBuffer.NormalKind = "normal";
+        /**
+         * Tangents
+         */
+        VertexBuffer.TangentKind = "tangent";
+        /**
+         * Texture coordinates
+         */
+        VertexBuffer.UVKind = "uv";
+        /**
+         * Texture coordinates 2
+         */
+        VertexBuffer.UV2Kind = "uv2";
+        /**
+         * Texture coordinates 3
+         */
+        VertexBuffer.UV3Kind = "uv3";
+        /**
+         * Texture coordinates 4
+         */
+        VertexBuffer.UV4Kind = "uv4";
+        /**
+         * Texture coordinates 5
+         */
+        VertexBuffer.UV5Kind = "uv5";
+        /**
+         * Texture coordinates 6
+         */
+        VertexBuffer.UV6Kind = "uv6";
+        /**
+         * Colors
+         */
+        VertexBuffer.ColorKind = "color";
+        /**
+         * Matrix indices (for bones)
+         */
+        VertexBuffer.MatricesIndicesKind = "matricesIndices";
+        /**
+         * Matrix weights (for bones)
+         */
+        VertexBuffer.MatricesWeightsKind = "matricesWeights";
+        /**
+         * Additional matrix indices (for bones)
+         */
+        VertexBuffer.MatricesIndicesExtraKind = "matricesIndicesExtra";
+        /**
+         * Additional matrix weights (for bones)
+         */
+        VertexBuffer.MatricesWeightsExtraKind = "matricesWeightsExtra";
         return VertexBuffer;
     }());
     BABYLON.VertexBuffer = VertexBuffer;
@@ -31570,8 +31553,8 @@ var BABYLON;
     }());
     BABYLON._CreationDataStorage = _CreationDataStorage;
     /**
- * @hidden
- **/
+     * @hidden
+     **/
     var _InstanceDataStorage = /** @class */ (function () {
         function _InstanceDataStorage() {
             this.visibleInstances = {};

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


+ 111 - 128
dist/preview release/es6.js

@@ -12474,7 +12474,7 @@ var BABYLON;
              * Returns the current version of the framework
              */
             get: function () {
-                return "3.3.0-rc.1";
+                return "3.3.0-rc.2";
             },
             enumerable: true,
             configurable: true
@@ -29649,6 +29649,9 @@ var BABYLON;
 
 var BABYLON;
 (function (BABYLON) {
+    /**
+     * Class used to store data that will be store in GPU memory
+     */
     var Buffer = /** @class */ (function () {
         /**
          * Constructor
@@ -29697,12 +29700,24 @@ var BABYLON;
             return new BABYLON.VertexBuffer(this._engine, this, kind, this._updatable, true, byteStride, instanced === undefined ? this._instanced : instanced, byteOffset, size, undefined, undefined, true);
         };
         // Properties
+        /**
+         * Gets a boolean indicating if the Buffer is updatable?
+         * @returns true if the buffer is updatable
+         */
         Buffer.prototype.isUpdatable = function () {
             return this._updatable;
         };
+        /**
+         * Gets current buffer's data
+         * @returns a DataArray or null
+         */
         Buffer.prototype.getData = function () {
             return this._data;
         };
+        /**
+         * Gets underlying native buffer
+         * @returns underlying native buffer
+         */
         Buffer.prototype.getBuffer = function () {
             return this._buffer;
         };
@@ -29716,6 +29731,10 @@ var BABYLON;
             return this.byteStride / Float32Array.BYTES_PER_ELEMENT;
         };
         // Methods
+        /**
+         * Store data into the buffer. If the buffer was already used it will be either recreated or updated depending on isUpdatable property
+         * @param data defines the data to store
+         */
         Buffer.prototype.create = function (data) {
             if (data === void 0) { data = null; }
             if (!data && this._buffer) {
@@ -29744,6 +29763,10 @@ var BABYLON;
             this._buffer = null;
             this.create(this._data);
         };
+        /**
+         * Update current buffer data
+         * @param data defines the data to store
+         */
         Buffer.prototype.update = function (data) {
             this.create(data);
         };
@@ -29764,6 +29787,9 @@ var BABYLON;
                 this._data = null;
             }
         };
+        /**
+         * Release all resources
+         */
         Buffer.prototype.dispose = function () {
             if (!this._buffer) {
                 return;
@@ -29781,6 +29807,9 @@ var BABYLON;
 
 var BABYLON;
 (function (BABYLON) {
+    /**
+     * Specialized buffer used to store vertex data
+     */
     var VertexBuffer = /** @class */ (function () {
         /**
          * Constructor
@@ -29870,33 +29899,39 @@ var BABYLON;
             this._buffer._rebuild();
         };
         /**
-         * Returns the kind of the VertexBuffer (string).
+         * Returns the kind of the VertexBuffer (string)
+         * @returns a string
          */
         VertexBuffer.prototype.getKind = function () {
             return this._kind;
         };
         // Properties
         /**
-         * Boolean : is the VertexBuffer updatable ?
+         * Gets a boolean indicating if the VertexBuffer is updatable?
+         * @returns true if the buffer is updatable
          */
         VertexBuffer.prototype.isUpdatable = function () {
             return this._buffer.isUpdatable();
         };
         /**
-         * Returns an array of numbers or a typed array containing the VertexBuffer data.
+         * Gets current buffer's data
+         * @returns a DataArray or null
          */
         VertexBuffer.prototype.getData = function () {
             return this._buffer.getData();
         };
         /**
-         * Returns the WebGLBuffer associated to the VertexBuffer.
+         * Gets underlying native buffer
+         * @returns underlying native buffer
          */
         VertexBuffer.prototype.getBuffer = function () {
             return this._buffer.getBuffer();
         };
         /**
-         * Returns the stride as a multiple of the type byte length.
+         * Gets the stride in float32 units (i.e. byte stride / 4).
+         * May not be an integer if the byte stride is not divisible by 4.
          * DEPRECATED. Use byteStride instead.
+         * @returns the stride in float32 units
          */
         VertexBuffer.prototype.getStrideSize = function () {
             return this.byteStride / VertexBuffer.GetTypeByteLength(this.type);
@@ -29904,43 +29939,47 @@ var BABYLON;
         /**
          * Returns the offset as a multiple of the type byte length.
          * DEPRECATED. Use byteOffset instead.
+         * @returns the offset in bytes
          */
         VertexBuffer.prototype.getOffset = function () {
             return this.byteOffset / VertexBuffer.GetTypeByteLength(this.type);
         };
         /**
-         * Returns the number of components per vertex attribute (integer).
+         * Returns the number of components per vertex attribute (integer)
+         * @returns the size in float
          */
         VertexBuffer.prototype.getSize = function () {
             return this._size;
         };
         /**
-         * Boolean : is the WebGLBuffer of the VertexBuffer instanced now ?
+         * Gets a boolean indicating is the internal buffer of the VertexBuffer is instanced
+         * @returns true if this buffer is instanced
          */
         VertexBuffer.prototype.getIsInstanced = function () {
             return this._instanced;
         };
         /**
          * Returns the instancing divisor, zero for non-instanced (integer).
+         * @returns a number
          */
         VertexBuffer.prototype.getInstanceDivisor = function () {
             return this._instanceDivisor;
         };
         // Methods
         /**
-         * Creates the underlying WebGLBuffer from the passed numeric array or Float32Array.
-         * Returns the created WebGLBuffer.
+         * Store data into the buffer. If the buffer was already used it will be either recreated or updated depending on isUpdatable property
+         * @param data defines the data to store
          */
         VertexBuffer.prototype.create = function (data) {
-            return this._buffer.create(data);
+            this._buffer.create(data);
         };
         /**
-         * Updates the underlying WebGLBuffer according to the passed numeric array or Float32Array.
+         * Updates the underlying buffer according to the passed numeric array or Float32Array.
          * This function will create a new buffer if the current one is not updatable
-         * Returns the updated WebGLBuffer.
+         * @param data defines the data to store
          */
         VertexBuffer.prototype.update = function (data) {
-            return this._buffer.update(data);
+            this._buffer.update(data);
         };
         /**
          * Updates directly the underlying WebGLBuffer according to the passed numeric array or Float32Array.
@@ -29969,104 +30008,6 @@ var BABYLON;
         VertexBuffer.prototype.forEach = function (count, callback) {
             VertexBuffer.ForEach(this._buffer.getData(), this.byteOffset, this.byteStride, this._size, this.type, count, this.normalized, callback);
         };
-        Object.defineProperty(VertexBuffer, "PositionKind", {
-            get: function () {
-                return VertexBuffer._PositionKind;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(VertexBuffer, "NormalKind", {
-            get: function () {
-                return VertexBuffer._NormalKind;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(VertexBuffer, "TangentKind", {
-            get: function () {
-                return VertexBuffer._TangentKind;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(VertexBuffer, "UVKind", {
-            get: function () {
-                return VertexBuffer._UVKind;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(VertexBuffer, "UV2Kind", {
-            get: function () {
-                return VertexBuffer._UV2Kind;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(VertexBuffer, "UV3Kind", {
-            get: function () {
-                return VertexBuffer._UV3Kind;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(VertexBuffer, "UV4Kind", {
-            get: function () {
-                return VertexBuffer._UV4Kind;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(VertexBuffer, "UV5Kind", {
-            get: function () {
-                return VertexBuffer._UV5Kind;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(VertexBuffer, "UV6Kind", {
-            get: function () {
-                return VertexBuffer._UV6Kind;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(VertexBuffer, "ColorKind", {
-            get: function () {
-                return VertexBuffer._ColorKind;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(VertexBuffer, "MatricesIndicesKind", {
-            get: function () {
-                return VertexBuffer._MatricesIndicesKind;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(VertexBuffer, "MatricesWeightsKind", {
-            get: function () {
-                return VertexBuffer._MatricesWeightsKind;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(VertexBuffer, "MatricesIndicesExtraKind", {
-            get: function () {
-                return VertexBuffer._MatricesIndicesExtraKind;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(VertexBuffer, "MatricesWeightsExtraKind", {
-            get: function () {
-                return VertexBuffer._MatricesWeightsExtraKind;
-            },
-            enumerable: true,
-            configurable: true
-        });
         /**
          * Deduces the stride given a kind.
          * @param kind The kind string to deduce
@@ -30218,20 +30159,62 @@ var BABYLON;
          */
         VertexBuffer.FLOAT = 5126;
         // Enums
-        VertexBuffer._PositionKind = "position";
-        VertexBuffer._NormalKind = "normal";
-        VertexBuffer._TangentKind = "tangent";
-        VertexBuffer._UVKind = "uv";
-        VertexBuffer._UV2Kind = "uv2";
-        VertexBuffer._UV3Kind = "uv3";
-        VertexBuffer._UV4Kind = "uv4";
-        VertexBuffer._UV5Kind = "uv5";
-        VertexBuffer._UV6Kind = "uv6";
-        VertexBuffer._ColorKind = "color";
-        VertexBuffer._MatricesIndicesKind = "matricesIndices";
-        VertexBuffer._MatricesWeightsKind = "matricesWeights";
-        VertexBuffer._MatricesIndicesExtraKind = "matricesIndicesExtra";
-        VertexBuffer._MatricesWeightsExtraKind = "matricesWeightsExtra";
+        /**
+         * Positions
+         */
+        VertexBuffer.PositionKind = "position";
+        /**
+         * Normals
+         */
+        VertexBuffer.NormalKind = "normal";
+        /**
+         * Tangents
+         */
+        VertexBuffer.TangentKind = "tangent";
+        /**
+         * Texture coordinates
+         */
+        VertexBuffer.UVKind = "uv";
+        /**
+         * Texture coordinates 2
+         */
+        VertexBuffer.UV2Kind = "uv2";
+        /**
+         * Texture coordinates 3
+         */
+        VertexBuffer.UV3Kind = "uv3";
+        /**
+         * Texture coordinates 4
+         */
+        VertexBuffer.UV4Kind = "uv4";
+        /**
+         * Texture coordinates 5
+         */
+        VertexBuffer.UV5Kind = "uv5";
+        /**
+         * Texture coordinates 6
+         */
+        VertexBuffer.UV6Kind = "uv6";
+        /**
+         * Colors
+         */
+        VertexBuffer.ColorKind = "color";
+        /**
+         * Matrix indices (for bones)
+         */
+        VertexBuffer.MatricesIndicesKind = "matricesIndices";
+        /**
+         * Matrix weights (for bones)
+         */
+        VertexBuffer.MatricesWeightsKind = "matricesWeights";
+        /**
+         * Additional matrix indices (for bones)
+         */
+        VertexBuffer.MatricesIndicesExtraKind = "matricesIndicesExtra";
+        /**
+         * Additional matrix weights (for bones)
+         */
+        VertexBuffer.MatricesWeightsExtraKind = "matricesWeightsExtra";
         return VertexBuffer;
     }());
     BABYLON.VertexBuffer = VertexBuffer;
@@ -31570,8 +31553,8 @@ var BABYLON;
     }());
     BABYLON._CreationDataStorage = _CreationDataStorage;
     /**
- * @hidden
- **/
+     * @hidden
+     **/
     var _InstanceDataStorage = /** @class */ (function () {
         function _InstanceDataStorage() {
             this.visibleInstances = {};

+ 1 - 1
dist/preview release/glTF2Interface/package.json

@@ -1,7 +1,7 @@
 {
     "name": "babylonjs-gltf2interface",
     "description": "A typescript declaration of babylon's gltf2 inteface.",
-    "version": "3.3.0-rc.1",
+    "version": "3.3.0-rc.2",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"

+ 1 - 1
dist/preview release/gui/package.json

@@ -4,7 +4,7 @@
     },
     "name": "babylonjs-gui",
     "description": "The Babylon.js GUI library is an extension you can use to generate interactive user interface. It is build on top of the DynamicTexture.",
-    "version": "3.3.0-rc.1",
+    "version": "3.3.0-rc.2",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"

+ 1 - 1
dist/preview release/inspector/package.json

@@ -4,7 +4,7 @@
     },
     "name": "babylonjs-inspector",
     "description": "The Babylon.js inspector.",
-    "version": "3.3.0-rc.1",
+    "version": "3.3.0-rc.2",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"

+ 2 - 2
dist/preview release/loaders/package.json

@@ -4,7 +4,7 @@
     },
     "name": "babylonjs-loaders",
     "description": "The Babylon.js file loaders library is an extension you can use to load different 3D file types into a Babylon scene.",
-    "version": "3.3.0-rc.1",
+    "version": "3.3.0-rc.2",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"
@@ -27,7 +27,7 @@
     ],
     "license": "Apache-2.0",
     "dependencies": {
-        "babylonjs-gltf2interface": "3.3.0-rc.1"
+        "babylonjs-gltf2interface": "3.3.0-rc.2"
     },
     "peerDependencies": {
         "babylonjs": ">=3.2.0-alpha"

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

@@ -4,7 +4,7 @@
     },
     "name": "babylonjs-materials",
     "description": "The Babylon.js materials library is a collection of advanced materials to be used in a Babylon.js scene.",
-    "version": "3.3.0-rc.1",
+    "version": "3.3.0-rc.2",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"

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

@@ -4,7 +4,7 @@
     },
     "name": "babylonjs-post-process",
     "description": "The Babylon.js materials library is a collection of advanced materials to be used in a Babylon.js scene.",
-    "version": "3.3.0-rc.1",
+    "version": "3.3.0-rc.2",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"

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

@@ -4,7 +4,7 @@
     },
     "name": "babylonjs-procedural-textures",
     "description": "The Babylon.js materials library is a collection of advanced materials to be used in a Babylon.js scene.",
-    "version": "3.3.0-rc.1",
+    "version": "3.3.0-rc.2",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"

+ 2 - 2
dist/preview release/serializers/package.json

@@ -4,7 +4,7 @@
     },
     "name": "babylonjs-serializers",
     "description": "The Babylon.js serializers library is an extension you can use to serialize Babylon scenes.",
-    "version": "3.3.0-rc.1",
+    "version": "3.3.0-rc.2",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"
@@ -27,7 +27,7 @@
     ],
     "license": "Apache-2.0",
     "dependencies": {
-        "babylonjs-gltf2interface": "3.3.0-rc.1"
+        "babylonjs-gltf2interface": "3.3.0-rc.2"
     },
     "peerDependencies": {
         "babylonjs": ">=3.2.0-alpha"

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

@@ -1,7 +1,7 @@
 {
-  "errors": 1093,
+  "errors": 1058,
   "babylon.typedoc.json": {
-    "errors": 1093,
+    "errors": 1058,
     "BaseTexture": {
       "Class": {
         "Comments": {
@@ -280,59 +280,6 @@
         }
       }
     },
-    "Buffer": {
-      "Class": {
-        "Comments": {
-          "MissingText": true
-        }
-      },
-      "Method": {
-        "create": {
-          "Comments": {
-            "MissingText": true
-          },
-          "Parameter": {
-            "data": {
-              "Comments": {
-                "MissingText": true
-              }
-            }
-          }
-        },
-        "dispose": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "getBuffer": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "getData": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "isUpdatable": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "update": {
-          "Comments": {
-            "MissingText": true
-          },
-          "Parameter": {
-            "data": {
-              "Comments": {
-                "MissingText": true
-              }
-            }
-          }
-        }
-      }
-    },
     "CustomProceduralTexture": {
       "Class": {
         "Comments": {
@@ -5363,150 +5310,6 @@
         }
       }
     },
-    "VertexBuffer": {
-      "Class": {
-        "Comments": {
-          "MissingText": true
-        }
-      },
-      "Property": {
-        "ColorKind": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "MatricesIndicesExtraKind": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "MatricesIndicesKind": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "MatricesWeightsExtraKind": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "MatricesWeightsKind": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "NormalKind": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "PositionKind": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "TangentKind": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "UV2Kind": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "UV3Kind": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "UV4Kind": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "UV5Kind": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "UV6Kind": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "UVKind": {
-          "Comments": {
-            "MissingText": true
-          }
-        }
-      },
-      "Method": {
-        "create": {
-          "Parameter": {
-            "data": {
-              "Comments": {
-                "MissingText": true
-              }
-            }
-          }
-        },
-        "getBuffer": {
-          "Comments": {
-            "MissingReturn": true
-          }
-        },
-        "getData": {
-          "Comments": {
-            "MissingReturn": true
-          }
-        },
-        "getInstanceDivisor": {
-          "Comments": {
-            "MissingReturn": true
-          }
-        },
-        "getIsInstanced": {
-          "Comments": {
-            "MissingReturn": true
-          }
-        },
-        "getKind": {
-          "Comments": {
-            "MissingReturn": true
-          }
-        },
-        "getOffset": {
-          "Comments": {
-            "MissingReturn": true
-          }
-        },
-        "getSize": {
-          "Comments": {
-            "MissingReturn": true
-          }
-        },
-        "getStrideSize": {
-          "Comments": {
-            "MissingReturn": true
-          }
-        },
-        "isUpdatable": {
-          "Comments": {
-            "MissingReturn": true
-          }
-        },
-        "update": {
-          "Parameter": {
-            "data": {
-              "Comments": {
-                "MissingText": true
-              }
-            }
-          }
-        }
-      }
-    },
     "VideoTexture": {
       "Class": {
         "Comments": {

+ 393 - 185
dist/preview release/viewer/babylon.viewer.d.ts

@@ -70,57 +70,6 @@ declare module BabylonViewer {
     export let viewerGlobals: ViewerGlobals;
 }
 declare module BabylonViewer {
-    /**
-        * The viewer manager is the container for all viewers currently registered on this page.
-        * It is possible to have more than one viewer on a single page.
-        */
-    export class ViewerManager {
-            /**
-                * A callback that will be triggered when a new viewer was added
-                */
-            onViewerAdded: (viewer: AbstractViewer) => void;
-            /**
-                * Will notify when a new viewer was added
-                */
-            onViewerAddedObservable: BABYLON.Observable<AbstractViewer>;
-            /**
-                * Will notify when a viewer was removed (disposed)
-                */
-            onViewerRemovedObservable: BABYLON.Observable<string>;
-            constructor();
-            /**
-                * Adding a new viewer to the viewer manager and start tracking it.
-                * @param viewer the viewer to add
-                */
-            addViewer(viewer: AbstractViewer): void;
-            /**
-                * remove a viewer from the viewer manager
-                * @param viewer the viewer to remove
-                */
-            removeViewer(viewer: AbstractViewer): void;
-            /**
-                * Get a viewer by its baseId (if the container element has an ID, it is the this is. if not, a random id was assigned)
-                * @param id the id of the HTMl element (or the viewer's, if none provided)
-                */
-            getViewerById(id: string): AbstractViewer;
-            /**
-                * Get a viewer using a container element
-                * @param element the HTML element to search viewers associated with
-                */
-            getViewerByHTMLElement(element: HTMLElement): AbstractViewer | undefined;
-            /**
-                * Get a promise that will fullfil when this viewer was initialized.
-                * Since viewer initialization and template injection is asynchronous, using the promise will guaranty that
-                * you will get the viewer after everything was already configured.
-                * @param id the viewer id to find
-                */
-            getViewerPromiseById(id: string): Promise<AbstractViewer>;
-            /**
-                * dispose the manager and all of its associated viewers
-                */
-            dispose(): void;
-    }
-    export let viewerManager: ViewerManager;
 }
 declare module BabylonViewer {
     /**
@@ -199,6 +148,242 @@ declare module BabylonViewer {
     }
 }
 declare module BabylonViewer {
+    /**
+        * The AbstractViewr is the center of Babylon's viewer.
+        * It is the basic implementation of the default viewer and is responsible of loading and showing the model and the templates
+        */
+    export abstract class AbstractViewer {
+            containerElement: HTMLElement;
+            /**
+                * The corresponsing template manager of this viewer.
+                */
+            templateManager: TemplateManager;
+            /**
+                * Babylon BABYLON.Engine corresponding with this viewer
+                */
+            engine: BABYLON.Engine;
+            /**
+                * The ID of this viewer. it will be generated randomly or use the HTML Element's ID.
+                */
+            readonly baseId: string;
+            /**
+                * The last loader used to load a model.
+                * @deprecated
+                */
+            lastUsedLoader: BABYLON.ISceneLoaderPlugin | BABYLON.ISceneLoaderPluginAsync;
+            /**
+                * The ModelLoader instance connected with this viewer.
+                */
+            modelLoader: ModelLoader;
+            /**
+                * A flag that controls whether or not the render loop should be executed
+                */
+            runRenderLoop: boolean;
+            /**
+                * The scene manager connected with this viewer instance
+                */
+            sceneManager: SceneManager;
+            /**
+                * Will notify when the scene was initialized
+                */
+            readonly onSceneInitObservable: BABYLON.Observable<BABYLON.Scene>;
+            /**
+                * will notify when the engine was initialized
+                */
+            readonly onEngineInitObservable: BABYLON.Observable<BABYLON.Engine>;
+            /**
+                * Will notify when a new model was added to the scene.
+                * Note that added does not neccessarily mean loaded!
+                */
+            readonly onModelAddedObservable: BABYLON.Observable<ViewerModel>;
+            /**
+                * will notify after every model load
+                */
+            readonly onModelLoadedObservable: BABYLON.Observable<ViewerModel>;
+            /**
+                * will notify when any model notify of progress
+                */
+            readonly onModelLoadProgressObservable: BABYLON.Observable<BABYLON.SceneLoaderProgressEvent>;
+            /**
+                * will notify when any model load failed.
+                */
+            readonly onModelLoadErrorObservable: BABYLON.Observable<{
+                    message: string;
+                    exception: any;
+            }>;
+            /**
+                * Will notify when a model was removed from the scene;
+                */
+            readonly onModelRemovedObservable: BABYLON.Observable<ViewerModel>;
+            /**
+                * will notify when a new loader was initialized.
+                * Used mainly to know when a model starts loading.
+                */
+            readonly onLoaderInitObservable: BABYLON.Observable<BABYLON.ISceneLoaderPlugin | BABYLON.ISceneLoaderPluginAsync>;
+            /**
+                * Observers registered here will be executed when the entire load process has finished.
+                */
+            readonly onInitDoneObservable: BABYLON.Observable<AbstractViewer>;
+            /**
+                * Functions added to this observable will be executed on each frame rendered.
+                */
+            readonly onFrameRenderedObservable: BABYLON.Observable<AbstractViewer>;
+            /**
+                * Observers registered here will be executed when VR more is entered.
+                */
+            readonly onEnteringVRObservable: BABYLON.Observable<AbstractViewer>;
+            /**
+                * Observers registered here will be executed when VR mode is exited.
+                */
+            readonly onExitingVRObservable: BABYLON.Observable<AbstractViewer>;
+            observablesManager: ObservablesManager;
+            /**
+                * The canvas associated with this viewer
+                */
+            protected _canvas: HTMLCanvasElement;
+            /**
+                * The (single) canvas of this viewer
+                */
+            readonly canvas: HTMLCanvasElement;
+            /**
+                * is this viewer disposed?
+                */
+            protected _isDisposed: boolean;
+            /**
+                * registered onBeforeRender functions.
+                * This functions are also registered at the native scene. The reference can be used to unregister them.
+                */
+            protected _registeredOnBeforeRenderFunctions: Array<() => void>;
+            /**
+                * The configuration loader of this viewer
+                */
+            protected _configurationLoader: ConfigurationLoader;
+            /**
+                * Is the viewer already initialized. for internal use.
+                */
+            protected _isInit: boolean;
+            protected _configurationContainer: ConfigurationContainer;
+            readonly configurationContainer: ConfigurationContainer;
+            constructor(containerElement: HTMLElement, initialConfiguration?: ViewerConfiguration);
+            /**
+                * get the baseId of this viewer
+                */
+            getBaseId(): string;
+            /**
+                * Do we have a canvas to render on, and is it a part of the scene
+                */
+            isCanvasInDOM(): boolean;
+            /**
+             * Set the viewer's background rendering flag.
+             */
+            renderInBackground: boolean;
+            /**
+                * Get the configuration object. This is a reference only.
+                * The configuration can ONLY be updated using the updateConfiguration function.
+                * changing this object will have no direct effect on the scene.
+                */
+            readonly configuration: ViewerConfiguration;
+            /**
+                * force resizing the engine.
+                */
+            forceResize(): void;
+            protected _hdToggled: boolean;
+            toggleHD(): void;
+            protected _vrToggled: boolean;
+            protected _vrScale: number;
+            protected _vrInit: boolean;
+            toggleVR(): void;
+            protected _initVR(): void;
+            /**
+                * The resize function that will be registered with the window object
+                */
+            protected _resize: () => void;
+            protected _onConfigurationLoaded(configuration: ViewerConfiguration): void;
+            /**
+                * Force a single render loop execution.
+                */
+            forceRender(): void;
+            /**
+                * render loop that will be executed by the engine
+                */
+            protected _render: (force?: boolean) => void;
+            /**
+                * Takes a screenshot of the scene and returns it as a base64 encoded png.
+                * @param callback optional callback that will be triggered when screenshot is done.
+                * @param width Optional screenshot width (default to 512).
+                * @param height Optional screenshot height (default to 512).
+                * @returns a promise with the screenshot data
+                */
+            takeScreenshot(callback?: (data: string) => void, width?: number, height?: number): Promise<string>;
+            /**
+                * Update the current viewer configuration with new values.
+                * Only provided information will be updated, old configuration values will be kept.
+                * If this.configuration was manually changed, you can trigger this function with no parameters,
+                * and the entire configuration will be updated.
+                * @param newConfiguration the partial configuration to update or a URL to a JSON holding the updated configuration
+                *
+                */
+            updateConfiguration(newConfiguration?: Partial<ViewerConfiguration> | string): void;
+            /**
+                * this is used to register native functions using the configuration object.
+                * This will configure the observers.
+                * @param observersConfiguration observers configuration
+                */
+            protected _configureObservers(observersConfiguration: IObserversConfiguration): void;
+            /**
+                * Dispose the entire viewer including the scene and the engine
+                */
+            dispose(): void;
+            /**
+                * This will prepare the container element for the viewer
+                */
+            protected abstract _prepareContainerElement(): any;
+            /**
+                * This function will execute when the HTML templates finished initializing.
+                * It should initialize the engine and continue execution.
+                *
+                * @returns {Promise<AbstractViewer>} The viewer object will be returned after the object was loaded.
+                */
+            protected _onTemplatesLoaded(): Promise<AbstractViewer>;
+            /**
+                * This will force the creation of an engine and a scene.
+                * It will also load a model if preconfigured.
+                * But first - it will load the extendible onTemplateLoaded()!
+                */
+            protected _onTemplateLoaded(): Promise<AbstractViewer>;
+            /**
+                * Initialize the engine. Retruns a promise in case async calls are needed.
+                *
+                * @protected
+                * @returns {Promise<BABYLON.Engine>}
+                * @memberof Viewer
+                */
+            protected _initEngine(): Promise<BABYLON.Engine>;
+            /**
+                * Initialize a model loading. The returned object (a ViewerModel object) will be loaded in the background.
+                * The difference between this and loadModel is that loadModel will fulfill the promise when the model finished loading.
+                *
+                * @param modelConfig model configuration to use when loading the model.
+                * @param clearScene should the scene be cleared before loading this model
+                * @returns a ViewerModel object that is not yet fully loaded.
+                */
+            initModel(modelConfig: string | File | IModelConfiguration, clearScene?: boolean): ViewerModel;
+            /**
+                * load a model using the provided configuration.
+                * This function, as opposed to initModel, will return a promise that resolves when the model is loaded, and rejects with error.
+                * If you want to attach to the observables of the model, use initModle instead.
+                *
+                * @param modelConfig the model configuration or URL to load.
+                * @param clearScene Should the scene be cleared before loading the model
+                * @returns a Promise the fulfills when the model finished loading successfully.
+                */
+            loadModel(modelConfig: string | File | IModelConfiguration, clearScene?: boolean): Promise<ViewerModel>;
+            protected _initTelemetryEvents(): void;
+            /**
+                * Injects all the spectre shader in the babylon shader store
+                */
+            protected _injectCustomShaders(): void;
+    }
 }
 declare module BabylonViewer {
     /**
@@ -976,69 +1161,26 @@ declare module BabylonViewer {
     }
 }
 declare module BabylonViewer {
-    export interface IModelConfiguration {
-            id?: string;
-            url?: string;
-            root?: string;
-            file?: string | File;
-            loader?: string;
-            position?: {
-                    x: number;
-                    y: number;
-                    z: number;
-            };
-            rotation?: {
-                    x: number;
-                    y: number;
-                    z: number;
-                    w?: number;
-            };
-            scaling?: {
-                    x: number;
-                    y: number;
-                    z: number;
-            };
-            parentObjectIndex?: number;
-            castShadow?: boolean;
-            receiveShadows?: boolean;
-            normalize?: boolean | {
-                    center?: boolean;
-                    unitSize?: boolean;
-                    parentIndex?: number;
-            };
-            title?: string;
-            subtitle?: string;
-            thumbnail?: string;
-            animation?: {
-                    autoStart?: boolean | string;
-                    playOnce?: boolean;
-                    autoStartIndex?: number;
-            };
-            entryAnimation?: IModelAnimationConfiguration;
-            exitAnimation?: IModelAnimationConfiguration;
-            material?: {
-                    directEnabled?: boolean;
-                    directIntensity?: number;
-                    emissiveIntensity?: number;
-                    environmentIntensity?: number;
-                    [propName: string]: any;
-            };
+    /**
+        * The configuration loader will load the configuration object from any source and will use the defined mapper to
+        * parse the object and return a conform ViewerConfiguration.
+        * It is a private member of the scene.
+        */
+    export class ConfigurationLoader {
+            constructor(_enableCache?: boolean);
             /**
-                * Rotation offset axis definition
+                * load a configuration object that is defined in the initial configuration provided.
+                * The viewer configuration can extend different types of configuration objects and have an extra configuration defined.
+                *
+                * @param initConfig the initial configuration that has the definitions of further configuration to load.
+                * @param callback an optional callback that will be called sync, if noconfiguration needs to be loaded or configuration is payload-only
+                * @returns A promise that delivers the extended viewer configuration, when done.
                 */
-            rotationOffsetAxis?: {
-                    x: number;
-                    y: number;
-                    z: number;
-            };
+            loadConfiguration(initConfig?: ViewerConfiguration, callback?: (config: ViewerConfiguration) => void): Promise<ViewerConfiguration>;
             /**
-                * the offset angle
+                * Dispose the configuration loader. This will cancel file requests, if active.
                 */
-            rotationOffsetAngle?: number;
-            loaderConfiguration?: {
-                    maxLODsToLoad?: number;
-                    progressiveLoading?: boolean;
-            };
+            dispose(): void;
     }
 }
 declare module BabylonViewer {
@@ -1106,33 +1248,6 @@ declare module BabylonViewer {
 }
 declare module BabylonViewer {
     /**
-        * Get a loader plugin according to its name.
-        * The plugin will be cached and will be reused if called for again.
-        *
-        * @param name the name of the plugin
-        */
-    export function getLoaderPluginByName(name: string): ILoaderPlugin;
-    /**
-        *
-        */
-    export function addLoaderPlugin(name: string, plugin: ILoaderPlugin): void;
-}
-declare module BabylonViewer {
-    /**
-        * A custom upgrade-oriented function configuration for the scene optimizer.
-        *
-        * @param viewer the viewer to optimize
-        */
-    export function extendedUpgrade(sceneManager: SceneManager): boolean;
-    /**
-        * A custom degrade-oriented function configuration for the scene optimizer.
-        *
-        * @param viewer the viewer to optimize
-        */
-    export function extendedDegrade(sceneManager: SceneManager): boolean;
-}
-declare module BabylonViewer {
-    /**
         * This interface describes the structure of the variable sent with the configuration observables of the scene manager.
         * O - the type of object we are dealing with (Light, BABYLON.ArcRotateCamera, BABYLON.Scene, etc')
         * T - the configuration type
@@ -1313,6 +1428,99 @@ declare module BabylonViewer {
     }
 }
 declare module BabylonViewer {
+    export interface IModelConfiguration {
+            id?: string;
+            url?: string;
+            root?: string;
+            file?: string | File;
+            loader?: string;
+            position?: {
+                    x: number;
+                    y: number;
+                    z: number;
+            };
+            rotation?: {
+                    x: number;
+                    y: number;
+                    z: number;
+                    w?: number;
+            };
+            scaling?: {
+                    x: number;
+                    y: number;
+                    z: number;
+            };
+            parentObjectIndex?: number;
+            castShadow?: boolean;
+            receiveShadows?: boolean;
+            normalize?: boolean | {
+                    center?: boolean;
+                    unitSize?: boolean;
+                    parentIndex?: number;
+            };
+            title?: string;
+            subtitle?: string;
+            thumbnail?: string;
+            animation?: {
+                    autoStart?: boolean | string;
+                    playOnce?: boolean;
+                    autoStartIndex?: number;
+            };
+            entryAnimation?: IModelAnimationConfiguration;
+            exitAnimation?: IModelAnimationConfiguration;
+            material?: {
+                    directEnabled?: boolean;
+                    directIntensity?: number;
+                    emissiveIntensity?: number;
+                    environmentIntensity?: number;
+                    [propName: string]: any;
+            };
+            /**
+                * Rotation offset axis definition
+                */
+            rotationOffsetAxis?: {
+                    x: number;
+                    y: number;
+                    z: number;
+            };
+            /**
+                * the offset angle
+                */
+            rotationOffsetAngle?: number;
+            loaderConfiguration?: {
+                    maxLODsToLoad?: number;
+                    progressiveLoading?: boolean;
+            };
+    }
+}
+declare module BabylonViewer {
+    /**
+        * Get a loader plugin according to its name.
+        * The plugin will be cached and will be reused if called for again.
+        *
+        * @param name the name of the plugin
+        */
+    export function getLoaderPluginByName(name: string): ILoaderPlugin;
+    /**
+        *
+        */
+    export function addLoaderPlugin(name: string, plugin: ILoaderPlugin): void;
+}
+declare module BabylonViewer {
+    /**
+        * A custom upgrade-oriented function configuration for the scene optimizer.
+        *
+        * @param viewer the viewer to optimize
+        */
+    export function extendedUpgrade(sceneManager: SceneManager): boolean;
+    /**
+        * A custom degrade-oriented function configuration for the scene optimizer.
+        *
+        * @param viewer the viewer to optimize
+        */
+    export function extendedDegrade(sceneManager: SceneManager): boolean;
+}
+declare module BabylonViewer {
 }
 declare module BabylonViewer {
     export interface IEnvironmentMapConfiguration {
@@ -1373,6 +1581,54 @@ declare module BabylonViewer {
 }
 declare module BabylonViewer {
     /**
+        * The ViewerLabs class will hold functions that are not (!) backwards compatible.
+        * The APIs in all labs-related classes and configuration  might change.
+        * Once stable, lab features will be moved to the publis API and configuration object.
+        */
+    export class ViewerLabs {
+            constructor(_scene: BABYLON.Scene);
+            assetsRootURL: string;
+            environment: PBREnvironment;
+            /**
+                        * Loads an environment map from a given URL
+                        * @param url URL of environment map
+                        * @param onSuccess Callback fired after environment successfully applied to the scene
+                        * @param onProgress Callback fired at progress events while loading the environment map
+                        * @param onError Callback fired when the load fails
+                        */
+            loadEnvironment(url: string, onSuccess?: (env: PBREnvironment) => void, onProgress?: (bytesLoaded: number, bytesTotal: number) => void, onError?: (e: any) => void): void;
+            /**
+                * Loads an environment map from a given URL
+                * @param buffer ArrayBuffer containing environment map
+                * @param onSuccess Callback fired after environment successfully applied to the scene
+                * @param onProgress Callback fired at progress events while loading the environment map
+                * @param onError Callback fired when the load fails
+                */
+            loadEnvironment(buffer: ArrayBuffer, onSuccess?: (env: PBREnvironment) => void, onProgress?: (bytesLoaded: number, bytesTotal: number) => void, onError?: (e: any) => void): void;
+            /**
+                * Sets the environment to an already loaded environment
+                * @param env PBREnvironment instance
+                * @param onSuccess Callback fired after environment successfully applied to the scene
+                * @param onProgress Callback fired at progress events while loading the environment map
+                * @param onError Callback fired when the load fails
+                */
+            loadEnvironment(env: PBREnvironment, onSuccess?: (env: PBREnvironment) => void, onProgress?: (bytesLoaded: number, bytesTotal: number) => void, onError?: (e: any) => void): void;
+            /**
+                * Applies an `EnvironmentMapConfiguration` to the scene
+                * @param environmentMapConfiguration Environment map configuration to apply
+                */
+            applyEnvironmentMapConfiguration(rotationY?: number): void;
+            /**
+                * Get an environment asset url by using the configuration if the path is not absolute.
+                * @param url Asset url
+                * @returns The Asset url using the `environmentAssetsRootURL` if the url is not an absolute path.
+                */
+            getAssetUrl(url: string): string;
+            rotateShadowLight(shadowLight: BABYLON.ShadowLight, amount: number, point?: BABYLON.Vector3, axis?: BABYLON.Vector3, target?: BABYLON.Vector3): void;
+    }
+}
+declare module BabylonViewer {
+    /**
         * Defines an animation to be applied to a model (translation, scale or rotation).
         */
     export interface IModelAnimationConfiguration {
@@ -1435,54 +1691,6 @@ declare module BabylonViewer {
     }
 }
 declare module BabylonViewer {
-    /**
-        * The ViewerLabs class will hold functions that are not (!) backwards compatible.
-        * The APIs in all labs-related classes and configuration  might change.
-        * Once stable, lab features will be moved to the publis API and configuration object.
-        */
-    export class ViewerLabs {
-            constructor(_scene: BABYLON.Scene);
-            assetsRootURL: string;
-            environment: PBREnvironment;
-            /**
-                        * Loads an environment map from a given URL
-                        * @param url URL of environment map
-                        * @param onSuccess Callback fired after environment successfully applied to the scene
-                        * @param onProgress Callback fired at progress events while loading the environment map
-                        * @param onError Callback fired when the load fails
-                        */
-            loadEnvironment(url: string, onSuccess?: (env: PBREnvironment) => void, onProgress?: (bytesLoaded: number, bytesTotal: number) => void, onError?: (e: any) => void): void;
-            /**
-                * Loads an environment map from a given URL
-                * @param buffer ArrayBuffer containing environment map
-                * @param onSuccess Callback fired after environment successfully applied to the scene
-                * @param onProgress Callback fired at progress events while loading the environment map
-                * @param onError Callback fired when the load fails
-                */
-            loadEnvironment(buffer: ArrayBuffer, onSuccess?: (env: PBREnvironment) => void, onProgress?: (bytesLoaded: number, bytesTotal: number) => void, onError?: (e: any) => void): void;
-            /**
-                * Sets the environment to an already loaded environment
-                * @param env PBREnvironment instance
-                * @param onSuccess Callback fired after environment successfully applied to the scene
-                * @param onProgress Callback fired at progress events while loading the environment map
-                * @param onError Callback fired when the load fails
-                */
-            loadEnvironment(env: PBREnvironment, onSuccess?: (env: PBREnvironment) => void, onProgress?: (bytesLoaded: number, bytesTotal: number) => void, onError?: (e: any) => void): void;
-            /**
-                * Applies an `EnvironmentMapConfiguration` to the scene
-                * @param environmentMapConfiguration Environment map configuration to apply
-                */
-            applyEnvironmentMapConfiguration(rotationY?: number): void;
-            /**
-                * Get an environment asset url by using the configuration if the path is not absolute.
-                * @param url Asset url
-                * @returns The Asset url using the `environmentAssetsRootURL` if the url is not an absolute path.
-                */
-            getAssetUrl(url: string): string;
-            rotateShadowLight(shadowLight: BABYLON.ShadowLight, amount: number, point?: BABYLON.Vector3, axis?: BABYLON.Vector3, target?: BABYLON.Vector3): void;
-    }
-}
-declare module BabylonViewer {
     export interface ICameraConfiguration {
         position?: {
             x: number;

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


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


+ 419 - 202
dist/preview release/viewer/babylon.viewer.module.d.ts

@@ -94,59 +94,7 @@ declare module 'babylonjs-viewer/configuration/globals' {
 }
 
 declare module 'babylonjs-viewer/viewer/viewerManager' {
-    import { Observable } from 'babylonjs';
-    import { AbstractViewer } from 'babylonjs-viewer/viewer/viewer';
-    /**
-        * The viewer manager is the container for all viewers currently registered on this page.
-        * It is possible to have more than one viewer on a single page.
-        */
-    export class ViewerManager {
-            /**
-                * A callback that will be triggered when a new viewer was added
-                */
-            onViewerAdded: (viewer: AbstractViewer) => void;
-            /**
-                * Will notify when a new viewer was added
-                */
-            onViewerAddedObservable: Observable<AbstractViewer>;
-            /**
-                * Will notify when a viewer was removed (disposed)
-                */
-            onViewerRemovedObservable: Observable<string>;
-            constructor();
-            /**
-                * Adding a new viewer to the viewer manager and start tracking it.
-                * @param viewer the viewer to add
-                */
-            addViewer(viewer: AbstractViewer): void;
-            /**
-                * remove a viewer from the viewer manager
-                * @param viewer the viewer to remove
-                */
-            removeViewer(viewer: AbstractViewer): void;
-            /**
-                * Get a viewer by its baseId (if the container element has an ID, it is the this is. if not, a random id was assigned)
-                * @param id the id of the HTMl element (or the viewer's, if none provided)
-                */
-            getViewerById(id: string): AbstractViewer;
-            /**
-                * Get a viewer using a container element
-                * @param element the HTML element to search viewers associated with
-                */
-            getViewerByHTMLElement(element: HTMLElement): AbstractViewer | undefined;
-            /**
-                * Get a promise that will fullfil when this viewer was initialized.
-                * Since viewer initialization and template injection is asynchronous, using the promise will guaranty that
-                * you will get the viewer after everything was already configured.
-                * @param id the viewer id to find
-                */
-            getViewerPromiseById(id: string): Promise<AbstractViewer>;
-            /**
-                * dispose the manager and all of its associated viewers
-                */
-            dispose(): void;
-    }
-    export let viewerManager: ViewerManager;
+    
 }
 
 declare module 'babylonjs-viewer/viewer/defaultViewer' {
@@ -232,7 +180,251 @@ declare module 'babylonjs-viewer/viewer/defaultViewer' {
 }
 
 declare module 'babylonjs-viewer/viewer/viewer' {
-    
+    import { Engine, ISceneLoaderPlugin, ISceneLoaderPluginAsync, Observable, Scene, SceneLoaderProgressEvent } from 'babylonjs';
+    import { IModelConfiguration, IObserversConfiguration, ViewerConfiguration } from 'babylonjs-viewer/configuration';
+    import { ConfigurationContainer } from 'babylonjs-viewer/configuration/configurationContainer';
+    import { ConfigurationLoader } from 'babylonjs-viewer/configuration/loader';
+    import { ModelLoader } from 'babylonjs-viewer/loader/modelLoader';
+    import { ObservablesManager } from 'babylonjs-viewer/managers/observablesManager';
+    import { SceneManager } from 'babylonjs-viewer/managers/sceneManager';
+    import { ViewerModel } from 'babylonjs-viewer/model/viewerModel';
+    import { TemplateManager } from 'babylonjs-viewer/templating/templateManager';
+    /**
+        * The AbstractViewr is the center of Babylon's viewer.
+        * It is the basic implementation of the default viewer and is responsible of loading and showing the model and the templates
+        */
+    export abstract class AbstractViewer {
+            containerElement: HTMLElement;
+            /**
+                * The corresponsing template manager of this viewer.
+                */
+            templateManager: TemplateManager;
+            /**
+                * Babylon Engine corresponding with this viewer
+                */
+            engine: Engine;
+            /**
+                * The ID of this viewer. it will be generated randomly or use the HTML Element's ID.
+                */
+            readonly baseId: string;
+            /**
+                * The last loader used to load a model.
+                * @deprecated
+                */
+            lastUsedLoader: ISceneLoaderPlugin | ISceneLoaderPluginAsync;
+            /**
+                * The ModelLoader instance connected with this viewer.
+                */
+            modelLoader: ModelLoader;
+            /**
+                * A flag that controls whether or not the render loop should be executed
+                */
+            runRenderLoop: boolean;
+            /**
+                * The scene manager connected with this viewer instance
+                */
+            sceneManager: SceneManager;
+            /**
+                * Will notify when the scene was initialized
+                */
+            readonly onSceneInitObservable: Observable<Scene>;
+            /**
+                * will notify when the engine was initialized
+                */
+            readonly onEngineInitObservable: Observable<Engine>;
+            /**
+                * Will notify when a new model was added to the scene.
+                * Note that added does not neccessarily mean loaded!
+                */
+            readonly onModelAddedObservable: Observable<ViewerModel>;
+            /**
+                * will notify after every model load
+                */
+            readonly onModelLoadedObservable: Observable<ViewerModel>;
+            /**
+                * will notify when any model notify of progress
+                */
+            readonly onModelLoadProgressObservable: Observable<SceneLoaderProgressEvent>;
+            /**
+                * will notify when any model load failed.
+                */
+            readonly onModelLoadErrorObservable: Observable<{
+                    message: string;
+                    exception: any;
+            }>;
+            /**
+                * Will notify when a model was removed from the scene;
+                */
+            readonly onModelRemovedObservable: Observable<ViewerModel>;
+            /**
+                * will notify when a new loader was initialized.
+                * Used mainly to know when a model starts loading.
+                */
+            readonly onLoaderInitObservable: Observable<ISceneLoaderPlugin | ISceneLoaderPluginAsync>;
+            /**
+                * Observers registered here will be executed when the entire load process has finished.
+                */
+            readonly onInitDoneObservable: Observable<AbstractViewer>;
+            /**
+                * Functions added to this observable will be executed on each frame rendered.
+                */
+            readonly onFrameRenderedObservable: Observable<AbstractViewer>;
+            /**
+                * Observers registered here will be executed when VR more is entered.
+                */
+            readonly onEnteringVRObservable: Observable<AbstractViewer>;
+            /**
+                * Observers registered here will be executed when VR mode is exited.
+                */
+            readonly onExitingVRObservable: Observable<AbstractViewer>;
+            observablesManager: ObservablesManager;
+            /**
+                * The canvas associated with this viewer
+                */
+            protected _canvas: HTMLCanvasElement;
+            /**
+                * The (single) canvas of this viewer
+                */
+            readonly canvas: HTMLCanvasElement;
+            /**
+                * is this viewer disposed?
+                */
+            protected _isDisposed: boolean;
+            /**
+                * registered onBeforeRender functions.
+                * This functions are also registered at the native scene. The reference can be used to unregister them.
+                */
+            protected _registeredOnBeforeRenderFunctions: Array<() => void>;
+            /**
+                * The configuration loader of this viewer
+                */
+            protected _configurationLoader: ConfigurationLoader;
+            /**
+                * Is the viewer already initialized. for internal use.
+                */
+            protected _isInit: boolean;
+            protected _configurationContainer: ConfigurationContainer;
+            readonly configurationContainer: ConfigurationContainer;
+            constructor(containerElement: HTMLElement, initialConfiguration?: ViewerConfiguration);
+            /**
+                * get the baseId of this viewer
+                */
+            getBaseId(): string;
+            /**
+                * Do we have a canvas to render on, and is it a part of the scene
+                */
+            isCanvasInDOM(): boolean;
+            /**
+             * Set the viewer's background rendering flag.
+             */
+            renderInBackground: boolean;
+            /**
+                * Get the configuration object. This is a reference only.
+                * The configuration can ONLY be updated using the updateConfiguration function.
+                * changing this object will have no direct effect on the scene.
+                */
+            readonly configuration: ViewerConfiguration;
+            /**
+                * force resizing the engine.
+                */
+            forceResize(): void;
+            protected _hdToggled: boolean;
+            toggleHD(): void;
+            protected _vrToggled: boolean;
+            protected _vrScale: number;
+            protected _vrInit: boolean;
+            toggleVR(): void;
+            protected _initVR(): void;
+            /**
+                * The resize function that will be registered with the window object
+                */
+            protected _resize: () => void;
+            protected _onConfigurationLoaded(configuration: ViewerConfiguration): void;
+            /**
+                * Force a single render loop execution.
+                */
+            forceRender(): void;
+            /**
+                * render loop that will be executed by the engine
+                */
+            protected _render: (force?: boolean) => void;
+            /**
+                * Takes a screenshot of the scene and returns it as a base64 encoded png.
+                * @param callback optional callback that will be triggered when screenshot is done.
+                * @param width Optional screenshot width (default to 512).
+                * @param height Optional screenshot height (default to 512).
+                * @returns a promise with the screenshot data
+                */
+            takeScreenshot(callback?: (data: string) => void, width?: number, height?: number): Promise<string>;
+            /**
+                * Update the current viewer configuration with new values.
+                * Only provided information will be updated, old configuration values will be kept.
+                * If this.configuration was manually changed, you can trigger this function with no parameters,
+                * and the entire configuration will be updated.
+                * @param newConfiguration the partial configuration to update or a URL to a JSON holding the updated configuration
+                *
+                */
+            updateConfiguration(newConfiguration?: Partial<ViewerConfiguration> | string): void;
+            /**
+                * this is used to register native functions using the configuration object.
+                * This will configure the observers.
+                * @param observersConfiguration observers configuration
+                */
+            protected _configureObservers(observersConfiguration: IObserversConfiguration): void;
+            /**
+                * Dispose the entire viewer including the scene and the engine
+                */
+            dispose(): void;
+            /**
+                * This will prepare the container element for the viewer
+                */
+            protected abstract _prepareContainerElement(): any;
+            /**
+                * This function will execute when the HTML templates finished initializing.
+                * It should initialize the engine and continue execution.
+                *
+                * @returns {Promise<AbstractViewer>} The viewer object will be returned after the object was loaded.
+                */
+            protected _onTemplatesLoaded(): Promise<AbstractViewer>;
+            /**
+                * This will force the creation of an engine and a scene.
+                * It will also load a model if preconfigured.
+                * But first - it will load the extendible onTemplateLoaded()!
+                */
+            protected _onTemplateLoaded(): Promise<AbstractViewer>;
+            /**
+                * Initialize the engine. Retruns a promise in case async calls are needed.
+                *
+                * @protected
+                * @returns {Promise<Engine>}
+                * @memberof Viewer
+                */
+            protected _initEngine(): Promise<Engine>;
+            /**
+                * Initialize a model loading. The returned object (a ViewerModel object) will be loaded in the background.
+                * The difference between this and loadModel is that loadModel will fulfill the promise when the model finished loading.
+                *
+                * @param modelConfig model configuration to use when loading the model.
+                * @param clearScene should the scene be cleared before loading this model
+                * @returns a ViewerModel object that is not yet fully loaded.
+                */
+            initModel(modelConfig: string | File | IModelConfiguration, clearScene?: boolean): ViewerModel;
+            /**
+                * load a model using the provided configuration.
+                * This function, as opposed to initModel, will return a promise that resolves when the model is loaded, and rejects with error.
+                * If you want to attach to the observables of the model, use initModle instead.
+                *
+                * @param modelConfig the model configuration or URL to load.
+                * @param clearScene Should the scene be cleared before loading the model
+                * @returns a Promise the fulfills when the model finished loading successfully.
+                */
+            loadModel(modelConfig: string | File | IModelConfiguration, clearScene?: boolean): Promise<ViewerModel>;
+            protected _initTelemetryEvents(): void;
+            /**
+                * Injects all the spectre shader in the babylon shader store
+                */
+            protected _injectCustomShaders(): void;
+    }
 }
 
 declare module 'babylonjs-viewer/managers/telemetryManager' {
@@ -1051,71 +1243,28 @@ declare module 'babylonjs-viewer/configuration/configurationContainer' {
     }
 }
 
-declare module 'babylonjs-viewer/configuration/interfaces/modelConfiguration' {
-    import { IModelAnimationConfiguration } from "babylonjs-viewer/configuration/interfaces/modelAnimationConfiguration";
-    export interface IModelConfiguration {
-            id?: string;
-            url?: string;
-            root?: string;
-            file?: string | File;
-            loader?: string;
-            position?: {
-                    x: number;
-                    y: number;
-                    z: number;
-            };
-            rotation?: {
-                    x: number;
-                    y: number;
-                    z: number;
-                    w?: number;
-            };
-            scaling?: {
-                    x: number;
-                    y: number;
-                    z: number;
-            };
-            parentObjectIndex?: number;
-            castShadow?: boolean;
-            receiveShadows?: boolean;
-            normalize?: boolean | {
-                    center?: boolean;
-                    unitSize?: boolean;
-                    parentIndex?: number;
-            };
-            title?: string;
-            subtitle?: string;
-            thumbnail?: string;
-            animation?: {
-                    autoStart?: boolean | string;
-                    playOnce?: boolean;
-                    autoStartIndex?: number;
-            };
-            entryAnimation?: IModelAnimationConfiguration;
-            exitAnimation?: IModelAnimationConfiguration;
-            material?: {
-                    directEnabled?: boolean;
-                    directIntensity?: number;
-                    emissiveIntensity?: number;
-                    environmentIntensity?: number;
-                    [propName: string]: any;
-            };
+declare module 'babylonjs-viewer/configuration/loader' {
+    import { ViewerConfiguration } from 'babylonjs-viewer/configuration/configuration';
+    /**
+        * The configuration loader will load the configuration object from any source and will use the defined mapper to
+        * parse the object and return a conform ViewerConfiguration.
+        * It is a private member of the scene.
+        */
+    export class ConfigurationLoader {
+            constructor(_enableCache?: boolean);
             /**
-                * Rotation offset axis definition
+                * load a configuration object that is defined in the initial configuration provided.
+                * The viewer configuration can extend different types of configuration objects and have an extra configuration defined.
+                *
+                * @param initConfig the initial configuration that has the definitions of further configuration to load.
+                * @param callback an optional callback that will be called sync, if noconfiguration needs to be loaded or configuration is payload-only
+                * @returns A promise that delivers the extended viewer configuration, when done.
                 */
-            rotationOffsetAxis?: {
-                    x: number;
-                    y: number;
-                    z: number;
-            };
+            loadConfiguration(initConfig?: ViewerConfiguration, callback?: (config: ViewerConfiguration) => void): Promise<ViewerConfiguration>;
             /**
-                * the offset angle
+                * Dispose the configuration loader. This will cancel file requests, if active.
                 */
-            rotationOffsetAngle?: number;
-            loaderConfiguration?: {
-                    maxLODsToLoad?: number;
-                    progressiveLoading?: boolean;
-            };
+            dispose(): void;
     }
 }
 
@@ -1185,42 +1334,6 @@ declare module 'babylonjs-viewer/managers/observablesManager' {
     }
 }
 
-declare module 'babylonjs-viewer/loader/plugins' {
-    import { TelemetryLoaderPlugin } from "babylonjs-viewer/loader/plugins/telemetryLoaderPlugin";
-    import { ILoaderPlugin } from "babylonjs-viewer/loader/plugins/loaderPlugin";
-    import { MSFTLodLoaderPlugin } from 'babylonjs-viewer/loader/plugins/msftLodLoaderPlugin';
-    import { ApplyMaterialConfigPlugin } from 'babylonjs-viewer/loader/plugins/applyMaterialConfig';
-    import { ExtendedMaterialLoaderPlugin } from 'babylonjs-viewer/loader/plugins/extendedMaterialLoaderPlugin';
-    export { TelemetryLoaderPlugin, ILoaderPlugin, MSFTLodLoaderPlugin, ApplyMaterialConfigPlugin, ExtendedMaterialLoaderPlugin };
-    /**
-        * Get a loader plugin according to its name.
-        * The plugin will be cached and will be reused if called for again.
-        *
-        * @param name the name of the plugin
-        */
-    export function getLoaderPluginByName(name: string): ILoaderPlugin;
-    /**
-        *
-        */
-    export function addLoaderPlugin(name: string, plugin: ILoaderPlugin): void;
-}
-
-declare module 'babylonjs-viewer/optimizer/custom/extended' {
-    import { SceneManager } from 'babylonjs-viewer/managers/sceneManager';
-    /**
-        * A custom upgrade-oriented function configuration for the scene optimizer.
-        *
-        * @param viewer the viewer to optimize
-        */
-    export function extendedUpgrade(sceneManager: SceneManager): boolean;
-    /**
-        * A custom degrade-oriented function configuration for the scene optimizer.
-        *
-        * @param viewer the viewer to optimize
-        */
-    export function extendedDegrade(sceneManager: SceneManager): boolean;
-}
-
 declare module 'babylonjs-viewer/managers/sceneManager' {
     import { Scene, ArcRotateCamera, Engine, Light, SceneOptimizer, EnvironmentHelper, Color3, Observable, DefaultRenderingPipeline, Nullable, VRExperienceHelper } from 'babylonjs';
     import { ILightConfiguration, ISceneConfiguration, ISceneOptimizerConfiguration, ICameraConfiguration, ISkyboxConfiguration, ViewerConfiguration, IGroundConfiguration, IModelConfiguration, IVRConfiguration } from 'babylonjs-viewer/configuration';
@@ -1410,6 +1523,110 @@ declare module 'babylonjs-viewer/managers/sceneManager' {
     }
 }
 
+declare module 'babylonjs-viewer/configuration/interfaces/modelConfiguration' {
+    import { IModelAnimationConfiguration } from "babylonjs-viewer/configuration/interfaces/modelAnimationConfiguration";
+    export interface IModelConfiguration {
+            id?: string;
+            url?: string;
+            root?: string;
+            file?: string | File;
+            loader?: string;
+            position?: {
+                    x: number;
+                    y: number;
+                    z: number;
+            };
+            rotation?: {
+                    x: number;
+                    y: number;
+                    z: number;
+                    w?: number;
+            };
+            scaling?: {
+                    x: number;
+                    y: number;
+                    z: number;
+            };
+            parentObjectIndex?: number;
+            castShadow?: boolean;
+            receiveShadows?: boolean;
+            normalize?: boolean | {
+                    center?: boolean;
+                    unitSize?: boolean;
+                    parentIndex?: number;
+            };
+            title?: string;
+            subtitle?: string;
+            thumbnail?: string;
+            animation?: {
+                    autoStart?: boolean | string;
+                    playOnce?: boolean;
+                    autoStartIndex?: number;
+            };
+            entryAnimation?: IModelAnimationConfiguration;
+            exitAnimation?: IModelAnimationConfiguration;
+            material?: {
+                    directEnabled?: boolean;
+                    directIntensity?: number;
+                    emissiveIntensity?: number;
+                    environmentIntensity?: number;
+                    [propName: string]: any;
+            };
+            /**
+                * Rotation offset axis definition
+                */
+            rotationOffsetAxis?: {
+                    x: number;
+                    y: number;
+                    z: number;
+            };
+            /**
+                * the offset angle
+                */
+            rotationOffsetAngle?: number;
+            loaderConfiguration?: {
+                    maxLODsToLoad?: number;
+                    progressiveLoading?: boolean;
+            };
+    }
+}
+
+declare module 'babylonjs-viewer/loader/plugins' {
+    import { TelemetryLoaderPlugin } from "babylonjs-viewer/loader/plugins/telemetryLoaderPlugin";
+    import { ILoaderPlugin } from "babylonjs-viewer/loader/plugins/loaderPlugin";
+    import { MSFTLodLoaderPlugin } from 'babylonjs-viewer/loader/plugins/msftLodLoaderPlugin';
+    import { ApplyMaterialConfigPlugin } from 'babylonjs-viewer/loader/plugins/applyMaterialConfig';
+    import { ExtendedMaterialLoaderPlugin } from 'babylonjs-viewer/loader/plugins/extendedMaterialLoaderPlugin';
+    export { TelemetryLoaderPlugin, ILoaderPlugin, MSFTLodLoaderPlugin, ApplyMaterialConfigPlugin, ExtendedMaterialLoaderPlugin };
+    /**
+        * Get a loader plugin according to its name.
+        * The plugin will be cached and will be reused if called for again.
+        *
+        * @param name the name of the plugin
+        */
+    export function getLoaderPluginByName(name: string): ILoaderPlugin;
+    /**
+        *
+        */
+    export function addLoaderPlugin(name: string, plugin: ILoaderPlugin): void;
+}
+
+declare module 'babylonjs-viewer/optimizer/custom/extended' {
+    import { SceneManager } from 'babylonjs-viewer/managers/sceneManager';
+    /**
+        * A custom upgrade-oriented function configuration for the scene optimizer.
+        *
+        * @param viewer the viewer to optimize
+        */
+    export function extendedUpgrade(sceneManager: SceneManager): boolean;
+    /**
+        * A custom degrade-oriented function configuration for the scene optimizer.
+        *
+        * @param viewer the viewer to optimize
+        */
+    export function extendedDegrade(sceneManager: SceneManager): boolean;
+}
+
 declare module 'babylonjs-viewer/configuration/interfaces' {
     export * from 'babylonjs-viewer/configuration/interfaces/cameraConfiguration';
     export * from 'babylonjs-viewer/configuration/interfaces/colorGradingConfiguration';
@@ -1488,6 +1705,57 @@ declare module 'babylonjs-viewer/templating/eventManager' {
     }
 }
 
+declare module 'babylonjs-viewer/labs/viewerLabs' {
+    import { PBREnvironment } from "babylonjs-viewer/labs/environmentSerializer";
+    import { ShadowLight, Vector3, Scene } from 'babylonjs';
+    /**
+        * The ViewerLabs class will hold functions that are not (!) backwards compatible.
+        * The APIs in all labs-related classes and configuration  might change.
+        * Once stable, lab features will be moved to the publis API and configuration object.
+        */
+    export class ViewerLabs {
+            constructor(_scene: Scene);
+            assetsRootURL: string;
+            environment: PBREnvironment;
+            /**
+                        * Loads an environment map from a given URL
+                        * @param url URL of environment map
+                        * @param onSuccess Callback fired after environment successfully applied to the scene
+                        * @param onProgress Callback fired at progress events while loading the environment map
+                        * @param onError Callback fired when the load fails
+                        */
+            loadEnvironment(url: string, onSuccess?: (env: PBREnvironment) => void, onProgress?: (bytesLoaded: number, bytesTotal: number) => void, onError?: (e: any) => void): void;
+            /**
+                * Loads an environment map from a given URL
+                * @param buffer ArrayBuffer containing environment map
+                * @param onSuccess Callback fired after environment successfully applied to the scene
+                * @param onProgress Callback fired at progress events while loading the environment map
+                * @param onError Callback fired when the load fails
+                */
+            loadEnvironment(buffer: ArrayBuffer, onSuccess?: (env: PBREnvironment) => void, onProgress?: (bytesLoaded: number, bytesTotal: number) => void, onError?: (e: any) => void): void;
+            /**
+                * Sets the environment to an already loaded environment
+                * @param env PBREnvironment instance
+                * @param onSuccess Callback fired after environment successfully applied to the scene
+                * @param onProgress Callback fired at progress events while loading the environment map
+                * @param onError Callback fired when the load fails
+                */
+            loadEnvironment(env: PBREnvironment, onSuccess?: (env: PBREnvironment) => void, onProgress?: (bytesLoaded: number, bytesTotal: number) => void, onError?: (e: any) => void): void;
+            /**
+                * Applies an `EnvironmentMapConfiguration` to the scene
+                * @param environmentMapConfiguration Environment map configuration to apply
+                */
+            applyEnvironmentMapConfiguration(rotationY?: number): void;
+            /**
+                * Get an environment asset url by using the configuration if the path is not absolute.
+                * @param url Asset url
+                * @returns The Asset url using the `environmentAssetsRootURL` if the url is not an absolute path.
+                */
+            getAssetUrl(url: string): string;
+            rotateShadowLight(shadowLight: ShadowLight, amount: number, point?: Vector3, axis?: Vector3, target?: Vector3): void;
+    }
+}
+
 declare module 'babylonjs-viewer/configuration/interfaces/modelAnimationConfiguration' {
     /**
         * Defines an animation to be applied to a model (translation, scale or rotation).
@@ -1568,57 +1836,6 @@ declare module 'babylonjs-viewer/loader/plugins/extendedMaterialLoaderPlugin' {
     }
 }
 
-declare module 'babylonjs-viewer/labs/viewerLabs' {
-    import { PBREnvironment } from "babylonjs-viewer/labs/environmentSerializer";
-    import { ShadowLight, Vector3, Scene } from 'babylonjs';
-    /**
-        * The ViewerLabs class will hold functions that are not (!) backwards compatible.
-        * The APIs in all labs-related classes and configuration  might change.
-        * Once stable, lab features will be moved to the publis API and configuration object.
-        */
-    export class ViewerLabs {
-            constructor(_scene: Scene);
-            assetsRootURL: string;
-            environment: PBREnvironment;
-            /**
-                        * Loads an environment map from a given URL
-                        * @param url URL of environment map
-                        * @param onSuccess Callback fired after environment successfully applied to the scene
-                        * @param onProgress Callback fired at progress events while loading the environment map
-                        * @param onError Callback fired when the load fails
-                        */
-            loadEnvironment(url: string, onSuccess?: (env: PBREnvironment) => void, onProgress?: (bytesLoaded: number, bytesTotal: number) => void, onError?: (e: any) => void): void;
-            /**
-                * Loads an environment map from a given URL
-                * @param buffer ArrayBuffer containing environment map
-                * @param onSuccess Callback fired after environment successfully applied to the scene
-                * @param onProgress Callback fired at progress events while loading the environment map
-                * @param onError Callback fired when the load fails
-                */
-            loadEnvironment(buffer: ArrayBuffer, onSuccess?: (env: PBREnvironment) => void, onProgress?: (bytesLoaded: number, bytesTotal: number) => void, onError?: (e: any) => void): void;
-            /**
-                * Sets the environment to an already loaded environment
-                * @param env PBREnvironment instance
-                * @param onSuccess Callback fired after environment successfully applied to the scene
-                * @param onProgress Callback fired at progress events while loading the environment map
-                * @param onError Callback fired when the load fails
-                */
-            loadEnvironment(env: PBREnvironment, onSuccess?: (env: PBREnvironment) => void, onProgress?: (bytesLoaded: number, bytesTotal: number) => void, onError?: (e: any) => void): void;
-            /**
-                * Applies an `EnvironmentMapConfiguration` to the scene
-                * @param environmentMapConfiguration Environment map configuration to apply
-                */
-            applyEnvironmentMapConfiguration(rotationY?: number): void;
-            /**
-                * Get an environment asset url by using the configuration if the path is not absolute.
-                * @param url Asset url
-                * @returns The Asset url using the `environmentAssetsRootURL` if the url is not an absolute path.
-                */
-            getAssetUrl(url: string): string;
-            rotateShadowLight(shadowLight: ShadowLight, amount: number, point?: Vector3, axis?: Vector3, target?: Vector3): void;
-    }
-}
-
 declare module 'babylonjs-viewer/configuration/interfaces/cameraConfiguration' {
     export interface ICameraConfiguration {
         position?: {

+ 1 - 1
package.json

@@ -9,7 +9,7 @@
     ],
     "name": "babylonjs",
     "description": "Babylon.js is a JavaScript 3D engine based on webgl.",
-    "version": "3.3.0-rc.1",
+    "version": "3.3.0-rc.2",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"

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

@@ -475,7 +475,7 @@
          * Returns the current version of the framework
          */
         public static get Version(): string {
-            return "3.3.0-rc.1";
+            return "3.3.0-rc.2";
         }
 
         // Updatable statics so stick with vars here

+ 28 - 0
src/Mesh/babylon.buffer.ts

@@ -1,4 +1,7 @@
 module BABYLON {
+    /**
+     * Class used to store data that will be store in GPU memory
+     */
     export class Buffer {
         private _engine: Engine;
         private _buffer: Nullable<WebGLBuffer>;
@@ -61,14 +64,27 @@
         }
 
         // Properties
+
+        /**
+         * Gets a boolean indicating if the Buffer is updatable?
+         * @returns true if the buffer is updatable
+         */
         public isUpdatable(): boolean {
             return this._updatable;
         }
 
+        /**
+         * Gets current buffer's data
+         * @returns a DataArray or null
+         */
         public getData(): Nullable<DataArray> {
             return this._data;
         }
 
+        /**
+         * Gets underlying native buffer
+         * @returns underlying native buffer
+         */
         public getBuffer(): Nullable<WebGLBuffer> {
             return this._buffer;
         }
@@ -84,6 +100,11 @@
         }
 
         // Methods
+
+        /**
+         * Store data into the buffer. If the buffer was already used it will be either recreated or updated depending on isUpdatable property
+         * @param data defines the data to store
+         */
         public create(data: Nullable<DataArray> = null): void {
             if (!data && this._buffer) {
                 return; // nothing to do
@@ -114,6 +135,10 @@
             this.create(this._data);
         }
 
+        /**
+         * Update current buffer data
+         * @param data defines the data to store
+         */
         public update(data: DataArray): void {
             this.create(data);
         }
@@ -136,6 +161,9 @@
             }
         }
 
+        /**
+         * Release all resources
+         */
         public dispose(): void {
             if (!this._buffer) {
                 return;

+ 83 - 83
src/Mesh/babylon.vertexBuffer.ts

@@ -1,4 +1,7 @@
 module BABYLON {
+    /**
+     * Specialized buffer used to store vertex data
+     */
     export class VertexBuffer {
         /** @hidden */
         public _buffer: Buffer;
@@ -148,37 +151,44 @@
         }
 
         /**
-         * Returns the kind of the VertexBuffer (string).  
+         * Returns the kind of the VertexBuffer (string)
+         * @returns a string
          */
         public getKind(): string {
             return this._kind;
         }
 
         // Properties
+
         /**
-         * Boolean : is the VertexBuffer updatable ?
+         * Gets a boolean indicating if the VertexBuffer is updatable?
+         * @returns true if the buffer is updatable
          */
         public isUpdatable(): boolean {
             return this._buffer.isUpdatable();
         }
 
         /**
-         * Returns an array of numbers or a typed array containing the VertexBuffer data.  
+         * Gets current buffer's data
+         * @returns a DataArray or null
          */
         public getData(): Nullable<DataArray> {
             return this._buffer.getData();
         }
 
         /**
-         * Returns the WebGLBuffer associated to the VertexBuffer.  
+         * Gets underlying native buffer
+         * @returns underlying native buffer
          */
         public getBuffer(): Nullable<WebGLBuffer> {
             return this._buffer.getBuffer();
         }
 
         /**
-         * Returns the stride as a multiple of the type byte length.
+         * Gets the stride in float32 units (i.e. byte stride / 4).
+         * May not be an integer if the byte stride is not divisible by 4.
          * DEPRECATED. Use byteStride instead.
+         * @returns the stride in float32 units
          */
         public getStrideSize(): number {
             return this.byteStride / VertexBuffer.GetTypeByteLength(this.type);
@@ -187,20 +197,23 @@
         /**
          * Returns the offset as a multiple of the type byte length.
          * DEPRECATED. Use byteOffset instead.
+         * @returns the offset in bytes
          */
         public getOffset(): number {
             return this.byteOffset / VertexBuffer.GetTypeByteLength(this.type);
         }
 
         /**
-         * Returns the number of components per vertex attribute (integer).  
+         * Returns the number of components per vertex attribute (integer)
+         * @returns the size in float 
          */
         public getSize(): number {
             return this._size;
         }
 
         /**
-         * Boolean : is the WebGLBuffer of the VertexBuffer instanced now ?
+         * Gets a boolean indicating is the internal buffer of the VertexBuffer is instanced
+         * @returns true if this buffer is instanced
          */
         public getIsInstanced(): boolean {
             return this._instanced;
@@ -208,6 +221,7 @@
 
         /**
          * Returns the instancing divisor, zero for non-instanced (integer).  
+         * @returns a number
          */
         public getInstanceDivisor(): number {
             return this._instanceDivisor;
@@ -216,20 +230,20 @@
         // Methods
 
         /**
-         * Creates the underlying WebGLBuffer from the passed numeric array or Float32Array.  
-         * Returns the created WebGLBuffer.   
+         * Store data into the buffer. If the buffer was already used it will be either recreated or updated depending on isUpdatable property
+         * @param data defines the data to store
          */
         public create(data?: DataArray): void {
-            return this._buffer.create(data);
+            this._buffer.create(data);
         }
 
         /**
-         * Updates the underlying WebGLBuffer according to the passed numeric array or Float32Array.  
+         * Updates the underlying buffer according to the passed numeric array or Float32Array.  
          * This function will create a new buffer if the current one is not updatable
-         * Returns the updated WebGLBuffer.  
+         * @param data defines the data to store 
          */
         public update(data: DataArray): void {
-            return this._buffer.update(data);
+            this._buffer.update(data);
         }
 
         /**
@@ -262,76 +276,62 @@
         }
 
         // Enums
-        private static _PositionKind = "position";
-        private static _NormalKind = "normal";
-        private static _TangentKind = "tangent";
-        private static _UVKind = "uv";
-        private static _UV2Kind = "uv2";
-        private static _UV3Kind = "uv3";
-        private static _UV4Kind = "uv4";
-        private static _UV5Kind = "uv5";
-        private static _UV6Kind = "uv6";
-        private static _ColorKind = "color";
-        private static _MatricesIndicesKind = "matricesIndices";
-        private static _MatricesWeightsKind = "matricesWeights";
-        private static _MatricesIndicesExtraKind = "matricesIndicesExtra";
-        private static _MatricesWeightsExtraKind = "matricesWeightsExtra";
-
-        public static get PositionKind(): string {
-            return VertexBuffer._PositionKind;
-        }
-
-        public static get NormalKind(): string {
-            return VertexBuffer._NormalKind;
-        }
-
-        public static get TangentKind(): string {
-            return VertexBuffer._TangentKind;
-        }
-
-        public static get UVKind(): string {
-            return VertexBuffer._UVKind;
-        }
-
-        public static get UV2Kind(): string {
-            return VertexBuffer._UV2Kind;
-        }
-
-        public static get UV3Kind(): string {
-            return VertexBuffer._UV3Kind;
-        }
-
-        public static get UV4Kind(): string {
-            return VertexBuffer._UV4Kind;
-        }
-
-        public static get UV5Kind(): string {
-            return VertexBuffer._UV5Kind;
-        }
-
-        public static get UV6Kind(): string {
-            return VertexBuffer._UV6Kind;
-        }
-
-        public static get ColorKind(): string {
-            return VertexBuffer._ColorKind;
-        }
-
-        public static get MatricesIndicesKind(): string {
-            return VertexBuffer._MatricesIndicesKind;
-        }
-
-        public static get MatricesWeightsKind(): string {
-            return VertexBuffer._MatricesWeightsKind;
-        }
-
-        public static get MatricesIndicesExtraKind(): string {
-            return VertexBuffer._MatricesIndicesExtraKind;
-        }
-
-        public static get MatricesWeightsExtraKind(): string {
-            return VertexBuffer._MatricesWeightsExtraKind;
-        }
+        /**
+         * Positions
+         */
+        public static readonly PositionKind = "position";
+        /**
+         * Normals
+         */
+        public static readonly NormalKind = "normal";
+        /**
+         * Tangents
+         */
+        public static readonly TangentKind = "tangent";
+        /**
+         * Texture coordinates
+         */
+        public static readonly UVKind = "uv";
+        /**
+         * Texture coordinates 2
+         */
+        public static readonly UV2Kind = "uv2";
+        /**
+         * Texture coordinates 3
+         */
+        public static readonly UV3Kind = "uv3";
+        /**
+         * Texture coordinates 4
+         */
+        public static readonly UV4Kind = "uv4";
+        /**
+         * Texture coordinates 5
+         */
+        public static readonly UV5Kind = "uv5";
+        /**
+         * Texture coordinates 6
+         */
+        public static readonly UV6Kind = "uv6";
+        /**
+         * Colors
+         */
+        public static readonly ColorKind = "color";
+        /**
+         * Matrix indices (for bones)
+         */
+        public static readonly MatricesIndicesKind = "matricesIndices";
+        /**
+         * Matrix weights (for bones)
+         */
+        public static readonly MatricesWeightsKind = "matricesWeights";
+        /**
+         * Additional matrix indices (for bones)
+         */
+        public static readonly MatricesIndicesExtraKind = "matricesIndicesExtra";
+        /**
+         * Additional matrix weights (for bones)
+         */
+        public static readonly MatricesWeightsExtraKind = "matricesWeightsExtra";
 
         /**
          * Deduces the stride given a kind.