@jdultra/threedtiles 13.1.3 → 13.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,7 +2,7 @@ var Zt = Object.defineProperty;
2
2
  var $t = (c, e, a) => e in c ? Zt(c, e, { enumerable: !0, configurable: !0, writable: !0, value: a }) : c[e] = a;
3
3
  var ge = (c, e, a) => $t(c, typeof e != "symbol" ? e + "" : e, a);
4
4
  import * as E from "three";
5
- import { Matrix3 as Fa, Vector3 as D, Box3 as Ra, Matrix4 as Se, Ray as eA, BufferGeometry as ea, LineBasicMaterial as It, LineSegments as mt, BufferAttribute as he, TrianglesDrawMode as aA, TriangleFanDrawMode as ya, TriangleStripDrawMode as Bt, Loader as Ma, LoaderUtils as Le, FileLoader as Ce, Color as le, LinearSRGBColorSpace as K, SpotLight as tA, PointLight as AA, DirectionalLight as iA, MeshBasicMaterial as Ge, SRGBColorSpace as re, MeshPhysicalMaterial as ae, Vector2 as Ct, Quaternion as pt, InstancedMesh as sA, InstancedBufferAttribute as wa, Object3D as Et, TextureLoader as rA, ImageBitmapLoader as nA, InterleavedBuffer as oA, InterleavedBufferAttribute as cA, LinearFilter as Be, LinearMipmapLinearFilter as $e, RepeatWrapping as ka, NearestFilter as v, PointsMaterial as bA, Material as ta, MeshStandardMaterial as Ha, DoubleSide as dA, PropertyBinding as hA, SkinnedMesh as lA, Mesh as xa, Line as gA, LineLoop as fA, Points as uA, Group as Aa, PerspectiveCamera as IA, MathUtils as mA, OrthographicCamera as Qt, Skeleton as BA, AnimationClip as CA, Bone as pA, InterpolateLinear as yt, ColorManagement as ja, NearestMipmapNearestFilter as EA, LinearMipmapNearestFilter as QA, NearestMipmapLinearFilter as yA, ClampToEdgeWrapping as wA, MirroredRepeatWrapping as kA, InterpolateDiscrete as xA, FrontSide as Ze, Texture as Na, VectorKeyframeTrack as La, NumberKeyframeTrack as Oa, QuaternionKeyframeTrack as Ja, Sphere as jA, Interpolant as SA, CompressedCubeTexture as DA, CompressedArrayTexture as vA, CompressedTexture as Pa, RGBAFormat as ee, RGBA_ASTC_4x4_Format as wt, RGB_BPTC_UNSIGNED_Format as FA, RGBA_BPTC_Format as RA, RGBA_ETC2_EAC_Format as MA, RGBA_PVRTC_4BPPV1_Format as TA, RGBA_S3TC_DXT5_Format as GA, RGB_ETC1_Format as UA, RGB_ETC2_Format as HA, RGB_PVRTC_4BPPV1_Format as NA, RGBA_S3TC_DXT1_Format as LA, UnsignedByteType as X, HalfFloatType as ke, FloatType as R, DataTexture as Ue, Data3DTexture as OA, NoColorSpace as JA, RGFormat as He, RedFormat as Ne, RGBA_ASTC_6x6_Format as qa, WebGL3DRenderTarget as ne, ShaderMaterial as ia, InstancedBufferGeometry as _a, DynamicDrawUsage as Ka, Scene as PA, PlaneGeometry as qA } from "three";
5
+ import { Matrix3 as Fa, Vector3 as D, Box3 as Ra, Matrix4 as Se, Ray as eA, BufferGeometry as ea, LineBasicMaterial as It, LineSegments as mt, BufferAttribute as he, TrianglesDrawMode as aA, TriangleFanDrawMode as ya, TriangleStripDrawMode as Bt, Loader as Ma, LoaderUtils as Le, FileLoader as Ce, Color as le, LinearSRGBColorSpace as K, SpotLight as tA, PointLight as AA, DirectionalLight as iA, MeshBasicMaterial as Ge, SRGBColorSpace as re, MeshPhysicalMaterial as ae, Vector2 as Ct, Quaternion as pt, InstancedMesh as sA, InstancedBufferAttribute as wa, Object3D as Et, TextureLoader as rA, ImageBitmapLoader as nA, InterleavedBuffer as oA, InterleavedBufferAttribute as cA, LinearFilter as Be, LinearMipmapLinearFilter as $e, RepeatWrapping as ka, NearestFilter as v, PointsMaterial as bA, Material as ta, MeshStandardMaterial as Ha, DoubleSide as dA, PropertyBinding as hA, SkinnedMesh as lA, Mesh as xa, Line as gA, LineLoop as fA, Points as uA, Group as Aa, PerspectiveCamera as IA, MathUtils as mA, OrthographicCamera as Qt, Skeleton as BA, AnimationClip as CA, Bone as pA, InterpolateLinear as yt, ColorManagement as ja, NearestMipmapNearestFilter as EA, LinearMipmapNearestFilter as QA, NearestMipmapLinearFilter as yA, ClampToEdgeWrapping as wA, MirroredRepeatWrapping as kA, InterpolateDiscrete as xA, FrontSide as Ze, Texture as Na, VectorKeyframeTrack as La, NumberKeyframeTrack as Oa, QuaternionKeyframeTrack as Pa, Sphere as jA, Interpolant as SA, CompressedCubeTexture as DA, CompressedArrayTexture as vA, CompressedTexture as Ja, RGBAFormat as ee, RGBA_ASTC_4x4_Format as wt, RGB_BPTC_UNSIGNED_Format as FA, RGBA_BPTC_Format as RA, RGBA_ETC2_EAC_Format as MA, RGBA_PVRTC_4BPPV1_Format as TA, RGBA_S3TC_DXT5_Format as GA, RGB_ETC1_Format as UA, RGB_ETC2_Format as HA, RGB_PVRTC_4BPPV1_Format as NA, RGBA_S3TC_DXT1_Format as LA, UnsignedByteType as X, HalfFloatType as ke, FloatType as R, DataTexture as Ue, Data3DTexture as OA, NoColorSpace as PA, RGFormat as He, RedFormat as Ne, RGBA_ASTC_6x6_Format as qa, WebGL3DRenderTarget as ne, ShaderMaterial as ia, InstancedBufferGeometry as _a, DynamicDrawUsage as Ka, Scene as JA, PlaneGeometry as qA } from "three";
6
6
  class es {
7
7
  constructor() {
8
8
  this.cullMap = [], this.cullMaterial = new E.MeshBasicMaterial({ vertexColors: !0 }), this.cullMaterial.side = E.FrontSide, this.cullTarget = this._createCullTarget(), this.cullPixels = new Uint8Array(4 * this.cullTarget.width * this.cullTarget.height);
@@ -943,7 +943,7 @@ class ui {
943
943
  const a = this.parser.json, t = a.nodes[e];
944
944
  if (!t.extensions || !t.extensions[this.name] || t.mesh === void 0) return null;
945
945
  const A = a.meshes[t.mesh];
946
- for (const o of A.primitives) if (o.mode !== J.TRIANGLES && o.mode !== J.TRIANGLE_STRIP && o.mode !== J.TRIANGLE_FAN && o.mode !== void 0) return null;
946
+ for (const o of A.primitives) if (o.mode !== P.TRIANGLES && o.mode !== P.TRIANGLE_STRIP && o.mode !== P.TRIANGLE_FAN && o.mode !== void 0) return null;
947
947
  const i = t.extensions[this.name].attributes, s = [], r = {};
948
948
  for (const o in i) s.push(this.parser.getDependency("accessor", i[o]).then((n) => (r[o] = n, r[o])));
949
949
  return s.length < 1 ? null : (s.push(this.parser.createNodeMesh(e)), Promise.all(s).then((o) => {
@@ -1055,7 +1055,7 @@ class yi extends Ft {
1055
1055
  return Qi.fromArray(i).normalize().toArray(i), i;
1056
1056
  }
1057
1057
  }
1058
- const J = { FLOAT: 5126, FLOAT_MAT3: 35675, FLOAT_MAT4: 35676, FLOAT_VEC2: 35664, FLOAT_VEC3: 35665, FLOAT_VEC4: 35666, LINEAR: 9729, REPEAT: 10497, SAMPLER_2D: 35678, POINTS: 0, LINES: 1, LINE_LOOP: 2, LINE_STRIP: 3, TRIANGLES: 4, TRIANGLE_STRIP: 5, TRIANGLE_FAN: 6, UNSIGNED_BYTE: 5121, UNSIGNED_SHORT: 5123 }, xe = { 5120: Int8Array, 5121: Uint8Array, 5122: Int16Array, 5123: Uint16Array, 5125: Uint32Array, 5126: Float32Array }, $a = { 9728: v, 9729: Be, 9984: EA, 9985: QA, 9986: yA, 9987: $e }, et = { 33071: wA, 33648: kA, 10497: ka }, na = { SCALAR: 1, VEC2: 2, VEC3: 3, VEC4: 4, MAT2: 4, MAT3: 9, MAT4: 16 }, Sa = { POSITION: "position", NORMAL: "normal", TANGENT: "tangent", TEXCOORD_0: "uv", TEXCOORD_1: "uv1", TEXCOORD_2: "uv2", TEXCOORD_3: "uv3", COLOR_0: "color", WEIGHTS_0: "skinWeight", JOINTS_0: "skinIndex" }, oe = { scale: "scale", translation: "position", rotation: "quaternion", weights: "morphTargetInfluences" }, wi = { CUBICSPLINE: void 0, LINEAR: yt, STEP: xA }, ki = "OPAQUE", xi = "MASK", ji = "BLEND";
1058
+ const P = { FLOAT: 5126, FLOAT_MAT3: 35675, FLOAT_MAT4: 35676, FLOAT_VEC2: 35664, FLOAT_VEC3: 35665, FLOAT_VEC4: 35666, LINEAR: 9729, REPEAT: 10497, SAMPLER_2D: 35678, POINTS: 0, LINES: 1, LINE_LOOP: 2, LINE_STRIP: 3, TRIANGLES: 4, TRIANGLE_STRIP: 5, TRIANGLE_FAN: 6, UNSIGNED_BYTE: 5121, UNSIGNED_SHORT: 5123 }, xe = { 5120: Int8Array, 5121: Uint8Array, 5122: Int16Array, 5123: Uint16Array, 5125: Uint32Array, 5126: Float32Array }, $a = { 9728: v, 9729: Be, 9984: EA, 9985: QA, 9986: yA, 9987: $e }, et = { 33071: wA, 33648: kA, 10497: ka }, na = { SCALAR: 1, VEC2: 2, VEC3: 3, VEC4: 4, MAT2: 4, MAT3: 9, MAT4: 16 }, Sa = { POSITION: "position", NORMAL: "normal", TANGENT: "tangent", TEXCOORD_0: "uv", TEXCOORD_1: "uv1", TEXCOORD_2: "uv2", TEXCOORD_3: "uv3", COLOR_0: "color", WEIGHTS_0: "skinWeight", JOINTS_0: "skinIndex" }, oe = { scale: "scale", translation: "position", rotation: "quaternion", weights: "morphTargetInfluences" }, wi = { CUBICSPLINE: void 0, LINEAR: yt, STEP: xA }, ki = "OPAQUE", xi = "MASK", ji = "BLEND";
1059
1059
  function fe(c, e, a) {
1060
1060
  for (const t in a.extensions) c[t] === void 0 && (e.userData.gltfExtensions = e.userData.gltfExtensions || {}, e.userData.gltfExtensions[t] = a.extensions[t]);
1061
1061
  }
@@ -1446,12 +1446,12 @@ class Fi {
1446
1446
  const I = b[h], m = s[h];
1447
1447
  let u;
1448
1448
  const C = d[h];
1449
- if (m.mode === J.TRIANGLES || m.mode === J.TRIANGLE_STRIP || m.mode === J.TRIANGLE_FAN || m.mode === void 0) u = i.isSkinnedMesh === !0 ? new lA(I, C) : new xa(I, C), u.isSkinnedMesh === !0 && u.normalizeSkinWeights(), m.mode === J.TRIANGLE_STRIP ? u.geometry = Za(u.geometry, Bt) : m.mode === J.TRIANGLE_FAN && (u.geometry = Za(u.geometry, ya));
1450
- else if (m.mode === J.LINES) u = new mt(I, C);
1451
- else if (m.mode === J.LINE_STRIP) u = new gA(I, C);
1452
- else if (m.mode === J.LINE_LOOP) u = new fA(I, C);
1449
+ if (m.mode === P.TRIANGLES || m.mode === P.TRIANGLE_STRIP || m.mode === P.TRIANGLE_FAN || m.mode === void 0) u = i.isSkinnedMesh === !0 ? new lA(I, C) : new xa(I, C), u.isSkinnedMesh === !0 && u.normalizeSkinWeights(), m.mode === P.TRIANGLE_STRIP ? u.geometry = Za(u.geometry, Bt) : m.mode === P.TRIANGLE_FAN && (u.geometry = Za(u.geometry, ya));
1450
+ else if (m.mode === P.LINES) u = new mt(I, C);
1451
+ else if (m.mode === P.LINE_STRIP) u = new gA(I, C);
1452
+ else if (m.mode === P.LINE_LOOP) u = new fA(I, C);
1453
1453
  else {
1454
- if (m.mode !== J.POINTS) throw new Error("THREE.GLTFLoader: Primitive mode unsupported: " + m.mode);
1454
+ if (m.mode !== P.POINTS) throw new Error("THREE.GLTFLoader: Primitive mode unsupported: " + m.mode);
1455
1455
  u = new uA(I, C);
1456
1456
  }
1457
1457
  Object.keys(u.geometry.morphAttributes).length > 0 && Si(u, i), u.name = a.createUniqueName(i.name || "mesh_" + e), se(u, i), m.extensions && fe(A, u, m), a.assignFinalMaterial(u), g.push(u);
@@ -1575,7 +1575,7 @@ class Fi {
1575
1575
  n = Oa;
1576
1576
  break;
1577
1577
  case oe.rotation:
1578
- n = Ja;
1578
+ n = Pa;
1579
1579
  break;
1580
1580
  case oe.position:
1581
1581
  case oe.scale:
@@ -1602,7 +1602,7 @@ class Fi {
1602
1602
  }
1603
1603
  _createCubicSplineTrackInterpolant(e) {
1604
1604
  e.createInterpolant = function(a) {
1605
- return new (this instanceof Ja ? yi : Ft)(this.times, this.values, this.getValueSize() / 3, a);
1605
+ return new (this instanceof Pa ? yi : Ft)(this.times, this.values, this.getValueSize() / 3, a);
1606
1606
  }, e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline = !0;
1607
1607
  }
1608
1608
  }
@@ -1915,7 +1915,7 @@ class Mi {
1915
1915
  this.workers.forEach((e) => e.terminate()), this.workersResolve.length = 0, this.workers.length = 0, this.queue.length = 0, this.workerStatus = 0;
1916
1916
  }
1917
1917
  }
1918
- const Mt = 9, Tt = 15, Gt = 16, Ut = 22, Ht = 37, Nt = 43, Lt = 76, Ot = 83, Jt = 97, Pt = 100, qt = 103, _t = 109, Kt = 165, zt = 166, Ta = 1000066e3;
1918
+ const Mt = 9, Tt = 15, Gt = 16, Ut = 22, Ht = 37, Nt = 43, Lt = 76, Ot = 83, Pt = 97, Jt = 100, qt = 103, _t = 109, Kt = 165, zt = 166, Ta = 1000066e3;
1919
1919
  class Ti {
1920
1920
  constructor() {
1921
1921
  this.vkFormat = 0, this.typeSize = 1, this.pixelWidth = 0, this.pixelHeight = 0, this.pixelDepth = 0, this.layerCount = 0, this.faceCount = 1, this.supercompressionScheme = 0, this.levels = [], this.dataFormatDescriptor = [{ vendorId: 0, descriptorType: 0, descriptorBlockSize: 0, versionNumber: 2, colorModel: 0, colorPrimaries: 1, transferFunction: 2, flags: 0, texelBlockDimension: [0, 0, 0, 0], bytesPlane: [0, 0, 0, 0, 0, 0, 0, 0], samples: [] }], this.keyValue = {}, this.globalData = null;
@@ -2039,7 +2039,7 @@ class L extends Ma {
2039
2039
  if (a.faceCount === 6) b = new DA(i, o, n);
2040
2040
  else {
2041
2041
  const g = i[0].mipmaps;
2042
- b = a.layerCount > 1 ? new vA(g, s, r, a.layerCount, o, n) : new Pa(g, s, r, o, n);
2042
+ b = a.layerCount > 1 ? new vA(g, s, r, a.layerCount, o, n) : new Ja(g, s, r, o, n);
2043
2043
  }
2044
2044
  return b.minFilter = i[0].mipmaps.length === 1 ? Be : $e, b.magFilter = Be, b.generateMipmaps = !1, b.needsUpdate = !0, b.colorSpace = it(a), b.premultiplyAlpha = !!(1 & d), b;
2045
2045
  }
@@ -2061,17 +2061,17 @@ class L extends Ma {
2061
2061
  n.dataFormatDescriptor.length = 0, n.dataFormatDescriptor.push(y);
2062
2062
  const w = new Me(r, f, I, !0);
2063
2063
  for (; w._offset < I; ) {
2064
- const F = w._nextUint32(), G = w._scan(F), P = tt(G);
2065
- if (n.keyValue[P] = w._nextUint8Array(F - G.byteLength - 1), P.match(/^ktx/i)) {
2066
- const V = tt(n.keyValue[P]);
2067
- n.keyValue[P] = V.substring(0, V.lastIndexOf("\0"));
2064
+ const F = w._nextUint32(), G = w._scan(F), J = tt(G);
2065
+ if (n.keyValue[J] = w._nextUint8Array(F - G.byteLength - 1), J.match(/^ktx/i)) {
2066
+ const V = tt(n.keyValue[J]);
2067
+ n.keyValue[J] = V.substring(0, V.lastIndexOf("\0"));
2068
2068
  }
2069
2069
  w._skip(F % 4 ? 4 - F % 4 : 0);
2070
2070
  }
2071
2071
  if (u <= 0) return n;
2072
2072
  const p = new Me(r, m, u, !0), Q = p._nextUint16(), x = p._nextUint16(), j = p._nextUint32(), M = p._nextUint32(), O = p._nextUint32(), aa = p._nextUint32(), De = [];
2073
2073
  for (let F = 0; F < g; F++) De.push({ imageFlags: p._nextUint32(), rgbSliceByteOffset: p._nextUint32(), rgbSliceByteLength: p._nextUint32(), alphaSliceByteOffset: p._nextUint32(), alphaSliceByteLength: p._nextUint32() });
2074
- const Pe = m + p._offset, ve = Pe + j, Fe = ve + M, Re = Fe + O, qe = new Uint8Array(r.buffer, r.byteOffset + Pe, j), _e = new Uint8Array(r.buffer, r.byteOffset + ve, M), z = new Uint8Array(r.buffer, r.byteOffset + Fe, O), pe = new Uint8Array(r.buffer, r.byteOffset + Re, aa);
2074
+ const Je = m + p._offset, ve = Je + j, Fe = ve + M, Re = Fe + O, qe = new Uint8Array(r.buffer, r.byteOffset + Je, j), _e = new Uint8Array(r.buffer, r.byteOffset + ve, M), z = new Uint8Array(r.buffer, r.byteOffset + Fe, O), pe = new Uint8Array(r.buffer, r.byteOffset + Re, aa);
2075
2075
  return n.globalData = { endpointCount: Q, selectorCount: x, imageDescs: De, endpointsData: qe, selectorsData: _e, tablesData: z, extendedData: pe }, n;
2076
2076
  }(new Uint8Array(e)), A = t.vkFormat === Ta && t.dataFormatDescriptor[0].colorModel === 167;
2077
2077
  if (!(t.vkFormat === 0 || A && !this.workerConfig.astcHDRSupported)) return async function(r) {
@@ -2097,7 +2097,7 @@ class L extends Ma {
2097
2097
  if (Ui.has(fa[o])) b = r.pixelDepth === 0 ? new Ue(d[0].data, r.pixelWidth, r.pixelHeight) : new OA(d[0].data, r.pixelWidth, r.pixelHeight, r.pixelDepth);
2098
2098
  else {
2099
2099
  if (r.pixelDepth > 0) throw new Error("THREE.KTX2Loader: Unsupported pixelDepth.");
2100
- b = new Pa(d, r.pixelWidth, r.pixelHeight), b.minFilter = d.length === 1 ? Be : $e, b.magFilter = Be;
2100
+ b = new Ja(d, r.pixelWidth, r.pixelHeight), b.minFilter = d.length === 1 ? Be : $e, b.magFilter = Be;
2101
2101
  }
2102
2102
  return b.mipmaps = d, b.type = ua[o], b.format = fa[o], b.colorSpace = it(r), b.needsUpdate = !0, Promise.resolve(b);
2103
2103
  }(t);
@@ -2137,10 +2137,10 @@ L.BasisFormat = { ETC1S: 0, UASTC: 1, UASTC_HDR: 2 }, L.TranscoderFormat = { ETC
2137
2137
  if (!w.isHDR()) throw new Error("THREE.KTX2Loader: Unknown Basis encoding");
2138
2138
  Q = s.UASTC_HDR;
2139
2139
  }
2140
- const x = w.getWidth(), j = w.getHeight(), M = w.getLayers() || 1, O = w.getLevels(), aa = w.getFaces(), De = w.getHasAlpha(), Pe = w.getDFDFlags(), { transcoderFormat: ve, engineFormat: Fe, engineType: Re } = function(z, pe, F, G) {
2141
- const P = o[z];
2142
- for (let V = 0; V < P.length; V++) {
2143
- const q = P[V];
2140
+ const x = w.getWidth(), j = w.getHeight(), M = w.getLayers() || 1, O = w.getLevels(), aa = w.getFaces(), De = w.getHasAlpha(), Je = w.getDFDFlags(), { transcoderFormat: ve, engineFormat: Fe, engineType: Re } = function(z, pe, F, G) {
2141
+ const J = o[z];
2142
+ for (let V = 0; V < J.length; V++) {
2143
+ const q = J[V];
2144
2144
  if (!(q.if && !c[q.if]) && q.basisFormat.includes(z) && !(G && q.transcoderFormat.length < 2) && !(q.needsPowerOfTwo && (!n(pe) || !n(F))))
2145
2145
  return { transcoderFormat: q.transcoderFormat[G ? 1 : 0], engineFormat: q.engineFormat[G ? 1 : 0], engineType: q.engineType[0] };
2146
2146
  }
@@ -2153,21 +2153,21 @@ L.BasisFormat = { ETC1S: 0, UASTC: 1, UASTC_HDR: 2 }, L.TranscoderFormat = { ETC
2153
2153
  const pe = [];
2154
2154
  for (let F = 0; F < O; F++) {
2155
2155
  const G = [];
2156
- let P, V;
2156
+ let J, V;
2157
2157
  for (let Ee = 0; Ee < M; Ee++) {
2158
2158
  const Qe = w.getImageLevelInfo(F, Ee, z);
2159
- z !== 0 || F !== 0 || Ee !== 0 || Qe.origWidth % 4 == 0 && Qe.origHeight % 4 == 0 || console.warn("THREE.KTX2Loader: ETC1S and UASTC textures should use multiple-of-four dimensions."), O > 1 ? (P = Qe.origWidth, V = Qe.origHeight) : (P = Qe.width, V = Qe.height);
2159
+ z !== 0 || F !== 0 || Ee !== 0 || Qe.origWidth % 4 == 0 && Qe.origHeight % 4 == 0 || console.warn("THREE.KTX2Loader: ETC1S and UASTC textures should use multiple-of-four dimensions."), O > 1 ? (J = Qe.origWidth, V = Qe.origHeight) : (J = Qe.width, V = Qe.height);
2160
2160
  let ye = new Uint8Array(w.getImageTranscodedSizeInBytes(F, Ee, 0, ve));
2161
2161
  const Xt = w.transcodeImage(ye, F, Ee, z, ve, 0, -1, -1);
2162
2162
  if (Re === A.HalfFloatType && (ye = new Uint16Array(ye.buffer, ye.byteOffset, ye.byteLength / Uint16Array.BYTES_PER_ELEMENT)), !Xt) throw p(), new Error("THREE.KTX2Loader: .transcodeImage failed.");
2163
2163
  G.push(ye);
2164
2164
  }
2165
2165
  const q = d(G);
2166
- pe.push({ data: q, width: P, height: V }), _e.push(q.buffer);
2166
+ pe.push({ data: q, width: J, height: V }), _e.push(q.buffer);
2167
2167
  }
2168
2168
  qe.push({ mipmaps: pe, width: x, height: j, format: Fe, type: Re });
2169
2169
  }
2170
- return p(), { faces: qe, buffers: _e, width: x, height: j, hasAlpha: De, dfdFlags: Pe, format: Fe, type: Re };
2170
+ return p(), { faces: qe, buffers: _e, width: x, height: j, hasAlpha: De, dfdFlags: Je, format: Fe, type: Re };
2171
2171
  }(g.buffer);
2172
2172
  self.postMessage({ type: "transcode", id: g.id, data: { faces: h, width: I, height: m, hasAlpha: u, format: C, type: B, dfdFlags: y } }, f);
2173
2173
  } catch (h) {
@@ -2195,10 +2195,10 @@ L.BasisFormat = { ETC1S: 0, UASTC: 1, UASTC_HDR: 2 }, L.TranscoderFormat = { ETC
2195
2195
  return l;
2196
2196
  }
2197
2197
  };
2198
- const Ui = /* @__PURE__ */ new Set([ee, He, Ne]), fa = { [_t]: ee, [Jt]: ee, [Ht]: ee, [Nt]: ee, [qt]: He, [Ot]: He, [Gt]: He, [Ut]: He, [Pt]: Ne, [Lt]: Ne, [Tt]: Ne, [Mt]: Ne, [Ta]: wt, [zt]: qa, [Kt]: qa }, ua = { [_t]: R, [Jt]: ke, [Ht]: X, [Nt]: X, [qt]: R, [Ot]: ke, [Gt]: X, [Ut]: X, [Pt]: R, [Lt]: ke, [Tt]: X, [Mt]: X, [Ta]: ke, [zt]: X, [Kt]: X };
2198
+ const Ui = /* @__PURE__ */ new Set([ee, He, Ne]), fa = { [_t]: ee, [Pt]: ee, [Ht]: ee, [Nt]: ee, [qt]: He, [Ot]: He, [Gt]: He, [Ut]: He, [Jt]: Ne, [Lt]: Ne, [Tt]: Ne, [Mt]: Ne, [Ta]: wt, [zt]: qa, [Kt]: qa }, ua = { [_t]: R, [Pt]: ke, [Ht]: X, [Nt]: X, [qt]: R, [Ot]: ke, [Gt]: X, [Ut]: X, [Jt]: R, [Lt]: ke, [Tt]: X, [Mt]: X, [Ta]: ke, [zt]: X, [Kt]: X };
2199
2199
  function it(c) {
2200
2200
  const e = c.dataFormatDescriptor[0];
2201
- return e.colorPrimaries === 1 ? e.transferFunction === 2 ? re : K : e.colorPrimaries === 10 ? e.transferFunction === 2 ? "display-p3" : "display-p3-linear" : (e.colorPrimaries === 0 || console.warn(`THREE.KTX2Loader: Unsupported color primaries, "${e.colorPrimaries}"`), JA);
2201
+ return e.colorPrimaries === 1 ? e.transferFunction === 2 ? re : K : e.colorPrimaries === 10 ? e.transferFunction === 2 ? "display-p3" : "display-p3-linear" : (e.colorPrimaries === 0 || console.warn(`THREE.KTX2Loader: Unsupported color primaries, "${e.colorPrimaries}"`), PA);
2202
2202
  }
2203
2203
  async function st(c) {
2204
2204
  const e = c.split("?")[0].split(".").pop(), a = await fetch(c);
@@ -2527,7 +2527,7 @@ var Vt = function() {
2527
2527
  let te = 0;
2528
2528
  class Ni {
2529
2529
  constructor(e) {
2530
- if (this.timeout = e.timeout != null ? e.timeout : 5e3, this.renderer = e.renderer, this.zUpToYUpMatrix = new E.Matrix4(), this.zUpToYUpMatrix.set(1, 0, 0, 0, 0, 0, -1, 0, 0, 1, 0, 0, 0, 0, 0, 1), this.maxCachedItems = 100, this.proxy = e.proxy, e && (this.meshCallback = e.meshCallback, this.pointsCallback = e.pointsCallback, e.maxCachedItems != null && (this.maxCachedItems = e.maxCachedItems)), this.gltfLoader = new Dt(), e && e.dracoLoader) this.gltfLoader.setDRACOLoader(e.dracoLoader), this.hasDracoLoader = !0;
2530
+ if (this.downloadParallelism = e.downloadParallelism == null ? 8 : e.downloadParallelism, this.timeout = e.timeout != null ? e.timeout : 5e3, this.renderer = e.renderer, this.zUpToYUpMatrix = new E.Matrix4(), this.zUpToYUpMatrix.set(1, 0, 0, 0, 0, 0, -1, 0, 0, 1, 0, 0, 0, 0, 0, 1), this.maxCachedItems = 100, this.proxy = e.proxy, e && (this.meshCallback = e.meshCallback, this.pointsCallback = e.pointsCallback, e.maxCachedItems != null && (this.maxCachedItems = e.maxCachedItems)), this.gltfLoader = new Dt(), e && e.dracoLoader) this.gltfLoader.setDRACOLoader(e.dracoLoader), this.hasDracoLoader = !0;
2531
2531
  else {
2532
2532
  const a = new Rt();
2533
2533
  a.setDecoderPath("https://storage.googleapis.com/ogc-3d-tiles/draco/"), this.dracoLoader = a, this.gltfLoader.setDRACOLoader(a), this.gltfLoader.hasDracoLoader = !0;
@@ -2541,7 +2541,7 @@ class Ni {
2541
2541
  }
2542
2542
  update() {
2543
2543
  const e = this;
2544
- te < 8 && e._download(), e._loadBatch();
2544
+ te < e.downloadParallelism && e._download(), e._loadBatch();
2545
2545
  }
2546
2546
  _scheduleDownload(e) {
2547
2547
  this.downloads.unshift(e);
@@ -3053,21 +3053,21 @@ class Oe extends me {
3053
3053
  return i;
3054
3054
  }
3055
3055
  }
3056
- class Je extends Oe {
3056
+ class Pe extends Oe {
3057
3057
  constructor(e = [], a) {
3058
3058
  super(e, a);
3059
3059
  }
3060
3060
  clone() {
3061
- return new Je(this, { comparator: this.comparator, toElementFn: this.toElementFn });
3061
+ return new Pe(this, { comparator: this.comparator, toElementFn: this.toElementFn });
3062
3062
  }
3063
3063
  filter(e, a) {
3064
- const t = new Je([], { toElementFn: this.toElementFn, comparator: this.comparator });
3064
+ const t = new Pe([], { toElementFn: this.toElementFn, comparator: this.comparator });
3065
3065
  let A = 0;
3066
3066
  for (const i of this) e.call(a, i, A, this) && t.add(i), A++;
3067
3067
  return t;
3068
3068
  }
3069
3069
  map(e, a, t, A) {
3070
- const i = new Je([], { comparator: a, toElementFn: t });
3070
+ const i = new Pe([], { comparator: a, toElementFn: t });
3071
3071
  let s = 0;
3072
3072
  for (const r of this) i.add(e.call(A, r, s, this)), s++;
3073
3073
  return i;
@@ -3077,9 +3077,9 @@ function Oi(c) {
3077
3077
  return new Worker("" + new URL("assets/PointsManager.worker-5fpGpVvf.js", import.meta.url).href, { type: "module", name: c == null ? void 0 : c.name });
3078
3078
  }
3079
3079
  new Ra(), new D(), new D(), new D(), new D();
3080
- const Ve = new D(), Ji = new D(), Yt = new Fa();
3080
+ const Ve = new D(), Pi = new D(), Yt = new Fa();
3081
3081
  Yt.set(1, 0, 0, 0, 0, 1, 0, -1, 0);
3082
- class Pi extends xa {
3082
+ class Ji extends xa {
3083
3083
  constructor(e, a) {
3084
3084
  const A = Math.min(Math.ceil(8) * 512, Math.pow(512, 2));
3085
3085
  let i = 1 * Math.pow(512, 2);
@@ -3095,7 +3095,7 @@ class Pi extends xa {
3095
3095
  const d = new ia({ uniforms: { textureSize: { value: 512 }, numSlices: { value: 1 }, cov1Texture: { value: o.texture }, cov2Texture: { value: n.texture }, colorTexture: { value: s.texture }, positionTexture: { value: r.texture }, zUpToYUpMatrix3x3: { value: Yt }, sizeMultiplier: { value: 1 }, cropRadius: { value: Number.MAX_VALUE }, cameraNear: { value: 0.01 }, cameraFar: { value: 10 }, computeLinearDepth: { value: !0 } }, vertexShader: qi(), fragmentShader: a || _i(), transparent: !0, side: Ze, depthTest: !1, depthWrite: !1 }), b = new _a(), g = new Float32Array([-0.5, 0.5, 0, 0.5, 0.5, 0, -0.5, -0.5, 0, 0.5, -0.5, 0]);
3096
3096
  b.setIndex([0, 2, 1, 2, 3, 1]), b.setAttribute("position", new he(g, 3));
3097
3097
  const l = new Uint32Array(i), h = new wa(l, 1, !1);
3098
- h.needsUpdate = !0, h.setUsage(Ka), b.setAttribute("order", h), b.instanceCount = 0, super(b, d), this.numBatches = 0, this.numVisibleBatches = 0, this.orderAttribute = h, this.textureSize = 512, this.numTextures = 1, this.batchSize = A, this.maxSplats = i, this.numSplatsRendered = 0, this.colorRenderTarget = s, this.positionRenderTarget = r, this.cov1RenderTarget = o, this.cov2RenderTarget = n, this.renderer = e, this.sortID = 0, this.freeAddresses = new Je();
3098
+ h.needsUpdate = !0, h.setUsage(Ka), b.setAttribute("order", h), b.instanceCount = 0, super(b, d), this.numBatches = 0, this.numVisibleBatches = 0, this.orderAttribute = h, this.textureSize = 512, this.numTextures = 1, this.batchSize = A, this.maxSplats = i, this.numSplatsRendered = 0, this.colorRenderTarget = s, this.positionRenderTarget = r, this.cov1RenderTarget = o, this.cov2RenderTarget = n, this.renderer = e, this.sortID = 0, this.freeAddresses = new Pe();
3099
3099
  for (let I = 0; I < this.maxSplats; I += A) this.freeAddresses.add(I);
3100
3100
  this.worker = new Oi({ type: "module" }), this.sortListeners = [], this.worker.onmessage = (I) => {
3101
3101
  const m = new Uint32Array(I.data.order);
@@ -3127,7 +3127,7 @@ in vec2 vUv;
3127
3127
 
3128
3128
  void main() {
3129
3129
  gl_FragColor = texture( sourceTexture, vec3(vUv, w) );
3130
- }`, transparent: !1, side: Ze, depthTest: !1, depthWrite: !1 }), this.copyCamera = new Qt(-0.5, 0.5, 0.5, -0.5, 0.1, 10), this.copyCamera.position.z = 1, this.copyScene = new PA();
3130
+ }`, transparent: !1, side: Ze, depthTest: !1, depthWrite: !1 }), this.copyCamera = new Qt(-0.5, 0.5, 0.5, -0.5, 0.1, 10), this.copyCamera.position.z = 1, this.copyScene = new JA();
3131
3131
  const f = new qA(1, 1);
3132
3132
  this.copyQuad = new xa(f, this.copyMaterial2D), this.copyScene.add(this.copyQuad), this.copyScene.matrixAutoUpdate = !1, this.copyQuad.matrixAutoUpdate = !1;
3133
3133
  }
@@ -3170,7 +3170,7 @@ void main() {
3170
3170
  const u = m * m;
3171
3171
  for (let C = 0; C < l.length; C += 3) {
3172
3172
  Ve.set(l[C], -l[C + 2], l[C + 1]);
3173
- const B = Ji.copy(Ve).sub(f.origin).dot(f.direction);
3173
+ const B = Pi.copy(Ve).sub(f.origin).dot(f.direction);
3174
3174
  B > 0 && f.distanceSqToPoint(Ve) < u && I.push({ distance: B, point: Ve.clone(), type: "splat" });
3175
3175
  }
3176
3176
  }, n > this.freeAddresses.size && this.growTextures();
@@ -3488,7 +3488,7 @@ class Wt extends E.Object3D {
3488
3488
  }
3489
3489
  async _setup(e) {
3490
3490
  const a = this;
3491
- if (e.json.extensionsRequired && (e.json.extensionsRequired.includes("JDULTRA_gaussian_splats") || e.json.extensionsRequired.includes("JDULTRA_gaussian_splats_V2")) && (a.splatsMesh = new Pi(a.tileLoader.renderer), this.splatsMesh.setSplatsCropRadius(this.splatsCropRadius), this.splatsMesh.setSplatsSizeMultiplier(this.splatsSizeMultiplier), a.add(a.splatsMesh)), e.json.root ? (a.json = e.json.root, a.json.refine || (a.json.refine = e.json.refine), a.json.geometricError || (a.json.geometricError = e.json.geometricError), a.json.transform || (a.json.transform = e.json.transform), a.json.boundingVolume || (a.json.boundingVolume = e.json.boundingVolume)) : a.json = e.json, a.json.children || (a.json.getChildren ? a.json.children = await a.json.getChildren() : a.json.children = []), a.rootPath = e.json.rootPath ? e.json.rootPath : e.rootPath, a.json.refine ? a.refine = a.json.refine : a.refine = e.parentRefine, a.json.geometricError ? a.geometricError = a.json.geometricError : a.geometricError = e.parentGeometricError, a.json.transform) {
3491
+ if (e.json.extensionsRequired && (e.json.extensionsRequired.includes("JDULTRA_gaussian_splats") || e.json.extensionsRequired.includes("JDULTRA_gaussian_splats_V2")) && (a.splatsMesh = new Ji(a.tileLoader.renderer), this.splatsMesh.setSplatsCropRadius(this.splatsCropRadius), this.splatsMesh.setSplatsSizeMultiplier(this.splatsSizeMultiplier), a.add(a.splatsMesh)), e.json.root ? (a.json = e.json.root, a.json.refine || (a.json.refine = e.json.refine), a.json.geometricError || (a.json.geometricError = e.json.geometricError), a.json.transform || (a.json.transform = e.json.transform), a.json.boundingVolume || (a.json.boundingVolume = e.json.boundingVolume)) : a.json = e.json, a.json.children || (a.json.getChildren ? a.json.children = await a.json.getChildren() : a.json.children = []), a.rootPath = e.json.rootPath ? e.json.rootPath : e.rootPath, a.json.refine ? a.refine = a.json.refine : a.refine = e.parentRefine, a.json.geometricError ? a.geometricError = a.json.geometricError : a.geometricError = e.parentGeometricError, a.json.transform) {
3492
3492
  let A = new E.Matrix4();
3493
3493
  A.elements = a.json.transform, a.applyMatrix4(A);
3494
3494
  }