This commit is contained in:
Akko
2025-08-04 18:57:35 +02:00
parent 8cf6e78a79
commit 9495868c2e
5030 changed files with 518594 additions and 17609 deletions

View File

@@ -0,0 +1,145 @@
import { Matrix } from '../../../maths/matrix/Matrix';
import { Rectangle } from '../../../maths/shapes/Rectangle';
/**
* Simple bounds implementation instead of more ambiguous [number, number, number, number]
* @memberof rendering
*/
export interface BoundsData {
minX: number;
minY: number;
maxX: number;
maxY: number;
}
/**
* A representation of an AABB bounding box.
* @memberof rendering
*/
export declare class Bounds {
/** @default Infinity */
minX: number;
/** @default Infinity */
minY: number;
/** @default -Infinity */
maxX: number;
/** @default -Infinity */
maxY: number;
matrix: Matrix;
private _rectangle;
constructor(minX?: number, minY?: number, maxX?: number, maxY?: number);
/**
* Checks if bounds are empty.
* @returns - True if empty.
*/
isEmpty(): boolean;
/** The bounding rectangle of the bounds. */
get rectangle(): Rectangle;
/** Clears the bounds and resets. */
clear(): this;
/**
* Sets the bounds.
* @param x0 - left X of frame
* @param y0 - top Y of frame
* @param x1 - right X of frame
* @param y1 - bottom Y of frame
*/
set(x0: number, y0: number, x1: number, y1: number): void;
/**
* Adds sprite frame
* @param x0 - left X of frame
* @param y0 - top Y of frame
* @param x1 - right X of frame
* @param y1 - bottom Y of frame
* @param matrix
*/
addFrame(x0: number, y0: number, x1: number, y1: number, matrix?: Matrix): void;
/**
* Adds a rectangle to the bounds.
* @param rect - The rectangle to be added.
* @param matrix - The matrix to apply to the bounds.
*/
addRect(rect: Rectangle, matrix?: Matrix): void;
/**
* Adds other {@link Bounds}.
* @param bounds - The Bounds to be added
* @param matrix
*/
addBounds(bounds: BoundsData, matrix?: Matrix): void;
/**
* Adds other Bounds, masked with Bounds.
* @param mask - The Bounds to be added.
*/
addBoundsMask(mask: Bounds): void;
/**
* Adds other Bounds, multiplied with matrix.
* @param matrix - The matrix to apply to the bounds.
*/
applyMatrix(matrix: Matrix): void;
/**
* Resizes the bounds object to include the given rectangle.
* @param rect - The rectangle to be included.
*/
fit(rect: Rectangle): this;
/**
* Resizes the bounds object to include the given bounds.
* @param left - The left value of the bounds.
* @param right - The right value of the bounds.
* @param top - The top value of the bounds.
* @param bottom - The bottom value of the bounds.
*/
fitBounds(left: number, right: number, top: number, bottom: number): this;
/**
* Pads bounds object, making it grow in all directions.
* If paddingY is omitted, both paddingX and paddingY will be set to paddingX.
* @param paddingX - The horizontal padding amount.
* @param paddingY - The vertical padding amount.
*/
pad(paddingX: number, paddingY?: number): this;
/** Ceils the bounds. */
ceil(): this;
/** Clones the bounds. */
clone(): Bounds;
/**
* Scales the bounds by the given values
* @param x - The X value to scale by.
* @param y - The Y value to scale by.
*/
scale(x: number, y?: number): this;
/** the x value of the bounds. */
get x(): number;
set x(value: number);
/** the y value of the bounds. */
get y(): number;
set y(value: number);
/** the width value of the bounds. */
get width(): number;
set width(value: number);
/** the height value of the bounds. */
get height(): number;
set height(value: number);
/** the left value of the bounds. */
get left(): number;
/** the right value of the bounds. */
get right(): number;
/** the top value of the bounds. */
get top(): number;
/** the bottom value of the bounds. */
get bottom(): number;
/** Is the bounds positive. */
get isPositive(): boolean;
get isValid(): boolean;
/**
* Adds screen vertices from array
* @param vertexData - calculated vertices
* @param beginOffset - begin offset
* @param endOffset - end offset, excluded
* @param matrix
*/
addVertexData(vertexData: Float32Array, beginOffset: number, endOffset: number, matrix?: Matrix): void;
/**
* Checks if the point is contained within the bounds.
* @param x - x coordinate
* @param y - y coordinate
*/
containsPoint(x: number, y: number): boolean;
toString(): string;
}

View File

@@ -0,0 +1,371 @@
'use strict';
var Matrix = require('../../../maths/matrix/Matrix.js');
var Rectangle = require('../../../maths/shapes/Rectangle.js');
"use strict";
const defaultMatrix = new Matrix.Matrix();
class Bounds {
constructor(minX = Infinity, minY = Infinity, maxX = -Infinity, maxY = -Infinity) {
/** @default Infinity */
this.minX = Infinity;
/** @default Infinity */
this.minY = Infinity;
/** @default -Infinity */
this.maxX = -Infinity;
/** @default -Infinity */
this.maxY = -Infinity;
this.matrix = defaultMatrix;
this.minX = minX;
this.minY = minY;
this.maxX = maxX;
this.maxY = maxY;
}
/**
* Checks if bounds are empty.
* @returns - True if empty.
*/
isEmpty() {
return this.minX > this.maxX || this.minY > this.maxY;
}
/** The bounding rectangle of the bounds. */
get rectangle() {
if (!this._rectangle) {
this._rectangle = new Rectangle.Rectangle();
}
const rectangle = this._rectangle;
if (this.minX > this.maxX || this.minY > this.maxY) {
rectangle.x = 0;
rectangle.y = 0;
rectangle.width = 0;
rectangle.height = 0;
} else {
rectangle.copyFromBounds(this);
}
return rectangle;
}
/** Clears the bounds and resets. */
clear() {
this.minX = Infinity;
this.minY = Infinity;
this.maxX = -Infinity;
this.maxY = -Infinity;
this.matrix = defaultMatrix;
return this;
}
/**
* Sets the bounds.
* @param x0 - left X of frame
* @param y0 - top Y of frame
* @param x1 - right X of frame
* @param y1 - bottom Y of frame
*/
set(x0, y0, x1, y1) {
this.minX = x0;
this.minY = y0;
this.maxX = x1;
this.maxY = y1;
}
/**
* Adds sprite frame
* @param x0 - left X of frame
* @param y0 - top Y of frame
* @param x1 - right X of frame
* @param y1 - bottom Y of frame
* @param matrix
*/
addFrame(x0, y0, x1, y1, matrix) {
matrix || (matrix = this.matrix);
const a = matrix.a;
const b = matrix.b;
const c = matrix.c;
const d = matrix.d;
const tx = matrix.tx;
const ty = matrix.ty;
let minX = this.minX;
let minY = this.minY;
let maxX = this.maxX;
let maxY = this.maxY;
let x = a * x0 + c * y0 + tx;
let y = b * x0 + d * y0 + ty;
if (x < minX)
minX = x;
if (y < minY)
minY = y;
if (x > maxX)
maxX = x;
if (y > maxY)
maxY = y;
x = a * x1 + c * y0 + tx;
y = b * x1 + d * y0 + ty;
if (x < minX)
minX = x;
if (y < minY)
minY = y;
if (x > maxX)
maxX = x;
if (y > maxY)
maxY = y;
x = a * x0 + c * y1 + tx;
y = b * x0 + d * y1 + ty;
if (x < minX)
minX = x;
if (y < minY)
minY = y;
if (x > maxX)
maxX = x;
if (y > maxY)
maxY = y;
x = a * x1 + c * y1 + tx;
y = b * x1 + d * y1 + ty;
if (x < minX)
minX = x;
if (y < minY)
minY = y;
if (x > maxX)
maxX = x;
if (y > maxY)
maxY = y;
this.minX = minX;
this.minY = minY;
this.maxX = maxX;
this.maxY = maxY;
}
/**
* Adds a rectangle to the bounds.
* @param rect - The rectangle to be added.
* @param matrix - The matrix to apply to the bounds.
*/
addRect(rect, matrix) {
this.addFrame(rect.x, rect.y, rect.x + rect.width, rect.y + rect.height, matrix);
}
/**
* Adds other {@link Bounds}.
* @param bounds - The Bounds to be added
* @param matrix
*/
addBounds(bounds, matrix) {
this.addFrame(bounds.minX, bounds.minY, bounds.maxX, bounds.maxY, matrix);
}
/**
* Adds other Bounds, masked with Bounds.
* @param mask - The Bounds to be added.
*/
addBoundsMask(mask) {
this.minX = this.minX > mask.minX ? this.minX : mask.minX;
this.minY = this.minY > mask.minY ? this.minY : mask.minY;
this.maxX = this.maxX < mask.maxX ? this.maxX : mask.maxX;
this.maxY = this.maxY < mask.maxY ? this.maxY : mask.maxY;
}
/**
* Adds other Bounds, multiplied with matrix.
* @param matrix - The matrix to apply to the bounds.
*/
applyMatrix(matrix) {
const minX = this.minX;
const minY = this.minY;
const maxX = this.maxX;
const maxY = this.maxY;
const { a, b, c, d, tx, ty } = matrix;
let x = a * minX + c * minY + tx;
let y = b * minX + d * minY + ty;
this.minX = x;
this.minY = y;
this.maxX = x;
this.maxY = y;
x = a * maxX + c * minY + tx;
y = b * maxX + d * minY + ty;
this.minX = x < this.minX ? x : this.minX;
this.minY = y < this.minY ? y : this.minY;
this.maxX = x > this.maxX ? x : this.maxX;
this.maxY = y > this.maxY ? y : this.maxY;
x = a * minX + c * maxY + tx;
y = b * minX + d * maxY + ty;
this.minX = x < this.minX ? x : this.minX;
this.minY = y < this.minY ? y : this.minY;
this.maxX = x > this.maxX ? x : this.maxX;
this.maxY = y > this.maxY ? y : this.maxY;
x = a * maxX + c * maxY + tx;
y = b * maxX + d * maxY + ty;
this.minX = x < this.minX ? x : this.minX;
this.minY = y < this.minY ? y : this.minY;
this.maxX = x > this.maxX ? x : this.maxX;
this.maxY = y > this.maxY ? y : this.maxY;
}
/**
* Resizes the bounds object to include the given rectangle.
* @param rect - The rectangle to be included.
*/
fit(rect) {
if (this.minX < rect.left)
this.minX = rect.left;
if (this.maxX > rect.right)
this.maxX = rect.right;
if (this.minY < rect.top)
this.minY = rect.top;
if (this.maxY > rect.bottom)
this.maxY = rect.bottom;
return this;
}
/**
* Resizes the bounds object to include the given bounds.
* @param left - The left value of the bounds.
* @param right - The right value of the bounds.
* @param top - The top value of the bounds.
* @param bottom - The bottom value of the bounds.
*/
fitBounds(left, right, top, bottom) {
if (this.minX < left)
this.minX = left;
if (this.maxX > right)
this.maxX = right;
if (this.minY < top)
this.minY = top;
if (this.maxY > bottom)
this.maxY = bottom;
return this;
}
/**
* Pads bounds object, making it grow in all directions.
* If paddingY is omitted, both paddingX and paddingY will be set to paddingX.
* @param paddingX - The horizontal padding amount.
* @param paddingY - The vertical padding amount.
*/
pad(paddingX, paddingY = paddingX) {
this.minX -= paddingX;
this.maxX += paddingX;
this.minY -= paddingY;
this.maxY += paddingY;
return this;
}
/** Ceils the bounds. */
ceil() {
this.minX = Math.floor(this.minX);
this.minY = Math.floor(this.minY);
this.maxX = Math.ceil(this.maxX);
this.maxY = Math.ceil(this.maxY);
return this;
}
/** Clones the bounds. */
clone() {
return new Bounds(this.minX, this.minY, this.maxX, this.maxY);
}
/**
* Scales the bounds by the given values
* @param x - The X value to scale by.
* @param y - The Y value to scale by.
*/
scale(x, y = x) {
this.minX *= x;
this.minY *= y;
this.maxX *= x;
this.maxY *= y;
return this;
}
/** the x value of the bounds. */
get x() {
return this.minX;
}
set x(value) {
const width = this.maxX - this.minX;
this.minX = value;
this.maxX = value + width;
}
/** the y value of the bounds. */
get y() {
return this.minY;
}
set y(value) {
const height = this.maxY - this.minY;
this.minY = value;
this.maxY = value + height;
}
/** the width value of the bounds. */
get width() {
return this.maxX - this.minX;
}
set width(value) {
this.maxX = this.minX + value;
}
/** the height value of the bounds. */
get height() {
return this.maxY - this.minY;
}
set height(value) {
this.maxY = this.minY + value;
}
/** the left value of the bounds. */
get left() {
return this.minX;
}
/** the right value of the bounds. */
get right() {
return this.maxX;
}
/** the top value of the bounds. */
get top() {
return this.minY;
}
/** the bottom value of the bounds. */
get bottom() {
return this.maxY;
}
/** Is the bounds positive. */
get isPositive() {
return this.maxX - this.minX > 0 && this.maxY - this.minY > 0;
}
get isValid() {
return this.minX + this.minY !== Infinity;
}
/**
* Adds screen vertices from array
* @param vertexData - calculated vertices
* @param beginOffset - begin offset
* @param endOffset - end offset, excluded
* @param matrix
*/
addVertexData(vertexData, beginOffset, endOffset, matrix) {
let minX = this.minX;
let minY = this.minY;
let maxX = this.maxX;
let maxY = this.maxY;
matrix || (matrix = this.matrix);
const a = matrix.a;
const b = matrix.b;
const c = matrix.c;
const d = matrix.d;
const tx = matrix.tx;
const ty = matrix.ty;
for (let i = beginOffset; i < endOffset; i += 2) {
const localX = vertexData[i];
const localY = vertexData[i + 1];
const x = a * localX + c * localY + tx;
const y = b * localX + d * localY + ty;
minX = x < minX ? x : minX;
minY = y < minY ? y : minY;
maxX = x > maxX ? x : maxX;
maxY = y > maxY ? y : maxY;
}
this.minX = minX;
this.minY = minY;
this.maxX = maxX;
this.maxY = maxY;
}
/**
* Checks if the point is contained within the bounds.
* @param x - x coordinate
* @param y - y coordinate
*/
containsPoint(x, y) {
if (this.minX <= x && this.minY <= y && this.maxX >= x && this.maxY >= y) {
return true;
}
return false;
}
toString() {
return `[pixi.js:Bounds minX=${this.minX} minY=${this.minY} maxX=${this.maxX} maxY=${this.maxY} width=${this.width} height=${this.height}]`;
}
}
exports.Bounds = Bounds;
//# sourceMappingURL=Bounds.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,369 @@
import { Matrix } from '../../../maths/matrix/Matrix.mjs';
import { Rectangle } from '../../../maths/shapes/Rectangle.mjs';
"use strict";
const defaultMatrix = new Matrix();
class Bounds {
constructor(minX = Infinity, minY = Infinity, maxX = -Infinity, maxY = -Infinity) {
/** @default Infinity */
this.minX = Infinity;
/** @default Infinity */
this.minY = Infinity;
/** @default -Infinity */
this.maxX = -Infinity;
/** @default -Infinity */
this.maxY = -Infinity;
this.matrix = defaultMatrix;
this.minX = minX;
this.minY = minY;
this.maxX = maxX;
this.maxY = maxY;
}
/**
* Checks if bounds are empty.
* @returns - True if empty.
*/
isEmpty() {
return this.minX > this.maxX || this.minY > this.maxY;
}
/** The bounding rectangle of the bounds. */
get rectangle() {
if (!this._rectangle) {
this._rectangle = new Rectangle();
}
const rectangle = this._rectangle;
if (this.minX > this.maxX || this.minY > this.maxY) {
rectangle.x = 0;
rectangle.y = 0;
rectangle.width = 0;
rectangle.height = 0;
} else {
rectangle.copyFromBounds(this);
}
return rectangle;
}
/** Clears the bounds and resets. */
clear() {
this.minX = Infinity;
this.minY = Infinity;
this.maxX = -Infinity;
this.maxY = -Infinity;
this.matrix = defaultMatrix;
return this;
}
/**
* Sets the bounds.
* @param x0 - left X of frame
* @param y0 - top Y of frame
* @param x1 - right X of frame
* @param y1 - bottom Y of frame
*/
set(x0, y0, x1, y1) {
this.minX = x0;
this.minY = y0;
this.maxX = x1;
this.maxY = y1;
}
/**
* Adds sprite frame
* @param x0 - left X of frame
* @param y0 - top Y of frame
* @param x1 - right X of frame
* @param y1 - bottom Y of frame
* @param matrix
*/
addFrame(x0, y0, x1, y1, matrix) {
matrix || (matrix = this.matrix);
const a = matrix.a;
const b = matrix.b;
const c = matrix.c;
const d = matrix.d;
const tx = matrix.tx;
const ty = matrix.ty;
let minX = this.minX;
let minY = this.minY;
let maxX = this.maxX;
let maxY = this.maxY;
let x = a * x0 + c * y0 + tx;
let y = b * x0 + d * y0 + ty;
if (x < minX)
minX = x;
if (y < minY)
minY = y;
if (x > maxX)
maxX = x;
if (y > maxY)
maxY = y;
x = a * x1 + c * y0 + tx;
y = b * x1 + d * y0 + ty;
if (x < minX)
minX = x;
if (y < minY)
minY = y;
if (x > maxX)
maxX = x;
if (y > maxY)
maxY = y;
x = a * x0 + c * y1 + tx;
y = b * x0 + d * y1 + ty;
if (x < minX)
minX = x;
if (y < minY)
minY = y;
if (x > maxX)
maxX = x;
if (y > maxY)
maxY = y;
x = a * x1 + c * y1 + tx;
y = b * x1 + d * y1 + ty;
if (x < minX)
minX = x;
if (y < minY)
minY = y;
if (x > maxX)
maxX = x;
if (y > maxY)
maxY = y;
this.minX = minX;
this.minY = minY;
this.maxX = maxX;
this.maxY = maxY;
}
/**
* Adds a rectangle to the bounds.
* @param rect - The rectangle to be added.
* @param matrix - The matrix to apply to the bounds.
*/
addRect(rect, matrix) {
this.addFrame(rect.x, rect.y, rect.x + rect.width, rect.y + rect.height, matrix);
}
/**
* Adds other {@link Bounds}.
* @param bounds - The Bounds to be added
* @param matrix
*/
addBounds(bounds, matrix) {
this.addFrame(bounds.minX, bounds.minY, bounds.maxX, bounds.maxY, matrix);
}
/**
* Adds other Bounds, masked with Bounds.
* @param mask - The Bounds to be added.
*/
addBoundsMask(mask) {
this.minX = this.minX > mask.minX ? this.minX : mask.minX;
this.minY = this.minY > mask.minY ? this.minY : mask.minY;
this.maxX = this.maxX < mask.maxX ? this.maxX : mask.maxX;
this.maxY = this.maxY < mask.maxY ? this.maxY : mask.maxY;
}
/**
* Adds other Bounds, multiplied with matrix.
* @param matrix - The matrix to apply to the bounds.
*/
applyMatrix(matrix) {
const minX = this.minX;
const minY = this.minY;
const maxX = this.maxX;
const maxY = this.maxY;
const { a, b, c, d, tx, ty } = matrix;
let x = a * minX + c * minY + tx;
let y = b * minX + d * minY + ty;
this.minX = x;
this.minY = y;
this.maxX = x;
this.maxY = y;
x = a * maxX + c * minY + tx;
y = b * maxX + d * minY + ty;
this.minX = x < this.minX ? x : this.minX;
this.minY = y < this.minY ? y : this.minY;
this.maxX = x > this.maxX ? x : this.maxX;
this.maxY = y > this.maxY ? y : this.maxY;
x = a * minX + c * maxY + tx;
y = b * minX + d * maxY + ty;
this.minX = x < this.minX ? x : this.minX;
this.minY = y < this.minY ? y : this.minY;
this.maxX = x > this.maxX ? x : this.maxX;
this.maxY = y > this.maxY ? y : this.maxY;
x = a * maxX + c * maxY + tx;
y = b * maxX + d * maxY + ty;
this.minX = x < this.minX ? x : this.minX;
this.minY = y < this.minY ? y : this.minY;
this.maxX = x > this.maxX ? x : this.maxX;
this.maxY = y > this.maxY ? y : this.maxY;
}
/**
* Resizes the bounds object to include the given rectangle.
* @param rect - The rectangle to be included.
*/
fit(rect) {
if (this.minX < rect.left)
this.minX = rect.left;
if (this.maxX > rect.right)
this.maxX = rect.right;
if (this.minY < rect.top)
this.minY = rect.top;
if (this.maxY > rect.bottom)
this.maxY = rect.bottom;
return this;
}
/**
* Resizes the bounds object to include the given bounds.
* @param left - The left value of the bounds.
* @param right - The right value of the bounds.
* @param top - The top value of the bounds.
* @param bottom - The bottom value of the bounds.
*/
fitBounds(left, right, top, bottom) {
if (this.minX < left)
this.minX = left;
if (this.maxX > right)
this.maxX = right;
if (this.minY < top)
this.minY = top;
if (this.maxY > bottom)
this.maxY = bottom;
return this;
}
/**
* Pads bounds object, making it grow in all directions.
* If paddingY is omitted, both paddingX and paddingY will be set to paddingX.
* @param paddingX - The horizontal padding amount.
* @param paddingY - The vertical padding amount.
*/
pad(paddingX, paddingY = paddingX) {
this.minX -= paddingX;
this.maxX += paddingX;
this.minY -= paddingY;
this.maxY += paddingY;
return this;
}
/** Ceils the bounds. */
ceil() {
this.minX = Math.floor(this.minX);
this.minY = Math.floor(this.minY);
this.maxX = Math.ceil(this.maxX);
this.maxY = Math.ceil(this.maxY);
return this;
}
/** Clones the bounds. */
clone() {
return new Bounds(this.minX, this.minY, this.maxX, this.maxY);
}
/**
* Scales the bounds by the given values
* @param x - The X value to scale by.
* @param y - The Y value to scale by.
*/
scale(x, y = x) {
this.minX *= x;
this.minY *= y;
this.maxX *= x;
this.maxY *= y;
return this;
}
/** the x value of the bounds. */
get x() {
return this.minX;
}
set x(value) {
const width = this.maxX - this.minX;
this.minX = value;
this.maxX = value + width;
}
/** the y value of the bounds. */
get y() {
return this.minY;
}
set y(value) {
const height = this.maxY - this.minY;
this.minY = value;
this.maxY = value + height;
}
/** the width value of the bounds. */
get width() {
return this.maxX - this.minX;
}
set width(value) {
this.maxX = this.minX + value;
}
/** the height value of the bounds. */
get height() {
return this.maxY - this.minY;
}
set height(value) {
this.maxY = this.minY + value;
}
/** the left value of the bounds. */
get left() {
return this.minX;
}
/** the right value of the bounds. */
get right() {
return this.maxX;
}
/** the top value of the bounds. */
get top() {
return this.minY;
}
/** the bottom value of the bounds. */
get bottom() {
return this.maxY;
}
/** Is the bounds positive. */
get isPositive() {
return this.maxX - this.minX > 0 && this.maxY - this.minY > 0;
}
get isValid() {
return this.minX + this.minY !== Infinity;
}
/**
* Adds screen vertices from array
* @param vertexData - calculated vertices
* @param beginOffset - begin offset
* @param endOffset - end offset, excluded
* @param matrix
*/
addVertexData(vertexData, beginOffset, endOffset, matrix) {
let minX = this.minX;
let minY = this.minY;
let maxX = this.maxX;
let maxY = this.maxY;
matrix || (matrix = this.matrix);
const a = matrix.a;
const b = matrix.b;
const c = matrix.c;
const d = matrix.d;
const tx = matrix.tx;
const ty = matrix.ty;
for (let i = beginOffset; i < endOffset; i += 2) {
const localX = vertexData[i];
const localY = vertexData[i + 1];
const x = a * localX + c * localY + tx;
const y = b * localX + d * localY + ty;
minX = x < minX ? x : minX;
minY = y < minY ? y : minY;
maxX = x > maxX ? x : maxX;
maxY = y > maxY ? y : maxY;
}
this.minX = minX;
this.minY = minY;
this.maxX = maxX;
this.maxY = maxY;
}
/**
* Checks if the point is contained within the bounds.
* @param x - x coordinate
* @param y - y coordinate
*/
containsPoint(x, y) {
if (this.minX <= x && this.minY <= y && this.maxX >= x && this.maxY >= y) {
return true;
}
return false;
}
toString() {
return `[pixi.js:Bounds minX=${this.minX} minY=${this.minY} maxX=${this.maxX} maxY=${this.maxY} width=${this.width} height=${this.height}]`;
}
}
export { Bounds };
//# sourceMappingURL=Bounds.mjs.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,13 @@
import type { Container } from '../Container';
import type { Bounds } from './Bounds';
/**
* Does exactly the same as getGlobalBounds, but does instead makes use of transforming AABBs
* of the various children within the scene graph. This is much faster, but less accurate.
*
* the result will never be smaller - only ever slightly larger (in most cases, it will be the same).
* @param target - The target container to get the bounds from
* @param bounds - The output bounds object.
* @returns The bounds.
*/
export declare function getFastGlobalBounds(target: Container, bounds: Bounds): Bounds;
export declare function _getGlobalBoundsRecursive(target: Container, bounds: Bounds): void;

View File

@@ -0,0 +1,73 @@
'use strict';
var Matrix = require('../../../maths/matrix/Matrix.js');
var matrixAndBoundsPool = require('./utils/matrixAndBoundsPool.js');
"use strict";
const tempMatrix = new Matrix.Matrix();
function getFastGlobalBounds(target, bounds) {
bounds.clear();
_getGlobalBoundsRecursive(target, bounds);
if (!bounds.isValid) {
bounds.set(0, 0, 0, 0);
}
if (!target.renderGroup) {
bounds.applyMatrix(target.parentRenderGroup.worldTransform);
} else {
bounds.applyMatrix(target.renderGroup.localTransform);
}
return bounds;
}
function _getGlobalBoundsRecursive(target, bounds) {
if (target.localDisplayStatus !== 7 || !target.measurable) {
return;
}
const manageEffects = !!target.effects.length;
let localBounds = bounds;
if (target.renderGroup || manageEffects) {
localBounds = matrixAndBoundsPool.boundsPool.get().clear();
}
if (target.boundsArea) {
bounds.addRect(target.boundsArea, target.worldTransform);
} else {
if (target.renderPipeId) {
const viewBounds = target.bounds;
localBounds.addFrame(
viewBounds.minX,
viewBounds.minY,
viewBounds.maxX,
viewBounds.maxY,
target.groupTransform
);
}
const children = target.children;
for (let i = 0; i < children.length; i++) {
_getGlobalBoundsRecursive(children[i], localBounds);
}
}
if (manageEffects) {
let advanced = false;
for (let i = 0; i < target.effects.length; i++) {
if (target.effects[i].addBounds) {
if (!advanced) {
advanced = true;
localBounds.applyMatrix(target.parentRenderGroup.worldTransform);
}
target.effects[i].addBounds(localBounds, true);
}
}
if (advanced) {
localBounds.applyMatrix(target.parentRenderGroup.worldTransform.copyTo(tempMatrix).invert());
bounds.addBounds(localBounds, target.relativeGroupTransform);
}
bounds.addBounds(localBounds);
matrixAndBoundsPool.boundsPool.return(localBounds);
} else if (target.renderGroup) {
bounds.addBounds(localBounds, target.relativeGroupTransform);
matrixAndBoundsPool.boundsPool.return(localBounds);
}
}
exports._getGlobalBoundsRecursive = _getGlobalBoundsRecursive;
exports.getFastGlobalBounds = getFastGlobalBounds;
//# sourceMappingURL=getFastGlobalBounds.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,70 @@
import { Matrix } from '../../../maths/matrix/Matrix.mjs';
import { boundsPool } from './utils/matrixAndBoundsPool.mjs';
"use strict";
const tempMatrix = new Matrix();
function getFastGlobalBounds(target, bounds) {
bounds.clear();
_getGlobalBoundsRecursive(target, bounds);
if (!bounds.isValid) {
bounds.set(0, 0, 0, 0);
}
if (!target.renderGroup) {
bounds.applyMatrix(target.parentRenderGroup.worldTransform);
} else {
bounds.applyMatrix(target.renderGroup.localTransform);
}
return bounds;
}
function _getGlobalBoundsRecursive(target, bounds) {
if (target.localDisplayStatus !== 7 || !target.measurable) {
return;
}
const manageEffects = !!target.effects.length;
let localBounds = bounds;
if (target.renderGroup || manageEffects) {
localBounds = boundsPool.get().clear();
}
if (target.boundsArea) {
bounds.addRect(target.boundsArea, target.worldTransform);
} else {
if (target.renderPipeId) {
const viewBounds = target.bounds;
localBounds.addFrame(
viewBounds.minX,
viewBounds.minY,
viewBounds.maxX,
viewBounds.maxY,
target.groupTransform
);
}
const children = target.children;
for (let i = 0; i < children.length; i++) {
_getGlobalBoundsRecursive(children[i], localBounds);
}
}
if (manageEffects) {
let advanced = false;
for (let i = 0; i < target.effects.length; i++) {
if (target.effects[i].addBounds) {
if (!advanced) {
advanced = true;
localBounds.applyMatrix(target.parentRenderGroup.worldTransform);
}
target.effects[i].addBounds(localBounds, true);
}
}
if (advanced) {
localBounds.applyMatrix(target.parentRenderGroup.worldTransform.copyTo(tempMatrix).invert());
bounds.addBounds(localBounds, target.relativeGroupTransform);
}
bounds.addBounds(localBounds);
boundsPool.return(localBounds);
} else if (target.renderGroup) {
bounds.addBounds(localBounds, target.relativeGroupTransform);
boundsPool.return(localBounds);
}
}
export { _getGlobalBoundsRecursive, getFastGlobalBounds };
//# sourceMappingURL=getFastGlobalBounds.mjs.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,6 @@
import { Matrix } from '../../../maths/matrix/Matrix';
import type { Container } from '../Container';
import type { Bounds } from './Bounds';
export declare function getGlobalBounds(target: Container, skipUpdateTransform: boolean, bounds: Bounds): Bounds;
export declare function _getGlobalBounds(target: Container, bounds: Bounds, parentTransform: Matrix, skipUpdateTransform: boolean): void;
export declare function updateTransformBackwards(target: Container, parentTransform: Matrix): Matrix;

View File

@@ -0,0 +1,81 @@
'use strict';
var Matrix = require('../../../maths/matrix/Matrix.js');
var matrixAndBoundsPool = require('./utils/matrixAndBoundsPool.js');
"use strict";
function getGlobalBounds(target, skipUpdateTransform, bounds) {
bounds.clear();
let parentTransform;
let pooledMatrix;
if (target.parent) {
if (!skipUpdateTransform) {
pooledMatrix = matrixAndBoundsPool.matrixPool.get().identity();
parentTransform = updateTransformBackwards(target, pooledMatrix);
} else {
parentTransform = target.parent.worldTransform;
}
} else {
parentTransform = Matrix.Matrix.IDENTITY;
}
_getGlobalBounds(target, bounds, parentTransform, skipUpdateTransform);
if (pooledMatrix) {
matrixAndBoundsPool.matrixPool.return(pooledMatrix);
}
if (!bounds.isValid) {
bounds.set(0, 0, 0, 0);
}
return bounds;
}
function _getGlobalBounds(target, bounds, parentTransform, skipUpdateTransform) {
if (!target.visible || !target.measurable)
return;
let worldTransform;
if (!skipUpdateTransform) {
target.updateLocalTransform();
worldTransform = matrixAndBoundsPool.matrixPool.get();
worldTransform.appendFrom(target.localTransform, parentTransform);
} else {
worldTransform = target.worldTransform;
}
const parentBounds = bounds;
const preserveBounds = !!target.effects.length;
if (preserveBounds) {
bounds = matrixAndBoundsPool.boundsPool.get().clear();
}
if (target.boundsArea) {
bounds.addRect(target.boundsArea, worldTransform);
} else {
if (target.addBounds) {
bounds.matrix = worldTransform;
target.addBounds(bounds);
}
for (let i = 0; i < target.children.length; i++) {
_getGlobalBounds(target.children[i], bounds, worldTransform, skipUpdateTransform);
}
}
if (preserveBounds) {
for (let i = 0; i < target.effects.length; i++) {
target.effects[i].addBounds?.(bounds);
}
parentBounds.addBounds(bounds, Matrix.Matrix.IDENTITY);
matrixAndBoundsPool.boundsPool.return(bounds);
}
if (!skipUpdateTransform) {
matrixAndBoundsPool.matrixPool.return(worldTransform);
}
}
function updateTransformBackwards(target, parentTransform) {
const parent = target.parent;
if (parent) {
updateTransformBackwards(parent, parentTransform);
parent.updateLocalTransform();
parentTransform.append(parent.localTransform);
}
return parentTransform;
}
exports._getGlobalBounds = _getGlobalBounds;
exports.getGlobalBounds = getGlobalBounds;
exports.updateTransformBackwards = updateTransformBackwards;
//# sourceMappingURL=getGlobalBounds.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,77 @@
import { Matrix } from '../../../maths/matrix/Matrix.mjs';
import { matrixPool, boundsPool } from './utils/matrixAndBoundsPool.mjs';
"use strict";
function getGlobalBounds(target, skipUpdateTransform, bounds) {
bounds.clear();
let parentTransform;
let pooledMatrix;
if (target.parent) {
if (!skipUpdateTransform) {
pooledMatrix = matrixPool.get().identity();
parentTransform = updateTransformBackwards(target, pooledMatrix);
} else {
parentTransform = target.parent.worldTransform;
}
} else {
parentTransform = Matrix.IDENTITY;
}
_getGlobalBounds(target, bounds, parentTransform, skipUpdateTransform);
if (pooledMatrix) {
matrixPool.return(pooledMatrix);
}
if (!bounds.isValid) {
bounds.set(0, 0, 0, 0);
}
return bounds;
}
function _getGlobalBounds(target, bounds, parentTransform, skipUpdateTransform) {
if (!target.visible || !target.measurable)
return;
let worldTransform;
if (!skipUpdateTransform) {
target.updateLocalTransform();
worldTransform = matrixPool.get();
worldTransform.appendFrom(target.localTransform, parentTransform);
} else {
worldTransform = target.worldTransform;
}
const parentBounds = bounds;
const preserveBounds = !!target.effects.length;
if (preserveBounds) {
bounds = boundsPool.get().clear();
}
if (target.boundsArea) {
bounds.addRect(target.boundsArea, worldTransform);
} else {
if (target.addBounds) {
bounds.matrix = worldTransform;
target.addBounds(bounds);
}
for (let i = 0; i < target.children.length; i++) {
_getGlobalBounds(target.children[i], bounds, worldTransform, skipUpdateTransform);
}
}
if (preserveBounds) {
for (let i = 0; i < target.effects.length; i++) {
target.effects[i].addBounds?.(bounds);
}
parentBounds.addBounds(bounds, Matrix.IDENTITY);
boundsPool.return(bounds);
}
if (!skipUpdateTransform) {
matrixPool.return(worldTransform);
}
}
function updateTransformBackwards(target, parentTransform) {
const parent = target.parent;
if (parent) {
updateTransformBackwards(parent, parentTransform);
parent.updateLocalTransform();
parentTransform.append(parent.localTransform);
}
return parentTransform;
}
export { _getGlobalBounds, getGlobalBounds, updateTransformBackwards };
//# sourceMappingURL=getGlobalBounds.mjs.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,5 @@
import { Matrix } from '../../../maths/matrix/Matrix';
import type { Container } from '../Container';
import type { Bounds } from './Bounds';
export declare function getLocalBounds(target: Container, bounds: Bounds, relativeMatrix?: Matrix): Bounds;
export declare function getParent(target: Container, root: Container, matrix: Matrix): void;

View File

@@ -0,0 +1,71 @@
'use strict';
var Matrix = require('../../../maths/matrix/Matrix.js');
var warn = require('../../../utils/logging/warn.js');
var matrixAndBoundsPool = require('./utils/matrixAndBoundsPool.js');
"use strict";
function getLocalBounds(target, bounds, relativeMatrix) {
bounds.clear();
relativeMatrix || (relativeMatrix = Matrix.Matrix.IDENTITY);
_getLocalBounds(target, bounds, relativeMatrix, target, true);
if (!bounds.isValid) {
bounds.set(0, 0, 0, 0);
}
return bounds;
}
function _getLocalBounds(target, bounds, parentTransform, rootContainer, isRoot) {
let relativeTransform;
if (!isRoot) {
if (!target.visible || !target.measurable)
return;
target.updateLocalTransform();
const localTransform = target.localTransform;
relativeTransform = matrixAndBoundsPool.matrixPool.get();
relativeTransform.appendFrom(localTransform, parentTransform);
} else {
relativeTransform = matrixAndBoundsPool.matrixPool.get();
relativeTransform = parentTransform.copyTo(relativeTransform);
}
const parentBounds = bounds;
const preserveBounds = !!target.effects.length;
if (preserveBounds) {
bounds = matrixAndBoundsPool.boundsPool.get().clear();
}
if (target.boundsArea) {
bounds.addRect(target.boundsArea, relativeTransform);
} else {
if (target.renderPipeId) {
bounds.matrix = relativeTransform;
target.addBounds(bounds);
}
const children = target.children;
for (let i = 0; i < children.length; i++) {
_getLocalBounds(children[i], bounds, relativeTransform, rootContainer, false);
}
}
if (preserveBounds) {
for (let i = 0; i < target.effects.length; i++) {
target.effects[i].addLocalBounds?.(bounds, rootContainer);
}
parentBounds.addBounds(bounds, Matrix.Matrix.IDENTITY);
matrixAndBoundsPool.boundsPool.return(bounds);
}
matrixAndBoundsPool.matrixPool.return(relativeTransform);
}
function getParent(target, root, matrix) {
const parent = target.parent;
if (!parent) {
warn.warn("Item is not inside the root container");
return;
}
if (parent !== root) {
getParent(parent, root, matrix);
parent.updateLocalTransform();
matrix.append(parent.localTransform);
}
}
exports.getLocalBounds = getLocalBounds;
exports.getParent = getParent;
//# sourceMappingURL=getLocalBounds.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,68 @@
import { Matrix } from '../../../maths/matrix/Matrix.mjs';
import { warn } from '../../../utils/logging/warn.mjs';
import { matrixPool, boundsPool } from './utils/matrixAndBoundsPool.mjs';
"use strict";
function getLocalBounds(target, bounds, relativeMatrix) {
bounds.clear();
relativeMatrix || (relativeMatrix = Matrix.IDENTITY);
_getLocalBounds(target, bounds, relativeMatrix, target, true);
if (!bounds.isValid) {
bounds.set(0, 0, 0, 0);
}
return bounds;
}
function _getLocalBounds(target, bounds, parentTransform, rootContainer, isRoot) {
let relativeTransform;
if (!isRoot) {
if (!target.visible || !target.measurable)
return;
target.updateLocalTransform();
const localTransform = target.localTransform;
relativeTransform = matrixPool.get();
relativeTransform.appendFrom(localTransform, parentTransform);
} else {
relativeTransform = matrixPool.get();
relativeTransform = parentTransform.copyTo(relativeTransform);
}
const parentBounds = bounds;
const preserveBounds = !!target.effects.length;
if (preserveBounds) {
bounds = boundsPool.get().clear();
}
if (target.boundsArea) {
bounds.addRect(target.boundsArea, relativeTransform);
} else {
if (target.renderPipeId) {
bounds.matrix = relativeTransform;
target.addBounds(bounds);
}
const children = target.children;
for (let i = 0; i < children.length; i++) {
_getLocalBounds(children[i], bounds, relativeTransform, rootContainer, false);
}
}
if (preserveBounds) {
for (let i = 0; i < target.effects.length; i++) {
target.effects[i].addLocalBounds?.(bounds, rootContainer);
}
parentBounds.addBounds(bounds, Matrix.IDENTITY);
boundsPool.return(bounds);
}
matrixPool.return(relativeTransform);
}
function getParent(target, root, matrix) {
const parent = target.parent;
if (!parent) {
warn("Item is not inside the root container");
return;
}
if (parent !== root) {
getParent(parent, root, matrix);
parent.updateLocalTransform();
matrix.append(parent.localTransform);
}
}
export { getLocalBounds, getParent };
//# sourceMappingURL=getLocalBounds.mjs.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,3 @@
import type { Renderable } from '../../../rendering/renderers/shared/Renderable';
import type { Bounds } from './Bounds';
export declare function getGlobalRenderableBounds(renderables: Renderable[], bounds: Bounds): Bounds;

View File

@@ -0,0 +1,20 @@
'use strict';
"use strict";
function getGlobalRenderableBounds(renderables, bounds) {
bounds.clear();
const tempMatrix = bounds.matrix;
for (let i = 0; i < renderables.length; i++) {
const renderable = renderables[i];
if (renderable.globalDisplayStatus < 7) {
continue;
}
bounds.matrix = renderable.worldTransform;
renderable.addBounds(bounds);
}
bounds.matrix = tempMatrix;
return bounds;
}
exports.getGlobalRenderableBounds = getGlobalRenderableBounds;
//# sourceMappingURL=getRenderableBounds.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"getRenderableBounds.js","sources":["../../../../src/scene/container/bounds/getRenderableBounds.ts"],"sourcesContent":["import type { Renderable } from '../../../rendering/renderers/shared/Renderable';\nimport type { Bounds } from './Bounds';\n\nexport function getGlobalRenderableBounds(renderables: Renderable[], bounds: Bounds): Bounds\n{\n bounds.clear();\n\n // instead of copying the matrix each time we are assigning it in bounds\n // this is a performance hack :D\n // so we need to restore the matrix after we are done\n\n const tempMatrix = bounds.matrix;\n\n for (let i = 0; i < renderables.length; i++)\n {\n const renderable = renderables[i];\n\n if (renderable.globalDisplayStatus < 0b111)\n {\n continue;\n }\n\n bounds.matrix = renderable.worldTransform;\n renderable.addBounds(bounds);\n }\n\n bounds.matrix = tempMatrix;\n\n return bounds;\n}\n"],"names":[],"mappings":";;;AAGgB,SAAA,yBAAA,CAA0B,aAA2B,MACrE,EAAA;AACI,EAAA,MAAA,CAAO,KAAM,EAAA,CAAA;AAMb,EAAA,MAAM,aAAa,MAAO,CAAA,MAAA,CAAA;AAE1B,EAAA,KAAA,IAAS,CAAI,GAAA,CAAA,EAAG,CAAI,GAAA,WAAA,CAAY,QAAQ,CACxC,EAAA,EAAA;AACI,IAAM,MAAA,UAAA,GAAa,YAAY,CAAC,CAAA,CAAA;AAEhC,IAAI,IAAA,UAAA,CAAW,sBAAsB,CACrC,EAAA;AACI,MAAA,SAAA;AAAA,KACJ;AAEA,IAAA,MAAA,CAAO,SAAS,UAAW,CAAA,cAAA,CAAA;AAC3B,IAAA,UAAA,CAAW,UAAU,MAAM,CAAA,CAAA;AAAA,GAC/B;AAEA,EAAA,MAAA,CAAO,MAAS,GAAA,UAAA,CAAA;AAEhB,EAAO,OAAA,MAAA,CAAA;AACX;;;;"}

View File

@@ -0,0 +1,18 @@
"use strict";
function getGlobalRenderableBounds(renderables, bounds) {
bounds.clear();
const tempMatrix = bounds.matrix;
for (let i = 0; i < renderables.length; i++) {
const renderable = renderables[i];
if (renderable.globalDisplayStatus < 7) {
continue;
}
bounds.matrix = renderable.worldTransform;
renderable.addBounds(bounds);
}
bounds.matrix = tempMatrix;
return bounds;
}
export { getGlobalRenderableBounds };
//# sourceMappingURL=getRenderableBounds.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"getRenderableBounds.mjs","sources":["../../../../src/scene/container/bounds/getRenderableBounds.ts"],"sourcesContent":["import type { Renderable } from '../../../rendering/renderers/shared/Renderable';\nimport type { Bounds } from './Bounds';\n\nexport function getGlobalRenderableBounds(renderables: Renderable[], bounds: Bounds): Bounds\n{\n bounds.clear();\n\n // instead of copying the matrix each time we are assigning it in bounds\n // this is a performance hack :D\n // so we need to restore the matrix after we are done\n\n const tempMatrix = bounds.matrix;\n\n for (let i = 0; i < renderables.length; i++)\n {\n const renderable = renderables[i];\n\n if (renderable.globalDisplayStatus < 0b111)\n {\n continue;\n }\n\n bounds.matrix = renderable.worldTransform;\n renderable.addBounds(bounds);\n }\n\n bounds.matrix = tempMatrix;\n\n return bounds;\n}\n"],"names":[],"mappings":";AAGgB,SAAA,yBAAA,CAA0B,aAA2B,MACrE,EAAA;AACI,EAAA,MAAA,CAAO,KAAM,EAAA,CAAA;AAMb,EAAA,MAAM,aAAa,MAAO,CAAA,MAAA,CAAA;AAE1B,EAAA,KAAA,IAAS,CAAI,GAAA,CAAA,EAAG,CAAI,GAAA,WAAA,CAAY,QAAQ,CACxC,EAAA,EAAA;AACI,IAAM,MAAA,UAAA,GAAa,YAAY,CAAC,CAAA,CAAA;AAEhC,IAAI,IAAA,UAAA,CAAW,sBAAsB,CACrC,EAAA;AACI,MAAA,SAAA;AAAA,KACJ;AAEA,IAAA,MAAA,CAAO,SAAS,UAAW,CAAA,cAAA,CAAA;AAC3B,IAAA,UAAA,CAAW,UAAU,MAAM,CAAA,CAAA;AAAA,GAC/B;AAEA,EAAA,MAAA,CAAO,MAAS,GAAA,UAAA,CAAA;AAEhB,EAAO,OAAA,MAAA,CAAA;AACX;;;;"}

View File

@@ -0,0 +1,9 @@
import { Matrix } from '../../../../maths/matrix/Matrix';
import { Pool } from '../../../../utils/pool/Pool';
import { Bounds } from '../Bounds';
import type { PoolItem } from '../../../../utils/pool/Pool';
type MatrixPoolItem = Matrix & PoolItem;
type BoundsPoolItem = Bounds & PoolItem;
export declare const matrixPool: Pool<MatrixPoolItem>;
export declare const boundsPool: Pool<BoundsPoolItem>;
export {};

View File

@@ -0,0 +1,13 @@
'use strict';
var Matrix = require('../../../../maths/matrix/Matrix.js');
var Pool = require('../../../../utils/pool/Pool.js');
var Bounds = require('../Bounds.js');
"use strict";
const matrixPool = new Pool.Pool(Matrix.Matrix);
const boundsPool = new Pool.Pool(Bounds.Bounds);
exports.boundsPool = boundsPool;
exports.matrixPool = matrixPool;
//# sourceMappingURL=matrixAndBoundsPool.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"matrixAndBoundsPool.js","sources":["../../../../../src/scene/container/bounds/utils/matrixAndBoundsPool.ts"],"sourcesContent":["import { Matrix } from '../../../../maths/matrix/Matrix';\nimport { Pool } from '../../../../utils/pool/Pool';\nimport { Bounds } from '../Bounds';\n\nimport type { PoolItem } from '../../../../utils/pool/Pool';\n\ntype MatrixPoolItem = Matrix & PoolItem;\ntype BoundsPoolItem = Bounds & PoolItem;\nexport const matrixPool = new Pool<MatrixPoolItem>(Matrix);\nexport const boundsPool = new Pool<BoundsPoolItem>(Bounds);\n"],"names":["Pool","Matrix","Bounds"],"mappings":";;;;;;;AAQa,MAAA,UAAA,GAAa,IAAIA,SAAA,CAAqBC,aAAM,EAAA;AAC5C,MAAA,UAAA,GAAa,IAAID,SAAA,CAAqBE,aAAM;;;;;"}

View File

@@ -0,0 +1,10 @@
import { Matrix } from '../../../../maths/matrix/Matrix.mjs';
import { Pool } from '../../../../utils/pool/Pool.mjs';
import { Bounds } from '../Bounds.mjs';
"use strict";
const matrixPool = new Pool(Matrix);
const boundsPool = new Pool(Bounds);
export { boundsPool, matrixPool };
//# sourceMappingURL=matrixAndBoundsPool.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"matrixAndBoundsPool.mjs","sources":["../../../../../src/scene/container/bounds/utils/matrixAndBoundsPool.ts"],"sourcesContent":["import { Matrix } from '../../../../maths/matrix/Matrix';\nimport { Pool } from '../../../../utils/pool/Pool';\nimport { Bounds } from '../Bounds';\n\nimport type { PoolItem } from '../../../../utils/pool/Pool';\n\ntype MatrixPoolItem = Matrix & PoolItem;\ntype BoundsPoolItem = Bounds & PoolItem;\nexport const matrixPool = new Pool<MatrixPoolItem>(Matrix);\nexport const boundsPool = new Pool<BoundsPoolItem>(Bounds);\n"],"names":[],"mappings":";;;;;AAQa,MAAA,UAAA,GAAa,IAAI,IAAA,CAAqB,MAAM,EAAA;AAC5C,MAAA,UAAA,GAAa,IAAI,IAAA,CAAqB,MAAM;;;;"}