This commit is contained in:
2025-01-04 00:34:03 +01:00
parent 41829408dc
commit 0ca14bbc19
18111 changed files with 1871397 additions and 0 deletions

178
resources/app/node_modules/@pixi/mesh/lib/Mesh.js generated vendored Normal file
View File

@@ -0,0 +1,178 @@
"use strict";
var core = require("@pixi/core"), display = require("@pixi/display"), MeshBatchUvs = require("./MeshBatchUvs.js");
const tempPoint = new core.Point(), tempPolygon = new core.Polygon(), _Mesh = class _Mesh2 extends display.Container {
/**
* @param geometry - The geometry the mesh will use.
* @param {PIXI.MeshMaterial} shader - The shader the mesh will use.
* @param state - The state that the WebGL context is required to be in to render the mesh
* if no state is provided, uses {@link PIXI.State.for2d} to create a 2D state for PixiJS.
* @param drawMode - The drawMode, can be any of the {@link PIXI.DRAW_MODES} constants.
*/
constructor(geometry, shader, state, drawMode = core.DRAW_MODES.TRIANGLES) {
super(), this.geometry = geometry, this.shader = shader, this.state = state || core.State.for2d(), this.drawMode = drawMode, this.start = 0, this.size = 0, this.uvs = null, this.indices = null, this.vertexData = new Float32Array(1), this.vertexDirty = -1, this._transformID = -1, this._roundPixels = core.settings.ROUND_PIXELS, this.batchUvs = null;
}
/**
* Includes vertex positions, face indices, normals, colors, UVs, and
* custom attributes within buffers, reducing the cost of passing all
* this data to the GPU. Can be shared between multiple Mesh objects.
*/
get geometry() {
return this._geometry;
}
set geometry(value) {
this._geometry !== value && (this._geometry && (this._geometry.refCount--, this._geometry.refCount === 0 && this._geometry.dispose()), this._geometry = value, this._geometry && this._geometry.refCount++, this.vertexDirty = -1);
}
/**
* To change mesh uv's, change its uvBuffer data and increment its _updateID.
* @readonly
*/
get uvBuffer() {
return this.geometry.buffers[1];
}
/**
* To change mesh vertices, change its uvBuffer data and increment its _updateID.
* Incrementing _updateID is optional because most of Mesh objects do it anyway.
* @readonly
*/
get verticesBuffer() {
return this.geometry.buffers[0];
}
/** Alias for {@link PIXI.Mesh#shader}. */
set material(value) {
this.shader = value;
}
get material() {
return this.shader;
}
/**
* The blend mode to be applied to the Mesh. Apply a value of
* `PIXI.BLEND_MODES.NORMAL` to reset the blend mode.
* @default PIXI.BLEND_MODES.NORMAL;
*/
set blendMode(value) {
this.state.blendMode = value;
}
get blendMode() {
return this.state.blendMode;
}
/**
* If true PixiJS will Math.floor() x/y values when rendering, stopping pixel interpolation.
* Advantages can include sharper image quality (like text) and faster rendering on canvas.
* The main disadvantage is movement of objects may appear less smooth.
* To set the global default, change {@link PIXI.settings.ROUND_PIXELS}
* @default false
*/
set roundPixels(value) {
this._roundPixels !== value && (this._transformID = -1), this._roundPixels = value;
}
get roundPixels() {
return this._roundPixels;
}
/**
* The multiply tint applied to the Mesh. This is a hex value. A value of
* `0xFFFFFF` will remove any tint effect.
*
* Null for non-MeshMaterial shaders
* @default 0xFFFFFF
*/
get tint() {
return "tint" in this.shader ? this.shader.tint : null;
}
set tint(value) {
this.shader.tint = value;
}
/**
* The tint color as a RGB integer
* @ignore
*/
get tintValue() {
return this.shader.tintValue;
}
/** The texture that the Mesh uses. Null for non-MeshMaterial shaders */
get texture() {
return "texture" in this.shader ? this.shader.texture : null;
}
set texture(value) {
this.shader.texture = value;
}
/**
* Standard renderer draw.
* @param renderer - Instance to renderer.
*/
_render(renderer) {
const vertices = this.geometry.buffers[0].data;
this.shader.batchable && this.drawMode === core.DRAW_MODES.TRIANGLES && vertices.length < _Mesh2.BATCHABLE_SIZE * 2 ? this._renderToBatch(renderer) : this._renderDefault(renderer);
}
/**
* Standard non-batching way of rendering.
* @param renderer - Instance to renderer.
*/
_renderDefault(renderer) {
const shader = this.shader;
shader.alpha = this.worldAlpha, shader.update && shader.update(), renderer.batch.flush(), shader.uniforms.translationMatrix = this.transform.worldTransform.toArray(!0), renderer.shader.bind(shader), renderer.state.set(this.state), renderer.geometry.bind(this.geometry, shader), renderer.geometry.draw(this.drawMode, this.size, this.start, this.geometry.instanceCount);
}
/**
* Rendering by using the Batch system.
* @param renderer - Instance to renderer.
*/
_renderToBatch(renderer) {
const geometry = this.geometry, shader = this.shader;
shader.uvMatrix && (shader.uvMatrix.update(), this.calculateUvs()), this.calculateVertices(), this.indices = geometry.indexBuffer.data, this._tintRGB = shader._tintRGB, this._texture = shader.texture;
const pluginName = this.material.pluginName;
renderer.batch.setObjectRenderer(renderer.plugins[pluginName]), renderer.plugins[pluginName].render(this);
}
/** Updates vertexData field based on transform and vertices. */
calculateVertices() {
const verticesBuffer = this.geometry.buffers[0], vertices = verticesBuffer.data, vertexDirtyId = verticesBuffer._updateID;
if (vertexDirtyId === this.vertexDirty && this._transformID === this.transform._worldID)
return;
this._transformID = this.transform._worldID, this.vertexData.length !== vertices.length && (this.vertexData = new Float32Array(vertices.length));
const wt = this.transform.worldTransform, a = wt.a, b = wt.b, c = wt.c, d = wt.d, tx = wt.tx, ty = wt.ty, vertexData = this.vertexData;
for (let i = 0; i < vertexData.length / 2; i++) {
const x = vertices[i * 2], y = vertices[i * 2 + 1];
vertexData[i * 2] = a * x + c * y + tx, vertexData[i * 2 + 1] = b * x + d * y + ty;
}
if (this._roundPixels) {
const resolution = core.settings.RESOLUTION;
for (let i = 0; i < vertexData.length; ++i)
vertexData[i] = Math.round(vertexData[i] * resolution) / resolution;
}
this.vertexDirty = vertexDirtyId;
}
/** Updates uv field based on from geometry uv's or batchUvs. */
calculateUvs() {
const geomUvs = this.geometry.buffers[1], shader = this.shader;
shader.uvMatrix.isSimple ? this.uvs = geomUvs.data : (this.batchUvs || (this.batchUvs = new MeshBatchUvs.MeshBatchUvs(geomUvs, shader.uvMatrix)), this.batchUvs.update(), this.uvs = this.batchUvs.data);
}
/**
* Updates the bounds of the mesh as a rectangle. The bounds calculation takes the worldTransform into account.
* there must be a aVertexPosition attribute present in the geometry for bounds to be calculated correctly.
*/
_calculateBounds() {
this.calculateVertices(), this._bounds.addVertexData(this.vertexData, 0, this.vertexData.length);
}
/**
* Tests if a point is inside this mesh. Works only for PIXI.DRAW_MODES.TRIANGLES.
* @param point - The point to test.
* @returns - The result of the test.
*/
containsPoint(point) {
if (!this.getBounds().contains(point.x, point.y))
return !1;
this.worldTransform.applyInverse(point, tempPoint);
const vertices = this.geometry.getBuffer("aVertexPosition").data, points = tempPolygon.points, indices = this.geometry.getIndex().data, len = indices.length, step = this.drawMode === 4 ? 3 : 1;
for (let i = 0; i + 2 < len; i += step) {
const ind0 = indices[i] * 2, ind1 = indices[i + 1] * 2, ind2 = indices[i + 2] * 2;
if (points[0] = vertices[ind0], points[1] = vertices[ind0 + 1], points[2] = vertices[ind1], points[3] = vertices[ind1 + 1], points[4] = vertices[ind2], points[5] = vertices[ind2 + 1], tempPolygon.contains(tempPoint.x, tempPoint.y))
return !0;
}
return !1;
}
destroy(options) {
super.destroy(options), this._cachedTexture && (this._cachedTexture.destroy(), this._cachedTexture = null), this.geometry = null, this.shader = null, this.state = null, this.uvs = null, this.indices = null, this.vertexData = null;
}
};
_Mesh.BATCHABLE_SIZE = 100;
let Mesh = _Mesh;
exports.Mesh = Mesh;
//# sourceMappingURL=Mesh.js.map

File diff suppressed because one or more lines are too long

181
resources/app/node_modules/@pixi/mesh/lib/Mesh.mjs generated vendored Normal file
View File

@@ -0,0 +1,181 @@
import { Point, Polygon, State, settings, DRAW_MODES } from "@pixi/core";
import { Container } from "@pixi/display";
import { MeshBatchUvs } from "./MeshBatchUvs.mjs";
const tempPoint = new Point(), tempPolygon = new Polygon(), _Mesh = class _Mesh2 extends Container {
/**
* @param geometry - The geometry the mesh will use.
* @param {PIXI.MeshMaterial} shader - The shader the mesh will use.
* @param state - The state that the WebGL context is required to be in to render the mesh
* if no state is provided, uses {@link PIXI.State.for2d} to create a 2D state for PixiJS.
* @param drawMode - The drawMode, can be any of the {@link PIXI.DRAW_MODES} constants.
*/
constructor(geometry, shader, state, drawMode = DRAW_MODES.TRIANGLES) {
super(), this.geometry = geometry, this.shader = shader, this.state = state || State.for2d(), this.drawMode = drawMode, this.start = 0, this.size = 0, this.uvs = null, this.indices = null, this.vertexData = new Float32Array(1), this.vertexDirty = -1, this._transformID = -1, this._roundPixels = settings.ROUND_PIXELS, this.batchUvs = null;
}
/**
* Includes vertex positions, face indices, normals, colors, UVs, and
* custom attributes within buffers, reducing the cost of passing all
* this data to the GPU. Can be shared between multiple Mesh objects.
*/
get geometry() {
return this._geometry;
}
set geometry(value) {
this._geometry !== value && (this._geometry && (this._geometry.refCount--, this._geometry.refCount === 0 && this._geometry.dispose()), this._geometry = value, this._geometry && this._geometry.refCount++, this.vertexDirty = -1);
}
/**
* To change mesh uv's, change its uvBuffer data and increment its _updateID.
* @readonly
*/
get uvBuffer() {
return this.geometry.buffers[1];
}
/**
* To change mesh vertices, change its uvBuffer data and increment its _updateID.
* Incrementing _updateID is optional because most of Mesh objects do it anyway.
* @readonly
*/
get verticesBuffer() {
return this.geometry.buffers[0];
}
/** Alias for {@link PIXI.Mesh#shader}. */
set material(value) {
this.shader = value;
}
get material() {
return this.shader;
}
/**
* The blend mode to be applied to the Mesh. Apply a value of
* `PIXI.BLEND_MODES.NORMAL` to reset the blend mode.
* @default PIXI.BLEND_MODES.NORMAL;
*/
set blendMode(value) {
this.state.blendMode = value;
}
get blendMode() {
return this.state.blendMode;
}
/**
* If true PixiJS will Math.floor() x/y values when rendering, stopping pixel interpolation.
* Advantages can include sharper image quality (like text) and faster rendering on canvas.
* The main disadvantage is movement of objects may appear less smooth.
* To set the global default, change {@link PIXI.settings.ROUND_PIXELS}
* @default false
*/
set roundPixels(value) {
this._roundPixels !== value && (this._transformID = -1), this._roundPixels = value;
}
get roundPixels() {
return this._roundPixels;
}
/**
* The multiply tint applied to the Mesh. This is a hex value. A value of
* `0xFFFFFF` will remove any tint effect.
*
* Null for non-MeshMaterial shaders
* @default 0xFFFFFF
*/
get tint() {
return "tint" in this.shader ? this.shader.tint : null;
}
set tint(value) {
this.shader.tint = value;
}
/**
* The tint color as a RGB integer
* @ignore
*/
get tintValue() {
return this.shader.tintValue;
}
/** The texture that the Mesh uses. Null for non-MeshMaterial shaders */
get texture() {
return "texture" in this.shader ? this.shader.texture : null;
}
set texture(value) {
this.shader.texture = value;
}
/**
* Standard renderer draw.
* @param renderer - Instance to renderer.
*/
_render(renderer) {
const vertices = this.geometry.buffers[0].data;
this.shader.batchable && this.drawMode === DRAW_MODES.TRIANGLES && vertices.length < _Mesh2.BATCHABLE_SIZE * 2 ? this._renderToBatch(renderer) : this._renderDefault(renderer);
}
/**
* Standard non-batching way of rendering.
* @param renderer - Instance to renderer.
*/
_renderDefault(renderer) {
const shader = this.shader;
shader.alpha = this.worldAlpha, shader.update && shader.update(), renderer.batch.flush(), shader.uniforms.translationMatrix = this.transform.worldTransform.toArray(!0), renderer.shader.bind(shader), renderer.state.set(this.state), renderer.geometry.bind(this.geometry, shader), renderer.geometry.draw(this.drawMode, this.size, this.start, this.geometry.instanceCount);
}
/**
* Rendering by using the Batch system.
* @param renderer - Instance to renderer.
*/
_renderToBatch(renderer) {
const geometry = this.geometry, shader = this.shader;
shader.uvMatrix && (shader.uvMatrix.update(), this.calculateUvs()), this.calculateVertices(), this.indices = geometry.indexBuffer.data, this._tintRGB = shader._tintRGB, this._texture = shader.texture;
const pluginName = this.material.pluginName;
renderer.batch.setObjectRenderer(renderer.plugins[pluginName]), renderer.plugins[pluginName].render(this);
}
/** Updates vertexData field based on transform and vertices. */
calculateVertices() {
const verticesBuffer = this.geometry.buffers[0], vertices = verticesBuffer.data, vertexDirtyId = verticesBuffer._updateID;
if (vertexDirtyId === this.vertexDirty && this._transformID === this.transform._worldID)
return;
this._transformID = this.transform._worldID, this.vertexData.length !== vertices.length && (this.vertexData = new Float32Array(vertices.length));
const wt = this.transform.worldTransform, a = wt.a, b = wt.b, c = wt.c, d = wt.d, tx = wt.tx, ty = wt.ty, vertexData = this.vertexData;
for (let i = 0; i < vertexData.length / 2; i++) {
const x = vertices[i * 2], y = vertices[i * 2 + 1];
vertexData[i * 2] = a * x + c * y + tx, vertexData[i * 2 + 1] = b * x + d * y + ty;
}
if (this._roundPixels) {
const resolution = settings.RESOLUTION;
for (let i = 0; i < vertexData.length; ++i)
vertexData[i] = Math.round(vertexData[i] * resolution) / resolution;
}
this.vertexDirty = vertexDirtyId;
}
/** Updates uv field based on from geometry uv's or batchUvs. */
calculateUvs() {
const geomUvs = this.geometry.buffers[1], shader = this.shader;
shader.uvMatrix.isSimple ? this.uvs = geomUvs.data : (this.batchUvs || (this.batchUvs = new MeshBatchUvs(geomUvs, shader.uvMatrix)), this.batchUvs.update(), this.uvs = this.batchUvs.data);
}
/**
* Updates the bounds of the mesh as a rectangle. The bounds calculation takes the worldTransform into account.
* there must be a aVertexPosition attribute present in the geometry for bounds to be calculated correctly.
*/
_calculateBounds() {
this.calculateVertices(), this._bounds.addVertexData(this.vertexData, 0, this.vertexData.length);
}
/**
* Tests if a point is inside this mesh. Works only for PIXI.DRAW_MODES.TRIANGLES.
* @param point - The point to test.
* @returns - The result of the test.
*/
containsPoint(point) {
if (!this.getBounds().contains(point.x, point.y))
return !1;
this.worldTransform.applyInverse(point, tempPoint);
const vertices = this.geometry.getBuffer("aVertexPosition").data, points = tempPolygon.points, indices = this.geometry.getIndex().data, len = indices.length, step = this.drawMode === 4 ? 3 : 1;
for (let i = 0; i + 2 < len; i += step) {
const ind0 = indices[i] * 2, ind1 = indices[i + 1] * 2, ind2 = indices[i + 2] * 2;
if (points[0] = vertices[ind0], points[1] = vertices[ind0 + 1], points[2] = vertices[ind1], points[3] = vertices[ind1 + 1], points[4] = vertices[ind2], points[5] = vertices[ind2 + 1], tempPolygon.contains(tempPoint.x, tempPoint.y))
return !0;
}
return !1;
}
destroy(options) {
super.destroy(options), this._cachedTexture && (this._cachedTexture.destroy(), this._cachedTexture = null), this.geometry = null, this.shader = null, this.state = null, this.uvs = null, this.indices = null, this.vertexData = null;
}
};
_Mesh.BATCHABLE_SIZE = 100;
let Mesh = _Mesh;
export {
Mesh
};
//# sourceMappingURL=Mesh.mjs.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,23 @@
"use strict";
class MeshBatchUvs {
/**
* @param uvBuffer - Buffer with normalized uv's
* @param uvMatrix - Material UV matrix
*/
constructor(uvBuffer, uvMatrix) {
this.uvBuffer = uvBuffer, this.uvMatrix = uvMatrix, this.data = null, this._bufferUpdateId = -1, this._textureUpdateId = -1, this._updateID = 0;
}
/**
* Updates
* @param forceUpdate - force the update
*/
update(forceUpdate) {
if (!forceUpdate && this._bufferUpdateId === this.uvBuffer._updateID && this._textureUpdateId === this.uvMatrix._updateID)
return;
this._bufferUpdateId = this.uvBuffer._updateID, this._textureUpdateId = this.uvMatrix._updateID;
const data = this.uvBuffer.data;
(!this.data || this.data.length !== data.length) && (this.data = new Float32Array(data.length)), this.uvMatrix.multiplyUvs(data, this.data), this._updateID++;
}
}
exports.MeshBatchUvs = MeshBatchUvs;
//# sourceMappingURL=MeshBatchUvs.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"MeshBatchUvs.js","sources":["../src/MeshBatchUvs.ts"],"sourcesContent":["import type { Buffer, TextureMatrix } from '@pixi/core';\n\n/**\n * Class controls cache for UV mapping from Texture normal space to BaseTexture normal space.\n * @memberof PIXI\n */\nexport class MeshBatchUvs\n{\n /** UV Buffer data. */\n public readonly data: Float32Array;\n\n /** Buffer with normalized UV's. */\n public uvBuffer: Buffer;\n\n /** Material UV matrix. */\n public uvMatrix: TextureMatrix;\n\n private _bufferUpdateId: number;\n private _textureUpdateId: number;\n\n // Internal-only properties\n _updateID: number;\n\n /**\n * @param uvBuffer - Buffer with normalized uv's\n * @param uvMatrix - Material UV matrix\n */\n constructor(uvBuffer: Buffer, uvMatrix: TextureMatrix)\n {\n this.uvBuffer = uvBuffer;\n this.uvMatrix = uvMatrix;\n this.data = null;\n\n this._bufferUpdateId = -1;\n this._textureUpdateId = -1;\n this._updateID = 0;\n }\n\n /**\n * Updates\n * @param forceUpdate - force the update\n */\n public update(forceUpdate?: boolean): void\n {\n if (!forceUpdate\n && this._bufferUpdateId === this.uvBuffer._updateID\n && this._textureUpdateId === this.uvMatrix._updateID\n )\n {\n return;\n }\n\n this._bufferUpdateId = this.uvBuffer._updateID;\n this._textureUpdateId = this.uvMatrix._updateID;\n\n const data = this.uvBuffer.data as Float32Array;\n\n if (!this.data || this.data.length !== data.length)\n {\n (this.data as any) = new Float32Array(data.length);\n }\n\n this.uvMatrix.multiplyUvs(data, this.data);\n\n this._updateID++;\n }\n}\n"],"names":[],"mappings":";AAMO,MAAM,aACb;AAAA;AAAA;AAAA;AAAA;AAAA,EAoBI,YAAY,UAAkB,UAC9B;AACI,SAAK,WAAW,UAChB,KAAK,WAAW,UAChB,KAAK,OAAO,MAEZ,KAAK,kBAAkB,IACvB,KAAK,mBAAmB,IACxB,KAAK,YAAY;AAAA,EACrB;AAAA;AAAA;AAAA;AAAA;AAAA,EAMO,OAAO,aACd;AACQ,QAAA,CAAC,eACE,KAAK,oBAAoB,KAAK,SAAS,aACvC,KAAK,qBAAqB,KAAK,SAAS;AAG3C;AAGJ,SAAK,kBAAkB,KAAK,SAAS,WACrC,KAAK,mBAAmB,KAAK,SAAS;AAEhC,UAAA,OAAO,KAAK,SAAS;AAEvB,KAAA,CAAC,KAAK,QAAQ,KAAK,KAAK,WAAW,KAAK,YAEvC,KAAK,OAAe,IAAI,aAAa,KAAK,MAAM,IAGrD,KAAK,SAAS,YAAY,MAAM,KAAK,IAAI,GAEzC,KAAK;AAAA,EACT;AACJ;;"}

View File

@@ -0,0 +1,24 @@
class MeshBatchUvs {
/**
* @param uvBuffer - Buffer with normalized uv's
* @param uvMatrix - Material UV matrix
*/
constructor(uvBuffer, uvMatrix) {
this.uvBuffer = uvBuffer, this.uvMatrix = uvMatrix, this.data = null, this._bufferUpdateId = -1, this._textureUpdateId = -1, this._updateID = 0;
}
/**
* Updates
* @param forceUpdate - force the update
*/
update(forceUpdate) {
if (!forceUpdate && this._bufferUpdateId === this.uvBuffer._updateID && this._textureUpdateId === this.uvMatrix._updateID)
return;
this._bufferUpdateId = this.uvBuffer._updateID, this._textureUpdateId = this.uvMatrix._updateID;
const data = this.uvBuffer.data;
(!this.data || this.data.length !== data.length) && (this.data = new Float32Array(data.length)), this.uvMatrix.multiplyUvs(data, this.data), this._updateID++;
}
}
export {
MeshBatchUvs
};
//# sourceMappingURL=MeshBatchUvs.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"MeshBatchUvs.mjs","sources":["../src/MeshBatchUvs.ts"],"sourcesContent":["import type { Buffer, TextureMatrix } from '@pixi/core';\n\n/**\n * Class controls cache for UV mapping from Texture normal space to BaseTexture normal space.\n * @memberof PIXI\n */\nexport class MeshBatchUvs\n{\n /** UV Buffer data. */\n public readonly data: Float32Array;\n\n /** Buffer with normalized UV's. */\n public uvBuffer: Buffer;\n\n /** Material UV matrix. */\n public uvMatrix: TextureMatrix;\n\n private _bufferUpdateId: number;\n private _textureUpdateId: number;\n\n // Internal-only properties\n _updateID: number;\n\n /**\n * @param uvBuffer - Buffer with normalized uv's\n * @param uvMatrix - Material UV matrix\n */\n constructor(uvBuffer: Buffer, uvMatrix: TextureMatrix)\n {\n this.uvBuffer = uvBuffer;\n this.uvMatrix = uvMatrix;\n this.data = null;\n\n this._bufferUpdateId = -1;\n this._textureUpdateId = -1;\n this._updateID = 0;\n }\n\n /**\n * Updates\n * @param forceUpdate - force the update\n */\n public update(forceUpdate?: boolean): void\n {\n if (!forceUpdate\n && this._bufferUpdateId === this.uvBuffer._updateID\n && this._textureUpdateId === this.uvMatrix._updateID\n )\n {\n return;\n }\n\n this._bufferUpdateId = this.uvBuffer._updateID;\n this._textureUpdateId = this.uvMatrix._updateID;\n\n const data = this.uvBuffer.data as Float32Array;\n\n if (!this.data || this.data.length !== data.length)\n {\n (this.data as any) = new Float32Array(data.length);\n }\n\n this.uvMatrix.multiplyUvs(data, this.data);\n\n this._updateID++;\n }\n}\n"],"names":[],"mappings":"AAMO,MAAM,aACb;AAAA;AAAA;AAAA;AAAA;AAAA,EAoBI,YAAY,UAAkB,UAC9B;AACI,SAAK,WAAW,UAChB,KAAK,WAAW,UAChB,KAAK,OAAO,MAEZ,KAAK,kBAAkB,IACvB,KAAK,mBAAmB,IACxB,KAAK,YAAY;AAAA,EACrB;AAAA;AAAA;AAAA;AAAA;AAAA,EAMO,OAAO,aACd;AACQ,QAAA,CAAC,eACE,KAAK,oBAAoB,KAAK,SAAS,aACvC,KAAK,qBAAqB,KAAK,SAAS;AAG3C;AAGJ,SAAK,kBAAkB,KAAK,SAAS,WACrC,KAAK,mBAAmB,KAAK,SAAS;AAEhC,UAAA,OAAO,KAAK,SAAS;AAEvB,KAAA,CAAC,KAAK,QAAQ,KAAK,KAAK,WAAW,KAAK,YAEvC,KAAK,OAAe,IAAI,aAAa,KAAK,MAAM,IAGrD,KAAK,SAAS,YAAY,MAAM,KAAK,IAAI,GAEzC,KAAK;AAAA,EACT;AACJ;"}

View File

@@ -0,0 +1,24 @@
"use strict";
var core = require("@pixi/core");
class MeshGeometry extends core.Geometry {
/**
* @param {Float32Array|number[]} [vertices] - Positional data on geometry.
* @param {Float32Array|number[]} [uvs] - Texture UVs.
* @param {Uint16Array|number[]} [index] - IndexBuffer
*/
constructor(vertices, uvs, index) {
super();
const verticesBuffer = new core.Buffer(vertices), uvsBuffer = new core.Buffer(uvs, !0), indexBuffer = new core.Buffer(index, !0, !0);
this.addAttribute("aVertexPosition", verticesBuffer, 2, !1, core.TYPES.FLOAT).addAttribute("aTextureCoord", uvsBuffer, 2, !1, core.TYPES.FLOAT).addIndex(indexBuffer), this._updateId = -1;
}
/**
* If the vertex position is updated.
* @readonly
* @private
*/
get vertexDirtyId() {
return this.buffers[0]._updateID;
}
}
exports.MeshGeometry = MeshGeometry;
//# sourceMappingURL=MeshGeometry.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"MeshGeometry.js","sources":["../src/MeshGeometry.ts"],"sourcesContent":["import { Buffer, Geometry, TYPES } from '@pixi/core';\n\nimport type { IArrayBuffer } from '@pixi/core';\n\n/**\n * Standard 2D geometry used in PixiJS.\n *\n * Geometry can be defined without passing in a style or data if required.\n * @example\n * import { Geometry } from 'pixi.js';\n *\n * const geometry = new Geometry();\n *\n * geometry.addAttribute('positions', [0, 0, 100, 0, 100, 100, 0, 100], 2);\n * geometry.addAttribute('uvs', [0, 0, 1, 0, 1, 1, 0, 1], 2);\n * geometry.addIndex([0, 1, 2, 1, 3, 2]);\n * @memberof PIXI\n */\nexport class MeshGeometry extends Geometry\n{\n // Internal-only properties\n /**\n * Dirty flag to limit update calls on Mesh. For example,\n * limiting updates on a single Mesh instance with a shared Geometry\n * within the render loop.\n * @private\n * @default -1\n */\n _updateId: number;\n\n /**\n * @param {Float32Array|number[]} [vertices] - Positional data on geometry.\n * @param {Float32Array|number[]} [uvs] - Texture UVs.\n * @param {Uint16Array|number[]} [index] - IndexBuffer\n */\n constructor(vertices?: IArrayBuffer, uvs?: IArrayBuffer, index?: IArrayBuffer)\n {\n super();\n\n const verticesBuffer = new Buffer(vertices);\n const uvsBuffer = new Buffer(uvs, true);\n const indexBuffer = new Buffer(index, true, true);\n\n this.addAttribute('aVertexPosition', verticesBuffer, 2, false, TYPES.FLOAT)\n .addAttribute('aTextureCoord', uvsBuffer, 2, false, TYPES.FLOAT)\n .addIndex(indexBuffer);\n\n this._updateId = -1;\n }\n\n /**\n * If the vertex position is updated.\n * @readonly\n * @private\n */\n get vertexDirtyId(): number\n {\n return this.buffers[0]._updateID;\n }\n}\n"],"names":["Geometry","Buffer","TYPES"],"mappings":";;AAkBO,MAAM,qBAAqBA,KAAAA,SAClC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAgBI,YAAY,UAAyB,KAAoB,OACzD;AACU;AAEN,UAAM,iBAAiB,IAAIC,YAAO,QAAQ,GACpC,YAAY,IAAIA,KAAAA,OAAO,KAAK,EAAI,GAChC,cAAc,IAAIA,KAAO,OAAA,OAAO,IAAM,EAAI;AAE3C,SAAA,aAAa,mBAAmB,gBAAgB,GAAG,IAAOC,WAAM,KAAK,EACrE,aAAa,iBAAiB,WAAW,GAAG,IAAOA,WAAM,KAAK,EAC9D,SAAS,WAAW,GAEzB,KAAK,YAAY;AAAA,EACrB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,IAAI,gBACJ;AACW,WAAA,KAAK,QAAQ,CAAC,EAAE;AAAA,EAC3B;AACJ;;"}

View File

@@ -0,0 +1,25 @@
import { Geometry, Buffer, TYPES } from "@pixi/core";
class MeshGeometry extends Geometry {
/**
* @param {Float32Array|number[]} [vertices] - Positional data on geometry.
* @param {Float32Array|number[]} [uvs] - Texture UVs.
* @param {Uint16Array|number[]} [index] - IndexBuffer
*/
constructor(vertices, uvs, index) {
super();
const verticesBuffer = new Buffer(vertices), uvsBuffer = new Buffer(uvs, !0), indexBuffer = new Buffer(index, !0, !0);
this.addAttribute("aVertexPosition", verticesBuffer, 2, !1, TYPES.FLOAT).addAttribute("aTextureCoord", uvsBuffer, 2, !1, TYPES.FLOAT).addIndex(indexBuffer), this._updateId = -1;
}
/**
* If the vertex position is updated.
* @readonly
* @private
*/
get vertexDirtyId() {
return this.buffers[0]._updateID;
}
}
export {
MeshGeometry
};
//# sourceMappingURL=MeshGeometry.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"MeshGeometry.mjs","sources":["../src/MeshGeometry.ts"],"sourcesContent":["import { Buffer, Geometry, TYPES } from '@pixi/core';\n\nimport type { IArrayBuffer } from '@pixi/core';\n\n/**\n * Standard 2D geometry used in PixiJS.\n *\n * Geometry can be defined without passing in a style or data if required.\n * @example\n * import { Geometry } from 'pixi.js';\n *\n * const geometry = new Geometry();\n *\n * geometry.addAttribute('positions', [0, 0, 100, 0, 100, 100, 0, 100], 2);\n * geometry.addAttribute('uvs', [0, 0, 1, 0, 1, 1, 0, 1], 2);\n * geometry.addIndex([0, 1, 2, 1, 3, 2]);\n * @memberof PIXI\n */\nexport class MeshGeometry extends Geometry\n{\n // Internal-only properties\n /**\n * Dirty flag to limit update calls on Mesh. For example,\n * limiting updates on a single Mesh instance with a shared Geometry\n * within the render loop.\n * @private\n * @default -1\n */\n _updateId: number;\n\n /**\n * @param {Float32Array|number[]} [vertices] - Positional data on geometry.\n * @param {Float32Array|number[]} [uvs] - Texture UVs.\n * @param {Uint16Array|number[]} [index] - IndexBuffer\n */\n constructor(vertices?: IArrayBuffer, uvs?: IArrayBuffer, index?: IArrayBuffer)\n {\n super();\n\n const verticesBuffer = new Buffer(vertices);\n const uvsBuffer = new Buffer(uvs, true);\n const indexBuffer = new Buffer(index, true, true);\n\n this.addAttribute('aVertexPosition', verticesBuffer, 2, false, TYPES.FLOAT)\n .addAttribute('aTextureCoord', uvsBuffer, 2, false, TYPES.FLOAT)\n .addIndex(indexBuffer);\n\n this._updateId = -1;\n }\n\n /**\n * If the vertex position is updated.\n * @readonly\n * @private\n */\n get vertexDirtyId(): number\n {\n return this.buffers[0]._updateID;\n }\n}\n"],"names":[],"mappings":";AAkBO,MAAM,qBAAqB,SAClC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAgBI,YAAY,UAAyB,KAAoB,OACzD;AACU;AAEN,UAAM,iBAAiB,IAAI,OAAO,QAAQ,GACpC,YAAY,IAAI,OAAO,KAAK,EAAI,GAChC,cAAc,IAAI,OAAO,OAAO,IAAM,EAAI;AAE3C,SAAA,aAAa,mBAAmB,gBAAgB,GAAG,IAAO,MAAM,KAAK,EACrE,aAAa,iBAAiB,WAAW,GAAG,IAAO,MAAM,KAAK,EAC9D,SAAS,WAAW,GAEzB,KAAK,YAAY;AAAA,EACrB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,IAAI,gBACJ;AACW,WAAA,KAAK,QAAQ,CAAC,EAAE;AAAA,EAC3B;AACJ;"}

View File

@@ -0,0 +1,71 @@
"use strict";
var core = require("@pixi/core"), mesh$1 = require("./shader/mesh.frag.js"), mesh = require("./shader/mesh.vert.js");
class MeshMaterial extends core.Shader {
/**
* @param uSampler - Texture that material uses to render.
* @param options - Additional options
* @param {number} [options.alpha=1] - Default alpha.
* @param {PIXI.ColorSource} [options.tint=0xFFFFFF] - Default tint.
* @param {string} [options.pluginName='batch'] - Renderer plugin for batching.
* @param {PIXI.Program} [options.program=0xFFFFFF] - Custom program.
* @param {object} [options.uniforms] - Custom uniforms.
*/
constructor(uSampler, options) {
const uniforms = {
uSampler,
alpha: 1,
uTextureMatrix: core.Matrix.IDENTITY,
uColor: new Float32Array([1, 1, 1, 1])
};
options = Object.assign({
tint: 16777215,
alpha: 1,
pluginName: "batch"
}, options), options.uniforms && Object.assign(uniforms, options.uniforms), super(options.program || core.Program.from(mesh.default, mesh$1.default), uniforms), this._colorDirty = !1, this.uvMatrix = new core.TextureMatrix(uSampler), this.batchable = options.program === void 0, this.pluginName = options.pluginName, this._tintColor = new core.Color(options.tint), this._tintRGB = this._tintColor.toLittleEndianNumber(), this._colorDirty = !0, this.alpha = options.alpha;
}
/** Reference to the texture being rendered. */
get texture() {
return this.uniforms.uSampler;
}
set texture(value) {
this.uniforms.uSampler !== value && (!this.uniforms.uSampler.baseTexture.alphaMode != !value.baseTexture.alphaMode && (this._colorDirty = !0), this.uniforms.uSampler = value, this.uvMatrix.texture = value);
}
/**
* This gets automatically set by the object using this.
* @default 1
*/
set alpha(value) {
value !== this._alpha && (this._alpha = value, this._colorDirty = !0);
}
get alpha() {
return this._alpha;
}
/**
* Multiply tint for the material.
* @default 0xFFFFFF
*/
set tint(value) {
value !== this.tint && (this._tintColor.setValue(value), this._tintRGB = this._tintColor.toLittleEndianNumber(), this._colorDirty = !0);
}
get tint() {
return this._tintColor.value;
}
/**
* Get the internal number from tint color
* @ignore
*/
get tintValue() {
return this._tintColor.toNumber();
}
/** Gets called automatically by the Mesh. Intended to be overridden for custom {@link PIXI.MeshMaterial} objects. */
update() {
if (this._colorDirty) {
this._colorDirty = !1;
const applyToChannels = this.texture.baseTexture.alphaMode;
core.Color.shared.setValue(this._tintColor).premultiply(this._alpha, applyToChannels).toArray(this.uniforms.uColor);
}
this.uvMatrix.update() && (this.uniforms.uTextureMatrix = this.uvMatrix.mapCoord);
}
}
exports.MeshMaterial = MeshMaterial;
//# sourceMappingURL=MeshMaterial.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,74 @@
import { Shader, Matrix, Program, TextureMatrix, Color } from "@pixi/core";
import fragment from "./shader/mesh.frag.mjs";
import vertex from "./shader/mesh.vert.mjs";
class MeshMaterial extends Shader {
/**
* @param uSampler - Texture that material uses to render.
* @param options - Additional options
* @param {number} [options.alpha=1] - Default alpha.
* @param {PIXI.ColorSource} [options.tint=0xFFFFFF] - Default tint.
* @param {string} [options.pluginName='batch'] - Renderer plugin for batching.
* @param {PIXI.Program} [options.program=0xFFFFFF] - Custom program.
* @param {object} [options.uniforms] - Custom uniforms.
*/
constructor(uSampler, options) {
const uniforms = {
uSampler,
alpha: 1,
uTextureMatrix: Matrix.IDENTITY,
uColor: new Float32Array([1, 1, 1, 1])
};
options = Object.assign({
tint: 16777215,
alpha: 1,
pluginName: "batch"
}, options), options.uniforms && Object.assign(uniforms, options.uniforms), super(options.program || Program.from(vertex, fragment), uniforms), this._colorDirty = !1, this.uvMatrix = new TextureMatrix(uSampler), this.batchable = options.program === void 0, this.pluginName = options.pluginName, this._tintColor = new Color(options.tint), this._tintRGB = this._tintColor.toLittleEndianNumber(), this._colorDirty = !0, this.alpha = options.alpha;
}
/** Reference to the texture being rendered. */
get texture() {
return this.uniforms.uSampler;
}
set texture(value) {
this.uniforms.uSampler !== value && (!this.uniforms.uSampler.baseTexture.alphaMode != !value.baseTexture.alphaMode && (this._colorDirty = !0), this.uniforms.uSampler = value, this.uvMatrix.texture = value);
}
/**
* This gets automatically set by the object using this.
* @default 1
*/
set alpha(value) {
value !== this._alpha && (this._alpha = value, this._colorDirty = !0);
}
get alpha() {
return this._alpha;
}
/**
* Multiply tint for the material.
* @default 0xFFFFFF
*/
set tint(value) {
value !== this.tint && (this._tintColor.setValue(value), this._tintRGB = this._tintColor.toLittleEndianNumber(), this._colorDirty = !0);
}
get tint() {
return this._tintColor.value;
}
/**
* Get the internal number from tint color
* @ignore
*/
get tintValue() {
return this._tintColor.toNumber();
}
/** Gets called automatically by the Mesh. Intended to be overridden for custom {@link PIXI.MeshMaterial} objects. */
update() {
if (this._colorDirty) {
this._colorDirty = !1;
const applyToChannels = this.texture.baseTexture.alphaMode;
Color.shared.setValue(this._tintColor).premultiply(this._alpha, applyToChannels).toArray(this.uniforms.uColor);
}
this.uvMatrix.update() && (this.uniforms.uTextureMatrix = this.uvMatrix.mapCoord);
}
}
export {
MeshMaterial
};
//# sourceMappingURL=MeshMaterial.mjs.map

File diff suppressed because one or more lines are too long

7
resources/app/node_modules/@pixi/mesh/lib/index.js generated vendored Normal file
View File

@@ -0,0 +1,7 @@
"use strict";
var Mesh = require("./Mesh.js"), MeshBatchUvs = require("./MeshBatchUvs.js"), MeshGeometry = require("./MeshGeometry.js"), MeshMaterial = require("./MeshMaterial.js");
exports.Mesh = Mesh.Mesh;
exports.MeshBatchUvs = MeshBatchUvs.MeshBatchUvs;
exports.MeshGeometry = MeshGeometry.MeshGeometry;
exports.MeshMaterial = MeshMaterial.MeshMaterial;
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}

11
resources/app/node_modules/@pixi/mesh/lib/index.mjs generated vendored Normal file
View File

@@ -0,0 +1,11 @@
import { Mesh } from "./Mesh.mjs";
import { MeshBatchUvs } from "./MeshBatchUvs.mjs";
import { MeshGeometry } from "./MeshGeometry.mjs";
import { MeshMaterial } from "./MeshMaterial.mjs";
export {
Mesh,
MeshBatchUvs,
MeshGeometry,
MeshMaterial
};
//# sourceMappingURL=index.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: !0 });
var fragment = `varying vec2 vTextureCoord;
uniform vec4 uColor;
uniform sampler2D uSampler;
void main(void)
{
gl_FragColor = texture2D(uSampler, vTextureCoord) * uColor;
}
`;
exports.default = fragment;
//# sourceMappingURL=mesh.frag.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"mesh.frag.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;"}

View File

@@ -0,0 +1,14 @@
var fragment = `varying vec2 vTextureCoord;
uniform vec4 uColor;
uniform sampler2D uSampler;
void main(void)
{
gl_FragColor = texture2D(uSampler, vTextureCoord) * uColor;
}
`;
export {
fragment as default
};
//# sourceMappingURL=mesh.frag.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"mesh.frag.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;"}

View File

@@ -0,0 +1,20 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: !0 });
var vertex = `attribute vec2 aVertexPosition;
attribute vec2 aTextureCoord;
uniform mat3 projectionMatrix;
uniform mat3 translationMatrix;
uniform mat3 uTextureMatrix;
varying vec2 vTextureCoord;
void main(void)
{
gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
vTextureCoord = (uTextureMatrix * vec3(aTextureCoord, 1.0)).xy;
}
`;
exports.default = vertex;
//# sourceMappingURL=mesh.vert.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"mesh.vert.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;"}

View File

@@ -0,0 +1,20 @@
var vertex = `attribute vec2 aVertexPosition;
attribute vec2 aTextureCoord;
uniform mat3 projectionMatrix;
uniform mat3 translationMatrix;
uniform mat3 uTextureMatrix;
varying vec2 vTextureCoord;
void main(void)
{
gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
vTextureCoord = (uTextureMatrix * vec3(aTextureCoord, 1.0)).xy;
}
`;
export {
vertex as default
};
//# sourceMappingURL=mesh.vert.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"mesh.vert.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;"}