David Catuhe 7 år sedan
förälder
incheckning
9b617eba15

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 20440 - 19380
Playground/babylon.d.txt


+ 2 - 1
Tools/Gulp/package.json

@@ -65,6 +65,7 @@
     },
     "dependencies": {
         "dts-bundle": "^0.7.3",
-        "gulp-clean": "^0.4.0"
+        "gulp-clean": "^0.4.0",
+        "npm": "^5.8.0"
     }
 }

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


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


+ 5 - 0
dist/preview release/babylon.max.js

@@ -87550,6 +87550,9 @@ var BABYLON;
             }
             else if (this._vrDeviceOrientationCamera) {
                 this._vrDeviceOrientationCamera.position = this._position;
+                if (this._scene.activeCamera) {
+                    this._vrDeviceOrientationCamera.minZ = this._scene.activeCamera.minZ;
+                }
                 this._scene.activeCamera = this._vrDeviceOrientationCamera;
                 this._scene.getEngine().switchFullscreen(true);
                 this.updateButtonVisibility();
@@ -87594,6 +87597,8 @@ var BABYLON;
             if (this._interactionsEnabled) {
                 this._scene.unregisterBeforeRender(this.beforeRender);
             }
+            // resize to update width and height when exiting vr exits fullscreen
+            this._scene.getEngine().resize();
         };
         Object.defineProperty(VRExperienceHelper.prototype, "position", {
             /**

+ 5 - 0
dist/preview release/babylon.no-module.max.js

@@ -87517,6 +87517,9 @@ var BABYLON;
             }
             else if (this._vrDeviceOrientationCamera) {
                 this._vrDeviceOrientationCamera.position = this._position;
+                if (this._scene.activeCamera) {
+                    this._vrDeviceOrientationCamera.minZ = this._scene.activeCamera.minZ;
+                }
                 this._scene.activeCamera = this._vrDeviceOrientationCamera;
                 this._scene.getEngine().switchFullscreen(true);
                 this.updateButtonVisibility();
@@ -87561,6 +87564,8 @@ var BABYLON;
             if (this._interactionsEnabled) {
                 this._scene.unregisterBeforeRender(this.beforeRender);
             }
+            // resize to update width and height when exiting vr exits fullscreen
+            this._scene.getEngine().resize();
         };
         Object.defineProperty(VRExperienceHelper.prototype, "position", {
             /**

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


+ 5 - 0
dist/preview release/es6.js

@@ -87517,6 +87517,9 @@ var BABYLON;
             }
             else if (this._vrDeviceOrientationCamera) {
                 this._vrDeviceOrientationCamera.position = this._position;
+                if (this._scene.activeCamera) {
+                    this._vrDeviceOrientationCamera.minZ = this._scene.activeCamera.minZ;
+                }
                 this._scene.activeCamera = this._vrDeviceOrientationCamera;
                 this._scene.getEngine().switchFullscreen(true);
                 this.updateButtonVisibility();
@@ -87561,6 +87564,8 @@ var BABYLON;
             if (this._interactionsEnabled) {
                 this._scene.unregisterBeforeRender(this.beforeRender);
             }
+            // resize to update width and height when exiting vr exits fullscreen
+            this._scene.getEngine().resize();
         };
         Object.defineProperty(VRExperienceHelper.prototype, "position", {
             /**

+ 168 - 6
dist/preview release/loaders/babylon.glTF1FileLoader.d.ts

@@ -1,5 +1,8 @@
 
 declare module BABYLON {
+    /**
+    * Coordinate system mode that will be used when loading from the gltf file
+    */
     enum GLTFLoaderCoordinateSystemMode {
         /**
          * Automatically convert the glTF right-handed data to the appropriate system based on the current coordinate system mode of the scene.
@@ -10,6 +13,9 @@ declare module BABYLON {
          */
         FORCE_RIGHT_HANDED = 1,
     }
+    /**
+    * Animation mode that determines which animations should be started when a file is loaded
+    */
     enum GLTFLoaderAnimationStartMode {
         /**
          * No animation will start.
@@ -24,10 +30,22 @@ declare module BABYLON {
          */
         ALL = 2,
     }
+    /**
+    * Loaded gltf data
+    */
     interface IGLTFLoaderData {
+        /**
+        * Loaded json string converted to an object
+        */
         json: Object;
+        /**
+        * Loaded ArrayBufferView
+        */
         bin: Nullable<ArrayBufferView>;
     }
+    /**
+    * Gltf extension interface
+    */
     interface IGLTFLoaderExtension {
         /**
          * The name of this extension.
@@ -38,6 +56,9 @@ declare module BABYLON {
          */
         enabled: boolean;
     }
+    /**
+    * Loading state
+    */
     enum GLTFLoaderState {
         /**
          * The asset is loading.
@@ -52,29 +73,77 @@ declare module BABYLON {
          */
         COMPLETE = 2,
     }
+    /**
+    * GLTF loader interface
+    */
     interface IGLTFLoader extends IDisposable {
+        /**
+        * Coordinate system that will be used when loading from the gltf file
+        */
         coordinateSystemMode: GLTFLoaderCoordinateSystemMode;
+        /**
+        * Animation mode that determines which animations should be started when a file is loaded
+        */
         animationStartMode: GLTFLoaderAnimationStartMode;
+        /**
+        * If the materials in the file should automatically be compiled
+        */
         compileMaterials: boolean;
+        /**
+        * If a clip plane should be usede when loading meshes in the file
+        */
         useClipPlane: boolean;
+        /**
+        * If shadow generators should automatically be compiled
+        */
         compileShadowGenerators: boolean;
+        /**
+        * Observable that fires each time a mesh is loaded
+        */
         onMeshLoadedObservable: Observable<AbstractMesh>;
+        /**
+        * Observable that fires each time a texture is loaded
+        */
         onTextureLoadedObservable: Observable<BaseTexture>;
+        /**
+       * Observable that fires each time a material is loaded
+       */
         onMaterialLoadedObservable: Observable<Material>;
+        /**
+        * Observable that fires when the load has completed
+        */
         onCompleteObservable: Observable<IGLTFLoader>;
+        /**
+        * Observable that fires when the loader is disposed
+        */
         onDisposeObservable: Observable<IGLTFLoader>;
+        /**
+        * Observable that fire when an extension is loaded
+        */
         onExtensionLoadedObservable: Observable<IGLTFLoaderExtension>;
+        /**
+        * Loader state
+        */
         state: Nullable<GLTFLoaderState>;
+        /**
+        * Imports one or more meshes from a loaded gltf file and adds them to the scene
+        */
         importMeshAsync: (meshesNames: any, scene: Scene, data: IGLTFLoaderData, rootUrl: string, onProgress?: (event: SceneLoaderProgressEvent) => void) => Promise<{
             meshes: AbstractMesh[];
             particleSystems: ParticleSystem[];
             skeletons: Skeleton[];
             animationGroups: AnimationGroup[];
         }>;
+        /**
+        * Imports all objects from a loaded gltf file and adds them to the scene
+        */
         loadAsync: (scene: Scene, data: IGLTFLoaderData, rootUrl: string, onProgress?: (event: SceneLoaderProgressEvent) => void) => Promise<void>;
     }
+    /** File loader to load gltf files into a babylon scene */
     class GLTFFileLoader implements IDisposable, ISceneLoaderPluginAsync, ISceneLoaderPluginFactory {
+        /** Creates a gltf 1.0 file loader */
         static CreateGLTFLoaderV1: () => IGLTFLoader;
+        /** Creates a gltf 2.0 file loader */
         static CreateGLTFLoaderV2: () => IGLTFLoader;
         /**
          * Raised when the asset has been parsed.
@@ -83,27 +152,39 @@ declare module BABYLON {
          */
         onParsedObservable: Observable<IGLTFLoaderData>;
         private _onParsedObserver;
+        /** Raised when the asset has been parsed. */
         onParsed: (loaderData: IGLTFLoaderData) => void;
+        /**
+         * Set this property to false to disable incremental loading which delays the loader from calling the success callback until after loading the meshes and shaders. Textures always loads asynchronously. For example, the success callback can compute the bounding information of the loaded meshes when incremental loading is disabled. Defaults to true.
+         */
         static IncrementalLoading: boolean;
+        /**
+         * Set this property to true in order to work with homogeneous coordinates, available with some converters and exporters. Defaults to false. See https://en.wikipedia.org/wiki/Homogeneous_coordinates
+         */
         static HomogeneousCoordinates: boolean;
         /**
-         * The coordinate system mode (AUTO, FORCE_RIGHT_HANDED).
+         * The coordinate system mode (AUTO, FORCE_RIGHT_HANDED). Defaults to AUTO.
+         * - AUTO - Automatically convert the glTF right-handed data to the appropriate system based on the current coordinate system mode of the scene.
+         * - FORCE_RIGHT_HANDED - Sets the useRightHandedSystem flag on the scene.
          */
         coordinateSystemMode: GLTFLoaderCoordinateSystemMode;
         /**
-         * The animation start mode (NONE, FIRST, ALL).
-         */
+        * The animation start mode (NONE, FIRST, ALL). Defaults to FIRST.
+        * - NONE - No animation will start.
+        * - FIRST - The first animation will start.
+        * - ALL - All animations will start.
+        */
         animationStartMode: GLTFLoaderAnimationStartMode;
         /**
-         * Set to true to compile materials before raising the success callback.
+         * Set to true to compile materials before raising the success callback. Defaults to false.
          */
         compileMaterials: boolean;
         /**
-         * Set to true to also compile materials with clip planes.
+         * Set to true to also compile materials with clip planes. Defaults to false.
          */
         useClipPlane: boolean;
         /**
-         * Set to true to compile shadow generators before raising the success callback.
+         * Set to true to compile shadow generators before raising the success callback. Defaults to false.
          */
         compileShadowGenerators: boolean;
         /**
@@ -111,18 +192,27 @@ declare module BABYLON {
          */
         readonly onMeshLoadedObservable: Observable<AbstractMesh>;
         private _onMeshLoadedObserver;
+        /**
+         * Raised when the loader creates a mesh after parsing the glTF properties of the mesh. (onMeshLoadedObservable is likely desired instead.)
+         */
         onMeshLoaded: (mesh: AbstractMesh) => void;
         /**
          * Raised when the loader creates a texture after parsing the glTF properties of the texture.
          */
         readonly onTextureLoadedObservable: Observable<BaseTexture>;
         private _onTextureLoadedObserver;
+        /**
+         * Method called when a texture has been loaded (onTextureLoadedObservable is likely desired instead.)
+         */
         onTextureLoaded: (texture: BaseTexture) => void;
         /**
          * Raised when the loader creates a material after parsing the glTF properties of the material.
          */
         readonly onMaterialLoadedObservable: Observable<Material>;
         private _onMaterialLoadedObserver;
+        /**
+         * Method when the loader creates a material after parsing the glTF properties of the material. (onMaterialLoadedObservable is likely desired instead.)
+         */
         onMaterialLoaded: (material: Material) => void;
         /**
          * Raised when the asset is completely loaded, immediately before the loader is disposed.
@@ -131,12 +221,18 @@ declare module BABYLON {
          */
         readonly onCompleteObservable: Observable<GLTFFileLoader>;
         private _onCompleteObserver;
+        /**
+         * Raised when the asset is completely loaded, immediately before the loader is disposed. (onCompleteObservable is likely desired instead.)
+         */
         onComplete: () => void;
         /**
         * Raised after the loader is disposed.
         */
         readonly onDisposeObservable: Observable<GLTFFileLoader>;
         private _onDisposeObserver;
+        /**
+         * Raised after the loader is disposed. (onDisposeObservable is likely desired instead.)
+         */
         onDispose: () => void;
         /**
          * Raised after a loader extension is created.
@@ -144,6 +240,9 @@ declare module BABYLON {
          */
         readonly onExtensionLoadedObservable: Observable<IGLTFLoaderExtension>;
         private _onExtensionLoadedObserver;
+        /**
+         * Raised after a loader extension is created. (onExtensionLoadedObservable is likely desired instead.)
+         */
         onExtensionLoaded: (extension: IGLTFLoaderExtension) => void;
         /**
          * Returns a promise that resolves when the asset is completely loaded.
@@ -155,22 +254,65 @@ declare module BABYLON {
          */
         readonly loaderState: Nullable<GLTFLoaderState>;
         private _loader;
+        /**
+         * Name of the loader ("gltf")
+         */
         name: string;
+        /**
+         * Supported file extensions of the loader (.gltf, .glb)
+         */
         extensions: ISceneLoaderPluginExtensions;
         /**
          * Disposes the loader, releases resources during load, and cancels any outstanding requests.
          */
         dispose(): void;
+        /**
+        * Imports one or more meshes from a loaded gltf file and adds them to the scene
+        * @param meshesNames a string or array of strings of the mesh names that should be loaded from the file
+        * @param scene the scene the meshes should be added to
+        * @param data gltf data containing information of the meshes in a loaded file
+        * @param rootUrl root url to load from
+        * @param onProgress event that fires when loading progress has occured
+        * @returns a promise containg the loaded meshes, particles, skeletons and animations
+        */
         importMeshAsync(meshesNames: any, scene: Scene, data: any, rootUrl: string, onProgress?: (event: SceneLoaderProgressEvent) => void): Promise<{
             meshes: AbstractMesh[];
             particleSystems: ParticleSystem[];
             skeletons: Skeleton[];
             animationGroups: AnimationGroup[];
         }>;
+        /**
+        * Imports all objects from a loaded gltf file and adds them to the scene
+        * @param scene the scene the objects should be added to
+        * @param data gltf data containing information of the meshes in a loaded file
+        * @param rootUrl root url to load from
+        * @param onProgress event that fires when loading progress has occured
+        * @returns a promise which completes when objects have been loaded to the scene
+        */
         loadAsync(scene: Scene, data: string | ArrayBuffer, rootUrl: string, onProgress?: (event: SceneLoaderProgressEvent) => void): Promise<void>;
+        /**
+         * Load into an asset container.
+         * @param scene The scene to load into
+         * @param data The data to import
+         * @param rootUrl The root url for scene and resources
+         * @param onProgress The callback when the load progresses
+         * @returns The loaded asset container
+         */
         loadAssetContainerAsync(scene: Scene, data: string | ArrayBuffer, rootUrl: string, onProgress?: (event: SceneLoaderProgressEvent) => void): Promise<AssetContainer>;
+        /**
+         * If the data string can be loaded directly
+         * @param data string contianing the file data
+         * @returns if the data can be loaded directly
+         */
         canDirectLoad(data: string): boolean;
+        /**
+         * Rewrites a url by combining a root url and response url
+         */
         rewriteRootURL: (rootUrl: string, responseURL?: string) => string;
+        /**
+         * Instantiates a gltf file loader plugin
+         * @returns the created plugin
+         */
         createPlugin(): ISceneLoaderPlugin | ISceneLoaderPluginAsync;
         private _parse(data);
         private _getLoader(loaderData);
@@ -587,9 +729,21 @@ declare module BABYLON.GLTF1 {
         onMaterialLoadedObservable: Observable<Material>;
         onCompleteObservable: Observable<IGLTFLoader>;
         onExtensionLoadedObservable: Observable<IGLTFLoaderExtension>;
+        /**
+        * State of the loader
+        */
         state: Nullable<GLTFLoaderState>;
         dispose(): void;
         private _importMeshAsync(meshesNames, scene, data, rootUrl, onSuccess, onProgress?, onError?);
+        /**
+        * Imports one or more meshes from a loaded gltf file and adds them to the scene
+        * @param meshesNames a string or array of strings of the mesh names that should be loaded from the file
+        * @param scene the scene the meshes should be added to
+        * @param data gltf data containing information of the meshes in a loaded file
+        * @param rootUrl root url to load from
+        * @param onProgress event that fires when loading progress has occured
+        * @returns a promise containg the loaded meshes, particles, skeletons and animations
+        */
         importMeshAsync(meshesNames: any, scene: Scene, data: IGLTFLoaderData, rootUrl: string, onProgress?: (event: SceneLoaderProgressEvent) => void): Promise<{
             meshes: AbstractMesh[];
             particleSystems: ParticleSystem[];
@@ -597,6 +751,14 @@ declare module BABYLON.GLTF1 {
             animationGroups: AnimationGroup[];
         }>;
         private _loadAsync(scene, data, rootUrl, onSuccess, onProgress?, onError?);
+        /**
+        * Imports all objects from a loaded gltf file and adds them to the scene
+        * @param scene the scene the objects should be added to
+        * @param data gltf data containing information of the meshes in a loaded file
+        * @param rootUrl root url to load from
+        * @param onProgress event that fires when loading progress has occured
+        * @returns a promise which completes when objects have been loaded to the scene
+        */
         loadAsync(scene: Scene, data: IGLTFLoaderData, rootUrl: string, onProgress?: (event: SceneLoaderProgressEvent) => void): Promise<void>;
         private _loadShadersAsync(gltfRuntime, onload);
         private _loadBuffersAsync(gltfRuntime, onLoad, onProgress?);

+ 106 - 6
dist/preview release/loaders/babylon.glTF1FileLoader.js

@@ -1,6 +1,9 @@
 /// <reference path="../../../dist/preview release/babylon.d.ts"/>
 var BABYLON;
 (function (BABYLON) {
+    /**
+    * Coordinate system mode that will be used when loading from the gltf file
+    */
     var GLTFLoaderCoordinateSystemMode;
     (function (GLTFLoaderCoordinateSystemMode) {
         /**
@@ -12,6 +15,9 @@ var BABYLON;
          */
         GLTFLoaderCoordinateSystemMode[GLTFLoaderCoordinateSystemMode["FORCE_RIGHT_HANDED"] = 1] = "FORCE_RIGHT_HANDED";
     })(GLTFLoaderCoordinateSystemMode = BABYLON.GLTFLoaderCoordinateSystemMode || (BABYLON.GLTFLoaderCoordinateSystemMode = {}));
+    /**
+    * Animation mode that determines which animations should be started when a file is loaded
+    */
     var GLTFLoaderAnimationStartMode;
     (function (GLTFLoaderAnimationStartMode) {
         /**
@@ -27,6 +33,9 @@ var BABYLON;
          */
         GLTFLoaderAnimationStartMode[GLTFLoaderAnimationStartMode["ALL"] = 2] = "ALL";
     })(GLTFLoaderAnimationStartMode = BABYLON.GLTFLoaderAnimationStartMode || (BABYLON.GLTFLoaderAnimationStartMode = {}));
+    /**
+    * Loading state
+    */
     var GLTFLoaderState;
     (function (GLTFLoaderState) {
         /**
@@ -42,6 +51,7 @@ var BABYLON;
          */
         GLTFLoaderState[GLTFLoaderState["COMPLETE"] = 2] = "COMPLETE";
     })(GLTFLoaderState = BABYLON.GLTFLoaderState || (BABYLON.GLTFLoaderState = {}));
+    /** File loader to load gltf files into a babylon scene */
     var GLTFFileLoader = /** @class */ (function () {
         function GLTFFileLoader() {
             // #region Common options
@@ -54,23 +64,28 @@ var BABYLON;
             // #endregion
             // #region V2 options
             /**
-             * The coordinate system mode (AUTO, FORCE_RIGHT_HANDED).
+             * The coordinate system mode (AUTO, FORCE_RIGHT_HANDED). Defaults to AUTO.
+             * - AUTO - Automatically convert the glTF right-handed data to the appropriate system based on the current coordinate system mode of the scene.
+             * - FORCE_RIGHT_HANDED - Sets the useRightHandedSystem flag on the scene.
              */
             this.coordinateSystemMode = GLTFLoaderCoordinateSystemMode.AUTO;
             /**
-             * The animation start mode (NONE, FIRST, ALL).
-             */
+            * The animation start mode (NONE, FIRST, ALL). Defaults to FIRST.
+            * - NONE - No animation will start.
+            * - FIRST - The first animation will start.
+            * - ALL - All animations will start.
+            */
             this.animationStartMode = GLTFLoaderAnimationStartMode.FIRST;
             /**
-             * Set to true to compile materials before raising the success callback.
+             * Set to true to compile materials before raising the success callback. Defaults to false.
              */
             this.compileMaterials = false;
             /**
-             * Set to true to also compile materials with clip planes.
+             * Set to true to also compile materials with clip planes. Defaults to false.
              */
             this.useClipPlane = false;
             /**
-             * Set to true to compile shadow generators before raising the success callback.
+             * Set to true to compile shadow generators before raising the success callback. Defaults to false.
              */
             this.compileShadowGenerators = false;
             /**
@@ -102,13 +117,20 @@ var BABYLON;
             this.onExtensionLoadedObservable = new BABYLON.Observable();
             // #endregion
             this._loader = null;
+            /**
+             * Name of the loader ("gltf")
+             */
             this.name = "gltf";
+            /**
+             * Supported file extensions of the loader (.gltf, .glb)
+             */
             this.extensions = {
                 ".gltf": { isBinary: false },
                 ".glb": { isBinary: true }
             };
         }
         Object.defineProperty(GLTFFileLoader.prototype, "onParsed", {
+            /** Raised when the asset has been parsed. */
             set: function (callback) {
                 if (this._onParsedObserver) {
                     this.onParsedObservable.remove(this._onParsedObserver);
@@ -119,6 +141,9 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(GLTFFileLoader.prototype, "onMeshLoaded", {
+            /**
+             * Raised when the loader creates a mesh after parsing the glTF properties of the mesh. (onMeshLoadedObservable is likely desired instead.)
+             */
             set: function (callback) {
                 if (this._onMeshLoadedObserver) {
                     this.onMeshLoadedObservable.remove(this._onMeshLoadedObserver);
@@ -129,6 +154,9 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(GLTFFileLoader.prototype, "onTextureLoaded", {
+            /**
+             * Method called when a texture has been loaded (onTextureLoadedObservable is likely desired instead.)
+             */
             set: function (callback) {
                 if (this._onTextureLoadedObserver) {
                     this.onTextureLoadedObservable.remove(this._onTextureLoadedObserver);
@@ -139,6 +167,9 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(GLTFFileLoader.prototype, "onMaterialLoaded", {
+            /**
+             * Method when the loader creates a material after parsing the glTF properties of the material. (onMaterialLoadedObservable is likely desired instead.)
+             */
             set: function (callback) {
                 if (this._onMaterialLoadedObserver) {
                     this.onMaterialLoadedObservable.remove(this._onMaterialLoadedObserver);
@@ -149,6 +180,9 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(GLTFFileLoader.prototype, "onComplete", {
+            /**
+             * Raised when the asset is completely loaded, immediately before the loader is disposed. (onCompleteObservable is likely desired instead.)
+             */
             set: function (callback) {
                 if (this._onCompleteObserver) {
                     this.onCompleteObservable.remove(this._onCompleteObserver);
@@ -159,6 +193,9 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(GLTFFileLoader.prototype, "onDispose", {
+            /**
+             * Raised after the loader is disposed. (onDisposeObservable is likely desired instead.)
+             */
             set: function (callback) {
                 if (this._onDisposeObserver) {
                     this.onDisposeObservable.remove(this._onDisposeObserver);
@@ -169,6 +206,9 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(GLTFFileLoader.prototype, "onExtensionLoaded", {
+            /**
+             * Raised after a loader extension is created. (onExtensionLoadedObservable is likely desired instead.)
+             */
             set: function (callback) {
                 if (this._onExtensionLoadedObserver) {
                     this.onExtensionLoadedObservable.remove(this._onExtensionLoadedObserver);
@@ -214,6 +254,15 @@ var BABYLON;
             this.onDisposeObservable.notifyObservers(this);
             this.onDisposeObservable.clear();
         };
+        /**
+        * Imports one or more meshes from a loaded gltf file and adds them to the scene
+        * @param meshesNames a string or array of strings of the mesh names that should be loaded from the file
+        * @param scene the scene the meshes should be added to
+        * @param data gltf data containing information of the meshes in a loaded file
+        * @param rootUrl root url to load from
+        * @param onProgress event that fires when loading progress has occured
+        * @returns a promise containg the loaded meshes, particles, skeletons and animations
+        */
         GLTFFileLoader.prototype.importMeshAsync = function (meshesNames, scene, data, rootUrl, onProgress) {
             var _this = this;
             return Promise.resolve().then(function () {
@@ -222,6 +271,14 @@ var BABYLON;
                 return _this._loader.importMeshAsync(meshesNames, scene, loaderData, rootUrl, onProgress);
             });
         };
+        /**
+        * Imports all objects from a loaded gltf file and adds them to the scene
+        * @param scene the scene the objects should be added to
+        * @param data gltf data containing information of the meshes in a loaded file
+        * @param rootUrl root url to load from
+        * @param onProgress event that fires when loading progress has occured
+        * @returns a promise which completes when objects have been loaded to the scene
+        */
         GLTFFileLoader.prototype.loadAsync = function (scene, data, rootUrl, onProgress) {
             var _this = this;
             return Promise.resolve().then(function () {
@@ -230,6 +287,14 @@ var BABYLON;
                 return _this._loader.loadAsync(scene, loaderData, rootUrl, onProgress);
             });
         };
+        /**
+         * Load into an asset container.
+         * @param scene The scene to load into
+         * @param data The data to import
+         * @param rootUrl The root url for scene and resources
+         * @param onProgress The callback when the load progresses
+         * @returns The loaded asset container
+         */
         GLTFFileLoader.prototype.loadAssetContainerAsync = function (scene, data, rootUrl, onProgress) {
             var _this = this;
             return Promise.resolve().then(function () {
@@ -246,9 +311,18 @@ var BABYLON;
                 });
             });
         };
+        /**
+         * If the data string can be loaded directly
+         * @param data string contianing the file data
+         * @returns if the data can be loaded directly
+         */
         GLTFFileLoader.prototype.canDirectLoad = function (data) {
             return ((data.indexOf("scene") !== -1) && (data.indexOf("node") !== -1));
         };
+        /**
+         * Instantiates a gltf file loader plugin
+         * @returns the created plugin
+         */
         GLTFFileLoader.prototype.createPlugin = function () {
             return new GLTFFileLoader();
         };
@@ -432,7 +506,13 @@ var BABYLON;
         };
         // #endregion
         // #region V1 options
+        /**
+         * Set this property to false to disable incremental loading which delays the loader from calling the success callback until after loading the meshes and shaders. Textures always loads asynchronously. For example, the success callback can compute the bounding information of the loaded meshes when incremental loading is disabled. Defaults to true.
+         */
         GLTFFileLoader.IncrementalLoading = true;
+        /**
+         * Set this property to true in order to work with homogeneous coordinates, available with some converters and exporters. Defaults to false. See https://en.wikipedia.org/wiki/Homogeneous_coordinates
+         */
         GLTFFileLoader.HomogeneousCoordinates = false;
         return GLTFFileLoader;
     }());
@@ -1869,6 +1949,9 @@ var BABYLON;
                 this.onMaterialLoadedObservable = new BABYLON.Observable();
                 this.onCompleteObservable = new BABYLON.Observable();
                 this.onExtensionLoadedObservable = new BABYLON.Observable();
+                /**
+                * State of the loader
+                */
                 this.state = null;
             }
             GLTFLoader.RegisterExtension = function (extension) {
@@ -1931,6 +2014,15 @@ var BABYLON;
                 }, onError);
                 return true;
             };
+            /**
+            * Imports one or more meshes from a loaded gltf file and adds them to the scene
+            * @param meshesNames a string or array of strings of the mesh names that should be loaded from the file
+            * @param scene the scene the meshes should be added to
+            * @param data gltf data containing information of the meshes in a loaded file
+            * @param rootUrl root url to load from
+            * @param onProgress event that fires when loading progress has occured
+            * @returns a promise containg the loaded meshes, particles, skeletons and animations
+            */
             GLTFLoader.prototype.importMeshAsync = function (meshesNames, scene, data, rootUrl, onProgress) {
                 var _this = this;
                 return new Promise(function (resolve, reject) {
@@ -1970,6 +2062,14 @@ var BABYLON;
                     }, onError);
                 }, onError);
             };
+            /**
+            * Imports all objects from a loaded gltf file and adds them to the scene
+            * @param scene the scene the objects should be added to
+            * @param data gltf data containing information of the meshes in a loaded file
+            * @param rootUrl root url to load from
+            * @param onProgress event that fires when loading progress has occured
+            * @returns a promise which completes when objects have been loaded to the scene
+            */
             GLTFLoader.prototype.loadAsync = function (scene, data, rootUrl, onProgress) {
                 var _this = this;
                 return new Promise(function (resolve, reject) {

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

@@ -1,5 +1,8 @@
 
 declare module BABYLON {
+    /**
+    * Coordinate system mode that will be used when loading from the gltf file
+    */
     enum GLTFLoaderCoordinateSystemMode {
         /**
          * Automatically convert the glTF right-handed data to the appropriate system based on the current coordinate system mode of the scene.
@@ -10,6 +13,9 @@ declare module BABYLON {
          */
         FORCE_RIGHT_HANDED = 1,
     }
+    /**
+    * Animation mode that determines which animations should be started when a file is loaded
+    */
     enum GLTFLoaderAnimationStartMode {
         /**
          * No animation will start.
@@ -24,10 +30,22 @@ declare module BABYLON {
          */
         ALL = 2,
     }
+    /**
+    * Loaded gltf data
+    */
     interface IGLTFLoaderData {
+        /**
+        * Loaded json string converted to an object
+        */
         json: Object;
+        /**
+        * Loaded ArrayBufferView
+        */
         bin: Nullable<ArrayBufferView>;
     }
+    /**
+    * Gltf extension interface
+    */
     interface IGLTFLoaderExtension {
         /**
          * The name of this extension.
@@ -38,6 +56,9 @@ declare module BABYLON {
          */
         enabled: boolean;
     }
+    /**
+    * Loading state
+    */
     enum GLTFLoaderState {
         /**
          * The asset is loading.
@@ -52,29 +73,77 @@ declare module BABYLON {
          */
         COMPLETE = 2,
     }
+    /**
+    * GLTF loader interface
+    */
     interface IGLTFLoader extends IDisposable {
+        /**
+        * Coordinate system that will be used when loading from the gltf file
+        */
         coordinateSystemMode: GLTFLoaderCoordinateSystemMode;
+        /**
+        * Animation mode that determines which animations should be started when a file is loaded
+        */
         animationStartMode: GLTFLoaderAnimationStartMode;
+        /**
+        * If the materials in the file should automatically be compiled
+        */
         compileMaterials: boolean;
+        /**
+        * If a clip plane should be usede when loading meshes in the file
+        */
         useClipPlane: boolean;
+        /**
+        * If shadow generators should automatically be compiled
+        */
         compileShadowGenerators: boolean;
+        /**
+        * Observable that fires each time a mesh is loaded
+        */
         onMeshLoadedObservable: Observable<AbstractMesh>;
+        /**
+        * Observable that fires each time a texture is loaded
+        */
         onTextureLoadedObservable: Observable<BaseTexture>;
+        /**
+       * Observable that fires each time a material is loaded
+       */
         onMaterialLoadedObservable: Observable<Material>;
+        /**
+        * Observable that fires when the load has completed
+        */
         onCompleteObservable: Observable<IGLTFLoader>;
+        /**
+        * Observable that fires when the loader is disposed
+        */
         onDisposeObservable: Observable<IGLTFLoader>;
+        /**
+        * Observable that fire when an extension is loaded
+        */
         onExtensionLoadedObservable: Observable<IGLTFLoaderExtension>;
+        /**
+        * Loader state
+        */
         state: Nullable<GLTFLoaderState>;
+        /**
+        * Imports one or more meshes from a loaded gltf file and adds them to the scene
+        */
         importMeshAsync: (meshesNames: any, scene: Scene, data: IGLTFLoaderData, rootUrl: string, onProgress?: (event: SceneLoaderProgressEvent) => void) => Promise<{
             meshes: AbstractMesh[];
             particleSystems: ParticleSystem[];
             skeletons: Skeleton[];
             animationGroups: AnimationGroup[];
         }>;
+        /**
+        * Imports all objects from a loaded gltf file and adds them to the scene
+        */
         loadAsync: (scene: Scene, data: IGLTFLoaderData, rootUrl: string, onProgress?: (event: SceneLoaderProgressEvent) => void) => Promise<void>;
     }
+    /** File loader to load gltf files into a babylon scene */
     class GLTFFileLoader implements IDisposable, ISceneLoaderPluginAsync, ISceneLoaderPluginFactory {
+        /** Creates a gltf 1.0 file loader */
         static CreateGLTFLoaderV1: () => IGLTFLoader;
+        /** Creates a gltf 2.0 file loader */
         static CreateGLTFLoaderV2: () => IGLTFLoader;
         /**
          * Raised when the asset has been parsed.
@@ -83,27 +152,39 @@ declare module BABYLON {
          */
         onParsedObservable: Observable<IGLTFLoaderData>;
         private _onParsedObserver;
+        /** Raised when the asset has been parsed. */
         onParsed: (loaderData: IGLTFLoaderData) => void;
+        /**
+         * Set this property to false to disable incremental loading which delays the loader from calling the success callback until after loading the meshes and shaders. Textures always loads asynchronously. For example, the success callback can compute the bounding information of the loaded meshes when incremental loading is disabled. Defaults to true.
+         */
         static IncrementalLoading: boolean;
+        /**
+         * Set this property to true in order to work with homogeneous coordinates, available with some converters and exporters. Defaults to false. See https://en.wikipedia.org/wiki/Homogeneous_coordinates
+         */
         static HomogeneousCoordinates: boolean;
         /**
-         * The coordinate system mode (AUTO, FORCE_RIGHT_HANDED).
+         * The coordinate system mode (AUTO, FORCE_RIGHT_HANDED). Defaults to AUTO.
+         * - AUTO - Automatically convert the glTF right-handed data to the appropriate system based on the current coordinate system mode of the scene.
+         * - FORCE_RIGHT_HANDED - Sets the useRightHandedSystem flag on the scene.
          */
         coordinateSystemMode: GLTFLoaderCoordinateSystemMode;
         /**
-         * The animation start mode (NONE, FIRST, ALL).
-         */
+        * The animation start mode (NONE, FIRST, ALL). Defaults to FIRST.
+        * - NONE - No animation will start.
+        * - FIRST - The first animation will start.
+        * - ALL - All animations will start.
+        */
         animationStartMode: GLTFLoaderAnimationStartMode;
         /**
-         * Set to true to compile materials before raising the success callback.
+         * Set to true to compile materials before raising the success callback. Defaults to false.
          */
         compileMaterials: boolean;
         /**
-         * Set to true to also compile materials with clip planes.
+         * Set to true to also compile materials with clip planes. Defaults to false.
          */
         useClipPlane: boolean;
         /**
-         * Set to true to compile shadow generators before raising the success callback.
+         * Set to true to compile shadow generators before raising the success callback. Defaults to false.
          */
         compileShadowGenerators: boolean;
         /**
@@ -111,18 +192,27 @@ declare module BABYLON {
          */
         readonly onMeshLoadedObservable: Observable<AbstractMesh>;
         private _onMeshLoadedObserver;
+        /**
+         * Raised when the loader creates a mesh after parsing the glTF properties of the mesh. (onMeshLoadedObservable is likely desired instead.)
+         */
         onMeshLoaded: (mesh: AbstractMesh) => void;
         /**
          * Raised when the loader creates a texture after parsing the glTF properties of the texture.
          */
         readonly onTextureLoadedObservable: Observable<BaseTexture>;
         private _onTextureLoadedObserver;
+        /**
+         * Method called when a texture has been loaded (onTextureLoadedObservable is likely desired instead.)
+         */
         onTextureLoaded: (texture: BaseTexture) => void;
         /**
          * Raised when the loader creates a material after parsing the glTF properties of the material.
          */
         readonly onMaterialLoadedObservable: Observable<Material>;
         private _onMaterialLoadedObserver;
+        /**
+         * Method when the loader creates a material after parsing the glTF properties of the material. (onMaterialLoadedObservable is likely desired instead.)
+         */
         onMaterialLoaded: (material: Material) => void;
         /**
          * Raised when the asset is completely loaded, immediately before the loader is disposed.
@@ -131,12 +221,18 @@ declare module BABYLON {
          */
         readonly onCompleteObservable: Observable<GLTFFileLoader>;
         private _onCompleteObserver;
+        /**
+         * Raised when the asset is completely loaded, immediately before the loader is disposed. (onCompleteObservable is likely desired instead.)
+         */
         onComplete: () => void;
         /**
         * Raised after the loader is disposed.
         */
         readonly onDisposeObservable: Observable<GLTFFileLoader>;
         private _onDisposeObserver;
+        /**
+         * Raised after the loader is disposed. (onDisposeObservable is likely desired instead.)
+         */
         onDispose: () => void;
         /**
          * Raised after a loader extension is created.
@@ -144,6 +240,9 @@ declare module BABYLON {
          */
         readonly onExtensionLoadedObservable: Observable<IGLTFLoaderExtension>;
         private _onExtensionLoadedObserver;
+        /**
+         * Raised after a loader extension is created. (onExtensionLoadedObservable is likely desired instead.)
+         */
         onExtensionLoaded: (extension: IGLTFLoaderExtension) => void;
         /**
          * Returns a promise that resolves when the asset is completely loaded.
@@ -155,22 +254,65 @@ declare module BABYLON {
          */
         readonly loaderState: Nullable<GLTFLoaderState>;
         private _loader;
+        /**
+         * Name of the loader ("gltf")
+         */
         name: string;
+        /**
+         * Supported file extensions of the loader (.gltf, .glb)
+         */
         extensions: ISceneLoaderPluginExtensions;
         /**
          * Disposes the loader, releases resources during load, and cancels any outstanding requests.
          */
         dispose(): void;
+        /**
+        * Imports one or more meshes from a loaded gltf file and adds them to the scene
+        * @param meshesNames a string or array of strings of the mesh names that should be loaded from the file
+        * @param scene the scene the meshes should be added to
+        * @param data gltf data containing information of the meshes in a loaded file
+        * @param rootUrl root url to load from
+        * @param onProgress event that fires when loading progress has occured
+        * @returns a promise containg the loaded meshes, particles, skeletons and animations
+        */
         importMeshAsync(meshesNames: any, scene: Scene, data: any, rootUrl: string, onProgress?: (event: SceneLoaderProgressEvent) => void): Promise<{
             meshes: AbstractMesh[];
             particleSystems: ParticleSystem[];
             skeletons: Skeleton[];
             animationGroups: AnimationGroup[];
         }>;
+        /**
+        * Imports all objects from a loaded gltf file and adds them to the scene
+        * @param scene the scene the objects should be added to
+        * @param data gltf data containing information of the meshes in a loaded file
+        * @param rootUrl root url to load from
+        * @param onProgress event that fires when loading progress has occured
+        * @returns a promise which completes when objects have been loaded to the scene
+        */
         loadAsync(scene: Scene, data: string | ArrayBuffer, rootUrl: string, onProgress?: (event: SceneLoaderProgressEvent) => void): Promise<void>;
+        /**
+         * Load into an asset container.
+         * @param scene The scene to load into
+         * @param data The data to import
+         * @param rootUrl The root url for scene and resources
+         * @param onProgress The callback when the load progresses
+         * @returns The loaded asset container
+         */
         loadAssetContainerAsync(scene: Scene, data: string | ArrayBuffer, rootUrl: string, onProgress?: (event: SceneLoaderProgressEvent) => void): Promise<AssetContainer>;
+        /**
+         * If the data string can be loaded directly
+         * @param data string contianing the file data
+         * @returns if the data can be loaded directly
+         */
         canDirectLoad(data: string): boolean;
+        /**
+         * Rewrites a url by combining a root url and response url
+         */
         rewriteRootURL: (rootUrl: string, responseURL?: string) => string;
+        /**
+         * Instantiates a gltf file loader plugin
+         * @returns the created plugin
+         */
         createPlugin(): ISceneLoaderPlugin | ISceneLoaderPluginAsync;
         private _parse(data);
         private _getLoader(loaderData);
@@ -185,48 +327,84 @@ declare module BABYLON {
 
 
 declare module BABYLON.GLTF2 {
+    /** Array item which contains it's index in an array */
     interface IArrayItem {
         _index: number;
     }
+    /** Array item helper methods */
     class ArrayItem {
+        /** Sets the index of each array element to its index in the array */
         static Assign(values?: IArrayItem[]): void;
     }
 }
 
 
 
+/**
+ * GLTF2 module for babylon
+ */
 declare module BABYLON.GLTF2 {
+    /**
+     * Interface to access data and vertex buffer associated with a file
+     */
     interface ILoaderAccessor extends IAccessor, IArrayItem {
         _data?: Promise<ArrayBufferView>;
         _babylonVertexBuffer?: Promise<VertexBuffer>;
     }
+    /**
+     * Loader's animation channel
+     */
     interface ILoaderAnimationChannel extends IAnimationChannel, IArrayItem {
     }
+    /**
+     * Container for animation keyframe data
+     */
     interface ILoaderAnimationSamplerData {
         input: Float32Array;
         interpolation: AnimationSamplerInterpolation;
         output: Float32Array;
     }
+    /**
+     * Keyframe data
+     */
     interface ILoaderAnimationSampler extends IAnimationSampler, IArrayItem {
         _data: Promise<ILoaderAnimationSamplerData>;
     }
+    /**
+     * Loader animation
+     */
     interface ILoaderAnimation extends IAnimation, IArrayItem {
         channels: ILoaderAnimationChannel[];
         samplers: ILoaderAnimationSampler[];
         _babylonAnimationGroup?: AnimationGroup;
     }
+    /**
+     * Loader buffer
+     */
     interface ILoaderBuffer extends IBuffer, IArrayItem {
         _data?: Promise<ArrayBufferView>;
     }
+    /**
+     * Loader's buffer data
+     */
     interface ILoaderBufferView extends IBufferView, IArrayItem {
         _data?: Promise<ArrayBufferView>;
         _babylonBuffer?: Promise<Buffer>;
     }
+    /**
+     * Loader's loaded camera data
+     */
     interface ILoaderCamera extends ICamera, IArrayItem {
     }
+    /**
+     * Loaded image specified by url
+     */
     interface ILoaderImage extends IImage, IArrayItem {
         _objectURL?: Promise<string>;
     }
+    /**
+     * Loaded material data
+     */
     interface ILoaderMaterial extends IMaterial, IArrayItem {
         _babylonData?: {
             [drawMode: number]: {
@@ -236,11 +414,20 @@ declare module BABYLON.GLTF2 {
             };
         };
     }
+    /**
+     * Loader mesh data
+     */
     interface ILoaderMesh extends IMesh, IArrayItem {
         primitives: ILoaderMeshPrimitive[];
     }
+    /**
+     * Loader mesh data
+     */
     interface ILoaderMeshPrimitive extends IMeshPrimitive, IArrayItem {
     }
+    /**
+     * Node for traversing loader data
+     */
     interface ILoaderNode extends INode, IArrayItem {
         _parent: ILoaderNode;
         _babylonMesh?: Mesh;
@@ -248,23 +435,41 @@ declare module BABYLON.GLTF2 {
         _babylonAnimationTargets?: Node[];
         _numMorphTargets?: number;
     }
+    /**
+     * Sampler data
+     */
     interface ILoaderSamplerData {
         noMipMaps: boolean;
         samplingMode: number;
         wrapU: number;
         wrapV: number;
     }
+    /**
+     * Sampler data
+     */
     interface ILoaderSampler extends ISampler, IArrayItem {
         _data?: ILoaderSamplerData;
     }
+    /**
+     * Loader's scene
+     */
     interface ILoaderScene extends IScene, IArrayItem {
     }
+    /**
+     * Loader's skeleton data
+     */
     interface ILoaderSkin extends ISkin, IArrayItem {
         _babylonSkeleton?: Skeleton;
         _loaded?: Promise<void>;
     }
+    /**
+     * Loader's texture
+     */
     interface ILoaderTexture extends ITexture, IArrayItem {
     }
+    /**
+     * Loaded GLTF data
+     */
     interface ILoaderGLTF extends IGLTF {
         accessors?: ILoaderAccessor[];
         animations?: ILoaderAnimation[];
@@ -283,14 +488,40 @@ declare module BABYLON.GLTF2 {
 }
 
 
+/**
+* Defines the GLTF2 module used to import/export GLTF 2.0 files
+*/
 declare module BABYLON.GLTF2 {
+    /**
+    * Interface for a meterial with a constructor
+    */
     interface MaterialConstructor<T extends Material> {
+        /**
+        * The material class
+        */
         readonly prototype: T;
+        /**
+        * Instatiates a material
+        * @param name name of the material
+        * @param scene the scene the material will be added to
+        */
         new (name: string, scene: Scene): T;
     }
+    /**
+    * Used to load from a GLTF2 file
+    */
     class GLTFLoader implements IGLTFLoader {
+        /**
+        * @ignore
+        */
         _gltf: ILoaderGLTF;
+        /**
+        * @ignore
+        */
         _babylonScene: Scene;
+        /**
+        * @ignore
+        */
         _completePromises: Promise<void>[];
         private _disposed;
         private _state;
@@ -303,26 +534,87 @@ declare module BABYLON.GLTF2 {
         private _requests;
         private static _Names;
         private static _Factories;
+        /**
+        * @ignore, registers the loader
+        * @param name name of the loader
+        * @param factory function that converts a loader to a loader extension
+        */
         static _Register(name: string, factory: (loader: GLTFLoader) => GLTFLoaderExtension): void;
+        /**
+        * Coordinate system that will be used when loading from the gltf file
+        */
         coordinateSystemMode: GLTFLoaderCoordinateSystemMode;
+        /**
+        * Animation mode that determines which animations should be started when a file is loaded
+        */
         animationStartMode: GLTFLoaderAnimationStartMode;
+        /**
+        * If the materials in the file should automatically be compiled
+        */
         compileMaterials: boolean;
+        /**
+        * If a clip plane should be usede when loading meshes in the file
+        */
         useClipPlane: boolean;
+        /**
+        * If shadow generators should automatically be compiled
+        */
         compileShadowGenerators: boolean;
+        /**
+        * Observable that fires when the loader is disposed
+        */
         readonly onDisposeObservable: Observable<IGLTFLoader>;
+        /**
+        * Observable that fires each time a mesh is loaded
+        */
         readonly onMeshLoadedObservable: Observable<AbstractMesh>;
+        /**
+        * Observable that fires each time a texture is loaded
+        */
         readonly onTextureLoadedObservable: Observable<BaseTexture>;
+        /**
+        * Observable that fires each time a material is loaded
+        */
         readonly onMaterialLoadedObservable: Observable<Material>;
+        /**
+        * Observable that fires each time an extension is loaded
+        */
         readonly onExtensionLoadedObservable: Observable<IGLTFLoaderExtension>;
+        /**
+        * Observable that fires when the load has completed
+        */
         readonly onCompleteObservable: Observable<IGLTFLoader>;
+        /**
+        * The current state of the loader
+        */
         readonly state: Nullable<GLTFLoaderState>;
+        /**
+        * Disposes of the loader
+        */
         dispose(): void;
+        /**
+        * Imports one or more meshes from a loaded gltf file and adds them to the scene
+        * @param meshesNames a string or array of strings of the mesh names that should be loaded from the file
+        * @param scene the scene the meshes should be added to
+        * @param data gltf data containing information of the meshes in a loaded file
+        * @param rootUrl root url to load from
+        * @param onProgress event that fires when loading progress has occured
+        * @returns a promise containg the loaded meshes, particles, skeletons and animations
+        */
         importMeshAsync(meshesNames: any, scene: Scene, data: IGLTFLoaderData, rootUrl: string, onProgress?: (event: SceneLoaderProgressEvent) => void): Promise<{
             meshes: AbstractMesh[];
             particleSystems: ParticleSystem[];
             skeletons: Skeleton[];
             animationGroups: AnimationGroup[];
         }>;
+        /**
+        * Imports all objects from a loaded gltf file and adds them to the scene
+        * @param scene the scene the objects should be added to
+        * @param data gltf data containing information of the meshes in a loaded file
+        * @param rootUrl root url to load from
+        * @param onProgress event that fires when loading progress has occured
+        * @returns a promise which completes when objects have been loaded to the scene
+        */
         loadAsync(scene: Scene, data: IGLTFLoaderData, rootUrl: string, onProgress?: (event: SceneLoaderProgressEvent) => void): Promise<void>;
         private _loadAsync(nodes, scene, data, rootUrl, onProgress?);
         private _loadExtensions();
@@ -331,12 +623,18 @@ declare module BABYLON.GLTF2 {
         private _checkExtensions();
         private _createRootNode();
         private _loadNodesAsync(nodes);
+        /**
+        * @ignore
+        */
         _loadSceneAsync(context: string, scene: ILoaderScene): Promise<void>;
         private _forEachPrimitive(node, callback);
         private _getMeshes();
         private _getSkeletons();
         private _getAnimationGroups();
         private _startAnimations();
+        /**
+        * @ignore
+        */
         _loadNodeAsync(context: string, node: ILoaderNode): Promise<void>;
         private _loadMeshAsync(context, node, mesh, babylonMesh);
         private _loadPrimitiveAsync(context, node, mesh, primitive, babylonMesh);
@@ -356,21 +654,48 @@ declare module BABYLON.GLTF2 {
         private _loadAnimationChannelAsync(context, animationContext, animation, channel, babylonAnimationGroup);
         private _loadAnimationSamplerAsync(context, sampler);
         private _loadBufferAsync(context, buffer);
+        /**
+        * @ignore
+        */
         _loadBufferViewAsync(context: string, bufferView: ILoaderBufferView): Promise<ArrayBufferView>;
         private _loadAccessorAsync(context, accessor);
+        /**
+        * @ignore
+        */
         _loadVertexBufferViewAsync(context: string, bufferView: ILoaderBufferView, kind: string): Promise<Buffer>;
         private _loadVertexAccessorAsync(context, accessor, kind);
         private _getDefaultMaterial(drawMode);
         private _loadMaterialMetallicRoughnessPropertiesAsync(context, material, babylonMaterial);
+        /**
+        * @ignore
+        */
         _loadMaterialAsync(context: string, material: ILoaderMaterial, babylonMesh: Mesh, babylonDrawMode: number, assign: (babylonMaterial: Material) => void): Promise<void>;
+        /**
+        * @ignore
+        */
         _createMaterial<T extends Material>(type: MaterialConstructor<T>, name: string, drawMode: number): T;
+        /**
+        * @ignore
+        */
         _loadMaterialBasePropertiesAsync(context: string, material: ILoaderMaterial, babylonMaterial: PBRMaterial): Promise<void>;
+        /**
+        * @ignore
+        */
         _loadMaterialAlphaProperties(context: string, material: ILoaderMaterial, babylonMaterial: PBRMaterial): void;
+        /**
+        * @ignore
+        */
         _loadTextureAsync(context: string, textureInfo: ITextureInfo, assign: (texture: Texture) => void): Promise<void>;
         private _loadSampler(context, sampler);
         private _loadImageAsync(context, image);
+        /**
+        * @ignore
+        */
         _loadUriAsync(context: string, uri: string): Promise<ArrayBufferView>;
         private _onProgress();
+        /**
+        * @ignore
+        */
         static _GetProperty<T>(context: string, array: ArrayLike<T> | undefined, index: number | undefined): T;
         private static _GetTextureWrapMode(context, mode);
         private static _GetTextureSamplingMode(context, magFilter?, minFilter?);
@@ -380,12 +705,18 @@ declare module BABYLON.GLTF2 {
         private _compileMaterialsAsync();
         private _compileShadowGeneratorsAsync();
         private _clear();
+        /**
+        * @ignore
+        */
         _applyExtensions<T>(actionAsync: (extension: GLTFLoaderExtension) => Nullable<Promise<T>>): Nullable<Promise<T>>;
     }
 }
 
 
 declare module BABYLON.GLTF2 {
+    /**
+     * Abstract class that can be implemented to extend existing gltf loader behavior.
+     */
     abstract class GLTFLoaderExtension implements IGLTFLoaderExtension, IDisposable {
         enabled: boolean;
         readonly abstract name: string;
@@ -440,6 +771,7 @@ declare module BABYLON.GLTF2.Extensions {
 }
 
 
+/** Module defining extensions to gltf */
 declare module BABYLON.GLTF2.Extensions {
     class KHR_draco_mesh_compression extends GLTFLoaderExtension {
         readonly name: string;

+ 198 - 6
dist/preview release/loaders/babylon.glTF2FileLoader.js

@@ -1,6 +1,9 @@
 /// <reference path="../../../dist/preview release/babylon.d.ts"/>
 var BABYLON;
 (function (BABYLON) {
+    /**
+    * Coordinate system mode that will be used when loading from the gltf file
+    */
     var GLTFLoaderCoordinateSystemMode;
     (function (GLTFLoaderCoordinateSystemMode) {
         /**
@@ -12,6 +15,9 @@ var BABYLON;
          */
         GLTFLoaderCoordinateSystemMode[GLTFLoaderCoordinateSystemMode["FORCE_RIGHT_HANDED"] = 1] = "FORCE_RIGHT_HANDED";
     })(GLTFLoaderCoordinateSystemMode = BABYLON.GLTFLoaderCoordinateSystemMode || (BABYLON.GLTFLoaderCoordinateSystemMode = {}));
+    /**
+    * Animation mode that determines which animations should be started when a file is loaded
+    */
     var GLTFLoaderAnimationStartMode;
     (function (GLTFLoaderAnimationStartMode) {
         /**
@@ -27,6 +33,9 @@ var BABYLON;
          */
         GLTFLoaderAnimationStartMode[GLTFLoaderAnimationStartMode["ALL"] = 2] = "ALL";
     })(GLTFLoaderAnimationStartMode = BABYLON.GLTFLoaderAnimationStartMode || (BABYLON.GLTFLoaderAnimationStartMode = {}));
+    /**
+    * Loading state
+    */
     var GLTFLoaderState;
     (function (GLTFLoaderState) {
         /**
@@ -42,6 +51,7 @@ var BABYLON;
          */
         GLTFLoaderState[GLTFLoaderState["COMPLETE"] = 2] = "COMPLETE";
     })(GLTFLoaderState = BABYLON.GLTFLoaderState || (BABYLON.GLTFLoaderState = {}));
+    /** File loader to load gltf files into a babylon scene */
     var GLTFFileLoader = /** @class */ (function () {
         function GLTFFileLoader() {
             // #region Common options
@@ -54,23 +64,28 @@ var BABYLON;
             // #endregion
             // #region V2 options
             /**
-             * The coordinate system mode (AUTO, FORCE_RIGHT_HANDED).
+             * The coordinate system mode (AUTO, FORCE_RIGHT_HANDED). Defaults to AUTO.
+             * - AUTO - Automatically convert the glTF right-handed data to the appropriate system based on the current coordinate system mode of the scene.
+             * - FORCE_RIGHT_HANDED - Sets the useRightHandedSystem flag on the scene.
              */
             this.coordinateSystemMode = GLTFLoaderCoordinateSystemMode.AUTO;
             /**
-             * The animation start mode (NONE, FIRST, ALL).
-             */
+            * The animation start mode (NONE, FIRST, ALL). Defaults to FIRST.
+            * - NONE - No animation will start.
+            * - FIRST - The first animation will start.
+            * - ALL - All animations will start.
+            */
             this.animationStartMode = GLTFLoaderAnimationStartMode.FIRST;
             /**
-             * Set to true to compile materials before raising the success callback.
+             * Set to true to compile materials before raising the success callback. Defaults to false.
              */
             this.compileMaterials = false;
             /**
-             * Set to true to also compile materials with clip planes.
+             * Set to true to also compile materials with clip planes. Defaults to false.
              */
             this.useClipPlane = false;
             /**
-             * Set to true to compile shadow generators before raising the success callback.
+             * Set to true to compile shadow generators before raising the success callback. Defaults to false.
              */
             this.compileShadowGenerators = false;
             /**
@@ -102,13 +117,20 @@ var BABYLON;
             this.onExtensionLoadedObservable = new BABYLON.Observable();
             // #endregion
             this._loader = null;
+            /**
+             * Name of the loader ("gltf")
+             */
             this.name = "gltf";
+            /**
+             * Supported file extensions of the loader (.gltf, .glb)
+             */
             this.extensions = {
                 ".gltf": { isBinary: false },
                 ".glb": { isBinary: true }
             };
         }
         Object.defineProperty(GLTFFileLoader.prototype, "onParsed", {
+            /** Raised when the asset has been parsed. */
             set: function (callback) {
                 if (this._onParsedObserver) {
                     this.onParsedObservable.remove(this._onParsedObserver);
@@ -119,6 +141,9 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(GLTFFileLoader.prototype, "onMeshLoaded", {
+            /**
+             * Raised when the loader creates a mesh after parsing the glTF properties of the mesh. (onMeshLoadedObservable is likely desired instead.)
+             */
             set: function (callback) {
                 if (this._onMeshLoadedObserver) {
                     this.onMeshLoadedObservable.remove(this._onMeshLoadedObserver);
@@ -129,6 +154,9 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(GLTFFileLoader.prototype, "onTextureLoaded", {
+            /**
+             * Method called when a texture has been loaded (onTextureLoadedObservable is likely desired instead.)
+             */
             set: function (callback) {
                 if (this._onTextureLoadedObserver) {
                     this.onTextureLoadedObservable.remove(this._onTextureLoadedObserver);
@@ -139,6 +167,9 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(GLTFFileLoader.prototype, "onMaterialLoaded", {
+            /**
+             * Method when the loader creates a material after parsing the glTF properties of the material. (onMaterialLoadedObservable is likely desired instead.)
+             */
             set: function (callback) {
                 if (this._onMaterialLoadedObserver) {
                     this.onMaterialLoadedObservable.remove(this._onMaterialLoadedObserver);
@@ -149,6 +180,9 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(GLTFFileLoader.prototype, "onComplete", {
+            /**
+             * Raised when the asset is completely loaded, immediately before the loader is disposed. (onCompleteObservable is likely desired instead.)
+             */
             set: function (callback) {
                 if (this._onCompleteObserver) {
                     this.onCompleteObservable.remove(this._onCompleteObserver);
@@ -159,6 +193,9 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(GLTFFileLoader.prototype, "onDispose", {
+            /**
+             * Raised after the loader is disposed. (onDisposeObservable is likely desired instead.)
+             */
             set: function (callback) {
                 if (this._onDisposeObserver) {
                     this.onDisposeObservable.remove(this._onDisposeObserver);
@@ -169,6 +206,9 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(GLTFFileLoader.prototype, "onExtensionLoaded", {
+            /**
+             * Raised after a loader extension is created. (onExtensionLoadedObservable is likely desired instead.)
+             */
             set: function (callback) {
                 if (this._onExtensionLoadedObserver) {
                     this.onExtensionLoadedObservable.remove(this._onExtensionLoadedObserver);
@@ -214,6 +254,15 @@ var BABYLON;
             this.onDisposeObservable.notifyObservers(this);
             this.onDisposeObservable.clear();
         };
+        /**
+        * Imports one or more meshes from a loaded gltf file and adds them to the scene
+        * @param meshesNames a string or array of strings of the mesh names that should be loaded from the file
+        * @param scene the scene the meshes should be added to
+        * @param data gltf data containing information of the meshes in a loaded file
+        * @param rootUrl root url to load from
+        * @param onProgress event that fires when loading progress has occured
+        * @returns a promise containg the loaded meshes, particles, skeletons and animations
+        */
         GLTFFileLoader.prototype.importMeshAsync = function (meshesNames, scene, data, rootUrl, onProgress) {
             var _this = this;
             return Promise.resolve().then(function () {
@@ -222,6 +271,14 @@ var BABYLON;
                 return _this._loader.importMeshAsync(meshesNames, scene, loaderData, rootUrl, onProgress);
             });
         };
+        /**
+        * Imports all objects from a loaded gltf file and adds them to the scene
+        * @param scene the scene the objects should be added to
+        * @param data gltf data containing information of the meshes in a loaded file
+        * @param rootUrl root url to load from
+        * @param onProgress event that fires when loading progress has occured
+        * @returns a promise which completes when objects have been loaded to the scene
+        */
         GLTFFileLoader.prototype.loadAsync = function (scene, data, rootUrl, onProgress) {
             var _this = this;
             return Promise.resolve().then(function () {
@@ -230,6 +287,14 @@ var BABYLON;
                 return _this._loader.loadAsync(scene, loaderData, rootUrl, onProgress);
             });
         };
+        /**
+         * Load into an asset container.
+         * @param scene The scene to load into
+         * @param data The data to import
+         * @param rootUrl The root url for scene and resources
+         * @param onProgress The callback when the load progresses
+         * @returns The loaded asset container
+         */
         GLTFFileLoader.prototype.loadAssetContainerAsync = function (scene, data, rootUrl, onProgress) {
             var _this = this;
             return Promise.resolve().then(function () {
@@ -246,9 +311,18 @@ var BABYLON;
                 });
             });
         };
+        /**
+         * If the data string can be loaded directly
+         * @param data string contianing the file data
+         * @returns if the data can be loaded directly
+         */
         GLTFFileLoader.prototype.canDirectLoad = function (data) {
             return ((data.indexOf("scene") !== -1) && (data.indexOf("node") !== -1));
         };
+        /**
+         * Instantiates a gltf file loader plugin
+         * @returns the created plugin
+         */
         GLTFFileLoader.prototype.createPlugin = function () {
             return new GLTFFileLoader();
         };
@@ -432,7 +506,13 @@ var BABYLON;
         };
         // #endregion
         // #region V1 options
+        /**
+         * Set this property to false to disable incremental loading which delays the loader from calling the success callback until after loading the meshes and shaders. Textures always loads asynchronously. For example, the success callback can compute the bounding information of the loaded meshes when incremental loading is disabled. Defaults to true.
+         */
         GLTFFileLoader.IncrementalLoading = true;
+        /**
+         * Set this property to true in order to work with homogeneous coordinates, available with some converters and exporters. Defaults to false. See https://en.wikipedia.org/wiki/Homogeneous_coordinates
+         */
         GLTFFileLoader.HomogeneousCoordinates = false;
         return GLTFFileLoader;
     }());
@@ -476,9 +556,11 @@ var BABYLON;
 (function (BABYLON) {
     var GLTF2;
     (function (GLTF2) {
+        /** Array item helper methods */
         var ArrayItem = /** @class */ (function () {
             function ArrayItem() {
             }
+            /** Sets the index of each array element to its index in the array */
             ArrayItem.Assign = function (values) {
                 if (values) {
                     for (var index = 0; index < values.length; index++) {
@@ -500,12 +582,21 @@ var BABYLON;
 //# sourceMappingURL=babylon.glTFLoaderInterfaces.js.map
 
 /// <reference path="../../../../dist/preview release/babylon.d.ts"/>
+/**
+* Defines the GLTF2 module used to import/export GLTF 2.0 files
+*/
 var BABYLON;
 (function (BABYLON) {
     var GLTF2;
     (function (GLTF2) {
+        /**
+        * Used to load from a GLTF2 file
+        */
         var GLTFLoader = /** @class */ (function () {
             function GLTFLoader() {
+                /**
+                * @ignore
+                */
                 this._completePromises = new Array();
                 this._disposed = false;
                 this._state = null;
@@ -513,18 +604,56 @@ var BABYLON;
                 this._defaultSampler = {};
                 this._defaultBabylonMaterials = {};
                 this._requests = new Array();
+                /**
+                * Coordinate system that will be used when loading from the gltf file
+                */
                 this.coordinateSystemMode = BABYLON.GLTFLoaderCoordinateSystemMode.AUTO;
+                /**
+                * Animation mode that determines which animations should be started when a file is loaded
+                */
                 this.animationStartMode = BABYLON.GLTFLoaderAnimationStartMode.FIRST;
+                /**
+                * If the materials in the file should automatically be compiled
+                */
                 this.compileMaterials = false;
+                /**
+                * If a clip plane should be usede when loading meshes in the file
+                */
                 this.useClipPlane = false;
+                /**
+                * If shadow generators should automatically be compiled
+                */
                 this.compileShadowGenerators = false;
+                /**
+                * Observable that fires when the loader is disposed
+                */
                 this.onDisposeObservable = new BABYLON.Observable();
+                /**
+                * Observable that fires each time a mesh is loaded
+                */
                 this.onMeshLoadedObservable = new BABYLON.Observable();
+                /**
+                * Observable that fires each time a texture is loaded
+                */
                 this.onTextureLoadedObservable = new BABYLON.Observable();
+                /**
+                * Observable that fires each time a material is loaded
+                */
                 this.onMaterialLoadedObservable = new BABYLON.Observable();
+                /**
+                * Observable that fires each time an extension is loaded
+                */
                 this.onExtensionLoadedObservable = new BABYLON.Observable();
+                /**
+                * Observable that fires when the load has completed
+                */
                 this.onCompleteObservable = new BABYLON.Observable();
             }
+            /**
+            * @ignore, registers the loader
+            * @param name name of the loader
+            * @param factory function that converts a loader to a loader extension
+            */
             GLTFLoader._Register = function (name, factory) {
                 if (GLTFLoader._Factories[name]) {
                     BABYLON.Tools.Error("Extension with the name '" + name + "' already exists");
@@ -535,12 +664,18 @@ var BABYLON;
                 GLTFLoader._Names.push(name);
             };
             Object.defineProperty(GLTFLoader.prototype, "state", {
+                /**
+                * The current state of the loader
+                */
                 get: function () {
                     return this._state;
                 },
                 enumerable: true,
                 configurable: true
             });
+            /**
+            * Disposes of the loader
+            */
             GLTFLoader.prototype.dispose = function () {
                 if (this._disposed) {
                     return;
@@ -550,6 +685,15 @@ var BABYLON;
                 this.onDisposeObservable.clear();
                 this._clear();
             };
+            /**
+            * Imports one or more meshes from a loaded gltf file and adds them to the scene
+            * @param meshesNames a string or array of strings of the mesh names that should be loaded from the file
+            * @param scene the scene the meshes should be added to
+            * @param data gltf data containing information of the meshes in a loaded file
+            * @param rootUrl root url to load from
+            * @param onProgress event that fires when loading progress has occured
+            * @returns a promise containg the loaded meshes, particles, skeletons and animations
+            */
             GLTFLoader.prototype.importMeshAsync = function (meshesNames, scene, data, rootUrl, onProgress) {
                 var _this = this;
                 return Promise.resolve().then(function () {
@@ -583,6 +727,14 @@ var BABYLON;
                     });
                 });
             };
+            /**
+            * Imports all objects from a loaded gltf file and adds them to the scene
+            * @param scene the scene the objects should be added to
+            * @param data gltf data containing information of the meshes in a loaded file
+            * @param rootUrl root url to load from
+            * @param onProgress event that fires when loading progress has occured
+            * @returns a promise which completes when objects have been loaded to the scene
+            */
             GLTFLoader.prototype.loadAsync = function (scene, data, rootUrl, onProgress) {
                 return this._loadAsync(null, scene, data, rootUrl, onProgress);
             };
@@ -740,6 +892,9 @@ var BABYLON;
                 promises.push(this._loadAnimationsAsync());
                 return Promise.all(promises).then(function () { });
             };
+            /**
+            * @ignore
+            */
             GLTFLoader.prototype._loadSceneAsync = function (context, scene) {
                 var promise = GLTF2.GLTFLoaderExtension._LoadSceneAsync(this, context, scene);
                 if (promise) {
@@ -839,6 +994,9 @@ var BABYLON;
                     }
                 }
             };
+            /**
+            * @ignore
+            */
             GLTFLoader.prototype._loadNodeAsync = function (context, node) {
                 var promise = GLTF2.GLTFLoaderExtension._LoadNodeAsync(this, context, node);
                 if (promise) {
@@ -1359,6 +1517,9 @@ var BABYLON;
                 buffer._data = this._loadUriAsync(context, buffer.uri);
                 return buffer._data;
             };
+            /**
+            * @ignore
+            */
             GLTFLoader.prototype._loadBufferViewAsync = function (context, bufferView) {
                 if (bufferView._data) {
                     return bufferView._data;
@@ -1417,6 +1578,9 @@ var BABYLON;
                 });
                 return accessor._data;
             };
+            /**
+            * @ignore
+            */
             GLTFLoader.prototype._loadVertexBufferViewAsync = function (context, bufferView, kind) {
                 var _this = this;
                 if (bufferView._babylonBuffer) {
@@ -1486,6 +1650,9 @@ var BABYLON;
                 this._loadMaterialAlphaProperties(context, material, babylonMaterial);
                 return Promise.all(promises).then(function () { });
             };
+            /**
+            * @ignore
+            */
             GLTFLoader.prototype._loadMaterialAsync = function (context, material, babylonMesh, babylonDrawMode, assign) {
                 var promise = GLTF2.GLTFLoaderExtension._LoadMaterialAsync(this, context, material, babylonMesh, babylonDrawMode, assign);
                 if (promise) {
@@ -1511,12 +1678,18 @@ var BABYLON;
                 assign(babylonData.material);
                 return babylonData.loaded;
             };
+            /**
+            * @ignore
+            */
             GLTFLoader.prototype._createMaterial = function (type, name, drawMode) {
                 var babylonMaterial = new type(name, this._babylonScene);
                 babylonMaterial.sideOrientation = this._babylonScene.useRightHandedSystem ? BABYLON.Material.CounterClockWiseSideOrientation : BABYLON.Material.ClockWiseSideOrientation;
                 babylonMaterial.fillMode = drawMode;
                 return babylonMaterial;
             };
+            /**
+            * @ignore
+            */
             GLTFLoader.prototype._loadMaterialBasePropertiesAsync = function (context, material, babylonMaterial) {
                 var promises = new Array();
                 babylonMaterial.emissiveColor = material.emissiveFactor ? BABYLON.Color3.FromArray(material.emissiveFactor) : new BABYLON.Color3(0, 0, 0);
@@ -1550,6 +1723,9 @@ var BABYLON;
                 }
                 return Promise.all(promises).then(function () { });
             };
+            /**
+            * @ignore
+            */
             GLTFLoader.prototype._loadMaterialAlphaProperties = function (context, material, babylonMaterial) {
                 var alphaMode = material.alphaMode || "OPAQUE" /* OPAQUE */;
                 switch (alphaMode) {
@@ -1578,6 +1754,9 @@ var BABYLON;
                     }
                 }
             };
+            /**
+            * @ignore
+            */
             GLTFLoader.prototype._loadTextureAsync = function (context, textureInfo, assign) {
                 var _this = this;
                 var texture = GLTFLoader._GetProperty(context + "/index", this._gltf.textures, textureInfo.index);
@@ -1637,6 +1816,9 @@ var BABYLON;
                 });
                 return image._objectURL;
             };
+            /**
+            * @ignore
+            */
             GLTFLoader.prototype._loadUriAsync = function (context, uri) {
                 var _this = this;
                 var promise = GLTF2.GLTFLoaderExtension._LoadUriAsync(this, context, uri);
@@ -1694,6 +1876,9 @@ var BABYLON;
                 }
                 this._progressCallback(new BABYLON.SceneLoaderProgressEvent(lengthComputable, loaded, lengthComputable ? total : 0));
             };
+            /**
+            * @ignore
+            */
             GLTFLoader._GetProperty = function (context, array, index) {
                 if (!array || index == undefined || !array[index]) {
                     throw new Error(context + ": Failed to find index (" + index + ")");
@@ -1842,6 +2027,9 @@ var BABYLON;
                 this.onTextureLoadedObservable.clear();
                 this.onMaterialLoadedObservable.clear();
             };
+            /**
+            * @ignore
+            */
             GLTFLoader.prototype._applyExtensions = function (actionAsync) {
                 for (var _i = 0, _a = GLTFLoader._Names; _i < _a.length; _i++) {
                     var name_5 = _a[_i];
@@ -1871,6 +2059,9 @@ var BABYLON;
 (function (BABYLON) {
     var GLTF2;
     (function (GLTF2) {
+        /**
+         * Abstract class that can be implemented to extend existing gltf loader behavior.
+         */
         var GLTFLoaderExtension = /** @class */ (function () {
             function GLTFLoaderExtension(loader) {
                 this.enabled = true;
@@ -2120,6 +2311,7 @@ var __extends = (this && this.__extends) || (function () {
         d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
     };
 })();
+/** Module defining extensions to gltf */
 var BABYLON;
 (function (BABYLON) {
     var GLTF2;

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

@@ -1,5 +1,8 @@
 
 declare module BABYLON {
+    /**
+    * Coordinate system mode that will be used when loading from the gltf file
+    */
     enum GLTFLoaderCoordinateSystemMode {
         /**
          * Automatically convert the glTF right-handed data to the appropriate system based on the current coordinate system mode of the scene.
@@ -10,6 +13,9 @@ declare module BABYLON {
          */
         FORCE_RIGHT_HANDED = 1,
     }
+    /**
+    * Animation mode that determines which animations should be started when a file is loaded
+    */
     enum GLTFLoaderAnimationStartMode {
         /**
          * No animation will start.
@@ -24,10 +30,22 @@ declare module BABYLON {
          */
         ALL = 2,
     }
+    /**
+    * Loaded gltf data
+    */
     interface IGLTFLoaderData {
+        /**
+        * Loaded json string converted to an object
+        */
         json: Object;
+        /**
+        * Loaded ArrayBufferView
+        */
         bin: Nullable<ArrayBufferView>;
     }
+    /**
+    * Gltf extension interface
+    */
     interface IGLTFLoaderExtension {
         /**
          * The name of this extension.
@@ -38,6 +56,9 @@ declare module BABYLON {
          */
         enabled: boolean;
     }
+    /**
+    * Loading state
+    */
     enum GLTFLoaderState {
         /**
          * The asset is loading.
@@ -52,29 +73,77 @@ declare module BABYLON {
          */
         COMPLETE = 2,
     }
+    /**
+    * GLTF loader interface
+    */
     interface IGLTFLoader extends IDisposable {
+        /**
+        * Coordinate system that will be used when loading from the gltf file
+        */
         coordinateSystemMode: GLTFLoaderCoordinateSystemMode;
+        /**
+        * Animation mode that determines which animations should be started when a file is loaded
+        */
         animationStartMode: GLTFLoaderAnimationStartMode;
+        /**
+        * If the materials in the file should automatically be compiled
+        */
         compileMaterials: boolean;
+        /**
+        * If a clip plane should be usede when loading meshes in the file
+        */
         useClipPlane: boolean;
+        /**
+        * If shadow generators should automatically be compiled
+        */
         compileShadowGenerators: boolean;
+        /**
+        * Observable that fires each time a mesh is loaded
+        */
         onMeshLoadedObservable: Observable<AbstractMesh>;
+        /**
+        * Observable that fires each time a texture is loaded
+        */
         onTextureLoadedObservable: Observable<BaseTexture>;
+        /**
+       * Observable that fires each time a material is loaded
+       */
         onMaterialLoadedObservable: Observable<Material>;
+        /**
+        * Observable that fires when the load has completed
+        */
         onCompleteObservable: Observable<IGLTFLoader>;
+        /**
+        * Observable that fires when the loader is disposed
+        */
         onDisposeObservable: Observable<IGLTFLoader>;
+        /**
+        * Observable that fire when an extension is loaded
+        */
         onExtensionLoadedObservable: Observable<IGLTFLoaderExtension>;
+        /**
+        * Loader state
+        */
         state: Nullable<GLTFLoaderState>;
+        /**
+        * Imports one or more meshes from a loaded gltf file and adds them to the scene
+        */
         importMeshAsync: (meshesNames: any, scene: Scene, data: IGLTFLoaderData, rootUrl: string, onProgress?: (event: SceneLoaderProgressEvent) => void) => Promise<{
             meshes: AbstractMesh[];
             particleSystems: ParticleSystem[];
             skeletons: Skeleton[];
             animationGroups: AnimationGroup[];
         }>;
+        /**
+        * Imports all objects from a loaded gltf file and adds them to the scene
+        */
         loadAsync: (scene: Scene, data: IGLTFLoaderData, rootUrl: string, onProgress?: (event: SceneLoaderProgressEvent) => void) => Promise<void>;
     }
+    /** File loader to load gltf files into a babylon scene */
     class GLTFFileLoader implements IDisposable, ISceneLoaderPluginAsync, ISceneLoaderPluginFactory {
+        /** Creates a gltf 1.0 file loader */
         static CreateGLTFLoaderV1: () => IGLTFLoader;
+        /** Creates a gltf 2.0 file loader */
         static CreateGLTFLoaderV2: () => IGLTFLoader;
         /**
          * Raised when the asset has been parsed.
@@ -83,27 +152,39 @@ declare module BABYLON {
          */
         onParsedObservable: Observable<IGLTFLoaderData>;
         private _onParsedObserver;
+        /** Raised when the asset has been parsed. */
         onParsed: (loaderData: IGLTFLoaderData) => void;
+        /**
+         * Set this property to false to disable incremental loading which delays the loader from calling the success callback until after loading the meshes and shaders. Textures always loads asynchronously. For example, the success callback can compute the bounding information of the loaded meshes when incremental loading is disabled. Defaults to true.
+         */
         static IncrementalLoading: boolean;
+        /**
+         * Set this property to true in order to work with homogeneous coordinates, available with some converters and exporters. Defaults to false. See https://en.wikipedia.org/wiki/Homogeneous_coordinates
+         */
         static HomogeneousCoordinates: boolean;
         /**
-         * The coordinate system mode (AUTO, FORCE_RIGHT_HANDED).
+         * The coordinate system mode (AUTO, FORCE_RIGHT_HANDED). Defaults to AUTO.
+         * - AUTO - Automatically convert the glTF right-handed data to the appropriate system based on the current coordinate system mode of the scene.
+         * - FORCE_RIGHT_HANDED - Sets the useRightHandedSystem flag on the scene.
          */
         coordinateSystemMode: GLTFLoaderCoordinateSystemMode;
         /**
-         * The animation start mode (NONE, FIRST, ALL).
-         */
+        * The animation start mode (NONE, FIRST, ALL). Defaults to FIRST.
+        * - NONE - No animation will start.
+        * - FIRST - The first animation will start.
+        * - ALL - All animations will start.
+        */
         animationStartMode: GLTFLoaderAnimationStartMode;
         /**
-         * Set to true to compile materials before raising the success callback.
+         * Set to true to compile materials before raising the success callback. Defaults to false.
          */
         compileMaterials: boolean;
         /**
-         * Set to true to also compile materials with clip planes.
+         * Set to true to also compile materials with clip planes. Defaults to false.
          */
         useClipPlane: boolean;
         /**
-         * Set to true to compile shadow generators before raising the success callback.
+         * Set to true to compile shadow generators before raising the success callback. Defaults to false.
          */
         compileShadowGenerators: boolean;
         /**
@@ -111,18 +192,27 @@ declare module BABYLON {
          */
         readonly onMeshLoadedObservable: Observable<AbstractMesh>;
         private _onMeshLoadedObserver;
+        /**
+         * Raised when the loader creates a mesh after parsing the glTF properties of the mesh. (onMeshLoadedObservable is likely desired instead.)
+         */
         onMeshLoaded: (mesh: AbstractMesh) => void;
         /**
          * Raised when the loader creates a texture after parsing the glTF properties of the texture.
          */
         readonly onTextureLoadedObservable: Observable<BaseTexture>;
         private _onTextureLoadedObserver;
+        /**
+         * Method called when a texture has been loaded (onTextureLoadedObservable is likely desired instead.)
+         */
         onTextureLoaded: (texture: BaseTexture) => void;
         /**
          * Raised when the loader creates a material after parsing the glTF properties of the material.
          */
         readonly onMaterialLoadedObservable: Observable<Material>;
         private _onMaterialLoadedObserver;
+        /**
+         * Method when the loader creates a material after parsing the glTF properties of the material. (onMaterialLoadedObservable is likely desired instead.)
+         */
         onMaterialLoaded: (material: Material) => void;
         /**
          * Raised when the asset is completely loaded, immediately before the loader is disposed.
@@ -131,12 +221,18 @@ declare module BABYLON {
          */
         readonly onCompleteObservable: Observable<GLTFFileLoader>;
         private _onCompleteObserver;
+        /**
+         * Raised when the asset is completely loaded, immediately before the loader is disposed. (onCompleteObservable is likely desired instead.)
+         */
         onComplete: () => void;
         /**
         * Raised after the loader is disposed.
         */
         readonly onDisposeObservable: Observable<GLTFFileLoader>;
         private _onDisposeObserver;
+        /**
+         * Raised after the loader is disposed. (onDisposeObservable is likely desired instead.)
+         */
         onDispose: () => void;
         /**
          * Raised after a loader extension is created.
@@ -144,6 +240,9 @@ declare module BABYLON {
          */
         readonly onExtensionLoadedObservable: Observable<IGLTFLoaderExtension>;
         private _onExtensionLoadedObserver;
+        /**
+         * Raised after a loader extension is created. (onExtensionLoadedObservable is likely desired instead.)
+         */
         onExtensionLoaded: (extension: IGLTFLoaderExtension) => void;
         /**
          * Returns a promise that resolves when the asset is completely loaded.
@@ -155,22 +254,65 @@ declare module BABYLON {
          */
         readonly loaderState: Nullable<GLTFLoaderState>;
         private _loader;
+        /**
+         * Name of the loader ("gltf")
+         */
         name: string;
+        /**
+         * Supported file extensions of the loader (.gltf, .glb)
+         */
         extensions: ISceneLoaderPluginExtensions;
         /**
          * Disposes the loader, releases resources during load, and cancels any outstanding requests.
          */
         dispose(): void;
+        /**
+        * Imports one or more meshes from a loaded gltf file and adds them to the scene
+        * @param meshesNames a string or array of strings of the mesh names that should be loaded from the file
+        * @param scene the scene the meshes should be added to
+        * @param data gltf data containing information of the meshes in a loaded file
+        * @param rootUrl root url to load from
+        * @param onProgress event that fires when loading progress has occured
+        * @returns a promise containg the loaded meshes, particles, skeletons and animations
+        */
         importMeshAsync(meshesNames: any, scene: Scene, data: any, rootUrl: string, onProgress?: (event: SceneLoaderProgressEvent) => void): Promise<{
             meshes: AbstractMesh[];
             particleSystems: ParticleSystem[];
             skeletons: Skeleton[];
             animationGroups: AnimationGroup[];
         }>;
+        /**
+        * Imports all objects from a loaded gltf file and adds them to the scene
+        * @param scene the scene the objects should be added to
+        * @param data gltf data containing information of the meshes in a loaded file
+        * @param rootUrl root url to load from
+        * @param onProgress event that fires when loading progress has occured
+        * @returns a promise which completes when objects have been loaded to the scene
+        */
         loadAsync(scene: Scene, data: string | ArrayBuffer, rootUrl: string, onProgress?: (event: SceneLoaderProgressEvent) => void): Promise<void>;
+        /**
+         * Load into an asset container.
+         * @param scene The scene to load into
+         * @param data The data to import
+         * @param rootUrl The root url for scene and resources
+         * @param onProgress The callback when the load progresses
+         * @returns The loaded asset container
+         */
         loadAssetContainerAsync(scene: Scene, data: string | ArrayBuffer, rootUrl: string, onProgress?: (event: SceneLoaderProgressEvent) => void): Promise<AssetContainer>;
+        /**
+         * If the data string can be loaded directly
+         * @param data string contianing the file data
+         * @returns if the data can be loaded directly
+         */
         canDirectLoad(data: string): boolean;
+        /**
+         * Rewrites a url by combining a root url and response url
+         */
         rewriteRootURL: (rootUrl: string, responseURL?: string) => string;
+        /**
+         * Instantiates a gltf file loader plugin
+         * @returns the created plugin
+         */
         createPlugin(): ISceneLoaderPlugin | ISceneLoaderPluginAsync;
         private _parse(data);
         private _getLoader(loaderData);
@@ -587,9 +729,21 @@ declare module BABYLON.GLTF1 {
         onMaterialLoadedObservable: Observable<Material>;
         onCompleteObservable: Observable<IGLTFLoader>;
         onExtensionLoadedObservable: Observable<IGLTFLoaderExtension>;
+        /**
+        * State of the loader
+        */
         state: Nullable<GLTFLoaderState>;
         dispose(): void;
         private _importMeshAsync(meshesNames, scene, data, rootUrl, onSuccess, onProgress?, onError?);
+        /**
+        * Imports one or more meshes from a loaded gltf file and adds them to the scene
+        * @param meshesNames a string or array of strings of the mesh names that should be loaded from the file
+        * @param scene the scene the meshes should be added to
+        * @param data gltf data containing information of the meshes in a loaded file
+        * @param rootUrl root url to load from
+        * @param onProgress event that fires when loading progress has occured
+        * @returns a promise containg the loaded meshes, particles, skeletons and animations
+        */
         importMeshAsync(meshesNames: any, scene: Scene, data: IGLTFLoaderData, rootUrl: string, onProgress?: (event: SceneLoaderProgressEvent) => void): Promise<{
             meshes: AbstractMesh[];
             particleSystems: ParticleSystem[];
@@ -597,6 +751,14 @@ declare module BABYLON.GLTF1 {
             animationGroups: AnimationGroup[];
         }>;
         private _loadAsync(scene, data, rootUrl, onSuccess, onProgress?, onError?);
+        /**
+        * Imports all objects from a loaded gltf file and adds them to the scene
+        * @param scene the scene the objects should be added to
+        * @param data gltf data containing information of the meshes in a loaded file
+        * @param rootUrl root url to load from
+        * @param onProgress event that fires when loading progress has occured
+        * @returns a promise which completes when objects have been loaded to the scene
+        */
         loadAsync(scene: Scene, data: IGLTFLoaderData, rootUrl: string, onProgress?: (event: SceneLoaderProgressEvent) => void): Promise<void>;
         private _loadShadersAsync(gltfRuntime, onload);
         private _loadBuffersAsync(gltfRuntime, onLoad, onProgress?);
@@ -741,48 +903,84 @@ declare module BABYLON.GLTF1 {
 
 
 declare module BABYLON.GLTF2 {
+    /** Array item which contains it's index in an array */
     interface IArrayItem {
         _index: number;
     }
+    /** Array item helper methods */
     class ArrayItem {
+        /** Sets the index of each array element to its index in the array */
         static Assign(values?: IArrayItem[]): void;
     }
 }
 
 
 
+/**
+ * GLTF2 module for babylon
+ */
 declare module BABYLON.GLTF2 {
+    /**
+     * Interface to access data and vertex buffer associated with a file
+     */
     interface ILoaderAccessor extends IAccessor, IArrayItem {
         _data?: Promise<ArrayBufferView>;
         _babylonVertexBuffer?: Promise<VertexBuffer>;
     }
+    /**
+     * Loader's animation channel
+     */
     interface ILoaderAnimationChannel extends IAnimationChannel, IArrayItem {
     }
+    /**
+     * Container for animation keyframe data
+     */
     interface ILoaderAnimationSamplerData {
         input: Float32Array;
         interpolation: AnimationSamplerInterpolation;
         output: Float32Array;
     }
+    /**
+     * Keyframe data
+     */
     interface ILoaderAnimationSampler extends IAnimationSampler, IArrayItem {
         _data: Promise<ILoaderAnimationSamplerData>;
     }
+    /**
+     * Loader animation
+     */
     interface ILoaderAnimation extends IAnimation, IArrayItem {
         channels: ILoaderAnimationChannel[];
         samplers: ILoaderAnimationSampler[];
         _babylonAnimationGroup?: AnimationGroup;
     }
+    /**
+     * Loader buffer
+     */
     interface ILoaderBuffer extends IBuffer, IArrayItem {
         _data?: Promise<ArrayBufferView>;
     }
+    /**
+     * Loader's buffer data
+     */
     interface ILoaderBufferView extends IBufferView, IArrayItem {
         _data?: Promise<ArrayBufferView>;
         _babylonBuffer?: Promise<Buffer>;
     }
+    /**
+     * Loader's loaded camera data
+     */
     interface ILoaderCamera extends ICamera, IArrayItem {
     }
+    /**
+     * Loaded image specified by url
+     */
     interface ILoaderImage extends IImage, IArrayItem {
         _objectURL?: Promise<string>;
     }
+    /**
+     * Loaded material data
+     */
     interface ILoaderMaterial extends IMaterial, IArrayItem {
         _babylonData?: {
             [drawMode: number]: {
@@ -792,11 +990,20 @@ declare module BABYLON.GLTF2 {
             };
         };
     }
+    /**
+     * Loader mesh data
+     */
     interface ILoaderMesh extends IMesh, IArrayItem {
         primitives: ILoaderMeshPrimitive[];
     }
+    /**
+     * Loader mesh data
+     */
     interface ILoaderMeshPrimitive extends IMeshPrimitive, IArrayItem {
     }
+    /**
+     * Node for traversing loader data
+     */
     interface ILoaderNode extends INode, IArrayItem {
         _parent: ILoaderNode;
         _babylonMesh?: Mesh;
@@ -804,23 +1011,41 @@ declare module BABYLON.GLTF2 {
         _babylonAnimationTargets?: Node[];
         _numMorphTargets?: number;
     }
+    /**
+     * Sampler data
+     */
     interface ILoaderSamplerData {
         noMipMaps: boolean;
         samplingMode: number;
         wrapU: number;
         wrapV: number;
     }
+    /**
+     * Sampler data
+     */
     interface ILoaderSampler extends ISampler, IArrayItem {
         _data?: ILoaderSamplerData;
     }
+    /**
+     * Loader's scene
+     */
     interface ILoaderScene extends IScene, IArrayItem {
     }
+    /**
+     * Loader's skeleton data
+     */
     interface ILoaderSkin extends ISkin, IArrayItem {
         _babylonSkeleton?: Skeleton;
         _loaded?: Promise<void>;
     }
+    /**
+     * Loader's texture
+     */
     interface ILoaderTexture extends ITexture, IArrayItem {
     }
+    /**
+     * Loaded GLTF data
+     */
     interface ILoaderGLTF extends IGLTF {
         accessors?: ILoaderAccessor[];
         animations?: ILoaderAnimation[];
@@ -839,14 +1064,40 @@ declare module BABYLON.GLTF2 {
 }
 
 
+/**
+* Defines the GLTF2 module used to import/export GLTF 2.0 files
+*/
 declare module BABYLON.GLTF2 {
+    /**
+    * Interface for a meterial with a constructor
+    */
     interface MaterialConstructor<T extends Material> {
+        /**
+        * The material class
+        */
         readonly prototype: T;
+        /**
+        * Instatiates a material
+        * @param name name of the material
+        * @param scene the scene the material will be added to
+        */
         new (name: string, scene: Scene): T;
     }
+    /**
+    * Used to load from a GLTF2 file
+    */
     class GLTFLoader implements IGLTFLoader {
+        /**
+        * @ignore
+        */
         _gltf: ILoaderGLTF;
+        /**
+        * @ignore
+        */
         _babylonScene: Scene;
+        /**
+        * @ignore
+        */
         _completePromises: Promise<void>[];
         private _disposed;
         private _state;
@@ -859,26 +1110,87 @@ declare module BABYLON.GLTF2 {
         private _requests;
         private static _Names;
         private static _Factories;
+        /**
+        * @ignore, registers the loader
+        * @param name name of the loader
+        * @param factory function that converts a loader to a loader extension
+        */
         static _Register(name: string, factory: (loader: GLTFLoader) => GLTFLoaderExtension): void;
+        /**
+        * Coordinate system that will be used when loading from the gltf file
+        */
         coordinateSystemMode: GLTFLoaderCoordinateSystemMode;
+        /**
+        * Animation mode that determines which animations should be started when a file is loaded
+        */
         animationStartMode: GLTFLoaderAnimationStartMode;
+        /**
+        * If the materials in the file should automatically be compiled
+        */
         compileMaterials: boolean;
+        /**
+        * If a clip plane should be usede when loading meshes in the file
+        */
         useClipPlane: boolean;
+        /**
+        * If shadow generators should automatically be compiled
+        */
         compileShadowGenerators: boolean;
+        /**
+        * Observable that fires when the loader is disposed
+        */
         readonly onDisposeObservable: Observable<IGLTFLoader>;
+        /**
+        * Observable that fires each time a mesh is loaded
+        */
         readonly onMeshLoadedObservable: Observable<AbstractMesh>;
+        /**
+        * Observable that fires each time a texture is loaded
+        */
         readonly onTextureLoadedObservable: Observable<BaseTexture>;
+        /**
+        * Observable that fires each time a material is loaded
+        */
         readonly onMaterialLoadedObservable: Observable<Material>;
+        /**
+        * Observable that fires each time an extension is loaded
+        */
         readonly onExtensionLoadedObservable: Observable<IGLTFLoaderExtension>;
+        /**
+        * Observable that fires when the load has completed
+        */
         readonly onCompleteObservable: Observable<IGLTFLoader>;
+        /**
+        * The current state of the loader
+        */
         readonly state: Nullable<GLTFLoaderState>;
+        /**
+        * Disposes of the loader
+        */
         dispose(): void;
+        /**
+        * Imports one or more meshes from a loaded gltf file and adds them to the scene
+        * @param meshesNames a string or array of strings of the mesh names that should be loaded from the file
+        * @param scene the scene the meshes should be added to
+        * @param data gltf data containing information of the meshes in a loaded file
+        * @param rootUrl root url to load from
+        * @param onProgress event that fires when loading progress has occured
+        * @returns a promise containg the loaded meshes, particles, skeletons and animations
+        */
         importMeshAsync(meshesNames: any, scene: Scene, data: IGLTFLoaderData, rootUrl: string, onProgress?: (event: SceneLoaderProgressEvent) => void): Promise<{
             meshes: AbstractMesh[];
             particleSystems: ParticleSystem[];
             skeletons: Skeleton[];
             animationGroups: AnimationGroup[];
         }>;
+        /**
+        * Imports all objects from a loaded gltf file and adds them to the scene
+        * @param scene the scene the objects should be added to
+        * @param data gltf data containing information of the meshes in a loaded file
+        * @param rootUrl root url to load from
+        * @param onProgress event that fires when loading progress has occured
+        * @returns a promise which completes when objects have been loaded to the scene
+        */
         loadAsync(scene: Scene, data: IGLTFLoaderData, rootUrl: string, onProgress?: (event: SceneLoaderProgressEvent) => void): Promise<void>;
         private _loadAsync(nodes, scene, data, rootUrl, onProgress?);
         private _loadExtensions();
@@ -887,12 +1199,18 @@ declare module BABYLON.GLTF2 {
         private _checkExtensions();
         private _createRootNode();
         private _loadNodesAsync(nodes);
+        /**
+        * @ignore
+        */
         _loadSceneAsync(context: string, scene: ILoaderScene): Promise<void>;
         private _forEachPrimitive(node, callback);
         private _getMeshes();
         private _getSkeletons();
         private _getAnimationGroups();
         private _startAnimations();
+        /**
+        * @ignore
+        */
         _loadNodeAsync(context: string, node: ILoaderNode): Promise<void>;
         private _loadMeshAsync(context, node, mesh, babylonMesh);
         private _loadPrimitiveAsync(context, node, mesh, primitive, babylonMesh);
@@ -912,21 +1230,48 @@ declare module BABYLON.GLTF2 {
         private _loadAnimationChannelAsync(context, animationContext, animation, channel, babylonAnimationGroup);
         private _loadAnimationSamplerAsync(context, sampler);
         private _loadBufferAsync(context, buffer);
+        /**
+        * @ignore
+        */
         _loadBufferViewAsync(context: string, bufferView: ILoaderBufferView): Promise<ArrayBufferView>;
         private _loadAccessorAsync(context, accessor);
+        /**
+        * @ignore
+        */
         _loadVertexBufferViewAsync(context: string, bufferView: ILoaderBufferView, kind: string): Promise<Buffer>;
         private _loadVertexAccessorAsync(context, accessor, kind);
         private _getDefaultMaterial(drawMode);
         private _loadMaterialMetallicRoughnessPropertiesAsync(context, material, babylonMaterial);
+        /**
+        * @ignore
+        */
         _loadMaterialAsync(context: string, material: ILoaderMaterial, babylonMesh: Mesh, babylonDrawMode: number, assign: (babylonMaterial: Material) => void): Promise<void>;
+        /**
+        * @ignore
+        */
         _createMaterial<T extends Material>(type: MaterialConstructor<T>, name: string, drawMode: number): T;
+        /**
+        * @ignore
+        */
         _loadMaterialBasePropertiesAsync(context: string, material: ILoaderMaterial, babylonMaterial: PBRMaterial): Promise<void>;
+        /**
+        * @ignore
+        */
         _loadMaterialAlphaProperties(context: string, material: ILoaderMaterial, babylonMaterial: PBRMaterial): void;
+        /**
+        * @ignore
+        */
         _loadTextureAsync(context: string, textureInfo: ITextureInfo, assign: (texture: Texture) => void): Promise<void>;
         private _loadSampler(context, sampler);
         private _loadImageAsync(context, image);
+        /**
+        * @ignore
+        */
         _loadUriAsync(context: string, uri: string): Promise<ArrayBufferView>;
         private _onProgress();
+        /**
+        * @ignore
+        */
         static _GetProperty<T>(context: string, array: ArrayLike<T> | undefined, index: number | undefined): T;
         private static _GetTextureWrapMode(context, mode);
         private static _GetTextureSamplingMode(context, magFilter?, minFilter?);
@@ -936,12 +1281,18 @@ declare module BABYLON.GLTF2 {
         private _compileMaterialsAsync();
         private _compileShadowGeneratorsAsync();
         private _clear();
+        /**
+        * @ignore
+        */
         _applyExtensions<T>(actionAsync: (extension: GLTFLoaderExtension) => Nullable<Promise<T>>): Nullable<Promise<T>>;
     }
 }
 
 
 declare module BABYLON.GLTF2 {
+    /**
+     * Abstract class that can be implemented to extend existing gltf loader behavior.
+     */
     abstract class GLTFLoaderExtension implements IGLTFLoaderExtension, IDisposable {
         enabled: boolean;
         readonly abstract name: string;
@@ -996,6 +1347,7 @@ declare module BABYLON.GLTF2.Extensions {
 }
 
 
+/** Module defining extensions to gltf */
 declare module BABYLON.GLTF2.Extensions {
     class KHR_draco_mesh_compression extends GLTFLoaderExtension {
         readonly name: string;

+ 218 - 6
dist/preview release/loaders/babylon.glTFFileLoader.js

@@ -1,6 +1,9 @@
 /// <reference path="../../../dist/preview release/babylon.d.ts"/>
 var BABYLON;
 (function (BABYLON) {
+    /**
+    * Coordinate system mode that will be used when loading from the gltf file
+    */
     var GLTFLoaderCoordinateSystemMode;
     (function (GLTFLoaderCoordinateSystemMode) {
         /**
@@ -12,6 +15,9 @@ var BABYLON;
          */
         GLTFLoaderCoordinateSystemMode[GLTFLoaderCoordinateSystemMode["FORCE_RIGHT_HANDED"] = 1] = "FORCE_RIGHT_HANDED";
     })(GLTFLoaderCoordinateSystemMode = BABYLON.GLTFLoaderCoordinateSystemMode || (BABYLON.GLTFLoaderCoordinateSystemMode = {}));
+    /**
+    * Animation mode that determines which animations should be started when a file is loaded
+    */
     var GLTFLoaderAnimationStartMode;
     (function (GLTFLoaderAnimationStartMode) {
         /**
@@ -27,6 +33,9 @@ var BABYLON;
          */
         GLTFLoaderAnimationStartMode[GLTFLoaderAnimationStartMode["ALL"] = 2] = "ALL";
     })(GLTFLoaderAnimationStartMode = BABYLON.GLTFLoaderAnimationStartMode || (BABYLON.GLTFLoaderAnimationStartMode = {}));
+    /**
+    * Loading state
+    */
     var GLTFLoaderState;
     (function (GLTFLoaderState) {
         /**
@@ -42,6 +51,7 @@ var BABYLON;
          */
         GLTFLoaderState[GLTFLoaderState["COMPLETE"] = 2] = "COMPLETE";
     })(GLTFLoaderState = BABYLON.GLTFLoaderState || (BABYLON.GLTFLoaderState = {}));
+    /** File loader to load gltf files into a babylon scene */
     var GLTFFileLoader = /** @class */ (function () {
         function GLTFFileLoader() {
             // #region Common options
@@ -54,23 +64,28 @@ var BABYLON;
             // #endregion
             // #region V2 options
             /**
-             * The coordinate system mode (AUTO, FORCE_RIGHT_HANDED).
+             * The coordinate system mode (AUTO, FORCE_RIGHT_HANDED). Defaults to AUTO.
+             * - AUTO - Automatically convert the glTF right-handed data to the appropriate system based on the current coordinate system mode of the scene.
+             * - FORCE_RIGHT_HANDED - Sets the useRightHandedSystem flag on the scene.
              */
             this.coordinateSystemMode = GLTFLoaderCoordinateSystemMode.AUTO;
             /**
-             * The animation start mode (NONE, FIRST, ALL).
-             */
+            * The animation start mode (NONE, FIRST, ALL). Defaults to FIRST.
+            * - NONE - No animation will start.
+            * - FIRST - The first animation will start.
+            * - ALL - All animations will start.
+            */
             this.animationStartMode = GLTFLoaderAnimationStartMode.FIRST;
             /**
-             * Set to true to compile materials before raising the success callback.
+             * Set to true to compile materials before raising the success callback. Defaults to false.
              */
             this.compileMaterials = false;
             /**
-             * Set to true to also compile materials with clip planes.
+             * Set to true to also compile materials with clip planes. Defaults to false.
              */
             this.useClipPlane = false;
             /**
-             * Set to true to compile shadow generators before raising the success callback.
+             * Set to true to compile shadow generators before raising the success callback. Defaults to false.
              */
             this.compileShadowGenerators = false;
             /**
@@ -102,13 +117,20 @@ var BABYLON;
             this.onExtensionLoadedObservable = new BABYLON.Observable();
             // #endregion
             this._loader = null;
+            /**
+             * Name of the loader ("gltf")
+             */
             this.name = "gltf";
+            /**
+             * Supported file extensions of the loader (.gltf, .glb)
+             */
             this.extensions = {
                 ".gltf": { isBinary: false },
                 ".glb": { isBinary: true }
             };
         }
         Object.defineProperty(GLTFFileLoader.prototype, "onParsed", {
+            /** Raised when the asset has been parsed. */
             set: function (callback) {
                 if (this._onParsedObserver) {
                     this.onParsedObservable.remove(this._onParsedObserver);
@@ -119,6 +141,9 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(GLTFFileLoader.prototype, "onMeshLoaded", {
+            /**
+             * Raised when the loader creates a mesh after parsing the glTF properties of the mesh. (onMeshLoadedObservable is likely desired instead.)
+             */
             set: function (callback) {
                 if (this._onMeshLoadedObserver) {
                     this.onMeshLoadedObservable.remove(this._onMeshLoadedObserver);
@@ -129,6 +154,9 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(GLTFFileLoader.prototype, "onTextureLoaded", {
+            /**
+             * Method called when a texture has been loaded (onTextureLoadedObservable is likely desired instead.)
+             */
             set: function (callback) {
                 if (this._onTextureLoadedObserver) {
                     this.onTextureLoadedObservable.remove(this._onTextureLoadedObserver);
@@ -139,6 +167,9 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(GLTFFileLoader.prototype, "onMaterialLoaded", {
+            /**
+             * Method when the loader creates a material after parsing the glTF properties of the material. (onMaterialLoadedObservable is likely desired instead.)
+             */
             set: function (callback) {
                 if (this._onMaterialLoadedObserver) {
                     this.onMaterialLoadedObservable.remove(this._onMaterialLoadedObserver);
@@ -149,6 +180,9 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(GLTFFileLoader.prototype, "onComplete", {
+            /**
+             * Raised when the asset is completely loaded, immediately before the loader is disposed. (onCompleteObservable is likely desired instead.)
+             */
             set: function (callback) {
                 if (this._onCompleteObserver) {
                     this.onCompleteObservable.remove(this._onCompleteObserver);
@@ -159,6 +193,9 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(GLTFFileLoader.prototype, "onDispose", {
+            /**
+             * Raised after the loader is disposed. (onDisposeObservable is likely desired instead.)
+             */
             set: function (callback) {
                 if (this._onDisposeObserver) {
                     this.onDisposeObservable.remove(this._onDisposeObserver);
@@ -169,6 +206,9 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(GLTFFileLoader.prototype, "onExtensionLoaded", {
+            /**
+             * Raised after a loader extension is created. (onExtensionLoadedObservable is likely desired instead.)
+             */
             set: function (callback) {
                 if (this._onExtensionLoadedObserver) {
                     this.onExtensionLoadedObservable.remove(this._onExtensionLoadedObserver);
@@ -214,6 +254,15 @@ var BABYLON;
             this.onDisposeObservable.notifyObservers(this);
             this.onDisposeObservable.clear();
         };
+        /**
+        * Imports one or more meshes from a loaded gltf file and adds them to the scene
+        * @param meshesNames a string or array of strings of the mesh names that should be loaded from the file
+        * @param scene the scene the meshes should be added to
+        * @param data gltf data containing information of the meshes in a loaded file
+        * @param rootUrl root url to load from
+        * @param onProgress event that fires when loading progress has occured
+        * @returns a promise containg the loaded meshes, particles, skeletons and animations
+        */
         GLTFFileLoader.prototype.importMeshAsync = function (meshesNames, scene, data, rootUrl, onProgress) {
             var _this = this;
             return Promise.resolve().then(function () {
@@ -222,6 +271,14 @@ var BABYLON;
                 return _this._loader.importMeshAsync(meshesNames, scene, loaderData, rootUrl, onProgress);
             });
         };
+        /**
+        * Imports all objects from a loaded gltf file and adds them to the scene
+        * @param scene the scene the objects should be added to
+        * @param data gltf data containing information of the meshes in a loaded file
+        * @param rootUrl root url to load from
+        * @param onProgress event that fires when loading progress has occured
+        * @returns a promise which completes when objects have been loaded to the scene
+        */
         GLTFFileLoader.prototype.loadAsync = function (scene, data, rootUrl, onProgress) {
             var _this = this;
             return Promise.resolve().then(function () {
@@ -230,6 +287,14 @@ var BABYLON;
                 return _this._loader.loadAsync(scene, loaderData, rootUrl, onProgress);
             });
         };
+        /**
+         * Load into an asset container.
+         * @param scene The scene to load into
+         * @param data The data to import
+         * @param rootUrl The root url for scene and resources
+         * @param onProgress The callback when the load progresses
+         * @returns The loaded asset container
+         */
         GLTFFileLoader.prototype.loadAssetContainerAsync = function (scene, data, rootUrl, onProgress) {
             var _this = this;
             return Promise.resolve().then(function () {
@@ -246,9 +311,18 @@ var BABYLON;
                 });
             });
         };
+        /**
+         * If the data string can be loaded directly
+         * @param data string contianing the file data
+         * @returns if the data can be loaded directly
+         */
         GLTFFileLoader.prototype.canDirectLoad = function (data) {
             return ((data.indexOf("scene") !== -1) && (data.indexOf("node") !== -1));
         };
+        /**
+         * Instantiates a gltf file loader plugin
+         * @returns the created plugin
+         */
         GLTFFileLoader.prototype.createPlugin = function () {
             return new GLTFFileLoader();
         };
@@ -432,7 +506,13 @@ var BABYLON;
         };
         // #endregion
         // #region V1 options
+        /**
+         * Set this property to false to disable incremental loading which delays the loader from calling the success callback until after loading the meshes and shaders. Textures always loads asynchronously. For example, the success callback can compute the bounding information of the loaded meshes when incremental loading is disabled. Defaults to true.
+         */
         GLTFFileLoader.IncrementalLoading = true;
+        /**
+         * Set this property to true in order to work with homogeneous coordinates, available with some converters and exporters. Defaults to false. See https://en.wikipedia.org/wiki/Homogeneous_coordinates
+         */
         GLTFFileLoader.HomogeneousCoordinates = false;
         return GLTFFileLoader;
     }());
@@ -1869,6 +1949,9 @@ var BABYLON;
                 this.onMaterialLoadedObservable = new BABYLON.Observable();
                 this.onCompleteObservable = new BABYLON.Observable();
                 this.onExtensionLoadedObservable = new BABYLON.Observable();
+                /**
+                * State of the loader
+                */
                 this.state = null;
             }
             GLTFLoader.RegisterExtension = function (extension) {
@@ -1931,6 +2014,15 @@ var BABYLON;
                 }, onError);
                 return true;
             };
+            /**
+            * Imports one or more meshes from a loaded gltf file and adds them to the scene
+            * @param meshesNames a string or array of strings of the mesh names that should be loaded from the file
+            * @param scene the scene the meshes should be added to
+            * @param data gltf data containing information of the meshes in a loaded file
+            * @param rootUrl root url to load from
+            * @param onProgress event that fires when loading progress has occured
+            * @returns a promise containg the loaded meshes, particles, skeletons and animations
+            */
             GLTFLoader.prototype.importMeshAsync = function (meshesNames, scene, data, rootUrl, onProgress) {
                 var _this = this;
                 return new Promise(function (resolve, reject) {
@@ -1970,6 +2062,14 @@ var BABYLON;
                     }, onError);
                 }, onError);
             };
+            /**
+            * Imports all objects from a loaded gltf file and adds them to the scene
+            * @param scene the scene the objects should be added to
+            * @param data gltf data containing information of the meshes in a loaded file
+            * @param rootUrl root url to load from
+            * @param onProgress event that fires when loading progress has occured
+            * @returns a promise which completes when objects have been loaded to the scene
+            */
             GLTFLoader.prototype.loadAsync = function (scene, data, rootUrl, onProgress) {
                 var _this = this;
                 return new Promise(function (resolve, reject) {
@@ -2671,9 +2771,11 @@ var BABYLON;
 (function (BABYLON) {
     var GLTF2;
     (function (GLTF2) {
+        /** Array item helper methods */
         var ArrayItem = /** @class */ (function () {
             function ArrayItem() {
             }
+            /** Sets the index of each array element to its index in the array */
             ArrayItem.Assign = function (values) {
                 if (values) {
                     for (var index = 0; index < values.length; index++) {
@@ -2695,12 +2797,21 @@ var BABYLON;
 //# sourceMappingURL=babylon.glTFLoaderInterfaces.js.map
 
 /// <reference path="../../../../dist/preview release/babylon.d.ts"/>
+/**
+* Defines the GLTF2 module used to import/export GLTF 2.0 files
+*/
 var BABYLON;
 (function (BABYLON) {
     var GLTF2;
     (function (GLTF2) {
+        /**
+        * Used to load from a GLTF2 file
+        */
         var GLTFLoader = /** @class */ (function () {
             function GLTFLoader() {
+                /**
+                * @ignore
+                */
                 this._completePromises = new Array();
                 this._disposed = false;
                 this._state = null;
@@ -2708,18 +2819,56 @@ var BABYLON;
                 this._defaultSampler = {};
                 this._defaultBabylonMaterials = {};
                 this._requests = new Array();
+                /**
+                * Coordinate system that will be used when loading from the gltf file
+                */
                 this.coordinateSystemMode = BABYLON.GLTFLoaderCoordinateSystemMode.AUTO;
+                /**
+                * Animation mode that determines which animations should be started when a file is loaded
+                */
                 this.animationStartMode = BABYLON.GLTFLoaderAnimationStartMode.FIRST;
+                /**
+                * If the materials in the file should automatically be compiled
+                */
                 this.compileMaterials = false;
+                /**
+                * If a clip plane should be usede when loading meshes in the file
+                */
                 this.useClipPlane = false;
+                /**
+                * If shadow generators should automatically be compiled
+                */
                 this.compileShadowGenerators = false;
+                /**
+                * Observable that fires when the loader is disposed
+                */
                 this.onDisposeObservable = new BABYLON.Observable();
+                /**
+                * Observable that fires each time a mesh is loaded
+                */
                 this.onMeshLoadedObservable = new BABYLON.Observable();
+                /**
+                * Observable that fires each time a texture is loaded
+                */
                 this.onTextureLoadedObservable = new BABYLON.Observable();
+                /**
+                * Observable that fires each time a material is loaded
+                */
                 this.onMaterialLoadedObservable = new BABYLON.Observable();
+                /**
+                * Observable that fires each time an extension is loaded
+                */
                 this.onExtensionLoadedObservable = new BABYLON.Observable();
+                /**
+                * Observable that fires when the load has completed
+                */
                 this.onCompleteObservable = new BABYLON.Observable();
             }
+            /**
+            * @ignore, registers the loader
+            * @param name name of the loader
+            * @param factory function that converts a loader to a loader extension
+            */
             GLTFLoader._Register = function (name, factory) {
                 if (GLTFLoader._Factories[name]) {
                     BABYLON.Tools.Error("Extension with the name '" + name + "' already exists");
@@ -2730,12 +2879,18 @@ var BABYLON;
                 GLTFLoader._Names.push(name);
             };
             Object.defineProperty(GLTFLoader.prototype, "state", {
+                /**
+                * The current state of the loader
+                */
                 get: function () {
                     return this._state;
                 },
                 enumerable: true,
                 configurable: true
             });
+            /**
+            * Disposes of the loader
+            */
             GLTFLoader.prototype.dispose = function () {
                 if (this._disposed) {
                     return;
@@ -2745,6 +2900,15 @@ var BABYLON;
                 this.onDisposeObservable.clear();
                 this._clear();
             };
+            /**
+            * Imports one or more meshes from a loaded gltf file and adds them to the scene
+            * @param meshesNames a string or array of strings of the mesh names that should be loaded from the file
+            * @param scene the scene the meshes should be added to
+            * @param data gltf data containing information of the meshes in a loaded file
+            * @param rootUrl root url to load from
+            * @param onProgress event that fires when loading progress has occured
+            * @returns a promise containg the loaded meshes, particles, skeletons and animations
+            */
             GLTFLoader.prototype.importMeshAsync = function (meshesNames, scene, data, rootUrl, onProgress) {
                 var _this = this;
                 return Promise.resolve().then(function () {
@@ -2778,6 +2942,14 @@ var BABYLON;
                     });
                 });
             };
+            /**
+            * Imports all objects from a loaded gltf file and adds them to the scene
+            * @param scene the scene the objects should be added to
+            * @param data gltf data containing information of the meshes in a loaded file
+            * @param rootUrl root url to load from
+            * @param onProgress event that fires when loading progress has occured
+            * @returns a promise which completes when objects have been loaded to the scene
+            */
             GLTFLoader.prototype.loadAsync = function (scene, data, rootUrl, onProgress) {
                 return this._loadAsync(null, scene, data, rootUrl, onProgress);
             };
@@ -2935,6 +3107,9 @@ var BABYLON;
                 promises.push(this._loadAnimationsAsync());
                 return Promise.all(promises).then(function () { });
             };
+            /**
+            * @ignore
+            */
             GLTFLoader.prototype._loadSceneAsync = function (context, scene) {
                 var promise = GLTF2.GLTFLoaderExtension._LoadSceneAsync(this, context, scene);
                 if (promise) {
@@ -3034,6 +3209,9 @@ var BABYLON;
                     }
                 }
             };
+            /**
+            * @ignore
+            */
             GLTFLoader.prototype._loadNodeAsync = function (context, node) {
                 var promise = GLTF2.GLTFLoaderExtension._LoadNodeAsync(this, context, node);
                 if (promise) {
@@ -3554,6 +3732,9 @@ var BABYLON;
                 buffer._data = this._loadUriAsync(context, buffer.uri);
                 return buffer._data;
             };
+            /**
+            * @ignore
+            */
             GLTFLoader.prototype._loadBufferViewAsync = function (context, bufferView) {
                 if (bufferView._data) {
                     return bufferView._data;
@@ -3612,6 +3793,9 @@ var BABYLON;
                 });
                 return accessor._data;
             };
+            /**
+            * @ignore
+            */
             GLTFLoader.prototype._loadVertexBufferViewAsync = function (context, bufferView, kind) {
                 var _this = this;
                 if (bufferView._babylonBuffer) {
@@ -3681,6 +3865,9 @@ var BABYLON;
                 this._loadMaterialAlphaProperties(context, material, babylonMaterial);
                 return Promise.all(promises).then(function () { });
             };
+            /**
+            * @ignore
+            */
             GLTFLoader.prototype._loadMaterialAsync = function (context, material, babylonMesh, babylonDrawMode, assign) {
                 var promise = GLTF2.GLTFLoaderExtension._LoadMaterialAsync(this, context, material, babylonMesh, babylonDrawMode, assign);
                 if (promise) {
@@ -3706,12 +3893,18 @@ var BABYLON;
                 assign(babylonData.material);
                 return babylonData.loaded;
             };
+            /**
+            * @ignore
+            */
             GLTFLoader.prototype._createMaterial = function (type, name, drawMode) {
                 var babylonMaterial = new type(name, this._babylonScene);
                 babylonMaterial.sideOrientation = this._babylonScene.useRightHandedSystem ? BABYLON.Material.CounterClockWiseSideOrientation : BABYLON.Material.ClockWiseSideOrientation;
                 babylonMaterial.fillMode = drawMode;
                 return babylonMaterial;
             };
+            /**
+            * @ignore
+            */
             GLTFLoader.prototype._loadMaterialBasePropertiesAsync = function (context, material, babylonMaterial) {
                 var promises = new Array();
                 babylonMaterial.emissiveColor = material.emissiveFactor ? BABYLON.Color3.FromArray(material.emissiveFactor) : new BABYLON.Color3(0, 0, 0);
@@ -3745,6 +3938,9 @@ var BABYLON;
                 }
                 return Promise.all(promises).then(function () { });
             };
+            /**
+            * @ignore
+            */
             GLTFLoader.prototype._loadMaterialAlphaProperties = function (context, material, babylonMaterial) {
                 var alphaMode = material.alphaMode || "OPAQUE" /* OPAQUE */;
                 switch (alphaMode) {
@@ -3773,6 +3969,9 @@ var BABYLON;
                     }
                 }
             };
+            /**
+            * @ignore
+            */
             GLTFLoader.prototype._loadTextureAsync = function (context, textureInfo, assign) {
                 var _this = this;
                 var texture = GLTFLoader._GetProperty(context + "/index", this._gltf.textures, textureInfo.index);
@@ -3832,6 +4031,9 @@ var BABYLON;
                 });
                 return image._objectURL;
             };
+            /**
+            * @ignore
+            */
             GLTFLoader.prototype._loadUriAsync = function (context, uri) {
                 var _this = this;
                 var promise = GLTF2.GLTFLoaderExtension._LoadUriAsync(this, context, uri);
@@ -3889,6 +4091,9 @@ var BABYLON;
                 }
                 this._progressCallback(new BABYLON.SceneLoaderProgressEvent(lengthComputable, loaded, lengthComputable ? total : 0));
             };
+            /**
+            * @ignore
+            */
             GLTFLoader._GetProperty = function (context, array, index) {
                 if (!array || index == undefined || !array[index]) {
                     throw new Error(context + ": Failed to find index (" + index + ")");
@@ -4037,6 +4242,9 @@ var BABYLON;
                 this.onTextureLoadedObservable.clear();
                 this.onMaterialLoadedObservable.clear();
             };
+            /**
+            * @ignore
+            */
             GLTFLoader.prototype._applyExtensions = function (actionAsync) {
                 for (var _i = 0, _a = GLTFLoader._Names; _i < _a.length; _i++) {
                     var name_5 = _a[_i];
@@ -4066,6 +4274,9 @@ var BABYLON;
 (function (BABYLON) {
     var GLTF2;
     (function (GLTF2) {
+        /**
+         * Abstract class that can be implemented to extend existing gltf loader behavior.
+         */
         var GLTFLoaderExtension = /** @class */ (function () {
             function GLTFLoaderExtension(loader) {
                 this.enabled = true;
@@ -4315,6 +4526,7 @@ var __extends = (this && this.__extends) || (function () {
         d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
     };
 })();
+/** Module defining extensions to gltf */
 var BABYLON;
 (function (BABYLON) {
     var GLTF2;

+ 358 - 6
dist/preview release/loaders/babylonjs.loaders.d.ts

@@ -96,6 +96,9 @@ declare module BABYLON {
 
 
 declare module BABYLON {
+    /**
+    * Coordinate system mode that will be used when loading from the gltf file
+    */
     enum GLTFLoaderCoordinateSystemMode {
         /**
          * Automatically convert the glTF right-handed data to the appropriate system based on the current coordinate system mode of the scene.
@@ -106,6 +109,9 @@ declare module BABYLON {
          */
         FORCE_RIGHT_HANDED = 1,
     }
+    /**
+    * Animation mode that determines which animations should be started when a file is loaded
+    */
     enum GLTFLoaderAnimationStartMode {
         /**
          * No animation will start.
@@ -120,10 +126,22 @@ declare module BABYLON {
          */
         ALL = 2,
     }
+    /**
+    * Loaded gltf data
+    */
     interface IGLTFLoaderData {
+        /**
+        * Loaded json string converted to an object
+        */
         json: Object;
+        /**
+        * Loaded ArrayBufferView
+        */
         bin: Nullable<ArrayBufferView>;
     }
+    /**
+    * Gltf extension interface
+    */
     interface IGLTFLoaderExtension {
         /**
          * The name of this extension.
@@ -134,6 +152,9 @@ declare module BABYLON {
          */
         enabled: boolean;
     }
+    /**
+    * Loading state
+    */
     enum GLTFLoaderState {
         /**
          * The asset is loading.
@@ -148,29 +169,77 @@ declare module BABYLON {
          */
         COMPLETE = 2,
     }
+    /**
+    * GLTF loader interface
+    */
     interface IGLTFLoader extends IDisposable {
+        /**
+        * Coordinate system that will be used when loading from the gltf file
+        */
         coordinateSystemMode: GLTFLoaderCoordinateSystemMode;
+        /**
+        * Animation mode that determines which animations should be started when a file is loaded
+        */
         animationStartMode: GLTFLoaderAnimationStartMode;
+        /**
+        * If the materials in the file should automatically be compiled
+        */
         compileMaterials: boolean;
+        /**
+        * If a clip plane should be usede when loading meshes in the file
+        */
         useClipPlane: boolean;
+        /**
+        * If shadow generators should automatically be compiled
+        */
         compileShadowGenerators: boolean;
+        /**
+        * Observable that fires each time a mesh is loaded
+        */
         onMeshLoadedObservable: Observable<AbstractMesh>;
+        /**
+        * Observable that fires each time a texture is loaded
+        */
         onTextureLoadedObservable: Observable<BaseTexture>;
+        /**
+       * Observable that fires each time a material is loaded
+       */
         onMaterialLoadedObservable: Observable<Material>;
+        /**
+        * Observable that fires when the load has completed
+        */
         onCompleteObservable: Observable<IGLTFLoader>;
+        /**
+        * Observable that fires when the loader is disposed
+        */
         onDisposeObservable: Observable<IGLTFLoader>;
+        /**
+        * Observable that fire when an extension is loaded
+        */
         onExtensionLoadedObservable: Observable<IGLTFLoaderExtension>;
+        /**
+        * Loader state
+        */
         state: Nullable<GLTFLoaderState>;
+        /**
+        * Imports one or more meshes from a loaded gltf file and adds them to the scene
+        */
         importMeshAsync: (meshesNames: any, scene: Scene, data: IGLTFLoaderData, rootUrl: string, onProgress?: (event: SceneLoaderProgressEvent) => void) => Promise<{
             meshes: AbstractMesh[];
             particleSystems: ParticleSystem[];
             skeletons: Skeleton[];
             animationGroups: AnimationGroup[];
         }>;
+        /**
+        * Imports all objects from a loaded gltf file and adds them to the scene
+        */
         loadAsync: (scene: Scene, data: IGLTFLoaderData, rootUrl: string, onProgress?: (event: SceneLoaderProgressEvent) => void) => Promise<void>;
     }
+    /** File loader to load gltf files into a babylon scene */
     class GLTFFileLoader implements IDisposable, ISceneLoaderPluginAsync, ISceneLoaderPluginFactory {
+        /** Creates a gltf 1.0 file loader */
         static CreateGLTFLoaderV1: () => IGLTFLoader;
+        /** Creates a gltf 2.0 file loader */
         static CreateGLTFLoaderV2: () => IGLTFLoader;
         /**
          * Raised when the asset has been parsed.
@@ -179,27 +248,39 @@ declare module BABYLON {
          */
         onParsedObservable: Observable<IGLTFLoaderData>;
         private _onParsedObserver;
+        /** Raised when the asset has been parsed. */
         onParsed: (loaderData: IGLTFLoaderData) => void;
+        /**
+         * Set this property to false to disable incremental loading which delays the loader from calling the success callback until after loading the meshes and shaders. Textures always loads asynchronously. For example, the success callback can compute the bounding information of the loaded meshes when incremental loading is disabled. Defaults to true.
+         */
         static IncrementalLoading: boolean;
+        /**
+         * Set this property to true in order to work with homogeneous coordinates, available with some converters and exporters. Defaults to false. See https://en.wikipedia.org/wiki/Homogeneous_coordinates
+         */
         static HomogeneousCoordinates: boolean;
         /**
-         * The coordinate system mode (AUTO, FORCE_RIGHT_HANDED).
+         * The coordinate system mode (AUTO, FORCE_RIGHT_HANDED). Defaults to AUTO.
+         * - AUTO - Automatically convert the glTF right-handed data to the appropriate system based on the current coordinate system mode of the scene.
+         * - FORCE_RIGHT_HANDED - Sets the useRightHandedSystem flag on the scene.
          */
         coordinateSystemMode: GLTFLoaderCoordinateSystemMode;
         /**
-         * The animation start mode (NONE, FIRST, ALL).
-         */
+        * The animation start mode (NONE, FIRST, ALL). Defaults to FIRST.
+        * - NONE - No animation will start.
+        * - FIRST - The first animation will start.
+        * - ALL - All animations will start.
+        */
         animationStartMode: GLTFLoaderAnimationStartMode;
         /**
-         * Set to true to compile materials before raising the success callback.
+         * Set to true to compile materials before raising the success callback. Defaults to false.
          */
         compileMaterials: boolean;
         /**
-         * Set to true to also compile materials with clip planes.
+         * Set to true to also compile materials with clip planes. Defaults to false.
          */
         useClipPlane: boolean;
         /**
-         * Set to true to compile shadow generators before raising the success callback.
+         * Set to true to compile shadow generators before raising the success callback. Defaults to false.
          */
         compileShadowGenerators: boolean;
         /**
@@ -207,18 +288,27 @@ declare module BABYLON {
          */
         readonly onMeshLoadedObservable: Observable<AbstractMesh>;
         private _onMeshLoadedObserver;
+        /**
+         * Raised when the loader creates a mesh after parsing the glTF properties of the mesh. (onMeshLoadedObservable is likely desired instead.)
+         */
         onMeshLoaded: (mesh: AbstractMesh) => void;
         /**
          * Raised when the loader creates a texture after parsing the glTF properties of the texture.
          */
         readonly onTextureLoadedObservable: Observable<BaseTexture>;
         private _onTextureLoadedObserver;
+        /**
+         * Method called when a texture has been loaded (onTextureLoadedObservable is likely desired instead.)
+         */
         onTextureLoaded: (texture: BaseTexture) => void;
         /**
          * Raised when the loader creates a material after parsing the glTF properties of the material.
          */
         readonly onMaterialLoadedObservable: Observable<Material>;
         private _onMaterialLoadedObserver;
+        /**
+         * Method when the loader creates a material after parsing the glTF properties of the material. (onMaterialLoadedObservable is likely desired instead.)
+         */
         onMaterialLoaded: (material: Material) => void;
         /**
          * Raised when the asset is completely loaded, immediately before the loader is disposed.
@@ -227,12 +317,18 @@ declare module BABYLON {
          */
         readonly onCompleteObservable: Observable<GLTFFileLoader>;
         private _onCompleteObserver;
+        /**
+         * Raised when the asset is completely loaded, immediately before the loader is disposed. (onCompleteObservable is likely desired instead.)
+         */
         onComplete: () => void;
         /**
         * Raised after the loader is disposed.
         */
         readonly onDisposeObservable: Observable<GLTFFileLoader>;
         private _onDisposeObserver;
+        /**
+         * Raised after the loader is disposed. (onDisposeObservable is likely desired instead.)
+         */
         onDispose: () => void;
         /**
          * Raised after a loader extension is created.
@@ -240,6 +336,9 @@ declare module BABYLON {
          */
         readonly onExtensionLoadedObservable: Observable<IGLTFLoaderExtension>;
         private _onExtensionLoadedObserver;
+        /**
+         * Raised after a loader extension is created. (onExtensionLoadedObservable is likely desired instead.)
+         */
         onExtensionLoaded: (extension: IGLTFLoaderExtension) => void;
         /**
          * Returns a promise that resolves when the asset is completely loaded.
@@ -251,22 +350,65 @@ declare module BABYLON {
          */
         readonly loaderState: Nullable<GLTFLoaderState>;
         private _loader;
+        /**
+         * Name of the loader ("gltf")
+         */
         name: string;
+        /**
+         * Supported file extensions of the loader (.gltf, .glb)
+         */
         extensions: ISceneLoaderPluginExtensions;
         /**
          * Disposes the loader, releases resources during load, and cancels any outstanding requests.
          */
         dispose(): void;
+        /**
+        * Imports one or more meshes from a loaded gltf file and adds them to the scene
+        * @param meshesNames a string or array of strings of the mesh names that should be loaded from the file
+        * @param scene the scene the meshes should be added to
+        * @param data gltf data containing information of the meshes in a loaded file
+        * @param rootUrl root url to load from
+        * @param onProgress event that fires when loading progress has occured
+        * @returns a promise containg the loaded meshes, particles, skeletons and animations
+        */
         importMeshAsync(meshesNames: any, scene: Scene, data: any, rootUrl: string, onProgress?: (event: SceneLoaderProgressEvent) => void): Promise<{
             meshes: AbstractMesh[];
             particleSystems: ParticleSystem[];
             skeletons: Skeleton[];
             animationGroups: AnimationGroup[];
         }>;
+        /**
+        * Imports all objects from a loaded gltf file and adds them to the scene
+        * @param scene the scene the objects should be added to
+        * @param data gltf data containing information of the meshes in a loaded file
+        * @param rootUrl root url to load from
+        * @param onProgress event that fires when loading progress has occured
+        * @returns a promise which completes when objects have been loaded to the scene
+        */
         loadAsync(scene: Scene, data: string | ArrayBuffer, rootUrl: string, onProgress?: (event: SceneLoaderProgressEvent) => void): Promise<void>;
+        /**
+         * Load into an asset container.
+         * @param scene The scene to load into
+         * @param data The data to import
+         * @param rootUrl The root url for scene and resources
+         * @param onProgress The callback when the load progresses
+         * @returns The loaded asset container
+         */
         loadAssetContainerAsync(scene: Scene, data: string | ArrayBuffer, rootUrl: string, onProgress?: (event: SceneLoaderProgressEvent) => void): Promise<AssetContainer>;
+        /**
+         * If the data string can be loaded directly
+         * @param data string contianing the file data
+         * @returns if the data can be loaded directly
+         */
         canDirectLoad(data: string): boolean;
+        /**
+         * Rewrites a url by combining a root url and response url
+         */
         rewriteRootURL: (rootUrl: string, responseURL?: string) => string;
+        /**
+         * Instantiates a gltf file loader plugin
+         * @returns the created plugin
+         */
         createPlugin(): ISceneLoaderPlugin | ISceneLoaderPluginAsync;
         private _parse(data);
         private _getLoader(loaderData);
@@ -683,9 +825,21 @@ declare module BABYLON.GLTF1 {
         onMaterialLoadedObservable: Observable<Material>;
         onCompleteObservable: Observable<IGLTFLoader>;
         onExtensionLoadedObservable: Observable<IGLTFLoaderExtension>;
+        /**
+        * State of the loader
+        */
         state: Nullable<GLTFLoaderState>;
         dispose(): void;
         private _importMeshAsync(meshesNames, scene, data, rootUrl, onSuccess, onProgress?, onError?);
+        /**
+        * Imports one or more meshes from a loaded gltf file and adds them to the scene
+        * @param meshesNames a string or array of strings of the mesh names that should be loaded from the file
+        * @param scene the scene the meshes should be added to
+        * @param data gltf data containing information of the meshes in a loaded file
+        * @param rootUrl root url to load from
+        * @param onProgress event that fires when loading progress has occured
+        * @returns a promise containg the loaded meshes, particles, skeletons and animations
+        */
         importMeshAsync(meshesNames: any, scene: Scene, data: IGLTFLoaderData, rootUrl: string, onProgress?: (event: SceneLoaderProgressEvent) => void): Promise<{
             meshes: AbstractMesh[];
             particleSystems: ParticleSystem[];
@@ -693,6 +847,14 @@ declare module BABYLON.GLTF1 {
             animationGroups: AnimationGroup[];
         }>;
         private _loadAsync(scene, data, rootUrl, onSuccess, onProgress?, onError?);
+        /**
+        * Imports all objects from a loaded gltf file and adds them to the scene
+        * @param scene the scene the objects should be added to
+        * @param data gltf data containing information of the meshes in a loaded file
+        * @param rootUrl root url to load from
+        * @param onProgress event that fires when loading progress has occured
+        * @returns a promise which completes when objects have been loaded to the scene
+        */
         loadAsync(scene: Scene, data: IGLTFLoaderData, rootUrl: string, onProgress?: (event: SceneLoaderProgressEvent) => void): Promise<void>;
         private _loadShadersAsync(gltfRuntime, onload);
         private _loadBuffersAsync(gltfRuntime, onLoad, onProgress?);
@@ -837,48 +999,84 @@ declare module BABYLON.GLTF1 {
 
 
 declare module BABYLON.GLTF2 {
+    /** Array item which contains it's index in an array */
     interface IArrayItem {
         _index: number;
     }
+    /** Array item helper methods */
     class ArrayItem {
+        /** Sets the index of each array element to its index in the array */
         static Assign(values?: IArrayItem[]): void;
     }
 }
 
 
 
+/**
+ * GLTF2 module for babylon
+ */
 declare module BABYLON.GLTF2 {
+    /**
+     * Interface to access data and vertex buffer associated with a file
+     */
     interface ILoaderAccessor extends IAccessor, IArrayItem {
         _data?: Promise<ArrayBufferView>;
         _babylonVertexBuffer?: Promise<VertexBuffer>;
     }
+    /**
+     * Loader's animation channel
+     */
     interface ILoaderAnimationChannel extends IAnimationChannel, IArrayItem {
     }
+    /**
+     * Container for animation keyframe data
+     */
     interface ILoaderAnimationSamplerData {
         input: Float32Array;
         interpolation: AnimationSamplerInterpolation;
         output: Float32Array;
     }
+    /**
+     * Keyframe data
+     */
     interface ILoaderAnimationSampler extends IAnimationSampler, IArrayItem {
         _data: Promise<ILoaderAnimationSamplerData>;
     }
+    /**
+     * Loader animation
+     */
     interface ILoaderAnimation extends IAnimation, IArrayItem {
         channels: ILoaderAnimationChannel[];
         samplers: ILoaderAnimationSampler[];
         _babylonAnimationGroup?: AnimationGroup;
     }
+    /**
+     * Loader buffer
+     */
     interface ILoaderBuffer extends IBuffer, IArrayItem {
         _data?: Promise<ArrayBufferView>;
     }
+    /**
+     * Loader's buffer data
+     */
     interface ILoaderBufferView extends IBufferView, IArrayItem {
         _data?: Promise<ArrayBufferView>;
         _babylonBuffer?: Promise<Buffer>;
     }
+    /**
+     * Loader's loaded camera data
+     */
     interface ILoaderCamera extends ICamera, IArrayItem {
     }
+    /**
+     * Loaded image specified by url
+     */
     interface ILoaderImage extends IImage, IArrayItem {
         _objectURL?: Promise<string>;
     }
+    /**
+     * Loaded material data
+     */
     interface ILoaderMaterial extends IMaterial, IArrayItem {
         _babylonData?: {
             [drawMode: number]: {
@@ -888,11 +1086,20 @@ declare module BABYLON.GLTF2 {
             };
         };
     }
+    /**
+     * Loader mesh data
+     */
     interface ILoaderMesh extends IMesh, IArrayItem {
         primitives: ILoaderMeshPrimitive[];
     }
+    /**
+     * Loader mesh data
+     */
     interface ILoaderMeshPrimitive extends IMeshPrimitive, IArrayItem {
     }
+    /**
+     * Node for traversing loader data
+     */
     interface ILoaderNode extends INode, IArrayItem {
         _parent: ILoaderNode;
         _babylonMesh?: Mesh;
@@ -900,23 +1107,41 @@ declare module BABYLON.GLTF2 {
         _babylonAnimationTargets?: Node[];
         _numMorphTargets?: number;
     }
+    /**
+     * Sampler data
+     */
     interface ILoaderSamplerData {
         noMipMaps: boolean;
         samplingMode: number;
         wrapU: number;
         wrapV: number;
     }
+    /**
+     * Sampler data
+     */
     interface ILoaderSampler extends ISampler, IArrayItem {
         _data?: ILoaderSamplerData;
     }
+    /**
+     * Loader's scene
+     */
     interface ILoaderScene extends IScene, IArrayItem {
     }
+    /**
+     * Loader's skeleton data
+     */
     interface ILoaderSkin extends ISkin, IArrayItem {
         _babylonSkeleton?: Skeleton;
         _loaded?: Promise<void>;
     }
+    /**
+     * Loader's texture
+     */
     interface ILoaderTexture extends ITexture, IArrayItem {
     }
+    /**
+     * Loaded GLTF data
+     */
     interface ILoaderGLTF extends IGLTF {
         accessors?: ILoaderAccessor[];
         animations?: ILoaderAnimation[];
@@ -935,14 +1160,40 @@ declare module BABYLON.GLTF2 {
 }
 
 
+/**
+* Defines the GLTF2 module used to import/export GLTF 2.0 files
+*/
 declare module BABYLON.GLTF2 {
+    /**
+    * Interface for a meterial with a constructor
+    */
     interface MaterialConstructor<T extends Material> {
+        /**
+        * The material class
+        */
         readonly prototype: T;
+        /**
+        * Instatiates a material
+        * @param name name of the material
+        * @param scene the scene the material will be added to
+        */
         new (name: string, scene: Scene): T;
     }
+    /**
+    * Used to load from a GLTF2 file
+    */
     class GLTFLoader implements IGLTFLoader {
+        /**
+        * @ignore
+        */
         _gltf: ILoaderGLTF;
+        /**
+        * @ignore
+        */
         _babylonScene: Scene;
+        /**
+        * @ignore
+        */
         _completePromises: Promise<void>[];
         private _disposed;
         private _state;
@@ -955,26 +1206,87 @@ declare module BABYLON.GLTF2 {
         private _requests;
         private static _Names;
         private static _Factories;
+        /**
+        * @ignore, registers the loader
+        * @param name name of the loader
+        * @param factory function that converts a loader to a loader extension
+        */
         static _Register(name: string, factory: (loader: GLTFLoader) => GLTFLoaderExtension): void;
+        /**
+        * Coordinate system that will be used when loading from the gltf file
+        */
         coordinateSystemMode: GLTFLoaderCoordinateSystemMode;
+        /**
+        * Animation mode that determines which animations should be started when a file is loaded
+        */
         animationStartMode: GLTFLoaderAnimationStartMode;
+        /**
+        * If the materials in the file should automatically be compiled
+        */
         compileMaterials: boolean;
+        /**
+        * If a clip plane should be usede when loading meshes in the file
+        */
         useClipPlane: boolean;
+        /**
+        * If shadow generators should automatically be compiled
+        */
         compileShadowGenerators: boolean;
+        /**
+        * Observable that fires when the loader is disposed
+        */
         readonly onDisposeObservable: Observable<IGLTFLoader>;
+        /**
+        * Observable that fires each time a mesh is loaded
+        */
         readonly onMeshLoadedObservable: Observable<AbstractMesh>;
+        /**
+        * Observable that fires each time a texture is loaded
+        */
         readonly onTextureLoadedObservable: Observable<BaseTexture>;
+        /**
+        * Observable that fires each time a material is loaded
+        */
         readonly onMaterialLoadedObservable: Observable<Material>;
+        /**
+        * Observable that fires each time an extension is loaded
+        */
         readonly onExtensionLoadedObservable: Observable<IGLTFLoaderExtension>;
+        /**
+        * Observable that fires when the load has completed
+        */
         readonly onCompleteObservable: Observable<IGLTFLoader>;
+        /**
+        * The current state of the loader
+        */
         readonly state: Nullable<GLTFLoaderState>;
+        /**
+        * Disposes of the loader
+        */
         dispose(): void;
+        /**
+        * Imports one or more meshes from a loaded gltf file and adds them to the scene
+        * @param meshesNames a string or array of strings of the mesh names that should be loaded from the file
+        * @param scene the scene the meshes should be added to
+        * @param data gltf data containing information of the meshes in a loaded file
+        * @param rootUrl root url to load from
+        * @param onProgress event that fires when loading progress has occured
+        * @returns a promise containg the loaded meshes, particles, skeletons and animations
+        */
         importMeshAsync(meshesNames: any, scene: Scene, data: IGLTFLoaderData, rootUrl: string, onProgress?: (event: SceneLoaderProgressEvent) => void): Promise<{
             meshes: AbstractMesh[];
             particleSystems: ParticleSystem[];
             skeletons: Skeleton[];
             animationGroups: AnimationGroup[];
         }>;
+        /**
+        * Imports all objects from a loaded gltf file and adds them to the scene
+        * @param scene the scene the objects should be added to
+        * @param data gltf data containing information of the meshes in a loaded file
+        * @param rootUrl root url to load from
+        * @param onProgress event that fires when loading progress has occured
+        * @returns a promise which completes when objects have been loaded to the scene
+        */
         loadAsync(scene: Scene, data: IGLTFLoaderData, rootUrl: string, onProgress?: (event: SceneLoaderProgressEvent) => void): Promise<void>;
         private _loadAsync(nodes, scene, data, rootUrl, onProgress?);
         private _loadExtensions();
@@ -983,12 +1295,18 @@ declare module BABYLON.GLTF2 {
         private _checkExtensions();
         private _createRootNode();
         private _loadNodesAsync(nodes);
+        /**
+        * @ignore
+        */
         _loadSceneAsync(context: string, scene: ILoaderScene): Promise<void>;
         private _forEachPrimitive(node, callback);
         private _getMeshes();
         private _getSkeletons();
         private _getAnimationGroups();
         private _startAnimations();
+        /**
+        * @ignore
+        */
         _loadNodeAsync(context: string, node: ILoaderNode): Promise<void>;
         private _loadMeshAsync(context, node, mesh, babylonMesh);
         private _loadPrimitiveAsync(context, node, mesh, primitive, babylonMesh);
@@ -1008,21 +1326,48 @@ declare module BABYLON.GLTF2 {
         private _loadAnimationChannelAsync(context, animationContext, animation, channel, babylonAnimationGroup);
         private _loadAnimationSamplerAsync(context, sampler);
         private _loadBufferAsync(context, buffer);
+        /**
+        * @ignore
+        */
         _loadBufferViewAsync(context: string, bufferView: ILoaderBufferView): Promise<ArrayBufferView>;
         private _loadAccessorAsync(context, accessor);
+        /**
+        * @ignore
+        */
         _loadVertexBufferViewAsync(context: string, bufferView: ILoaderBufferView, kind: string): Promise<Buffer>;
         private _loadVertexAccessorAsync(context, accessor, kind);
         private _getDefaultMaterial(drawMode);
         private _loadMaterialMetallicRoughnessPropertiesAsync(context, material, babylonMaterial);
+        /**
+        * @ignore
+        */
         _loadMaterialAsync(context: string, material: ILoaderMaterial, babylonMesh: Mesh, babylonDrawMode: number, assign: (babylonMaterial: Material) => void): Promise<void>;
+        /**
+        * @ignore
+        */
         _createMaterial<T extends Material>(type: MaterialConstructor<T>, name: string, drawMode: number): T;
+        /**
+        * @ignore
+        */
         _loadMaterialBasePropertiesAsync(context: string, material: ILoaderMaterial, babylonMaterial: PBRMaterial): Promise<void>;
+        /**
+        * @ignore
+        */
         _loadMaterialAlphaProperties(context: string, material: ILoaderMaterial, babylonMaterial: PBRMaterial): void;
+        /**
+        * @ignore
+        */
         _loadTextureAsync(context: string, textureInfo: ITextureInfo, assign: (texture: Texture) => void): Promise<void>;
         private _loadSampler(context, sampler);
         private _loadImageAsync(context, image);
+        /**
+        * @ignore
+        */
         _loadUriAsync(context: string, uri: string): Promise<ArrayBufferView>;
         private _onProgress();
+        /**
+        * @ignore
+        */
         static _GetProperty<T>(context: string, array: ArrayLike<T> | undefined, index: number | undefined): T;
         private static _GetTextureWrapMode(context, mode);
         private static _GetTextureSamplingMode(context, magFilter?, minFilter?);
@@ -1032,12 +1377,18 @@ declare module BABYLON.GLTF2 {
         private _compileMaterialsAsync();
         private _compileShadowGeneratorsAsync();
         private _clear();
+        /**
+        * @ignore
+        */
         _applyExtensions<T>(actionAsync: (extension: GLTFLoaderExtension) => Nullable<Promise<T>>): Nullable<Promise<T>>;
     }
 }
 
 
 declare module BABYLON.GLTF2 {
+    /**
+     * Abstract class that can be implemented to extend existing gltf loader behavior.
+     */
     abstract class GLTFLoaderExtension implements IGLTFLoaderExtension, IDisposable {
         enabled: boolean;
         readonly abstract name: string;
@@ -1092,6 +1443,7 @@ declare module BABYLON.GLTF2.Extensions {
 }
 
 
+/** Module defining extensions to gltf */
 declare module BABYLON.GLTF2.Extensions {
     class KHR_draco_mesh_compression extends GLTFLoaderExtension {
         readonly name: string;

+ 218 - 6
dist/preview release/loaders/babylonjs.loaders.js

@@ -1001,6 +1001,9 @@ var BABYLON;
 
 var BABYLON;
 (function (BABYLON) {
+    /**
+    * Coordinate system mode that will be used when loading from the gltf file
+    */
     var GLTFLoaderCoordinateSystemMode;
     (function (GLTFLoaderCoordinateSystemMode) {
         /**
@@ -1012,6 +1015,9 @@ var BABYLON;
          */
         GLTFLoaderCoordinateSystemMode[GLTFLoaderCoordinateSystemMode["FORCE_RIGHT_HANDED"] = 1] = "FORCE_RIGHT_HANDED";
     })(GLTFLoaderCoordinateSystemMode = BABYLON.GLTFLoaderCoordinateSystemMode || (BABYLON.GLTFLoaderCoordinateSystemMode = {}));
+    /**
+    * Animation mode that determines which animations should be started when a file is loaded
+    */
     var GLTFLoaderAnimationStartMode;
     (function (GLTFLoaderAnimationStartMode) {
         /**
@@ -1027,6 +1033,9 @@ var BABYLON;
          */
         GLTFLoaderAnimationStartMode[GLTFLoaderAnimationStartMode["ALL"] = 2] = "ALL";
     })(GLTFLoaderAnimationStartMode = BABYLON.GLTFLoaderAnimationStartMode || (BABYLON.GLTFLoaderAnimationStartMode = {}));
+    /**
+    * Loading state
+    */
     var GLTFLoaderState;
     (function (GLTFLoaderState) {
         /**
@@ -1042,6 +1051,7 @@ var BABYLON;
          */
         GLTFLoaderState[GLTFLoaderState["COMPLETE"] = 2] = "COMPLETE";
     })(GLTFLoaderState = BABYLON.GLTFLoaderState || (BABYLON.GLTFLoaderState = {}));
+    /** File loader to load gltf files into a babylon scene */
     var GLTFFileLoader = /** @class */ (function () {
         function GLTFFileLoader() {
             // #region Common options
@@ -1054,23 +1064,28 @@ var BABYLON;
             // #endregion
             // #region V2 options
             /**
-             * The coordinate system mode (AUTO, FORCE_RIGHT_HANDED).
+             * The coordinate system mode (AUTO, FORCE_RIGHT_HANDED). Defaults to AUTO.
+             * - AUTO - Automatically convert the glTF right-handed data to the appropriate system based on the current coordinate system mode of the scene.
+             * - FORCE_RIGHT_HANDED - Sets the useRightHandedSystem flag on the scene.
              */
             this.coordinateSystemMode = GLTFLoaderCoordinateSystemMode.AUTO;
             /**
-             * The animation start mode (NONE, FIRST, ALL).
-             */
+            * The animation start mode (NONE, FIRST, ALL). Defaults to FIRST.
+            * - NONE - No animation will start.
+            * - FIRST - The first animation will start.
+            * - ALL - All animations will start.
+            */
             this.animationStartMode = GLTFLoaderAnimationStartMode.FIRST;
             /**
-             * Set to true to compile materials before raising the success callback.
+             * Set to true to compile materials before raising the success callback. Defaults to false.
              */
             this.compileMaterials = false;
             /**
-             * Set to true to also compile materials with clip planes.
+             * Set to true to also compile materials with clip planes. Defaults to false.
              */
             this.useClipPlane = false;
             /**
-             * Set to true to compile shadow generators before raising the success callback.
+             * Set to true to compile shadow generators before raising the success callback. Defaults to false.
              */
             this.compileShadowGenerators = false;
             /**
@@ -1102,13 +1117,20 @@ var BABYLON;
             this.onExtensionLoadedObservable = new BABYLON.Observable();
             // #endregion
             this._loader = null;
+            /**
+             * Name of the loader ("gltf")
+             */
             this.name = "gltf";
+            /**
+             * Supported file extensions of the loader (.gltf, .glb)
+             */
             this.extensions = {
                 ".gltf": { isBinary: false },
                 ".glb": { isBinary: true }
             };
         }
         Object.defineProperty(GLTFFileLoader.prototype, "onParsed", {
+            /** Raised when the asset has been parsed. */
             set: function (callback) {
                 if (this._onParsedObserver) {
                     this.onParsedObservable.remove(this._onParsedObserver);
@@ -1119,6 +1141,9 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(GLTFFileLoader.prototype, "onMeshLoaded", {
+            /**
+             * Raised when the loader creates a mesh after parsing the glTF properties of the mesh. (onMeshLoadedObservable is likely desired instead.)
+             */
             set: function (callback) {
                 if (this._onMeshLoadedObserver) {
                     this.onMeshLoadedObservable.remove(this._onMeshLoadedObserver);
@@ -1129,6 +1154,9 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(GLTFFileLoader.prototype, "onTextureLoaded", {
+            /**
+             * Method called when a texture has been loaded (onTextureLoadedObservable is likely desired instead.)
+             */
             set: function (callback) {
                 if (this._onTextureLoadedObserver) {
                     this.onTextureLoadedObservable.remove(this._onTextureLoadedObserver);
@@ -1139,6 +1167,9 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(GLTFFileLoader.prototype, "onMaterialLoaded", {
+            /**
+             * Method when the loader creates a material after parsing the glTF properties of the material. (onMaterialLoadedObservable is likely desired instead.)
+             */
             set: function (callback) {
                 if (this._onMaterialLoadedObserver) {
                     this.onMaterialLoadedObservable.remove(this._onMaterialLoadedObserver);
@@ -1149,6 +1180,9 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(GLTFFileLoader.prototype, "onComplete", {
+            /**
+             * Raised when the asset is completely loaded, immediately before the loader is disposed. (onCompleteObservable is likely desired instead.)
+             */
             set: function (callback) {
                 if (this._onCompleteObserver) {
                     this.onCompleteObservable.remove(this._onCompleteObserver);
@@ -1159,6 +1193,9 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(GLTFFileLoader.prototype, "onDispose", {
+            /**
+             * Raised after the loader is disposed. (onDisposeObservable is likely desired instead.)
+             */
             set: function (callback) {
                 if (this._onDisposeObserver) {
                     this.onDisposeObservable.remove(this._onDisposeObserver);
@@ -1169,6 +1206,9 @@ var BABYLON;
             configurable: true
         });
         Object.defineProperty(GLTFFileLoader.prototype, "onExtensionLoaded", {
+            /**
+             * Raised after a loader extension is created. (onExtensionLoadedObservable is likely desired instead.)
+             */
             set: function (callback) {
                 if (this._onExtensionLoadedObserver) {
                     this.onExtensionLoadedObservable.remove(this._onExtensionLoadedObserver);
@@ -1214,6 +1254,15 @@ var BABYLON;
             this.onDisposeObservable.notifyObservers(this);
             this.onDisposeObservable.clear();
         };
+        /**
+        * Imports one or more meshes from a loaded gltf file and adds them to the scene
+        * @param meshesNames a string or array of strings of the mesh names that should be loaded from the file
+        * @param scene the scene the meshes should be added to
+        * @param data gltf data containing information of the meshes in a loaded file
+        * @param rootUrl root url to load from
+        * @param onProgress event that fires when loading progress has occured
+        * @returns a promise containg the loaded meshes, particles, skeletons and animations
+        */
         GLTFFileLoader.prototype.importMeshAsync = function (meshesNames, scene, data, rootUrl, onProgress) {
             var _this = this;
             return Promise.resolve().then(function () {
@@ -1222,6 +1271,14 @@ var BABYLON;
                 return _this._loader.importMeshAsync(meshesNames, scene, loaderData, rootUrl, onProgress);
             });
         };
+        /**
+        * Imports all objects from a loaded gltf file and adds them to the scene
+        * @param scene the scene the objects should be added to
+        * @param data gltf data containing information of the meshes in a loaded file
+        * @param rootUrl root url to load from
+        * @param onProgress event that fires when loading progress has occured
+        * @returns a promise which completes when objects have been loaded to the scene
+        */
         GLTFFileLoader.prototype.loadAsync = function (scene, data, rootUrl, onProgress) {
             var _this = this;
             return Promise.resolve().then(function () {
@@ -1230,6 +1287,14 @@ var BABYLON;
                 return _this._loader.loadAsync(scene, loaderData, rootUrl, onProgress);
             });
         };
+        /**
+         * Load into an asset container.
+         * @param scene The scene to load into
+         * @param data The data to import
+         * @param rootUrl The root url for scene and resources
+         * @param onProgress The callback when the load progresses
+         * @returns The loaded asset container
+         */
         GLTFFileLoader.prototype.loadAssetContainerAsync = function (scene, data, rootUrl, onProgress) {
             var _this = this;
             return Promise.resolve().then(function () {
@@ -1246,9 +1311,18 @@ var BABYLON;
                 });
             });
         };
+        /**
+         * If the data string can be loaded directly
+         * @param data string contianing the file data
+         * @returns if the data can be loaded directly
+         */
         GLTFFileLoader.prototype.canDirectLoad = function (data) {
             return ((data.indexOf("scene") !== -1) && (data.indexOf("node") !== -1));
         };
+        /**
+         * Instantiates a gltf file loader plugin
+         * @returns the created plugin
+         */
         GLTFFileLoader.prototype.createPlugin = function () {
             return new GLTFFileLoader();
         };
@@ -1432,7 +1506,13 @@ var BABYLON;
         };
         // #endregion
         // #region V1 options
+        /**
+         * Set this property to false to disable incremental loading which delays the loader from calling the success callback until after loading the meshes and shaders. Textures always loads asynchronously. For example, the success callback can compute the bounding information of the loaded meshes when incremental loading is disabled. Defaults to true.
+         */
         GLTFFileLoader.IncrementalLoading = true;
+        /**
+         * Set this property to true in order to work with homogeneous coordinates, available with some converters and exporters. Defaults to false. See https://en.wikipedia.org/wiki/Homogeneous_coordinates
+         */
         GLTFFileLoader.HomogeneousCoordinates = false;
         return GLTFFileLoader;
     }());
@@ -2869,6 +2949,9 @@ var BABYLON;
                 this.onMaterialLoadedObservable = new BABYLON.Observable();
                 this.onCompleteObservable = new BABYLON.Observable();
                 this.onExtensionLoadedObservable = new BABYLON.Observable();
+                /**
+                * State of the loader
+                */
                 this.state = null;
             }
             GLTFLoader.RegisterExtension = function (extension) {
@@ -2931,6 +3014,15 @@ var BABYLON;
                 }, onError);
                 return true;
             };
+            /**
+            * Imports one or more meshes from a loaded gltf file and adds them to the scene
+            * @param meshesNames a string or array of strings of the mesh names that should be loaded from the file
+            * @param scene the scene the meshes should be added to
+            * @param data gltf data containing information of the meshes in a loaded file
+            * @param rootUrl root url to load from
+            * @param onProgress event that fires when loading progress has occured
+            * @returns a promise containg the loaded meshes, particles, skeletons and animations
+            */
             GLTFLoader.prototype.importMeshAsync = function (meshesNames, scene, data, rootUrl, onProgress) {
                 var _this = this;
                 return new Promise(function (resolve, reject) {
@@ -2970,6 +3062,14 @@ var BABYLON;
                     }, onError);
                 }, onError);
             };
+            /**
+            * Imports all objects from a loaded gltf file and adds them to the scene
+            * @param scene the scene the objects should be added to
+            * @param data gltf data containing information of the meshes in a loaded file
+            * @param rootUrl root url to load from
+            * @param onProgress event that fires when loading progress has occured
+            * @returns a promise which completes when objects have been loaded to the scene
+            */
             GLTFLoader.prototype.loadAsync = function (scene, data, rootUrl, onProgress) {
                 var _this = this;
                 return new Promise(function (resolve, reject) {
@@ -3653,9 +3753,11 @@ var BABYLON;
 (function (BABYLON) {
     var GLTF2;
     (function (GLTF2) {
+        /** Array item helper methods */
         var ArrayItem = /** @class */ (function () {
             function ArrayItem() {
             }
+            /** Sets the index of each array element to its index in the array */
             ArrayItem.Assign = function (values) {
                 if (values) {
                     for (var index = 0; index < values.length; index++) {
@@ -3677,12 +3779,21 @@ var BABYLON;
 //# sourceMappingURL=babylon.glTFLoaderInterfaces.js.map
 
 
+/**
+* Defines the GLTF2 module used to import/export GLTF 2.0 files
+*/
 var BABYLON;
 (function (BABYLON) {
     var GLTF2;
     (function (GLTF2) {
+        /**
+        * Used to load from a GLTF2 file
+        */
         var GLTFLoader = /** @class */ (function () {
             function GLTFLoader() {
+                /**
+                * @ignore
+                */
                 this._completePromises = new Array();
                 this._disposed = false;
                 this._state = null;
@@ -3690,18 +3801,56 @@ var BABYLON;
                 this._defaultSampler = {};
                 this._defaultBabylonMaterials = {};
                 this._requests = new Array();
+                /**
+                * Coordinate system that will be used when loading from the gltf file
+                */
                 this.coordinateSystemMode = BABYLON.GLTFLoaderCoordinateSystemMode.AUTO;
+                /**
+                * Animation mode that determines which animations should be started when a file is loaded
+                */
                 this.animationStartMode = BABYLON.GLTFLoaderAnimationStartMode.FIRST;
+                /**
+                * If the materials in the file should automatically be compiled
+                */
                 this.compileMaterials = false;
+                /**
+                * If a clip plane should be usede when loading meshes in the file
+                */
                 this.useClipPlane = false;
+                /**
+                * If shadow generators should automatically be compiled
+                */
                 this.compileShadowGenerators = false;
+                /**
+                * Observable that fires when the loader is disposed
+                */
                 this.onDisposeObservable = new BABYLON.Observable();
+                /**
+                * Observable that fires each time a mesh is loaded
+                */
                 this.onMeshLoadedObservable = new BABYLON.Observable();
+                /**
+                * Observable that fires each time a texture is loaded
+                */
                 this.onTextureLoadedObservable = new BABYLON.Observable();
+                /**
+                * Observable that fires each time a material is loaded
+                */
                 this.onMaterialLoadedObservable = new BABYLON.Observable();
+                /**
+                * Observable that fires each time an extension is loaded
+                */
                 this.onExtensionLoadedObservable = new BABYLON.Observable();
+                /**
+                * Observable that fires when the load has completed
+                */
                 this.onCompleteObservable = new BABYLON.Observable();
             }
+            /**
+            * @ignore, registers the loader
+            * @param name name of the loader
+            * @param factory function that converts a loader to a loader extension
+            */
             GLTFLoader._Register = function (name, factory) {
                 if (GLTFLoader._Factories[name]) {
                     BABYLON.Tools.Error("Extension with the name '" + name + "' already exists");
@@ -3712,12 +3861,18 @@ var BABYLON;
                 GLTFLoader._Names.push(name);
             };
             Object.defineProperty(GLTFLoader.prototype, "state", {
+                /**
+                * The current state of the loader
+                */
                 get: function () {
                     return this._state;
                 },
                 enumerable: true,
                 configurable: true
             });
+            /**
+            * Disposes of the loader
+            */
             GLTFLoader.prototype.dispose = function () {
                 if (this._disposed) {
                     return;
@@ -3727,6 +3882,15 @@ var BABYLON;
                 this.onDisposeObservable.clear();
                 this._clear();
             };
+            /**
+            * Imports one or more meshes from a loaded gltf file and adds them to the scene
+            * @param meshesNames a string or array of strings of the mesh names that should be loaded from the file
+            * @param scene the scene the meshes should be added to
+            * @param data gltf data containing information of the meshes in a loaded file
+            * @param rootUrl root url to load from
+            * @param onProgress event that fires when loading progress has occured
+            * @returns a promise containg the loaded meshes, particles, skeletons and animations
+            */
             GLTFLoader.prototype.importMeshAsync = function (meshesNames, scene, data, rootUrl, onProgress) {
                 var _this = this;
                 return Promise.resolve().then(function () {
@@ -3760,6 +3924,14 @@ var BABYLON;
                     });
                 });
             };
+            /**
+            * Imports all objects from a loaded gltf file and adds them to the scene
+            * @param scene the scene the objects should be added to
+            * @param data gltf data containing information of the meshes in a loaded file
+            * @param rootUrl root url to load from
+            * @param onProgress event that fires when loading progress has occured
+            * @returns a promise which completes when objects have been loaded to the scene
+            */
             GLTFLoader.prototype.loadAsync = function (scene, data, rootUrl, onProgress) {
                 return this._loadAsync(null, scene, data, rootUrl, onProgress);
             };
@@ -3917,6 +4089,9 @@ var BABYLON;
                 promises.push(this._loadAnimationsAsync());
                 return Promise.all(promises).then(function () { });
             };
+            /**
+            * @ignore
+            */
             GLTFLoader.prototype._loadSceneAsync = function (context, scene) {
                 var promise = GLTF2.GLTFLoaderExtension._LoadSceneAsync(this, context, scene);
                 if (promise) {
@@ -4016,6 +4191,9 @@ var BABYLON;
                     }
                 }
             };
+            /**
+            * @ignore
+            */
             GLTFLoader.prototype._loadNodeAsync = function (context, node) {
                 var promise = GLTF2.GLTFLoaderExtension._LoadNodeAsync(this, context, node);
                 if (promise) {
@@ -4536,6 +4714,9 @@ var BABYLON;
                 buffer._data = this._loadUriAsync(context, buffer.uri);
                 return buffer._data;
             };
+            /**
+            * @ignore
+            */
             GLTFLoader.prototype._loadBufferViewAsync = function (context, bufferView) {
                 if (bufferView._data) {
                     return bufferView._data;
@@ -4594,6 +4775,9 @@ var BABYLON;
                 });
                 return accessor._data;
             };
+            /**
+            * @ignore
+            */
             GLTFLoader.prototype._loadVertexBufferViewAsync = function (context, bufferView, kind) {
                 var _this = this;
                 if (bufferView._babylonBuffer) {
@@ -4663,6 +4847,9 @@ var BABYLON;
                 this._loadMaterialAlphaProperties(context, material, babylonMaterial);
                 return Promise.all(promises).then(function () { });
             };
+            /**
+            * @ignore
+            */
             GLTFLoader.prototype._loadMaterialAsync = function (context, material, babylonMesh, babylonDrawMode, assign) {
                 var promise = GLTF2.GLTFLoaderExtension._LoadMaterialAsync(this, context, material, babylonMesh, babylonDrawMode, assign);
                 if (promise) {
@@ -4688,12 +4875,18 @@ var BABYLON;
                 assign(babylonData.material);
                 return babylonData.loaded;
             };
+            /**
+            * @ignore
+            */
             GLTFLoader.prototype._createMaterial = function (type, name, drawMode) {
                 var babylonMaterial = new type(name, this._babylonScene);
                 babylonMaterial.sideOrientation = this._babylonScene.useRightHandedSystem ? BABYLON.Material.CounterClockWiseSideOrientation : BABYLON.Material.ClockWiseSideOrientation;
                 babylonMaterial.fillMode = drawMode;
                 return babylonMaterial;
             };
+            /**
+            * @ignore
+            */
             GLTFLoader.prototype._loadMaterialBasePropertiesAsync = function (context, material, babylonMaterial) {
                 var promises = new Array();
                 babylonMaterial.emissiveColor = material.emissiveFactor ? BABYLON.Color3.FromArray(material.emissiveFactor) : new BABYLON.Color3(0, 0, 0);
@@ -4727,6 +4920,9 @@ var BABYLON;
                 }
                 return Promise.all(promises).then(function () { });
             };
+            /**
+            * @ignore
+            */
             GLTFLoader.prototype._loadMaterialAlphaProperties = function (context, material, babylonMaterial) {
                 var alphaMode = material.alphaMode || "OPAQUE" /* OPAQUE */;
                 switch (alphaMode) {
@@ -4755,6 +4951,9 @@ var BABYLON;
                     }
                 }
             };
+            /**
+            * @ignore
+            */
             GLTFLoader.prototype._loadTextureAsync = function (context, textureInfo, assign) {
                 var _this = this;
                 var texture = GLTFLoader._GetProperty(context + "/index", this._gltf.textures, textureInfo.index);
@@ -4814,6 +5013,9 @@ var BABYLON;
                 });
                 return image._objectURL;
             };
+            /**
+            * @ignore
+            */
             GLTFLoader.prototype._loadUriAsync = function (context, uri) {
                 var _this = this;
                 var promise = GLTF2.GLTFLoaderExtension._LoadUriAsync(this, context, uri);
@@ -4871,6 +5073,9 @@ var BABYLON;
                 }
                 this._progressCallback(new BABYLON.SceneLoaderProgressEvent(lengthComputable, loaded, lengthComputable ? total : 0));
             };
+            /**
+            * @ignore
+            */
             GLTFLoader._GetProperty = function (context, array, index) {
                 if (!array || index == undefined || !array[index]) {
                     throw new Error(context + ": Failed to find index (" + index + ")");
@@ -5019,6 +5224,9 @@ var BABYLON;
                 this.onTextureLoadedObservable.clear();
                 this.onMaterialLoadedObservable.clear();
             };
+            /**
+            * @ignore
+            */
             GLTFLoader.prototype._applyExtensions = function (actionAsync) {
                 for (var _i = 0, _a = GLTFLoader._Names; _i < _a.length; _i++) {
                     var name_5 = _a[_i];
@@ -5048,6 +5256,9 @@ var BABYLON;
 (function (BABYLON) {
     var GLTF2;
     (function (GLTF2) {
+        /**
+         * Abstract class that can be implemented to extend existing gltf loader behavior.
+         */
         var GLTFLoaderExtension = /** @class */ (function () {
             function GLTFLoaderExtension(loader) {
                 this.enabled = true;
@@ -5279,6 +5490,7 @@ var BABYLON;
 
 
 
+/** Module defining extensions to gltf */
 var BABYLON;
 (function (BABYLON) {
     var GLTF2;

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

@@ -103,6 +103,9 @@ declare module BABYLON {
 
 
 declare module BABYLON {
+    /**
+    * Coordinate system mode that will be used when loading from the gltf file
+    */
     enum GLTFLoaderCoordinateSystemMode {
         /**
          * Automatically convert the glTF right-handed data to the appropriate system based on the current coordinate system mode of the scene.
@@ -113,6 +116,9 @@ declare module BABYLON {
          */
         FORCE_RIGHT_HANDED = 1,
     }
+    /**
+    * Animation mode that determines which animations should be started when a file is loaded
+    */
     enum GLTFLoaderAnimationStartMode {
         /**
          * No animation will start.
@@ -127,10 +133,22 @@ declare module BABYLON {
          */
         ALL = 2,
     }
+    /**
+    * Loaded gltf data
+    */
     interface IGLTFLoaderData {
+        /**
+        * Loaded json string converted to an object
+        */
         json: Object;
+        /**
+        * Loaded ArrayBufferView
+        */
         bin: Nullable<ArrayBufferView>;
     }
+    /**
+    * Gltf extension interface
+    */
     interface IGLTFLoaderExtension {
         /**
          * The name of this extension.
@@ -141,6 +159,9 @@ declare module BABYLON {
          */
         enabled: boolean;
     }
+    /**
+    * Loading state
+    */
     enum GLTFLoaderState {
         /**
          * The asset is loading.
@@ -155,29 +176,77 @@ declare module BABYLON {
          */
         COMPLETE = 2,
     }
+    /**
+    * GLTF loader interface
+    */
     interface IGLTFLoader extends IDisposable {
+        /**
+        * Coordinate system that will be used when loading from the gltf file
+        */
         coordinateSystemMode: GLTFLoaderCoordinateSystemMode;
+        /**
+        * Animation mode that determines which animations should be started when a file is loaded
+        */
         animationStartMode: GLTFLoaderAnimationStartMode;
+        /**
+        * If the materials in the file should automatically be compiled
+        */
         compileMaterials: boolean;
+        /**
+        * If a clip plane should be usede when loading meshes in the file
+        */
         useClipPlane: boolean;
+        /**
+        * If shadow generators should automatically be compiled
+        */
         compileShadowGenerators: boolean;
+        /**
+        * Observable that fires each time a mesh is loaded
+        */
         onMeshLoadedObservable: Observable<AbstractMesh>;
+        /**
+        * Observable that fires each time a texture is loaded
+        */
         onTextureLoadedObservable: Observable<BaseTexture>;
+        /**
+       * Observable that fires each time a material is loaded
+       */
         onMaterialLoadedObservable: Observable<Material>;
+        /**
+        * Observable that fires when the load has completed
+        */
         onCompleteObservable: Observable<IGLTFLoader>;
+        /**
+        * Observable that fires when the loader is disposed
+        */
         onDisposeObservable: Observable<IGLTFLoader>;
+        /**
+        * Observable that fire when an extension is loaded
+        */
         onExtensionLoadedObservable: Observable<IGLTFLoaderExtension>;
+        /**
+        * Loader state
+        */
         state: Nullable<GLTFLoaderState>;
+        /**
+        * Imports one or more meshes from a loaded gltf file and adds them to the scene
+        */
         importMeshAsync: (meshesNames: any, scene: Scene, data: IGLTFLoaderData, rootUrl: string, onProgress?: (event: SceneLoaderProgressEvent) => void) => Promise<{
             meshes: AbstractMesh[];
             particleSystems: ParticleSystem[];
             skeletons: Skeleton[];
             animationGroups: AnimationGroup[];
         }>;
+        /**
+        * Imports all objects from a loaded gltf file and adds them to the scene
+        */
         loadAsync: (scene: Scene, data: IGLTFLoaderData, rootUrl: string, onProgress?: (event: SceneLoaderProgressEvent) => void) => Promise<void>;
     }
+    /** File loader to load gltf files into a babylon scene */
     class GLTFFileLoader implements IDisposable, ISceneLoaderPluginAsync, ISceneLoaderPluginFactory {
+        /** Creates a gltf 1.0 file loader */
         static CreateGLTFLoaderV1: () => IGLTFLoader;
+        /** Creates a gltf 2.0 file loader */
         static CreateGLTFLoaderV2: () => IGLTFLoader;
         /**
          * Raised when the asset has been parsed.
@@ -186,27 +255,39 @@ declare module BABYLON {
          */
         onParsedObservable: Observable<IGLTFLoaderData>;
         private _onParsedObserver;
+        /** Raised when the asset has been parsed. */
         onParsed: (loaderData: IGLTFLoaderData) => void;
+        /**
+         * Set this property to false to disable incremental loading which delays the loader from calling the success callback until after loading the meshes and shaders. Textures always loads asynchronously. For example, the success callback can compute the bounding information of the loaded meshes when incremental loading is disabled. Defaults to true.
+         */
         static IncrementalLoading: boolean;
+        /**
+         * Set this property to true in order to work with homogeneous coordinates, available with some converters and exporters. Defaults to false. See https://en.wikipedia.org/wiki/Homogeneous_coordinates
+         */
         static HomogeneousCoordinates: boolean;
         /**
-         * The coordinate system mode (AUTO, FORCE_RIGHT_HANDED).
+         * The coordinate system mode (AUTO, FORCE_RIGHT_HANDED). Defaults to AUTO.
+         * - AUTO - Automatically convert the glTF right-handed data to the appropriate system based on the current coordinate system mode of the scene.
+         * - FORCE_RIGHT_HANDED - Sets the useRightHandedSystem flag on the scene.
          */
         coordinateSystemMode: GLTFLoaderCoordinateSystemMode;
         /**
-         * The animation start mode (NONE, FIRST, ALL).
-         */
+        * The animation start mode (NONE, FIRST, ALL). Defaults to FIRST.
+        * - NONE - No animation will start.
+        * - FIRST - The first animation will start.
+        * - ALL - All animations will start.
+        */
         animationStartMode: GLTFLoaderAnimationStartMode;
         /**
-         * Set to true to compile materials before raising the success callback.
+         * Set to true to compile materials before raising the success callback. Defaults to false.
          */
         compileMaterials: boolean;
         /**
-         * Set to true to also compile materials with clip planes.
+         * Set to true to also compile materials with clip planes. Defaults to false.
          */
         useClipPlane: boolean;
         /**
-         * Set to true to compile shadow generators before raising the success callback.
+         * Set to true to compile shadow generators before raising the success callback. Defaults to false.
          */
         compileShadowGenerators: boolean;
         /**
@@ -214,18 +295,27 @@ declare module BABYLON {
          */
         readonly onMeshLoadedObservable: Observable<AbstractMesh>;
         private _onMeshLoadedObserver;
+        /**
+         * Raised when the loader creates a mesh after parsing the glTF properties of the mesh. (onMeshLoadedObservable is likely desired instead.)
+         */
         onMeshLoaded: (mesh: AbstractMesh) => void;
         /**
          * Raised when the loader creates a texture after parsing the glTF properties of the texture.
          */
         readonly onTextureLoadedObservable: Observable<BaseTexture>;
         private _onTextureLoadedObserver;
+        /**
+         * Method called when a texture has been loaded (onTextureLoadedObservable is likely desired instead.)
+         */
         onTextureLoaded: (texture: BaseTexture) => void;
         /**
          * Raised when the loader creates a material after parsing the glTF properties of the material.
          */
         readonly onMaterialLoadedObservable: Observable<Material>;
         private _onMaterialLoadedObserver;
+        /**
+         * Method when the loader creates a material after parsing the glTF properties of the material. (onMaterialLoadedObservable is likely desired instead.)
+         */
         onMaterialLoaded: (material: Material) => void;
         /**
          * Raised when the asset is completely loaded, immediately before the loader is disposed.
@@ -234,12 +324,18 @@ declare module BABYLON {
          */
         readonly onCompleteObservable: Observable<GLTFFileLoader>;
         private _onCompleteObserver;
+        /**
+         * Raised when the asset is completely loaded, immediately before the loader is disposed. (onCompleteObservable is likely desired instead.)
+         */
         onComplete: () => void;
         /**
         * Raised after the loader is disposed.
         */
         readonly onDisposeObservable: Observable<GLTFFileLoader>;
         private _onDisposeObserver;
+        /**
+         * Raised after the loader is disposed. (onDisposeObservable is likely desired instead.)
+         */
         onDispose: () => void;
         /**
          * Raised after a loader extension is created.
@@ -247,6 +343,9 @@ declare module BABYLON {
          */
         readonly onExtensionLoadedObservable: Observable<IGLTFLoaderExtension>;
         private _onExtensionLoadedObserver;
+        /**
+         * Raised after a loader extension is created. (onExtensionLoadedObservable is likely desired instead.)
+         */
         onExtensionLoaded: (extension: IGLTFLoaderExtension) => void;
         /**
          * Returns a promise that resolves when the asset is completely loaded.
@@ -258,22 +357,65 @@ declare module BABYLON {
          */
         readonly loaderState: Nullable<GLTFLoaderState>;
         private _loader;
+        /**
+         * Name of the loader ("gltf")
+         */
         name: string;
+        /**
+         * Supported file extensions of the loader (.gltf, .glb)
+         */
         extensions: ISceneLoaderPluginExtensions;
         /**
          * Disposes the loader, releases resources during load, and cancels any outstanding requests.
          */
         dispose(): void;
+        /**
+        * Imports one or more meshes from a loaded gltf file and adds them to the scene
+        * @param meshesNames a string or array of strings of the mesh names that should be loaded from the file
+        * @param scene the scene the meshes should be added to
+        * @param data gltf data containing information of the meshes in a loaded file
+        * @param rootUrl root url to load from
+        * @param onProgress event that fires when loading progress has occured
+        * @returns a promise containg the loaded meshes, particles, skeletons and animations
+        */
         importMeshAsync(meshesNames: any, scene: Scene, data: any, rootUrl: string, onProgress?: (event: SceneLoaderProgressEvent) => void): Promise<{
             meshes: AbstractMesh[];
             particleSystems: ParticleSystem[];
             skeletons: Skeleton[];
             animationGroups: AnimationGroup[];
         }>;
+        /**
+        * Imports all objects from a loaded gltf file and adds them to the scene
+        * @param scene the scene the objects should be added to
+        * @param data gltf data containing information of the meshes in a loaded file
+        * @param rootUrl root url to load from
+        * @param onProgress event that fires when loading progress has occured
+        * @returns a promise which completes when objects have been loaded to the scene
+        */
         loadAsync(scene: Scene, data: string | ArrayBuffer, rootUrl: string, onProgress?: (event: SceneLoaderProgressEvent) => void): Promise<void>;
+        /**
+         * Load into an asset container.
+         * @param scene The scene to load into
+         * @param data The data to import
+         * @param rootUrl The root url for scene and resources
+         * @param onProgress The callback when the load progresses
+         * @returns The loaded asset container
+         */
         loadAssetContainerAsync(scene: Scene, data: string | ArrayBuffer, rootUrl: string, onProgress?: (event: SceneLoaderProgressEvent) => void): Promise<AssetContainer>;
+        /**
+         * If the data string can be loaded directly
+         * @param data string contianing the file data
+         * @returns if the data can be loaded directly
+         */
         canDirectLoad(data: string): boolean;
+        /**
+         * Rewrites a url by combining a root url and response url
+         */
         rewriteRootURL: (rootUrl: string, responseURL?: string) => string;
+        /**
+         * Instantiates a gltf file loader plugin
+         * @returns the created plugin
+         */
         createPlugin(): ISceneLoaderPlugin | ISceneLoaderPluginAsync;
         private _parse(data);
         private _getLoader(loaderData);
@@ -690,9 +832,21 @@ declare module BABYLON.GLTF1 {
         onMaterialLoadedObservable: Observable<Material>;
         onCompleteObservable: Observable<IGLTFLoader>;
         onExtensionLoadedObservable: Observable<IGLTFLoaderExtension>;
+        /**
+        * State of the loader
+        */
         state: Nullable<GLTFLoaderState>;
         dispose(): void;
         private _importMeshAsync(meshesNames, scene, data, rootUrl, onSuccess, onProgress?, onError?);
+        /**
+        * Imports one or more meshes from a loaded gltf file and adds them to the scene
+        * @param meshesNames a string or array of strings of the mesh names that should be loaded from the file
+        * @param scene the scene the meshes should be added to
+        * @param data gltf data containing information of the meshes in a loaded file
+        * @param rootUrl root url to load from
+        * @param onProgress event that fires when loading progress has occured
+        * @returns a promise containg the loaded meshes, particles, skeletons and animations
+        */
         importMeshAsync(meshesNames: any, scene: Scene, data: IGLTFLoaderData, rootUrl: string, onProgress?: (event: SceneLoaderProgressEvent) => void): Promise<{
             meshes: AbstractMesh[];
             particleSystems: ParticleSystem[];
@@ -700,6 +854,14 @@ declare module BABYLON.GLTF1 {
             animationGroups: AnimationGroup[];
         }>;
         private _loadAsync(scene, data, rootUrl, onSuccess, onProgress?, onError?);
+        /**
+        * Imports all objects from a loaded gltf file and adds them to the scene
+        * @param scene the scene the objects should be added to
+        * @param data gltf data containing information of the meshes in a loaded file
+        * @param rootUrl root url to load from
+        * @param onProgress event that fires when loading progress has occured
+        * @returns a promise which completes when objects have been loaded to the scene
+        */
         loadAsync(scene: Scene, data: IGLTFLoaderData, rootUrl: string, onProgress?: (event: SceneLoaderProgressEvent) => void): Promise<void>;
         private _loadShadersAsync(gltfRuntime, onload);
         private _loadBuffersAsync(gltfRuntime, onLoad, onProgress?);
@@ -844,48 +1006,84 @@ declare module BABYLON.GLTF1 {
 
 
 declare module BABYLON.GLTF2 {
+    /** Array item which contains it's index in an array */
     interface IArrayItem {
         _index: number;
     }
+    /** Array item helper methods */
     class ArrayItem {
+        /** Sets the index of each array element to its index in the array */
         static Assign(values?: IArrayItem[]): void;
     }
 }
 
 
 
+/**
+ * GLTF2 module for babylon
+ */
 declare module BABYLON.GLTF2 {
+    /**
+     * Interface to access data and vertex buffer associated with a file
+     */
     interface ILoaderAccessor extends IAccessor, IArrayItem {
         _data?: Promise<ArrayBufferView>;
         _babylonVertexBuffer?: Promise<VertexBuffer>;
     }
+    /**
+     * Loader's animation channel
+     */
     interface ILoaderAnimationChannel extends IAnimationChannel, IArrayItem {
     }
+    /**
+     * Container for animation keyframe data
+     */
     interface ILoaderAnimationSamplerData {
         input: Float32Array;
         interpolation: AnimationSamplerInterpolation;
         output: Float32Array;
     }
+    /**
+     * Keyframe data
+     */
     interface ILoaderAnimationSampler extends IAnimationSampler, IArrayItem {
         _data: Promise<ILoaderAnimationSamplerData>;
     }
+    /**
+     * Loader animation
+     */
     interface ILoaderAnimation extends IAnimation, IArrayItem {
         channels: ILoaderAnimationChannel[];
         samplers: ILoaderAnimationSampler[];
         _babylonAnimationGroup?: AnimationGroup;
     }
+    /**
+     * Loader buffer
+     */
     interface ILoaderBuffer extends IBuffer, IArrayItem {
         _data?: Promise<ArrayBufferView>;
     }
+    /**
+     * Loader's buffer data
+     */
     interface ILoaderBufferView extends IBufferView, IArrayItem {
         _data?: Promise<ArrayBufferView>;
         _babylonBuffer?: Promise<Buffer>;
     }
+    /**
+     * Loader's loaded camera data
+     */
     interface ILoaderCamera extends ICamera, IArrayItem {
     }
+    /**
+     * Loaded image specified by url
+     */
     interface ILoaderImage extends IImage, IArrayItem {
         _objectURL?: Promise<string>;
     }
+    /**
+     * Loaded material data
+     */
     interface ILoaderMaterial extends IMaterial, IArrayItem {
         _babylonData?: {
             [drawMode: number]: {
@@ -895,11 +1093,20 @@ declare module BABYLON.GLTF2 {
             };
         };
     }
+    /**
+     * Loader mesh data
+     */
     interface ILoaderMesh extends IMesh, IArrayItem {
         primitives: ILoaderMeshPrimitive[];
     }
+    /**
+     * Loader mesh data
+     */
     interface ILoaderMeshPrimitive extends IMeshPrimitive, IArrayItem {
     }
+    /**
+     * Node for traversing loader data
+     */
     interface ILoaderNode extends INode, IArrayItem {
         _parent: ILoaderNode;
         _babylonMesh?: Mesh;
@@ -907,23 +1114,41 @@ declare module BABYLON.GLTF2 {
         _babylonAnimationTargets?: Node[];
         _numMorphTargets?: number;
     }
+    /**
+     * Sampler data
+     */
     interface ILoaderSamplerData {
         noMipMaps: boolean;
         samplingMode: number;
         wrapU: number;
         wrapV: number;
     }
+    /**
+     * Sampler data
+     */
     interface ILoaderSampler extends ISampler, IArrayItem {
         _data?: ILoaderSamplerData;
     }
+    /**
+     * Loader's scene
+     */
     interface ILoaderScene extends IScene, IArrayItem {
     }
+    /**
+     * Loader's skeleton data
+     */
     interface ILoaderSkin extends ISkin, IArrayItem {
         _babylonSkeleton?: Skeleton;
         _loaded?: Promise<void>;
     }
+    /**
+     * Loader's texture
+     */
     interface ILoaderTexture extends ITexture, IArrayItem {
     }
+    /**
+     * Loaded GLTF data
+     */
     interface ILoaderGLTF extends IGLTF {
         accessors?: ILoaderAccessor[];
         animations?: ILoaderAnimation[];
@@ -942,14 +1167,40 @@ declare module BABYLON.GLTF2 {
 }
 
 
+/**
+* Defines the GLTF2 module used to import/export GLTF 2.0 files
+*/
 declare module BABYLON.GLTF2 {
+    /**
+    * Interface for a meterial with a constructor
+    */
     interface MaterialConstructor<T extends Material> {
+        /**
+        * The material class
+        */
         readonly prototype: T;
+        /**
+        * Instatiates a material
+        * @param name name of the material
+        * @param scene the scene the material will be added to
+        */
         new (name: string, scene: Scene): T;
     }
+    /**
+    * Used to load from a GLTF2 file
+    */
     class GLTFLoader implements IGLTFLoader {
+        /**
+        * @ignore
+        */
         _gltf: ILoaderGLTF;
+        /**
+        * @ignore
+        */
         _babylonScene: Scene;
+        /**
+        * @ignore
+        */
         _completePromises: Promise<void>[];
         private _disposed;
         private _state;
@@ -962,26 +1213,87 @@ declare module BABYLON.GLTF2 {
         private _requests;
         private static _Names;
         private static _Factories;
+        /**
+        * @ignore, registers the loader
+        * @param name name of the loader
+        * @param factory function that converts a loader to a loader extension
+        */
         static _Register(name: string, factory: (loader: GLTFLoader) => GLTFLoaderExtension): void;
+        /**
+        * Coordinate system that will be used when loading from the gltf file
+        */
         coordinateSystemMode: GLTFLoaderCoordinateSystemMode;
+        /**
+        * Animation mode that determines which animations should be started when a file is loaded
+        */
         animationStartMode: GLTFLoaderAnimationStartMode;
+        /**
+        * If the materials in the file should automatically be compiled
+        */
         compileMaterials: boolean;
+        /**
+        * If a clip plane should be usede when loading meshes in the file
+        */
         useClipPlane: boolean;
+        /**
+        * If shadow generators should automatically be compiled
+        */
         compileShadowGenerators: boolean;
+        /**
+        * Observable that fires when the loader is disposed
+        */
         readonly onDisposeObservable: Observable<IGLTFLoader>;
+        /**
+        * Observable that fires each time a mesh is loaded
+        */
         readonly onMeshLoadedObservable: Observable<AbstractMesh>;
+        /**
+        * Observable that fires each time a texture is loaded
+        */
         readonly onTextureLoadedObservable: Observable<BaseTexture>;
+        /**
+        * Observable that fires each time a material is loaded
+        */
         readonly onMaterialLoadedObservable: Observable<Material>;
+        /**
+        * Observable that fires each time an extension is loaded
+        */
         readonly onExtensionLoadedObservable: Observable<IGLTFLoaderExtension>;
+        /**
+        * Observable that fires when the load has completed
+        */
         readonly onCompleteObservable: Observable<IGLTFLoader>;
+        /**
+        * The current state of the loader
+        */
         readonly state: Nullable<GLTFLoaderState>;
+        /**
+        * Disposes of the loader
+        */
         dispose(): void;
+        /**
+        * Imports one or more meshes from a loaded gltf file and adds them to the scene
+        * @param meshesNames a string or array of strings of the mesh names that should be loaded from the file
+        * @param scene the scene the meshes should be added to
+        * @param data gltf data containing information of the meshes in a loaded file
+        * @param rootUrl root url to load from
+        * @param onProgress event that fires when loading progress has occured
+        * @returns a promise containg the loaded meshes, particles, skeletons and animations
+        */
         importMeshAsync(meshesNames: any, scene: Scene, data: IGLTFLoaderData, rootUrl: string, onProgress?: (event: SceneLoaderProgressEvent) => void): Promise<{
             meshes: AbstractMesh[];
             particleSystems: ParticleSystem[];
             skeletons: Skeleton[];
             animationGroups: AnimationGroup[];
         }>;
+        /**
+        * Imports all objects from a loaded gltf file and adds them to the scene
+        * @param scene the scene the objects should be added to
+        * @param data gltf data containing information of the meshes in a loaded file
+        * @param rootUrl root url to load from
+        * @param onProgress event that fires when loading progress has occured
+        * @returns a promise which completes when objects have been loaded to the scene
+        */
         loadAsync(scene: Scene, data: IGLTFLoaderData, rootUrl: string, onProgress?: (event: SceneLoaderProgressEvent) => void): Promise<void>;
         private _loadAsync(nodes, scene, data, rootUrl, onProgress?);
         private _loadExtensions();
@@ -990,12 +1302,18 @@ declare module BABYLON.GLTF2 {
         private _checkExtensions();
         private _createRootNode();
         private _loadNodesAsync(nodes);
+        /**
+        * @ignore
+        */
         _loadSceneAsync(context: string, scene: ILoaderScene): Promise<void>;
         private _forEachPrimitive(node, callback);
         private _getMeshes();
         private _getSkeletons();
         private _getAnimationGroups();
         private _startAnimations();
+        /**
+        * @ignore
+        */
         _loadNodeAsync(context: string, node: ILoaderNode): Promise<void>;
         private _loadMeshAsync(context, node, mesh, babylonMesh);
         private _loadPrimitiveAsync(context, node, mesh, primitive, babylonMesh);
@@ -1015,21 +1333,48 @@ declare module BABYLON.GLTF2 {
         private _loadAnimationChannelAsync(context, animationContext, animation, channel, babylonAnimationGroup);
         private _loadAnimationSamplerAsync(context, sampler);
         private _loadBufferAsync(context, buffer);
+        /**
+        * @ignore
+        */
         _loadBufferViewAsync(context: string, bufferView: ILoaderBufferView): Promise<ArrayBufferView>;
         private _loadAccessorAsync(context, accessor);
+        /**
+        * @ignore
+        */
         _loadVertexBufferViewAsync(context: string, bufferView: ILoaderBufferView, kind: string): Promise<Buffer>;
         private _loadVertexAccessorAsync(context, accessor, kind);
         private _getDefaultMaterial(drawMode);
         private _loadMaterialMetallicRoughnessPropertiesAsync(context, material, babylonMaterial);
+        /**
+        * @ignore
+        */
         _loadMaterialAsync(context: string, material: ILoaderMaterial, babylonMesh: Mesh, babylonDrawMode: number, assign: (babylonMaterial: Material) => void): Promise<void>;
+        /**
+        * @ignore
+        */
         _createMaterial<T extends Material>(type: MaterialConstructor<T>, name: string, drawMode: number): T;
+        /**
+        * @ignore
+        */
         _loadMaterialBasePropertiesAsync(context: string, material: ILoaderMaterial, babylonMaterial: PBRMaterial): Promise<void>;
+        /**
+        * @ignore
+        */
         _loadMaterialAlphaProperties(context: string, material: ILoaderMaterial, babylonMaterial: PBRMaterial): void;
+        /**
+        * @ignore
+        */
         _loadTextureAsync(context: string, textureInfo: ITextureInfo, assign: (texture: Texture) => void): Promise<void>;
         private _loadSampler(context, sampler);
         private _loadImageAsync(context, image);
+        /**
+        * @ignore
+        */
         _loadUriAsync(context: string, uri: string): Promise<ArrayBufferView>;
         private _onProgress();
+        /**
+        * @ignore
+        */
         static _GetProperty<T>(context: string, array: ArrayLike<T> | undefined, index: number | undefined): T;
         private static _GetTextureWrapMode(context, mode);
         private static _GetTextureSamplingMode(context, magFilter?, minFilter?);
@@ -1039,12 +1384,18 @@ declare module BABYLON.GLTF2 {
         private _compileMaterialsAsync();
         private _compileShadowGeneratorsAsync();
         private _clear();
+        /**
+        * @ignore
+        */
         _applyExtensions<T>(actionAsync: (extension: GLTFLoaderExtension) => Nullable<Promise<T>>): Nullable<Promise<T>>;
     }
 }
 
 
 declare module BABYLON.GLTF2 {
+    /**
+     * Abstract class that can be implemented to extend existing gltf loader behavior.
+     */
     abstract class GLTFLoaderExtension implements IGLTFLoaderExtension, IDisposable {
         enabled: boolean;
         readonly abstract name: string;
@@ -1099,6 +1450,7 @@ declare module BABYLON.GLTF2.Extensions {
 }
 
 
+/** Module defining extensions to gltf */
 declare module BABYLON.GLTF2.Extensions {
     class KHR_draco_mesh_compression extends GLTFLoaderExtension {
         readonly name: string;

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


+ 5 - 0
dist/preview release/viewer/babylon.viewer.max.js

@@ -87638,6 +87638,9 @@ var BABYLON;
             }
             else if (this._vrDeviceOrientationCamera) {
                 this._vrDeviceOrientationCamera.position = this._position;
+                if (this._scene.activeCamera) {
+                    this._vrDeviceOrientationCamera.minZ = this._scene.activeCamera.minZ;
+                }
                 this._scene.activeCamera = this._vrDeviceOrientationCamera;
                 this._scene.getEngine().switchFullscreen(true);
                 this.updateButtonVisibility();
@@ -87682,6 +87685,8 @@ var BABYLON;
             if (this._interactionsEnabled) {
                 this._scene.unregisterBeforeRender(this.beforeRender);
             }
+            // resize to update width and height when exiting vr exits fullscreen
+            this._scene.getEngine().resize();
         };
         Object.defineProperty(VRExperienceHelper.prototype, "position", {
             /**