Ver código fonte

More code comments

David Catuhe 7 anos atrás
pai
commit
20a7fb630e

Diferenças do arquivo suprimidas por serem muito extensas
+ 8048 - 8004
dist/preview release/babylon.d.ts


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

@@ -4536,98 +4536,6 @@
         }
         }
       }
       }
     },
     },
-    "BoneIKController": {
-      "Constructor": {
-        "new BoneIKController": {
-          "Comments": {
-            "MissingText": true
-          },
-          "Parameter": {
-            "mesh": {
-              "Comments": {
-                "MissingText": true
-              }
-            },
-            "bone": {
-              "Comments": {
-                "MissingText": true
-              }
-            },
-            "options": {
-              "Comments": {
-                "MissingText": true
-              }
-            }
-          }
-        }
-      },
-      "Property": {
-        "maxAngle": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "mesh": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "poleAngle": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "poleTargetBone": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "poleTargetLocalOffset": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "poleTargetMesh": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "poleTargetPosition": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "slerpAmount": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "targetMesh": {
-          "Comments": {
-            "MissingText": true
-          }
-        },
-        "targetPosition": {
-          "Comments": {
-            "MissingText": true
-          }
-        }
-      },
-      "Method": {
-        "update": {
-          "Comments": {
-            "MissingText": true
-          }
-        }
-      }
-    },
-    "BoneLookController": {
-      "Class": {
-        "Comments": {
-          "MissingText": true
-        }
-      }
-    },
     "BounceEase": {
     "BounceEase": {
       "Class": {
       "Class": {
         "Comments": {
         "Comments": {

+ 52 - 11
src/Bones/babylon.boneIKController.ts

@@ -1,19 +1,55 @@
 module BABYLON {
 module BABYLON {
-    /** Class used to apply inverse kinematics to bones */
+    /** 
+     * Class used to apply inverse kinematics to bones 
+     * @see http://doc.babylonjs.com/how_to/how_to_use_bones_and_skeletons#boneikcontroller
+     */
     export class BoneIKController {
     export class BoneIKController {
 
 
         private static _tmpVecs: Vector3[] = [Vector3.Zero(), Vector3.Zero(), Vector3.Zero(), Vector3.Zero(), Vector3.Zero(), Vector3.Zero()];
         private static _tmpVecs: Vector3[] = [Vector3.Zero(), Vector3.Zero(), Vector3.Zero(), Vector3.Zero(), Vector3.Zero(), Vector3.Zero()];
         private static _tmpQuat = Quaternion.Identity();
         private static _tmpQuat = Quaternion.Identity();
         private static _tmpMats: Matrix[] = [Matrix.Identity(), Matrix.Identity()];
         private static _tmpMats: Matrix[] = [Matrix.Identity(), Matrix.Identity()];
         
         
+        /**
+         * Gets or sets the target mesh
+         */
         public targetMesh: AbstractMesh;
         public targetMesh: AbstractMesh;
+
+        /** Gets or sets the mesh used as pole */
         public poleTargetMesh: AbstractMesh;
         public poleTargetMesh: AbstractMesh;
+
+        /**
+         * Gets or sets the bone used as pole
+         */
         public poleTargetBone: Nullable<Bone>;
         public poleTargetBone: Nullable<Bone>;
+
+        /**
+         * Gets or sets the target position
+         */
         public targetPosition = Vector3.Zero();
         public targetPosition = Vector3.Zero();
+
+        /**
+         * Gets or sets the pole target position
+         */
         public poleTargetPosition = Vector3.Zero();
         public poleTargetPosition = Vector3.Zero();
+
+        /**
+         * Gets or sets the pole target local offset
+         */
         public poleTargetLocalOffset = Vector3.Zero();
         public poleTargetLocalOffset = Vector3.Zero();
+
+        /**
+         * Gets or sets the pole angle
+         */
         public poleAngle = 0;
         public poleAngle = 0;
+
+        /**
+         * Gets or sets the mesh associated with the controller
+         */
         public mesh: AbstractMesh;
         public mesh: AbstractMesh;
+
+        /**
+         * The amount to slerp (spherical linear interpolation) to the target.  Set this to a value between 0 and 1 (a value of 1 disables slerp)
+         */
         public slerpAmount = 1;
         public slerpAmount = 1;
 
 
         private _bone1Quat = Quaternion.Identity();
         private _bone1Quat = Quaternion.Identity();
@@ -34,18 +70,23 @@ module BABYLON {
 
 
         private _adjustRoll = 0;
         private _adjustRoll = 0;
         
         
-        get maxAngle(): number {
-
+        /**
+         * Gets or sets maximum allowed angle
+         */
+        public get maxAngle(): number {
             return this._maxAngle;
             return this._maxAngle;
-
         }
         }
 
 
-        set maxAngle(value: number) {
-            
+        public set maxAngle(value: number) {          
             this._setMaxAngle(value);
             this._setMaxAngle(value);
-
         }
         }
 
 
+        /**
+         * Creates a new BoneIKController
+         * @param mesh defines the mesh to control
+         * @param bone defines the bone to control
+         * @param options defines options to set up the controller
+         */
         constructor(mesh: AbstractMesh, 
         constructor(mesh: AbstractMesh, 
                     bone: Bone, 
                     bone: Bone, 
                     options?: { 
                     options?: { 
@@ -166,8 +207,10 @@ module BABYLON {
 
 
         }
         }
 
 
-        public update(): void {
-	
+        /**
+         * Force the controller to update the bones
+         */
+        public update(): void {	
             var bone1 = this._bone1;
             var bone1 = this._bone1;
 
 
             if (!bone1) {
             if (!bone1) {
@@ -296,8 +339,6 @@ module BABYLON {
 
 
             this._bone2.setAxisAngle(this._bendAxis, angC, Space.LOCAL);
             this._bone2.setAxisAngle(this._bendAxis, angC, Space.LOCAL);
             this._bone2Ang = angC;
             this._bone2Ang = angC;
-
         }
         }
-
     }
     }
 }
 }

+ 30 - 26
src/Bones/babylon.boneLookController.ts

@@ -1,4 +1,8 @@
 module BABYLON {
 module BABYLON {
+    /**
+     * Class used to make a bone look toward a point in space
+     * @see http://doc.babylonjs.com/how_to/how_to_use_bones_and_skeletons#bonelookcontroller
+     */
     export class BoneLookController {
     export class BoneLookController {
 
 
         private static _tmpVecs: Vector3[] = [Vector3.Zero(), Vector3.Zero(), Vector3.Zero(), Vector3.Zero(), Vector3.Zero(), Vector3.Zero(), Vector3.Zero(), Vector3.Zero(), Vector3.Zero(), Vector3.Zero()];
         private static _tmpVecs: Vector3[] = [Vector3.Zero(), Vector3.Zero(), Vector3.Zero(), Vector3.Zero(), Vector3.Zero(), Vector3.Zero(), Vector3.Zero(), Vector3.Zero(), Vector3.Zero(), Vector3.Zero()];
@@ -6,47 +10,47 @@ module BABYLON {
         private static _tmpMats: Matrix[] = [Matrix.Identity(), Matrix.Identity(), Matrix.Identity(), Matrix.Identity(), Matrix.Identity()];
         private static _tmpMats: Matrix[] = [Matrix.Identity(), Matrix.Identity(), Matrix.Identity(), Matrix.Identity(), Matrix.Identity()];
 
 
         /**
         /**
-         * The target Vector3 that the bone will look at.
+         * The target Vector3 that the bone will look at
          */
          */
         public target: Vector3;
         public target: Vector3;
 
 
         /**
         /**
-         * The mesh that the bone is attached to.
+         * The mesh that the bone is attached to
          */
          */
         public mesh: AbstractMesh;
         public mesh: AbstractMesh;
 
 
         /**
         /**
-         * The bone that will be looking to the target.
+         * The bone that will be looking to the target
          */
          */
         public bone: Bone;
         public bone: Bone;
 
 
         /**
         /**
-         * The up axis of the coordinate system that is used when the bone is rotated.
+         * The up axis of the coordinate system that is used when the bone is rotated
          */
          */
         public upAxis: Vector3 = Vector3.Up();
         public upAxis: Vector3 = Vector3.Up();
 
 
         /**
         /**
-         * The space that the up axis is in - BABYLON.Space.BONE, BABYLON.Space.LOCAL (default), or BABYLON.Space.WORLD.
+         * The space that the up axis is in - BABYLON.Space.BONE, BABYLON.Space.LOCAL (default), or BABYLON.Space.WORLD
          */
          */
         public upAxisSpace: Space = Space.LOCAL;
         public upAxisSpace: Space = Space.LOCAL;
 
 
         /**
         /**
-         * Used to make an adjustment to the yaw of the bone.
+         * Used to make an adjustment to the yaw of the bone
          */
          */
         public adjustYaw = 0;
         public adjustYaw = 0;
 
 
         /**
         /**
-         * Used to make an adjustment to the pitch of the bone.
+         * Used to make an adjustment to the pitch of the bone
          */
          */
         public adjustPitch = 0;
         public adjustPitch = 0;
 
 
         /**
         /**
-         * Used to make an adjustment to the roll of the bone.
+         * Used to make an adjustment to the roll of the bone
          */
          */
         public adjustRoll = 0;
         public adjustRoll = 0;
 
 
         /**
         /**
-         * The amount to slerp (spherical linear interpolation) to the target.  Set this to a value between 0 and 1 (a value of 1 disables slerp).
+         * The amount to slerp (spherical linear interpolation) to the target.  Set this to a value between 0 and 1 (a value of 1 disables slerp)
          */
          */
         public slerpAmount = 1;
         public slerpAmount = 1;
 
 
@@ -71,7 +75,7 @@ module BABYLON {
         private _fowardAxis: Vector3 = Vector3.Forward();
         private _fowardAxis: Vector3 = Vector3.Forward();
 
 
         /**
         /**
-         * Get/set the minimum yaw angle that the bone can look to.
+         * Gets or sets the minimum yaw angle that the bone can look to
          */
          */
         get minYaw(): number {
         get minYaw(): number {
             return this._minYaw;
             return this._minYaw;
@@ -88,7 +92,7 @@ module BABYLON {
         }
         }
 
 
         /**
         /**
-         * Get/set the maximum yaw angle that the bone can look to.
+         * Gets or sets the maximum yaw angle that the bone can look to
          */
          */
         get maxYaw(): number {
         get maxYaw(): number {
             return this._maxYaw;
             return this._maxYaw;
@@ -105,7 +109,7 @@ module BABYLON {
         }
         }
 
 
         /**
         /**
-         * Get/set the minimum pitch angle that the bone can look to.
+         * Gets or sets the minimum pitch angle that the bone can look to
          */
          */
         get minPitch(): number {
         get minPitch(): number {
             return this._minPitch;
             return this._minPitch;
@@ -117,7 +121,7 @@ module BABYLON {
         }
         }
 
 
         /**
         /**
-         * Get/set the maximum pitch angle that the bone can look to.
+         * Gets or sets the maximum pitch angle that the bone can look to
          */
          */
         get maxPitch(): number {
         get maxPitch(): number {
             return this._maxPitch;
             return this._maxPitch;
@@ -134,18 +138,18 @@ module BABYLON {
          * @param bone the bone that will be looking to the target
          * @param bone the bone that will be looking to the target
          * @param target the target Vector3 to look at
          * @param target the target Vector3 to look at
          * @param settings optional settings:
          * @param settings optional settings:
-         * - maxYaw: the maximum angle the bone will yaw to
-         * - minYaw: the minimum angle the bone will yaw to
-         * - maxPitch: the maximum angle the bone will pitch to
-         * - minPitch: the minimum angle the bone will yaw to
-         * - slerpAmount: set the between 0 and 1 to make the bone slerp to the target.
-         * - upAxis: the up axis of the coordinate system
-         * - upAxisSpace: the space that the up axis is in - BABYLON.Space.BONE, BABYLON.Space.LOCAL (default), or BABYLON.Space.WORLD.
-         * - yawAxis: set yawAxis if the bone does not yaw on the y axis
-         * - pitchAxis: set pitchAxis if the bone does not pitch on the x axis
-         * - adjustYaw: used to make an adjustment to the yaw of the bone
-         * - adjustPitch: used to make an adjustment to the pitch of the bone
-         * - adjustRoll: used to make an adjustment to the roll of the bone
+         * * maxYaw: the maximum angle the bone will yaw to
+         * * minYaw: the minimum angle the bone will yaw to
+         * * maxPitch: the maximum angle the bone will pitch to
+         * * minPitch: the minimum angle the bone will yaw to
+         * * slerpAmount: set the between 0 and 1 to make the bone slerp to the target.
+         * * upAxis: the up axis of the coordinate system
+         * * upAxisSpace: the space that the up axis is in - BABYLON.Space.BONE, BABYLON.Space.LOCAL (default), or BABYLON.Space.WORLD.
+         * * yawAxis: set yawAxis if the bone does not yaw on the y axis
+         * * pitchAxis: set pitchAxis if the bone does not pitch on the x axis
+         * * adjustYaw: used to make an adjustment to the yaw of the bone
+         * * adjustPitch: used to make an adjustment to the pitch of the bone
+         * * adjustRoll: used to make an adjustment to the roll of the bone
          **/
          **/
         constructor(mesh: AbstractMesh,
         constructor(mesh: AbstractMesh,
             bone: Bone,
             bone: Bone,
@@ -253,7 +257,7 @@ module BABYLON {
         }
         }
 
 
         /**
         /**
-         * Update the bone to look at the target.  This should be called before the scene is rendered (use scene.registerBeforeRender()).
+         * Update the bone to look at the target.  This should be called before the scene is rendered (use scene.registerBeforeRender())
          */
          */
         public update(): void {
         public update(): void {