Forráskód Böngészése

More code comments

David Catuhe 7 éve
szülő
commit
623c60d83e

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 13698 - 13546
dist/preview release/babylon.d.ts


A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 0 - 1
dist/preview release/serializers/babylonjs.serializers.min.js


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

@@ -559,34 +559,6 @@
         }
       }
     },
-    "DDSTools": {
-      "Class": {
-        "Comments": {
-          "MissingText": true
-        }
-      },
-      "Property": {
-        "StoreLODInAlphaChannel": {
-          "Comments": {
-            "MissingText": true
-          }
-        }
-      },
-      "Method": {
-        "GetDDSInfo": {
-          "Comments": {
-            "MissingText": true
-          },
-          "Parameter": {
-            "arrayBuffer": {
-              "Comments": {
-                "MissingText": true
-              }
-            }
-          }
-        }
-      }
-    },
     "DecimationTriangle": {
       "Class": {
         "Comments": {
@@ -830,115 +802,6 @@
         }
       }
     },
-    "FilesInput": {
-      "Class": {
-        "Comments": {
-          "MissingText": true
-        }
-      },
-      "Constructor": {
-        "new FilesInput": {
-          "Comments": {
-            "MissingText": true
-          },
-          "Parameter": {
-            "engine": {
-              "Comments": {
-                "MissingText": true
-              }
-            },
-            "scene": {
-              "Comments": {
-                "MissingText": true
-              }
-            },
-            "sceneLoadedCallback": {
-              "Comments": {
-                "MissingText": true
-              }
-            },
-            "progressCallback": {
-              "Comments": {
-                "MissingText": true
-              }
-            },
-            "additionalRenderLoopLogicCallback": {
-              "Comments": {
-                "MissingText": true
-              }
-            },
-            "textureLoadingCallback": {
-              "Comments": {
-                "MissingText": true
-              }
-            },
-            "startingProcessingFilesCallback": {
-              "Comments": {
-                "MissingText": true
-              }
-            },
-            "onReloadCallback": {
-              "Comments": {
-                "MissingText": true
-              }
-            },
-            "errorCallback": {
-              "Comments": {
-                "MissingText": true
-              }
-            }
-          }
-        }
-      },
-      "Property": {
-        "onProcessFileCallback": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "FilesToLoad": {
-          "Comments": {
-            "MissingText": true
-          }
-        }
-      },
-      "Method": {
-        "dispose": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "loadFiles": {
-          "Comments": {
-            "MissingText": true
-          },
-          "Parameter": {
-            "event": {
-              "Comments": {
-                "MissingText": true
-              }
-            }
-          }
-        },
-        "monitorElementForDragNDrop": {
-          "Comments": {
-            "MissingText": true
-          },
-          "Parameter": {
-            "elementToMonitor": {
-              "Comments": {
-                "MissingText": true
-              }
-            }
-          }
-        },
-        "reload": {
-          "Comments": {
-            "MissingText": true
-          }
-        }
-      }
-    },
     "FilterPostProcess": {
       "Class": {
         "Comments": {
@@ -1419,149 +1282,6 @@
         }
       }
     },
-    "KhronosTextureContainer": {
-      "Constructor": {
-        "new KhronosTextureContainer": {
-          "Comments": {
-            "MissingText": true,
-            "MissingReturn": true
-          },
-          "Parameter": {
-            "arrayBuffer": {
-              "Comments": {
-                "MissingText": true
-              }
-            },
-            "facesExpected": {
-              "Comments": {
-                "MissingText": true
-              }
-            },
-            "threeDExpected": {
-              "Comments": {
-                "MissingText": true
-              }
-            },
-            "textureArrayExpected": {
-              "Comments": {
-                "MissingText": true
-              }
-            }
-          }
-        }
-      },
-      "Property": {
-        "arrayBuffer": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "bytesOfKeyValueData": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "glBaseInternalFormat": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "glFormat": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "glInternalFormat": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "glType": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "glTypeSize": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "loadType": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "numberOfArrayElements": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "numberOfFaces": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "numberOfMipmapLevels": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "pixelDepth": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "pixelHeight": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "pixelWidth": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "COMPRESSED_2D": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "COMPRESSED_3D": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "HEADER_LEN": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "TEX_2D": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "TEX_3D": {
-          "Comments": {
-            "MissingText": true
-          }
-        }
-      },
-      "Method": {
-        "switchEndainness": {
-          "Comments": {
-            "MissingText": true
-          },
-          "Parameter": {
-            "val": {
-              "Comments": {
-                "MissingText": true
-              }
-            }
-          }
-        }
-      }
-    },
     "LensRenderingPipeline": {
       "Class": {
         "Comments": {
@@ -2426,45 +2146,6 @@
         }
       }
     },
-    "PerformanceMonitor": {
-      "Property": {
-        "averageFPS": {
-          "Tags": {
-            "returns": true
-          }
-        },
-        "averageFrameTime": {
-          "Tags": {
-            "returns": true
-          }
-        },
-        "averageFrameTimeVariance": {
-          "Tags": {
-            "returns": true
-          }
-        },
-        "instantaneousFPS": {
-          "Tags": {
-            "returns": true
-          }
-        },
-        "instantaneousFrameTime": {
-          "Tags": {
-            "returns": true
-          }
-        },
-        "isEnabled": {
-          "Tags": {
-            "returns": true
-          }
-        },
-        "isSaturated": {
-          "Tags": {
-            "returns": true
-          }
-        }
-      }
-    },
     "PhysicsGravitationalFieldEvent": {
       "Constructor": {
         "new PhysicsGravitationalFieldEvent": {
@@ -5893,54 +5574,6 @@
         }
       }
     },
-    "SceneSerializer": {
-      "Class": {
-        "Comments": {
-          "MissingText": true
-        }
-      },
-      "Method": {
-        "ClearCache": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "Serialize": {
-          "Comments": {
-            "MissingText": true
-          },
-          "Parameter": {
-            "scene": {
-              "Comments": {
-                "MissingText": true
-              }
-            }
-          }
-        },
-        "SerializeMesh": {
-          "Comments": {
-            "MissingText": true
-          },
-          "Parameter": {
-            "toSerialize": {
-              "Comments": {
-                "MissingText": true
-              }
-            },
-            "withParents": {
-              "Comments": {
-                "MissingText": true
-              }
-            },
-            "withChildren": {
-              "Comments": {
-                "MissingText": true
-              }
-            }
-          }
-        }
-      }
-    },
     "SerializationHelper": {
       "Class": {
         "Comments": {
@@ -7621,486 +7254,6 @@
         }
       }
     },
-    "TGATools": {
-      "Class": {
-        "Comments": {
-          "MissingText": true
-        }
-      },
-      "Method": {
-        "GetTGAHeader": {
-          "Comments": {
-            "MissingText": true
-          },
-          "Parameter": {
-            "data": {
-              "Comments": {
-                "MissingText": true
-              }
-            }
-          }
-        },
-        "_getImageData16bits": {
-          "Comments": {
-            "MissingText": true
-          },
-          "Parameter": {
-            "header": {
-              "Comments": {
-                "MissingText": true
-              }
-            },
-            "palettes": {
-              "Comments": {
-                "MissingText": true
-              }
-            },
-            "pixel_data": {
-              "Comments": {
-                "MissingText": true
-              }
-            },
-            "y_start": {
-              "Comments": {
-                "MissingText": true
-              }
-            },
-            "y_step": {
-              "Comments": {
-                "MissingText": true
-              }
-            },
-            "y_end": {
-              "Comments": {
-                "MissingText": true
-              }
-            },
-            "x_start": {
-              "Comments": {
-                "MissingText": true
-              }
-            },
-            "x_step": {
-              "Comments": {
-                "MissingText": true
-              }
-            },
-            "x_end": {
-              "Comments": {
-                "MissingText": true
-              }
-            }
-          }
-        },
-        "_getImageData24bits": {
-          "Comments": {
-            "MissingText": true
-          },
-          "Parameter": {
-            "header": {
-              "Comments": {
-                "MissingText": true
-              }
-            },
-            "palettes": {
-              "Comments": {
-                "MissingText": true
-              }
-            },
-            "pixel_data": {
-              "Comments": {
-                "MissingText": true
-              }
-            },
-            "y_start": {
-              "Comments": {
-                "MissingText": true
-              }
-            },
-            "y_step": {
-              "Comments": {
-                "MissingText": true
-              }
-            },
-            "y_end": {
-              "Comments": {
-                "MissingText": true
-              }
-            },
-            "x_start": {
-              "Comments": {
-                "MissingText": true
-              }
-            },
-            "x_step": {
-              "Comments": {
-                "MissingText": true
-              }
-            },
-            "x_end": {
-              "Comments": {
-                "MissingText": true
-              }
-            }
-          }
-        },
-        "_getImageData32bits": {
-          "Comments": {
-            "MissingText": true
-          },
-          "Parameter": {
-            "header": {
-              "Comments": {
-                "MissingText": true
-              }
-            },
-            "palettes": {
-              "Comments": {
-                "MissingText": true
-              }
-            },
-            "pixel_data": {
-              "Comments": {
-                "MissingText": true
-              }
-            },
-            "y_start": {
-              "Comments": {
-                "MissingText": true
-              }
-            },
-            "y_step": {
-              "Comments": {
-                "MissingText": true
-              }
-            },
-            "y_end": {
-              "Comments": {
-                "MissingText": true
-              }
-            },
-            "x_start": {
-              "Comments": {
-                "MissingText": true
-              }
-            },
-            "x_step": {
-              "Comments": {
-                "MissingText": true
-              }
-            },
-            "x_end": {
-              "Comments": {
-                "MissingText": true
-              }
-            }
-          }
-        },
-        "_getImageData8bits": {
-          "Comments": {
-            "MissingText": true
-          },
-          "Parameter": {
-            "header": {
-              "Comments": {
-                "MissingText": true
-              }
-            },
-            "palettes": {
-              "Comments": {
-                "MissingText": true
-              }
-            },
-            "pixel_data": {
-              "Comments": {
-                "MissingText": true
-              }
-            },
-            "y_start": {
-              "Comments": {
-                "MissingText": true
-              }
-            },
-            "y_step": {
-              "Comments": {
-                "MissingText": true
-              }
-            },
-            "y_end": {
-              "Comments": {
-                "MissingText": true
-              }
-            },
-            "x_start": {
-              "Comments": {
-                "MissingText": true
-              }
-            },
-            "x_step": {
-              "Comments": {
-                "MissingText": true
-              }
-            },
-            "x_end": {
-              "Comments": {
-                "MissingText": true
-              }
-            }
-          }
-        },
-        "_getImageDataGrey16bits": {
-          "Comments": {
-            "MissingText": true
-          },
-          "Parameter": {
-            "header": {
-              "Comments": {
-                "MissingText": true
-              }
-            },
-            "palettes": {
-              "Comments": {
-                "MissingText": true
-              }
-            },
-            "pixel_data": {
-              "Comments": {
-                "MissingText": true
-              }
-            },
-            "y_start": {
-              "Comments": {
-                "MissingText": true
-              }
-            },
-            "y_step": {
-              "Comments": {
-                "MissingText": true
-              }
-            },
-            "y_end": {
-              "Comments": {
-                "MissingText": true
-              }
-            },
-            "x_start": {
-              "Comments": {
-                "MissingText": true
-              }
-            },
-            "x_step": {
-              "Comments": {
-                "MissingText": true
-              }
-            },
-            "x_end": {
-              "Comments": {
-                "MissingText": true
-              }
-            }
-          }
-        },
-        "_getImageDataGrey8bits": {
-          "Comments": {
-            "MissingText": true
-          },
-          "Parameter": {
-            "header": {
-              "Comments": {
-                "MissingText": true
-              }
-            },
-            "palettes": {
-              "Comments": {
-                "MissingText": true
-              }
-            },
-            "pixel_data": {
-              "Comments": {
-                "MissingText": true
-              }
-            },
-            "y_start": {
-              "Comments": {
-                "MissingText": true
-              }
-            },
-            "y_step": {
-              "Comments": {
-                "MissingText": true
-              }
-            },
-            "y_end": {
-              "Comments": {
-                "MissingText": true
-              }
-            },
-            "x_start": {
-              "Comments": {
-                "MissingText": true
-              }
-            },
-            "x_step": {
-              "Comments": {
-                "MissingText": true
-              }
-            },
-            "x_end": {
-              "Comments": {
-                "MissingText": true
-              }
-            }
-          }
-        }
-      }
-    },
-    "Tags": {
-      "Class": {
-        "Comments": {
-          "MissingText": true
-        }
-      },
-      "Method": {
-        "AddTagsTo": {
-          "Comments": {
-            "MissingText": true
-          },
-          "Parameter": {
-            "obj": {
-              "Comments": {
-                "MissingText": true
-              }
-            },
-            "tagsString": {
-              "Comments": {
-                "MissingText": true
-              }
-            }
-          }
-        },
-        "DisableFor": {
-          "Comments": {
-            "MissingText": true
-          },
-          "Parameter": {
-            "obj": {
-              "Comments": {
-                "MissingText": true
-              }
-            }
-          }
-        },
-        "EnableFor": {
-          "Comments": {
-            "MissingText": true
-          },
-          "Parameter": {
-            "obj": {
-              "Comments": {
-                "MissingText": true
-              }
-            }
-          }
-        },
-        "GetTags": {
-          "Comments": {
-            "MissingText": true
-          },
-          "Parameter": {
-            "obj": {
-              "Comments": {
-                "MissingText": true
-              }
-            },
-            "asString": {
-              "Comments": {
-                "MissingText": true
-              }
-            }
-          }
-        },
-        "HasTags": {
-          "Comments": {
-            "MissingText": true
-          },
-          "Parameter": {
-            "obj": {
-              "Comments": {
-                "MissingText": true
-              }
-            }
-          }
-        },
-        "MatchesQuery": {
-          "Comments": {
-            "MissingText": true
-          },
-          "Parameter": {
-            "obj": {
-              "Comments": {
-                "MissingText": true
-              }
-            },
-            "tagsQuery": {
-              "Comments": {
-                "MissingText": true
-              }
-            }
-          }
-        },
-        "RemoveTagsFrom": {
-          "Comments": {
-            "MissingText": true
-          },
-          "Parameter": {
-            "obj": {
-              "Comments": {
-                "MissingText": true
-              }
-            },
-            "tagsString": {
-              "Comments": {
-                "MissingText": true
-              }
-            }
-          }
-        },
-        "_AddTagTo": {
-          "Comments": {
-            "MissingText": true
-          },
-          "Parameter": {
-            "obj": {
-              "Comments": {
-                "MissingText": true
-              }
-            },
-            "tag": {
-              "Comments": {
-                "MissingText": true
-              }
-            }
-          }
-        },
-        "_RemoveTagFrom": {
-          "Comments": {
-            "MissingText": true
-          },
-          "Parameter": {
-            "obj": {
-              "Comments": {
-                "MissingText": true
-              }
-            },
-            "tag": {
-              "Comments": {
-                "MissingText": true
-              }
-            }
-          }
-        }
-      }
-    },
     "TargetedAnimation": {
       "Property": {
         "animation": {
@@ -8461,36 +7614,6 @@
         }
       }
     },
-    "TextureTools": {
-      "Class": {
-        "Comments": {
-          "MissingText": true
-        }
-      },
-      "Method": {
-        "CreateResizedCopy": {
-          "Parameter": {
-            "useBilinearMode": {
-              "Comments": {
-                "MissingText": true
-              }
-            }
-          }
-        },
-        "GetEnvironmentBRDFTexture": {
-          "Comments": {
-            "MissingText": true
-          },
-          "Parameter": {
-            "scene": {
-              "Comments": {
-                "MissingText": true
-              }
-            }
-          }
-        }
-      }
-    },
     "Tmp": {
       "Class": {
         "Comments": {

+ 11 - 0
src/Tools/babylon.dds.ts

@@ -141,9 +141,20 @@
         sphericalPolynomial?: SphericalPolynomial;
     };
 
+    /**
+     * Class used to provide DDS decompression tools
+     */
     export class DDSTools {
+        /**
+         * Gets or sets a boolean indicating that LOD info is stored in alpha channel (false by default)
+         */
         public static StoreLODInAlphaChannel = false;
 
+        /**
+         * Gets DDS information from an array buffer
+         * @param arrayBuffer defines the array buffer to read data from
+         * @returns the DDS information
+         */
         public static GetDDSInfo(arrayBuffer: any): DDSInfo {
             var header = new Int32Array(arrayBuffer, 0, headerLengthInt);
             var extendedHeader = new Int32Array(arrayBuffer, 0, headerLengthInt + 4);

+ 35 - 0
src/Tools/babylon.filesInput.ts

@@ -1,7 +1,16 @@
 module BABYLON {
+    /**
+     * Class used to help managing file picking and drag'n'drop
+     */
     export class FilesInput {
+        /**
+         * List of files ready to be loaded
+         */
         public static FilesToLoad: { [key: string]: File } = {};
 
+        /**
+         * Callback called when a file is processed
+         */
         public onProcessFileCallback: (file: File, name: string, extension: string) => true = () => { return true; };
 
         private _engine: Engine;
@@ -18,6 +27,18 @@
         private _sceneFileToLoad: File;
         private _filesToLoad: File[];
 
+        /**
+         * Creates a new FilesInput
+         * @param engine defines the rendering engine
+         * @param scene defines the hosting scene
+         * @param sceneLoadedCallback callback called when scene is loaded
+         * @param progressCallback callback called to track progress
+         * @param additionalRenderLoopLogicCallback callback called to add user logic to the rendering loop
+         * @param textureLoadingCallback callback called when a texture is loading
+         * @param startingProcessingFilesCallback callback called when the system is about to process all files
+         * @param onReloadCallback callback called when a reload is requested
+         * @param errorCallback callback call if an error occurs
+         */
         constructor(engine: Engine, scene: Scene, sceneLoadedCallback: (sceneFile: File, scene: Scene) => void, progressCallback: (progress: SceneLoaderProgressEvent) => void, additionalRenderLoopLogicCallback: () => void, 
             textureLoadingCallback: (remaining: number) => void, startingProcessingFilesCallback: (files?: File[]) => void, onReloadCallback: (sceneFile: File) => void, errorCallback: (sceneFile: File, scene: Scene, message: string) => void) {
             this._engine = engine;
@@ -36,6 +57,10 @@
         private _dragOverHandler: (e: any) => void;
         private _dropHandler: (e: any) => void;
 
+        /**
+         * Calls this function to listen to drag'n'drop events on a specific DOM element
+         * @param elementToMonitor defines the DOM element to track
+         */
         public monitorElementForDragNDrop(elementToMonitor: HTMLElement): void {
             if (elementToMonitor) {
                 this._elementToMonitor = elementToMonitor;
@@ -50,6 +75,9 @@
             }
         }
 
+        /**
+         * Release all associated resources
+         */
         public dispose() {
             if (!this._elementToMonitor) {
                 return;
@@ -134,6 +162,10 @@
             }
         }
 
+        /**
+         * Load files from a drop event
+         * @param event defines the drop event to use as source
+         */
         public loadFiles(event: any): void {
             // Handling data transfer via drag'n'drop
             if (event && event.dataTransfer && event.dataTransfer.files) {
@@ -214,6 +246,9 @@
             }
         }
 
+        /**
+         * Reload the current scene from the loaded files
+         */
         public reload() {
             // If a scene file has been provided
             if (this._sceneFileToLoad) {

+ 74 - 25
src/Tools/babylon.khronosTextureContainer.ts

@@ -4,36 +4,79 @@ module BABYLON {
      * for file layout see https://www.khronos.org/opengles/sdk/tools/KTX/file_format_spec/
      */
     export class KhronosTextureContainer {
-        static HEADER_LEN = 12 + (13 * 4); // identifier + header elements (not including key value meta-data pairs)
+        private static HEADER_LEN = 12 + (13 * 4); // identifier + header elements (not including key value meta-data pairs)
 
         // load types
-        static COMPRESSED_2D = 0; // uses a gl.compressedTexImage2D()
-        static COMPRESSED_3D = 1; // uses a gl.compressedTexImage3D()
-        static TEX_2D = 2; // uses a gl.texImage2D()
-        static TEX_3D = 3; // uses a gl.texImage3D()
+        private static COMPRESSED_2D = 0; // uses a gl.compressedTexImage2D()
+        private static COMPRESSED_3D = 1; // uses a gl.compressedTexImage3D()
+        private static TEX_2D = 2; // uses a gl.texImage2D()
+        private static TEX_3D = 3; // uses a gl.texImage3D()
 
         // elements of the header 
+        /**
+         * Gets the openGL type
+         */
         public glType: number;
+        /**
+         * Gets the openGL type size
+         */
         public glTypeSize: number;
+        /**
+         * Gets the openGL format
+         */
         public glFormat: number;
+        /**
+         * Gets the openGL internal format
+         */
         public glInternalFormat: number;
+        /**
+         * Gets the base internal format
+         */
         public glBaseInternalFormat: number;
+        /**
+         * Gets image width in pixel
+         */
         public pixelWidth: number;
+        /**
+         * Gets image height in pixel
+         */
         public pixelHeight: number;
+        /**
+         * Gets image depth in pixels
+         */
         public pixelDepth: number;
+        /**
+         * Gets the number of array elements
+         */
         public numberOfArrayElements: number;
+        /**
+         * Gets the number of faces
+         */
         public numberOfFaces: number;
+        /**
+         * Gets the number of mipmap levels
+         */
         public numberOfMipmapLevels: number;
+        /**
+         * Gets the bytes of key value data
+         */
         public bytesOfKeyValueData: number;
-
+        /**
+         * Gets the load type
+         */
         public loadType: number;
+
+
         /**
-         * @param {ArrayBuffer} arrayBuffer- contents of the KTX container file
-         * @param {number} facesExpected- should be either 1 or 6, based whether a cube texture or or
-         * @param {boolean} threeDExpected- provision for indicating that data should be a 3D texture, not implemented
-         * @param {boolean} textureArrayExpected- provision for indicating that data should be a texture array, not implemented
+         * Creates a new KhronosTextureContainer
+         * @param arrayBuffer contents of the KTX container file
+         * @param facesExpected should be either 1 or 6, based whether a cube texture or or
+         * @param threeDExpected provision for indicating that data should be a 3D texture, not implemented
+         * @param textureArrayExpected provision for indicating that data should be a texture array, not implemented
          */
-        public constructor(public arrayBuffer: any, facesExpected: number, threeDExpected?: boolean, textureArrayExpected?: boolean) {
+        public constructor(
+            /** contents of the KTX container file */
+            public arrayBuffer: any, facesExpected: number, threeDExpected?: boolean, textureArrayExpected?: boolean) {
             // Test that it is a ktx formatted file, based on the first 12 bytes, character representation is:
             // '�', 'K', 'T', 'X', ' ', '1', '1', '�', '\r', '\n', '\x1A', '\n'
             // 0xAB, 0x4B, 0x54, 0x58, 0x20, 0x31, 0x31, 0xBB, 0x0D, 0x0A, 0x1A, 0x0A
@@ -51,18 +94,18 @@ module BABYLON {
             var oppositeEndianess = header[0] === 0x01020304;
 
             // read all the header elements in order they exist in the file, without modification (sans endainness)
-            this.glType = oppositeEndianess ? this.switchEndainness(header[1]) : header[1]; // must be 0 for compressed textures
-            this.glTypeSize = oppositeEndianess ? this.switchEndainness(header[2]) : header[2]; // must be 1 for compressed textures
-            this.glFormat = oppositeEndianess ? this.switchEndainness(header[3]) : header[3]; // must be 0 for compressed textures
-            this.glInternalFormat = oppositeEndianess ? this.switchEndainness(header[4]) : header[4]; // the value of arg passed to gl.compressedTexImage2D(,,x,,,,)
-            this.glBaseInternalFormat = oppositeEndianess ? this.switchEndainness(header[5]) : header[5]; // specify GL_RGB, GL_RGBA, GL_ALPHA, etc (un-compressed only)
-            this.pixelWidth = oppositeEndianess ? this.switchEndainness(header[6]) : header[6]; // level 0 value of arg passed to gl.compressedTexImage2D(,,,x,,,)
-            this.pixelHeight = oppositeEndianess ? this.switchEndainness(header[7]) : header[7]; // level 0 value of arg passed to gl.compressedTexImage2D(,,,,x,,)
-            this.pixelDepth = oppositeEndianess ? this.switchEndainness(header[8]) : header[8]; // level 0 value of arg passed to gl.compressedTexImage3D(,,,,,x,,)
-            this.numberOfArrayElements = oppositeEndianess ? this.switchEndainness(header[9]) : header[9]; // used for texture arrays
-            this.numberOfFaces = oppositeEndianess ? this.switchEndainness(header[10]) : header[10]; // used for cubemap textures, should either be 1 or 6
-            this.numberOfMipmapLevels = oppositeEndianess ? this.switchEndainness(header[11]) : header[11]; // number of levels; disregard possibility of 0 for compressed textures
-            this.bytesOfKeyValueData = oppositeEndianess ? this.switchEndainness(header[12]) : header[12]; // the amount of space after the header for meta-data
+            this.glType = oppositeEndianess ? this.switchEndianness(header[1]) : header[1]; // must be 0 for compressed textures
+            this.glTypeSize = oppositeEndianess ? this.switchEndianness(header[2]) : header[2]; // must be 1 for compressed textures
+            this.glFormat = oppositeEndianess ? this.switchEndianness(header[3]) : header[3]; // must be 0 for compressed textures
+            this.glInternalFormat = oppositeEndianess ? this.switchEndianness(header[4]) : header[4]; // the value of arg passed to gl.compressedTexImage2D(,,x,,,,)
+            this.glBaseInternalFormat = oppositeEndianess ? this.switchEndianness(header[5]) : header[5]; // specify GL_RGB, GL_RGBA, GL_ALPHA, etc (un-compressed only)
+            this.pixelWidth = oppositeEndianess ? this.switchEndianness(header[6]) : header[6]; // level 0 value of arg passed to gl.compressedTexImage2D(,,,x,,,)
+            this.pixelHeight = oppositeEndianess ? this.switchEndianness(header[7]) : header[7]; // level 0 value of arg passed to gl.compressedTexImage2D(,,,,x,,)
+            this.pixelDepth = oppositeEndianess ? this.switchEndianness(header[8]) : header[8]; // level 0 value of arg passed to gl.compressedTexImage3D(,,,,,x,,)
+            this.numberOfArrayElements = oppositeEndianess ? this.switchEndianness(header[9]) : header[9]; // used for texture arrays
+            this.numberOfFaces = oppositeEndianess ? this.switchEndianness(header[10]) : header[10]; // used for cubemap textures, should either be 1 or 6
+            this.numberOfMipmapLevels = oppositeEndianess ? this.switchEndianness(header[11]) : header[11]; // number of levels; disregard possibility of 0 for compressed textures
+            this.bytesOfKeyValueData = oppositeEndianess ? this.switchEndianness(header[12]) : header[12]; // the amount of space after the header for meta-data
 
             // Make sure we have a compressed type.  Not only reduces work, but probably better to let dev know they are not compressing.
             if (this.glType !== 0) {
@@ -93,8 +136,14 @@ module BABYLON {
             this.loadType = KhronosTextureContainer.COMPRESSED_2D;
         }
 
-        // not as fast hardware based, but will probably never need to use
-        public switchEndainness(val: number): number {
+        // 
+        /**
+         * Revert the endianness of a value.
+         * Not as fast hardware based, but will probably never need to use
+         * @param val defines the value to convert
+         * @returns the new value
+         */
+        public switchEndianness(val: number): number {
             return ((val & 0xFF) << 24)
                 | ((val & 0xFF00) << 8)
                 | ((val >> 8) & 0xFF00)

+ 0 - 7
src/Tools/babylon.performanceMonitor.ts

@@ -34,7 +34,6 @@ module BABYLON {
 
 		/**
 		 * Returns the average frame time in milliseconds over the sliding window (or the subset of frames sampled so far)
-		 * @return Average frame time in milliseconds
 		 */
         public get averageFrameTime(): number {
             return this._rollingFrameTime.average;
@@ -42,7 +41,6 @@ module BABYLON {
 
 		/**
 		 * Returns the variance frame time in milliseconds over the sliding window (or the subset of frames sampled so far)
-		 * @return Frame time variance in milliseconds squared
 		 */
         public get averageFrameTimeVariance(): number {
             return this._rollingFrameTime.variance;
@@ -50,7 +48,6 @@ module BABYLON {
 
 		/**
 		 * Returns the frame time of the most recent frame
-		 * @return Frame time in milliseconds
 		 */
         public get instantaneousFrameTime(): number {
             return this._rollingFrameTime.history(0);
@@ -58,7 +55,6 @@ module BABYLON {
 
 		/**
 		 * Returns the average framerate in frames per second over the sliding window (or the subset of frames sampled so far)
-		 * @return Framerate in frames per second
 		 */
         public get averageFPS(): number {
             return 1000.0 / this._rollingFrameTime.average;
@@ -66,7 +62,6 @@ module BABYLON {
 
 		/**
 		 * Returns the average framerate in frames per second using the most recent frame time
-		 * @return Framerate in frames per second
 		 */
         public get instantaneousFPS(): number {
             let history = this._rollingFrameTime.history(0);
@@ -80,7 +75,6 @@ module BABYLON {
 
 		/**
 		 * Returns true if enough samples have been taken to completely fill the sliding window
-		 * @return true if saturated
 		 */
         public get isSaturated(): boolean {
             return this._rollingFrameTime.isSaturated();
@@ -105,7 +99,6 @@ module BABYLON {
 
 		/**
 		 * Returns true if sampling is enabled
-		 * @return true if enabled
 		 */
         public get isEnabled(): boolean {
             return this._enabled;

+ 18 - 0
src/Tools/babylon.sceneSerializer.ts

@@ -115,11 +115,22 @@
         }
     }
 
+    /**
+     * Class used to serialize a scene into a string
+     */
     export class SceneSerializer {
+        /**
+         * Clear cache used by a previous serialization
+         */
         public static ClearCache(): void {
             serializedGeometries = [];
         }
 
+        /**
+         * Serialize a scene into a JSON compatible object
+         * @param scene defines the scene to serialize
+         * @returns a JSON compatible object
+         */
         public static Serialize(scene: Scene): any {
             var serializationObject: any = {};
 
@@ -292,6 +303,13 @@
             return serializationObject;
         }
 
+        /**
+         * Serialize a mesh into a JSON compatible object
+         * @param toSerialize defines the mesh to serialize
+         * @param withParents defines if parents must be serialized as well
+         * @param withChildren defines if children must be serialized as well
+         * @returns a JSON compatible object
+         */
         public static SerializeMesh(toSerialize: any /* Mesh || Mesh[] */, withParents: boolean = false, withChildren: boolean = false): any {
             var serializationObject: any = {};
 

+ 45 - 3
src/Tools/babylon.tags.ts

@@ -1,5 +1,12 @@
 module BABYLON {
+    /**
+     * Class used to store custom tags 
+     */
     export class Tags {
+        /**
+         * Adds support for tags on the given object
+         * @param obj defines the object to use
+         */
         public static EnableFor(obj: any): void {
             obj._tags = obj._tags || {};
 
@@ -20,6 +27,10 @@
             };
         }
 
+        /**
+         * Removes tags support
+         * @param obj defines the object to use
+         */
         public static DisableFor(obj: any): void {
             delete obj._tags;
             delete obj.hasTags;
@@ -28,6 +39,11 @@
             delete obj.matchesTagsQuery;
         }
 
+        /**
+         * Gets a boolean indicating if the given object has tags
+         * @param obj defines the object to use
+         * @returns a boolean
+         */
         public static HasTags(obj: any): boolean {
             if (!obj._tags) {
                 return false;
@@ -35,6 +51,12 @@
             return !Tools.IsEmpty(obj._tags);
         }
 
+        /**
+         * Gets the tags available on a given object
+         * @param obj defines the object to use
+         * @param asString defines if the tags must be returned as a string instead of an array of strings
+         * @returns the tags
+         */
         public static GetTags(obj: any, asString: boolean = true): any {
             if (!obj._tags) {
                 return null;
@@ -53,9 +75,12 @@
 
         }
 
-        // the tags 'true' and 'false' are reserved and cannot be used as tags
-        // a tag cannot start with '||', '&&', and '!'
-        // it cannot contain whitespaces
+        /**
+         * Adds tags to an object
+         * @param obj defines the object to use
+         * @param tagsString defines the tag string. The tags 'true' and 'false' are reserved and cannot be used as tags.
+         * A tag cannot start with '||', '&&', and '!'. It cannot contain whitespaces
+         */
         public static AddTagsTo(obj: any, tagsString: string): void {
             if (!tagsString) {
                 return;
@@ -71,6 +96,9 @@
             });
         }
 
+        /**
+         * @hidden
+         */
         public static _AddTagTo(obj: any, tag: string): void {
             tag = tag.trim();
 
@@ -86,6 +114,11 @@
             obj._tags[tag] = true;
         }
 
+        /**
+         * Removes specific tags from a specific object
+         * @param obj defines the object to use
+         * @param tagsString defines the tags to remove
+         */
         public static RemoveTagsFrom(obj: any, tagsString: string) {
             if (!Tags.HasTags(obj)) {
                 return;
@@ -96,10 +129,19 @@
             }
         }
 
+        /**
+         * @hidden
+         */        
         public static _RemoveTagFrom(obj: any, tag: string): void {
             delete obj._tags[tag];
         }
 
+        /**
+         * Defines if tags hosted on an object match a given query
+         * @param obj defines the object to use
+         * @param tagsQuery defines the tag query
+         * @returns a boolean
+         */
         public static MatchesQuery(obj: any, tagsQuery: string): boolean {
             if (tagsQuery === undefined) {
                 return true;

+ 12 - 3
src/Tools/babylon.textureTools.ts

@@ -1,11 +1,15 @@
 module BABYLON {
+    /**
+     * Class used to host texture specific utilities
+     */
     export class TextureTools {
 		/**
 		 * Uses the GPU to create a copy texture rescaled at a given size
 		 * @param texture Texture to copy from
-		 * @param width Desired width
-		 * @param height Desired height
-		 * @return Generated texture
+		 * @param width defines the desired width
+		 * @param height defines the desired height
+         * @param useBilinearMode defines if bilinear mode has to be used
+		 * @return the generated texture
 		 */
         public static CreateResizedCopy(texture: Texture, width: number, height: number, useBilinearMode: boolean = true): Texture {
 
@@ -63,6 +67,11 @@
             return rtt;
         }
 
+        /**
+         * Gets an environment BRDF texture for a given scene
+         * @param scene defines the hosting scene
+         * @returns the environment BRDF texture
+         */
         public static GetEnvironmentBRDFTexture(scene: Scene): BaseTexture {
             if (!scene._environmentBRDFTexture) {
                 var texture = Texture.CreateFromBase64String(this._environmentBRDFBase64Texture, "EnvironmentBRDFTexture", scene, true, false, Texture.BILINEAR_SAMPLINGMODE);

+ 16 - 5
src/Tools/babylon.tga.ts

@@ -1,9 +1,9 @@
 module BABYLON {
-    /*
-    * Based on jsTGALoader - Javascript loader for TGA file
-    * By Vincent Thibault
-    * @blog http://blog.robrowser.com/javascript-tga-loader.html
-    */
+    /**
+     * Based on jsTGALoader - Javascript loader for TGA file
+     * By Vincent Thibault
+     * @see http://blog.robrowser.com/javascript-tga-loader.html
+     */
     export class TGATools {
 
         //private static _TYPE_NO_DATA = 0;
@@ -20,6 +20,11 @@
         private static _ORIGIN_UL = 0x02;
         private static _ORIGIN_UR = 0x03;
 
+        /**
+         * Gets the header of a TGA file
+         * @param data defines the TGA data
+         * @returns the header
+         */
         public static GetTGAHeader(data: Uint8Array): any {
             var offset = 0;
 
@@ -199,6 +204,7 @@
             engine._uploadDataToTextureDirectly(texture, imageData);
         }
 
+        /** @hidden */
         static _getImageData8bits(header: any, palettes: Uint8Array, pixel_data: Uint8Array, y_start: number, y_step: number, y_end: number, x_start: number, x_step: number, x_end: number): Uint8Array {
             var image = pixel_data, colormap = palettes;
             var width = header.width, height = header.height;
@@ -219,6 +225,7 @@
             return imageData;
         }
 
+        /** @hidden */
         static _getImageData16bits(header: any, palettes: Uint8Array, pixel_data: Uint8Array, y_start: number, y_step: number, y_end: number, x_start: number, x_step: number, x_end: number): Uint8Array {
             var image = pixel_data;
             var width = header.width, height = header.height;
@@ -243,6 +250,7 @@
             return imageData;
         }
 
+        /** @hidden */
         static _getImageData24bits(header: any, palettes: Uint8Array, pixel_data: Uint8Array, y_start: number, y_step: number, y_end: number, x_start: number, x_step: number, x_end: number): Uint8Array {
             var image = pixel_data;
             var width = header.width, height = header.height;
@@ -262,6 +270,7 @@
             return imageData;
         }
 
+        /** @hidden */
         static _getImageData32bits(header: any, palettes: Uint8Array, pixel_data: Uint8Array, y_start: number, y_step: number, y_end: number, x_start: number, x_step: number, x_end: number): Uint8Array {
             var image = pixel_data;
             var width = header.width, height = header.height;
@@ -281,6 +290,7 @@
             return imageData;
         }
 
+        /** @hidden */
         static _getImageDataGrey8bits(header: any, palettes: Uint8Array, pixel_data: Uint8Array, y_start: number, y_step: number, y_end: number, x_start: number, x_step: number, x_end: number): Uint8Array {
             var image = pixel_data;
             var width = header.width, height = header.height;
@@ -301,6 +311,7 @@
             return imageData;
         }
 
+        /** @hidden */
         static _getImageDataGrey16bits(header: any, palettes: Uint8Array, pixel_data: Uint8Array, y_start: number, y_step: number, y_end: number, x_start: number, x_step: number, x_end: number): Uint8Array {
             var image = pixel_data;
             var width = header.width, height = header.height;