Bläddra i källkod

Fixed babylon.rectPackingMap declaration order

David Catuhe 9 år sedan
förälder
incheckning
4c08ea8673

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 936 - 956
dist/preview release/babylon.d.ts


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 1 - 1
dist/preview release/babylon.js


+ 43 - 43
dist/preview release/babylon.max.js

@@ -34858,49 +34858,9 @@ var BABYLON;
 var BABYLON;
 (function (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);
-        /**
-         * Create an instance of the object with a dimension using the given size
-         * @param size The dimension of the rectangle that will contain all the sub ones.
-         */
-        function RectPackingMap(size) {
-            _super.call(this, null, null, BABYLON.Vector2.Zero(), size);
-            this._root = this;
-        }
-        /**
-         * Add a rectangle, finding the best location to store it into the map
-         * @param size the dimension of the rectangle to store
-         * @return the Node containing the rectangle information, or null if we couldn't find a free spot
-         */
-        RectPackingMap.prototype.addRect = function (size) {
-            var node = this.findAndSplitNode(size);
-            return node;
-        };
-        Object.defineProperty(RectPackingMap.prototype, "freeSpace", {
-            /**
-             * Return the current space free normalized between [0;1]
-             * @returns {}
-             */
-            get: function () {
-                var freeSize = 0;
-                freeSize = this.evalFreeSize(freeSize);
-                return freeSize / (this._size.width * this._size.height);
-            },
-            enumerable: true,
-            configurable: true
-        });
-        return RectPackingMap;
-    })(PackedRect);
-    BABYLON.RectPackingMap = RectPackingMap;
-    /**
-     * This class describe a rectangle that were added to the map.
-     * You have access to its coordinates either in pixel or normalized (UV)
-     */
+  * This class describe a rectangle that were added to the map.
+  * You have access to its coordinates either in pixel or normalized (UV)
+  */
     var PackedRect = (function () {
         function PackedRect(root, parent, pos, size) {
             this._pos = pos;
@@ -35057,6 +35017,46 @@ var BABYLON;
         return PackedRect;
     })();
     BABYLON.PackedRect = PackedRect;
+    /**
+     * 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);
+        /**
+         * Create an instance of the object with a dimension using the given size
+         * @param size The dimension of the rectangle that will contain all the sub ones.
+         */
+        function RectPackingMap(size) {
+            _super.call(this, null, null, BABYLON.Vector2.Zero(), size);
+            this._root = this;
+        }
+        /**
+         * Add a rectangle, finding the best location to store it into the map
+         * @param size the dimension of the rectangle to store
+         * @return the Node containing the rectangle information, or null if we couldn't find a free spot
+         */
+        RectPackingMap.prototype.addRect = function (size) {
+            var node = this.findAndSplitNode(size);
+            return node;
+        };
+        Object.defineProperty(RectPackingMap.prototype, "freeSpace", {
+            /**
+             * Return the current space free normalized between [0;1]
+             * @returns {}
+             */
+            get: function () {
+                var freeSize = 0;
+                freeSize = this.evalFreeSize(freeSize);
+                return freeSize / (this._size.width * this._size.height);
+            },
+            enumerable: true,
+            configurable: true
+        });
+        return RectPackingMap;
+    })(PackedRect);
+    BABYLON.RectPackingMap = RectPackingMap;
 })(BABYLON || (BABYLON = {}));
 
 var BABYLON;

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 1 - 1
dist/preview release/babylon.noworker.js


+ 43 - 43
src/Tools/babylon.rectPackingMap.js

@@ -6,49 +6,9 @@ var __extends = (this && this.__extends) || function (d, b) {
 var BABYLON;
 (function (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);
-        /**
-         * Create an instance of the object with a dimension using the given size
-         * @param size The dimension of the rectangle that will contain all the sub ones.
-         */
-        function RectPackingMap(size) {
-            _super.call(this, null, null, BABYLON.Vector2.Zero(), size);
-            this._root = this;
-        }
-        /**
-         * Add a rectangle, finding the best location to store it into the map
-         * @param size the dimension of the rectangle to store
-         * @return the Node containing the rectangle information, or null if we couldn't find a free spot
-         */
-        RectPackingMap.prototype.addRect = function (size) {
-            var node = this.findAndSplitNode(size);
-            return node;
-        };
-        Object.defineProperty(RectPackingMap.prototype, "freeSpace", {
-            /**
-             * Return the current space free normalized between [0;1]
-             * @returns {}
-             */
-            get: function () {
-                var freeSize = 0;
-                freeSize = this.evalFreeSize(freeSize);
-                return freeSize / (this._size.width * this._size.height);
-            },
-            enumerable: true,
-            configurable: true
-        });
-        return RectPackingMap;
-    })(PackedRect);
-    BABYLON.RectPackingMap = RectPackingMap;
-    /**
-     * This class describe a rectangle that were added to the map.
-     * You have access to its coordinates either in pixel or normalized (UV)
-     */
+  * This class describe a rectangle that were added to the map.
+  * You have access to its coordinates either in pixel or normalized (UV)
+  */
     var PackedRect = (function () {
         function PackedRect(root, parent, pos, size) {
             this._pos = pos;
@@ -205,4 +165,44 @@ var BABYLON;
         return PackedRect;
     })();
     BABYLON.PackedRect = PackedRect;
+    /**
+     * 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);
+        /**
+         * Create an instance of the object with a dimension using the given size
+         * @param size The dimension of the rectangle that will contain all the sub ones.
+         */
+        function RectPackingMap(size) {
+            _super.call(this, null, null, BABYLON.Vector2.Zero(), size);
+            this._root = this;
+        }
+        /**
+         * Add a rectangle, finding the best location to store it into the map
+         * @param size the dimension of the rectangle to store
+         * @return the Node containing the rectangle information, or null if we couldn't find a free spot
+         */
+        RectPackingMap.prototype.addRect = function (size) {
+            var node = this.findAndSplitNode(size);
+            return node;
+        };
+        Object.defineProperty(RectPackingMap.prototype, "freeSpace", {
+            /**
+             * Return the current space free normalized between [0;1]
+             * @returns {}
+             */
+            get: function () {
+                var freeSize = 0;
+                freeSize = this.evalFreeSize(freeSize);
+                return freeSize / (this._size.width * this._size.height);
+            },
+            enumerable: true,
+            configurable: true
+        });
+        return RectPackingMap;
+    })(PackedRect);
+    BABYLON.RectPackingMap = RectPackingMap;
 })(BABYLON || (BABYLON = {}));

+ 39 - 40
src/Tools/babylon.rectPackingMap.ts

@@ -1,46 +1,9 @@
 module 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.
-     */
-    export class RectPackingMap extends PackedRect {
-        /**
-         * Create an instance of the object with a dimension using the given size
-         * @param size The dimension of the rectangle that will contain all the sub ones.
-         */
-        constructor(size: Size) {
-            super(null, null, Vector2.Zero(), size);
-
-            this._root = this;
-        }
-
-        /**
-         * Add a rectangle, finding the best location to store it into the map
-         * @param size the dimension of the rectangle to store
-         * @return the Node containing the rectangle information, or null if we couldn't find a free spot
-         */
-        public addRect(size: Size): PackedRect {
-            var node = this.findAndSplitNode(size);
-            return node;
-        }
-
-        /**
-         * Return the current space free normalized between [0;1]
-         * @returns {} 
-         */
-        public get freeSpace(): number {
-            var freeSize = 0;
-            freeSize = this.evalFreeSize(freeSize);
-
-            return freeSize / (this._size.width * this._size.height);
-        }
-    }
 
     /**
-     * This class describe a rectangle that were added to the map.
-     * You have access to its coordinates either in pixel or normalized (UV)
-     */
+  * This class describe a rectangle that were added to the map.
+  * You have access to its coordinates either in pixel or normalized (UV)
+  */
     export class PackedRect {
         constructor(root: PackedRect, parent: PackedRect, pos: Vector2, size: Size) {
             this._pos = pos;
@@ -216,5 +179,41 @@
         protected _size: Size;
     }
 
+    /**
+     * 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 {
+        /**
+         * Create an instance of the object with a dimension using the given size
+         * @param size The dimension of the rectangle that will contain all the sub ones.
+         */
+        constructor(size: Size) {
+            super(null, null, Vector2.Zero(), size);
 
+            this._root = this;
+        }
+
+        /**
+         * Add a rectangle, finding the best location to store it into the map
+         * @param size the dimension of the rectangle to store
+         * @return the Node containing the rectangle information, or null if we couldn't find a free spot
+         */
+        public addRect(size: Size): PackedRect {
+            var node = this.findAndSplitNode(size);
+            return node;
+        }
+
+        /**
+         * Return the current space free normalized between [0;1]
+         * @returns {} 
+         */
+        public get freeSpace(): number {
+            var freeSize = 0;
+            freeSize = this.evalFreeSize(freeSize);
+
+            return freeSize / (this._size.width * this._size.height);
+        }
+    }
 }