Bladeren bron

document camera and cubetexture

Kacey Coley 7 jaren geleden
bovenliggende
commit
23a3ab01cd
2 gewijzigde bestanden met toevoegingen van 42 en 2 verwijderingen
  1. 3 0
      src/Cameras/babylon.camera.ts
  2. 39 2
      src/Materials/Textures/babylon.cubeTexture.ts

+ 3 - 0
src/Cameras/babylon.camera.ts

@@ -486,6 +486,9 @@
             return this._rigCameras;
         }
 
+        /**
+         * Gets the post process rig
+         */
         public get rigPostProcess(): Nullable<PostProcess> {
             return this._rigPostProcess;
         }

+ 39 - 2
src/Materials/Textures/babylon.cubeTexture.ts

@@ -1,5 +1,11 @@
 module BABYLON {
+    /**
+     * Class for creating a cube texture
+     */
     export class CubeTexture extends BaseTexture {
+        /**
+         * The url of the texture
+         */
         public url: string;
 
         /**
@@ -26,6 +32,9 @@
                 scene.markAllMaterialsAsDirty(Material.TextureDirtyFlag);
             }
         }
+        /**
+         * Returns the bounding box size
+         */
         public get boundingBoxSize(): Vector3 {
             return this._boundingBoxSize;
         }
@@ -57,7 +66,14 @@
         /** @hidden */
         public readonly _prefiltered: boolean = false;
 
-        public static CreateFromImages(files: string[], scene: Scene, noMipmap?: boolean) {
+        /**
+         * Creates a cube texture from an array of image urls
+         * @param files Array of image urls
+         * @param scene Babylon.js scene
+         * @param noMipmap Specifies if mip maps are not used
+         * @returns A cube texture
+         */
+        public static CreateFromImages(files: string[], scene: Scene, noMipmap?: boolean): CubeTexture {
             let rootUrlKey = "";
 
             files.forEach(url => rootUrlKey += url);
@@ -171,7 +187,9 @@
             }
         }
 
-        // Methods
+        /**
+         * Delays loading of the cube texture
+         */
         public delayLoad(): void {
             if (this.delayLoadState !== Engine.DELAYLOADSTATE_NOTLOADED) {
                 return;
@@ -195,14 +213,29 @@
             }
         }
 
+        /**
+         * Returns the reflection texture matrix
+         * @returns Reflection texture matrix
+         */
         public getReflectionTextureMatrix(): Matrix {
             return this._textureMatrix;
         }
 
+        /**
+         * Sets the reflection texture matrix
+         * @param value Reflection texture matrix
+         */
         public setReflectionTextureMatrix(value: Matrix): void {
             this._textureMatrix = value;
         }
 
+        /**
+         * Parses text to create a cube texture
+         * @param parsedTexture Serialized text to create a cube texture
+         * @param scene BABYLON.Scene 
+         * @param rootUrl The root url of the cube texture
+         * @returns A cube texture
+         */
         public static Parse(parsedTexture: any, scene: Scene, rootUrl: string): CubeTexture {
             var texture = SerializationHelper.Parse(() => {
                 var prefiltered:boolean = false;
@@ -232,6 +265,10 @@
             return texture;
         }
 
+        /**
+         * Makes a clone, or deep copy, of the cube texture
+         * @returns A cube texture
+         */
         public clone(): CubeTexture {
             return SerializationHelper.Clone(() => {
                 let scene = this.getScene();