chunk-AGGGC2FA.js 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. import {
  2. e
  3. } from "./chunk-X6GHUY4U.js";
  4. import {
  5. A,
  6. B,
  7. L,
  8. T,
  9. V,
  10. a,
  11. b,
  12. c,
  13. d,
  14. g,
  15. h,
  16. i,
  17. j,
  18. l,
  19. m,
  20. o,
  21. p,
  22. q,
  23. u,
  24. x,
  25. y
  26. } from "./chunk-HIELTLML.js";
  27. // node_modules/@arcgis/core/views/3d/support/buffer/InterleavedLayout.js
  28. var v = class {
  29. constructor(e2, t) {
  30. this.layout = e2, this.buffer = "number" == typeof t ? new ArrayBuffer(t * e2.stride) : t;
  31. for (const i2 of e2.fieldNames) {
  32. const t2 = e2.fields.get(i2);
  33. this[i2] = new t2.constructor(this.buffer, t2.offset, this.stride);
  34. }
  35. }
  36. get stride() {
  37. return this.layout.stride;
  38. }
  39. get count() {
  40. return this.buffer.byteLength / this.stride;
  41. }
  42. get byteLength() {
  43. return this.buffer.byteLength;
  44. }
  45. getField(e2, t) {
  46. const i2 = this[e2];
  47. return i2 && i2.elementCount === t.ElementCount && i2.elementType === t.ElementType ? i2 : null;
  48. }
  49. slice(e2, t) {
  50. return new v(this.layout, this.buffer.slice(e2 * this.stride, t * this.stride));
  51. }
  52. copyFrom(e2, t, i2, s) {
  53. const r = this.stride;
  54. if (r % 4 == 0) {
  55. const n = new Uint32Array(e2.buffer, t * r, s * r / 4);
  56. new Uint32Array(this.buffer, i2 * r, s * r / 4).set(n);
  57. } else {
  58. const n = new Uint8Array(e2.buffer, t * r, s * r);
  59. new Uint8Array(this.buffer, i2 * r, s * r).set(n);
  60. }
  61. }
  62. };
  63. var N = class {
  64. constructor() {
  65. this.stride = 0, this.fields = /* @__PURE__ */ new Map(), this.fieldNames = [];
  66. }
  67. vec2f(t, i2) {
  68. return this._appendField(t, u, i2), this;
  69. }
  70. vec2f64(e2, i2) {
  71. return this._appendField(e2, m, i2), this;
  72. }
  73. vec3f(e2, t) {
  74. return this._appendField(e2, i, t), this;
  75. }
  76. vec3f64(e2, t) {
  77. return this._appendField(e2, T, t), this;
  78. }
  79. vec4f(e2, t) {
  80. return this._appendField(e2, c, t), this;
  81. }
  82. vec4f64(e2, t) {
  83. return this._appendField(e2, h, t), this;
  84. }
  85. mat3f(e2, t) {
  86. return this._appendField(e2, l, t), this;
  87. }
  88. mat3f64(e2, t) {
  89. return this._appendField(e2, a, t), this;
  90. }
  91. mat4f(e2, t) {
  92. return this._appendField(e2, p, t), this;
  93. }
  94. mat4f64(e2, t) {
  95. return this._appendField(e2, b, t), this;
  96. }
  97. vec4u8(e2, t) {
  98. return this._appendField(e2, x, t), this;
  99. }
  100. f32(e2, t) {
  101. return this._appendField(e2, y, t), this;
  102. }
  103. f64(e2, t) {
  104. return this._appendField(e2, o, t), this;
  105. }
  106. u8(e2, t) {
  107. return this._appendField(e2, d, t), this;
  108. }
  109. u16(e2, t) {
  110. return this._appendField(e2, g, t), this;
  111. }
  112. i8(e2, t) {
  113. return this._appendField(e2, j, t), this;
  114. }
  115. vec2i8(e2, t) {
  116. return this._appendField(e2, V, t), this;
  117. }
  118. vec2i16(e2, t) {
  119. return this._appendField(e2, q, t), this;
  120. }
  121. vec2u8(e2, t) {
  122. return this._appendField(e2, A, t), this;
  123. }
  124. vec4u16(e2, t) {
  125. return this._appendField(e2, L, t), this;
  126. }
  127. u32(e2, t) {
  128. return this._appendField(e2, B, t), this;
  129. }
  130. _appendField(e2, t, i2) {
  131. const s = t.ElementCount * e(t.ElementType), r = this.stride;
  132. this.fields.set(e2, { size: s, constructor: t, offset: r, optional: i2 }), this.stride += s, this.fieldNames.push(e2);
  133. }
  134. alignTo(e2) {
  135. return this.stride = Math.floor((this.stride + e2 - 1) / e2) * e2, this;
  136. }
  137. hasField(e2) {
  138. return this.fieldNames.includes(e2);
  139. }
  140. createBuffer(e2) {
  141. return new v(this, e2);
  142. }
  143. createView(e2) {
  144. return new v(this, e2);
  145. }
  146. clone() {
  147. const e2 = new N();
  148. 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;
  149. }
  150. };
  151. function T2() {
  152. return new N();
  153. }
  154. export {
  155. T2 as T
  156. };
  157. //# sourceMappingURL=chunk-AGGGC2FA.js.map