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,7 @@
/**
* Assigns properties from one object to another, using an optional array of property names to ignore.
* @param target - The target object to assign properties to.
* @param options - The object to assign properties from.
* @param ignore - An object of property names to ignore ({ propToIgnore: true }).
*/
export declare function assignWithIgnore<T extends Record<string, any>>(target: T, options: T, ignore?: Record<string, boolean>): void;

View File

@@ -0,0 +1,13 @@
'use strict';
"use strict";
function assignWithIgnore(target, options, ignore = {}) {
for (const key in options) {
if (!ignore[key] && options[key] !== void 0) {
target[key] = options[key];
}
}
}
exports.assignWithIgnore = assignWithIgnore;
//# sourceMappingURL=assignWithIgnore.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"assignWithIgnore.js","sources":["../../../../src/scene/container/utils/assignWithIgnore.ts"],"sourcesContent":["/**\n * Assigns properties from one object to another, using an optional array of property names to ignore.\n * @param target - The target object to assign properties to.\n * @param options - The object to assign properties from.\n * @param ignore - An object of property names to ignore ({ propToIgnore: true }).\n */\nexport function assignWithIgnore<T extends Record<string, any>>(\n target: T,\n options: T,\n ignore: Record<string, boolean> = {}\n)\n{\n for (const key in options)\n {\n if (!ignore[key] && options[key] !== undefined)\n {\n target[key] = options[key];\n }\n }\n}\n"],"names":[],"mappings":";;;AAMO,SAAS,gBACZ,CAAA,MAAA,EACA,OACA,EAAA,MAAA,GAAkC,EAEtC,EAAA;AACI,EAAA,KAAA,MAAW,OAAO,OAClB,EAAA;AACI,IAAA,IAAI,CAAC,MAAO,CAAA,GAAG,KAAK,OAAQ,CAAA,GAAG,MAAM,KACrC,CAAA,EAAA;AACI,MAAO,MAAA,CAAA,GAAG,CAAI,GAAA,OAAA,CAAQ,GAAG,CAAA,CAAA;AAAA,KAC7B;AAAA,GACJ;AACJ;;;;"}

View File

@@ -0,0 +1,11 @@
"use strict";
function assignWithIgnore(target, options, ignore = {}) {
for (const key in options) {
if (!ignore[key] && options[key] !== void 0) {
target[key] = options[key];
}
}
}
export { assignWithIgnore };
//# sourceMappingURL=assignWithIgnore.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"assignWithIgnore.mjs","sources":["../../../../src/scene/container/utils/assignWithIgnore.ts"],"sourcesContent":["/**\n * Assigns properties from one object to another, using an optional array of property names to ignore.\n * @param target - The target object to assign properties to.\n * @param options - The object to assign properties from.\n * @param ignore - An object of property names to ignore ({ propToIgnore: true }).\n */\nexport function assignWithIgnore<T extends Record<string, any>>(\n target: T,\n options: T,\n ignore: Record<string, boolean> = {}\n)\n{\n for (const key in options)\n {\n if (!ignore[key] && options[key] !== undefined)\n {\n target[key] = options[key];\n }\n }\n}\n"],"names":[],"mappings":";AAMO,SAAS,gBACZ,CAAA,MAAA,EACA,OACA,EAAA,MAAA,GAAkC,EAEtC,EAAA;AACI,EAAA,KAAA,MAAW,OAAO,OAClB,EAAA;AACI,IAAA,IAAI,CAAC,MAAO,CAAA,GAAG,KAAK,OAAQ,CAAA,GAAG,MAAM,KACrC,CAAA,EAAA;AACI,MAAO,MAAA,CAAA,GAAG,CAAI,GAAA,OAAA,CAAQ,GAAG,CAAA,CAAA;AAAA,KAC7B;AAAA,GACJ;AACJ;;;;"}

View File

@@ -0,0 +1,19 @@
import type { InstructionSet } from '../../../rendering/renderers/shared/instructions/InstructionSet';
import type { Renderer, RenderPipes } from '../../../rendering/renderers/types';
import type { Container } from '../Container';
import type { RenderGroup } from '../RenderGroup';
/**
* @param renderGroup
* @param renderPipes
* @deprecated since 8.3.0
*/
export declare function buildInstructions(renderGroup: RenderGroup, renderPipes: RenderPipes): void;
export declare function buildInstructions(renderGroup: RenderGroup, renderer: Renderer): void;
/**
* @param container
* @param instructionSet
* @param renderer
* @deprecated since 8.3.0
*/
export declare function collectAllRenderables(container: Container, instructionSet: InstructionSet, renderer: RenderPipes): void;
export declare function collectAllRenderables(container: Container, instructionSet: InstructionSet, renderer: Renderer): void;

View File

@@ -0,0 +1,84 @@
'use strict';
"use strict";
function buildInstructions(renderGroup, rendererOrPipes) {
const root = renderGroup.root;
const instructionSet = renderGroup.instructionSet;
instructionSet.reset();
const renderer = rendererOrPipes.renderPipes ? rendererOrPipes : rendererOrPipes.batch.renderer;
const renderPipes = renderer.renderPipes;
renderPipes.batch.buildStart(instructionSet);
renderPipes.blendMode.buildStart();
renderPipes.colorMask.buildStart();
if (root.sortableChildren) {
root.sortChildren();
}
collectAllRenderablesAdvanced(root, instructionSet, renderer, true);
renderPipes.batch.buildEnd(instructionSet);
renderPipes.blendMode.buildEnd(instructionSet);
}
function collectAllRenderables(container, instructionSet, rendererOrPipes) {
const renderer = rendererOrPipes.renderPipes ? rendererOrPipes : rendererOrPipes.batch.renderer;
if (container.globalDisplayStatus < 7 || !container.includeInBuild)
return;
if (container.sortableChildren) {
container.sortChildren();
}
if (container.isSimple) {
collectAllRenderablesSimple(container, instructionSet, renderer);
} else {
collectAllRenderablesAdvanced(container, instructionSet, renderer, false);
}
}
function collectAllRenderablesSimple(container, instructionSet, renderer) {
if (container.renderPipeId) {
const { renderPipes, renderableGC } = renderer;
renderPipes.blendMode.setBlendMode(container, container.groupBlendMode, instructionSet);
container.didViewUpdate = false;
const rp = renderPipes;
rp[container.renderPipeId].addRenderable(container, instructionSet);
renderableGC.addRenderable(container, instructionSet);
}
if (!container.renderGroup) {
const children = container.children;
const length = children.length;
for (let i = 0; i < length; i++) {
collectAllRenderables(children[i], instructionSet, renderer);
}
}
}
function collectAllRenderablesAdvanced(container, instructionSet, renderer, isRoot) {
const { renderPipes, renderableGC } = renderer;
if (!isRoot && container.renderGroup) {
renderPipes.renderGroup.addRenderGroup(container.renderGroup, instructionSet);
} else {
for (let i = 0; i < container.effects.length; i++) {
const effect = container.effects[i];
const pipe = renderPipes[effect.pipe];
pipe.push(effect, container, instructionSet);
}
const renderPipeId = container.renderPipeId;
if (renderPipeId) {
renderPipes.blendMode.setBlendMode(container, container.groupBlendMode, instructionSet);
container.didViewUpdate = false;
const pipe = renderPipes[renderPipeId];
pipe.addRenderable(container, instructionSet);
renderableGC.addRenderable(container, instructionSet);
}
const children = container.children;
if (children.length) {
for (let i = 0; i < children.length; i++) {
collectAllRenderables(children[i], instructionSet, renderer);
}
}
for (let i = container.effects.length - 1; i >= 0; i--) {
const effect = container.effects[i];
const pipe = renderPipes[effect.pipe];
pipe.pop(effect, container, instructionSet);
}
}
}
exports.buildInstructions = buildInstructions;
exports.collectAllRenderables = collectAllRenderables;
//# sourceMappingURL=buildInstructions.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,81 @@
"use strict";
function buildInstructions(renderGroup, rendererOrPipes) {
const root = renderGroup.root;
const instructionSet = renderGroup.instructionSet;
instructionSet.reset();
const renderer = rendererOrPipes.renderPipes ? rendererOrPipes : rendererOrPipes.batch.renderer;
const renderPipes = renderer.renderPipes;
renderPipes.batch.buildStart(instructionSet);
renderPipes.blendMode.buildStart();
renderPipes.colorMask.buildStart();
if (root.sortableChildren) {
root.sortChildren();
}
collectAllRenderablesAdvanced(root, instructionSet, renderer, true);
renderPipes.batch.buildEnd(instructionSet);
renderPipes.blendMode.buildEnd(instructionSet);
}
function collectAllRenderables(container, instructionSet, rendererOrPipes) {
const renderer = rendererOrPipes.renderPipes ? rendererOrPipes : rendererOrPipes.batch.renderer;
if (container.globalDisplayStatus < 7 || !container.includeInBuild)
return;
if (container.sortableChildren) {
container.sortChildren();
}
if (container.isSimple) {
collectAllRenderablesSimple(container, instructionSet, renderer);
} else {
collectAllRenderablesAdvanced(container, instructionSet, renderer, false);
}
}
function collectAllRenderablesSimple(container, instructionSet, renderer) {
if (container.renderPipeId) {
const { renderPipes, renderableGC } = renderer;
renderPipes.blendMode.setBlendMode(container, container.groupBlendMode, instructionSet);
container.didViewUpdate = false;
const rp = renderPipes;
rp[container.renderPipeId].addRenderable(container, instructionSet);
renderableGC.addRenderable(container, instructionSet);
}
if (!container.renderGroup) {
const children = container.children;
const length = children.length;
for (let i = 0; i < length; i++) {
collectAllRenderables(children[i], instructionSet, renderer);
}
}
}
function collectAllRenderablesAdvanced(container, instructionSet, renderer, isRoot) {
const { renderPipes, renderableGC } = renderer;
if (!isRoot && container.renderGroup) {
renderPipes.renderGroup.addRenderGroup(container.renderGroup, instructionSet);
} else {
for (let i = 0; i < container.effects.length; i++) {
const effect = container.effects[i];
const pipe = renderPipes[effect.pipe];
pipe.push(effect, container, instructionSet);
}
const renderPipeId = container.renderPipeId;
if (renderPipeId) {
renderPipes.blendMode.setBlendMode(container, container.groupBlendMode, instructionSet);
container.didViewUpdate = false;
const pipe = renderPipes[renderPipeId];
pipe.addRenderable(container, instructionSet);
renderableGC.addRenderable(container, instructionSet);
}
const children = container.children;
if (children.length) {
for (let i = 0; i < children.length; i++) {
collectAllRenderables(children[i], instructionSet, renderer);
}
}
for (let i = container.effects.length - 1; i >= 0; i--) {
const effect = container.effects[i];
const pipe = renderPipes[effect.pipe];
pipe.pop(effect, container, instructionSet);
}
}
}
export { buildInstructions, collectAllRenderables };
//# sourceMappingURL=buildInstructions.mjs.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,21 @@
import type { Container } from '../Container';
/**
* This function will crawl through the container essentially check if the children have changed.
*
* This function checkChildrenDidChange recursively checks if any child in a Container
* or its children has changed. It does this by comparing a generated changeId for each
* child against a stored value in previousData.
* The changeId is a combination of the child's uid and _didChangeId, bitwise manipulated for uniqueness.
* If a change is detected, it updates previousData and sets didChange to true.
* The function returns a boolean indicating if any change was detected in the entire hierarchy of children.
* @param container - the container to check for changes
* @param previousData - the previous data from the last check made
* @param previousData.data - the data array
* @param previousData.index - the index of the data array
* @param previousData.didChange - did the data change
*/
export declare function checkChildrenDidChange(container: Container, previousData: {
data: number[];
index: number;
didChange: boolean;
}): boolean;

View File

@@ -0,0 +1,25 @@
'use strict';
"use strict";
function checkChildrenDidChange(container, previousData) {
const children = container.children;
for (let i = 0; i < children.length; i++) {
const child = children[i];
const uid = child.uid;
const didChange = (child._didViewChangeTick & 65535) << 16 | child._didContainerChangeTick & 65535;
const index = previousData.index;
if (previousData.data[index] !== uid || previousData.data[index + 1] !== didChange) {
previousData.data[previousData.index] = uid;
previousData.data[previousData.index + 1] = didChange;
previousData.didChange = true;
}
previousData.index = index + 2;
if (child.children.length) {
checkChildrenDidChange(child, previousData);
}
}
return previousData.didChange;
}
exports.checkChildrenDidChange = checkChildrenDidChange;
//# sourceMappingURL=checkChildrenDidChange.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"checkChildrenDidChange.js","sources":["../../../../src/scene/container/utils/checkChildrenDidChange.ts"],"sourcesContent":["import type { Container } from '../Container';\n\n/**\n * This function will crawl through the container essentially check if the children have changed.\n *\n * This function checkChildrenDidChange recursively checks if any child in a Container\n * or its children has changed. It does this by comparing a generated changeId for each\n * child against a stored value in previousData.\n * The changeId is a combination of the child's uid and _didChangeId, bitwise manipulated for uniqueness.\n * If a change is detected, it updates previousData and sets didChange to true.\n * The function returns a boolean indicating if any change was detected in the entire hierarchy of children.\n * @param container - the container to check for changes\n * @param previousData - the previous data from the last check made\n * @param previousData.data - the data array\n * @param previousData.index - the index of the data array\n * @param previousData.didChange - did the data change\n */\nexport function checkChildrenDidChange(\n container: Container,\n previousData: {\n data: number[];\n index: number;\n didChange: boolean;\n })\n{\n const children = container.children;\n\n for (let i = 0; i < children.length; i++)\n {\n const child = children[i];\n\n const uid = child.uid;\n const didChange = ((child._didViewChangeTick & 0xffff) << 16) | (child._didContainerChangeTick & 0xffff);\n\n const index = previousData.index;\n\n if (previousData.data[index] !== uid || previousData.data[index + 1] !== didChange)\n {\n previousData.data[previousData.index] = uid;\n previousData.data[previousData.index + 1] = didChange;\n\n previousData.didChange = true;\n }\n\n previousData.index = index + 2;\n\n if (child.children.length)\n {\n checkChildrenDidChange(child, previousData);\n }\n }\n\n return previousData.didChange;\n}\n"],"names":[],"mappings":";;;AAiBgB,SAAA,sBAAA,CACZ,WACA,YAKJ,EAAA;AACI,EAAA,MAAM,WAAW,SAAU,CAAA,QAAA,CAAA;AAE3B,EAAA,KAAA,IAAS,CAAI,GAAA,CAAA,EAAG,CAAI,GAAA,QAAA,CAAS,QAAQ,CACrC,EAAA,EAAA;AACI,IAAM,MAAA,KAAA,GAAQ,SAAS,CAAC,CAAA,CAAA;AAExB,IAAA,MAAM,MAAM,KAAM,CAAA,GAAA,CAAA;AAClB,IAAA,MAAM,aAAc,KAAM,CAAA,kBAAA,GAAqB,KAAW,KAAA,EAAA,GAAO,MAAM,uBAA0B,GAAA,KAAA,CAAA;AAEjG,IAAA,MAAM,QAAQ,YAAa,CAAA,KAAA,CAAA;AAE3B,IAAI,IAAA,YAAA,CAAa,IAAK,CAAA,KAAK,CAAM,KAAA,GAAA,IAAO,aAAa,IAAK,CAAA,KAAA,GAAQ,CAAC,CAAA,KAAM,SACzE,EAAA;AACI,MAAa,YAAA,CAAA,IAAA,CAAK,YAAa,CAAA,KAAK,CAAI,GAAA,GAAA,CAAA;AACxC,MAAA,YAAA,CAAa,IAAK,CAAA,YAAA,CAAa,KAAQ,GAAA,CAAC,CAAI,GAAA,SAAA,CAAA;AAE5C,MAAA,YAAA,CAAa,SAAY,GAAA,IAAA,CAAA;AAAA,KAC7B;AAEA,IAAA,YAAA,CAAa,QAAQ,KAAQ,GAAA,CAAA,CAAA;AAE7B,IAAI,IAAA,KAAA,CAAM,SAAS,MACnB,EAAA;AACI,MAAA,sBAAA,CAAuB,OAAO,YAAY,CAAA,CAAA;AAAA,KAC9C;AAAA,GACJ;AAEA,EAAA,OAAO,YAAa,CAAA,SAAA,CAAA;AACxB;;;;"}

View File

@@ -0,0 +1,23 @@
"use strict";
function checkChildrenDidChange(container, previousData) {
const children = container.children;
for (let i = 0; i < children.length; i++) {
const child = children[i];
const uid = child.uid;
const didChange = (child._didViewChangeTick & 65535) << 16 | child._didContainerChangeTick & 65535;
const index = previousData.index;
if (previousData.data[index] !== uid || previousData.data[index + 1] !== didChange) {
previousData.data[previousData.index] = uid;
previousData.data[previousData.index + 1] = didChange;
previousData.didChange = true;
}
previousData.index = index + 2;
if (child.children.length) {
checkChildrenDidChange(child, previousData);
}
}
return previousData.didChange;
}
export { checkChildrenDidChange };
//# sourceMappingURL=checkChildrenDidChange.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"checkChildrenDidChange.mjs","sources":["../../../../src/scene/container/utils/checkChildrenDidChange.ts"],"sourcesContent":["import type { Container } from '../Container';\n\n/**\n * This function will crawl through the container essentially check if the children have changed.\n *\n * This function checkChildrenDidChange recursively checks if any child in a Container\n * or its children has changed. It does this by comparing a generated changeId for each\n * child against a stored value in previousData.\n * The changeId is a combination of the child's uid and _didChangeId, bitwise manipulated for uniqueness.\n * If a change is detected, it updates previousData and sets didChange to true.\n * The function returns a boolean indicating if any change was detected in the entire hierarchy of children.\n * @param container - the container to check for changes\n * @param previousData - the previous data from the last check made\n * @param previousData.data - the data array\n * @param previousData.index - the index of the data array\n * @param previousData.didChange - did the data change\n */\nexport function checkChildrenDidChange(\n container: Container,\n previousData: {\n data: number[];\n index: number;\n didChange: boolean;\n })\n{\n const children = container.children;\n\n for (let i = 0; i < children.length; i++)\n {\n const child = children[i];\n\n const uid = child.uid;\n const didChange = ((child._didViewChangeTick & 0xffff) << 16) | (child._didContainerChangeTick & 0xffff);\n\n const index = previousData.index;\n\n if (previousData.data[index] !== uid || previousData.data[index + 1] !== didChange)\n {\n previousData.data[previousData.index] = uid;\n previousData.data[previousData.index + 1] = didChange;\n\n previousData.didChange = true;\n }\n\n previousData.index = index + 2;\n\n if (child.children.length)\n {\n checkChildrenDidChange(child, previousData);\n }\n }\n\n return previousData.didChange;\n}\n"],"names":[],"mappings":";AAiBgB,SAAA,sBAAA,CACZ,WACA,YAKJ,EAAA;AACI,EAAA,MAAM,WAAW,SAAU,CAAA,QAAA,CAAA;AAE3B,EAAA,KAAA,IAAS,CAAI,GAAA,CAAA,EAAG,CAAI,GAAA,QAAA,CAAS,QAAQ,CACrC,EAAA,EAAA;AACI,IAAM,MAAA,KAAA,GAAQ,SAAS,CAAC,CAAA,CAAA;AAExB,IAAA,MAAM,MAAM,KAAM,CAAA,GAAA,CAAA;AAClB,IAAA,MAAM,aAAc,KAAM,CAAA,kBAAA,GAAqB,KAAW,KAAA,EAAA,GAAO,MAAM,uBAA0B,GAAA,KAAA,CAAA;AAEjG,IAAA,MAAM,QAAQ,YAAa,CAAA,KAAA,CAAA;AAE3B,IAAI,IAAA,YAAA,CAAa,IAAK,CAAA,KAAK,CAAM,KAAA,GAAA,IAAO,aAAa,IAAK,CAAA,KAAA,GAAQ,CAAC,CAAA,KAAM,SACzE,EAAA;AACI,MAAa,YAAA,CAAA,IAAA,CAAK,YAAa,CAAA,KAAK,CAAI,GAAA,GAAA,CAAA;AACxC,MAAA,YAAA,CAAa,IAAK,CAAA,YAAA,CAAa,KAAQ,GAAA,CAAC,CAAI,GAAA,SAAA,CAAA;AAE5C,MAAA,YAAA,CAAa,SAAY,GAAA,IAAA,CAAA;AAAA,KAC7B;AAEA,IAAA,YAAA,CAAa,QAAQ,KAAQ,GAAA,CAAA,CAAA;AAE7B,IAAI,IAAA,KAAA,CAAM,SAAS,MACnB,EAAA;AACI,MAAA,sBAAA,CAAuB,OAAO,YAAY,CAAA,CAAA;AAAA,KAC9C;AAAA,GACJ;AAEA,EAAA,OAAO,YAAa,CAAA,SAAA,CAAA;AACxB;;;;"}

View File

@@ -0,0 +1,8 @@
/**
* nulls all slots in an array from a certain index.
* assume that when a null item is hit, the rest are also null.
* Which will be the case for where this is used!
* @param list - the array to clean
* @param index - the index to start from
*/
export declare function clearList(list: Array<unknown>, index?: number): void;

View File

@@ -0,0 +1,16 @@
'use strict';
"use strict";
function clearList(list, index) {
index || (index = 0);
for (let j = index; j < list.length; j++) {
if (list[j]) {
list[j] = null;
} else {
break;
}
}
}
exports.clearList = clearList;
//# sourceMappingURL=clearList.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"clearList.js","sources":["../../../../src/scene/container/utils/clearList.ts"],"sourcesContent":["/**\n * nulls all slots in an array from a certain index.\n * assume that when a null item is hit, the rest are also null.\n * Which will be the case for where this is used!\n * @param list - the array to clean\n * @param index - the index to start from\n */\nexport function clearList(list: Array<unknown>, index?: number)\n{\n index ||= 0;\n\n for (let j = index; j < list.length; j++)\n {\n if (list[j])\n {\n list[j] = null;\n }\n else\n {\n break;\n }\n }\n}\n"],"names":[],"mappings":";;;AAOgB,SAAA,SAAA,CAAU,MAAsB,KAChD,EAAA;AACI,EAAU,KAAA,KAAA,KAAA,GAAA,CAAA,CAAA,CAAA;AAEV,EAAA,KAAA,IAAS,CAAI,GAAA,KAAA,EAAO,CAAI,GAAA,IAAA,CAAK,QAAQ,CACrC,EAAA,EAAA;AACI,IAAI,IAAA,IAAA,CAAK,CAAC,CACV,EAAA;AACI,MAAA,IAAA,CAAK,CAAC,CAAI,GAAA,IAAA,CAAA;AAAA,KAGd,MAAA;AACI,MAAA,MAAA;AAAA,KACJ;AAAA,GACJ;AACJ;;;;"}

View File

@@ -0,0 +1,14 @@
"use strict";
function clearList(list, index) {
index || (index = 0);
for (let j = index; j < list.length; j++) {
if (list[j]) {
list[j] = null;
} else {
break;
}
}
}
export { clearList };
//# sourceMappingURL=clearList.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"clearList.mjs","sources":["../../../../src/scene/container/utils/clearList.ts"],"sourcesContent":["/**\n * nulls all slots in an array from a certain index.\n * assume that when a null item is hit, the rest are also null.\n * Which will be the case for where this is used!\n * @param list - the array to clean\n * @param index - the index to start from\n */\nexport function clearList(list: Array<unknown>, index?: number)\n{\n index ||= 0;\n\n for (let j = index; j < list.length; j++)\n {\n if (list[j])\n {\n list[j] = null;\n }\n else\n {\n break;\n }\n }\n}\n"],"names":[],"mappings":";AAOgB,SAAA,SAAA,CAAU,MAAsB,KAChD,EAAA;AACI,EAAU,KAAA,KAAA,KAAA,GAAA,CAAA,CAAA,CAAA;AAEV,EAAA,KAAA,IAAS,CAAI,GAAA,KAAA,EAAO,CAAI,GAAA,IAAA,CAAK,QAAQ,CACrC,EAAA,EAAA;AACI,IAAI,IAAA,IAAA,CAAK,CAAC,CACV,EAAA;AACI,MAAA,IAAA,CAAK,CAAC,CAAI,GAAA,IAAA,CAAA;AAAA,KAGd,MAAA;AACI,MAAA,MAAA;AAAA,KACJ;AAAA,GACJ;AACJ;;;;"}

View File

@@ -0,0 +1,2 @@
import type { RenderGroup } from '../RenderGroup';
export declare function collectRenderGroups(renderGroup: RenderGroup, out?: RenderGroup[]): RenderGroup[];

View File

@@ -0,0 +1,13 @@
'use strict';
"use strict";
function collectRenderGroups(renderGroup, out = []) {
out.push(renderGroup);
for (let i = 0; i < renderGroup.renderGroupChildren.length; i++) {
collectRenderGroups(renderGroup.renderGroupChildren[i], out);
}
return out;
}
exports.collectRenderGroups = collectRenderGroups;
//# sourceMappingURL=collectRenderGroups.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"collectRenderGroups.js","sources":["../../../../src/scene/container/utils/collectRenderGroups.ts"],"sourcesContent":["import type { RenderGroup } from '../RenderGroup';\n\nexport function collectRenderGroups(renderGroup: RenderGroup, out: RenderGroup[] = [])\n{\n out.push(renderGroup);\n\n for (let i = 0; i < renderGroup.renderGroupChildren.length; i++)\n {\n collectRenderGroups(renderGroup.renderGroupChildren[i], out);\n }\n\n return out;\n}\n"],"names":[],"mappings":";;;AAEO,SAAS,mBAAoB,CAAA,WAAA,EAA0B,GAAqB,GAAA,EACnF,EAAA;AACI,EAAA,GAAA,CAAI,KAAK,WAAW,CAAA,CAAA;AAEpB,EAAA,KAAA,IAAS,IAAI,CAAG,EAAA,CAAA,GAAI,WAAY,CAAA,mBAAA,CAAoB,QAAQ,CAC5D,EAAA,EAAA;AACI,IAAA,mBAAA,CAAoB,WAAY,CAAA,mBAAA,CAAoB,CAAC,CAAA,EAAG,GAAG,CAAA,CAAA;AAAA,GAC/D;AAEA,EAAO,OAAA,GAAA,CAAA;AACX;;;;"}

View File

@@ -0,0 +1,11 @@
"use strict";
function collectRenderGroups(renderGroup, out = []) {
out.push(renderGroup);
for (let i = 0; i < renderGroup.renderGroupChildren.length; i++) {
collectRenderGroups(renderGroup.renderGroupChildren[i], out);
}
return out;
}
export { collectRenderGroups };
//# sourceMappingURL=collectRenderGroups.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"collectRenderGroups.mjs","sources":["../../../../src/scene/container/utils/collectRenderGroups.ts"],"sourcesContent":["import type { RenderGroup } from '../RenderGroup';\n\nexport function collectRenderGroups(renderGroup: RenderGroup, out: RenderGroup[] = [])\n{\n out.push(renderGroup);\n\n for (let i = 0; i < renderGroup.renderGroupChildren.length; i++)\n {\n collectRenderGroups(renderGroup.renderGroupChildren[i], out);\n }\n\n return out;\n}\n"],"names":[],"mappings":";AAEO,SAAS,mBAAoB,CAAA,WAAA,EAA0B,GAAqB,GAAA,EACnF,EAAA;AACI,EAAA,GAAA,CAAI,KAAK,WAAW,CAAA,CAAA;AAEpB,EAAA,KAAA,IAAS,IAAI,CAAG,EAAA,CAAA,GAAI,WAAY,CAAA,mBAAA,CAAoB,QAAQ,CAC5D,EAAA,EAAA;AACI,IAAA,mBAAA,CAAoB,WAAY,CAAA,mBAAA,CAAoB,CAAC,CAAA,EAAG,GAAG,CAAA,CAAA;AAAA,GAC/D;AAEA,EAAO,OAAA,GAAA,CAAA;AACX;;;;"}

View File

@@ -0,0 +1,9 @@
/**
* Returns a new object with all properties from the input object that have defined values.
* @template T - The type of the input object.
* @param {T} obj - The input object.
* @returns {T} - A new object with only the defined properties from the input object.
* @memberof utils
* @ignore
*/
export declare function definedProps<T extends Record<string, any>>(obj: T): T;

View File

@@ -0,0 +1,15 @@
'use strict';
"use strict";
function definedProps(obj) {
const result = {};
for (const key in obj) {
if (obj[key] !== void 0) {
result[key] = obj[key];
}
}
return result;
}
exports.definedProps = definedProps;
//# sourceMappingURL=definedProps.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"definedProps.js","sources":["../../../../src/scene/container/utils/definedProps.ts"],"sourcesContent":["/**\n * Returns a new object with all properties from the input object that have defined values.\n * @template T - The type of the input object.\n * @param {T} obj - The input object.\n * @returns {T} - A new object with only the defined properties from the input object.\n * @memberof utils\n * @ignore\n */\nexport function definedProps<T extends Record<string, any>>(obj: T): T\n{\n const result: Partial<T> = {};\n\n for (const key in obj)\n {\n if (obj[key] !== undefined)\n {\n result[key] = obj[key];\n }\n }\n\n return result as T;\n}\n"],"names":[],"mappings":";;;AAQO,SAAS,aAA4C,GAC5D,EAAA;AACI,EAAA,MAAM,SAAqB,EAAC,CAAA;AAE5B,EAAA,KAAA,MAAW,OAAO,GAClB,EAAA;AACI,IAAI,IAAA,GAAA,CAAI,GAAG,CAAA,KAAM,KACjB,CAAA,EAAA;AACI,MAAO,MAAA,CAAA,GAAG,CAAI,GAAA,GAAA,CAAI,GAAG,CAAA,CAAA;AAAA,KACzB;AAAA,GACJ;AAEA,EAAO,OAAA,MAAA,CAAA;AACX;;;;"}

View File

@@ -0,0 +1,13 @@
"use strict";
function definedProps(obj) {
const result = {};
for (const key in obj) {
if (obj[key] !== void 0) {
result[key] = obj[key];
}
}
return result;
}
export { definedProps };
//# sourceMappingURL=definedProps.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"definedProps.mjs","sources":["../../../../src/scene/container/utils/definedProps.ts"],"sourcesContent":["/**\n * Returns a new object with all properties from the input object that have defined values.\n * @template T - The type of the input object.\n * @param {T} obj - The input object.\n * @returns {T} - A new object with only the defined properties from the input object.\n * @memberof utils\n * @ignore\n */\nexport function definedProps<T extends Record<string, any>>(obj: T): T\n{\n const result: Partial<T> = {};\n\n for (const key in obj)\n {\n if (obj[key] !== undefined)\n {\n result[key] = obj[key];\n }\n }\n\n return result as T;\n}\n"],"names":[],"mappings":";AAQO,SAAS,aAA4C,GAC5D,EAAA;AACI,EAAA,MAAM,SAAqB,EAAC,CAAA;AAE5B,EAAA,KAAA,MAAW,OAAO,GAClB,EAAA;AACI,IAAI,IAAA,GAAA,CAAI,GAAG,CAAA,KAAM,KACjB,CAAA,EAAA;AACI,MAAO,MAAA,CAAA,GAAG,CAAI,GAAA,GAAA,CAAI,GAAG,CAAA,CAAA;AAAA,KACzB;AAAA,GACJ;AAEA,EAAO,OAAA,MAAA,CAAA;AACX;;;;"}

View File

@@ -0,0 +1,3 @@
import type { RenderPipes } from '../../../rendering/renderers/types';
import type { RenderGroup } from '../RenderGroup';
export declare function executeInstructions(renderGroup: RenderGroup, renderer: RenderPipes): void;

View File

@@ -0,0 +1,14 @@
'use strict';
"use strict";
function executeInstructions(renderGroup, renderer) {
const instructionSet = renderGroup.instructionSet;
const instructions = instructionSet.instructions;
for (let i = 0; i < instructionSet.instructionSize; i++) {
const instruction = instructions[i];
renderer[instruction.renderPipeId].execute(instruction);
}
}
exports.executeInstructions = executeInstructions;
//# sourceMappingURL=executeInstructions.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"executeInstructions.js","sources":["../../../../src/scene/container/utils/executeInstructions.ts"],"sourcesContent":["import type { InstructionPipe } from '../../../rendering/renderers/shared/instructions/RenderPipe';\nimport type { RenderPipes } from '../../../rendering/renderers/types';\nimport type { RenderGroup } from '../RenderGroup';\n\nexport function executeInstructions(renderGroup: RenderGroup, renderer: RenderPipes)\n{\n const instructionSet = renderGroup.instructionSet;\n const instructions = instructionSet.instructions;\n\n for (let i = 0; i < instructionSet.instructionSize; i++)\n {\n const instruction = instructions[i];\n\n (renderer[instruction.renderPipeId as keyof RenderPipes] as InstructionPipe<any>).execute(instruction);\n }\n}\n"],"names":[],"mappings":";;;AAIgB,SAAA,mBAAA,CAAoB,aAA0B,QAC9D,EAAA;AACI,EAAA,MAAM,iBAAiB,WAAY,CAAA,cAAA,CAAA;AACnC,EAAA,MAAM,eAAe,cAAe,CAAA,YAAA,CAAA;AAEpC,EAAA,KAAA,IAAS,CAAI,GAAA,CAAA,EAAG,CAAI,GAAA,cAAA,CAAe,iBAAiB,CACpD,EAAA,EAAA;AACI,IAAM,MAAA,WAAA,GAAc,aAAa,CAAC,CAAA,CAAA;AAElC,IAAC,QAAS,CAAA,WAAA,CAAY,YAAiC,CAAA,CAA2B,QAAQ,WAAW,CAAA,CAAA;AAAA,GACzG;AACJ;;;;"}

View File

@@ -0,0 +1,12 @@
"use strict";
function executeInstructions(renderGroup, renderer) {
const instructionSet = renderGroup.instructionSet;
const instructions = instructionSet.instructions;
for (let i = 0; i < instructionSet.instructionSize; i++) {
const instruction = instructions[i];
renderer[instruction.renderPipeId].execute(instruction);
}
}
export { executeInstructions };
//# sourceMappingURL=executeInstructions.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"executeInstructions.mjs","sources":["../../../../src/scene/container/utils/executeInstructions.ts"],"sourcesContent":["import type { InstructionPipe } from '../../../rendering/renderers/shared/instructions/RenderPipe';\nimport type { RenderPipes } from '../../../rendering/renderers/types';\nimport type { RenderGroup } from '../RenderGroup';\n\nexport function executeInstructions(renderGroup: RenderGroup, renderer: RenderPipes)\n{\n const instructionSet = renderGroup.instructionSet;\n const instructions = instructionSet.instructions;\n\n for (let i = 0; i < instructionSet.instructionSize; i++)\n {\n const instruction = instructions[i];\n\n (renderer[instruction.renderPipeId as keyof RenderPipes] as InstructionPipe<any>).execute(instruction);\n }\n}\n"],"names":[],"mappings":";AAIgB,SAAA,mBAAA,CAAoB,aAA0B,QAC9D,EAAA;AACI,EAAA,MAAM,iBAAiB,WAAY,CAAA,cAAA,CAAA;AACnC,EAAA,MAAM,eAAe,cAAe,CAAA,YAAA,CAAA;AAEpC,EAAA,KAAA,IAAS,CAAI,GAAA,CAAA,EAAG,CAAI,GAAA,cAAA,CAAe,iBAAiB,CACpD,EAAA,EAAA;AACI,IAAM,MAAA,WAAA,GAAc,aAAa,CAAC,CAAA,CAAA;AAElC,IAAC,QAAS,CAAA,WAAA,CAAY,YAAiC,CAAA,CAA2B,QAAQ,WAAW,CAAA,CAAA;AAAA,GACzG;AACJ;;;;"}

View File

@@ -0,0 +1,2 @@
export declare function mixColors(localBGRColor: number, parentBGRColor: number): number;
export declare function mixStandardAnd32BitColors(localColorRGB: number, localAlpha: number, parentColor: number): number;

View File

@@ -0,0 +1,29 @@
'use strict';
var mixHexColors = require('./mixHexColors.js');
"use strict";
const WHITE_BGR = 16777215;
function mixColors(localBGRColor, parentBGRColor) {
if (localBGRColor === WHITE_BGR || parentBGRColor === WHITE_BGR) {
return localBGRColor + parentBGRColor - WHITE_BGR;
}
return mixHexColors.mixHexColors(localBGRColor, parentBGRColor, 0.5);
}
function mixStandardAnd32BitColors(localColorRGB, localAlpha, parentColor) {
const parentAlpha = (parentColor >> 24 & 255) / 255;
const globalAlpha = localAlpha * parentAlpha * 255;
const localBGRColor = ((localColorRGB & 255) << 16) + (localColorRGB & 65280) + (localColorRGB >> 16 & 255);
const parentBGRColor = parentColor & 16777215;
let sharedBGRColor;
if (localBGRColor === WHITE_BGR || parentBGRColor === WHITE_BGR) {
sharedBGRColor = localBGRColor + parentBGRColor - WHITE_BGR;
} else {
sharedBGRColor = mixHexColors.mixHexColors(localBGRColor, parentBGRColor, 0.5);
}
return sharedBGRColor + (globalAlpha << 24);
}
exports.mixColors = mixColors;
exports.mixStandardAnd32BitColors = mixStandardAnd32BitColors;
//# sourceMappingURL=mixColors.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"mixColors.js","sources":["../../../../src/scene/container/utils/mixColors.ts"],"sourcesContent":["import { mixHexColors } from './mixHexColors';\n\nconst WHITE_BGR = 0xFFFFFF;\n\nexport function mixColors(localBGRColor: number, parentBGRColor: number)\n{\n if (localBGRColor === WHITE_BGR || parentBGRColor === WHITE_BGR)\n {\n return localBGRColor + parentBGRColor - WHITE_BGR;\n }\n\n return mixHexColors(localBGRColor, parentBGRColor, 0.5);\n}\n\nexport function mixStandardAnd32BitColors(localColorRGB: number, localAlpha: number, parentColor: number)\n{\n const parentAlpha = ((parentColor >> 24) & 0xFF) / 255;\n\n const globalAlpha = ((localAlpha * parentAlpha) * 255);\n\n // flip rgb to bgr\n const localBGRColor = ((localColorRGB & 0xFF) << 16) + (localColorRGB & 0xFF00) + ((localColorRGB >> 16) & 0xFF);\n\n const parentBGRColor = parentColor & 0x00FFFFFF;\n\n let sharedBGRColor: number;\n\n if (localBGRColor === WHITE_BGR || parentBGRColor === WHITE_BGR)\n {\n sharedBGRColor = localBGRColor + parentBGRColor - WHITE_BGR;\n }\n else\n {\n sharedBGRColor = mixHexColors(localBGRColor, parentBGRColor, 0.5);\n }\n\n return sharedBGRColor + (globalAlpha << 24);\n}\n"],"names":["mixHexColors"],"mappings":";;;;;AAEA,MAAM,SAAY,GAAA,QAAA,CAAA;AAEF,SAAA,SAAA,CAAU,eAAuB,cACjD,EAAA;AACI,EAAI,IAAA,aAAA,KAAkB,SAAa,IAAA,cAAA,KAAmB,SACtD,EAAA;AACI,IAAA,OAAO,gBAAgB,cAAiB,GAAA,SAAA,CAAA;AAAA,GAC5C;AAEA,EAAO,OAAAA,yBAAA,CAAa,aAAe,EAAA,cAAA,EAAgB,GAAG,CAAA,CAAA;AAC1D,CAAA;AAEgB,SAAA,yBAAA,CAA0B,aAAuB,EAAA,UAAA,EAAoB,WACrF,EAAA;AACI,EAAM,MAAA,WAAA,GAAA,CAAgB,WAAe,IAAA,EAAA,GAAM,GAAQ,IAAA,GAAA,CAAA;AAEnD,EAAM,MAAA,WAAA,GAAgB,aAAa,WAAe,GAAA,GAAA,CAAA;AAGlD,EAAA,MAAM,kBAAkB,aAAgB,GAAA,GAAA,KAAS,OAAO,aAAgB,GAAA,KAAA,CAAA,IAAY,iBAAiB,EAAM,GAAA,GAAA,CAAA,CAAA;AAE3G,EAAA,MAAM,iBAAiB,WAAc,GAAA,QAAA,CAAA;AAErC,EAAI,IAAA,cAAA,CAAA;AAEJ,EAAI,IAAA,aAAA,KAAkB,SAAa,IAAA,cAAA,KAAmB,SACtD,EAAA;AACI,IAAA,cAAA,GAAiB,gBAAgB,cAAiB,GAAA,SAAA,CAAA;AAAA,GAGtD,MAAA;AACI,IAAiB,cAAA,GAAAA,yBAAA,CAAa,aAAe,EAAA,cAAA,EAAgB,GAAG,CAAA,CAAA;AAAA,GACpE;AAEA,EAAA,OAAO,kBAAkB,WAAe,IAAA,EAAA,CAAA,CAAA;AAC5C;;;;;"}

View File

@@ -0,0 +1,26 @@
import { mixHexColors } from './mixHexColors.mjs';
"use strict";
const WHITE_BGR = 16777215;
function mixColors(localBGRColor, parentBGRColor) {
if (localBGRColor === WHITE_BGR || parentBGRColor === WHITE_BGR) {
return localBGRColor + parentBGRColor - WHITE_BGR;
}
return mixHexColors(localBGRColor, parentBGRColor, 0.5);
}
function mixStandardAnd32BitColors(localColorRGB, localAlpha, parentColor) {
const parentAlpha = (parentColor >> 24 & 255) / 255;
const globalAlpha = localAlpha * parentAlpha * 255;
const localBGRColor = ((localColorRGB & 255) << 16) + (localColorRGB & 65280) + (localColorRGB >> 16 & 255);
const parentBGRColor = parentColor & 16777215;
let sharedBGRColor;
if (localBGRColor === WHITE_BGR || parentBGRColor === WHITE_BGR) {
sharedBGRColor = localBGRColor + parentBGRColor - WHITE_BGR;
} else {
sharedBGRColor = mixHexColors(localBGRColor, parentBGRColor, 0.5);
}
return sharedBGRColor + (globalAlpha << 24);
}
export { mixColors, mixStandardAnd32BitColors };
//# sourceMappingURL=mixColors.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"mixColors.mjs","sources":["../../../../src/scene/container/utils/mixColors.ts"],"sourcesContent":["import { mixHexColors } from './mixHexColors';\n\nconst WHITE_BGR = 0xFFFFFF;\n\nexport function mixColors(localBGRColor: number, parentBGRColor: number)\n{\n if (localBGRColor === WHITE_BGR || parentBGRColor === WHITE_BGR)\n {\n return localBGRColor + parentBGRColor - WHITE_BGR;\n }\n\n return mixHexColors(localBGRColor, parentBGRColor, 0.5);\n}\n\nexport function mixStandardAnd32BitColors(localColorRGB: number, localAlpha: number, parentColor: number)\n{\n const parentAlpha = ((parentColor >> 24) & 0xFF) / 255;\n\n const globalAlpha = ((localAlpha * parentAlpha) * 255);\n\n // flip rgb to bgr\n const localBGRColor = ((localColorRGB & 0xFF) << 16) + (localColorRGB & 0xFF00) + ((localColorRGB >> 16) & 0xFF);\n\n const parentBGRColor = parentColor & 0x00FFFFFF;\n\n let sharedBGRColor: number;\n\n if (localBGRColor === WHITE_BGR || parentBGRColor === WHITE_BGR)\n {\n sharedBGRColor = localBGRColor + parentBGRColor - WHITE_BGR;\n }\n else\n {\n sharedBGRColor = mixHexColors(localBGRColor, parentBGRColor, 0.5);\n }\n\n return sharedBGRColor + (globalAlpha << 24);\n}\n"],"names":[],"mappings":";;;AAEA,MAAM,SAAY,GAAA,QAAA,CAAA;AAEF,SAAA,SAAA,CAAU,eAAuB,cACjD,EAAA;AACI,EAAI,IAAA,aAAA,KAAkB,SAAa,IAAA,cAAA,KAAmB,SACtD,EAAA;AACI,IAAA,OAAO,gBAAgB,cAAiB,GAAA,SAAA,CAAA;AAAA,GAC5C;AAEA,EAAO,OAAA,YAAA,CAAa,aAAe,EAAA,cAAA,EAAgB,GAAG,CAAA,CAAA;AAC1D,CAAA;AAEgB,SAAA,yBAAA,CAA0B,aAAuB,EAAA,UAAA,EAAoB,WACrF,EAAA;AACI,EAAM,MAAA,WAAA,GAAA,CAAgB,WAAe,IAAA,EAAA,GAAM,GAAQ,IAAA,GAAA,CAAA;AAEnD,EAAM,MAAA,WAAA,GAAgB,aAAa,WAAe,GAAA,GAAA,CAAA;AAGlD,EAAA,MAAM,kBAAkB,aAAgB,GAAA,GAAA,KAAS,OAAO,aAAgB,GAAA,KAAA,CAAA,IAAY,iBAAiB,EAAM,GAAA,GAAA,CAAA,CAAA;AAE3G,EAAA,MAAM,iBAAiB,WAAc,GAAA,QAAA,CAAA;AAErC,EAAI,IAAA,cAAA,CAAA;AAEJ,EAAI,IAAA,aAAA,KAAkB,SAAa,IAAA,cAAA,KAAmB,SACtD,EAAA;AACI,IAAA,cAAA,GAAiB,gBAAgB,cAAiB,GAAA,SAAA,CAAA;AAAA,GAGtD,MAAA;AACI,IAAiB,cAAA,GAAA,YAAA,CAAa,aAAe,EAAA,cAAA,EAAgB,GAAG,CAAA,CAAA;AAAA,GACpE;AAEA,EAAA,OAAO,kBAAkB,WAAe,IAAA,EAAA,CAAA,CAAA;AAC5C;;;;"}

View File

@@ -0,0 +1 @@
export declare function mixHexColors(color1: number, color2: number, ratio: number): number;

View File

@@ -0,0 +1,18 @@
'use strict';
"use strict";
function mixHexColors(color1, color2, ratio) {
const r1 = color1 >> 16 & 255;
const g1 = color1 >> 8 & 255;
const b1 = color1 & 255;
const r2 = color2 >> 16 & 255;
const g2 = color2 >> 8 & 255;
const b2 = color2 & 255;
const r = r1 + (r2 - r1) * ratio;
const g = g1 + (g2 - g1) * ratio;
const b = b1 + (b2 - b1) * ratio;
return (r << 16) + (g << 8) + b;
}
exports.mixHexColors = mixHexColors;
//# sourceMappingURL=mixHexColors.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"mixHexColors.js","sources":["../../../../src/scene/container/utils/mixHexColors.ts"],"sourcesContent":["export function mixHexColors(color1: number, color2: number, ratio: number): number\n{\n const r1 = (color1 >> 16) & 0xFF;\n const g1 = (color1 >> 8) & 0xFF;\n const b1 = color1 & 0xFF;\n\n const r2 = (color2 >> 16) & 0xFF;\n const g2 = (color2 >> 8) & 0xFF;\n const b2 = color2 & 0xFF;\n\n const r = r1 + ((r2 - r1) * ratio);\n const g = g1 + ((g2 - g1) * ratio);\n const b = b1 + ((b2 - b1) * ratio);\n\n return (r << 16) + (g << 8) + b;\n}\n\n"],"names":[],"mappings":";;;AAAgB,SAAA,YAAA,CAAa,MAAgB,EAAA,MAAA,EAAgB,KAC7D,EAAA;AACI,EAAM,MAAA,EAAA,GAAM,UAAU,EAAM,GAAA,GAAA,CAAA;AAC5B,EAAM,MAAA,EAAA,GAAM,UAAU,CAAK,GAAA,GAAA,CAAA;AAC3B,EAAA,MAAM,KAAK,MAAS,GAAA,GAAA,CAAA;AAEpB,EAAM,MAAA,EAAA,GAAM,UAAU,EAAM,GAAA,GAAA,CAAA;AAC5B,EAAM,MAAA,EAAA,GAAM,UAAU,CAAK,GAAA,GAAA,CAAA;AAC3B,EAAA,MAAM,KAAK,MAAS,GAAA,GAAA,CAAA;AAEpB,EAAM,MAAA,CAAA,GAAI,EAAO,GAAA,CAAA,EAAA,GAAK,EAAM,IAAA,KAAA,CAAA;AAC5B,EAAM,MAAA,CAAA,GAAI,EAAO,GAAA,CAAA,EAAA,GAAK,EAAM,IAAA,KAAA,CAAA;AAC5B,EAAM,MAAA,CAAA,GAAI,EAAO,GAAA,CAAA,EAAA,GAAK,EAAM,IAAA,KAAA,CAAA;AAE5B,EAAQ,OAAA,CAAA,CAAA,IAAK,EAAO,KAAA,CAAA,IAAK,CAAK,CAAA,GAAA,CAAA,CAAA;AAClC;;;;"}

View File

@@ -0,0 +1,16 @@
"use strict";
function mixHexColors(color1, color2, ratio) {
const r1 = color1 >> 16 & 255;
const g1 = color1 >> 8 & 255;
const b1 = color1 & 255;
const r2 = color2 >> 16 & 255;
const g2 = color2 >> 8 & 255;
const b2 = color2 & 255;
const r = r1 + (r2 - r1) * ratio;
const g = g1 + (g2 - g1) * ratio;
const b = b1 + (b2 - b1) * ratio;
return (r << 16) + (g << 8) + b;
}
export { mixHexColors };
//# sourceMappingURL=mixHexColors.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"mixHexColors.mjs","sources":["../../../../src/scene/container/utils/mixHexColors.ts"],"sourcesContent":["export function mixHexColors(color1: number, color2: number, ratio: number): number\n{\n const r1 = (color1 >> 16) & 0xFF;\n const g1 = (color1 >> 8) & 0xFF;\n const b1 = color1 & 0xFF;\n\n const r2 = (color2 >> 16) & 0xFF;\n const g2 = (color2 >> 8) & 0xFF;\n const b2 = color2 & 0xFF;\n\n const r = r1 + ((r2 - r1) * ratio);\n const g = g1 + ((g2 - g1) * ratio);\n const b = b1 + ((b2 - b1) * ratio);\n\n return (r << 16) + (g << 8) + b;\n}\n\n"],"names":[],"mappings":";AAAgB,SAAA,YAAA,CAAa,MAAgB,EAAA,MAAA,EAAgB,KAC7D,EAAA;AACI,EAAM,MAAA,EAAA,GAAM,UAAU,EAAM,GAAA,GAAA,CAAA;AAC5B,EAAM,MAAA,EAAA,GAAM,UAAU,CAAK,GAAA,GAAA,CAAA;AAC3B,EAAA,MAAM,KAAK,MAAS,GAAA,GAAA,CAAA;AAEpB,EAAM,MAAA,EAAA,GAAM,UAAU,EAAM,GAAA,GAAA,CAAA;AAC5B,EAAM,MAAA,EAAA,GAAM,UAAU,CAAK,GAAA,GAAA,CAAA;AAC3B,EAAA,MAAM,KAAK,MAAS,GAAA,GAAA,CAAA;AAEpB,EAAM,MAAA,CAAA,GAAI,EAAO,GAAA,CAAA,EAAA,GAAK,EAAM,IAAA,KAAA,CAAA;AAC5B,EAAM,MAAA,CAAA,GAAI,EAAO,GAAA,CAAA,EAAA,GAAK,EAAM,IAAA,KAAA,CAAA;AAC5B,EAAM,MAAA,CAAA,GAAI,EAAO,GAAA,CAAA,EAAA,GAAK,EAAM,IAAA,KAAA,CAAA;AAE5B,EAAQ,OAAA,CAAA,CAAA,IAAK,EAAO,KAAA,CAAA,IAAK,CAAK,CAAA,GAAA,CAAA,CAAA;AAClC;;;;"}

View File

@@ -0,0 +1 @@
export declare function multiplyHexColors(color1: number, color2: number): number;

View File

@@ -0,0 +1,22 @@
'use strict';
"use strict";
function multiplyHexColors(color1, color2) {
if (color1 === 16777215 || !color2)
return color2;
if (color2 === 16777215 || !color1)
return color1;
const r1 = color1 >> 16 & 255;
const g1 = color1 >> 8 & 255;
const b1 = color1 & 255;
const r2 = color2 >> 16 & 255;
const g2 = color2 >> 8 & 255;
const b2 = color2 & 255;
const r = r1 * r2 / 255;
const g = g1 * g2 / 255;
const b = b1 * b2 / 255;
return (r << 16) + (g << 8) + b;
}
exports.multiplyHexColors = multiplyHexColors;
//# sourceMappingURL=multiplyHexColors.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"multiplyHexColors.js","sources":["../../../../src/scene/container/utils/multiplyHexColors.ts"],"sourcesContent":["export function multiplyHexColors(color1: number, color2: number): number\n{\n if (color1 === 0xFFFFFF || !color2) return color2;\n if (color2 === 0xFFFFFF || !color1) return color1;\n\n const r1 = (color1 >> 16) & 0xFF;\n const g1 = (color1 >> 8) & 0xFF;\n const b1 = color1 & 0xFF;\n\n const r2 = (color2 >> 16) & 0xFF;\n const g2 = (color2 >> 8) & 0xFF;\n const b2 = color2 & 0xFF;\n\n const r = (r1 * r2) / 255;\n const g = (g1 * g2) / 255;\n const b = (b1 * b2) / 255;\n\n return (r << 16) + (g << 8) + b;\n}\n"],"names":[],"mappings":";;;AAAgB,SAAA,iBAAA,CAAkB,QAAgB,MAClD,EAAA;AACI,EAAI,IAAA,MAAA,KAAW,YAAY,CAAC,MAAA;AAAQ,IAAO,OAAA,MAAA,CAAA;AAC3C,EAAI,IAAA,MAAA,KAAW,YAAY,CAAC,MAAA;AAAQ,IAAO,OAAA,MAAA,CAAA;AAE3C,EAAM,MAAA,EAAA,GAAM,UAAU,EAAM,GAAA,GAAA,CAAA;AAC5B,EAAM,MAAA,EAAA,GAAM,UAAU,CAAK,GAAA,GAAA,CAAA;AAC3B,EAAA,MAAM,KAAK,MAAS,GAAA,GAAA,CAAA;AAEpB,EAAM,MAAA,EAAA,GAAM,UAAU,EAAM,GAAA,GAAA,CAAA;AAC5B,EAAM,MAAA,EAAA,GAAM,UAAU,CAAK,GAAA,GAAA,CAAA;AAC3B,EAAA,MAAM,KAAK,MAAS,GAAA,GAAA,CAAA;AAEpB,EAAM,MAAA,CAAA,GAAK,KAAK,EAAM,GAAA,GAAA,CAAA;AACtB,EAAM,MAAA,CAAA,GAAK,KAAK,EAAM,GAAA,GAAA,CAAA;AACtB,EAAM,MAAA,CAAA,GAAK,KAAK,EAAM,GAAA,GAAA,CAAA;AAEtB,EAAQ,OAAA,CAAA,CAAA,IAAK,EAAO,KAAA,CAAA,IAAK,CAAK,CAAA,GAAA,CAAA,CAAA;AAClC;;;;"}

View File

@@ -0,0 +1,20 @@
"use strict";
function multiplyHexColors(color1, color2) {
if (color1 === 16777215 || !color2)
return color2;
if (color2 === 16777215 || !color1)
return color1;
const r1 = color1 >> 16 & 255;
const g1 = color1 >> 8 & 255;
const b1 = color1 & 255;
const r2 = color2 >> 16 & 255;
const g2 = color2 >> 8 & 255;
const b2 = color2 & 255;
const r = r1 * r2 / 255;
const g = g1 * g2 / 255;
const b = b1 * b2 / 255;
return (r << 16) + (g << 8) + b;
}
export { multiplyHexColors };
//# sourceMappingURL=multiplyHexColors.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"multiplyHexColors.mjs","sources":["../../../../src/scene/container/utils/multiplyHexColors.ts"],"sourcesContent":["export function multiplyHexColors(color1: number, color2: number): number\n{\n if (color1 === 0xFFFFFF || !color2) return color2;\n if (color2 === 0xFFFFFF || !color1) return color1;\n\n const r1 = (color1 >> 16) & 0xFF;\n const g1 = (color1 >> 8) & 0xFF;\n const b1 = color1 & 0xFF;\n\n const r2 = (color2 >> 16) & 0xFF;\n const g2 = (color2 >> 8) & 0xFF;\n const b2 = color2 & 0xFF;\n\n const r = (r1 * r2) / 255;\n const g = (g1 * g2) / 255;\n const b = (b1 * b2) / 255;\n\n return (r << 16) + (g << 8) + b;\n}\n"],"names":[],"mappings":";AAAgB,SAAA,iBAAA,CAAkB,QAAgB,MAClD,EAAA;AACI,EAAI,IAAA,MAAA,KAAW,YAAY,CAAC,MAAA;AAAQ,IAAO,OAAA,MAAA,CAAA;AAC3C,EAAI,IAAA,MAAA,KAAW,YAAY,CAAC,MAAA;AAAQ,IAAO,OAAA,MAAA,CAAA;AAE3C,EAAM,MAAA,EAAA,GAAM,UAAU,EAAM,GAAA,GAAA,CAAA;AAC5B,EAAM,MAAA,EAAA,GAAM,UAAU,CAAK,GAAA,GAAA,CAAA;AAC3B,EAAA,MAAM,KAAK,MAAS,GAAA,GAAA,CAAA;AAEpB,EAAM,MAAA,EAAA,GAAM,UAAU,EAAM,GAAA,GAAA,CAAA;AAC5B,EAAM,MAAA,EAAA,GAAM,UAAU,CAAK,GAAA,GAAA,CAAA;AAC3B,EAAA,MAAM,KAAK,MAAS,GAAA,GAAA,CAAA;AAEpB,EAAM,MAAA,CAAA,GAAK,KAAK,EAAM,GAAA,GAAA,CAAA;AACtB,EAAM,MAAA,CAAA,GAAK,KAAK,EAAM,GAAA,GAAA,CAAA;AACtB,EAAM,MAAA,CAAA,GAAK,KAAK,EAAM,GAAA,GAAA,CAAA;AAEtB,EAAQ,OAAA,CAAA,CAAA,IAAK,EAAO,KAAA,CAAA,IAAK,CAAK,CAAA,GAAA,CAAA,CAAA;AAClC;;;;"}

View File

@@ -0,0 +1,3 @@
import type { Matrix } from '../../../maths/matrix/Matrix';
import type { Container } from '../Container';
export declare function updateLocalTransform(lt: Matrix, container: Container): void;

View File

@@ -0,0 +1,21 @@
'use strict';
"use strict";
function updateLocalTransform(lt, container) {
const scale = container._scale;
const pivot = container._pivot;
const position = container._position;
const sx = scale._x;
const sy = scale._y;
const px = pivot._x;
const py = pivot._y;
lt.a = container._cx * sx;
lt.b = container._sx * sx;
lt.c = container._cy * sy;
lt.d = container._sy * sy;
lt.tx = position._x - (px * lt.a + py * lt.c);
lt.ty = position._y - (px * lt.b + py * lt.d);
}
exports.updateLocalTransform = updateLocalTransform;
//# sourceMappingURL=updateLocalTransform.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"updateLocalTransform.js","sources":["../../../../src/scene/container/utils/updateLocalTransform.ts"],"sourcesContent":["import type { Matrix } from '../../../maths/matrix/Matrix';\nimport type { Container } from '../Container';\n\nexport function updateLocalTransform(lt: Matrix, container: Container): void\n{\n const scale = container._scale;\n const pivot = container._pivot;\n const position = container._position;\n\n const sx = scale._x;\n const sy = scale._y;\n\n const px = pivot._x;\n const py = pivot._y;\n\n // get the matrix values of the container based on its this properties..\n lt.a = container._cx * sx;\n lt.b = container._sx * sx;\n lt.c = container._cy * sy;\n lt.d = container._sy * sy;\n\n lt.tx = position._x - ((px * lt.a) + (py * lt.c));\n lt.ty = position._y - ((px * lt.b) + (py * lt.d));\n}\n"],"names":[],"mappings":";;;AAGgB,SAAA,oBAAA,CAAqB,IAAY,SACjD,EAAA;AACI,EAAA,MAAM,QAAQ,SAAU,CAAA,MAAA,CAAA;AACxB,EAAA,MAAM,QAAQ,SAAU,CAAA,MAAA,CAAA;AACxB,EAAA,MAAM,WAAW,SAAU,CAAA,SAAA,CAAA;AAE3B,EAAA,MAAM,KAAK,KAAM,CAAA,EAAA,CAAA;AACjB,EAAA,MAAM,KAAK,KAAM,CAAA,EAAA,CAAA;AAEjB,EAAA,MAAM,KAAK,KAAM,CAAA,EAAA,CAAA;AACjB,EAAA,MAAM,KAAK,KAAM,CAAA,EAAA,CAAA;AAGjB,EAAG,EAAA,CAAA,CAAA,GAAI,UAAU,GAAM,GAAA,EAAA,CAAA;AACvB,EAAG,EAAA,CAAA,CAAA,GAAI,UAAU,GAAM,GAAA,EAAA,CAAA;AACvB,EAAG,EAAA,CAAA,CAAA,GAAI,UAAU,GAAM,GAAA,EAAA,CAAA;AACvB,EAAG,EAAA,CAAA,CAAA,GAAI,UAAU,GAAM,GAAA,EAAA,CAAA;AAEvB,EAAA,EAAA,CAAG,KAAK,QAAS,CAAA,EAAA,IAAO,KAAK,EAAG,CAAA,CAAA,GAAM,KAAK,EAAG,CAAA,CAAA,CAAA,CAAA;AAC9C,EAAA,EAAA,CAAG,KAAK,QAAS,CAAA,EAAA,IAAO,KAAK,EAAG,CAAA,CAAA,GAAM,KAAK,EAAG,CAAA,CAAA,CAAA,CAAA;AAClD;;;;"}

View File

@@ -0,0 +1,19 @@
"use strict";
function updateLocalTransform(lt, container) {
const scale = container._scale;
const pivot = container._pivot;
const position = container._position;
const sx = scale._x;
const sy = scale._y;
const px = pivot._x;
const py = pivot._y;
lt.a = container._cx * sx;
lt.b = container._sx * sx;
lt.c = container._cy * sy;
lt.d = container._sy * sy;
lt.tx = position._x - (px * lt.a + py * lt.c);
lt.ty = position._y - (px * lt.b + py * lt.d);
}
export { updateLocalTransform };
//# sourceMappingURL=updateLocalTransform.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"updateLocalTransform.mjs","sources":["../../../../src/scene/container/utils/updateLocalTransform.ts"],"sourcesContent":["import type { Matrix } from '../../../maths/matrix/Matrix';\nimport type { Container } from '../Container';\n\nexport function updateLocalTransform(lt: Matrix, container: Container): void\n{\n const scale = container._scale;\n const pivot = container._pivot;\n const position = container._position;\n\n const sx = scale._x;\n const sy = scale._y;\n\n const px = pivot._x;\n const py = pivot._y;\n\n // get the matrix values of the container based on its this properties..\n lt.a = container._cx * sx;\n lt.b = container._sx * sx;\n lt.c = container._cy * sy;\n lt.d = container._sy * sy;\n\n lt.tx = position._x - ((px * lt.a) + (py * lt.c));\n lt.ty = position._y - ((px * lt.b) + (py * lt.d));\n}\n"],"names":[],"mappings":";AAGgB,SAAA,oBAAA,CAAqB,IAAY,SACjD,EAAA;AACI,EAAA,MAAM,QAAQ,SAAU,CAAA,MAAA,CAAA;AACxB,EAAA,MAAM,QAAQ,SAAU,CAAA,MAAA,CAAA;AACxB,EAAA,MAAM,WAAW,SAAU,CAAA,SAAA,CAAA;AAE3B,EAAA,MAAM,KAAK,KAAM,CAAA,EAAA,CAAA;AACjB,EAAA,MAAM,KAAK,KAAM,CAAA,EAAA,CAAA;AAEjB,EAAA,MAAM,KAAK,KAAM,CAAA,EAAA,CAAA;AACjB,EAAA,MAAM,KAAK,KAAM,CAAA,EAAA,CAAA;AAGjB,EAAG,EAAA,CAAA,CAAA,GAAI,UAAU,GAAM,GAAA,EAAA,CAAA;AACvB,EAAG,EAAA,CAAA,CAAA,GAAI,UAAU,GAAM,GAAA,EAAA,CAAA;AACvB,EAAG,EAAA,CAAA,CAAA,GAAI,UAAU,GAAM,GAAA,EAAA,CAAA;AACvB,EAAG,EAAA,CAAA,CAAA,GAAI,UAAU,GAAM,GAAA,EAAA,CAAA;AAEvB,EAAA,EAAA,CAAG,KAAK,QAAS,CAAA,EAAA,IAAO,KAAK,EAAG,CAAA,CAAA,GAAM,KAAK,EAAG,CAAA,CAAA,CAAA,CAAA;AAC9C,EAAA,EAAA,CAAG,KAAK,QAAS,CAAA,EAAA,IAAO,KAAK,EAAG,CAAA,CAAA,GAAM,KAAK,EAAG,CAAA,CAAA,CAAA,CAAA;AAClD;;;;"}

View File

@@ -0,0 +1,5 @@
import { Container } from '../Container';
import type { RenderGroup } from '../RenderGroup';
export declare function updateRenderGroupTransforms(renderGroup: RenderGroup, updateChildRenderGroups?: boolean): void;
export declare function updateRenderGroupTransform(renderGroup: RenderGroup): void;
export declare function updateTransformAndChildren(container: Container, updateTick: number, updateFlags: number): void;

View File

@@ -0,0 +1,116 @@
'use strict';
var Container = require('../Container.js');
var clearList = require('./clearList.js');
var mixColors = require('./mixColors.js');
"use strict";
const tempContainer = new Container.Container();
const UPDATE_BLEND_COLOR_VISIBLE = Container.UPDATE_VISIBLE | Container.UPDATE_COLOR | Container.UPDATE_BLEND;
function updateRenderGroupTransforms(renderGroup, updateChildRenderGroups = false) {
updateRenderGroupTransform(renderGroup);
const childrenToUpdate = renderGroup.childrenToUpdate;
const updateTick = renderGroup.updateTick++;
for (const j in childrenToUpdate) {
const renderGroupDepth = Number(j);
const childrenAtDepth = childrenToUpdate[j];
const list = childrenAtDepth.list;
const index = childrenAtDepth.index;
for (let i = 0; i < index; i++) {
const child = list[i];
if (child.parentRenderGroup === renderGroup && child.relativeRenderGroupDepth === renderGroupDepth) {
updateTransformAndChildren(child, updateTick, 0);
}
}
clearList.clearList(list, index);
childrenAtDepth.index = 0;
}
if (updateChildRenderGroups) {
for (let i = 0; i < renderGroup.renderGroupChildren.length; i++) {
updateRenderGroupTransforms(renderGroup.renderGroupChildren[i], updateChildRenderGroups);
}
}
}
function updateRenderGroupTransform(renderGroup) {
const root = renderGroup.root;
let worldAlpha;
if (renderGroup.renderGroupParent) {
const renderGroupParent = renderGroup.renderGroupParent;
renderGroup.worldTransform.appendFrom(
root.relativeGroupTransform,
renderGroupParent.worldTransform
);
renderGroup.worldColor = mixColors.mixColors(
root.groupColor,
renderGroupParent.worldColor
);
worldAlpha = root.groupAlpha * renderGroupParent.worldAlpha;
} else {
renderGroup.worldTransform.copyFrom(root.localTransform);
renderGroup.worldColor = root.localColor;
worldAlpha = root.localAlpha;
}
worldAlpha = worldAlpha < 0 ? 0 : worldAlpha > 1 ? 1 : worldAlpha;
renderGroup.worldAlpha = worldAlpha;
renderGroup.worldColorAlpha = renderGroup.worldColor + ((worldAlpha * 255 | 0) << 24);
}
function updateTransformAndChildren(container, updateTick, updateFlags) {
if (updateTick === container.updateTick)
return;
container.updateTick = updateTick;
container.didChange = false;
const localTransform = container.localTransform;
container.updateLocalTransform();
const parent = container.parent;
if (parent && !parent.renderGroup) {
updateFlags = updateFlags | container._updateFlags;
container.relativeGroupTransform.appendFrom(
localTransform,
parent.relativeGroupTransform
);
if (updateFlags & UPDATE_BLEND_COLOR_VISIBLE) {
updateColorBlendVisibility(container, parent, updateFlags);
}
} else {
updateFlags = container._updateFlags;
container.relativeGroupTransform.copyFrom(localTransform);
if (updateFlags & UPDATE_BLEND_COLOR_VISIBLE) {
updateColorBlendVisibility(container, tempContainer, updateFlags);
}
}
if (!container.renderGroup) {
const children = container.children;
const length = children.length;
for (let i = 0; i < length; i++) {
updateTransformAndChildren(children[i], updateTick, updateFlags);
}
const renderGroup = container.parentRenderGroup;
if (container.renderPipeId && !renderGroup.structureDidChange) {
renderGroup.updateRenderable(container);
}
}
}
function updateColorBlendVisibility(container, parent, updateFlags) {
if (updateFlags & Container.UPDATE_COLOR) {
container.groupColor = mixColors.mixColors(
container.localColor,
parent.groupColor
);
let groupAlpha = container.localAlpha * parent.groupAlpha;
groupAlpha = groupAlpha < 0 ? 0 : groupAlpha > 1 ? 1 : groupAlpha;
container.groupAlpha = groupAlpha;
container.groupColorAlpha = container.groupColor + ((groupAlpha * 255 | 0) << 24);
}
if (updateFlags & Container.UPDATE_BLEND) {
container.groupBlendMode = container.localBlendMode === "inherit" ? parent.groupBlendMode : container.localBlendMode;
}
if (updateFlags & Container.UPDATE_VISIBLE) {
container.globalDisplayStatus = container.localDisplayStatus & parent.globalDisplayStatus;
}
container._updateFlags = 0;
}
exports.updateRenderGroupTransform = updateRenderGroupTransform;
exports.updateRenderGroupTransforms = updateRenderGroupTransforms;
exports.updateTransformAndChildren = updateTransformAndChildren;
//# sourceMappingURL=updateRenderGroupTransforms.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,112 @@
import { Container, UPDATE_VISIBLE, UPDATE_COLOR, UPDATE_BLEND } from '../Container.mjs';
import { clearList } from './clearList.mjs';
import { mixColors } from './mixColors.mjs';
"use strict";
const tempContainer = new Container();
const UPDATE_BLEND_COLOR_VISIBLE = UPDATE_VISIBLE | UPDATE_COLOR | UPDATE_BLEND;
function updateRenderGroupTransforms(renderGroup, updateChildRenderGroups = false) {
updateRenderGroupTransform(renderGroup);
const childrenToUpdate = renderGroup.childrenToUpdate;
const updateTick = renderGroup.updateTick++;
for (const j in childrenToUpdate) {
const renderGroupDepth = Number(j);
const childrenAtDepth = childrenToUpdate[j];
const list = childrenAtDepth.list;
const index = childrenAtDepth.index;
for (let i = 0; i < index; i++) {
const child = list[i];
if (child.parentRenderGroup === renderGroup && child.relativeRenderGroupDepth === renderGroupDepth) {
updateTransformAndChildren(child, updateTick, 0);
}
}
clearList(list, index);
childrenAtDepth.index = 0;
}
if (updateChildRenderGroups) {
for (let i = 0; i < renderGroup.renderGroupChildren.length; i++) {
updateRenderGroupTransforms(renderGroup.renderGroupChildren[i], updateChildRenderGroups);
}
}
}
function updateRenderGroupTransform(renderGroup) {
const root = renderGroup.root;
let worldAlpha;
if (renderGroup.renderGroupParent) {
const renderGroupParent = renderGroup.renderGroupParent;
renderGroup.worldTransform.appendFrom(
root.relativeGroupTransform,
renderGroupParent.worldTransform
);
renderGroup.worldColor = mixColors(
root.groupColor,
renderGroupParent.worldColor
);
worldAlpha = root.groupAlpha * renderGroupParent.worldAlpha;
} else {
renderGroup.worldTransform.copyFrom(root.localTransform);
renderGroup.worldColor = root.localColor;
worldAlpha = root.localAlpha;
}
worldAlpha = worldAlpha < 0 ? 0 : worldAlpha > 1 ? 1 : worldAlpha;
renderGroup.worldAlpha = worldAlpha;
renderGroup.worldColorAlpha = renderGroup.worldColor + ((worldAlpha * 255 | 0) << 24);
}
function updateTransformAndChildren(container, updateTick, updateFlags) {
if (updateTick === container.updateTick)
return;
container.updateTick = updateTick;
container.didChange = false;
const localTransform = container.localTransform;
container.updateLocalTransform();
const parent = container.parent;
if (parent && !parent.renderGroup) {
updateFlags = updateFlags | container._updateFlags;
container.relativeGroupTransform.appendFrom(
localTransform,
parent.relativeGroupTransform
);
if (updateFlags & UPDATE_BLEND_COLOR_VISIBLE) {
updateColorBlendVisibility(container, parent, updateFlags);
}
} else {
updateFlags = container._updateFlags;
container.relativeGroupTransform.copyFrom(localTransform);
if (updateFlags & UPDATE_BLEND_COLOR_VISIBLE) {
updateColorBlendVisibility(container, tempContainer, updateFlags);
}
}
if (!container.renderGroup) {
const children = container.children;
const length = children.length;
for (let i = 0; i < length; i++) {
updateTransformAndChildren(children[i], updateTick, updateFlags);
}
const renderGroup = container.parentRenderGroup;
if (container.renderPipeId && !renderGroup.structureDidChange) {
renderGroup.updateRenderable(container);
}
}
}
function updateColorBlendVisibility(container, parent, updateFlags) {
if (updateFlags & UPDATE_COLOR) {
container.groupColor = mixColors(
container.localColor,
parent.groupColor
);
let groupAlpha = container.localAlpha * parent.groupAlpha;
groupAlpha = groupAlpha < 0 ? 0 : groupAlpha > 1 ? 1 : groupAlpha;
container.groupAlpha = groupAlpha;
container.groupColorAlpha = container.groupColor + ((groupAlpha * 255 | 0) << 24);
}
if (updateFlags & UPDATE_BLEND) {
container.groupBlendMode = container.localBlendMode === "inherit" ? parent.groupBlendMode : container.localBlendMode;
}
if (updateFlags & UPDATE_VISIBLE) {
container.globalDisplayStatus = container.localDisplayStatus & parent.globalDisplayStatus;
}
container._updateFlags = 0;
}
export { updateRenderGroupTransform, updateRenderGroupTransforms, updateTransformAndChildren };
//# sourceMappingURL=updateRenderGroupTransforms.mjs.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,2 @@
import type { Matrix } from '../../../maths/matrix/Matrix';
export declare function updateWorldTransform(local: Matrix, parent: Matrix, world: Matrix): void;

View File

@@ -0,0 +1,24 @@
'use strict';
"use strict";
function updateWorldTransform(local, parent, world) {
const lta = local.a;
const ltb = local.b;
const ltc = local.c;
const ltd = local.d;
const lttx = local.tx;
const ltty = local.ty;
const pta = parent.a;
const ptb = parent.b;
const ptc = parent.c;
const ptd = parent.d;
world.a = lta * pta + ltb * ptc;
world.b = lta * ptb + ltb * ptd;
world.c = ltc * pta + ltd * ptc;
world.d = ltc * ptb + ltd * ptd;
world.tx = lttx * pta + ltty * ptc + parent.tx;
world.ty = lttx * ptb + ltty * ptd + parent.ty;
}
exports.updateWorldTransform = updateWorldTransform;
//# sourceMappingURL=updateWorldTransform.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"updateWorldTransform.js","sources":["../../../../src/scene/container/utils/updateWorldTransform.ts"],"sourcesContent":["import type { Matrix } from '../../../maths/matrix/Matrix';\n\nexport function updateWorldTransform(local: Matrix, parent: Matrix, world: Matrix): void\n{\n const lta = local.a;\n const ltb = local.b;\n const ltc = local.c;\n const ltd = local.d;\n const lttx = local.tx;\n const ltty = local.ty;\n\n const pta = parent.a;\n const ptb = parent.b;\n const ptc = parent.c;\n const ptd = parent.d;\n\n world.a = (lta * pta) + (ltb * ptc);\n world.b = (lta * ptb) + (ltb * ptd);\n world.c = (ltc * pta) + (ltd * ptc);\n world.d = (ltc * ptb) + (ltd * ptd);\n world.tx = (lttx * pta) + (ltty * ptc) + parent.tx;\n world.ty = (lttx * ptb) + (ltty * ptd) + parent.ty;\n}\n"],"names":[],"mappings":";;;AAEgB,SAAA,oBAAA,CAAqB,KAAe,EAAA,MAAA,EAAgB,KACpE,EAAA;AACI,EAAA,MAAM,MAAM,KAAM,CAAA,CAAA,CAAA;AAClB,EAAA,MAAM,MAAM,KAAM,CAAA,CAAA,CAAA;AAClB,EAAA,MAAM,MAAM,KAAM,CAAA,CAAA,CAAA;AAClB,EAAA,MAAM,MAAM,KAAM,CAAA,CAAA,CAAA;AAClB,EAAA,MAAM,OAAO,KAAM,CAAA,EAAA,CAAA;AACnB,EAAA,MAAM,OAAO,KAAM,CAAA,EAAA,CAAA;AAEnB,EAAA,MAAM,MAAM,MAAO,CAAA,CAAA,CAAA;AACnB,EAAA,MAAM,MAAM,MAAO,CAAA,CAAA,CAAA;AACnB,EAAA,MAAM,MAAM,MAAO,CAAA,CAAA,CAAA;AACnB,EAAA,MAAM,MAAM,MAAO,CAAA,CAAA,CAAA;AAEnB,EAAM,KAAA,CAAA,CAAA,GAAK,GAAM,GAAA,GAAA,GAAQ,GAAM,GAAA,GAAA,CAAA;AAC/B,EAAM,KAAA,CAAA,CAAA,GAAK,GAAM,GAAA,GAAA,GAAQ,GAAM,GAAA,GAAA,CAAA;AAC/B,EAAM,KAAA,CAAA,CAAA,GAAK,GAAM,GAAA,GAAA,GAAQ,GAAM,GAAA,GAAA,CAAA;AAC/B,EAAM,KAAA,CAAA,CAAA,GAAK,GAAM,GAAA,GAAA,GAAQ,GAAM,GAAA,GAAA,CAAA;AAC/B,EAAA,KAAA,CAAM,EAAM,GAAA,IAAA,GAAO,GAAQ,GAAA,IAAA,GAAO,MAAO,MAAO,CAAA,EAAA,CAAA;AAChD,EAAA,KAAA,CAAM,EAAM,GAAA,IAAA,GAAO,GAAQ,GAAA,IAAA,GAAO,MAAO,MAAO,CAAA,EAAA,CAAA;AACpD;;;;"}

View File

@@ -0,0 +1,22 @@
"use strict";
function updateWorldTransform(local, parent, world) {
const lta = local.a;
const ltb = local.b;
const ltc = local.c;
const ltd = local.d;
const lttx = local.tx;
const ltty = local.ty;
const pta = parent.a;
const ptb = parent.b;
const ptc = parent.c;
const ptd = parent.d;
world.a = lta * pta + ltb * ptc;
world.b = lta * ptb + ltb * ptd;
world.c = ltc * pta + ltd * ptc;
world.d = ltc * ptb + ltd * ptd;
world.tx = lttx * pta + ltty * ptc + parent.tx;
world.ty = lttx * ptb + ltty * ptd + parent.ty;
}
export { updateWorldTransform };
//# sourceMappingURL=updateWorldTransform.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"updateWorldTransform.mjs","sources":["../../../../src/scene/container/utils/updateWorldTransform.ts"],"sourcesContent":["import type { Matrix } from '../../../maths/matrix/Matrix';\n\nexport function updateWorldTransform(local: Matrix, parent: Matrix, world: Matrix): void\n{\n const lta = local.a;\n const ltb = local.b;\n const ltc = local.c;\n const ltd = local.d;\n const lttx = local.tx;\n const ltty = local.ty;\n\n const pta = parent.a;\n const ptb = parent.b;\n const ptc = parent.c;\n const ptd = parent.d;\n\n world.a = (lta * pta) + (ltb * ptc);\n world.b = (lta * ptb) + (ltb * ptd);\n world.c = (ltc * pta) + (ltd * ptc);\n world.d = (ltc * ptb) + (ltd * ptd);\n world.tx = (lttx * pta) + (ltty * ptc) + parent.tx;\n world.ty = (lttx * ptb) + (ltty * ptd) + parent.ty;\n}\n"],"names":[],"mappings":";AAEgB,SAAA,oBAAA,CAAqB,KAAe,EAAA,MAAA,EAAgB,KACpE,EAAA;AACI,EAAA,MAAM,MAAM,KAAM,CAAA,CAAA,CAAA;AAClB,EAAA,MAAM,MAAM,KAAM,CAAA,CAAA,CAAA;AAClB,EAAA,MAAM,MAAM,KAAM,CAAA,CAAA,CAAA;AAClB,EAAA,MAAM,MAAM,KAAM,CAAA,CAAA,CAAA;AAClB,EAAA,MAAM,OAAO,KAAM,CAAA,EAAA,CAAA;AACnB,EAAA,MAAM,OAAO,KAAM,CAAA,EAAA,CAAA;AAEnB,EAAA,MAAM,MAAM,MAAO,CAAA,CAAA,CAAA;AACnB,EAAA,MAAM,MAAM,MAAO,CAAA,CAAA,CAAA;AACnB,EAAA,MAAM,MAAM,MAAO,CAAA,CAAA,CAAA;AACnB,EAAA,MAAM,MAAM,MAAO,CAAA,CAAA,CAAA;AAEnB,EAAM,KAAA,CAAA,CAAA,GAAK,GAAM,GAAA,GAAA,GAAQ,GAAM,GAAA,GAAA,CAAA;AAC/B,EAAM,KAAA,CAAA,CAAA,GAAK,GAAM,GAAA,GAAA,GAAQ,GAAM,GAAA,GAAA,CAAA;AAC/B,EAAM,KAAA,CAAA,CAAA,GAAK,GAAM,GAAA,GAAA,GAAQ,GAAM,GAAA,GAAA,CAAA;AAC/B,EAAM,KAAA,CAAA,CAAA,GAAK,GAAM,GAAA,GAAA,GAAQ,GAAM,GAAA,GAAA,CAAA;AAC/B,EAAA,KAAA,CAAM,EAAM,GAAA,IAAA,GAAO,GAAQ,GAAA,IAAA,GAAO,MAAO,MAAO,CAAA,EAAA,CAAA;AAChD,EAAA,KAAA,CAAM,EAAM,GAAA,IAAA,GAAO,GAAQ,GAAA,IAAA,GAAO,MAAO,MAAO,CAAA,EAAA,CAAA;AACpD;;;;"}

View File

@@ -0,0 +1,3 @@
import type { RenderPipes } from '../../../rendering/renderers/types';
import type { RenderGroup } from '../RenderGroup';
export declare function validateRenderables(renderGroup: RenderGroup, renderPipes: RenderPipes): boolean;

View File

@@ -0,0 +1,21 @@
'use strict';
"use strict";
function validateRenderables(renderGroup, renderPipes) {
const { list, index } = renderGroup.childrenRenderablesToUpdate;
let rebuildRequired = false;
for (let i = 0; i < index; i++) {
const container = list[i];
const renderable = container;
const pipe = renderPipes[renderable.renderPipeId];
rebuildRequired = pipe.validateRenderable(container);
if (rebuildRequired) {
break;
}
}
renderGroup.structureDidChange = rebuildRequired;
return rebuildRequired;
}
exports.validateRenderables = validateRenderables;
//# sourceMappingURL=validateRenderables.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"validateRenderables.js","sources":["../../../../src/scene/container/utils/validateRenderables.ts"],"sourcesContent":["import type { RenderPipe } from '../../../rendering/renderers/shared/instructions/RenderPipe';\nimport type { RenderPipes } from '../../../rendering/renderers/types';\nimport type { RenderGroup } from '../RenderGroup';\n\nexport function validateRenderables(renderGroup: RenderGroup, renderPipes: RenderPipes): boolean\n{\n const { list, index } = renderGroup.childrenRenderablesToUpdate;\n\n let rebuildRequired = false;\n\n for (let i = 0; i < index; i++)\n {\n const container = list[i];\n\n // note to self: there is no need to check if container.parentRenderGroup || !container.renderGroup\n // exist here, as this function is only called if the structure did NOT change\n // which means they have to be valid if this function is called\n\n const renderable = container;\n const pipe = renderPipes[renderable.renderPipeId as keyof RenderPipes] as RenderPipe<any>;\n\n rebuildRequired = pipe.validateRenderable(container);\n\n if (rebuildRequired)\n {\n break;\n }\n }\n\n renderGroup.structureDidChange = rebuildRequired;\n\n return rebuildRequired;\n}\n"],"names":[],"mappings":";;;AAIgB,SAAA,mBAAA,CAAoB,aAA0B,WAC9D,EAAA;AACI,EAAA,MAAM,EAAE,IAAA,EAAM,KAAM,EAAA,GAAI,WAAY,CAAA,2BAAA,CAAA;AAEpC,EAAA,IAAI,eAAkB,GAAA,KAAA,CAAA;AAEtB,EAAA,KAAA,IAAS,CAAI,GAAA,CAAA,EAAG,CAAI,GAAA,KAAA,EAAO,CAC3B,EAAA,EAAA;AACI,IAAM,MAAA,SAAA,GAAY,KAAK,CAAC,CAAA,CAAA;AAMxB,IAAA,MAAM,UAAa,GAAA,SAAA,CAAA;AACnB,IAAM,MAAA,IAAA,GAAO,WAAY,CAAA,UAAA,CAAW,YAAiC,CAAA,CAAA;AAErE,IAAkB,eAAA,GAAA,IAAA,CAAK,mBAAmB,SAAS,CAAA,CAAA;AAEnD,IAAA,IAAI,eACJ,EAAA;AACI,MAAA,MAAA;AAAA,KACJ;AAAA,GACJ;AAEA,EAAA,WAAA,CAAY,kBAAqB,GAAA,eAAA,CAAA;AAEjC,EAAO,OAAA,eAAA,CAAA;AACX;;;;"}

View File

@@ -0,0 +1,19 @@
"use strict";
function validateRenderables(renderGroup, renderPipes) {
const { list, index } = renderGroup.childrenRenderablesToUpdate;
let rebuildRequired = false;
for (let i = 0; i < index; i++) {
const container = list[i];
const renderable = container;
const pipe = renderPipes[renderable.renderPipeId];
rebuildRequired = pipe.validateRenderable(container);
if (rebuildRequired) {
break;
}
}
renderGroup.structureDidChange = rebuildRequired;
return rebuildRequired;
}
export { validateRenderables };
//# sourceMappingURL=validateRenderables.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"validateRenderables.mjs","sources":["../../../../src/scene/container/utils/validateRenderables.ts"],"sourcesContent":["import type { RenderPipe } from '../../../rendering/renderers/shared/instructions/RenderPipe';\nimport type { RenderPipes } from '../../../rendering/renderers/types';\nimport type { RenderGroup } from '../RenderGroup';\n\nexport function validateRenderables(renderGroup: RenderGroup, renderPipes: RenderPipes): boolean\n{\n const { list, index } = renderGroup.childrenRenderablesToUpdate;\n\n let rebuildRequired = false;\n\n for (let i = 0; i < index; i++)\n {\n const container = list[i];\n\n // note to self: there is no need to check if container.parentRenderGroup || !container.renderGroup\n // exist here, as this function is only called if the structure did NOT change\n // which means they have to be valid if this function is called\n\n const renderable = container;\n const pipe = renderPipes[renderable.renderPipeId as keyof RenderPipes] as RenderPipe<any>;\n\n rebuildRequired = pipe.validateRenderable(container);\n\n if (rebuildRequired)\n {\n break;\n }\n }\n\n renderGroup.structureDidChange = rebuildRequired;\n\n return rebuildRequired;\n}\n"],"names":[],"mappings":";AAIgB,SAAA,mBAAA,CAAoB,aAA0B,WAC9D,EAAA;AACI,EAAA,MAAM,EAAE,IAAA,EAAM,KAAM,EAAA,GAAI,WAAY,CAAA,2BAAA,CAAA;AAEpC,EAAA,IAAI,eAAkB,GAAA,KAAA,CAAA;AAEtB,EAAA,KAAA,IAAS,CAAI,GAAA,CAAA,EAAG,CAAI,GAAA,KAAA,EAAO,CAC3B,EAAA,EAAA;AACI,IAAM,MAAA,SAAA,GAAY,KAAK,CAAC,CAAA,CAAA;AAMxB,IAAA,MAAM,UAAa,GAAA,SAAA,CAAA;AACnB,IAAM,MAAA,IAAA,GAAO,WAAY,CAAA,UAAA,CAAW,YAAiC,CAAA,CAAA;AAErE,IAAkB,eAAA,GAAA,IAAA,CAAK,mBAAmB,SAAS,CAAA,CAAA;AAEnD,IAAA,IAAI,eACJ,EAAA;AACI,MAAA,MAAA;AAAA,KACJ;AAAA,GACJ;AAEA,EAAA,WAAA,CAAY,kBAAqB,GAAA,eAAA,CAAA;AAEjC,EAAO,OAAA,eAAA,CAAA;AACX;;;;"}