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,3 @@
import { Bounds } from '../../../scene/container/bounds/Bounds';
import type { Container } from '../../../scene/container/Container';
export declare function addMaskBounds(mask: Container, bounds: Bounds, skipUpdateTransform: boolean): void;

View File

@@ -0,0 +1,17 @@
'use strict';
var Bounds = require('../../../scene/container/bounds/Bounds.js');
var getGlobalBounds = require('../../../scene/container/bounds/getGlobalBounds.js');
"use strict";
const tempBounds = new Bounds.Bounds();
function addMaskBounds(mask, bounds, skipUpdateTransform) {
const boundsToMask = tempBounds;
mask.measurable = true;
getGlobalBounds.getGlobalBounds(mask, skipUpdateTransform, boundsToMask);
bounds.addBoundsMask(boundsToMask);
mask.measurable = false;
}
exports.addMaskBounds = addMaskBounds;
//# sourceMappingURL=addMaskBounds.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"addMaskBounds.js","sources":["../../../../src/rendering/mask/utils/addMaskBounds.ts"],"sourcesContent":["import { Bounds } from '../../../scene/container/bounds/Bounds';\nimport { getGlobalBounds } from '../../../scene/container/bounds/getGlobalBounds';\n\nimport type { Container } from '../../../scene/container/Container';\n\nconst tempBounds = new Bounds();\n\nexport function addMaskBounds(mask: Container, bounds: Bounds, skipUpdateTransform: boolean): void\n{\n const boundsToMask = tempBounds;\n\n mask.measurable = true;\n\n getGlobalBounds(mask, skipUpdateTransform, boundsToMask);\n\n bounds.addBoundsMask(boundsToMask);\n\n mask.measurable = false;\n}\n\n"],"names":["Bounds","getGlobalBounds"],"mappings":";;;;;;AAKA,MAAM,UAAA,GAAa,IAAIA,aAAO,EAAA,CAAA;AAEd,SAAA,aAAA,CAAc,IAAiB,EAAA,MAAA,EAAgB,mBAC/D,EAAA;AACI,EAAA,MAAM,YAAe,GAAA,UAAA,CAAA;AAErB,EAAA,IAAA,CAAK,UAAa,GAAA,IAAA,CAAA;AAElB,EAAgBC,+BAAA,CAAA,IAAA,EAAM,qBAAqB,YAAY,CAAA,CAAA;AAEvD,EAAA,MAAA,CAAO,cAAc,YAAY,CAAA,CAAA;AAEjC,EAAA,IAAA,CAAK,UAAa,GAAA,KAAA,CAAA;AACtB;;;;"}

View File

@@ -0,0 +1,15 @@
import { Bounds } from '../../../scene/container/bounds/Bounds.mjs';
import { getGlobalBounds } from '../../../scene/container/bounds/getGlobalBounds.mjs';
"use strict";
const tempBounds = new Bounds();
function addMaskBounds(mask, bounds, skipUpdateTransform) {
const boundsToMask = tempBounds;
mask.measurable = true;
getGlobalBounds(mask, skipUpdateTransform, boundsToMask);
bounds.addBoundsMask(boundsToMask);
mask.measurable = false;
}
export { addMaskBounds };
//# sourceMappingURL=addMaskBounds.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"addMaskBounds.mjs","sources":["../../../../src/rendering/mask/utils/addMaskBounds.ts"],"sourcesContent":["import { Bounds } from '../../../scene/container/bounds/Bounds';\nimport { getGlobalBounds } from '../../../scene/container/bounds/getGlobalBounds';\n\nimport type { Container } from '../../../scene/container/Container';\n\nconst tempBounds = new Bounds();\n\nexport function addMaskBounds(mask: Container, bounds: Bounds, skipUpdateTransform: boolean): void\n{\n const boundsToMask = tempBounds;\n\n mask.measurable = true;\n\n getGlobalBounds(mask, skipUpdateTransform, boundsToMask);\n\n bounds.addBoundsMask(boundsToMask);\n\n mask.measurable = false;\n}\n\n"],"names":[],"mappings":";;;;AAKA,MAAM,UAAA,GAAa,IAAI,MAAO,EAAA,CAAA;AAEd,SAAA,aAAA,CAAc,IAAiB,EAAA,MAAA,EAAgB,mBAC/D,EAAA;AACI,EAAA,MAAM,YAAe,GAAA,UAAA,CAAA;AAErB,EAAA,IAAA,CAAK,UAAa,GAAA,IAAA,CAAA;AAElB,EAAgB,eAAA,CAAA,IAAA,EAAM,qBAAqB,YAAY,CAAA,CAAA;AAEvD,EAAA,MAAA,CAAO,cAAc,YAAY,CAAA,CAAA;AAEjC,EAAA,IAAA,CAAK,UAAa,GAAA,KAAA,CAAA;AACtB;;;;"}

View File

@@ -0,0 +1,5 @@
import type { Matrix } from '../../../maths/matrix/Matrix';
import type { Bounds } from '../../../scene/container/bounds/Bounds';
import type { Container } from '../../../scene/container/Container';
export declare function addMaskLocalBounds(mask: Container, bounds: Bounds, localRoot: Container): void;
export declare function getMatrixRelativeToParent(target: Container, root: Container, matrix: Matrix): Matrix;

View File

@@ -0,0 +1,34 @@
'use strict';
var getLocalBounds = require('../../../scene/container/bounds/getLocalBounds.js');
var matrixAndBoundsPool = require('../../../scene/container/bounds/utils/matrixAndBoundsPool.js');
var warn = require('../../../utils/logging/warn.js');
"use strict";
function addMaskLocalBounds(mask, bounds, localRoot) {
const boundsToMask = matrixAndBoundsPool.boundsPool.get();
mask.measurable = true;
const tempMatrix = matrixAndBoundsPool.matrixPool.get().identity();
const relativeMask = getMatrixRelativeToParent(mask, localRoot, tempMatrix);
getLocalBounds.getLocalBounds(mask, boundsToMask, relativeMask);
mask.measurable = false;
bounds.addBoundsMask(boundsToMask);
matrixAndBoundsPool.matrixPool.return(tempMatrix);
matrixAndBoundsPool.boundsPool.return(boundsToMask);
}
function getMatrixRelativeToParent(target, root, matrix) {
if (!target) {
warn.warn("Mask bounds, renderable is not inside the root container");
return matrix;
}
if (target !== root) {
getMatrixRelativeToParent(target.parent, root, matrix);
target.updateLocalTransform();
matrix.append(target.localTransform);
}
return matrix;
}
exports.addMaskLocalBounds = addMaskLocalBounds;
exports.getMatrixRelativeToParent = getMatrixRelativeToParent;
//# sourceMappingURL=addMaskLocalBounds.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"addMaskLocalBounds.js","sources":["../../../../src/rendering/mask/utils/addMaskLocalBounds.ts"],"sourcesContent":["import { getLocalBounds } from '../../../scene/container/bounds/getLocalBounds';\nimport { boundsPool, matrixPool } from '../../../scene/container/bounds/utils/matrixAndBoundsPool';\nimport { warn } from '../../../utils/logging/warn';\n\nimport type { Matrix } from '../../../maths/matrix/Matrix';\nimport type { Bounds } from '../../../scene/container/bounds/Bounds';\nimport type { Container } from '../../../scene/container/Container';\n\nexport function addMaskLocalBounds(mask: Container, bounds: Bounds, localRoot: Container): void\n{\n const boundsToMask = boundsPool.get();\n\n mask.measurable = true;\n\n const tempMatrix = matrixPool.get().identity();\n\n const relativeMask = getMatrixRelativeToParent(mask, localRoot, tempMatrix);\n\n getLocalBounds(mask, boundsToMask, relativeMask);\n\n mask.measurable = false;\n\n bounds.addBoundsMask(boundsToMask);\n\n matrixPool.return(tempMatrix);\n boundsPool.return(boundsToMask);\n}\n\nexport function getMatrixRelativeToParent(target: Container, root: Container, matrix: Matrix): Matrix\n{\n if (!target)\n {\n // we have reach the top of the tree!\n // #if _DEBUG\n warn('Mask bounds, renderable is not inside the root container');\n // #endif\n\n return matrix;\n }\n\n if (target !== root)\n {\n getMatrixRelativeToParent(target.parent, root, matrix);\n\n target.updateLocalTransform();\n\n matrix.append(target.localTransform);\n }\n\n return matrix;\n}\n"],"names":["boundsPool","matrixPool","getLocalBounds","warn"],"mappings":";;;;;;;AAQgB,SAAA,kBAAA,CAAmB,IAAiB,EAAA,MAAA,EAAgB,SACpE,EAAA;AACI,EAAM,MAAA,YAAA,GAAeA,+BAAW,GAAI,EAAA,CAAA;AAEpC,EAAA,IAAA,CAAK,UAAa,GAAA,IAAA,CAAA;AAElB,EAAA,MAAM,UAAa,GAAAC,8BAAA,CAAW,GAAI,EAAA,CAAE,QAAS,EAAA,CAAA;AAE7C,EAAA,MAAM,YAAe,GAAA,yBAAA,CAA0B,IAAM,EAAA,SAAA,EAAW,UAAU,CAAA,CAAA;AAE1E,EAAeC,6BAAA,CAAA,IAAA,EAAM,cAAc,YAAY,CAAA,CAAA;AAE/C,EAAA,IAAA,CAAK,UAAa,GAAA,KAAA,CAAA;AAElB,EAAA,MAAA,CAAO,cAAc,YAAY,CAAA,CAAA;AAEjC,EAAAD,8BAAA,CAAW,OAAO,UAAU,CAAA,CAAA;AAC5B,EAAAD,8BAAA,CAAW,OAAO,YAAY,CAAA,CAAA;AAClC,CAAA;AAEgB,SAAA,yBAAA,CAA0B,MAAmB,EAAA,IAAA,EAAiB,MAC9E,EAAA;AACI,EAAA,IAAI,CAAC,MACL,EAAA;AAGI,IAAAG,SAAA,CAAK,0DAA0D,CAAA,CAAA;AAG/D,IAAO,OAAA,MAAA,CAAA;AAAA,GACX;AAEA,EAAA,IAAI,WAAW,IACf,EAAA;AACI,IAA0B,yBAAA,CAAA,MAAA,CAAO,MAAQ,EAAA,IAAA,EAAM,MAAM,CAAA,CAAA;AAErD,IAAA,MAAA,CAAO,oBAAqB,EAAA,CAAA;AAE5B,IAAO,MAAA,CAAA,MAAA,CAAO,OAAO,cAAc,CAAA,CAAA;AAAA,GACvC;AAEA,EAAO,OAAA,MAAA,CAAA;AACX;;;;;"}

View File

@@ -0,0 +1,31 @@
import { getLocalBounds } from '../../../scene/container/bounds/getLocalBounds.mjs';
import { boundsPool, matrixPool } from '../../../scene/container/bounds/utils/matrixAndBoundsPool.mjs';
import { warn } from '../../../utils/logging/warn.mjs';
"use strict";
function addMaskLocalBounds(mask, bounds, localRoot) {
const boundsToMask = boundsPool.get();
mask.measurable = true;
const tempMatrix = matrixPool.get().identity();
const relativeMask = getMatrixRelativeToParent(mask, localRoot, tempMatrix);
getLocalBounds(mask, boundsToMask, relativeMask);
mask.measurable = false;
bounds.addBoundsMask(boundsToMask);
matrixPool.return(tempMatrix);
boundsPool.return(boundsToMask);
}
function getMatrixRelativeToParent(target, root, matrix) {
if (!target) {
warn("Mask bounds, renderable is not inside the root container");
return matrix;
}
if (target !== root) {
getMatrixRelativeToParent(target.parent, root, matrix);
target.updateLocalTransform();
matrix.append(target.localTransform);
}
return matrix;
}
export { addMaskLocalBounds, getMatrixRelativeToParent };
//# sourceMappingURL=addMaskLocalBounds.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"addMaskLocalBounds.mjs","sources":["../../../../src/rendering/mask/utils/addMaskLocalBounds.ts"],"sourcesContent":["import { getLocalBounds } from '../../../scene/container/bounds/getLocalBounds';\nimport { boundsPool, matrixPool } from '../../../scene/container/bounds/utils/matrixAndBoundsPool';\nimport { warn } from '../../../utils/logging/warn';\n\nimport type { Matrix } from '../../../maths/matrix/Matrix';\nimport type { Bounds } from '../../../scene/container/bounds/Bounds';\nimport type { Container } from '../../../scene/container/Container';\n\nexport function addMaskLocalBounds(mask: Container, bounds: Bounds, localRoot: Container): void\n{\n const boundsToMask = boundsPool.get();\n\n mask.measurable = true;\n\n const tempMatrix = matrixPool.get().identity();\n\n const relativeMask = getMatrixRelativeToParent(mask, localRoot, tempMatrix);\n\n getLocalBounds(mask, boundsToMask, relativeMask);\n\n mask.measurable = false;\n\n bounds.addBoundsMask(boundsToMask);\n\n matrixPool.return(tempMatrix);\n boundsPool.return(boundsToMask);\n}\n\nexport function getMatrixRelativeToParent(target: Container, root: Container, matrix: Matrix): Matrix\n{\n if (!target)\n {\n // we have reach the top of the tree!\n // #if _DEBUG\n warn('Mask bounds, renderable is not inside the root container');\n // #endif\n\n return matrix;\n }\n\n if (target !== root)\n {\n getMatrixRelativeToParent(target.parent, root, matrix);\n\n target.updateLocalTransform();\n\n matrix.append(target.localTransform);\n }\n\n return matrix;\n}\n"],"names":[],"mappings":";;;;;AAQgB,SAAA,kBAAA,CAAmB,IAAiB,EAAA,MAAA,EAAgB,SACpE,EAAA;AACI,EAAM,MAAA,YAAA,GAAe,WAAW,GAAI,EAAA,CAAA;AAEpC,EAAA,IAAA,CAAK,UAAa,GAAA,IAAA,CAAA;AAElB,EAAA,MAAM,UAAa,GAAA,UAAA,CAAW,GAAI,EAAA,CAAE,QAAS,EAAA,CAAA;AAE7C,EAAA,MAAM,YAAe,GAAA,yBAAA,CAA0B,IAAM,EAAA,SAAA,EAAW,UAAU,CAAA,CAAA;AAE1E,EAAe,cAAA,CAAA,IAAA,EAAM,cAAc,YAAY,CAAA,CAAA;AAE/C,EAAA,IAAA,CAAK,UAAa,GAAA,KAAA,CAAA;AAElB,EAAA,MAAA,CAAO,cAAc,YAAY,CAAA,CAAA;AAEjC,EAAA,UAAA,CAAW,OAAO,UAAU,CAAA,CAAA;AAC5B,EAAA,UAAA,CAAW,OAAO,YAAY,CAAA,CAAA;AAClC,CAAA;AAEgB,SAAA,yBAAA,CAA0B,MAAmB,EAAA,IAAA,EAAiB,MAC9E,EAAA;AACI,EAAA,IAAI,CAAC,MACL,EAAA;AAGI,IAAA,IAAA,CAAK,0DAA0D,CAAA,CAAA;AAG/D,IAAO,OAAA,MAAA,CAAA;AAAA,GACX;AAEA,EAAA,IAAI,WAAW,IACf,EAAA;AACI,IAA0B,yBAAA,CAAA,MAAA,CAAO,MAAQ,EAAA,IAAA,EAAM,MAAM,CAAA,CAAA;AAErD,IAAA,MAAA,CAAO,oBAAqB,EAAA,CAAA;AAE5B,IAAO,MAAA,CAAA,MAAA,CAAO,OAAO,cAAc,CAAA,CAAA;AAAA,GACvC;AAEA,EAAO,OAAA,MAAA,CAAA;AACX;;;;"}