Browse Source

More code comments

David Catuhe 7 years ago
parent
commit
16c951521a

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


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

@@ -2,70 +2,6 @@
   "errors": 550,
   "babylon.typedoc.json": {
     "errors": 550,
-    "DefaultLoadingScreen": {
-      "Class": {
-        "Comments": {
-          "MissingText": true
-        }
-      },
-      "Constructor": {
-        "new DefaultLoadingScreen": {
-          "Comments": {
-            "MissingText": true
-          },
-          "Parameter": {
-            "_renderingCanvas": {
-              "Comments": {
-                "MissingText": true
-              },
-              "Naming": {
-                "NotCamelCase": true
-              }
-            },
-            "_loadingText": {
-              "Comments": {
-                "MissingText": true
-              },
-              "Naming": {
-                "NotCamelCase": true
-              }
-            },
-            "_loadingDivBackgroundColor": {
-              "Comments": {
-                "MissingText": true
-              },
-              "Naming": {
-                "NotCamelCase": true
-              }
-            }
-          }
-        }
-      },
-      "Property": {
-        "loadingUIBackgroundColor": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "loadingUIText": {
-          "Comments": {
-            "MissingText": true
-          }
-        }
-      },
-      "Method": {
-        "displayLoadingUI": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "hideLoadingUI": {
-          "Comments": {
-            "MissingText": true
-          }
-        }
-      }
-    },
     "FreeCameraInputsManager": {
       "Method": {
         "addGamepad": {
@@ -1676,163 +1612,6 @@
         }
       }
     },
-    "SceneLoader": {
-      "Class": {
-        "Comments": {
-          "MissingText": true
-        }
-      },
-      "Property": {
-        "CleanBoneMatrixWeights": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "DETAILED_LOGGING": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "ForceFullSceneLoadingForIncremental": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "MINIMAL_LOGGING": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "NO_LOGGING": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "OnPluginActivatedObservable": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "SUMMARY_LOGGING": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "ShowLoadingScreen": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "loggingLevel": {
-          "Naming": {
-            "NotPascalCase": true
-          },
-          "Comments": {
-            "MissingText": true
-          }
-        }
-      },
-      "Method": {
-        "GetPluginForExtension": {
-          "Comments": {
-            "MissingText": true
-          },
-          "Parameter": {
-            "extension": {
-              "Comments": {
-                "MissingText": true
-              }
-            }
-          }
-        },
-        "IsPluginForExtensionAvailable": {
-          "Comments": {
-            "MissingText": true
-          },
-          "Parameter": {
-            "extension": {
-              "Comments": {
-                "MissingText": true
-              }
-            }
-          }
-        },
-        "RegisterPlugin": {
-          "Comments": {
-            "MissingText": true
-          },
-          "Parameter": {
-            "plugin": {
-              "Comments": {
-                "MissingText": true
-              }
-            }
-          }
-        }
-      }
-    },
-    "SceneLoaderProgressEvent": {
-      "Class": {
-        "Comments": {
-          "MissingText": true
-        }
-      },
-      "Constructor": {
-        "new SceneLoaderProgressEvent": {
-          "Comments": {
-            "MissingText": true
-          },
-          "Parameter": {
-            "lengthComputable": {
-              "Comments": {
-                "MissingText": true
-              }
-            },
-            "loaded": {
-              "Comments": {
-                "MissingText": true
-              }
-            },
-            "total": {
-              "Comments": {
-                "MissingText": true
-              }
-            }
-          }
-        }
-      },
-      "Property": {
-        "lengthComputable": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "loaded": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "total": {
-          "Comments": {
-            "MissingText": true
-          }
-        }
-      },
-      "Method": {
-        "FromProgressEvent": {
-          "Comments": {
-            "MissingText": true
-          },
-          "Parameter": {
-            "event": {
-              "Comments": {
-                "MissingText": true
-              }
-            }
-          }
-        }
-      }
-    },
     "SerializationHelper": {
       "Class": {
         "Comments": {
@@ -3027,82 +2806,6 @@
         }
       }
     },
-    "ILoadingScreen": {
-      "Interface": {
-        "Comments": {
-          "MissingText": true
-        }
-      },
-      "Property": {
-        "displayLoadingUI": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "hideLoadingUI": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "loadingUIBackgroundColor": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "loadingUIText": {
-          "Comments": {
-            "MissingText": true
-          }
-        }
-      }
-    },
-    "ISceneLoaderPlugin": {
-      "Interface": {
-        "Comments": {
-          "MissingText": true
-        }
-      }
-    },
-    "ISceneLoaderPluginAsync": {
-      "Interface": {
-        "Comments": {
-          "MissingText": true
-        }
-      }
-    },
-    "ISceneLoaderPluginExtensions": {
-      "Interface": {
-        "Comments": {
-          "MissingText": true
-        }
-      }
-    },
-    "ISceneLoaderPluginFactory": {
-      "Interface": {
-        "Comments": {
-          "MissingText": true
-        }
-      },
-      "Property": {
-        "canDirectLoad": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "name": {
-          "Comments": {
-            "MissingText": true
-          }
-        }
-      },
-      "Method": {
-        "createPlugin": {
-          "Comments": {
-            "MissingText": true
-          }
-        }
-      }
-    },
     "CameraInputTypes": {
       "Variable": {
         "Naming": {

+ 42 - 1
src/Loading/babylon.loadingScreen.ts

@@ -1,23 +1,51 @@
 module BABYLON {
 
+    /**
+     * Interface used to present a loading screen while loading a scene
+     * @see http://doc.babylonjs.com/how_to/creating_a_custom_loading_screen
+     */
     export interface ILoadingScreen {
+        /**
+         * Function called to display the loading screen
+         */
         displayLoadingUI: () => void;
+        /**
+         * Function called to hide the loading screen
+         */
         hideLoadingUI: () => void;
-        //default loader support
+        /**
+         * Gets or sets the color to use for the background
+         */
         loadingUIBackgroundColor: string;
+        /**
+         * Gets or sets the text to display while loading
+         */
         loadingUIText: string;
 
     }
 
+    /**
+     * Class used for the default loading screen
+     * @see http://doc.babylonjs.com/how_to/creating_a_custom_loading_screen
+     */
     export class DefaultLoadingScreen implements ILoadingScreen {
 
         private _loadingDiv: Nullable<HTMLDivElement>;
         private _loadingTextDiv: HTMLDivElement;
 
+        /**
+         * Creates a new default loading screen
+         * @param _renderingCanvas defines the canvas used to render the scene
+         * @param _loadingText defines the default text to display
+         * @param _loadingDivBackgroundColor defines the default background color
+         */
         constructor(private _renderingCanvas: HTMLCanvasElement, private _loadingText = "", private _loadingDivBackgroundColor = "black") {
 
         }
 
+        /**
+         * Function called to display the loading screen
+         */
         public displayLoadingUI(): void {
             if (this._loadingDiv) {
                 // Do not add a loading screen if there is already one  
@@ -91,6 +119,9 @@ module BABYLON {
             this._loadingDiv.style.opacity = "1";
         }
 
+        /**
+         * Function called to hide the loading screen
+         */        
         public hideLoadingUI(): void {
             if (!this._loadingDiv) {
                 return;
@@ -110,6 +141,9 @@ module BABYLON {
             this._loadingDiv.addEventListener("transitionend", onTransitionEnd);
         }
 
+        /**
+         * Gets or sets the text to display while loading
+         */
         public set loadingUIText(text: string) {
             this._loadingText = text;
 
@@ -118,6 +152,13 @@ module BABYLON {
             }
         }
 
+        public get loadingUIText(): string {
+            return this._loadingText;
+        }
+
+        /**
+         * Gets or sets the color to use for the background
+         */        
         public get loadingUIBackgroundColor(): string {
             return this._loadingDivBackgroundColor;
         }

+ 119 - 13
src/Loading/babylon.sceneLoader.ts

@@ -1,25 +1,67 @@
 module BABYLON {
+    /**
+     * Class used to represent data loading progression
+     */
     export class SceneLoaderProgressEvent {
-        constructor(public readonly lengthComputable: boolean, public readonly loaded: number, public readonly total: number) {
+        /**
+         * Create a new progress event
+         * @param lengthComputable defines if data length to load can be evaluated
+         * @param loaded defines the loaded data length
+         * @param total defines the data length to load
+         */
+        constructor(
+            /** defines if data length to load can be evaluated */
+            public readonly lengthComputable: boolean, 
+            /** defines the loaded data length */
+            public readonly loaded: number, 
+            /** defines the data length to load */
+            public readonly total: number) {
         }
 
+        /**
+         * Creates a new SceneLoaderProgressEvent from a ProgressEvent
+         * @param event defines the source event
+         * @returns a new SceneLoaderProgressEvent
+         */
         public static FromProgressEvent(event: ProgressEvent): SceneLoaderProgressEvent {
             return new SceneLoaderProgressEvent(event.lengthComputable, event.loaded, event.total);
         }
     }
 
+    /**
+     * Interface used by SceneLoader plugins to define supported file extensions
+     */
     export interface ISceneLoaderPluginExtensions {
+        /**
+         * Defines the list of supported extensions
+         */
         [extension: string]: {
             isBinary: boolean;
         };
     }
 
+    /**
+     * Interface used by SceneLoader plugin factory
+     */
     export interface ISceneLoaderPluginFactory {
+        /**
+         * Defines the name of the factory
+         */
         name: string;
+        /**
+         * Function called to create a new plugin
+         * @return the new plugin
+         */
         createPlugin(): ISceneLoaderPlugin | ISceneLoaderPluginAsync;
+        /**
+         * Boolean indicating if the plugin can direct load specific data
+         */
         canDirectLoad?: (data: string) => boolean;
     }
 
+    /**
+     * Interface used to define a SceneLoader plugin
+     */
     export interface ISceneLoaderPlugin {
         /**
          * The friendly name of this plugin.
@@ -76,6 +118,9 @@
         loadAssetContainer(scene: Scene, data: string, rootUrl: string, onError?: (message: string, exception?: any) => void): AssetContainer;
     }
 
+    /**
+     * Interface used to define an async SceneLoader plugin
+     */
     export interface ISceneLoaderPluginAsync {
         /**
          * The friendly name of this plugin.
@@ -132,41 +177,73 @@
         loadAssetContainerAsync(scene: Scene, data: string, rootUrl: string, onProgress?: (event: SceneLoaderProgressEvent) => void, fileName?: string): Promise<AssetContainer>;
     }
 
+    /**
+     * Defines a plugin registered by the SceneLoader
+     */
     interface IRegisteredPlugin {
+        /**
+         * Defines the plugin to use
+         */
         plugin: ISceneLoaderPlugin | ISceneLoaderPluginAsync | ISceneLoaderPluginFactory;
+        /**
+         * Defines if the plugin supports binary data
+         */
         isBinary: boolean;
     }
 
+    /**
+     * Defines file information
+     */
     interface IFileInfo {
+        /**
+         * Gets the file url
+         */
         url: string;
+        /**
+         * Gets the root url
+         */
         rootUrl: string;
+        /**
+         * Gets filename
+         */
         name: string;
     }
 
+    /**
+     * Class used to load scene from various file formats using registered plugins
+     * @see http://doc.babylonjs.com/how_to/load_from_any_file_type
+     */
     export class SceneLoader {
         // Flags
         private static _ForceFullSceneLoadingForIncremental = false;
         private static _ShowLoadingScreen = true;
         private static _CleanBoneMatrixWeights = false;
 
-        public static get NO_LOGGING(): number {
-            return 0;
-        }
+        /**
+         * No logging while loading
+         */
+        public static readonly NO_LOGGING = 0;
 
-        public static get MINIMAL_LOGGING(): number {
-            return 1;
-        }
+        /**
+         * Minimal logging while loading
+         */
+        public static readonly MINIMAL_LOGGING = 1;
 
-        public static get SUMMARY_LOGGING(): number {
-            return 2;
-        }
+        /**
+         * Summary logging while loading
+         */
+        public static readonly SUMMARY_LOGGING = 2;
 
-        public static get DETAILED_LOGGING(): number {
-            return 3;
-        }
+        /**
+         * Detailled logging while loading
+         */
+        public static readonly DETAILED_LOGGING = 3;
 
         private static _loggingLevel = SceneLoader.NO_LOGGING;
 
+        /**
+         * Gets or sets a boolean indicating if entire scene must be loaded even if scene contains incremental data
+         */
         public static get ForceFullSceneLoadingForIncremental() {
             return SceneLoader._ForceFullSceneLoadingForIncremental;
         }
@@ -175,6 +252,9 @@
             SceneLoader._ForceFullSceneLoadingForIncremental = value;
         }
 
+        /**
+         * Gets or sets a boolean indicating if loading screen must be displayed while loading a scene
+         */
         public static get ShowLoadingScreen(): boolean {
             return SceneLoader._ShowLoadingScreen;
         }
@@ -183,6 +263,10 @@
             SceneLoader._ShowLoadingScreen = value;
         }
 
+        /**
+         * Defines the current logging level (while loading the scene)
+         * @ignorenaming
+         */
         public static get loggingLevel(): number {
             return SceneLoader._loggingLevel;
         }
@@ -191,6 +275,9 @@
             SceneLoader._loggingLevel = value;
         }
 
+        /**
+         * Gets or set a boolean indicating if matrix weights must be cleaned upon loading
+         */
         public static get CleanBoneMatrixWeights(): boolean {
             return SceneLoader._CleanBoneMatrixWeights;
         }
@@ -200,6 +287,10 @@
         }
 
         // Members
+
+        /**
+         * Event raised when a plugin is used to load a scene
+         */
         public static OnPluginActivatedObservable = new Observable<ISceneLoaderPlugin | ISceneLoaderPluginAsync>();
 
         private static _registeredPlugins: { [extension: string]: IRegisteredPlugin } = {};
@@ -375,14 +466,29 @@
         }
 
         // Public functions
+
+        /**
+         * Gets a plugin that can load the given extension
+         * @param extension defines the extension to load
+         * @returns a plugin or null if none works
+         */
         public static GetPluginForExtension(extension: string): ISceneLoaderPlugin | ISceneLoaderPluginAsync | ISceneLoaderPluginFactory {
             return SceneLoader._getPluginForExtension(extension).plugin;
         }
 
+        /**
+         * Gets a boolean indicating that the given extension can be loaded
+         * @param extension defines the extension to load
+         * @returns true if the extension is supported
+         */
         public static IsPluginForExtensionAvailable(extension: string): boolean {
             return !!SceneLoader._registeredPlugins[extension];
         }
 
+        /**
+         * Adds a new plugin to the list of registered plugins
+         * @param plugin defines the plugin to add
+         */
         public static RegisterPlugin(plugin: ISceneLoaderPlugin | ISceneLoaderPluginAsync): void {
             if (typeof plugin.extensions === "string") {
                 var extension = <string>plugin.extensions;