Browse Source

RectPackingMap: added some doc.

nockawa 9 years ago
parent
commit
9c6fd69146
2 changed files with 8 additions and 6 deletions
  1. 4 3
      src/Tools/babylon.rectPackingMap.js
  2. 4 3
      src/Tools/babylon.rectPackingMap.ts

+ 4 - 3
src/Tools/babylon.rectPackingMap.js

@@ -8,6 +8,7 @@ var BABYLON;
     /**
      * The purpose of this class is to pack several Rectangles into a big map, while trying to fit everything as optimaly as possible.
      * This class is typically used to build lightmaps, sprite map or to pack several little textures into a big one.
+     * Note that this class allows allocated Rectangles to be freed: that is the map is dynamically maintained so you can add/remove rectangle based on their lifecycle.
      */
     var RectPackingMap = (function (_super) {
         __extends(RectPackingMap, _super);
@@ -30,7 +31,7 @@ var BABYLON;
         };
         Object.defineProperty(RectPackingMap.prototype, "freeSpace", {
             /**
-             * Return the space free normalized between [0;1]
+             * Return the current space free normalized between [0;1]
              * @returns {}
              */
             get: function () {
@@ -96,8 +97,8 @@ var BABYLON;
             configurable: true
         });
         /**
-         * Free this node's content.
-         * Call this method when you no longer need the rectangle to be in the map. The node will then be available for future additions.
+         * Free this rectangle from the map.
+         * Call this method when you no longer need the rectangle to be in the map.
          */
         PackedRect.prototype.freeContent = function () {
             if (!this.contentSize) {

+ 4 - 3
src/Tools/babylon.rectPackingMap.ts

@@ -2,6 +2,7 @@
     /**
      * The purpose of this class is to pack several Rectangles into a big map, while trying to fit everything as optimaly as possible.
      * This class is typically used to build lightmaps, sprite map or to pack several little textures into a big one.
+     * Note that this class allows allocated Rectangles to be freed: that is the map is dynamically maintained so you can add/remove rectangle based on their lifecycle.
      */
     export class RectPackingMap extends PackedRect {
         /**
@@ -25,7 +26,7 @@
         }
 
         /**
-         * Return the space free normalized between [0;1]
+         * Return the current space free normalized between [0;1]
          * @returns {} 
          */
         public get freeSpace(): number {
@@ -82,8 +83,8 @@
         }
 
         /**
-         * Free this node's content.
-         * Call this method when you no longer need the rectangle to be in the map. The node will then be available for future additions.
+         * Free this rectangle from the map.
+         * Call this method when you no longer need the rectangle to be in the map.
          */
         public freeContent() {
             if (!this.contentSize) {