|
@@ -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.
|
|
* 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.
|
|
* 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) {
|
|
var RectPackingMap = (function (_super) {
|
|
__extends(RectPackingMap, _super);
|
|
__extends(RectPackingMap, _super);
|
|
@@ -30,7 +31,7 @@ var BABYLON;
|
|
};
|
|
};
|
|
Object.defineProperty(RectPackingMap.prototype, "freeSpace", {
|
|
Object.defineProperty(RectPackingMap.prototype, "freeSpace", {
|
|
/**
|
|
/**
|
|
- * Return the space free normalized between [0;1]
|
|
|
|
|
|
+ * Return the current space free normalized between [0;1]
|
|
* @returns {}
|
|
* @returns {}
|
|
*/
|
|
*/
|
|
get: function () {
|
|
get: function () {
|
|
@@ -96,8 +97,8 @@ var BABYLON;
|
|
configurable: true
|
|
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 () {
|
|
PackedRect.prototype.freeContent = function () {
|
|
if (!this.contentSize) {
|
|
if (!this.contentSize) {
|