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

46 lines
2.5 KiB
JavaScript

shadow$provide.module$node_modules$pixi_DOT_js$lib$scene$mesh_plane$PlaneGeometry = function(global, require, module, exports) {
var deprecation = require("module$node_modules$pixi_DOT_js$lib$utils$logging$deprecation");
global = require("module$node_modules$pixi_DOT_js$lib$scene$mesh$shared$MeshGeometry");
"use strict";
const node_modules$pixi_DOT_js$lib$scene$mesh_plane$PlaneGeometry$classdecl$var46 = class extends global.MeshGeometry {
constructor(...args) {
super({});
let options = args[0] ?? {};
"number" === typeof options && (deprecation.deprecation(deprecation.v8_0_0, "PlaneGeometry constructor changed please use { width, height, verticesX, verticesY } instead"), options = {width:options, height:args[1], verticesX:args[2], verticesY:args[3]});
this.build(options);
}
build(options) {
options = {...node_modules$pixi_DOT_js$lib$scene$mesh_plane$PlaneGeometry$classdecl$var46.defaultOptions, ...options};
this.verticesX = this.verticesX ?? options.verticesX;
this.verticesY = this.verticesY ?? options.verticesY;
this.width = this.width ?? options.width;
this.height = this.height ?? options.height;
var total = this.verticesX * this.verticesY;
options = [];
const uvs = [], indices = [], verticesX = this.verticesX - 1;
var verticesY = this.verticesY - 1, sizeX = this.width / verticesX, sizeY = this.height / verticesY;
for (var i = 0; i < total; i++) {
var x = i % this.verticesX;
const y = i / this.verticesX | 0;
options.push(x * sizeX, y * sizeY);
uvs.push(x / verticesX, y / verticesY);
}
total = verticesX * verticesY;
for (verticesY = 0; verticesY < total; verticesY++) {
sizeX = verticesY % verticesX, sizeY = verticesY / verticesX | 0, i = sizeY * this.verticesX + sizeX + 1, x = (sizeY + 1) * this.verticesX + sizeX, indices.push(sizeY * this.verticesX + sizeX, i, x, i, (sizeY + 1) * this.verticesX + sizeX + 1, x);
}
this.buffers[0].data = new Float32Array(options);
this.buffers[1].data = new Float32Array(uvs);
this.indexBuffer.data = new Uint32Array(indices);
this.buffers[0].update();
this.buffers[1].update();
this.indexBuffer.update();
}
};
global = node_modules$pixi_DOT_js$lib$scene$mesh_plane$PlaneGeometry$classdecl$var46;
global.defaultOptions = {width:100, height:100, verticesX:10, verticesY:10};
exports.PlaneGeometry = global;
};
//# sourceMappingURL=module$node_modules$pixi_DOT_js$lib$scene$mesh_plane$PlaneGeometry.js.map