瀏覽代碼

Some documentation for mesh

Raanan Weber 10 年之前
父節點
當前提交
f9d8902a69
共有 2 個文件被更改,包括 26 次插入2 次删除
  1. 12 0
      Babylon/Mesh/babylon.mesh.js
  2. 14 2
      Babylon/Mesh/babylon.mesh.ts

+ 12 - 0
Babylon/Mesh/babylon.mesh.js

@@ -19,6 +19,7 @@ var BABYLON;
     var Mesh = (function (_super) {
         __extends(Mesh, _super);
         /**
+        * @constructor
         * @param {string} name - The value used by scene.getMeshByName() to do a lookup.
         * @param {Scene} scene - The scene to add this mesh to.
         * @param {Node} parent - The parent of this mesh, if it has one
@@ -104,6 +105,12 @@ var BABYLON;
             });
         };
 
+        /**
+        * Add a mesh as LOD level triggered at the given distance.
+        * @param {number} distance - the distance from the center of the object to show this level
+        * @param {BABYLON.Mesh} mesh - the mesh to be added as LOD level
+        * @return {BABYLON.Mesh} this mesh (for chaining)
+        */
         Mesh.prototype.addLODLevel = function (distance, mesh) {
             if (mesh && mesh._masterMesh) {
                 BABYLON.Tools.Warn("You cannot use a mesh as LOD level twice");
@@ -122,6 +129,11 @@ var BABYLON;
             return this;
         };
 
+        /**
+        * Remove a mesh from the LOD array
+        * @param {BABYLON.Mesh} mesh - the mesh to be removed.
+        * @return {BABYLON.Mesh} this mesh (for chaining)
+        */
         Mesh.prototype.removeLODLevel = function (mesh) {
             for (var index = 0; index < this._LODLevels.length; index++) {
                 if (this._LODLevels[index].mesh === mesh) {

+ 14 - 2
Babylon/Mesh/babylon.mesh.ts

@@ -29,6 +29,7 @@
         private _preActivateId: number;
 
         /**
+         * @constructor
          * @param {string} name - The value used by scene.getMeshByName() to do a lookup.
          * @param {Scene} scene - The scene to add this mesh to.
          * @param {Node} parent - The parent of this mesh, if it has one
@@ -103,6 +104,12 @@
             });
         }
 
+        /**
+         * Add a mesh as LOD level triggered at the given distance.
+         * @param {number} distance - the distance from the center of the object to show this level
+         * @param {BABYLON.Mesh} mesh - the mesh to be added as LOD level
+         * @return {BABYLON.Mesh} this mesh (for chaining)
+         */
         public addLODLevel(distance: number, mesh: Mesh): Mesh {
             if (mesh && mesh._masterMesh) {
                 Tools.Warn("You cannot use a mesh as LOD level twice");
@@ -121,6 +128,11 @@
             return this;
         }
 
+        /**
+         * Remove a mesh from the LOD array
+         * @param {BABYLON.Mesh} mesh - the mesh to be removed.
+         * @return {BABYLON.Mesh} this mesh (for chaining)
+         */
         public removeLODLevel(mesh: Mesh): Mesh {
 
             for (var index = 0; index < this._LODLevels.length; index++) {
@@ -810,8 +822,8 @@
             return true;
         }
 
-        // Clone
-        public clone(name: string, newParent: Node, doNotCloneChildren?: boolean): Mesh {
+        // Clone 
+        public clone(name: string, newParent?: Node, doNotCloneChildren?: boolean): Mesh {
             return new Mesh(name, this.getScene(), newParent, this, doNotCloneChildren);
         }