Files
il/resources/public/js/cljs-runtime/module$node_modules$pixi_DOT_js$lib$scene$mesh_perspective$PerspectiveMesh.js
2026-07-01 22:38:29 -06:00

40 lines
2.3 KiB
JavaScript

shadow$provide.module$node_modules$pixi_DOT_js$lib$scene$mesh_perspective$PerspectiveMesh = function(global, require, module, exports) {
global = require("module$node_modules$pixi_DOT_js$lib$rendering$renderers$shared$texture$Texture");
var definedProps = require("module$node_modules$pixi_DOT_js$lib$scene$container$utils$definedProps");
module = require("module$node_modules$pixi_DOT_js$lib$scene$mesh$shared$Mesh");
var PerspectivePlaneGeometry = require("module$node_modules$pixi_DOT_js$lib$scene$mesh_perspective$PerspectivePlaneGeometry");
"use strict";
const node_modules$pixi_DOT_js$lib$scene$mesh_perspective$PerspectiveMesh$classdecl$var47 = class extends module.Mesh {
constructor(options) {
options = {...node_modules$pixi_DOT_js$lib$scene$mesh_perspective$PerspectiveMesh$classdecl$var47.defaultOptions, ...options};
const {texture, verticesX, verticesY, ...rest} = options, planeGeometry = new PerspectivePlaneGeometry.PerspectivePlaneGeometry(definedProps.definedProps({width:texture.width, height:texture.height, verticesX, verticesY}));
super(definedProps.definedProps({...rest, geometry:planeGeometry}));
this._texture = texture;
this.geometry.setCorners(options.x0, options.y0, options.x1, options.y1, options.x2, options.y2, options.x3, options.y3);
}
textureUpdated() {
const geometry = this.geometry;
if (geometry) {
var {width, height} = this.texture;
if (geometry.width !== width || geometry.height !== height) {
geometry.width = width, geometry.height = height, geometry.updateProjection();
}
}
}
set texture(value) {
this._texture !== value && (super.texture = value, this.textureUpdated());
}
get texture() {
return this._texture;
}
setCorners(x0, y0, x1, y1, x2, y2, x3, y3) {
this.geometry.setCorners(x0, y0, x1, y1, x2, y2, x3, y3);
}
};
require = node_modules$pixi_DOT_js$lib$scene$mesh_perspective$PerspectiveMesh$classdecl$var47;
require.defaultOptions = {texture:global.Texture.WHITE, verticesX:10, verticesY:10, x0:0, y0:0, x1:100, y1:0, x2:100, y2:100, x3:0, y3:100};
exports.PerspectiveMesh = require;
};
//# sourceMappingURL=module$node_modules$pixi_DOT_js$lib$scene$mesh_perspective$PerspectiveMesh.js.map