瀏覽代碼

Improve code comments

David Catuhe 7 年之前
父節點
當前提交
c44ed5f788

文件差異過大導致無法顯示
+ 1250 - 1203
dist/preview release/babylon.d.ts


文件差異過大導致無法顯示
+ 124 - 1135
dist/preview release/typedocValidationBaseline.json


+ 1 - 0
src/Collisions/babylon.collider.ts

@@ -57,6 +57,7 @@
         }
         )();
 
+    /** @hidden */
     export class Collider {
         /** Define if a collision was found */
         public collisionFound: boolean;

+ 15 - 1
src/Collisions/babylon.collisionCoordinator.ts

@@ -1,8 +1,10 @@
 module BABYLON {
 
     //WebWorker code will be inserted to this variable.
+    /** @hidden */
     export var CollisionWorker = "";
 
+    /** @hidden */
     export interface ICollisionCoordinator {
         getNewPosition(position: Vector3, displacement: Vector3, collider: Collider, maximumRetry: number, excludedMesh: Nullable<AbstractMesh>, onNewPosition: (collisionIndex: number, newPosition: Vector3, collidedMesh: Nullable<AbstractMesh>) => void, collisionIndex: number): void;
         init(scene: Scene): void;
@@ -17,6 +19,7 @@ module BABYLON {
         onGeometryDeleted(geometry: Geometry): void;
     }
 
+    /** @hidden */
     export interface SerializedMesh {
         id: string;
         name: string;
@@ -31,6 +34,7 @@ module BABYLON {
         checkCollisions: boolean;
     }
 
+    /** @hidden */
     export interface SerializedSubMesh {
         position: number;
         verticesStart: number;
@@ -45,7 +49,8 @@ module BABYLON {
     }
 
     /**
-     * Interface describing the value associated with a geometry
+     * Interface describing the value associated with a geometry.
+     * @hidden
      */
     export interface SerializedGeometry {
         /**
@@ -66,11 +71,13 @@ module BABYLON {
         normals: Float32Array;
     }
 
+    /** @hidden */
     export interface BabylonMessage {
         taskType: WorkerTaskType;
         payload: InitPayload | CollidePayload | UpdatePayload /*any for TS under 1.4*/;
     }
 
+    /** @hidden */
     export interface SerializedColliderToWorker {
         position: Array<number>;
         velocity: Array<number>;
@@ -87,22 +94,26 @@ module BABYLON {
         COLLIDE
     }
 
+    /** @hidden */
     export interface WorkerReply {
         error: WorkerReplyType;
         taskType: WorkerTaskType;
         payload?: any;
     }
 
+    /** @hidden */
     export interface CollisionReplyPayload {
         newPosition: Array<number>;
         collisionId: number;
         collidedMeshUniqueId: number;
     }
 
+    /** @hidden */
     export interface InitPayload {
 
     }
 
+    /** @hidden */
     export interface CollidePayload {
         collisionId: number;
         collider: SerializedColliderToWorker;
@@ -110,6 +121,7 @@ module BABYLON {
         excludedMeshUniqueId: Nullable<number>;
     }
 
+    /** @hidden */
     export interface UpdatePayload {
         updatedMeshes: { [n: number]: SerializedMesh; };
         updatedGeometries: { [s: string]: SerializedGeometry; };
@@ -125,6 +137,7 @@ module BABYLON {
         UNKNOWN_ERROR
     }
 
+    /** @hidden */
     export class CollisionCoordinatorWorker implements ICollisionCoordinator {
 
         private _scene: Scene;
@@ -371,6 +384,7 @@ module BABYLON {
         }
     }
 
+    /** @hidden */
     export class CollisionCoordinatorLegacy implements ICollisionCoordinator {
 
         private _scene: Scene;

+ 5 - 0
src/Collisions/babylon.collisionWorker.ts

@@ -6,8 +6,10 @@ const safePostMessage: any = self.postMessage;
 module BABYLON {
 
     //If this file is included in the main thread, this will be initialized.
+    /** @hidden */
     export var WorkerIncluded: boolean = true;
 
+    /** @hidden */
     export class CollisionCache {
         private _meshes: { [n: string]: SerializedMesh; } = {};
         private _geometries: { [s: string]: SerializedGeometry; } = {};
@@ -45,6 +47,7 @@ module BABYLON {
         }
     }
 
+    /** @hidden */
     export class CollideWorker {
 
         private collisionsScalingMatrix = Matrix.Zero();
@@ -181,12 +184,14 @@ module BABYLON {
         }
     }
 
+    /** @hidden */
     export interface ICollisionDetector {
         onInit(payload: InitPayload): void;
         onUpdate(payload: UpdatePayload): void;
         onCollision(payload: CollidePayload): void;
     }
 
+    /** @hidden */
     export class CollisionDetectorTransferable implements ICollisionDetector {
         private _collisionCache: CollisionCache;
 

+ 13 - 1
src/Math/babylon.math.ts

@@ -1,6 +1,18 @@
 module BABYLON {
+    /** 
+     * Constant used to convert a value to gamma space 
+     * @ignorenaming
+     */
     export const ToGammaSpace = 1 / 2.2;
-    export const ToLinearSpace = 2.2;
+    /** 
+     * Constant used to convert a value to linear space 
+     * @ignorenaming
+     */
+     export const ToLinearSpace = 2.2;
+    /** 
+     * Constant used to define the minimal number value in Babylon.js 
+     * @ignorenaming
+     */
     export const Epsilon = 0.001;
 
     /**

+ 1 - 1
src/Particles/babylon.IParticleSystem.ts

@@ -268,7 +268,7 @@ module BABYLON {
         /**
          * Adds a new color gradient
          * @param gradient defines the gradient to use (between 0 and 1)
-         * @param color defines the color to affect to the specified gradient
+         * @param color1 defines the color to affect to the specified gradient
          * @param color2 defines an additional color used to define a range ([color, color2]) with main color to pick the final color from
          * @returns the current particle system
          */

+ 1 - 1
src/Particles/babylon.gpuParticleSystem.ts

@@ -171,7 +171,7 @@
         /**
          * Adds a new color gradient
          * @param gradient defines the gradient to use (between 0 and 1)
-         * @param color defines the color to affect to the specified gradient
+         * @param color1 defines the color to affect to the specified gradient
          * @param color2 defines an additional color used to define a range ([color, color2]) with main color to pick the final color from
          * @returns the current particle system
          */

+ 3 - 3
src/Particles/babylon.particleSystem.ts

@@ -795,17 +795,17 @@
         /**
          * Adds a new color gradient
          * @param gradient defines the gradient to use (between 0 and 1)
-         * @param color defines the color to affect to the specified gradient
+         * @param color1 defines the color to affect to the specified gradient
          * @param color2 defines an additional color used to define a range ([color, color2]) with main color to pick the final color from
          */
-        public addColorGradient(gradient: number, color: Color4, color2?: Color4): IParticleSystem {
+        public addColorGradient(gradient: number, color1: Color4, color2?: Color4): IParticleSystem {
             if (!this._colorGradients) {
                 this._colorGradients = [];
             }
 
             let colorGradient = new ColorGradient();
             colorGradient.gradient = gradient;
-            colorGradient.color1 = color;
+            colorGradient.color1 = color1;
             colorGradient.color2 = color2;
             this._colorGradients.push(colorGradient);
 

+ 15 - 0
src/babylon.types.ts

@@ -1,10 +1,25 @@
 module BABYLON {
+    /** Alias type for value that can be null */
     export type Nullable<T> = T | null;
+    /** 
+     * Alias type for number that are floats
+     * @ignorenaming
+     */
     export type float = number;
+    /** 
+     * Alias type for number that are doubles.
+     * @ignorenaming
+     */
     export type double = number;
+    /** 
+     * Alias type for number that are integer
+     * @ignorenaming 
+     */
     export type int = number;
 
+    /** Alias type for number array or Float32Array */
     export type FloatArray = number[] | Float32Array;
+    /** Alias type for number array or Float32Array or Int32Array or Uint32Array or Uint16Array */
     export type IndicesArray = number[] | Int32Array | Uint32Array | Uint16Array;
 
     /**