123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159 |
- import {
- e
- } from "./chunk-X6GHUY4U.js";
- import {
- A,
- B,
- L,
- T,
- V,
- a,
- b,
- c,
- d,
- g,
- h,
- i,
- j,
- l,
- m,
- o,
- p,
- q,
- u,
- x,
- y
- } from "./chunk-HIELTLML.js";
- // node_modules/@arcgis/core/views/3d/support/buffer/InterleavedLayout.js
- var v = class {
- constructor(e2, t) {
- this.layout = e2, this.buffer = "number" == typeof t ? new ArrayBuffer(t * e2.stride) : t;
- for (const i2 of e2.fieldNames) {
- const t2 = e2.fields.get(i2);
- this[i2] = new t2.constructor(this.buffer, t2.offset, this.stride);
- }
- }
- get stride() {
- return this.layout.stride;
- }
- get count() {
- return this.buffer.byteLength / this.stride;
- }
- get byteLength() {
- return this.buffer.byteLength;
- }
- getField(e2, t) {
- const i2 = this[e2];
- return i2 && i2.elementCount === t.ElementCount && i2.elementType === t.ElementType ? i2 : null;
- }
- slice(e2, t) {
- return new v(this.layout, this.buffer.slice(e2 * this.stride, t * this.stride));
- }
- copyFrom(e2, t, i2, s) {
- const r = this.stride;
- if (r % 4 == 0) {
- const n = new Uint32Array(e2.buffer, t * r, s * r / 4);
- new Uint32Array(this.buffer, i2 * r, s * r / 4).set(n);
- } else {
- const n = new Uint8Array(e2.buffer, t * r, s * r);
- new Uint8Array(this.buffer, i2 * r, s * r).set(n);
- }
- }
- };
- var N = class {
- constructor() {
- this.stride = 0, this.fields = /* @__PURE__ */ new Map(), this.fieldNames = [];
- }
- vec2f(t, i2) {
- return this._appendField(t, u, i2), this;
- }
- vec2f64(e2, i2) {
- return this._appendField(e2, m, i2), this;
- }
- vec3f(e2, t) {
- return this._appendField(e2, i, t), this;
- }
- vec3f64(e2, t) {
- return this._appendField(e2, T, t), this;
- }
- vec4f(e2, t) {
- return this._appendField(e2, c, t), this;
- }
- vec4f64(e2, t) {
- return this._appendField(e2, h, t), this;
- }
- mat3f(e2, t) {
- return this._appendField(e2, l, t), this;
- }
- mat3f64(e2, t) {
- return this._appendField(e2, a, t), this;
- }
- mat4f(e2, t) {
- return this._appendField(e2, p, t), this;
- }
- mat4f64(e2, t) {
- return this._appendField(e2, b, t), this;
- }
- vec4u8(e2, t) {
- return this._appendField(e2, x, t), this;
- }
- f32(e2, t) {
- return this._appendField(e2, y, t), this;
- }
- f64(e2, t) {
- return this._appendField(e2, o, t), this;
- }
- u8(e2, t) {
- return this._appendField(e2, d, t), this;
- }
- u16(e2, t) {
- return this._appendField(e2, g, t), this;
- }
- i8(e2, t) {
- return this._appendField(e2, j, t), this;
- }
- vec2i8(e2, t) {
- return this._appendField(e2, V, t), this;
- }
- vec2i16(e2, t) {
- return this._appendField(e2, q, t), this;
- }
- vec2u8(e2, t) {
- return this._appendField(e2, A, t), this;
- }
- vec4u16(e2, t) {
- return this._appendField(e2, L, t), this;
- }
- u32(e2, t) {
- return this._appendField(e2, B, t), this;
- }
- _appendField(e2, t, i2) {
- const s = t.ElementCount * e(t.ElementType), r = this.stride;
- this.fields.set(e2, { size: s, constructor: t, offset: r, optional: i2 }), this.stride += s, this.fieldNames.push(e2);
- }
- alignTo(e2) {
- return this.stride = Math.floor((this.stride + e2 - 1) / e2) * e2, this;
- }
- hasField(e2) {
- return this.fieldNames.includes(e2);
- }
- createBuffer(e2) {
- return new v(this, e2);
- }
- createView(e2) {
- return new v(this, e2);
- }
- clone() {
- const e2 = new N();
- return e2.stride = this.stride, e2.fields = /* @__PURE__ */ new Map(), this.fields.forEach((t, i2) => e2.fields.set(i2, t)), e2.fieldNames = this.fieldNames.slice(), e2.BufferType = this.BufferType, e2;
- }
- };
- function T2() {
- return new N();
- }
- export {
- T2 as T
- };
- //# sourceMappingURL=chunk-AGGGC2FA.js.map
|