@tresjs/cientos 4.0.0-rc.0 → 4.0.0-rc.1
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.
package/dist/trescientos.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* name: @tresjs/cientos
|
|
3
|
-
* version: v4.0.0-rc.
|
|
3
|
+
* version: v4.0.0-rc.1
|
|
4
4
|
* (c) 2024
|
|
5
5
|
* description: Collection of useful helpers and fully functional, ready-made abstractions for Tres
|
|
6
6
|
* author: Alvaro Saburido <hola@alvarosaburido.dev> (https://github.com/alvarosabu/)
|
|
@@ -10,7 +10,7 @@ var El = (o, e, t) => e in o ? bl(o, e, { enumerable: !0, configurable: !0, writ
|
|
|
10
10
|
var ue = (o, e, t) => El(o, typeof e != "symbol" ? e + "" : e, t);
|
|
11
11
|
import * as Xr from "three";
|
|
12
12
|
import { TrianglesDrawMode as Ml, TriangleFanDrawMode as sr, TriangleStripDrawMode as ra, REVISION as di, Color as Pe, Vector3 as $, CompressedTexture as xi, Texture as ts, MathUtils as Ze, RGBAFormat as oa, DoubleSide as tn, BufferAttribute as pt, PropertyBinding as nn, InterpolateDiscrete as aa, Matrix4 as Re, Scene as Ts, PlaneGeometry as Ut, ShaderMaterial as Lt, Uniform as Me, Mesh as he, PerspectiveCamera as St, WebGLRenderer as Sl, InterpolateLinear as Tr, NearestFilter as la, NearestMipmapNearestFilter as ca, NearestMipmapLinearFilter as ua, LinearFilter as yt, LinearMipmapNearestFilter as ha, LinearMipmapLinearFilter as br, ClampToEdgeWrapping as ns, RepeatWrapping as Bn, MirroredRepeatWrapping as fa, Plane as pi, Vector4 as it, WebGLRenderTarget as Gt, HalfFloatType as jt, UniformsUtils as ss, NoToneMapping as Al, FrontSide as Ss, UniformsLib as Qn, BackSide as Pl, BoxGeometry as Zt, Triangle as Cl, Object3D as At, Raycaster as da, Quaternion as ze, Euler as wn, MeshBasicMaterial as qt, LineBasicMaterial as bs, CylinderGeometry as Ct, BufferGeometry as mt, Float32BufferAttribute as ft, Line as Le, OctahedronGeometry as Cn, TorusGeometry as Bs, SphereGeometry as Rl, EventDispatcher as pa, Ray as Il, MOUSE as yn, TOUCH as zt, OrthographicCamera as Qt, Spherical as ai, Vector2 as ge, Loader as As, LoaderUtils as Jn, FileLoader as Nn, SpotLight as ma, PointLight as ir, DirectionalLight as ga, MeshPhysicalMaterial as Vt, InstancedMesh as Ol, InstancedBufferAttribute as Dl, TextureLoader as mi, ImageBitmapLoader as Ll, InterleavedBuffer as Er, InterleavedBufferAttribute as Jt, PointsMaterial as Fl, Material as wi, MeshStandardMaterial as Ps, SkinnedMesh as va, LineSegments as kl, LineLoop as Bl, Points as ya, Group as Mn, Skeleton as _a, AnimationClip as xa, Bone as rr, VectorKeyframeTrack as or, NumberKeyframeTrack as ar, QuaternionKeyframeTrack as lr, Box3 as Et, Sphere as gi, Interpolant as Nl, ExtrudeGeometry as Ul, Curve as zl, MeshPhongMaterial as Ti, MeshLambertMaterial as Hl, EquirectangularReflectionMapping as cr, AmbientLight as Gl, Uint16BufferAttribute as jl, Matrix3 as Ln, ShapePath as mn, DataTextureLoader as Vl, FloatType as ii, DataUtils as Ns, ShapeUtils as Yl, Box2 as wa, Shape as Xl, Path as bi, AnimationMixer as Wl, AudioListener as Ta, Audio as $l, AudioLoader as ba, FramebufferTexture as Wr, RawShaderMaterial as Ei, AdditiveBlending as Mr, UnsignedByteType as ur, DepthTexture as Ea, CubeTextureLoader as Zl, CubeReflectionMapping as Kl, ShapeGeometry as ql, DefaultLoadingManager as Us, VideoTexture as Ql, NoBlending as Jl, Camera as ec, TangentSpaceNormalMap as tc, Clock as nc, InstancedBufferGeometry as sc, InstancedInterleavedBuffer as hr, WireframeGeometry as ic, ShaderLib as ri, Line3 as rc, CatmullRomCurve3 as oc, QuadraticBezierCurve3 as ac, WebGLCubeRenderTarget as lc, CubeCamera as cc, MeshDepthMaterial as $r, DataTexture as Ma, UVMapping as uc, IcosahedronGeometry as hc } from "three";
|
|
13
|
-
import { defineComponent as me, toRefs as De, watch as ee, useSlots as Sr, computed as Fe, shallowRef as ve, withAsyncContext as An, toValue as un, watchEffect as Pt, unref as U, openBlock as ce, createElementBlock as
|
|
13
|
+
import { defineComponent as me, toRefs as De, watch as ee, useSlots as Sr, computed as Fe, shallowRef as ve, withAsyncContext as An, toValue as un, watchEffect as Pt, unref as U, openBlock as ce, createElementBlock as de, createCommentVNode as sn, renderSlot as Ve, ref as fe, shallowReactive as Sa, mergeProps as je, createElementVNode as _e, getCurrentScope as fc, onScopeDispose as dc, onMounted as zn, nextTick as Ar, isRef as li, getCurrentInstance as Aa, reactive as Es, onUnmounted as rt, isReactive as pc, onBeforeUnmount as Pr, Fragment as Pa, renderList as Ca, createBlock as Cr, toRaw as mc, triggerRef as gc, useAttrs as vc, createVNode as zs, render as yc } from "vue";
|
|
14
14
|
import { useTresContext as ye, useLoop as Ke, normalizeColor as _n, useLogger as vt, useLoader as Un, normalizeVectorFlexibleParam as Ra, useTexture as ci } from "@tresjs/core";
|
|
15
15
|
function Zr(o, e) {
|
|
16
16
|
if (e === Ml)
|
|
@@ -194,25 +194,25 @@ wc(Rr, "Utils", {
|
|
|
194
194
|
throw new Error("THREE.GLTFExporter: Cannot merge tracks with glTF CUBICSPLINE interpolation.");
|
|
195
195
|
console.warn("THREE.GLTFExporter: Morph target interpolation mode not yet supported. Using LINEAR instead."), r = r.clone(), r.setInterpolation(Tr);
|
|
196
196
|
}
|
|
197
|
-
const c = l.morphTargetInfluences.length,
|
|
198
|
-
if (
|
|
197
|
+
const c = l.morphTargetInfluences.length, h = l.morphTargetDictionary[a.propertyIndex];
|
|
198
|
+
if (h === void 0)
|
|
199
199
|
throw new Error("THREE.GLTFExporter: Morph target name not found: " + a.propertyIndex);
|
|
200
|
-
let
|
|
200
|
+
let u;
|
|
201
201
|
if (n[l.uuid] === void 0) {
|
|
202
|
-
|
|
203
|
-
const f = new
|
|
204
|
-
for (let g = 0; g <
|
|
205
|
-
f[g * c +
|
|
206
|
-
|
|
202
|
+
u = r.clone();
|
|
203
|
+
const f = new u.ValueBufferType(c * u.times.length);
|
|
204
|
+
for (let g = 0; g < u.times.length; g++)
|
|
205
|
+
f[g * c + h] = u.values[g];
|
|
206
|
+
u.name = (a.nodeName || "") + ".morphTargetInfluences", u.values = f, n[l.uuid] = u, t.push(u);
|
|
207
207
|
continue;
|
|
208
208
|
}
|
|
209
209
|
const m = r.createInterpolant(new r.ValueBufferType(1));
|
|
210
|
-
|
|
211
|
-
for (let f = 0; f <
|
|
212
|
-
|
|
210
|
+
u = n[l.uuid];
|
|
211
|
+
for (let f = 0; f < u.times.length; f++)
|
|
212
|
+
u.values[f * c + h] = m.evaluate(u.times[f]);
|
|
213
213
|
for (let f = 0; f < r.times.length; f++) {
|
|
214
|
-
const g = this.insertKeyframe(
|
|
215
|
-
|
|
214
|
+
const g = this.insertKeyframe(u, r.times[f]);
|
|
215
|
+
u.values[g * c + h] = r.values[f];
|
|
216
216
|
}
|
|
217
217
|
}
|
|
218
218
|
return o.tracks = t, o;
|
|
@@ -349,8 +349,8 @@ class Rc {
|
|
|
349
349
|
), this.options.animations.length > 0 && (this.options.trs = !0), this.processInput(e), await Promise.all(this.pending);
|
|
350
350
|
const s = this, i = s.buffers, r = s.json;
|
|
351
351
|
n = s.options;
|
|
352
|
-
const a = s.extensionsUsed, l = s.extensionsRequired, c = new Blob(i, { type: "application/octet-stream" }),
|
|
353
|
-
|
|
352
|
+
const a = s.extensionsUsed, l = s.extensionsRequired, c = new Blob(i, { type: "application/octet-stream" }), h = Object.keys(a), u = Object.keys(l);
|
|
353
|
+
h.length > 0 && (r.extensionsUsed = h), u.length > 0 && (r.extensionsRequired = u), r.buffers && r.buffers.length > 0 && (r.buffers[0].byteLength = c.size), n.binary === !0 ? c.arrayBuffer().then((m) => {
|
|
354
354
|
const f = Pi(m), g = new DataView(new ArrayBuffer(eo));
|
|
355
355
|
g.setUint32(0, f.byteLength, !0), g.setUint32(4, Sc, !0);
|
|
356
356
|
const p = Pi(Ac(JSON.stringify(r)), 32), v = new DataView(new ArrayBuffer(eo));
|
|
@@ -460,20 +460,20 @@ class Rc {
|
|
|
460
460
|
l.width = r, l.height = a;
|
|
461
461
|
const c = l.getContext("2d");
|
|
462
462
|
c.fillStyle = "#00ffff", c.fillRect(0, 0, r, a);
|
|
463
|
-
const
|
|
463
|
+
const h = c.getImageData(0, 0, r, a);
|
|
464
464
|
if (s) {
|
|
465
465
|
c.drawImage(s, 0, 0, r, a);
|
|
466
466
|
const f = n(e), g = c.getImageData(0, 0, r, a).data;
|
|
467
467
|
for (let p = 2; p < g.length; p += 4)
|
|
468
|
-
|
|
468
|
+
h.data[p] = f(g[p] / 256) * 256;
|
|
469
469
|
}
|
|
470
470
|
if (i) {
|
|
471
471
|
c.drawImage(i, 0, 0, r, a);
|
|
472
472
|
const f = n(t), g = c.getImageData(0, 0, r, a).data;
|
|
473
473
|
for (let p = 1; p < g.length; p += 4)
|
|
474
|
-
|
|
474
|
+
h.data[p] = f(g[p] / 256) * 256;
|
|
475
475
|
}
|
|
476
|
-
c.putImageData(
|
|
476
|
+
c.putImageData(h, 0, 0);
|
|
477
477
|
const m = (e || t).clone();
|
|
478
478
|
return m.source = new ts(l).source, "colorSpace" in m ? m.colorSpace = "" : m.encoding = 3e3, m.channel = (e || t).channel, e && t && e.channel !== t.channel && console.warn("THREE.GLTFExporter: UV channels for metalnessMap and roughnessMap textures must match."), m;
|
|
479
479
|
}
|
|
@@ -512,18 +512,18 @@ class Rc {
|
|
|
512
512
|
a = 4;
|
|
513
513
|
}
|
|
514
514
|
const l = Ia(s * e.itemSize * a), c = new DataView(new ArrayBuffer(l));
|
|
515
|
-
let
|
|
515
|
+
let h = 0;
|
|
516
516
|
for (let f = n; f < n + s; f++)
|
|
517
517
|
for (let g = 0; g < e.itemSize; g++) {
|
|
518
518
|
let p;
|
|
519
|
-
e.itemSize > 4 ? p = e.array[f * e.itemSize + g] : (g === 0 ? p = e.getX(f) : g === 1 ? p = e.getY(f) : g === 2 ? p = e.getZ(f) : g === 3 && (p = e.getW(f)), e.normalized === !0 && (p = Ze.normalize(p, e.array))), t === Oe.FLOAT ? c.setFloat32(
|
|
519
|
+
e.itemSize > 4 ? p = e.array[f * e.itemSize + g] : (g === 0 ? p = e.getX(f) : g === 1 ? p = e.getY(f) : g === 2 ? p = e.getZ(f) : g === 3 && (p = e.getW(f)), e.normalized === !0 && (p = Ze.normalize(p, e.array))), t === Oe.FLOAT ? c.setFloat32(h, p, !0) : t === Oe.INT ? c.setInt32(h, p, !0) : t === Oe.UNSIGNED_INT ? c.setUint32(h, p, !0) : t === Oe.SHORT ? c.setInt16(h, p, !0) : t === Oe.UNSIGNED_SHORT ? c.setUint16(h, p, !0) : t === Oe.BYTE ? c.setInt8(h, p) : t === Oe.UNSIGNED_BYTE && c.setUint8(h, p), h += a;
|
|
520
520
|
}
|
|
521
|
-
const
|
|
521
|
+
const u = {
|
|
522
522
|
buffer: this.processBuffer(c.buffer),
|
|
523
523
|
byteOffset: this.byteOffset,
|
|
524
524
|
byteLength: l
|
|
525
525
|
};
|
|
526
|
-
return i !== void 0 && (
|
|
526
|
+
return i !== void 0 && (u.target = i), i === Oe.ARRAY_BUFFER && (u.byteStride = e.itemSize * a), this.byteOffset += l, r.bufferViews.push(u), {
|
|
527
527
|
id: r.bufferViews.length - 1,
|
|
528
528
|
byteLength: 0
|
|
529
529
|
};
|
|
@@ -585,16 +585,16 @@ class Rc {
|
|
|
585
585
|
const l = Cc(e, n, s);
|
|
586
586
|
let c;
|
|
587
587
|
t !== void 0 && (c = e === t.index ? Oe.ELEMENT_ARRAY_BUFFER : Oe.ARRAY_BUFFER);
|
|
588
|
-
const
|
|
589
|
-
bufferView:
|
|
590
|
-
byteOffset:
|
|
588
|
+
const h = this.processBufferView(e, a, n, s, c), u = {
|
|
589
|
+
bufferView: h.id,
|
|
590
|
+
byteOffset: h.byteOffset,
|
|
591
591
|
componentType: a,
|
|
592
592
|
count: s,
|
|
593
593
|
max: l.max,
|
|
594
594
|
min: l.min,
|
|
595
595
|
type: r[e.itemSize]
|
|
596
596
|
};
|
|
597
|
-
return e.normalized === !0 && (
|
|
597
|
+
return e.normalized === !0 && (u.normalized = !0), i.accessors || (i.accessors = []), i.accessors.push(u) - 1;
|
|
598
598
|
}
|
|
599
599
|
/**
|
|
600
600
|
* Process image
|
|
@@ -608,9 +608,9 @@ class Rc {
|
|
|
608
608
|
if (e !== null) {
|
|
609
609
|
const i = this, r = i.cache, a = i.json, l = i.options, c = i.pending;
|
|
610
610
|
r.images.has(e) || r.images.set(e, {});
|
|
611
|
-
const
|
|
612
|
-
if (u
|
|
613
|
-
return u
|
|
611
|
+
const h = r.images.get(e), u = s + ":flipY/" + n.toString();
|
|
612
|
+
if (h[u] !== void 0)
|
|
613
|
+
return h[u];
|
|
614
614
|
a.images || (a.images = []);
|
|
615
615
|
const m = { mimeType: s }, f = to();
|
|
616
616
|
f.width = Math.min(e.width, l.maxTextureSize), f.height = Math.min(e.height, l.maxTextureSize);
|
|
@@ -633,7 +633,7 @@ class Rc {
|
|
|
633
633
|
})
|
|
634
634
|
);
|
|
635
635
|
const p = a.images.push(m) - 1;
|
|
636
|
-
return u
|
|
636
|
+
return h[u] = p, p;
|
|
637
637
|
} else
|
|
638
638
|
throw new Error("THREE.GLTFExporter: No valid image data found. Unable to process texture.");
|
|
639
639
|
}
|
|
@@ -752,7 +752,7 @@ class Rc {
|
|
|
752
752
|
const r = e.geometry;
|
|
753
753
|
let a;
|
|
754
754
|
e.isLineSegments ? a = Oe.LINES : e.isLineLoop ? a = Oe.LINE_LOOP : e.isLine ? a = Oe.LINE_STRIP : e.isPoints ? a = Oe.POINTS : a = e.material.wireframe ? Oe.LINES : Oe.TRIANGLES;
|
|
755
|
-
const l = {}, c = {},
|
|
755
|
+
const l = {}, c = {}, h = [], u = [], m = {
|
|
756
756
|
...vi >= 152 ? {
|
|
757
757
|
uv: "TEXCOORD_0",
|
|
758
758
|
uv1: "TEXCOORD_1",
|
|
@@ -809,7 +809,7 @@ class Rc {
|
|
|
809
809
|
V === 0 && B.setX(N, _.getX(N) - R.getX(N)), V === 1 && B.setY(N, _.getY(N) - R.getY(N)), V === 2 && B.setZ(N, _.getZ(N) - R.getZ(N)), V === 3 && B.setW(N, _.getW(N) - R.getW(N));
|
|
810
810
|
b[C] = this.processAccessor(B, r), t.attributes.set(this.getUID(R, !0), b[C]);
|
|
811
811
|
}
|
|
812
|
-
|
|
812
|
+
u.push(b), y.push(e.morphTargetInfluences[T]), e.morphTargetDictionary !== void 0 && E.push(P[T]);
|
|
813
813
|
}
|
|
814
814
|
l.weights = y, E.length > 0 && (l.extras = {}, l.extras.targetNames = E);
|
|
815
815
|
}
|
|
@@ -822,14 +822,14 @@ class Rc {
|
|
|
822
822
|
mode: a,
|
|
823
823
|
attributes: c
|
|
824
824
|
};
|
|
825
|
-
if (this.serializeUserData(r, P),
|
|
825
|
+
if (this.serializeUserData(r, P), u.length > 0 && (P.targets = u), r.index !== null) {
|
|
826
826
|
let b = this.getUID(r.index);
|
|
827
827
|
(d[y].start !== void 0 || d[y].count !== void 0) && (b += ":" + d[y].start + ":" + d[y].count), t.attributes.has(b) ? P.indices = t.attributes.get(b) : (P.indices = this.processAccessor(r.index, r, d[y].start, d[y].count), t.attributes.set(b, P.indices)), P.indices === null && delete P.indices;
|
|
828
828
|
}
|
|
829
829
|
const T = this.processMaterial(v[d[y].materialIndex]);
|
|
830
|
-
T !== null && (P.material = T),
|
|
830
|
+
T !== null && (P.material = T), h.push(P);
|
|
831
831
|
}
|
|
832
|
-
l.primitives =
|
|
832
|
+
l.primitives = h, n.meshes || (n.meshes = []), this._invokeAll(function(y) {
|
|
833
833
|
y.writeMesh && y.writeMesh(e, l);
|
|
834
834
|
});
|
|
835
835
|
const w = n.meshes.push(l) - 1;
|
|
@@ -908,14 +908,14 @@ class Rc {
|
|
|
908
908
|
n.animations || (n.animations = []), e = Rr.Utils.mergeMorphTargetTracks(e.clone(), t);
|
|
909
909
|
const i = e.tracks, r = [], a = [];
|
|
910
910
|
for (let l = 0; l < i.length; ++l) {
|
|
911
|
-
const c = i[l],
|
|
912
|
-
let
|
|
913
|
-
const m = Qr[
|
|
914
|
-
if (
|
|
911
|
+
const c = i[l], h = nn.parseTrackName(c.name);
|
|
912
|
+
let u = nn.findNode(t, h.nodeName);
|
|
913
|
+
const m = Qr[h.propertyName];
|
|
914
|
+
if (h.objectName === "bones" && (u.isSkinnedMesh === !0 ? u = u.skeleton.getBoneByName(h.objectIndex) : u = void 0), !u || !m)
|
|
915
915
|
return console.warn('THREE.GLTFExporter: Could not export animation track "%s".', c.name), null;
|
|
916
916
|
const f = 1;
|
|
917
917
|
let g = c.values.length / c.times.length;
|
|
918
|
-
m === Qr.morphTargetInfluences && (g /=
|
|
918
|
+
m === Qr.morphTargetInfluences && (g /= u.morphTargetInfluences.length);
|
|
919
919
|
let p;
|
|
920
920
|
c.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline === !0 ? (p = "CUBICSPLINE", g /= 3) : c.getInterpolation() === aa ? p = "STEP" : p = "LINEAR", a.push({
|
|
921
921
|
input: this.processAccessor(new pt(c.times, f)),
|
|
@@ -924,7 +924,7 @@ class Rc {
|
|
|
924
924
|
}), r.push({
|
|
925
925
|
sampler: a.length - 1,
|
|
926
926
|
target: {
|
|
927
|
-
node: s.get(
|
|
927
|
+
node: s.get(u),
|
|
928
928
|
path: m
|
|
929
929
|
}
|
|
930
930
|
});
|
|
@@ -947,8 +947,8 @@ class Rc {
|
|
|
947
947
|
if (r === void 0)
|
|
948
948
|
return null;
|
|
949
949
|
const a = [], l = new Float32Array(i.bones.length * 16), c = new Re();
|
|
950
|
-
for (let
|
|
951
|
-
a.push(n.get(i.bones[
|
|
950
|
+
for (let u = 0; u < i.bones.length; ++u)
|
|
951
|
+
a.push(n.get(i.bones[u])), c.copy(i.boneInverses[u]), c.multiply(e.bindMatrix).toArray(l, u * 16);
|
|
952
952
|
return t.skins === void 0 && (t.skins = []), t.skins.push({
|
|
953
953
|
inverseBindMatrices: this.processAccessor(new pt(l, 16)),
|
|
954
954
|
joints: a,
|
|
@@ -976,10 +976,10 @@ class Rc {
|
|
|
976
976
|
if (e.isSkinnedMesh && this.skins.push(e), e.children.length > 0) {
|
|
977
977
|
const a = [];
|
|
978
978
|
for (let l = 0, c = e.children.length; l < c; l++) {
|
|
979
|
-
const
|
|
980
|
-
if (
|
|
981
|
-
const
|
|
982
|
-
|
|
979
|
+
const h = e.children[l];
|
|
980
|
+
if (h.visible || n.onlyVisible === !1) {
|
|
981
|
+
const u = this.processNode(h);
|
|
982
|
+
u !== null && a.push(u);
|
|
983
983
|
}
|
|
984
984
|
}
|
|
985
985
|
a.length > 0 && (i.children = a);
|
|
@@ -1343,8 +1343,8 @@ var xs = function(o, e, t) {
|
|
|
1343
1343
|
var l = 15 - e;
|
|
1344
1344
|
for (s = 0; s < n; ++s)
|
|
1345
1345
|
if (o[s])
|
|
1346
|
-
for (var c = s << 4 | o[s],
|
|
1347
|
-
a[dr[
|
|
1346
|
+
for (var c = s << 4 | o[s], h = e - o[s], u = r[o[s] - 1]++ << h, m = u | (1 << h) - 1; u <= m; ++u)
|
|
1347
|
+
a[dr[u] >>> l] = c;
|
|
1348
1348
|
} else
|
|
1349
1349
|
for (a = new Tn(n), s = 0; s < n; ++s)
|
|
1350
1350
|
o[s] && (a[s] = dr[r[o[s] - 1]++] >>> 15 - o[s]);
|
|
@@ -1389,14 +1389,14 @@ var Xc = /* @__PURE__ */ xs(Cs, 9, 1), Wc = /* @__PURE__ */ xs(Ba, 5, 1), Ci = f
|
|
|
1389
1389
|
var z = new Mt(Math.max(O * 2, D));
|
|
1390
1390
|
z.set(e), e = z;
|
|
1391
1391
|
}
|
|
1392
|
-
}, a = t.f || 0, l = t.p || 0, c = t.b || 0,
|
|
1392
|
+
}, a = t.f || 0, l = t.p || 0, c = t.b || 0, h = t.l, u = t.d, m = t.m, f = t.n, g = n * 8;
|
|
1393
1393
|
do {
|
|
1394
|
-
if (!
|
|
1394
|
+
if (!h) {
|
|
1395
1395
|
t.f = a = Rt(o, l, 1);
|
|
1396
1396
|
var p = Rt(o, l + 1, 3);
|
|
1397
1397
|
if (l += 3, p)
|
|
1398
1398
|
if (p == 1)
|
|
1399
|
-
|
|
1399
|
+
h = Xc, u = Wc, m = 9, f = 5;
|
|
1400
1400
|
else if (p == 2) {
|
|
1401
1401
|
var y = Rt(o, l, 31) + 257, E = Rt(o, l + 10, 15) + 4, P = y + Rt(o, l + 5, 31) + 1;
|
|
1402
1402
|
l += 14;
|
|
@@ -1416,7 +1416,7 @@ var Xc = /* @__PURE__ */ xs(Cs, 9, 1), Wc = /* @__PURE__ */ xs(Ba, 5, 1), Ci = f
|
|
|
1416
1416
|
}
|
|
1417
1417
|
}
|
|
1418
1418
|
var j = T.subarray(0, y), V = T.subarray(y);
|
|
1419
|
-
m = Ci(j), f = Ci(V),
|
|
1419
|
+
m = Ci(j), f = Ci(V), h = xs(j, m, 1), u = xs(V, f, 1);
|
|
1420
1420
|
} else
|
|
1421
1421
|
throw "invalid block type";
|
|
1422
1422
|
else {
|
|
@@ -1437,7 +1437,7 @@ var Xc = /* @__PURE__ */ xs(Cs, 9, 1), Wc = /* @__PURE__ */ xs(Ba, 5, 1), Ci = f
|
|
|
1437
1437
|
}
|
|
1438
1438
|
s && r(c + 131072);
|
|
1439
1439
|
for (var Q = (1 << m) - 1, Z = (1 << f) - 1, ne = l; ; ne = l) {
|
|
1440
|
-
var B =
|
|
1440
|
+
var B = h[Ri(o, l) & Q], te = B >>> 4;
|
|
1441
1441
|
if (l += B & 15, l > g) {
|
|
1442
1442
|
if (i)
|
|
1443
1443
|
throw "unexpected EOF";
|
|
@@ -1448,7 +1448,7 @@ var Xc = /* @__PURE__ */ xs(Cs, 9, 1), Wc = /* @__PURE__ */ xs(Ba, 5, 1), Ci = f
|
|
|
1448
1448
|
if (te < 256)
|
|
1449
1449
|
e[c++] = te;
|
|
1450
1450
|
else if (te == 256) {
|
|
1451
|
-
ne = l,
|
|
1451
|
+
ne = l, h = null;
|
|
1452
1452
|
break;
|
|
1453
1453
|
} else {
|
|
1454
1454
|
var le = te - 254;
|
|
@@ -1456,7 +1456,7 @@ var Xc = /* @__PURE__ */ xs(Cs, 9, 1), Wc = /* @__PURE__ */ xs(Ba, 5, 1), Ci = f
|
|
|
1456
1456
|
var x = te - 257, ae = Oa[x];
|
|
1457
1457
|
le = Rt(o, l, (1 << ae) - 1) + ka[x], l += ae;
|
|
1458
1458
|
}
|
|
1459
|
-
var Te =
|
|
1459
|
+
var Te = u[Ri(o, l) & Z], I = Te >>> 4;
|
|
1460
1460
|
if (!Te)
|
|
1461
1461
|
throw "invalid distance";
|
|
1462
1462
|
l += Te & 15;
|
|
@@ -1476,7 +1476,7 @@ var Xc = /* @__PURE__ */ xs(Cs, 9, 1), Wc = /* @__PURE__ */ xs(Ba, 5, 1), Ci = f
|
|
|
1476
1476
|
c = k;
|
|
1477
1477
|
}
|
|
1478
1478
|
}
|
|
1479
|
-
t.l =
|
|
1479
|
+
t.l = h, t.p = ne, t.b = c, h && (a = 1, t.m = m, t.d = u, t.n = f);
|
|
1480
1480
|
} while (!a);
|
|
1481
1481
|
return c == e.length ? e : Zc(e, 0, c);
|
|
1482
1482
|
}, qc = /* @__PURE__ */ new Mt(0), Qc = function(o) {
|
|
@@ -1497,7 +1497,7 @@ var nu = Object.defineProperty, su = (o, e, t) => e in o ? nu(o, e, { enumerable
|
|
|
1497
1497
|
const Na = class extends he {
|
|
1498
1498
|
constructor(o, e = {}) {
|
|
1499
1499
|
super(o), this.isReflector = !0, this.type = "Reflector", this.camera = new St();
|
|
1500
|
-
const t = this, n = e.color !== void 0 ? new Pe(e.color) : new Pe(8355711), s = e.textureWidth || 512, i = e.textureHeight || 512, r = e.clipBias || 0, a = e.shader || Na.ReflectorShader, l = e.multisample !== void 0 ? e.multisample : 4, c = new pi(),
|
|
1500
|
+
const t = this, n = e.color !== void 0 ? new Pe(e.color) : new Pe(8355711), s = e.textureWidth || 512, i = e.textureHeight || 512, r = e.clipBias || 0, a = e.shader || Na.ReflectorShader, l = e.multisample !== void 0 ? e.multisample : 4, c = new pi(), h = new $(), u = new $(), m = new $(), f = new Re(), g = new $(0, 0, -1), p = new it(), v = new $(), d = new $(), w = new it(), y = new Re(), E = this.camera, P = new Gt(s, i, {
|
|
1501
1501
|
samples: l,
|
|
1502
1502
|
type: jt
|
|
1503
1503
|
}), T = new Lt({
|
|
@@ -1506,9 +1506,9 @@ const Na = class extends he {
|
|
|
1506
1506
|
vertexShader: a.vertexShader
|
|
1507
1507
|
});
|
|
1508
1508
|
T.uniforms.tDiffuse.value = P.texture, T.uniforms.color.value = n, T.uniforms.textureMatrix.value = y, this.material = T, this.onBeforeRender = function(b, x, M) {
|
|
1509
|
-
if (
|
|
1509
|
+
if (u.setFromMatrixPosition(t.matrixWorld), m.setFromMatrixPosition(M.matrixWorld), f.extractRotation(t.matrixWorld), h.set(0, 0, 1), h.applyMatrix4(f), v.subVectors(u, m), v.dot(h) > 0)
|
|
1510
1510
|
return;
|
|
1511
|
-
v.reflect(
|
|
1511
|
+
v.reflect(h).negate(), v.add(u), f.extractRotation(M.matrixWorld), g.set(0, 0, -1), g.applyMatrix4(f), g.add(m), d.subVectors(u, g), d.reflect(h).negate(), d.add(u), E.position.copy(v), E.up.set(0, 1, 0), E.up.applyMatrix4(f), E.up.reflect(h), E.lookAt(d), E.far = M.far, E.updateMatrixWorld(), E.projectionMatrix.copy(M.projectionMatrix), y.set(0.5, 0, 0, 0.5, 0, 0.5, 0, 0.5, 0, 0, 0.5, 0.5, 0, 0, 0, 1), y.multiply(E.projectionMatrix), y.multiply(E.matrixWorldInverse), y.multiply(t.matrixWorld), c.setFromNormalAndCoplanarPoint(h, u), c.applyMatrix4(E.matrixWorldInverse), p.set(c.normal.x, c.normal.y, c.normal.z, c.constant);
|
|
1512
1512
|
const _ = E.projectionMatrix;
|
|
1513
1513
|
w.x = (Math.sign(p.x) + _.elements[8]) / _.elements[0], w.y = (Math.sign(p.y) + _.elements[9]) / _.elements[5], w.z = -1, w.w = (1 + _.elements[10]) / _.elements[14], p.multiplyScalar(2 / p.dot(w)), _.elements[2] = p.x, _.elements[6] = p.y, _.elements[10] = p.z + 1 - r, _.elements[14] = p.w, t.visible = !1;
|
|
1514
1514
|
const C = b.getRenderTarget(), R = b.xr.enabled, B = b.shadowMap.autoUpdate, N = b.toneMapping;
|
|
@@ -1592,7 +1592,7 @@ iu(pr, "ReflectorShader", {
|
|
|
1592
1592
|
class ru extends he {
|
|
1593
1593
|
constructor(e, t = {}) {
|
|
1594
1594
|
super(e), this.isWater = !0;
|
|
1595
|
-
const n = this, s = t.textureWidth !== void 0 ? t.textureWidth : 512, i = t.textureHeight !== void 0 ? t.textureHeight : 512, r = t.clipBias !== void 0 ? t.clipBias : 0, a = t.alpha !== void 0 ? t.alpha : 1, l = t.time !== void 0 ? t.time : 0, c = t.waterNormals !== void 0 ? t.waterNormals : null,
|
|
1595
|
+
const n = this, s = t.textureWidth !== void 0 ? t.textureWidth : 512, i = t.textureHeight !== void 0 ? t.textureHeight : 512, r = t.clipBias !== void 0 ? t.clipBias : 0, a = t.alpha !== void 0 ? t.alpha : 1, l = t.time !== void 0 ? t.time : 0, c = t.waterNormals !== void 0 ? t.waterNormals : null, h = t.sunDirection !== void 0 ? t.sunDirection : new $(0.70707, 0.70707, 0), u = new Pe(t.sunColor !== void 0 ? t.sunColor : 16777215), m = new Pe(t.waterColor !== void 0 ? t.waterColor : 8355711), f = t.eye !== void 0 ? t.eye : new $(0, 0, 0), g = t.distortionScale !== void 0 ? t.distortionScale : 20, p = t.side !== void 0 ? t.side : Ss, v = t.fog !== void 0 ? t.fog : !1, d = new pi(), w = new $(), y = new $(), E = new $(), P = new Re(), T = new $(0, 0, -1), b = new it(), x = new $(), M = new $(), _ = new it(), C = new Re(), R = new St(), B = new Gt(s, i), N = {
|
|
1596
1596
|
uniforms: ss.merge([
|
|
1597
1597
|
Qn.fog,
|
|
1598
1598
|
Qn.lights,
|
|
@@ -1722,7 +1722,7 @@ class ru extends he {
|
|
|
1722
1722
|
side: p,
|
|
1723
1723
|
fog: v
|
|
1724
1724
|
});
|
|
1725
|
-
j.uniforms.mirrorSampler.value = B.texture, j.uniforms.textureMatrix.value = C, j.uniforms.alpha.value = a, j.uniforms.time.value = l, j.uniforms.normalSampler.value = c, j.uniforms.sunColor.value =
|
|
1725
|
+
j.uniforms.mirrorSampler.value = B.texture, j.uniforms.textureMatrix.value = C, j.uniforms.alpha.value = a, j.uniforms.time.value = l, j.uniforms.normalSampler.value = c, j.uniforms.sunColor.value = u, j.uniforms.waterColor.value = m, j.uniforms.sunDirection.value = h, j.uniforms.distortionScale.value = g, j.uniforms.eye.value = f, n.material = j, n.onBeforeRender = function(V, Q, Z) {
|
|
1726
1726
|
if (y.setFromMatrixPosition(n.matrixWorld), E.setFromMatrixPosition(Z.matrixWorld), P.extractRotation(n.matrixWorld), w.set(0, 0, 1), w.applyMatrix4(P), x.subVectors(y, E), x.dot(w) > 0)
|
|
1727
1727
|
return;
|
|
1728
1728
|
x.reflect(w).negate(), x.add(y), P.extractRotation(Z.matrixWorld), T.set(0, 0, -1), T.applyMatrix4(P), T.add(E), M.subVectors(y, T), M.reflect(w).negate(), M.add(y), R.position.copy(x), R.up.set(0, 1, 0), R.up.applyMatrix4(P), R.up.reflect(w), R.lookAt(M), R.far = Z.far, R.updateMatrixWorld(), R.projectionMatrix.copy(Z.projectionMatrix), C.set(0.5, 0, 0, 0.5, 0, 0.5, 0, 0.5, 0, 0, 0.5, 0.5, 0, 0, 0, 1), C.multiply(R.projectionMatrix), C.multiply(R.matrixWorldInverse), d.setFromNormalAndCoplanarPoint(w, y), d.applyMatrix4(R.matrixWorldInverse), b.set(d.normal.x, d.normal.y, d.normal.z, d.constant);
|
|
@@ -2021,15 +2021,15 @@ class hu extends At {
|
|
|
2021
2021
|
this.offset.copy(this.pointEnd).sub(this.pointStart), l === "local" && i !== "XYZ" && this.offset.applyQuaternion(this.worldQuaternionInv), i.indexOf("X") === -1 && (this.offset.x = 0), i.indexOf("Y") === -1 && (this.offset.y = 0), i.indexOf("Z") === -1 && (this.offset.z = 0), l === "local" && i !== "XYZ" ? this.offset.applyQuaternion(this.quaternionStart).divide(this.parentScale) : this.offset.applyQuaternion(this.parentQuaternionInv).divide(this.parentScale), a.position.copy(this.offset).add(this.positionStart), this.translationSnap && (l === "local" && (a.position.applyQuaternion(this.tempQuaternion.copy(this.quaternionStart).invert()), i.search("X") !== -1 && (a.position.x = Math.round(a.position.x / this.translationSnap) * this.translationSnap), i.search("Y") !== -1 && (a.position.y = Math.round(a.position.y / this.translationSnap) * this.translationSnap), i.search("Z") !== -1 && (a.position.z = Math.round(a.position.z / this.translationSnap) * this.translationSnap), a.position.applyQuaternion(this.quaternionStart)), l === "world" && (a.parent && a.position.add(this.tempVector.setFromMatrixPosition(a.parent.matrixWorld)), i.search("X") !== -1 && (a.position.x = Math.round(a.position.x / this.translationSnap) * this.translationSnap), i.search("Y") !== -1 && (a.position.y = Math.round(a.position.y / this.translationSnap) * this.translationSnap), i.search("Z") !== -1 && (a.position.z = Math.round(a.position.z / this.translationSnap) * this.translationSnap), a.parent && a.position.sub(this.tempVector.setFromMatrixPosition(a.parent.matrixWorld))));
|
|
2022
2022
|
else if (r === "scale") {
|
|
2023
2023
|
if (i.search("XYZ") !== -1) {
|
|
2024
|
-
let
|
|
2025
|
-
this.pointEnd.dot(this.pointStart) < 0 && (
|
|
2024
|
+
let h = this.pointEnd.length() / this.pointStart.length();
|
|
2025
|
+
this.pointEnd.dot(this.pointStart) < 0 && (h *= -1), this.tempVector2.set(h, h, h);
|
|
2026
2026
|
} else
|
|
2027
2027
|
this.tempVector.copy(this.pointStart), this.tempVector2.copy(this.pointEnd), this.tempVector.applyQuaternion(this.worldQuaternionInv), this.tempVector2.applyQuaternion(this.worldQuaternionInv), this.tempVector2.divide(this.tempVector), i.search("X") === -1 && (this.tempVector2.x = 1), i.search("Y") === -1 && (this.tempVector2.y = 1), i.search("Z") === -1 && (this.tempVector2.z = 1);
|
|
2028
2028
|
a.scale.copy(this.scaleStart).multiply(this.tempVector2), this.scaleSnap && this.object && (i.search("X") !== -1 && (this.object.scale.x = Math.round(a.scale.x / this.scaleSnap) * this.scaleSnap || this.scaleSnap), i.search("Y") !== -1 && (a.scale.y = Math.round(a.scale.y / this.scaleSnap) * this.scaleSnap || this.scaleSnap), i.search("Z") !== -1 && (a.scale.z = Math.round(a.scale.z / this.scaleSnap) * this.scaleSnap || this.scaleSnap));
|
|
2029
2029
|
} else if (r === "rotate") {
|
|
2030
2030
|
this.offset.copy(this.pointEnd).sub(this.pointStart);
|
|
2031
|
-
const
|
|
2032
|
-
i === "E" ? (this.rotationAxis.copy(this.eye), this.rotationAngle = this.pointEnd.angleTo(this.pointStart), this.startNorm.copy(this.pointStart).normalize(), this.endNorm.copy(this.pointEnd).normalize(), this.rotationAngle *= this.endNorm.cross(this.startNorm).dot(this.eye) < 0 ? 1 : -1) : i === "XYZE" ? (this.rotationAxis.copy(this.offset).cross(this.eye).normalize(), this.rotationAngle = this.offset.dot(this.tempVector.copy(this.rotationAxis).cross(this.eye)) *
|
|
2031
|
+
const h = 20 / this.worldPosition.distanceTo(this.tempVector.setFromMatrixPosition(this.camera.matrixWorld));
|
|
2032
|
+
i === "E" ? (this.rotationAxis.copy(this.eye), this.rotationAngle = this.pointEnd.angleTo(this.pointStart), this.startNorm.copy(this.pointStart).normalize(), this.endNorm.copy(this.pointEnd).normalize(), this.rotationAngle *= this.endNorm.cross(this.startNorm).dot(this.eye) < 0 ? 1 : -1) : i === "XYZE" ? (this.rotationAxis.copy(this.offset).cross(this.eye).normalize(), this.rotationAngle = this.offset.dot(this.tempVector.copy(this.rotationAxis).cross(this.eye)) * h) : (i === "X" || i === "Y" || i === "Z") && (this.rotationAxis.copy(this.unit[i]), this.tempVector.copy(this.unit[i]), l === "local" && this.tempVector.applyQuaternion(this.worldQuaternion), this.rotationAngle = this.offset.dot(this.tempVector.cross(this.eye).normalize()) * h), this.rotationSnap && (this.rotationAngle = Math.round(this.rotationAngle / this.rotationSnap) * this.rotationSnap), l === "local" && i !== "E" && i !== "XYZE" ? (a.quaternion.copy(this.quaternionStart), a.quaternion.multiply(this.tempQuaternion.setFromAxisAngle(this.rotationAxis, this.rotationAngle)).normalize()) : (this.rotationAxis.applyQuaternion(this.parentQuaternionInv), a.quaternion.copy(this.tempQuaternion.setFromAxisAngle(this.rotationAxis, this.rotationAngle)), a.quaternion.multiply(this.quaternionStart).normalize());
|
|
2033
2033
|
}
|
|
2034
2034
|
this.dispatchEvent(this.changeEvent), this.dispatchEvent(this.objectChangeEvent);
|
|
2035
2035
|
}
|
|
@@ -2087,9 +2087,9 @@ class hu extends At {
|
|
|
2087
2087
|
), this.domElement = s, this.domElement.addEventListener("pointerdown", this.onPointerDown), this.domElement.addEventListener("pointermove", this.onPointerHover), this.domElement.ownerDocument.addEventListener("pointerup", this.onPointerUp);
|
|
2088
2088
|
}), K(this, "dispose", () => {
|
|
2089
2089
|
var s, i, r, a, l, c;
|
|
2090
|
-
(s = this.domElement) == null || s.removeEventListener("pointerdown", this.onPointerDown), (i = this.domElement) == null || i.removeEventListener("pointermove", this.onPointerHover), (a = (r = this.domElement) == null ? void 0 : r.ownerDocument) == null || a.removeEventListener("pointermove", this.onPointerMove), (c = (l = this.domElement) == null ? void 0 : l.ownerDocument) == null || c.removeEventListener("pointerup", this.onPointerUp), this.traverse((
|
|
2091
|
-
const
|
|
2092
|
-
|
|
2090
|
+
(s = this.domElement) == null || s.removeEventListener("pointerdown", this.onPointerDown), (i = this.domElement) == null || i.removeEventListener("pointermove", this.onPointerHover), (a = (r = this.domElement) == null ? void 0 : r.ownerDocument) == null || a.removeEventListener("pointermove", this.onPointerMove), (c = (l = this.domElement) == null ? void 0 : l.ownerDocument) == null || c.removeEventListener("pointerup", this.onPointerUp), this.traverse((h) => {
|
|
2091
|
+
const u = h;
|
|
2092
|
+
u.geometry && u.geometry.dispose(), u.material && u.material.dispose();
|
|
2093
2093
|
});
|
|
2094
2094
|
}), this.domElement = t, this.camera = e, this.gizmo = new fu(), this.add(this.gizmo), this.plane = new du(), this.add(this.plane);
|
|
2095
2095
|
const n = (s, i) => {
|
|
@@ -2159,10 +2159,10 @@ class fu extends At {
|
|
|
2159
2159
|
l.opacity = 0.25;
|
|
2160
2160
|
const c = l.clone();
|
|
2161
2161
|
c.color.set(16776960);
|
|
2162
|
-
const u = l.clone();
|
|
2163
|
-
u.color.set(65535);
|
|
2164
2162
|
const h = l.clone();
|
|
2165
|
-
h.color.set(
|
|
2163
|
+
h.color.set(65535);
|
|
2164
|
+
const u = l.clone();
|
|
2165
|
+
u.color.set(16711935), e.clone().color.set(16776960);
|
|
2166
2166
|
const f = t.clone();
|
|
2167
2167
|
f.color.set(16711680);
|
|
2168
2168
|
const g = t.clone();
|
|
@@ -2212,13 +2212,13 @@ class fu extends At {
|
|
|
2212
2212
|
[new Le(b, w), [0.3, 0.18, 0], [0, 0, Math.PI / 2], [0.125, 1, 1]]
|
|
2213
2213
|
],
|
|
2214
2214
|
YZ: [
|
|
2215
|
-
[new he(new Ut(0.295, 0.295),
|
|
2215
|
+
[new he(new Ut(0.295, 0.295), h.clone()), [0, 0.15, 0.15], [0, Math.PI / 2, 0]],
|
|
2216
2216
|
[new Le(b, v), [0, 0.18, 0.3], [0, 0, Math.PI / 2], [0.125, 1, 1]],
|
|
2217
2217
|
[new Le(b, v), [0, 0.3, 0.18], [0, -Math.PI / 2, 0], [0.125, 1, 1]]
|
|
2218
2218
|
],
|
|
2219
2219
|
XZ: [
|
|
2220
2220
|
[
|
|
2221
|
-
new he(new Ut(0.295, 0.295),
|
|
2221
|
+
new he(new Ut(0.295, 0.295), u.clone()),
|
|
2222
2222
|
[0.15, 0, 0.15],
|
|
2223
2223
|
[-Math.PI / 2, 0, 0]
|
|
2224
2224
|
],
|
|
@@ -2308,12 +2308,12 @@ class fu extends At {
|
|
|
2308
2308
|
[new Le(b, w), [0.98, 0.855, 0], [0, 0, Math.PI / 2], [0.125, 1, 1]]
|
|
2309
2309
|
],
|
|
2310
2310
|
YZ: [
|
|
2311
|
-
[new he(T,
|
|
2311
|
+
[new he(T, h), [0, 0.85, 0.85], null, [0.2, 2, 2]],
|
|
2312
2312
|
[new Le(b, v), [0, 0.855, 0.98], [0, 0, Math.PI / 2], [0.125, 1, 1]],
|
|
2313
2313
|
[new Le(b, v), [0, 0.98, 0.855], [0, -Math.PI / 2, 0], [0.125, 1, 1]]
|
|
2314
2314
|
],
|
|
2315
2315
|
XZ: [
|
|
2316
|
-
[new he(T,
|
|
2316
|
+
[new he(T, u), [0.85, 0, 0.85], null, [2, 0.2, 2]],
|
|
2317
2317
|
[new Le(b, d), [0.855, 0, 0.98], null, [0.125, 1, 1]],
|
|
2318
2318
|
[new Le(b, d), [0.98, 0, 0.855], [0, -Math.PI / 2, 0], [0.125, 1, 1]]
|
|
2319
2319
|
],
|
|
@@ -2436,16 +2436,16 @@ class Ga extends pa {
|
|
|
2436
2436
|
LEFT: yn.ROTATE,
|
|
2437
2437
|
MIDDLE: yn.DOLLY,
|
|
2438
2438
|
RIGHT: yn.PAN
|
|
2439
|
-
}), xe(this, "touches", { ONE: zt.ROTATE, TWO: zt.DOLLY_PAN }), xe(this, "target0"), xe(this, "position0"), xe(this, "zoom0"), xe(this, "_domElementKeyEvents", null), xe(this, "getPolarAngle"), xe(this, "getAzimuthalAngle"), xe(this, "setPolarAngle"), xe(this, "setAzimuthalAngle"), xe(this, "getDistance"), xe(this, "listenToKeyEvents"), xe(this, "stopListenToKeyEvents"), xe(this, "saveState"), xe(this, "reset"), xe(this, "update"), xe(this, "connect"), xe(this, "dispose"), this.object = e, this.domElement = t, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this.getPolarAngle = () =>
|
|
2440
|
-
let re = ro(W, 2 * Math.PI), be =
|
|
2439
|
+
}), xe(this, "touches", { ONE: zt.ROTATE, TWO: zt.DOLLY_PAN }), xe(this, "target0"), xe(this, "position0"), xe(this, "zoom0"), xe(this, "_domElementKeyEvents", null), xe(this, "getPolarAngle"), xe(this, "getAzimuthalAngle"), xe(this, "setPolarAngle"), xe(this, "setAzimuthalAngle"), xe(this, "getDistance"), xe(this, "listenToKeyEvents"), xe(this, "stopListenToKeyEvents"), xe(this, "saveState"), xe(this, "reset"), xe(this, "update"), xe(this, "connect"), xe(this, "dispose"), this.object = e, this.domElement = t, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this.getPolarAngle = () => h.phi, this.getAzimuthalAngle = () => h.theta, this.setPolarAngle = (W) => {
|
|
2440
|
+
let re = ro(W, 2 * Math.PI), be = h.phi;
|
|
2441
2441
|
be < 0 && (be += 2 * Math.PI), re < 0 && (re += 2 * Math.PI);
|
|
2442
2442
|
let Be = Math.abs(re - be);
|
|
2443
|
-
2 * Math.PI - Be < Be && (re < be ? re += 2 * Math.PI : be += 2 * Math.PI),
|
|
2443
|
+
2 * Math.PI - Be < Be && (re < be ? re += 2 * Math.PI : be += 2 * Math.PI), u.phi = re - be, n.update();
|
|
2444
2444
|
}, this.setAzimuthalAngle = (W) => {
|
|
2445
|
-
let re = ro(W, 2 * Math.PI), be =
|
|
2445
|
+
let re = ro(W, 2 * Math.PI), be = h.theta;
|
|
2446
2446
|
be < 0 && (be += 2 * Math.PI), re < 0 && (re += 2 * Math.PI);
|
|
2447
2447
|
let Be = Math.abs(re - be);
|
|
2448
|
-
2 * Math.PI - Be < Be && (re < be ? re += 2 * Math.PI : be += 2 * Math.PI),
|
|
2448
|
+
2 * Math.PI - Be < Be && (re < be ? re += 2 * Math.PI : be += 2 * Math.PI), u.theta = re - be, n.update();
|
|
2449
2449
|
}, this.getDistance = () => n.object.position.distanceTo(n.target), this.listenToKeyEvents = (W) => {
|
|
2450
2450
|
W.addEventListener("keydown", an), this._domElementKeyEvents = W;
|
|
2451
2451
|
}, this.stopListenToKeyEvents = () => {
|
|
@@ -2458,9 +2458,9 @@ class Ga extends pa {
|
|
|
2458
2458
|
const W = new $(), re = new $(0, 1, 0), be = new ze().setFromUnitVectors(e.up, re), Be = be.clone().invert(), Je = new $(), Xt = new ze(), cn = 2 * Math.PI;
|
|
2459
2459
|
return function() {
|
|
2460
2460
|
const Yr = n.object.position;
|
|
2461
|
-
be.setFromUnitVectors(e.up, re), Be.copy(be).invert(), W.copy(Yr).sub(n.target), W.applyQuaternion(be),
|
|
2461
|
+
be.setFromUnitVectors(e.up, re), Be.copy(be).invert(), W.copy(Yr).sub(n.target), W.applyQuaternion(be), h.setFromVector3(W), n.autoRotate && l === a.NONE && N(R()), n.enableDamping ? (h.theta += u.theta * n.dampingFactor, h.phi += u.phi * n.dampingFactor) : (h.theta += u.theta, h.phi += u.phi);
|
|
2462
2462
|
let Wt = n.minAzimuthAngle, $t = n.maxAzimuthAngle;
|
|
2463
|
-
isFinite(Wt) && isFinite($t) && (Wt < -Math.PI ? Wt += cn : Wt > Math.PI && (Wt -= cn), $t < -Math.PI ? $t += cn : $t > Math.PI && ($t -= cn), Wt <= $t ?
|
|
2463
|
+
isFinite(Wt) && isFinite($t) && (Wt < -Math.PI ? Wt += cn : Wt > Math.PI && (Wt -= cn), $t < -Math.PI ? $t += cn : $t > Math.PI && ($t -= cn), Wt <= $t ? h.theta = Math.max(Wt, Math.min($t, h.theta)) : h.theta = h.theta > (Wt + $t) / 2 ? Math.max(Wt, h.theta) : Math.min($t, h.theta)), h.phi = Math.max(n.minPolarAngle, Math.min(n.maxPolarAngle, h.phi)), h.makeSafe(), n.enableDamping === !0 ? n.target.addScaledVector(f, n.dampingFactor) : n.target.add(f), n.zoomToCursor && M || n.object.isOrthographicCamera ? h.radius = ae(h.radius) : h.radius = ae(h.radius * m), W.setFromSpherical(h), W.applyQuaternion(Be), Yr.copy(n.target).add(W), n.object.matrixAutoUpdate || n.object.updateMatrix(), n.object.lookAt(n.target), n.enableDamping === !0 ? (u.theta *= 1 - n.dampingFactor, u.phi *= 1 - n.dampingFactor, f.multiplyScalar(1 - n.dampingFactor)) : (u.set(0, 0, 0), f.set(0, 0, 0));
|
|
2464
2464
|
let os = !1;
|
|
2465
2465
|
if (n.zoomToCursor && M) {
|
|
2466
2466
|
let as = null;
|
|
@@ -2499,7 +2499,7 @@ class Ga extends pa {
|
|
|
2499
2499
|
TOUCH_DOLLY_ROTATE: 6
|
|
2500
2500
|
};
|
|
2501
2501
|
let l = a.NONE;
|
|
2502
|
-
const c = 1e-6,
|
|
2502
|
+
const c = 1e-6, h = new ai(), u = new ai();
|
|
2503
2503
|
let m = 1;
|
|
2504
2504
|
const f = new $(), g = new ge(), p = new ge(), v = new ge(), d = new ge(), w = new ge(), y = new ge(), E = new ge(), P = new ge(), T = new ge(), b = new $(), x = new ge();
|
|
2505
2505
|
let M = !1;
|
|
@@ -2511,10 +2511,10 @@ class Ga extends pa {
|
|
|
2511
2511
|
return Math.pow(0.95, n.zoomSpeed);
|
|
2512
2512
|
}
|
|
2513
2513
|
function N(W) {
|
|
2514
|
-
n.reverseOrbit || n.reverseHorizontalOrbit ?
|
|
2514
|
+
n.reverseOrbit || n.reverseHorizontalOrbit ? u.theta += W : u.theta -= W;
|
|
2515
2515
|
}
|
|
2516
2516
|
function j(W) {
|
|
2517
|
-
n.reverseOrbit || n.reverseVerticalOrbit ?
|
|
2517
|
+
n.reverseOrbit || n.reverseVerticalOrbit ? u.phi += W : u.phi -= W;
|
|
2518
2518
|
}
|
|
2519
2519
|
const V = (() => {
|
|
2520
2520
|
const W = new $();
|
|
@@ -2909,13 +2909,13 @@ class Eu extends As {
|
|
|
2909
2909
|
i.parse(
|
|
2910
2910
|
c,
|
|
2911
2911
|
r,
|
|
2912
|
-
function(
|
|
2913
|
-
t(
|
|
2912
|
+
function(h) {
|
|
2913
|
+
t(h), i.manager.itemEnd(e);
|
|
2914
2914
|
},
|
|
2915
2915
|
a
|
|
2916
2916
|
);
|
|
2917
|
-
} catch (
|
|
2918
|
-
a(
|
|
2917
|
+
} catch (h) {
|
|
2918
|
+
a(h);
|
|
2919
2919
|
}
|
|
2920
2920
|
},
|
|
2921
2921
|
n,
|
|
@@ -2949,8 +2949,8 @@ class Eu extends As {
|
|
|
2949
2949
|
if (is(new Uint8Array(e.slice(0, 4))) === ja) {
|
|
2950
2950
|
try {
|
|
2951
2951
|
r[Ie.KHR_BINARY_GLTF] = new Vu(e);
|
|
2952
|
-
} catch (
|
|
2953
|
-
s && s(
|
|
2952
|
+
} catch (h) {
|
|
2953
|
+
s && s(h);
|
|
2954
2954
|
return;
|
|
2955
2955
|
}
|
|
2956
2956
|
i = JSON.parse(r[Ie.KHR_BINARY_GLTF].content);
|
|
@@ -2972,27 +2972,27 @@ class Eu extends As {
|
|
|
2972
2972
|
});
|
|
2973
2973
|
l.fileLoader.setRequestHeader(this.requestHeader);
|
|
2974
2974
|
for (let c = 0; c < this.pluginCallbacks.length; c++) {
|
|
2975
|
-
const
|
|
2976
|
-
|
|
2975
|
+
const h = this.pluginCallbacks[c](l);
|
|
2976
|
+
h.name || console.error("THREE.GLTFLoader: Invalid plugin found: missing name"), a[h.name] = h, r[h.name] = !0;
|
|
2977
2977
|
}
|
|
2978
2978
|
if (i.extensionsUsed)
|
|
2979
2979
|
for (let c = 0; c < i.extensionsUsed.length; ++c) {
|
|
2980
|
-
const
|
|
2981
|
-
switch (
|
|
2980
|
+
const h = i.extensionsUsed[c], u = i.extensionsRequired || [];
|
|
2981
|
+
switch (h) {
|
|
2982
2982
|
case Ie.KHR_MATERIALS_UNLIT:
|
|
2983
|
-
r[
|
|
2983
|
+
r[h] = new Au();
|
|
2984
2984
|
break;
|
|
2985
2985
|
case Ie.KHR_DRACO_MESH_COMPRESSION:
|
|
2986
|
-
r[
|
|
2986
|
+
r[h] = new Yu(i, this.dracoLoader);
|
|
2987
2987
|
break;
|
|
2988
2988
|
case Ie.KHR_TEXTURE_TRANSFORM:
|
|
2989
|
-
r[
|
|
2989
|
+
r[h] = new Xu();
|
|
2990
2990
|
break;
|
|
2991
2991
|
case Ie.KHR_MESH_QUANTIZATION:
|
|
2992
|
-
r[
|
|
2992
|
+
r[h] = new Wu();
|
|
2993
2993
|
break;
|
|
2994
2994
|
default:
|
|
2995
|
-
|
|
2995
|
+
u.indexOf(h) >= 0 && a[h] === void 0 && console.warn('THREE.GLTFLoader: Unknown extension "' + h + '".');
|
|
2996
2996
|
}
|
|
2997
2997
|
}
|
|
2998
2998
|
l.setExtensions(r), l.setPlugins(a), l.parse(n, s);
|
|
@@ -3063,18 +3063,18 @@ class Su {
|
|
|
3063
3063
|
return s;
|
|
3064
3064
|
const i = t.json, l = ((i.extensions && i.extensions[this.name] || {}).lights || [])[e];
|
|
3065
3065
|
let c;
|
|
3066
|
-
const
|
|
3067
|
-
l.color !== void 0 &&
|
|
3068
|
-
const
|
|
3066
|
+
const h = new Pe(16777215);
|
|
3067
|
+
l.color !== void 0 && h.setRGB(l.color[0], l.color[1], l.color[2], en);
|
|
3068
|
+
const u = l.range !== void 0 ? l.range : 0;
|
|
3069
3069
|
switch (l.type) {
|
|
3070
3070
|
case "directional":
|
|
3071
|
-
c = new ga(
|
|
3071
|
+
c = new ga(h), c.target.position.set(0, 0, -1), c.add(c.target);
|
|
3072
3072
|
break;
|
|
3073
3073
|
case "point":
|
|
3074
|
-
c = new ir(
|
|
3074
|
+
c = new ir(h), c.distance = u;
|
|
3075
3075
|
break;
|
|
3076
3076
|
case "spot":
|
|
3077
|
-
c = new ma(
|
|
3077
|
+
c = new ma(h), c.distance = u, l.spot = l.spot || {}, l.spot.innerConeAngle = l.spot.innerConeAngle !== void 0 ? l.spot.innerConeAngle : 0, l.spot.outerConeAngle = l.spot.outerConeAngle !== void 0 ? l.spot.outerConeAngle : Math.PI / 4, c.angle = l.spot.outerConeAngle, c.penumbra = 1 - l.spot.innerConeAngle / l.spot.outerConeAngle, c.target.position.set(0, 0, -1), c.add(c.target);
|
|
3078
3078
|
break;
|
|
3079
3079
|
default:
|
|
3080
3080
|
throw new Error("THREE.GLTFLoader: Unexpected light type: " + l.type);
|
|
@@ -3401,15 +3401,15 @@ class Gu {
|
|
|
3401
3401
|
return null;
|
|
3402
3402
|
}
|
|
3403
3403
|
return i.then(function(a) {
|
|
3404
|
-
const l = s.byteOffset || 0, c = s.byteLength || 0,
|
|
3405
|
-
return r.decodeGltfBufferAsync ? r.decodeGltfBufferAsync(
|
|
3404
|
+
const l = s.byteOffset || 0, c = s.byteLength || 0, h = s.count, u = s.byteStride, m = new Uint8Array(a, l, c);
|
|
3405
|
+
return r.decodeGltfBufferAsync ? r.decodeGltfBufferAsync(h, u, m, s.mode, s.filter).then(function(f) {
|
|
3406
3406
|
return f.buffer;
|
|
3407
3407
|
}) : r.ready.then(function() {
|
|
3408
|
-
const f = new ArrayBuffer(
|
|
3408
|
+
const f = new ArrayBuffer(h * u);
|
|
3409
3409
|
return r.decodeGltfBuffer(
|
|
3410
3410
|
new Uint8Array(f),
|
|
3411
|
-
u,
|
|
3412
3411
|
h,
|
|
3412
|
+
u,
|
|
3413
3413
|
m,
|
|
3414
3414
|
s.mode,
|
|
3415
3415
|
s.filter
|
|
@@ -3435,11 +3435,11 @@ class ju {
|
|
|
3435
3435
|
const r = n.extensions[this.name].attributes, a = [], l = {};
|
|
3436
3436
|
for (const c in r)
|
|
3437
3437
|
a.push(
|
|
3438
|
-
this.parser.getDependency("accessor", r[c]).then((
|
|
3438
|
+
this.parser.getDependency("accessor", r[c]).then((h) => (l[c] = h, l[c]))
|
|
3439
3439
|
);
|
|
3440
3440
|
return a.length < 1 ? null : (a.push(this.parser.createNodeMesh(e)), Promise.all(a).then((c) => {
|
|
3441
|
-
const
|
|
3442
|
-
for (const g of
|
|
3441
|
+
const h = c.pop(), u = h.isGroup ? h.children : [h], m = c[0].count, f = [];
|
|
3442
|
+
for (const g of u) {
|
|
3443
3443
|
const p = new Re(), v = new $(), d = new ze(), w = new $(1, 1, 1), y = new Ol(g.geometry, g.material, m);
|
|
3444
3444
|
for (let E = 0; E < m; E++)
|
|
3445
3445
|
l.TRANSLATION && v.fromBufferAttribute(l.TRANSLATION, E), l.ROTATION && d.fromBufferAttribute(l.ROTATION, E), l.SCALE && w.fromBufferAttribute(l.SCALE, E), y.setMatrixAt(E, p.compose(v, d, w));
|
|
@@ -3450,7 +3450,7 @@ class ju {
|
|
|
3450
3450
|
} else E !== "TRANSLATION" && E !== "ROTATION" && E !== "SCALE" && g.geometry.setAttribute(E, l[E]);
|
|
3451
3451
|
At.prototype.copy.call(y, g), this.parser.assignFinalMaterial(y), f.push(y);
|
|
3452
3452
|
}
|
|
3453
|
-
return
|
|
3453
|
+
return h.isGroup ? (h.clear(), h.add(...f), h) : f[0];
|
|
3454
3454
|
}));
|
|
3455
3455
|
}
|
|
3456
3456
|
}
|
|
@@ -3494,27 +3494,27 @@ class Yu {
|
|
|
3494
3494
|
}
|
|
3495
3495
|
decodePrimitive(e, t) {
|
|
3496
3496
|
const n = this.json, s = this.dracoLoader, i = e.extensions[this.name].bufferView, r = e.extensions[this.name].attributes, a = {}, l = {}, c = {};
|
|
3497
|
-
for (const
|
|
3498
|
-
const
|
|
3499
|
-
a[
|
|
3500
|
-
}
|
|
3501
|
-
for (const
|
|
3502
|
-
const
|
|
3503
|
-
if (r[
|
|
3504
|
-
const m = n.accessors[e.attributes[
|
|
3505
|
-
c[
|
|
3497
|
+
for (const h in r) {
|
|
3498
|
+
const u = mr[h] || h.toLowerCase();
|
|
3499
|
+
a[u] = r[h];
|
|
3500
|
+
}
|
|
3501
|
+
for (const h in e.attributes) {
|
|
3502
|
+
const u = mr[h] || h.toLowerCase();
|
|
3503
|
+
if (r[h] !== void 0) {
|
|
3504
|
+
const m = n.accessors[e.attributes[h]], f = es[m.componentType];
|
|
3505
|
+
c[u] = f.name, l[u] = m.normalized === !0;
|
|
3506
3506
|
}
|
|
3507
3507
|
}
|
|
3508
|
-
return t.getDependency("bufferView", i).then(function(
|
|
3509
|
-
return new Promise(function(
|
|
3508
|
+
return t.getDependency("bufferView", i).then(function(h) {
|
|
3509
|
+
return new Promise(function(u, m) {
|
|
3510
3510
|
s.decodeDracoFile(
|
|
3511
|
-
|
|
3511
|
+
h,
|
|
3512
3512
|
function(f) {
|
|
3513
3513
|
for (const g in f.attributes) {
|
|
3514
3514
|
const p = f.attributes[g], v = l[g];
|
|
3515
3515
|
v !== void 0 && (p.normalized = v);
|
|
3516
3516
|
}
|
|
3517
|
-
|
|
3517
|
+
u(f);
|
|
3518
3518
|
},
|
|
3519
3519
|
a,
|
|
3520
3520
|
c,
|
|
@@ -3549,9 +3549,9 @@ class Va extends Nl {
|
|
|
3549
3549
|
return t;
|
|
3550
3550
|
}
|
|
3551
3551
|
interpolate_(e, t, n, s) {
|
|
3552
|
-
const i = this.resultBuffer, r = this.sampleValues, a = this.valueSize, l = a * 2, c = a * 3,
|
|
3552
|
+
const i = this.resultBuffer, r = this.sampleValues, a = this.valueSize, l = a * 2, c = a * 3, h = s - t, u = (n - t) / h, m = u * u, f = m * u, g = e * c, p = g - c, v = -2 * f + 3 * m, d = f - m, w = 1 - v, y = d - m + u;
|
|
3553
3553
|
for (let E = 0; E !== a; E++) {
|
|
3554
|
-
const P = r[p + E + a], T = r[p + E + l] *
|
|
3554
|
+
const P = r[p + E + a], T = r[p + E + l] * h, b = r[g + E + a], x = r[g + E] * h;
|
|
3555
3555
|
i[E] = w * P + y * T + v * b + d * x;
|
|
3556
3556
|
}
|
|
3557
3557
|
return i;
|
|
@@ -3665,26 +3665,26 @@ function Kt(o, e) {
|
|
|
3665
3665
|
}
|
|
3666
3666
|
function Qu(o, e, t) {
|
|
3667
3667
|
let n = !1, s = !1, i = !1;
|
|
3668
|
-
for (let c = 0,
|
|
3669
|
-
const
|
|
3670
|
-
if (
|
|
3668
|
+
for (let c = 0, h = e.length; c < h; c++) {
|
|
3669
|
+
const u = e[c];
|
|
3670
|
+
if (u.POSITION !== void 0 && (n = !0), u.NORMAL !== void 0 && (s = !0), u.COLOR_0 !== void 0 && (i = !0), n && s && i)
|
|
3671
3671
|
break;
|
|
3672
3672
|
}
|
|
3673
3673
|
if (!n && !s && !i)
|
|
3674
3674
|
return Promise.resolve(o);
|
|
3675
3675
|
const r = [], a = [], l = [];
|
|
3676
|
-
for (let c = 0,
|
|
3677
|
-
const
|
|
3676
|
+
for (let c = 0, h = e.length; c < h; c++) {
|
|
3677
|
+
const u = e[c];
|
|
3678
3678
|
if (n) {
|
|
3679
|
-
const m =
|
|
3679
|
+
const m = u.POSITION !== void 0 ? t.getDependency("accessor", u.POSITION) : o.attributes.position;
|
|
3680
3680
|
r.push(m);
|
|
3681
3681
|
}
|
|
3682
3682
|
if (s) {
|
|
3683
|
-
const m =
|
|
3683
|
+
const m = u.NORMAL !== void 0 ? t.getDependency("accessor", u.NORMAL) : o.attributes.normal;
|
|
3684
3684
|
a.push(m);
|
|
3685
3685
|
}
|
|
3686
3686
|
if (i) {
|
|
3687
|
-
const m =
|
|
3687
|
+
const m = u.COLOR_0 !== void 0 ? t.getDependency("accessor", u.COLOR_0) : o.attributes.color;
|
|
3688
3688
|
l.push(m);
|
|
3689
3689
|
}
|
|
3690
3690
|
}
|
|
@@ -3693,8 +3693,8 @@ function Qu(o, e, t) {
|
|
|
3693
3693
|
Promise.all(a),
|
|
3694
3694
|
Promise.all(l)
|
|
3695
3695
|
]).then(function(c) {
|
|
3696
|
-
const
|
|
3697
|
-
return n && (o.morphAttributes.position =
|
|
3696
|
+
const h = c[0], u = c[1], m = c[2];
|
|
3697
|
+
return n && (o.morphAttributes.position = h), s && (o.morphAttributes.normal = u), i && (o.morphAttributes.color = m), o.morphTargetsRelative = !0, o;
|
|
3698
3698
|
});
|
|
3699
3699
|
}
|
|
3700
3700
|
function Ju(o, e) {
|
|
@@ -3825,8 +3825,8 @@ class sh {
|
|
|
3825
3825
|
const s = n.clone(), i = (r, a) => {
|
|
3826
3826
|
const l = this.associations.get(r);
|
|
3827
3827
|
l != null && this.associations.set(a, l);
|
|
3828
|
-
for (const [c,
|
|
3829
|
-
i(
|
|
3828
|
+
for (const [c, h] of r.children.entries())
|
|
3829
|
+
i(h, a.children[c]);
|
|
3830
3830
|
};
|
|
3831
3831
|
return i(n, s), s.name += "_instance_" + e.uses[t]++, s;
|
|
3832
3832
|
}
|
|
@@ -3977,15 +3977,15 @@ class sh {
|
|
|
3977
3977
|
}
|
|
3978
3978
|
const i = [];
|
|
3979
3979
|
return s.bufferView !== void 0 ? i.push(this.getDependency("bufferView", s.bufferView)) : i.push(null), s.sparse !== void 0 && (i.push(this.getDependency("bufferView", s.sparse.indices.bufferView)), i.push(this.getDependency("bufferView", s.sparse.values.bufferView))), Promise.all(i).then(function(r) {
|
|
3980
|
-
const a = r[0], l = Ii[s.type], c = es[s.componentType],
|
|
3980
|
+
const a = r[0], l = Ii[s.type], c = es[s.componentType], h = c.BYTES_PER_ELEMENT, u = h * l, m = s.byteOffset || 0, f = s.bufferView !== void 0 ? n.bufferViews[s.bufferView].byteStride : void 0, g = s.normalized === !0;
|
|
3981
3981
|
let p, v;
|
|
3982
|
-
if (f && f !==
|
|
3982
|
+
if (f && f !== u) {
|
|
3983
3983
|
const d = Math.floor(m / f), w = "InterleavedBuffer:" + s.bufferView + ":" + s.componentType + ":" + d + ":" + s.count;
|
|
3984
3984
|
let y = t.cache.get(w);
|
|
3985
|
-
y || (p = new c(a, d * f, s.count * f /
|
|
3985
|
+
y || (p = new c(a, d * f, s.count * f / h), y = new Er(p, f / h), t.cache.add(w, y)), v = new Jt(
|
|
3986
3986
|
y,
|
|
3987
3987
|
l,
|
|
3988
|
-
m % f /
|
|
3988
|
+
m % f / h,
|
|
3989
3989
|
g
|
|
3990
3990
|
);
|
|
3991
3991
|
} else
|
|
@@ -4028,10 +4028,10 @@ class sh {
|
|
|
4028
4028
|
const s = this, i = this.json, r = i.textures[e], a = i.images[t], l = (a.uri || a.bufferView) + ":" + r.sampler;
|
|
4029
4029
|
if (this.textureCache[l])
|
|
4030
4030
|
return this.textureCache[l];
|
|
4031
|
-
const c = this.loadImageSource(t, n).then(function(
|
|
4032
|
-
|
|
4031
|
+
const c = this.loadImageSource(t, n).then(function(h) {
|
|
4032
|
+
h.flipY = !1, h.name = r.name || a.name || "", h.name === "" && typeof a.uri == "string" && a.uri.startsWith("data:image/") === !1 && (h.name = a.uri);
|
|
4033
4033
|
const m = (i.samplers || {})[r.sampler] || {};
|
|
4034
|
-
return
|
|
4034
|
+
return h.magFilter = lo[m.magFilter] || yt, h.minFilter = lo[m.minFilter] || br, h.wrapS = co[m.wrapS] || Bn, h.wrapT = co[m.wrapT] || Bn, s.associations.set(h, { textures: e }), h;
|
|
4035
4035
|
}).catch(function() {
|
|
4036
4036
|
return null;
|
|
4037
4037
|
});
|
|
@@ -4040,31 +4040,31 @@ class sh {
|
|
|
4040
4040
|
loadImageSource(e, t) {
|
|
4041
4041
|
const n = this, s = this.json, i = this.options;
|
|
4042
4042
|
if (this.sourceCache[e] !== void 0)
|
|
4043
|
-
return this.sourceCache[e].then((
|
|
4043
|
+
return this.sourceCache[e].then((u) => u.clone());
|
|
4044
4044
|
const r = s.images[e], a = self.URL || self.webkitURL;
|
|
4045
4045
|
let l = r.uri || "", c = !1;
|
|
4046
4046
|
if (r.bufferView !== void 0)
|
|
4047
|
-
l = n.getDependency("bufferView", r.bufferView).then(function(
|
|
4047
|
+
l = n.getDependency("bufferView", r.bufferView).then(function(u) {
|
|
4048
4048
|
c = !0;
|
|
4049
|
-
const m = new Blob([
|
|
4049
|
+
const m = new Blob([u], { type: r.mimeType });
|
|
4050
4050
|
return l = a.createObjectURL(m), l;
|
|
4051
4051
|
});
|
|
4052
4052
|
else if (r.uri === void 0)
|
|
4053
4053
|
throw new Error("THREE.GLTFLoader: Image " + e + " is missing URI and bufferView");
|
|
4054
|
-
const
|
|
4054
|
+
const h = Promise.resolve(l).then(function(u) {
|
|
4055
4055
|
return new Promise(function(m, f) {
|
|
4056
4056
|
let g = m;
|
|
4057
4057
|
t.isImageBitmapLoader === !0 && (g = function(p) {
|
|
4058
4058
|
const v = new ts(p);
|
|
4059
4059
|
v.needsUpdate = !0, m(v);
|
|
4060
|
-
}), t.load(Jn.resolveURL(
|
|
4060
|
+
}), t.load(Jn.resolveURL(u, i.path), g, void 0, f);
|
|
4061
4061
|
});
|
|
4062
|
-
}).then(function(
|
|
4063
|
-
return c === !0 && a.revokeObjectURL(l), Kt(
|
|
4064
|
-
}).catch(function(
|
|
4065
|
-
throw console.error("THREE.GLTFLoader: Couldn't load texture", l),
|
|
4062
|
+
}).then(function(u) {
|
|
4063
|
+
return c === !0 && a.revokeObjectURL(l), Kt(u, r), u.userData.mimeType = r.mimeType || th(r.uri), u;
|
|
4064
|
+
}).catch(function(u) {
|
|
4065
|
+
throw console.error("THREE.GLTFLoader: Couldn't load texture", l), u;
|
|
4066
4066
|
});
|
|
4067
|
-
return this.sourceCache[e] =
|
|
4067
|
+
return this.sourceCache[e] = h, h;
|
|
4068
4068
|
}
|
|
4069
4069
|
/**
|
|
4070
4070
|
* Asynchronously assigns a texture to the given material parameters.
|
|
@@ -4130,15 +4130,15 @@ class sh {
|
|
|
4130
4130
|
let r;
|
|
4131
4131
|
const a = {}, l = i.extensions || {}, c = [];
|
|
4132
4132
|
if (l[Ie.KHR_MATERIALS_UNLIT]) {
|
|
4133
|
-
const
|
|
4134
|
-
r =
|
|
4133
|
+
const u = s[Ie.KHR_MATERIALS_UNLIT];
|
|
4134
|
+
r = u.getMaterialType(), c.push(u.extendParams(a, i, t));
|
|
4135
4135
|
} else {
|
|
4136
|
-
const
|
|
4137
|
-
if (a.color = new Pe(1, 1, 1), a.opacity = 1, Array.isArray(
|
|
4138
|
-
const m =
|
|
4136
|
+
const u = i.pbrMetallicRoughness || {};
|
|
4137
|
+
if (a.color = new Pe(1, 1, 1), a.opacity = 1, Array.isArray(u.baseColorFactor)) {
|
|
4138
|
+
const m = u.baseColorFactor;
|
|
4139
4139
|
a.color.setRGB(m[0], m[1], m[2], en), a.opacity = m[3];
|
|
4140
4140
|
}
|
|
4141
|
-
|
|
4141
|
+
u.baseColorTexture !== void 0 && c.push(t.assignTexture(a, "map", u.baseColorTexture, Fn)), a.metalness = u.metallicFactor !== void 0 ? u.metallicFactor : 1, a.roughness = u.roughnessFactor !== void 0 ? u.roughnessFactor : 1, u.metallicRoughnessTexture !== void 0 && (c.push(t.assignTexture(a, "metalnessMap", u.metallicRoughnessTexture)), c.push(t.assignTexture(a, "roughnessMap", u.metallicRoughnessTexture))), r = this._invokeOne(function(m) {
|
|
4142
4142
|
return m.getMaterialType && m.getMaterialType(e);
|
|
4143
4143
|
}), c.push(
|
|
4144
4144
|
Promise.all(
|
|
@@ -4149,23 +4149,23 @@ class sh {
|
|
|
4149
4149
|
);
|
|
4150
4150
|
}
|
|
4151
4151
|
i.doubleSided === !0 && (a.side = tn);
|
|
4152
|
-
const
|
|
4153
|
-
if (
|
|
4154
|
-
const
|
|
4155
|
-
a.normalScale.set(
|
|
4152
|
+
const h = i.alphaMode || Oi.OPAQUE;
|
|
4153
|
+
if (h === Oi.BLEND ? (a.transparent = !0, a.depthWrite = !1) : (a.transparent = !1, h === Oi.MASK && (a.alphaTest = i.alphaCutoff !== void 0 ? i.alphaCutoff : 0.5)), i.normalTexture !== void 0 && r !== qt && (c.push(t.assignTexture(a, "normalMap", i.normalTexture)), a.normalScale = new ge(1, 1), i.normalTexture.scale !== void 0)) {
|
|
4154
|
+
const u = i.normalTexture.scale;
|
|
4155
|
+
a.normalScale.set(u, u);
|
|
4156
4156
|
}
|
|
4157
4157
|
if (i.occlusionTexture !== void 0 && r !== qt && (c.push(t.assignTexture(a, "aoMap", i.occlusionTexture)), i.occlusionTexture.strength !== void 0 && (a.aoMapIntensity = i.occlusionTexture.strength)), i.emissiveFactor !== void 0 && r !== qt) {
|
|
4158
|
-
const
|
|
4158
|
+
const u = i.emissiveFactor;
|
|
4159
4159
|
a.emissive = new Pe().setRGB(
|
|
4160
|
-
|
|
4161
|
-
|
|
4162
|
-
|
|
4160
|
+
u[0],
|
|
4161
|
+
u[1],
|
|
4162
|
+
u[2],
|
|
4163
4163
|
en
|
|
4164
4164
|
);
|
|
4165
4165
|
}
|
|
4166
4166
|
return i.emissiveTexture !== void 0 && r !== qt && c.push(t.assignTexture(a, "emissiveMap", i.emissiveTexture, Fn)), Promise.all(c).then(function() {
|
|
4167
|
-
const
|
|
4168
|
-
return i.name && (
|
|
4167
|
+
const u = new r(a);
|
|
4168
|
+
return i.name && (u.name = i.name), Kt(u, i), t.associations.set(u, { materials: e }), i.extensions && Rn(s, u, i), u;
|
|
4169
4169
|
});
|
|
4170
4170
|
}
|
|
4171
4171
|
/** When Object3D instances are targeted by animation, they need unique names. */
|
|
@@ -4190,12 +4190,12 @@ class sh {
|
|
|
4190
4190
|
}
|
|
4191
4191
|
const r = [];
|
|
4192
4192
|
for (let a = 0, l = e.length; a < l; a++) {
|
|
4193
|
-
const c = e[a],
|
|
4194
|
-
if (
|
|
4195
|
-
r.push(
|
|
4193
|
+
const c = e[a], h = eh(c), u = s[h];
|
|
4194
|
+
if (u)
|
|
4195
|
+
r.push(u.promise);
|
|
4196
4196
|
else {
|
|
4197
4197
|
let m;
|
|
4198
|
-
c.extensions && c.extensions[Ie.KHR_DRACO_MESH_COMPRESSION] ? m = i(c) : m = uo(new mt(), c, t), s[
|
|
4198
|
+
c.extensions && c.extensions[Ie.KHR_DRACO_MESH_COMPRESSION] ? m = i(c) : m = uo(new mt(), c, t), s[h] = { primitive: c, promise: m }, r.push(m);
|
|
4199
4199
|
}
|
|
4200
4200
|
}
|
|
4201
4201
|
return Promise.all(r);
|
|
@@ -4208,13 +4208,13 @@ class sh {
|
|
|
4208
4208
|
loadMesh(e) {
|
|
4209
4209
|
const t = this, n = this.json, s = this.extensions, i = n.meshes[e], r = i.primitives, a = [];
|
|
4210
4210
|
for (let l = 0, c = r.length; l < c; l++) {
|
|
4211
|
-
const
|
|
4212
|
-
a.push(
|
|
4211
|
+
const h = r[l].material === void 0 ? qu(this.cache) : this.getDependency("material", r[l].material);
|
|
4212
|
+
a.push(h);
|
|
4213
4213
|
}
|
|
4214
4214
|
return a.push(t.loadGeometries(r)), Promise.all(a).then(function(l) {
|
|
4215
|
-
const c = l.slice(0, l.length - 1),
|
|
4216
|
-
for (let f = 0, g =
|
|
4217
|
-
const p =
|
|
4215
|
+
const c = l.slice(0, l.length - 1), h = l[l.length - 1], u = [];
|
|
4216
|
+
for (let f = 0, g = h.length; f < g; f++) {
|
|
4217
|
+
const p = h[f], v = r[f];
|
|
4218
4218
|
let d;
|
|
4219
4219
|
const w = c[f];
|
|
4220
4220
|
if (v.mode === bt.TRIANGLES || v.mode === bt.TRIANGLE_STRIP || v.mode === bt.TRIANGLE_FAN || v.mode === void 0)
|
|
@@ -4229,19 +4229,19 @@ class sh {
|
|
|
4229
4229
|
d = new ya(p, w);
|
|
4230
4230
|
else
|
|
4231
4231
|
throw new Error("THREE.GLTFLoader: Primitive mode unsupported: " + v.mode);
|
|
4232
|
-
Object.keys(d.geometry.morphAttributes).length > 0 && Ju(d, i), d.name = t.createUniqueName(i.name || "mesh_" + e), Kt(d, i), v.extensions && Rn(s, d, v), t.assignFinalMaterial(d),
|
|
4232
|
+
Object.keys(d.geometry.morphAttributes).length > 0 && Ju(d, i), d.name = t.createUniqueName(i.name || "mesh_" + e), Kt(d, i), v.extensions && Rn(s, d, v), t.assignFinalMaterial(d), u.push(d);
|
|
4233
4233
|
}
|
|
4234
|
-
for (let f = 0, g =
|
|
4235
|
-
t.associations.set(
|
|
4234
|
+
for (let f = 0, g = u.length; f < g; f++)
|
|
4235
|
+
t.associations.set(u[f], {
|
|
4236
4236
|
meshes: e,
|
|
4237
4237
|
primitives: f
|
|
4238
4238
|
});
|
|
4239
|
-
if (
|
|
4240
|
-
return i.extensions && Rn(s,
|
|
4239
|
+
if (u.length === 1)
|
|
4240
|
+
return i.extensions && Rn(s, u[0], i), u[0];
|
|
4241
4241
|
const m = new Mn();
|
|
4242
4242
|
i.extensions && Rn(s, m, i), t.associations.set(m, { meshes: e });
|
|
4243
|
-
for (let f = 0, g =
|
|
4244
|
-
m.add(
|
|
4243
|
+
for (let f = 0, g = u.length; f < g; f++)
|
|
4244
|
+
m.add(u[f]);
|
|
4245
4245
|
return m;
|
|
4246
4246
|
});
|
|
4247
4247
|
}
|
|
@@ -4275,10 +4275,10 @@ class sh {
|
|
|
4275
4275
|
n.push(this._loadNodeShallow(t.joints[s]));
|
|
4276
4276
|
return t.inverseBindMatrices !== void 0 ? n.push(this.getDependency("accessor", t.inverseBindMatrices)) : n.push(null), Promise.all(n).then(function(s) {
|
|
4277
4277
|
const i = s.pop(), r = s, a = [], l = [];
|
|
4278
|
-
for (let c = 0,
|
|
4279
|
-
const
|
|
4280
|
-
if (
|
|
4281
|
-
a.push(
|
|
4278
|
+
for (let c = 0, h = r.length; c < h; c++) {
|
|
4279
|
+
const u = r[c];
|
|
4280
|
+
if (u) {
|
|
4281
|
+
a.push(u);
|
|
4282
4282
|
const m = new Re();
|
|
4283
4283
|
i !== null && m.fromArray(i.array, c * 16), l.push(m);
|
|
4284
4284
|
} else
|
|
@@ -4293,19 +4293,19 @@ class sh {
|
|
|
4293
4293
|
* @return {Promise<AnimationClip>}
|
|
4294
4294
|
*/
|
|
4295
4295
|
loadAnimation(e) {
|
|
4296
|
-
const t = this.json, n = this, s = t.animations[e], i = s.name ? s.name : "animation_" + e, r = [], a = [], l = [], c = [],
|
|
4297
|
-
for (let
|
|
4298
|
-
const f = s.channels[
|
|
4299
|
-
p.node !== void 0 && (r.push(this.getDependency("node", v)), a.push(this.getDependency("accessor", d)), l.push(this.getDependency("accessor", w)), c.push(g),
|
|
4296
|
+
const t = this.json, n = this, s = t.animations[e], i = s.name ? s.name : "animation_" + e, r = [], a = [], l = [], c = [], h = [];
|
|
4297
|
+
for (let u = 0, m = s.channels.length; u < m; u++) {
|
|
4298
|
+
const f = s.channels[u], g = s.samplers[f.sampler], p = f.target, v = p.node, d = s.parameters !== void 0 ? s.parameters[g.input] : g.input, w = s.parameters !== void 0 ? s.parameters[g.output] : g.output;
|
|
4299
|
+
p.node !== void 0 && (r.push(this.getDependency("node", v)), a.push(this.getDependency("accessor", d)), l.push(this.getDependency("accessor", w)), c.push(g), h.push(p));
|
|
4300
4300
|
}
|
|
4301
4301
|
return Promise.all([
|
|
4302
4302
|
Promise.all(r),
|
|
4303
4303
|
Promise.all(a),
|
|
4304
4304
|
Promise.all(l),
|
|
4305
4305
|
Promise.all(c),
|
|
4306
|
-
Promise.all(
|
|
4307
|
-
]).then(function(
|
|
4308
|
-
const m =
|
|
4306
|
+
Promise.all(h)
|
|
4307
|
+
]).then(function(u) {
|
|
4308
|
+
const m = u[0], f = u[1], g = u[2], p = u[3], v = u[4], d = [];
|
|
4309
4309
|
for (let w = 0, y = m.length; w < y; w++) {
|
|
4310
4310
|
const E = m[w], P = f[w], T = g[w], b = p[w], x = v[w];
|
|
4311
4311
|
if (E === void 0)
|
|
@@ -4337,17 +4337,17 @@ class sh {
|
|
|
4337
4337
|
*/
|
|
4338
4338
|
loadNode(e) {
|
|
4339
4339
|
const t = this.json, n = this, s = t.nodes[e], i = n._loadNodeShallow(e), r = [], a = s.children || [];
|
|
4340
|
-
for (let c = 0,
|
|
4340
|
+
for (let c = 0, h = a.length; c < h; c++)
|
|
4341
4341
|
r.push(n.getDependency("node", a[c]));
|
|
4342
4342
|
const l = s.skin === void 0 ? Promise.resolve(null) : n.getDependency("skin", s.skin);
|
|
4343
4343
|
return Promise.all([i, Promise.all(r), l]).then(function(c) {
|
|
4344
|
-
const
|
|
4345
|
-
m !== null &&
|
|
4344
|
+
const h = c[0], u = c[1], m = c[2];
|
|
4345
|
+
m !== null && h.traverse(function(f) {
|
|
4346
4346
|
f.isSkinnedMesh && f.bind(m, nh);
|
|
4347
4347
|
});
|
|
4348
|
-
for (let f = 0, g =
|
|
4349
|
-
|
|
4350
|
-
return
|
|
4348
|
+
for (let f = 0, g = u.length; f < g; f++)
|
|
4349
|
+
h.add(u[f]);
|
|
4350
|
+
return h;
|
|
4351
4351
|
});
|
|
4352
4352
|
}
|
|
4353
4353
|
// ._loadNodeShallow() parses a single node.
|
|
@@ -4368,16 +4368,16 @@ class sh {
|
|
|
4368
4368
|
}).forEach(function(c) {
|
|
4369
4369
|
a.push(c);
|
|
4370
4370
|
}), this.nodeCache[e] = Promise.all(a).then(function(c) {
|
|
4371
|
-
let
|
|
4372
|
-
if (i.isBone === !0 ?
|
|
4373
|
-
for (let
|
|
4374
|
-
|
|
4375
|
-
if (i.name && (
|
|
4376
|
-
const
|
|
4377
|
-
|
|
4371
|
+
let h;
|
|
4372
|
+
if (i.isBone === !0 ? h = new rr() : c.length > 1 ? h = new Mn() : c.length === 1 ? h = c[0] : h = new At(), h !== c[0])
|
|
4373
|
+
for (let u = 0, m = c.length; u < m; u++)
|
|
4374
|
+
h.add(c[u]);
|
|
4375
|
+
if (i.name && (h.userData.name = i.name, h.name = r), Kt(h, i), i.extensions && Rn(n, h, i), i.matrix !== void 0) {
|
|
4376
|
+
const u = new Re();
|
|
4377
|
+
u.fromArray(i.matrix), h.applyMatrix4(u);
|
|
4378
4378
|
} else
|
|
4379
|
-
i.translation !== void 0 &&
|
|
4380
|
-
return s.associations.has(
|
|
4379
|
+
i.translation !== void 0 && h.position.fromArray(i.translation), i.rotation !== void 0 && h.quaternion.fromArray(i.rotation), i.scale !== void 0 && h.scale.fromArray(i.scale);
|
|
4380
|
+
return s.associations.has(h) || s.associations.set(h, {}), s.associations.get(h).nodes = e, h;
|
|
4381
4381
|
}), this.nodeCache[e];
|
|
4382
4382
|
}
|
|
4383
4383
|
/**
|
|
@@ -4392,16 +4392,16 @@ class sh {
|
|
|
4392
4392
|
for (let l = 0, c = r.length; l < c; l++)
|
|
4393
4393
|
a.push(s.getDependency("node", r[l]));
|
|
4394
4394
|
return Promise.all(a).then(function(l) {
|
|
4395
|
-
for (let
|
|
4396
|
-
i.add(l[
|
|
4397
|
-
const c = (
|
|
4398
|
-
const
|
|
4395
|
+
for (let h = 0, u = l.length; h < u; h++)
|
|
4396
|
+
i.add(l[h]);
|
|
4397
|
+
const c = (h) => {
|
|
4398
|
+
const u = /* @__PURE__ */ new Map();
|
|
4399
4399
|
for (const [m, f] of s.associations)
|
|
4400
|
-
(m instanceof wi || m instanceof ts) &&
|
|
4401
|
-
return
|
|
4400
|
+
(m instanceof wi || m instanceof ts) && u.set(m, f);
|
|
4401
|
+
return h.traverse((m) => {
|
|
4402
4402
|
const f = s.associations.get(m);
|
|
4403
|
-
f != null &&
|
|
4404
|
-
}),
|
|
4403
|
+
f != null && u.set(m, f);
|
|
4404
|
+
}), u;
|
|
4405
4405
|
};
|
|
4406
4406
|
return s.associations = c(i), i;
|
|
4407
4407
|
});
|
|
@@ -4436,13 +4436,13 @@ class sh {
|
|
|
4436
4436
|
}
|
|
4437
4437
|
break;
|
|
4438
4438
|
}
|
|
4439
|
-
const
|
|
4439
|
+
const h = s.interpolation !== void 0 ? Ku[s.interpolation] : Tr, u = this._getArrayFromAccessor(n);
|
|
4440
4440
|
for (let m = 0, f = l.length; m < f; m++) {
|
|
4441
4441
|
const g = new c(
|
|
4442
4442
|
l[m] + "." + fn[i.path],
|
|
4443
4443
|
t.array,
|
|
4444
|
-
|
|
4445
|
-
|
|
4444
|
+
u,
|
|
4445
|
+
h
|
|
4446
4446
|
);
|
|
4447
4447
|
s.interpolation === "CUBICSPLINE" && this._createCubicSplineTrackInterpolant(g), r.push(g);
|
|
4448
4448
|
}
|
|
@@ -4471,8 +4471,8 @@ function ih(o, e, t) {
|
|
|
4471
4471
|
const a = t.json.accessors[n.POSITION], l = a.min, c = a.max;
|
|
4472
4472
|
if (l !== void 0 && c !== void 0) {
|
|
4473
4473
|
if (s.set(new $(l[0], l[1], l[2]), new $(c[0], c[1], c[2])), a.normalized) {
|
|
4474
|
-
const
|
|
4475
|
-
s.min.multiplyScalar(
|
|
4474
|
+
const h = gr(es[a.componentType]);
|
|
4475
|
+
s.min.multiplyScalar(h), s.max.multiplyScalar(h);
|
|
4476
4476
|
}
|
|
4477
4477
|
} else {
|
|
4478
4478
|
console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");
|
|
@@ -4483,10 +4483,10 @@ function ih(o, e, t) {
|
|
|
4483
4483
|
const i = e.targets;
|
|
4484
4484
|
if (i !== void 0) {
|
|
4485
4485
|
const a = new $(), l = new $();
|
|
4486
|
-
for (let c = 0,
|
|
4487
|
-
const
|
|
4488
|
-
if (
|
|
4489
|
-
const m = t.json.accessors[
|
|
4486
|
+
for (let c = 0, h = i.length; c < h; c++) {
|
|
4487
|
+
const u = i[c];
|
|
4488
|
+
if (u.POSITION !== void 0) {
|
|
4489
|
+
const m = t.json.accessors[u.POSITION], f = m.min, g = m.max;
|
|
4490
4490
|
if (f !== void 0 && g !== void 0) {
|
|
4491
4491
|
if (l.setX(Math.max(Math.abs(f[0]), Math.abs(g[0]))), l.setY(Math.max(Math.abs(f[1]), Math.abs(g[1]))), l.setZ(Math.max(Math.abs(f[2]), Math.abs(g[2]))), m.normalized) {
|
|
4492
4492
|
const p = gr(es[m.componentType]);
|
|
@@ -4528,8 +4528,8 @@ const us = new $();
|
|
|
4528
4528
|
function wt(o, e, t, n, s, i) {
|
|
4529
4529
|
const r = 2 * Math.PI * s / 4, a = Math.max(i - 2 * s, 0), l = Math.PI / 4;
|
|
4530
4530
|
us.copy(e), us[n] = 0, us.normalize();
|
|
4531
|
-
const c = 0.5 * r / (r + a),
|
|
4532
|
-
return Math.sign(us[t]) === 1 ?
|
|
4531
|
+
const c = 0.5 * r / (r + a), h = 1 - us.angleTo(o) / l;
|
|
4532
|
+
return Math.sign(us[t]) === 1 ? h * c : a / (r + a) + c + c * (1 - h);
|
|
4533
4533
|
}
|
|
4534
4534
|
class rh extends Zt {
|
|
4535
4535
|
constructor(e = 1, t = 1, n = 1, s = 2, i = 0.1) {
|
|
@@ -4537,9 +4537,9 @@ class rh extends Zt {
|
|
|
4537
4537
|
return;
|
|
4538
4538
|
const r = this.toNonIndexed();
|
|
4539
4539
|
this.index = null, this.attributes.position = r.attributes.position, this.attributes.normal = r.attributes.normal, this.attributes.uv = r.attributes.uv;
|
|
4540
|
-
const a = new $(), l = new $(), c = new $(e, t, n).divideScalar(2).subScalar(i),
|
|
4541
|
-
for (let v = 0, d = 0; v <
|
|
4542
|
-
switch (a.fromArray(
|
|
4540
|
+
const a = new $(), l = new $(), c = new $(e, t, n).divideScalar(2).subScalar(i), h = this.attributes.position.array, u = this.attributes.normal.array, m = this.attributes.uv.array, f = h.length / 6, g = new $(), p = 0.5 / s;
|
|
4541
|
+
for (let v = 0, d = 0; v < h.length; v += 3, d += 2)
|
|
4542
|
+
switch (a.fromArray(h, v), l.copy(a), l.x -= Math.sign(l.x) * p, l.y -= Math.sign(l.y) * p, l.z -= Math.sign(l.z) * p, l.normalize(), h[v + 0] = c.x * Math.sign(a.x) + l.x * i, h[v + 1] = c.y * Math.sign(a.y) + l.y * i, h[v + 2] = c.z * Math.sign(a.z) + l.z * i, u[v + 0] = l.x, u[v + 1] = l.y, u[v + 2] = l.z, Math.floor(v / f)) {
|
|
4543
4543
|
case 0:
|
|
4544
4544
|
g.set(1, 0, 0), m[d + 0] = wt(g, l, "z", "y", i, n), m[d + 1] = 1 - wt(g, l, "y", "z", i, t);
|
|
4545
4545
|
break;
|
|
@@ -4571,14 +4571,14 @@ class ho extends Ul {
|
|
|
4571
4571
|
height: a = 50,
|
|
4572
4572
|
size: l = 100,
|
|
4573
4573
|
lineHeight: c = 1,
|
|
4574
|
-
letterSpacing:
|
|
4575
|
-
...
|
|
4574
|
+
letterSpacing: h = 0,
|
|
4575
|
+
...u
|
|
4576
4576
|
} = t;
|
|
4577
4577
|
if (r === void 0)
|
|
4578
4578
|
super();
|
|
4579
4579
|
else {
|
|
4580
|
-
const m = r.generateShapes(e, l, { lineHeight: c, letterSpacing:
|
|
4581
|
-
super(m, { ...
|
|
4580
|
+
const m = r.generateShapes(e, l, { lineHeight: c, letterSpacing: h });
|
|
4581
|
+
super(m, { ...u, bevelEnabled: n, bevelSize: s, bevelThickness: i, depth: a });
|
|
4582
4582
|
}
|
|
4583
4583
|
this.type = "TextGeometry";
|
|
4584
4584
|
}
|
|
@@ -4693,8 +4693,8 @@ function lh(o, e, t, n) {
|
|
|
4693
4693
|
i[a] = e - n[o + 1 - a], r[a] = n[o + a] - e;
|
|
4694
4694
|
let l = 0;
|
|
4695
4695
|
for (let c = 0; c < a; ++c) {
|
|
4696
|
-
const
|
|
4697
|
-
s[c] = l +
|
|
4696
|
+
const h = r[c + 1], u = i[a - c], m = s[c] / (h + u);
|
|
4697
|
+
s[c] = l + h * m, l = u * m;
|
|
4698
4698
|
}
|
|
4699
4699
|
s[a] = l;
|
|
4700
4700
|
}
|
|
@@ -4703,37 +4703,37 @@ function lh(o, e, t, n) {
|
|
|
4703
4703
|
function ch(o, e, t, n) {
|
|
4704
4704
|
const s = Ya(o, n, e), i = lh(s, n, o, e), r = new it(0, 0, 0, 0);
|
|
4705
4705
|
for (let a = 0; a <= o; ++a) {
|
|
4706
|
-
const l = t[s - o + a], c = i[a],
|
|
4707
|
-
r.x += l.x *
|
|
4706
|
+
const l = t[s - o + a], c = i[a], h = l.w * c;
|
|
4707
|
+
r.x += l.x * h, r.y += l.y * h, r.z += l.z * h, r.w += l.w * c;
|
|
4708
4708
|
}
|
|
4709
4709
|
return r;
|
|
4710
4710
|
}
|
|
4711
4711
|
function uh(o, e, t, n, s) {
|
|
4712
4712
|
const i = [];
|
|
4713
|
-
for (let
|
|
4714
|
-
i[
|
|
4713
|
+
for (let u = 0; u <= t; ++u)
|
|
4714
|
+
i[u] = 0;
|
|
4715
4715
|
const r = [];
|
|
4716
|
-
for (let
|
|
4717
|
-
r[
|
|
4716
|
+
for (let u = 0; u <= n; ++u)
|
|
4717
|
+
r[u] = i.slice(0);
|
|
4718
4718
|
const a = [];
|
|
4719
|
-
for (let
|
|
4720
|
-
a[
|
|
4719
|
+
for (let u = 0; u <= t; ++u)
|
|
4720
|
+
a[u] = i.slice(0);
|
|
4721
4721
|
a[0][0] = 1;
|
|
4722
4722
|
const l = i.slice(0), c = i.slice(0);
|
|
4723
|
-
for (let
|
|
4724
|
-
l[
|
|
4723
|
+
for (let u = 1; u <= t; ++u) {
|
|
4724
|
+
l[u] = e - s[o + 1 - u], c[u] = s[o + u] - e;
|
|
4725
4725
|
let m = 0;
|
|
4726
|
-
for (let f = 0; f <
|
|
4727
|
-
const g = c[f + 1], p = l[
|
|
4728
|
-
a[
|
|
4729
|
-
const v = a[f][
|
|
4730
|
-
a[f][
|
|
4726
|
+
for (let f = 0; f < u; ++f) {
|
|
4727
|
+
const g = c[f + 1], p = l[u - f];
|
|
4728
|
+
a[u][f] = g + p;
|
|
4729
|
+
const v = a[f][u - 1] / a[u][f];
|
|
4730
|
+
a[f][u] = m + g * v, m = p * v;
|
|
4731
4731
|
}
|
|
4732
|
-
a[
|
|
4732
|
+
a[u][u] = m;
|
|
4733
4733
|
}
|
|
4734
|
-
for (let
|
|
4735
|
-
r[0][
|
|
4736
|
-
for (let
|
|
4734
|
+
for (let u = 0; u <= t; ++u)
|
|
4735
|
+
r[0][u] = a[u][t];
|
|
4736
|
+
for (let u = 0; u <= t; ++u) {
|
|
4737
4737
|
let m = 0, f = 1;
|
|
4738
4738
|
const g = [];
|
|
4739
4739
|
for (let p = 0; p <= t; ++p)
|
|
@@ -4741,38 +4741,38 @@ function uh(o, e, t, n, s) {
|
|
|
4741
4741
|
g[0][0] = 1;
|
|
4742
4742
|
for (let p = 1; p <= n; ++p) {
|
|
4743
4743
|
let v = 0;
|
|
4744
|
-
const d =
|
|
4745
|
-
|
|
4746
|
-
const y = d >= -1 ? 1 : -d, E =
|
|
4744
|
+
const d = u - p, w = t - p;
|
|
4745
|
+
u >= p && (g[f][0] = g[m][0] / a[w + 1][d], v = g[f][0] * a[d][w]);
|
|
4746
|
+
const y = d >= -1 ? 1 : -d, E = u - 1 <= w ? p - 1 : t - u;
|
|
4747
4747
|
for (let T = y; T <= E; ++T)
|
|
4748
4748
|
g[f][T] = (g[m][T] - g[m][T - 1]) / a[w + 1][d + T], v += g[f][T] * a[d + T][w];
|
|
4749
|
-
|
|
4749
|
+
u <= w && (g[f][p] = -g[m][p - 1] / a[w + 1][u], v += g[f][p] * a[u][w]), r[p][u] = v;
|
|
4750
4750
|
const P = m;
|
|
4751
4751
|
m = f, f = P;
|
|
4752
4752
|
}
|
|
4753
4753
|
}
|
|
4754
|
-
let
|
|
4755
|
-
for (let
|
|
4754
|
+
let h = t;
|
|
4755
|
+
for (let u = 1; u <= n; ++u) {
|
|
4756
4756
|
for (let m = 0; m <= t; ++m)
|
|
4757
|
-
r[
|
|
4758
|
-
|
|
4757
|
+
r[u][m] *= h;
|
|
4758
|
+
h *= t - u;
|
|
4759
4759
|
}
|
|
4760
4760
|
return r;
|
|
4761
4761
|
}
|
|
4762
4762
|
function hh(o, e, t, n, s) {
|
|
4763
4763
|
const i = s < o ? s : o, r = [], a = Ya(o, n, e), l = uh(a, n, o, i, e), c = [];
|
|
4764
|
-
for (let
|
|
4765
|
-
const
|
|
4766
|
-
|
|
4764
|
+
for (let h = 0; h < t.length; ++h) {
|
|
4765
|
+
const u = t[h].clone(), m = u.w;
|
|
4766
|
+
u.x *= m, u.y *= m, u.z *= m, c[h] = u;
|
|
4767
4767
|
}
|
|
4768
|
-
for (let
|
|
4769
|
-
const
|
|
4768
|
+
for (let h = 0; h <= i; ++h) {
|
|
4769
|
+
const u = c[a - o].clone().multiplyScalar(l[h][0]);
|
|
4770
4770
|
for (let m = 1; m <= o; ++m)
|
|
4771
|
-
|
|
4772
|
-
r[
|
|
4771
|
+
u.add(c[a - o + m].clone().multiplyScalar(l[h][m]));
|
|
4772
|
+
r[h] = u;
|
|
4773
4773
|
}
|
|
4774
|
-
for (let
|
|
4775
|
-
r[
|
|
4774
|
+
for (let h = i + 1; h <= s + 1; ++h)
|
|
4775
|
+
r[h] = new it(0, 0, 0);
|
|
4776
4776
|
return r;
|
|
4777
4777
|
}
|
|
4778
4778
|
function fh(o, e) {
|
|
@@ -5142,8 +5142,8 @@ class gh {
|
|
|
5142
5142
|
const s = this.parseModels(e.skeletons, t, n), i = Ce.Objects.Model, r = this;
|
|
5143
5143
|
s.forEach(function(l) {
|
|
5144
5144
|
const c = i[l.ID];
|
|
5145
|
-
r.setLookAtProperties(l, c), qe.get(l.ID).parents.forEach(function(
|
|
5146
|
-
const m = s.get(
|
|
5145
|
+
r.setLookAtProperties(l, c), qe.get(l.ID).parents.forEach(function(u) {
|
|
5146
|
+
const m = s.get(u.ID);
|
|
5147
5147
|
m !== void 0 && m.add(l);
|
|
5148
5148
|
}), l.parent === null && ht.add(l);
|
|
5149
5149
|
}), this.bindSkeleton(e.skeletons, t, s), this.createAmbientLight(), ht.traverse(function(l) {
|
|
@@ -5161,33 +5161,33 @@ class gh {
|
|
|
5161
5161
|
const s = /* @__PURE__ */ new Map(), i = Ce.Objects.Model;
|
|
5162
5162
|
for (const r in i) {
|
|
5163
5163
|
const a = parseInt(r), l = i[r], c = qe.get(a);
|
|
5164
|
-
let
|
|
5165
|
-
if (!
|
|
5164
|
+
let h = this.buildSkeleton(c, e, a, l.attrName);
|
|
5165
|
+
if (!h) {
|
|
5166
5166
|
switch (l.attrType) {
|
|
5167
5167
|
case "Camera":
|
|
5168
|
-
|
|
5168
|
+
h = this.createCamera(c);
|
|
5169
5169
|
break;
|
|
5170
5170
|
case "Light":
|
|
5171
|
-
|
|
5171
|
+
h = this.createLight(c);
|
|
5172
5172
|
break;
|
|
5173
5173
|
case "Mesh":
|
|
5174
|
-
|
|
5174
|
+
h = this.createMesh(c, t, n);
|
|
5175
5175
|
break;
|
|
5176
5176
|
case "NurbsCurve":
|
|
5177
|
-
|
|
5177
|
+
h = this.createCurve(c, t);
|
|
5178
5178
|
break;
|
|
5179
5179
|
case "LimbNode":
|
|
5180
5180
|
case "Root":
|
|
5181
|
-
|
|
5181
|
+
h = new rr();
|
|
5182
5182
|
break;
|
|
5183
5183
|
case "Null":
|
|
5184
5184
|
default:
|
|
5185
|
-
|
|
5185
|
+
h = new Mn();
|
|
5186
5186
|
break;
|
|
5187
5187
|
}
|
|
5188
|
-
|
|
5188
|
+
h.name = l.attrName ? nn.sanitizeNodeName(l.attrName) : "", h.ID = a;
|
|
5189
5189
|
}
|
|
5190
|
-
this.getTransformData(
|
|
5190
|
+
this.getTransformData(h, l), s.set(a, h);
|
|
5191
5191
|
}
|
|
5192
5192
|
return s;
|
|
5193
5193
|
}
|
|
@@ -5196,10 +5196,10 @@ class gh {
|
|
|
5196
5196
|
return e.parents.forEach(function(r) {
|
|
5197
5197
|
for (const a in t) {
|
|
5198
5198
|
const l = t[a];
|
|
5199
|
-
l.rawBones.forEach(function(c,
|
|
5199
|
+
l.rawBones.forEach(function(c, h) {
|
|
5200
5200
|
if (c.ID === r.ID) {
|
|
5201
|
-
const
|
|
5202
|
-
i = new rr(), i.matrixWorld.copy(c.transformLink), i.name = s ? nn.sanitizeNodeName(s) : "", i.ID = n, l.bones[
|
|
5201
|
+
const u = i;
|
|
5202
|
+
i = new rr(), i.matrixWorld.copy(c.transformLink), i.name = s ? nn.sanitizeNodeName(s) : "", i.ID = n, l.bones[h] = i, u !== null && i.add(u);
|
|
5203
5203
|
}
|
|
5204
5204
|
});
|
|
5205
5205
|
}
|
|
@@ -5223,12 +5223,12 @@ class gh {
|
|
|
5223
5223
|
let a = window.innerWidth, l = window.innerHeight;
|
|
5224
5224
|
n.AspectWidth !== void 0 && n.AspectHeight !== void 0 && (a = n.AspectWidth.value, l = n.AspectHeight.value);
|
|
5225
5225
|
const c = a / l;
|
|
5226
|
-
let
|
|
5227
|
-
n.FieldOfView !== void 0 && (
|
|
5228
|
-
const
|
|
5226
|
+
let h = 45;
|
|
5227
|
+
n.FieldOfView !== void 0 && (h = n.FieldOfView.value);
|
|
5228
|
+
const u = n.FocalLength ? n.FocalLength.value : null;
|
|
5229
5229
|
switch (s) {
|
|
5230
5230
|
case 0:
|
|
5231
|
-
t = new St(
|
|
5231
|
+
t = new St(h, c, i, r), u !== null && t.setFocalLength(u);
|
|
5232
5232
|
break;
|
|
5233
5233
|
case 1:
|
|
5234
5234
|
t = new Qt(
|
|
@@ -5275,8 +5275,8 @@ class gh {
|
|
|
5275
5275
|
case 2:
|
|
5276
5276
|
let c = Math.PI / 3;
|
|
5277
5277
|
n.InnerAngle !== void 0 && (c = Ze.degToRad(n.InnerAngle.value));
|
|
5278
|
-
let
|
|
5279
|
-
n.OuterAngle !== void 0 && (
|
|
5278
|
+
let h = 0;
|
|
5279
|
+
n.OuterAngle !== void 0 && (h = Ze.degToRad(n.OuterAngle.value), h = Math.max(h, 1)), t = new ma(i, r, a, c, h, l);
|
|
5280
5280
|
break;
|
|
5281
5281
|
default:
|
|
5282
5282
|
console.warn(
|
|
@@ -5326,8 +5326,8 @@ class gh {
|
|
|
5326
5326
|
qe.get(parseInt(r.ID)).parents.forEach(function(l) {
|
|
5327
5327
|
if (t.has(l.ID)) {
|
|
5328
5328
|
const c = l.ID;
|
|
5329
|
-
qe.get(c).parents.forEach(function(
|
|
5330
|
-
n.has(
|
|
5329
|
+
qe.get(c).parents.forEach(function(u) {
|
|
5330
|
+
n.has(u.ID) && n.get(u.ID).bind(new _a(r.bones), s[u.ID]);
|
|
5331
5331
|
});
|
|
5332
5332
|
}
|
|
5333
5333
|
});
|
|
@@ -5382,21 +5382,21 @@ class vh {
|
|
|
5382
5382
|
}
|
|
5383
5383
|
// Parse single node mesh geometry in FBXTree.Objects.Geometry
|
|
5384
5384
|
parseMeshGeometry(e, t, n) {
|
|
5385
|
-
const s = n.skeletons, i = [], r = e.parents.map(function(
|
|
5386
|
-
return Ce.Objects.Model[
|
|
5385
|
+
const s = n.skeletons, i = [], r = e.parents.map(function(u) {
|
|
5386
|
+
return Ce.Objects.Model[u.ID];
|
|
5387
5387
|
});
|
|
5388
5388
|
if (r.length === 0)
|
|
5389
5389
|
return;
|
|
5390
|
-
const a = e.children.reduce(function(
|
|
5391
|
-
return s[m.ID] !== void 0 && (
|
|
5390
|
+
const a = e.children.reduce(function(u, m) {
|
|
5391
|
+
return s[m.ID] !== void 0 && (u = s[m.ID]), u;
|
|
5392
5392
|
}, null);
|
|
5393
|
-
e.children.forEach(function(
|
|
5394
|
-
n.morphTargets[
|
|
5393
|
+
e.children.forEach(function(u) {
|
|
5394
|
+
n.morphTargets[u.ID] !== void 0 && i.push(n.morphTargets[u.ID]);
|
|
5395
5395
|
});
|
|
5396
5396
|
const l = r[0], c = {};
|
|
5397
5397
|
"RotationOrder" in l && (c.eulerOrder = $a(l.RotationOrder.value)), "InheritType" in l && (c.inheritType = parseInt(l.InheritType.value)), "GeometricTranslation" in l && (c.translation = l.GeometricTranslation.value), "GeometricRotation" in l && (c.rotation = l.GeometricRotation.value), "GeometricScaling" in l && (c.scale = l.GeometricScaling.value);
|
|
5398
|
-
const
|
|
5399
|
-
return this.genGeometry(t, a, i,
|
|
5398
|
+
const h = Wa(c);
|
|
5399
|
+
return this.genGeometry(t, a, i, h);
|
|
5400
5400
|
}
|
|
5401
5401
|
// Generate a BufferGeometry from a node in FBXTree.Objects.Geometry
|
|
5402
5402
|
genGeometry(e, t, n, s) {
|
|
@@ -5404,18 +5404,18 @@ class vh {
|
|
|
5404
5404
|
e.attrName && (i.name = e.attrName);
|
|
5405
5405
|
const r = this.parseGeoNode(e, t), a = this.genBuffers(r), l = new ft(a.vertex, 3);
|
|
5406
5406
|
if (l.applyMatrix4(s), i.setAttribute("position", l), a.colors.length > 0 && i.setAttribute("color", new ft(a.colors, 3)), t && (i.setAttribute("skinIndex", new jl(a.weightsIndices, 4)), i.setAttribute("skinWeight", new ft(a.vertexWeights, 4)), i.FBX_Deformer = t), a.normal.length > 0) {
|
|
5407
|
-
const c = new Ln().getNormalMatrix(s),
|
|
5408
|
-
|
|
5407
|
+
const c = new Ln().getNormalMatrix(s), h = new ft(a.normal, 3);
|
|
5408
|
+
h.applyNormalMatrix(c), i.setAttribute("normal", h);
|
|
5409
5409
|
}
|
|
5410
|
-
if (a.uvs.forEach(function(c,
|
|
5411
|
-
let
|
|
5412
|
-
|
|
5410
|
+
if (a.uvs.forEach(function(c, h) {
|
|
5411
|
+
let u = "uv" + (h + 1).toString();
|
|
5412
|
+
h === 0 && (u = "uv"), i.setAttribute(u, new ft(a.uvs[h], 2));
|
|
5413
5413
|
}), r.material && r.material.mappingType !== "AllSame") {
|
|
5414
|
-
let c = a.materialIndex[0],
|
|
5415
|
-
if (a.materialIndex.forEach(function(
|
|
5416
|
-
|
|
5414
|
+
let c = a.materialIndex[0], h = 0;
|
|
5415
|
+
if (a.materialIndex.forEach(function(u, m) {
|
|
5416
|
+
u !== c && (i.addGroup(h, m - h, c), c = u, h = m);
|
|
5417
5417
|
}), i.groups.length > 0) {
|
|
5418
|
-
const
|
|
5418
|
+
const u = i.groups[i.groups.length - 1], m = u.start + u.count;
|
|
5419
5419
|
m !== a.materialIndex.length && i.addGroup(m, a.materialIndex.length - m, c);
|
|
5420
5420
|
}
|
|
5421
5421
|
i.groups.length === 0 && i.addGroup(0, a.materialIndex.length, a.materialIndex[0]);
|
|
@@ -5449,7 +5449,7 @@ class vh {
|
|
|
5449
5449
|
vertexWeights: [],
|
|
5450
5450
|
weightsIndices: []
|
|
5451
5451
|
};
|
|
5452
|
-
let n = 0, s = 0, i = !1, r = [], a = [], l = [], c = [],
|
|
5452
|
+
let n = 0, s = 0, i = !1, r = [], a = [], l = [], c = [], h = [], u = [];
|
|
5453
5453
|
const m = this;
|
|
5454
5454
|
return e.vertexIndices.forEach(function(f, g) {
|
|
5455
5455
|
let p, v = !1;
|
|
@@ -5481,7 +5481,7 @@ class vh {
|
|
|
5481
5481
|
for (; w.length < 4; )
|
|
5482
5482
|
w.push(0), d.push(0);
|
|
5483
5483
|
for (let y = 0; y < 4; ++y)
|
|
5484
|
-
|
|
5484
|
+
h.push(w[y]), u.push(d[y]);
|
|
5485
5485
|
}
|
|
5486
5486
|
if (e.normal) {
|
|
5487
5487
|
const y = Ys(g, n, f, e.normal);
|
|
@@ -5498,17 +5498,17 @@ class vh {
|
|
|
5498
5498
|
a,
|
|
5499
5499
|
l,
|
|
5500
5500
|
c,
|
|
5501
|
-
u,
|
|
5502
5501
|
h,
|
|
5502
|
+
u,
|
|
5503
5503
|
s
|
|
5504
|
-
), n++, s = 0, r = [], a = [], l = [], c = [],
|
|
5504
|
+
), n++, s = 0, r = [], a = [], l = [], c = [], h = [], u = []);
|
|
5505
5505
|
}), t;
|
|
5506
5506
|
}
|
|
5507
5507
|
// Generate data for a single face in a geometry. If the face is a quad then split it into 2 tris
|
|
5508
|
-
genFace(e, t, n, s, i, r, a, l, c,
|
|
5509
|
-
for (let
|
|
5510
|
-
e.vertex.push(t.vertexPositions[n[0]]), e.vertex.push(t.vertexPositions[n[1]]), e.vertex.push(t.vertexPositions[n[2]]), e.vertex.push(t.vertexPositions[n[(
|
|
5511
|
-
e.uvs[f] === void 0 && (e.uvs[f] = []), e.uvs[f].push(a[f][0]), e.uvs[f].push(a[f][1]), e.uvs[f].push(a[f][(
|
|
5508
|
+
genFace(e, t, n, s, i, r, a, l, c, h) {
|
|
5509
|
+
for (let u = 2; u < h; u++)
|
|
5510
|
+
e.vertex.push(t.vertexPositions[n[0]]), e.vertex.push(t.vertexPositions[n[1]]), e.vertex.push(t.vertexPositions[n[2]]), e.vertex.push(t.vertexPositions[n[(u - 1) * 3]]), e.vertex.push(t.vertexPositions[n[(u - 1) * 3 + 1]]), e.vertex.push(t.vertexPositions[n[(u - 1) * 3 + 2]]), e.vertex.push(t.vertexPositions[n[u * 3]]), e.vertex.push(t.vertexPositions[n[u * 3 + 1]]), e.vertex.push(t.vertexPositions[n[u * 3 + 2]]), t.skeleton && (e.vertexWeights.push(l[0]), e.vertexWeights.push(l[1]), e.vertexWeights.push(l[2]), e.vertexWeights.push(l[3]), e.vertexWeights.push(l[(u - 1) * 4]), e.vertexWeights.push(l[(u - 1) * 4 + 1]), e.vertexWeights.push(l[(u - 1) * 4 + 2]), e.vertexWeights.push(l[(u - 1) * 4 + 3]), e.vertexWeights.push(l[u * 4]), e.vertexWeights.push(l[u * 4 + 1]), e.vertexWeights.push(l[u * 4 + 2]), e.vertexWeights.push(l[u * 4 + 3]), e.weightsIndices.push(c[0]), e.weightsIndices.push(c[1]), e.weightsIndices.push(c[2]), e.weightsIndices.push(c[3]), e.weightsIndices.push(c[(u - 1) * 4]), e.weightsIndices.push(c[(u - 1) * 4 + 1]), e.weightsIndices.push(c[(u - 1) * 4 + 2]), e.weightsIndices.push(c[(u - 1) * 4 + 3]), e.weightsIndices.push(c[u * 4]), e.weightsIndices.push(c[u * 4 + 1]), e.weightsIndices.push(c[u * 4 + 2]), e.weightsIndices.push(c[u * 4 + 3])), t.color && (e.colors.push(r[0]), e.colors.push(r[1]), e.colors.push(r[2]), e.colors.push(r[(u - 1) * 3]), e.colors.push(r[(u - 1) * 3 + 1]), e.colors.push(r[(u - 1) * 3 + 2]), e.colors.push(r[u * 3]), e.colors.push(r[u * 3 + 1]), e.colors.push(r[u * 3 + 2])), t.material && t.material.mappingType !== "AllSame" && (e.materialIndex.push(s), e.materialIndex.push(s), e.materialIndex.push(s)), t.normal && (e.normal.push(i[0]), e.normal.push(i[1]), e.normal.push(i[2]), e.normal.push(i[(u - 1) * 3]), e.normal.push(i[(u - 1) * 3 + 1]), e.normal.push(i[(u - 1) * 3 + 2]), e.normal.push(i[u * 3]), e.normal.push(i[u * 3 + 1]), e.normal.push(i[u * 3 + 2])), t.uv && t.uv.forEach(function(m, f) {
|
|
5511
|
+
e.uvs[f] === void 0 && (e.uvs[f] = []), e.uvs[f].push(a[f][0]), e.uvs[f].push(a[f][1]), e.uvs[f].push(a[f][(u - 1) * 2]), e.uvs[f].push(a[f][(u - 1) * 2 + 1]), e.uvs[f].push(a[f][u * 2]), e.uvs[f].push(a[f][u * 2 + 1]);
|
|
5512
5512
|
});
|
|
5513
5513
|
}
|
|
5514
5514
|
addMorphTargets(e, t, n, s) {
|
|
@@ -5528,15 +5528,15 @@ class vh {
|
|
|
5528
5528
|
// and a special attribute Index defining which vertices of the original geometry are affected
|
|
5529
5529
|
// Normal and position attributes only have data for the vertices that are affected by the morph
|
|
5530
5530
|
genMorphGeometry(e, t, n, s, i) {
|
|
5531
|
-
const r = t.PolygonVertexIndex !== void 0 ? t.PolygonVertexIndex.a : [], a = n.Vertices !== void 0 ? n.Vertices.a : [], l = n.Indexes !== void 0 ? n.Indexes.a : [], c = e.attributes.position.count * 3,
|
|
5531
|
+
const r = t.PolygonVertexIndex !== void 0 ? t.PolygonVertexIndex.a : [], a = n.Vertices !== void 0 ? n.Vertices.a : [], l = n.Indexes !== void 0 ? n.Indexes.a : [], c = e.attributes.position.count * 3, h = new Float32Array(c);
|
|
5532
5532
|
for (let g = 0; g < l.length; g++) {
|
|
5533
5533
|
const p = l[g] * 3;
|
|
5534
|
-
|
|
5534
|
+
h[p] = a[g * 3], h[p + 1] = a[g * 3 + 1], h[p + 2] = a[g * 3 + 2];
|
|
5535
5535
|
}
|
|
5536
|
-
const
|
|
5536
|
+
const u = {
|
|
5537
5537
|
vertexIndices: r,
|
|
5538
|
-
vertexPositions:
|
|
5539
|
-
}, m = this.genBuffers(
|
|
5538
|
+
vertexPositions: h
|
|
5539
|
+
}, m = this.genBuffers(u), f = new ft(m.vertex, 3);
|
|
5540
5540
|
f.name = i || n.attrName, f.applyMatrix4(s), e.morphAttributes.position.push(f);
|
|
5541
5541
|
}
|
|
5542
5542
|
// Parse normal from FBXTree.Objects.Geometry.LayerElementNormal if it exists
|
|
@@ -5607,18 +5607,18 @@ class vh {
|
|
|
5607
5607
|
if (isNaN(t))
|
|
5608
5608
|
return console.error("THREE.FBXLoader: Invalid Order %s given for geometry ID: %s", e.Order, e.id), new mt();
|
|
5609
5609
|
const n = t - 1, s = e.KnotVector.a, i = [], r = e.Points.a;
|
|
5610
|
-
for (let
|
|
5611
|
-
i.push(new it().fromArray(r,
|
|
5610
|
+
for (let u = 0, m = r.length; u < m; u += 4)
|
|
5611
|
+
i.push(new it().fromArray(r, u));
|
|
5612
5612
|
let a, l;
|
|
5613
5613
|
if (e.Form === "Closed")
|
|
5614
5614
|
i.push(i[0]);
|
|
5615
5615
|
else if (e.Form === "Periodic") {
|
|
5616
5616
|
a = n, l = s.length - 1 - a;
|
|
5617
|
-
for (let
|
|
5618
|
-
i.push(i[
|
|
5617
|
+
for (let u = 0; u < n; ++u)
|
|
5618
|
+
i.push(i[u]);
|
|
5619
5619
|
}
|
|
5620
|
-
const
|
|
5621
|
-
return new mt().setFromPoints(
|
|
5620
|
+
const h = new fo(n, s, i, a, l).getPoints(i.length * 12);
|
|
5621
|
+
return new mt().setFromPoints(h);
|
|
5622
5622
|
}
|
|
5623
5623
|
}
|
|
5624
5624
|
class yh {
|
|
@@ -5684,14 +5684,14 @@ class yh {
|
|
|
5684
5684
|
const i = [], r = qe.get(parseInt(s));
|
|
5685
5685
|
r !== void 0 && (r.children.forEach(function(l, c) {
|
|
5686
5686
|
if (e.has(l.ID)) {
|
|
5687
|
-
const
|
|
5688
|
-
if (
|
|
5687
|
+
const h = e.get(l.ID);
|
|
5688
|
+
if (h.curves.x !== void 0 || h.curves.y !== void 0 || h.curves.z !== void 0) {
|
|
5689
5689
|
if (i[c] === void 0) {
|
|
5690
|
-
const
|
|
5690
|
+
const u = qe.get(l.ID).parents.filter(function(m) {
|
|
5691
5691
|
return m.relationship !== void 0;
|
|
5692
5692
|
})[0].ID;
|
|
5693
|
-
if (
|
|
5694
|
-
const m = Ce.Objects.Model[
|
|
5693
|
+
if (u !== void 0) {
|
|
5694
|
+
const m = Ce.Objects.Model[u.toString()];
|
|
5695
5695
|
if (m === void 0) {
|
|
5696
5696
|
console.warn("THREE.FBXLoader: Encountered a unused curve.", l);
|
|
5697
5697
|
return;
|
|
@@ -5708,18 +5708,18 @@ class yh {
|
|
|
5708
5708
|
}), f.transform || (f.transform = new Re()), "PreRotation" in m && (f.preRotation = m.PreRotation.value), "PostRotation" in m && (f.postRotation = m.PostRotation.value), i[c] = f;
|
|
5709
5709
|
}
|
|
5710
5710
|
}
|
|
5711
|
-
i[c] && (i[c][
|
|
5712
|
-
} else if (
|
|
5711
|
+
i[c] && (i[c][h.attr] = h);
|
|
5712
|
+
} else if (h.curves.morph !== void 0) {
|
|
5713
5713
|
if (i[c] === void 0) {
|
|
5714
|
-
const
|
|
5714
|
+
const u = qe.get(l.ID).parents.filter(function(d) {
|
|
5715
5715
|
return d.relationship !== void 0;
|
|
5716
|
-
})[0].ID, m = qe.get(
|
|
5716
|
+
})[0].ID, m = qe.get(u).parents[0].ID, f = qe.get(m).parents[0].ID, g = qe.get(f).parents[0].ID, p = Ce.Objects.Model[g], v = {
|
|
5717
5717
|
modelName: p.attrName ? nn.sanitizeNodeName(p.attrName) : "",
|
|
5718
|
-
morphName: Ce.Objects.Deformer[
|
|
5718
|
+
morphName: Ce.Objects.Deformer[u].attrName
|
|
5719
5719
|
};
|
|
5720
5720
|
i[c] = v;
|
|
5721
5721
|
}
|
|
5722
|
-
i[c][
|
|
5722
|
+
i[c][h.attr] = h;
|
|
5723
5723
|
}
|
|
5724
5724
|
}
|
|
5725
5725
|
}), n.set(parseInt(s), i));
|
|
@@ -5791,10 +5791,10 @@ class yh {
|
|
|
5791
5791
|
t.x !== void 0 && (this.interpolateRotations(t.x), t.x.values = t.x.values.map(Ze.degToRad)), t.y !== void 0 && (this.interpolateRotations(t.y), t.y.values = t.y.values.map(Ze.degToRad)), t.z !== void 0 && (this.interpolateRotations(t.z), t.z.values = t.z.values.map(Ze.degToRad));
|
|
5792
5792
|
const a = this.getTimesForAllAxes(t), l = this.getKeyframeTrackValues(a, t, n);
|
|
5793
5793
|
s !== void 0 && (s = s.map(Ze.degToRad), s.push(r), s = new wn().fromArray(s), s = new ze().setFromEuler(s)), i !== void 0 && (i = i.map(Ze.degToRad), i.push(r), i = new wn().fromArray(i), i = new ze().setFromEuler(i).invert());
|
|
5794
|
-
const c = new ze(),
|
|
5794
|
+
const c = new ze(), h = new wn(), u = [];
|
|
5795
5795
|
for (let m = 0; m < l.length; m += 3)
|
|
5796
|
-
|
|
5797
|
-
return new lr(e + ".quaternion", a,
|
|
5796
|
+
h.set(l[m], l[m + 1], l[m + 2], r), c.setFromEuler(h), s !== void 0 && c.premultiply(s), i !== void 0 && c.multiply(i), c.toArray(u, m / 3 * 4);
|
|
5797
|
+
return new lr(e + ".quaternion", a, u);
|
|
5798
5798
|
}
|
|
5799
5799
|
generateMorphTrack(e) {
|
|
5800
5800
|
const t = e.DeformPercent.curves.morph, n = t.values.map(function(i) {
|
|
@@ -5827,18 +5827,18 @@ class yh {
|
|
|
5827
5827
|
let r = -1, a = -1, l = -1;
|
|
5828
5828
|
return e.forEach(function(c) {
|
|
5829
5829
|
if (t.x && (r = t.x.times.indexOf(c)), t.y && (a = t.y.times.indexOf(c)), t.z && (l = t.z.times.indexOf(c)), r !== -1) {
|
|
5830
|
-
const
|
|
5831
|
-
i.push(
|
|
5830
|
+
const h = t.x.values[r];
|
|
5831
|
+
i.push(h), s[0] = h;
|
|
5832
5832
|
} else
|
|
5833
5833
|
i.push(s[0]);
|
|
5834
5834
|
if (a !== -1) {
|
|
5835
|
-
const
|
|
5836
|
-
i.push(
|
|
5835
|
+
const h = t.y.values[a];
|
|
5836
|
+
i.push(h), s[1] = h;
|
|
5837
5837
|
} else
|
|
5838
5838
|
i.push(s[1]);
|
|
5839
5839
|
if (l !== -1) {
|
|
5840
|
-
const
|
|
5841
|
-
i.push(
|
|
5840
|
+
const h = t.z.values[l];
|
|
5841
|
+
i.push(h), s[2] = h;
|
|
5842
5842
|
} else
|
|
5843
5843
|
i.push(s[2]);
|
|
5844
5844
|
}), i;
|
|
@@ -5852,11 +5852,11 @@ class yh {
|
|
|
5852
5852
|
if (i >= 180) {
|
|
5853
5853
|
const r = i / 180, a = s / r;
|
|
5854
5854
|
let l = n + a;
|
|
5855
|
-
const c = e.times[t - 1],
|
|
5856
|
-
let m = c +
|
|
5855
|
+
const c = e.times[t - 1], u = (e.times[t] - c) / r;
|
|
5856
|
+
let m = c + u;
|
|
5857
5857
|
const f = [], g = [];
|
|
5858
5858
|
for (; m < e.times[t]; )
|
|
5859
|
-
f.push(m), m +=
|
|
5859
|
+
f.push(m), m += u, g.push(l), l += a;
|
|
5860
5860
|
e.times = go(e.times, t, f), e.values = go(e.values, t, g);
|
|
5861
5861
|
}
|
|
5862
5862
|
}
|
|
@@ -5888,8 +5888,8 @@ class _h {
|
|
|
5888
5888
|
const r = s.match(/^[\s\t]*;/), a = s.match(/^[\s\t]*$/);
|
|
5889
5889
|
if (r || a)
|
|
5890
5890
|
return;
|
|
5891
|
-
const l = s.match("^\\t{" + t.currentIndent + "}(\\w+):(.*){", ""), c = s.match("^\\t{" + t.currentIndent + "}(\\w+):[\\s\\t\\r\\n](.*)"),
|
|
5892
|
-
l ? t.parseNodeBegin(s, l) : c ? t.parseNodeProperty(s, c, n[++i]) :
|
|
5891
|
+
const l = s.match("^\\t{" + t.currentIndent + "}(\\w+):(.*){", ""), c = s.match("^\\t{" + t.currentIndent + "}(\\w+):[\\s\\t\\r\\n](.*)"), h = s.match("^\\t{" + (t.currentIndent - 1) + "}}");
|
|
5892
|
+
l ? t.parseNodeBegin(s, l) : c ? t.parseNodeProperty(s, c, n[++i]) : h ? t.popStack() : s.match(/^[^\s\t}]/) && t.parseNodePropertyContinued(s);
|
|
5893
5893
|
}), this.allNodes;
|
|
5894
5894
|
}
|
|
5895
5895
|
parseNodeBegin(e, t) {
|
|
@@ -5913,11 +5913,11 @@ class _h {
|
|
|
5913
5913
|
return;
|
|
5914
5914
|
}
|
|
5915
5915
|
if (s === "C") {
|
|
5916
|
-
const l = i.split(",").slice(1), c = parseInt(l[0]),
|
|
5917
|
-
let
|
|
5918
|
-
|
|
5916
|
+
const l = i.split(",").slice(1), c = parseInt(l[0]), h = parseInt(l[1]);
|
|
5917
|
+
let u = i.split(",").slice(3);
|
|
5918
|
+
u = u.map(function(m) {
|
|
5919
5919
|
return m.trim().replace(/^"/, "");
|
|
5920
|
-
}), s = "connections", i = [c,
|
|
5920
|
+
}), s = "connections", i = [c, h], Mh(i, u), r[s] === void 0 && (r[s] = []);
|
|
5921
5921
|
}
|
|
5922
5922
|
s === "Node" && (r.id = i), s in r && Array.isArray(r[s]) ? r[s].push(i) : s !== "a" ? r[s] = i : r.a = i, this.setCurrentProp(r, s), s === "a" && i.slice(-1) !== "," && (r.a = Fi(i));
|
|
5923
5923
|
}
|
|
@@ -5927,8 +5927,8 @@ class _h {
|
|
|
5927
5927
|
}
|
|
5928
5928
|
// parse "Property70"
|
|
5929
5929
|
parseNodeSpecialProperty(e, t, n) {
|
|
5930
|
-
const s = n.split('",').map(function(
|
|
5931
|
-
return
|
|
5930
|
+
const s = n.split('",').map(function(h) {
|
|
5931
|
+
return h.trim().replace(/^\"/, "").replace(/\s/, "_");
|
|
5932
5932
|
}), i = s[0], r = s[1], a = s[2], l = s[3];
|
|
5933
5933
|
let c = s[4];
|
|
5934
5934
|
switch (r) {
|
|
@@ -5986,12 +5986,12 @@ class xh {
|
|
|
5986
5986
|
const l = [];
|
|
5987
5987
|
for (let m = 0; m < i; m++)
|
|
5988
5988
|
l.push(this.parseProperty(e));
|
|
5989
|
-
const c = l.length > 0 ? l[0] : "",
|
|
5989
|
+
const c = l.length > 0 ? l[0] : "", h = l.length > 1 ? l[1] : "", u = l.length > 2 ? l[2] : "";
|
|
5990
5990
|
for (n.singleProperty = i === 1 && e.getOffset() === s; s > e.getOffset(); ) {
|
|
5991
5991
|
const m = this.parseNode(e, t);
|
|
5992
5992
|
m !== null && this.parseSubNode(a, n, m);
|
|
5993
5993
|
}
|
|
5994
|
-
return n.propertyList = l, typeof c == "number" && (n.id = c),
|
|
5994
|
+
return n.propertyList = l, typeof c == "number" && (n.id = c), h !== "" && (n.attrName = h), u !== "" && (n.attrType = u), a !== "" && (n.name = a), n;
|
|
5995
5995
|
}
|
|
5996
5996
|
parseSubNode(e, t, n) {
|
|
5997
5997
|
if (n.singleProperty === !0) {
|
|
@@ -6253,7 +6253,7 @@ function Ys(o, e, t, n) {
|
|
|
6253
6253
|
}
|
|
6254
6254
|
const Li = new wn(), Vn = new $();
|
|
6255
6255
|
function Wa(o) {
|
|
6256
|
-
const e = new Re(), t = new Re(), n = new Re(), s = new Re(), i = new Re(), r = new Re(), a = new Re(), l = new Re(), c = new Re(),
|
|
6256
|
+
const e = new Re(), t = new Re(), n = new Re(), s = new Re(), i = new Re(), r = new Re(), a = new Re(), l = new Re(), c = new Re(), h = new Re(), u = new Re(), m = new Re(), f = o.inheritType ? o.inheritType : 0;
|
|
6257
6257
|
if (o.translation && e.setPosition(Vn.fromArray(o.translation)), o.preRotation) {
|
|
6258
6258
|
const _ = o.preRotation.map(Ze.degToRad);
|
|
6259
6259
|
_.push(o.eulerOrder), t.makeRotationFromEuler(Li.fromArray(_));
|
|
@@ -6266,24 +6266,24 @@ function Wa(o) {
|
|
|
6266
6266
|
const _ = o.postRotation.map(Ze.degToRad);
|
|
6267
6267
|
_.push(o.eulerOrder), s.makeRotationFromEuler(Li.fromArray(_)), s.invert();
|
|
6268
6268
|
}
|
|
6269
|
-
o.scale && i.scale(Vn.fromArray(o.scale)), o.scalingOffset && a.setPosition(Vn.fromArray(o.scalingOffset)), o.scalingPivot && r.setPosition(Vn.fromArray(o.scalingPivot)), o.rotationOffset && l.setPosition(Vn.fromArray(o.rotationOffset)), o.rotationPivot && c.setPosition(Vn.fromArray(o.rotationPivot)), o.parentMatrixWorld && (
|
|
6269
|
+
o.scale && i.scale(Vn.fromArray(o.scale)), o.scalingOffset && a.setPosition(Vn.fromArray(o.scalingOffset)), o.scalingPivot && r.setPosition(Vn.fromArray(o.scalingPivot)), o.rotationOffset && l.setPosition(Vn.fromArray(o.rotationOffset)), o.rotationPivot && c.setPosition(Vn.fromArray(o.rotationPivot)), o.parentMatrixWorld && (u.copy(o.parentMatrix), h.copy(o.parentMatrixWorld));
|
|
6270
6270
|
const g = t.clone().multiply(n).multiply(s), p = new Re();
|
|
6271
|
-
p.extractRotation(
|
|
6271
|
+
p.extractRotation(h);
|
|
6272
6272
|
const v = new Re();
|
|
6273
|
-
v.copyPosition(
|
|
6274
|
-
const d = v.clone().invert().multiply(
|
|
6273
|
+
v.copyPosition(h);
|
|
6274
|
+
const d = v.clone().invert().multiply(h), w = p.clone().invert().multiply(d), y = i, E = new Re();
|
|
6275
6275
|
if (f === 0)
|
|
6276
6276
|
E.copy(p).multiply(g).multiply(w).multiply(y);
|
|
6277
6277
|
else if (f === 1)
|
|
6278
6278
|
E.copy(p).multiply(w).multiply(g).multiply(y);
|
|
6279
6279
|
else {
|
|
6280
|
-
const C = new Re().scale(new $().setFromMatrixScale(
|
|
6280
|
+
const C = new Re().scale(new $().setFromMatrixScale(u)).clone().invert(), R = w.clone().multiply(C);
|
|
6281
6281
|
E.copy(p).multiply(g).multiply(R).multiply(y);
|
|
6282
6282
|
}
|
|
6283
6283
|
const P = c.clone().invert(), T = r.clone().invert();
|
|
6284
6284
|
let b = e.clone().multiply(l).multiply(c).multiply(t).multiply(n).multiply(s).multiply(P).multiply(a).multiply(r).multiply(i).multiply(T);
|
|
6285
|
-
const x = new Re().copyPosition(b), M =
|
|
6286
|
-
return m.copyPosition(M), b = m.clone().multiply(E), b.premultiply(
|
|
6285
|
+
const x = new Re().copyPosition(b), M = h.clone().multiply(x);
|
|
6286
|
+
return m.copyPosition(M), b = m.clone().multiply(E), b.premultiply(h.invert()), b;
|
|
6287
6287
|
}
|
|
6288
6288
|
function $a(o) {
|
|
6289
6289
|
o = o || 0;
|
|
@@ -6366,13 +6366,13 @@ Or(Dr, "type");
|
|
|
6366
6366
|
function Rh(o, e, t, n) {
|
|
6367
6367
|
const s = Array.from(o), i = e / t.resolution, r = (t.boundingBox.yMax - t.boundingBox.yMin + t.underlineThickness) * i, a = [];
|
|
6368
6368
|
let l = 0, c = 0;
|
|
6369
|
-
for (let
|
|
6370
|
-
const
|
|
6371
|
-
if (
|
|
6369
|
+
for (let h = 0; h < s.length; h++) {
|
|
6370
|
+
const u = s[h];
|
|
6371
|
+
if (u === `
|
|
6372
6372
|
`)
|
|
6373
6373
|
l = 0, c -= r * n.lineHeight;
|
|
6374
6374
|
else {
|
|
6375
|
-
const m = Ih(
|
|
6375
|
+
const m = Ih(u, i, l, c, t);
|
|
6376
6376
|
m && (l += m.offsetX + n.letterSpacing, a.push(m.path));
|
|
6377
6377
|
}
|
|
6378
6378
|
}
|
|
@@ -6385,7 +6385,7 @@ function Ih(o, e, t, n, s) {
|
|
|
6385
6385
|
return;
|
|
6386
6386
|
}
|
|
6387
6387
|
const r = new mn();
|
|
6388
|
-
let a, l, c,
|
|
6388
|
+
let a, l, c, h, u, m, f, g;
|
|
6389
6389
|
if (i.o) {
|
|
6390
6390
|
const p = i._cachedOutline || (i._cachedOutline = i.o.split(" "));
|
|
6391
6391
|
for (let v = 0, d = p.length; v < d; )
|
|
@@ -6397,10 +6397,10 @@ function Ih(o, e, t, n, s) {
|
|
|
6397
6397
|
a = parseInt(p[v++]) * e + t, l = parseInt(p[v++]) * e + n, r.lineTo(a, l);
|
|
6398
6398
|
break;
|
|
6399
6399
|
case "q":
|
|
6400
|
-
c = parseInt(p[v++]) * e + t,
|
|
6400
|
+
c = parseInt(p[v++]) * e + t, h = parseInt(p[v++]) * e + n, u = parseInt(p[v++]) * e + t, m = parseInt(p[v++]) * e + n, r.quadraticCurveTo(u, m, c, h);
|
|
6401
6401
|
break;
|
|
6402
6402
|
case "b":
|
|
6403
|
-
c = parseInt(p[v++]) * e + t,
|
|
6403
|
+
c = parseInt(p[v++]) * e + t, h = parseInt(p[v++]) * e + n, u = parseInt(p[v++]) * e + t, m = parseInt(p[v++]) * e + n, f = parseInt(p[v++]) * e + t, g = parseInt(p[v++]) * e + n, r.bezierCurveTo(u, m, f, g, c, h);
|
|
6404
6404
|
break;
|
|
6405
6405
|
}
|
|
6406
6406
|
}
|
|
@@ -6424,11 +6424,11 @@ class vo extends Vl {
|
|
|
6424
6424
|
case 4:
|
|
6425
6425
|
throw new Error("THREE.RGBELoader: Memory Error: " + (M || ""));
|
|
6426
6426
|
}
|
|
6427
|
-
},
|
|
6428
|
-
`,
|
|
6427
|
+
}, h = `
|
|
6428
|
+
`, u = function(x, M, _) {
|
|
6429
6429
|
M = M || 1024;
|
|
6430
6430
|
let R = x.pos, B = -1, N = 0, j = "", V = String.fromCharCode.apply(null, new Uint16Array(x.subarray(R, R + 128)));
|
|
6431
|
-
for (; 0 > (B = V.indexOf(
|
|
6431
|
+
for (; 0 > (B = V.indexOf(h)) && N < M && R < x.byteLength; )
|
|
6432
6432
|
j += V, N += V.length, R += 128, V += String.fromCharCode.apply(null, new Uint16Array(x.subarray(R, R + 128)));
|
|
6433
6433
|
return -1 < B ? (x.pos += N + B + 1, j + V.slice(0, B)) : !1;
|
|
6434
6434
|
}, m = function(x) {
|
|
@@ -6444,8 +6444,8 @@ class vo extends Vl {
|
|
|
6444
6444
|
height: 0
|
|
6445
6445
|
};
|
|
6446
6446
|
let j, V;
|
|
6447
|
-
for ((x.pos >= x.byteLength || !(j =
|
|
6448
|
-
`; j =
|
|
6447
|
+
for ((x.pos >= x.byteLength || !(j = u(x))) && r(1, "no header found"), (V = j.match(M)) || r(3, "bad initial token"), N.valid |= 1, N.programtype = V[1], N.string += j + `
|
|
6448
|
+
`; j = u(x), j !== !1; ) {
|
|
6449
6449
|
if (N.string += j + `
|
|
6450
6450
|
`, j.charAt(0) === "#") {
|
|
6451
6451
|
N.comments += j + `
|
|
@@ -6592,10 +6592,10 @@ class ws extends As {
|
|
|
6592
6592
|
k = g(I, k), z = c(I);
|
|
6593
6593
|
break;
|
|
6594
6594
|
case "polyline":
|
|
6595
|
-
k = g(I, k), z =
|
|
6595
|
+
k = g(I, k), z = h(I);
|
|
6596
6596
|
break;
|
|
6597
6597
|
case "circle":
|
|
6598
|
-
k = g(I, k), z =
|
|
6598
|
+
k = g(I, k), z = u(I);
|
|
6599
6599
|
break;
|
|
6600
6600
|
case "ellipse":
|
|
6601
6601
|
k = g(I, k), z = m(I);
|
|
@@ -6846,7 +6846,7 @@ class ws extends As {
|
|
|
6846
6846
|
let z = 0;
|
|
6847
6847
|
return I.getAttribute("points").replace(D, k), O.currentPath.autoClose = !0, O;
|
|
6848
6848
|
}
|
|
6849
|
-
function
|
|
6849
|
+
function h(I) {
|
|
6850
6850
|
function k(S, A, L) {
|
|
6851
6851
|
const X = y(A), H = y(L);
|
|
6852
6852
|
z === 0 ? O.moveTo(X, H) : O.lineTo(X, H), z++;
|
|
@@ -6855,7 +6855,7 @@ class ws extends As {
|
|
|
6855
6855
|
let z = 0;
|
|
6856
6856
|
return I.getAttribute("points").replace(D, k), O.currentPath.autoClose = !1, O;
|
|
6857
6857
|
}
|
|
6858
|
-
function
|
|
6858
|
+
function u(I) {
|
|
6859
6859
|
const k = y(I.getAttribute("cx") || 0), D = y(I.getAttribute("cy") || 0), O = y(I.getAttribute("r") || 0), z = new bi();
|
|
6860
6860
|
z.absarc(k, D, O, 0, Math.PI * 2);
|
|
6861
6861
|
const S = new mn();
|
|
@@ -7277,14 +7277,14 @@ class ws extends As {
|
|
|
7277
7277
|
} else
|
|
7278
7278
|
console.warn('fill-rule: "' + y + '" is currently not implemented.');
|
|
7279
7279
|
}
|
|
7280
|
-
let
|
|
7280
|
+
let h = 999999999, u = -999999999, m = e.subPaths.map((p) => {
|
|
7281
7281
|
const v = p.getPoints();
|
|
7282
7282
|
let d = -999999999, w = 999999999, y = -999999999, E = 999999999;
|
|
7283
7283
|
for (let P = 0; P < v.length; P++) {
|
|
7284
7284
|
const T = v[P];
|
|
7285
7285
|
T.y > d && (d = T.y), T.y < w && (w = T.y), T.x > y && (y = T.x), T.x < E && (E = T.x);
|
|
7286
7286
|
}
|
|
7287
|
-
return
|
|
7287
|
+
return u <= y && (u = y + 1), h >= E && (h = E - 1), {
|
|
7288
7288
|
curves: p.curves,
|
|
7289
7289
|
points: v,
|
|
7290
7290
|
isCW: Yl.isClockWise(v),
|
|
@@ -7299,8 +7299,8 @@ class ws extends As {
|
|
|
7299
7299
|
(p) => c(
|
|
7300
7300
|
p,
|
|
7301
7301
|
m,
|
|
7302
|
-
u,
|
|
7303
7302
|
h,
|
|
7303
|
+
u,
|
|
7304
7304
|
e.userData ? e.userData.style.fillRule : void 0
|
|
7305
7305
|
)
|
|
7306
7306
|
), g = [];
|
|
@@ -7331,7 +7331,7 @@ class ws extends As {
|
|
|
7331
7331
|
return l.setAttribute("position", new ft(i, 3)), l.setAttribute("normal", new ft(r, 3)), l.setAttribute("uv", new ft(a, 2)), l;
|
|
7332
7332
|
}
|
|
7333
7333
|
static pointsToStrokeWithBuffers(e, t, n, s, i, r, a, l) {
|
|
7334
|
-
const c = new ge(),
|
|
7334
|
+
const c = new ge(), h = new ge(), u = new ge(), m = new ge(), f = new ge(), g = new ge(), p = new ge(), v = new ge(), d = new ge(), w = new ge(), y = new ge(), E = new ge(), P = new ge(), T = new ge(), b = new ge(), x = new ge(), M = new ge();
|
|
7335
7335
|
n = n !== void 0 ? n : 12, s = s !== void 0 ? s : 1e-3, l = l !== void 0 ? l : 0, e = H(e);
|
|
7336
7336
|
const _ = e.length;
|
|
7337
7337
|
if (_ < 2)
|
|
@@ -7344,12 +7344,12 @@ class ws extends As {
|
|
|
7344
7344
|
for (let G = 1; G < _; G++) {
|
|
7345
7345
|
R = e[G], G === _ - 1 ? C ? N = e[1] : N = void 0 : N = e[G + 1];
|
|
7346
7346
|
const q = c;
|
|
7347
|
-
if (D(B, R, q),
|
|
7348
|
-
D(R, N,
|
|
7349
|
-
const se = Math.abs(q.dot(
|
|
7347
|
+
if (D(B, R, q), u.copy(q).multiplyScalar(j), E.copy(R).sub(u), P.copy(R).add(u), Z = Q + V, ne = !1, N !== void 0) {
|
|
7348
|
+
D(R, N, h), u.copy(h).multiplyScalar(j), T.copy(R).sub(u), b.copy(R).add(u), te = !0, u.subVectors(N, B), q.dot(u) < 0 && (te = !1), G === 1 && (ae = te), u.subVectors(N, R), u.normalize();
|
|
7349
|
+
const se = Math.abs(q.dot(u));
|
|
7350
7350
|
if (se > Number.EPSILON) {
|
|
7351
7351
|
const ie = j / se;
|
|
7352
|
-
|
|
7352
|
+
u.multiplyScalar(-ie), m.subVectors(R, B), f.copy(m).setLength(ie).add(u), x.copy(f).negate();
|
|
7353
7353
|
const Y = f.length(), F = m.length();
|
|
7354
7354
|
m.divideScalar(F), g.subVectors(N, R);
|
|
7355
7355
|
const oe = g.length();
|
|
@@ -7394,12 +7394,12 @@ class ws extends As {
|
|
|
7394
7394
|
i && (i[I] = G.x, i[I + 1] = G.y, i[I + 2] = 0, r && (r[I] = 0, r[I + 1] = 0, r[I + 2] = 1), I += 3, a && (a[k] = q, a[k + 1] = se, k += 2)), Te += 3;
|
|
7395
7395
|
}
|
|
7396
7396
|
function z(G, q, se, ie, Y) {
|
|
7397
|
-
c.copy(q).sub(G).normalize(),
|
|
7397
|
+
c.copy(q).sub(G).normalize(), h.copy(se).sub(G).normalize();
|
|
7398
7398
|
let F = Math.PI;
|
|
7399
|
-
const oe = c.dot(
|
|
7400
|
-
Math.abs(oe) < 1 && (F = Math.abs(Math.acos(oe))), F /= n,
|
|
7399
|
+
const oe = c.dot(h);
|
|
7400
|
+
Math.abs(oe) < 1 && (F = Math.abs(Math.acos(oe))), F /= n, u.copy(q);
|
|
7401
7401
|
for (let pe = 0, Ae = n - 1; pe < Ae; pe++)
|
|
7402
|
-
m.copy(
|
|
7402
|
+
m.copy(u).rotateAround(G, F), O(u, ie, Y), O(m, ie, Y), O(G, ie, 0.5), u.copy(m);
|
|
7403
7403
|
O(m, ie, Y), O(se, ie, Y), O(G, ie, 0.5);
|
|
7404
7404
|
}
|
|
7405
7405
|
function S() {
|
|
@@ -7418,11 +7418,11 @@ class ws extends As {
|
|
|
7418
7418
|
break;
|
|
7419
7419
|
case "square":
|
|
7420
7420
|
if (Y)
|
|
7421
|
-
c.subVectors(q, G),
|
|
7421
|
+
c.subVectors(q, G), h.set(c.y, -c.x), u.addVectors(c, h).add(G), m.subVectors(h, c).add(G), ie ? (u.toArray(i, 1 * 3), m.toArray(i, 0 * 3), m.toArray(i, 3 * 3)) : (u.toArray(i, 1 * 3), a[3 * 2 + 1] === 1 ? m.toArray(i, 3 * 3) : u.toArray(i, 3 * 3), m.toArray(i, 0 * 3));
|
|
7422
7422
|
else {
|
|
7423
|
-
c.subVectors(se, G),
|
|
7423
|
+
c.subVectors(se, G), h.set(c.y, -c.x), u.addVectors(c, h).add(G), m.subVectors(h, c).add(G);
|
|
7424
7424
|
const oe = i.length;
|
|
7425
|
-
ie ? (
|
|
7425
|
+
ie ? (u.toArray(i, oe - 1 * 3), m.toArray(i, oe - 2 * 3), m.toArray(i, oe - 4 * 3)) : (m.toArray(i, oe - 2 * 3), u.toArray(i, oe - 1 * 3), m.toArray(i, oe - 4 * 3));
|
|
7426
7426
|
}
|
|
7427
7427
|
break;
|
|
7428
7428
|
}
|
|
@@ -7509,8 +7509,8 @@ class Dh extends As {
|
|
|
7509
7509
|
);
|
|
7510
7510
|
}
|
|
7511
7511
|
let s;
|
|
7512
|
-
const i = this.workerNextTaskID++, r = e.byteLength, a = this._getWorker(i, r).then((l) => (s = l, new Promise((c,
|
|
7513
|
-
s._callbacks[i] = { resolve: c, reject:
|
|
7512
|
+
const i = this.workerNextTaskID++, r = e.byteLength, a = this._getWorker(i, r).then((l) => (s = l, new Promise((c, h) => {
|
|
7513
|
+
s._callbacks[i] = { resolve: c, reject: h }, s.postMessage({ type: "decode", id: i, taskConfig: t, buffer: e }, [e]);
|
|
7514
7514
|
}))).then((l) => this._createGeometry(l.geometry));
|
|
7515
7515
|
return a.catch(() => !0).then(() => {
|
|
7516
7516
|
s && i && this._releaseTask(s, i);
|
|
@@ -7601,31 +7601,31 @@ function Lh() {
|
|
|
7601
7601
|
const a = r.data;
|
|
7602
7602
|
switch (a.type) {
|
|
7603
7603
|
case "init":
|
|
7604
|
-
o = a.decoderConfig, e = new Promise(function(
|
|
7605
|
-
o.onModuleLoaded = function(
|
|
7606
|
-
|
|
7604
|
+
o = a.decoderConfig, e = new Promise(function(h) {
|
|
7605
|
+
o.onModuleLoaded = function(u) {
|
|
7606
|
+
h({ draco: u });
|
|
7607
7607
|
}, DracoDecoderModule(o);
|
|
7608
7608
|
});
|
|
7609
7609
|
break;
|
|
7610
7610
|
case "decode":
|
|
7611
7611
|
const l = a.buffer, c = a.taskConfig;
|
|
7612
|
-
e.then((
|
|
7613
|
-
const
|
|
7612
|
+
e.then((h) => {
|
|
7613
|
+
const u = h.draco, m = new u.Decoder(), f = new u.DecoderBuffer();
|
|
7614
7614
|
f.Init(new Int8Array(l), l.byteLength);
|
|
7615
7615
|
try {
|
|
7616
|
-
const g = t(
|
|
7616
|
+
const g = t(u, m, f, c), p = g.attributes.map((v) => v.array.buffer);
|
|
7617
7617
|
g.index && p.push(g.index.array.buffer), self.postMessage({ type: "decode", id: a.id, geometry: g }, p);
|
|
7618
7618
|
} catch (g) {
|
|
7619
7619
|
console.error(g), self.postMessage({ type: "error", id: a.id, error: g.message });
|
|
7620
7620
|
} finally {
|
|
7621
|
-
|
|
7621
|
+
u.destroy(f), u.destroy(m);
|
|
7622
7622
|
}
|
|
7623
7623
|
});
|
|
7624
7624
|
break;
|
|
7625
7625
|
}
|
|
7626
7626
|
};
|
|
7627
7627
|
function t(r, a, l, c) {
|
|
7628
|
-
const
|
|
7628
|
+
const h = c.attributeIDs, u = c.attributeTypes;
|
|
7629
7629
|
let m, f;
|
|
7630
7630
|
const g = a.GetEncodedGeometryType(l);
|
|
7631
7631
|
if (g === r.TRIANGULAR_MESH)
|
|
@@ -7637,13 +7637,13 @@ function Lh() {
|
|
|
7637
7637
|
if (!f.ok() || m.ptr === 0)
|
|
7638
7638
|
throw new Error("THREE.DRACOLoader: Decoding failed: " + f.error_msg());
|
|
7639
7639
|
const p = { index: null, attributes: [] };
|
|
7640
|
-
for (const v in
|
|
7641
|
-
const d = self[
|
|
7640
|
+
for (const v in h) {
|
|
7641
|
+
const d = self[u[v]];
|
|
7642
7642
|
let w, y;
|
|
7643
7643
|
if (c.useUniqueIDs)
|
|
7644
|
-
y =
|
|
7644
|
+
y = h[v], w = a.GetAttributeByUniqueId(m, y);
|
|
7645
7645
|
else {
|
|
7646
|
-
if (y = a.GetAttributeId(m, r[
|
|
7646
|
+
if (y = a.GetAttributeId(m, r[h[v]]), y === -1)
|
|
7647
7647
|
continue;
|
|
7648
7648
|
w = a.GetAttribute(m, y);
|
|
7649
7649
|
}
|
|
@@ -7652,15 +7652,15 @@ function Lh() {
|
|
|
7652
7652
|
return g === r.TRIANGULAR_MESH && (p.index = n(r, a, m)), r.destroy(m), p;
|
|
7653
7653
|
}
|
|
7654
7654
|
function n(r, a, l) {
|
|
7655
|
-
const
|
|
7656
|
-
a.GetTrianglesUInt32Array(l,
|
|
7657
|
-
const f = new Uint32Array(r.HEAPF32.buffer, m,
|
|
7655
|
+
const h = l.num_faces() * 3, u = h * 4, m = r._malloc(u);
|
|
7656
|
+
a.GetTrianglesUInt32Array(l, u, m);
|
|
7657
|
+
const f = new Uint32Array(r.HEAPF32.buffer, m, h).slice();
|
|
7658
7658
|
return r._free(m), { array: f, itemSize: 1 };
|
|
7659
7659
|
}
|
|
7660
|
-
function s(r, a, l, c,
|
|
7661
|
-
const m =
|
|
7662
|
-
a.GetAttributeDataArrayForAllPoints(l,
|
|
7663
|
-
const w = new
|
|
7660
|
+
function s(r, a, l, c, h, u) {
|
|
7661
|
+
const m = u.num_components(), g = l.num_points() * m, p = g * h.BYTES_PER_ELEMENT, v = i(r, h), d = r._malloc(p);
|
|
7662
|
+
a.GetAttributeDataArrayForAllPoints(l, u, v, p, d);
|
|
7663
|
+
const w = new h(r.HEAPF32.buffer, d, g).slice();
|
|
7664
7664
|
return r._free(d), {
|
|
7665
7665
|
name: c,
|
|
7666
7666
|
array: w,
|
|
@@ -7710,8 +7710,8 @@ const Fh = ["args", "center"], Sg = /* @__PURE__ */ me({
|
|
|
7710
7710
|
text: a,
|
|
7711
7711
|
needUpdates: l,
|
|
7712
7712
|
size: c,
|
|
7713
|
-
height:
|
|
7714
|
-
curveSegments:
|
|
7713
|
+
height: h,
|
|
7714
|
+
curveSegments: u,
|
|
7715
7715
|
bevelEnabled: m,
|
|
7716
7716
|
bevelThickness: f,
|
|
7717
7717
|
bevelSize: g,
|
|
@@ -7737,8 +7737,8 @@ const Fh = ["args", "center"], Sg = /* @__PURE__ */ me({
|
|
|
7737
7737
|
})), t = await t, n(), t), x = Fe(() => ({
|
|
7738
7738
|
font: b,
|
|
7739
7739
|
size: un(c),
|
|
7740
|
-
height: un(
|
|
7741
|
-
curveSegments: un(
|
|
7740
|
+
height: un(h),
|
|
7741
|
+
curveSegments: un(u),
|
|
7742
7742
|
bevelEnabled: un(m),
|
|
7743
7743
|
bevelThickness: un(f),
|
|
7744
7744
|
bevelSize: un(g),
|
|
@@ -7747,12 +7747,12 @@ const Fh = ["args", "center"], Sg = /* @__PURE__ */ me({
|
|
|
7747
7747
|
}));
|
|
7748
7748
|
return Pt(() => {
|
|
7749
7749
|
T.value && l.value && (T.value.geometry.dispose(), T.value.geometry = new ho(P.value, x.value), i.value && T.value.geometry.center());
|
|
7750
|
-
}), (M, _) => U(r) ? (ce(),
|
|
7750
|
+
}), (M, _) => U(r) ? (ce(), de("TresMesh", {
|
|
7751
7751
|
key: 0,
|
|
7752
7752
|
ref_key: "text3DRef",
|
|
7753
7753
|
ref: T
|
|
7754
7754
|
}, [
|
|
7755
|
-
P.value ? (ce(),
|
|
7755
|
+
P.value ? (ce(), de("TresTextGeometry", {
|
|
7756
7756
|
key: 0,
|
|
7757
7757
|
args: [P.value, x.value],
|
|
7758
7758
|
center: U(i)
|
|
@@ -7762,7 +7762,7 @@ const Fh = ["args", "center"], Sg = /* @__PURE__ */ me({
|
|
|
7762
7762
|
}
|
|
7763
7763
|
});
|
|
7764
7764
|
function Ag(o, e) {
|
|
7765
|
-
const t =
|
|
7765
|
+
const t = fe(e), n = new Wl(t.value), s = Sa({});
|
|
7766
7766
|
o.forEach((r) => {
|
|
7767
7767
|
const a = n.clipAction(r, t.value);
|
|
7768
7768
|
s[r.name] = a;
|
|
@@ -7790,16 +7790,16 @@ const Pg = /* @__PURE__ */ me({
|
|
|
7790
7790
|
});
|
|
7791
7791
|
{
|
|
7792
7792
|
const l = Math.random() * 1e4, { onBeforeRender: c } = Ke();
|
|
7793
|
-
let
|
|
7794
|
-
c(({ delta:
|
|
7793
|
+
let h = l;
|
|
7794
|
+
c(({ delta: u, invalidate: m }) => {
|
|
7795
7795
|
if (!n.value)
|
|
7796
7796
|
return;
|
|
7797
|
-
|
|
7798
|
-
const f =
|
|
7797
|
+
h += u * t.speed;
|
|
7798
|
+
const f = h * 0.25, g = n.value;
|
|
7799
7799
|
g.rotation.x = Math.cos(f) * 0.125 * t.rotationFactor, g.rotation.y = Math.sin(f) * 0.125 * t.rotationFactor, g.rotation.z = Math.sin(f) * 0.05 * t.rotationFactor, g.position.y = Ze.mapLinear(Math.sin(f), -1, 1, t.range[0], t.range[1]) * t.floatFactor, m();
|
|
7800
7800
|
});
|
|
7801
7801
|
}
|
|
7802
|
-
return (s, i) => (ce(),
|
|
7802
|
+
return (s, i) => (ce(), de("TresGroup", je(s.$attrs, {
|
|
7803
7803
|
ref_key: "groupRef",
|
|
7804
7804
|
ref: n
|
|
7805
7805
|
}), [
|
|
@@ -7819,13 +7819,13 @@ const Pg = /* @__PURE__ */ me({
|
|
|
7819
7819
|
setup(o, { expose: e }) {
|
|
7820
7820
|
const t = o, { extend: n, invalidate: s } = ye(), i = ve();
|
|
7821
7821
|
n({ Reflector: pr });
|
|
7822
|
-
const { color: r, textureWidth: a, textureHeight: l, clipBias: c, multisample:
|
|
7822
|
+
const { color: r, textureWidth: a, textureHeight: l, clipBias: c, multisample: h, shader: u } = De(t);
|
|
7823
7823
|
return ee(t, () => s()), e({
|
|
7824
7824
|
instance: i
|
|
7825
|
-
}), (m, f) => (ce(),
|
|
7825
|
+
}), (m, f) => (ce(), de("TresReflector", {
|
|
7826
7826
|
ref_key: "reflectorRef",
|
|
7827
7827
|
ref: i,
|
|
7828
|
-
args: [void 0, { textureWidth: U(a), textureHeight: U(l), clipBias: U(c), multisample: U(
|
|
7828
|
+
args: [void 0, { textureWidth: U(a), textureHeight: U(l), clipBias: U(c), multisample: U(h), shader: U(u) }],
|
|
7829
7829
|
"material-uniforms-color-value": U(r)
|
|
7830
7830
|
}, [
|
|
7831
7831
|
Ve(m.$slots, "default", {}, () => [
|
|
@@ -7860,11 +7860,11 @@ function Gh(o, e = {}) {
|
|
|
7860
7860
|
};
|
|
7861
7861
|
return (a) => {
|
|
7862
7862
|
const l = dt(o), c = dt(e.maxWait);
|
|
7863
|
-
return t && i(t), l <= 0 || c !== void 0 && c <= 0 ? (n && (i(n), n = null), Promise.resolve(a())) : new Promise((
|
|
7864
|
-
s = e.rejectOnCancel ?
|
|
7865
|
-
t && i(t), n = null,
|
|
7863
|
+
return t && i(t), l <= 0 || c !== void 0 && c <= 0 ? (n && (i(n), n = null), Promise.resolve(a())) : new Promise((h, u) => {
|
|
7864
|
+
s = e.rejectOnCancel ? u : h, c && !n && (n = setTimeout(() => {
|
|
7865
|
+
t && i(t), n = null, h(a());
|
|
7866
7866
|
}, c)), t = setTimeout(() => {
|
|
7867
|
-
n && i(n), n = null,
|
|
7867
|
+
n && i(n), n = null, h(a());
|
|
7868
7868
|
}, l);
|
|
7869
7869
|
});
|
|
7870
7870
|
};
|
|
@@ -7872,14 +7872,14 @@ function Gh(o, e = {}) {
|
|
|
7872
7872
|
function Ka(...o) {
|
|
7873
7873
|
let e = 0, t, n = !0, s = Sn, i, r, a, l, c;
|
|
7874
7874
|
!li(o[0]) && typeof o[0] == "object" ? { delay: r, trailing: a = !0, leading: l = !0, rejectOnCancel: c = !1 } = o[0] : [r, a = !0, l = !0, c = !1] = o;
|
|
7875
|
-
const
|
|
7875
|
+
const h = () => {
|
|
7876
7876
|
t && (clearTimeout(t), t = void 0, s(), s = Sn);
|
|
7877
7877
|
};
|
|
7878
7878
|
return (m) => {
|
|
7879
7879
|
const f = dt(r), g = Date.now() - e, p = () => i = m();
|
|
7880
|
-
return
|
|
7880
|
+
return h(), f <= 0 ? (e = Date.now(), p()) : (g > f && (l || !n) ? (e = Date.now(), p()) : a && (i = new Promise((v, d) => {
|
|
7881
7881
|
s = c ? d : v, t = setTimeout(() => {
|
|
7882
|
-
e = Date.now(), n = !0, v(p()),
|
|
7882
|
+
e = Date.now(), n = !0, v(p()), h();
|
|
7883
7883
|
}, Math.max(0, f - g));
|
|
7884
7884
|
})), !l && !t && (t = setTimeout(() => n = !0, f)), n = !1, i);
|
|
7885
7885
|
};
|
|
@@ -7944,15 +7944,15 @@ function He(...o) {
|
|
|
7944
7944
|
return Sn;
|
|
7945
7945
|
Array.isArray(t) || (t = [t]), Array.isArray(n) || (n = [n]);
|
|
7946
7946
|
const i = [], r = () => {
|
|
7947
|
-
i.forEach((
|
|
7948
|
-
}, a = (
|
|
7947
|
+
i.forEach((h) => h()), i.length = 0;
|
|
7948
|
+
}, a = (h, u, m, f) => (h.addEventListener(u, m, f), () => h.removeEventListener(u, m, f)), l = ee(
|
|
7949
7949
|
() => [bn(e), dt(s)],
|
|
7950
|
-
([
|
|
7951
|
-
if (r(), !
|
|
7950
|
+
([h, u]) => {
|
|
7951
|
+
if (r(), !h)
|
|
7952
7952
|
return;
|
|
7953
|
-
const m = zh(
|
|
7953
|
+
const m = zh(u) ? { ...u } : u;
|
|
7954
7954
|
i.push(
|
|
7955
|
-
...t.flatMap((f) => n.map((g) => a(
|
|
7955
|
+
...t.flatMap((f) => n.map((g) => a(h, f, g, m)))
|
|
7956
7956
|
);
|
|
7957
7957
|
},
|
|
7958
7958
|
{ immediate: !0, flush: "post" }
|
|
@@ -7962,7 +7962,7 @@ function He(...o) {
|
|
|
7962
7962
|
return Lr(c), c;
|
|
7963
7963
|
}
|
|
7964
7964
|
function $h() {
|
|
7965
|
-
const o =
|
|
7965
|
+
const o = fe(!1), e = Aa();
|
|
7966
7966
|
return e && zn(() => {
|
|
7967
7967
|
o.value = !0;
|
|
7968
7968
|
}, e), o;
|
|
@@ -7974,7 +7974,7 @@ function qa(o) {
|
|
|
7974
7974
|
function Zh(o, e = {}) {
|
|
7975
7975
|
const { window: t = rn } = e, n = qa(() => t && "matchMedia" in t && typeof t.matchMedia == "function");
|
|
7976
7976
|
let s;
|
|
7977
|
-
const i =
|
|
7977
|
+
const i = fe(!1), r = (c) => {
|
|
7978
7978
|
i.value = c.matches;
|
|
7979
7979
|
}, a = () => {
|
|
7980
7980
|
s && ("removeEventListener" in s ? s.removeEventListener("change", r) : s.removeListener(r));
|
|
@@ -7990,32 +7990,32 @@ function Kh(o, e, t = {}) {
|
|
|
7990
7990
|
let i;
|
|
7991
7991
|
const r = qa(() => n && "ResizeObserver" in n), a = () => {
|
|
7992
7992
|
i && (i.disconnect(), i = void 0);
|
|
7993
|
-
}, l = Fe(() => Array.isArray(o) ? o.map((
|
|
7993
|
+
}, l = Fe(() => Array.isArray(o) ? o.map((u) => bn(u)) : [bn(o)]), c = ee(
|
|
7994
7994
|
l,
|
|
7995
|
-
(
|
|
7995
|
+
(u) => {
|
|
7996
7996
|
if (a(), r.value && n) {
|
|
7997
7997
|
i = new ResizeObserver(e);
|
|
7998
|
-
for (const m of
|
|
7998
|
+
for (const m of u)
|
|
7999
7999
|
m && i.observe(m, s);
|
|
8000
8000
|
}
|
|
8001
8001
|
},
|
|
8002
8002
|
{ immediate: !0, flush: "post" }
|
|
8003
|
-
),
|
|
8003
|
+
), h = () => {
|
|
8004
8004
|
a(), c();
|
|
8005
8005
|
};
|
|
8006
|
-
return Lr(
|
|
8006
|
+
return Lr(h), {
|
|
8007
8007
|
isSupported: r,
|
|
8008
|
-
stop:
|
|
8008
|
+
stop: h
|
|
8009
8009
|
};
|
|
8010
8010
|
}
|
|
8011
8011
|
function qh(o, e = { width: 0, height: 0 }, t = {}) {
|
|
8012
8012
|
const { window: n = rn, box: s = "content-box" } = t, i = Fe(() => {
|
|
8013
|
-
var
|
|
8014
|
-
return (m = (
|
|
8015
|
-
}), r =
|
|
8013
|
+
var u, m;
|
|
8014
|
+
return (m = (u = bn(o)) == null ? void 0 : u.namespaceURI) == null ? void 0 : m.includes("svg");
|
|
8015
|
+
}), r = fe(e.width), a = fe(e.height), { stop: l } = Kh(
|
|
8016
8016
|
o,
|
|
8017
|
-
([
|
|
8018
|
-
const m = s === "border-box" ?
|
|
8017
|
+
([u]) => {
|
|
8018
|
+
const m = s === "border-box" ? u.borderBoxSize : s === "content-box" ? u.contentBoxSize : u.devicePixelContentBoxSize;
|
|
8019
8019
|
if (n && i.value) {
|
|
8020
8020
|
const f = bn(o);
|
|
8021
8021
|
if (f) {
|
|
@@ -8026,27 +8026,27 @@ function qh(o, e = { width: 0, height: 0 }, t = {}) {
|
|
|
8026
8026
|
const f = Array.isArray(m) ? m : [m];
|
|
8027
8027
|
r.value = f.reduce((g, { inlineSize: p }) => g + p, 0), a.value = f.reduce((g, { blockSize: p }) => g + p, 0);
|
|
8028
8028
|
} else
|
|
8029
|
-
r.value =
|
|
8029
|
+
r.value = u.contentRect.width, a.value = u.contentRect.height;
|
|
8030
8030
|
},
|
|
8031
8031
|
t
|
|
8032
8032
|
);
|
|
8033
8033
|
kr(() => {
|
|
8034
|
-
const
|
|
8035
|
-
|
|
8034
|
+
const u = bn(o);
|
|
8035
|
+
u && (r.value = "offsetWidth" in u ? u.offsetWidth : e.width, a.value = "offsetHeight" in u ? u.offsetHeight : e.height);
|
|
8036
8036
|
});
|
|
8037
8037
|
const c = ee(
|
|
8038
8038
|
() => bn(o),
|
|
8039
|
-
(
|
|
8040
|
-
r.value =
|
|
8039
|
+
(u) => {
|
|
8040
|
+
r.value = u ? e.width : 0, a.value = u ? e.height : 0;
|
|
8041
8041
|
}
|
|
8042
8042
|
);
|
|
8043
|
-
function
|
|
8043
|
+
function h() {
|
|
8044
8044
|
l(), c();
|
|
8045
8045
|
}
|
|
8046
8046
|
return {
|
|
8047
8047
|
width: r,
|
|
8048
8048
|
height: a,
|
|
8049
|
-
stop:
|
|
8049
|
+
stop: h
|
|
8050
8050
|
};
|
|
8051
8051
|
}
|
|
8052
8052
|
const yo = 1;
|
|
@@ -8068,12 +8068,12 @@ function Qh(o, e = {}) {
|
|
|
8068
8068
|
},
|
|
8069
8069
|
behavior: l = "auto",
|
|
8070
8070
|
window: c = rn,
|
|
8071
|
-
onError:
|
|
8071
|
+
onError: h = (b) => {
|
|
8072
8072
|
console.error(b);
|
|
8073
8073
|
}
|
|
8074
|
-
} = e,
|
|
8074
|
+
} = e, u = fe(0), m = fe(0), f = Fe({
|
|
8075
8075
|
get() {
|
|
8076
|
-
return
|
|
8076
|
+
return u.value;
|
|
8077
8077
|
},
|
|
8078
8078
|
set(b) {
|
|
8079
8079
|
p(b, void 0);
|
|
@@ -8099,9 +8099,9 @@ function Qh(o, e = {}) {
|
|
|
8099
8099
|
behavior: dt(l)
|
|
8100
8100
|
});
|
|
8101
8101
|
const N = ((R = B == null ? void 0 : B.document) == null ? void 0 : R.documentElement) || (B == null ? void 0 : B.documentElement) || B;
|
|
8102
|
-
f != null && (
|
|
8102
|
+
f != null && (u.value = N.scrollLeft), g != null && (m.value = N.scrollTop);
|
|
8103
8103
|
}
|
|
8104
|
-
const v =
|
|
8104
|
+
const v = fe(!1), d = Es({
|
|
8105
8105
|
left: !0,
|
|
8106
8106
|
right: !1,
|
|
8107
8107
|
top: !0,
|
|
@@ -8118,9 +8118,9 @@ function Qh(o, e = {}) {
|
|
|
8118
8118
|
if (!c)
|
|
8119
8119
|
return;
|
|
8120
8120
|
const M = ((x = b == null ? void 0 : b.document) == null ? void 0 : x.documentElement) || (b == null ? void 0 : b.documentElement) || bn(b), { display: _, flexDirection: C } = getComputedStyle(M), R = M.scrollLeft;
|
|
8121
|
-
w.left = R <
|
|
8121
|
+
w.left = R < u.value, w.right = R > u.value;
|
|
8122
8122
|
const B = Math.abs(R) <= (r.left || 0), N = Math.abs(R) + M.clientWidth >= M.scrollWidth - (r.right || 0) - yo;
|
|
8123
|
-
_ === "flex" && C === "row-reverse" ? (d.left = N, d.right = B) : (d.left = B, d.right = N),
|
|
8123
|
+
_ === "flex" && C === "row-reverse" ? (d.left = N, d.right = B) : (d.left = B, d.right = N), u.value = R;
|
|
8124
8124
|
let j = M.scrollTop;
|
|
8125
8125
|
b === c.document && !j && (j = c.document.body.scrollTop), w.top = j < m.value, w.bottom = j > m.value;
|
|
8126
8126
|
const V = Math.abs(j) <= (r.top || 0), Q = Math.abs(j) + M.clientHeight >= M.scrollHeight - (r.bottom || 0) - yo;
|
|
@@ -8144,7 +8144,7 @@ function Qh(o, e = {}) {
|
|
|
8144
8144
|
return;
|
|
8145
8145
|
P(b);
|
|
8146
8146
|
} catch (b) {
|
|
8147
|
-
|
|
8147
|
+
h(b);
|
|
8148
8148
|
}
|
|
8149
8149
|
}), He(
|
|
8150
8150
|
o,
|
|
@@ -8185,23 +8185,23 @@ function ef(o = {}) {
|
|
|
8185
8185
|
return {};
|
|
8186
8186
|
},
|
|
8187
8187
|
current: r
|
|
8188
|
-
}, l = e ? Es(a) : a, c = /* @__PURE__ */ new Set(),
|
|
8189
|
-
function
|
|
8188
|
+
}, l = e ? Es(a) : a, c = /* @__PURE__ */ new Set(), h = /* @__PURE__ */ new Set();
|
|
8189
|
+
function u(p, v) {
|
|
8190
8190
|
p in l && (e ? l[p] = v : l[p].value = v);
|
|
8191
8191
|
}
|
|
8192
8192
|
function m() {
|
|
8193
8193
|
r.clear();
|
|
8194
|
-
for (const p of
|
|
8195
|
-
|
|
8194
|
+
for (const p of h)
|
|
8195
|
+
u(p, !1);
|
|
8196
8196
|
}
|
|
8197
8197
|
function f(p, v) {
|
|
8198
8198
|
var d, w;
|
|
8199
8199
|
const y = (d = p.key) == null ? void 0 : d.toLowerCase(), P = [(w = p.code) == null ? void 0 : w.toLowerCase(), y].filter(Boolean);
|
|
8200
8200
|
y && (v ? r.add(y) : r.delete(y));
|
|
8201
8201
|
for (const T of P)
|
|
8202
|
-
|
|
8202
|
+
h.add(T), u(T, v);
|
|
8203
8203
|
y === "meta" && !v ? (c.forEach((T) => {
|
|
8204
|
-
r.delete(T),
|
|
8204
|
+
r.delete(T), u(T, !1);
|
|
8205
8205
|
}), c.clear()) : typeof p.getModifierState == "function" && p.getModifierState("Meta") && v && [...r, ...P].forEach((T) => c.add(T));
|
|
8206
8206
|
}
|
|
8207
8207
|
He(t, "keydown", (p) => (f(p, !0), i(p)), { passive: s }), He(t, "keyup", (p) => (f(p, !1), i(p)), { passive: s }), He("blur", m, { passive: !0 }), He("focus", m, { passive: !0 });
|
|
@@ -8216,7 +8216,7 @@ function ef(o = {}) {
|
|
|
8216
8216
|
const y = v.split(/[+_-]/g).map((E) => E.trim());
|
|
8217
8217
|
l[v] = Fe(() => y.every((E) => dt(g[E])));
|
|
8218
8218
|
} else
|
|
8219
|
-
l[v] =
|
|
8219
|
+
l[v] = fe(!1);
|
|
8220
8220
|
const w = Reflect.get(p, v, d);
|
|
8221
8221
|
return e ? dt(w) : w;
|
|
8222
8222
|
}
|
|
@@ -8242,29 +8242,29 @@ function nf(o = {}) {
|
|
|
8242
8242
|
eventFilter: l
|
|
8243
8243
|
} = o;
|
|
8244
8244
|
let c = null;
|
|
8245
|
-
const
|
|
8245
|
+
const h = fe(s.x), u = fe(s.y), m = fe(null), f = typeof e == "function" ? e : tf[e], g = (P) => {
|
|
8246
8246
|
const T = f(P);
|
|
8247
|
-
c = P, T && ([
|
|
8247
|
+
c = P, T && ([h.value, u.value] = T, m.value = "mouse");
|
|
8248
8248
|
}, p = (P) => {
|
|
8249
8249
|
if (P.touches.length > 0) {
|
|
8250
8250
|
const T = f(P.touches[0]);
|
|
8251
|
-
T && ([
|
|
8251
|
+
T && ([h.value, u.value] = T, m.value = "touch");
|
|
8252
8252
|
}
|
|
8253
8253
|
}, v = () => {
|
|
8254
8254
|
if (!c || !i)
|
|
8255
8255
|
return;
|
|
8256
8256
|
const P = f(c);
|
|
8257
|
-
c instanceof MouseEvent && P && (
|
|
8257
|
+
c instanceof MouseEvent && P && (h.value = P[0] + i.scrollX, u.value = P[1] + i.scrollY);
|
|
8258
8258
|
}, d = () => {
|
|
8259
|
-
|
|
8259
|
+
h.value = s.x, u.value = s.y;
|
|
8260
8260
|
}, w = l ? (P) => l(() => g(P), {}) : (P) => g(P), y = l ? (P) => l(() => p(P), {}) : (P) => p(P), E = l ? () => l(() => v(), {}) : () => v();
|
|
8261
8261
|
if (r) {
|
|
8262
8262
|
const P = { passive: !0 };
|
|
8263
8263
|
He(r, ["mousemove", "dragover"], w, P), t && e !== "movement" && (He(r, ["touchstart", "touchmove"], y, P), n && He(r, "touchend", d, P)), a && e === "page" && He(i, "scroll", E, { passive: !0 });
|
|
8264
8264
|
}
|
|
8265
8265
|
return {
|
|
8266
|
-
x:
|
|
8267
|
-
y:
|
|
8266
|
+
x: h,
|
|
8267
|
+
y: u,
|
|
8268
8268
|
sourceType: m
|
|
8269
8269
|
};
|
|
8270
8270
|
}
|
|
@@ -8272,10 +8272,10 @@ function sf(o = {}) {
|
|
|
8272
8272
|
const { window: e = rn, behavior: t = "auto" } = o;
|
|
8273
8273
|
if (!e)
|
|
8274
8274
|
return {
|
|
8275
|
-
x:
|
|
8276
|
-
y:
|
|
8275
|
+
x: fe(0),
|
|
8276
|
+
y: fe(0)
|
|
8277
8277
|
};
|
|
8278
|
-
const n =
|
|
8278
|
+
const n = fe(e.scrollX), s = fe(e.scrollY), i = Fe({
|
|
8279
8279
|
get() {
|
|
8280
8280
|
return n.value;
|
|
8281
8281
|
},
|
|
@@ -8309,7 +8309,7 @@ function Qa(o = {}) {
|
|
|
8309
8309
|
initialHeight: n = Number.POSITIVE_INFINITY,
|
|
8310
8310
|
listenOrientation: s = !0,
|
|
8311
8311
|
includeScrollbar: i = !0
|
|
8312
|
-
} = o, r =
|
|
8312
|
+
} = o, r = fe(t), a = fe(n), l = () => {
|
|
8313
8313
|
e && (i ? (r.value = e.innerWidth, a.value = e.innerHeight) : (r.value = e.document.documentElement.clientWidth, a.value = e.document.documentElement.clientHeight));
|
|
8314
8314
|
};
|
|
8315
8315
|
if (l(), kr(l), He("resize", l, { passive: !0 }), s) {
|
|
@@ -8329,7 +8329,7 @@ const Rg = /* @__PURE__ */ me({
|
|
|
8329
8329
|
setup(o) {
|
|
8330
8330
|
const e = o, { camera: t, renderer: n } = ye(), { disabled: s, factor: i, ease: r, local: a } = De(e), l = {};
|
|
8331
8331
|
a.value && (l.target = n.value.domElement, l.type = "client");
|
|
8332
|
-
const { x: c, y:
|
|
8332
|
+
const { x: c, y: h } = nf(l), { width: u, height: m } = a.value ? qh(n.value.domElement) : Qa(), f = ve(), g = fe(), p = fe();
|
|
8333
8333
|
ee(
|
|
8334
8334
|
[i, r],
|
|
8335
8335
|
() => {
|
|
@@ -8337,13 +8337,13 @@ const Rg = /* @__PURE__ */ me({
|
|
|
8337
8337
|
},
|
|
8338
8338
|
{ immediate: !0 }
|
|
8339
8339
|
);
|
|
8340
|
-
const v = Fe(() => (c.value /
|
|
8340
|
+
const v = Fe(() => (c.value / u.value - 0.5) * g.value[0]), d = Fe(() => -(h.value / m.value - 0.5) * g.value[1]), { onBeforeRender: w } = Ke();
|
|
8341
8341
|
return w(({ delta: y, invalidate: E }) => {
|
|
8342
8342
|
s.value || !f.value || Number.isNaN(v.value) || Number.isNaN(d.value) || (f.value.position.x += (v.value - f.value.position.x) * p.value[0] * y, f.value.position.y += (d.value - f.value.position.y) * p.value[1] * y, E());
|
|
8343
8343
|
}), ee(
|
|
8344
8344
|
() => f.value,
|
|
8345
8345
|
(y) => y == null ? void 0 : y.add(t.value)
|
|
8346
|
-
), (y, E) => (ce(),
|
|
8346
|
+
), (y, E) => (ce(), de("TresGroup", {
|
|
8347
8347
|
ref_key: "cameraGroupRef",
|
|
8348
8348
|
ref: f
|
|
8349
8349
|
}, null, 512));
|
|
@@ -8359,9 +8359,9 @@ const Rg = /* @__PURE__ */ me({
|
|
|
8359
8359
|
"stopTrigger"
|
|
8360
8360
|
],
|
|
8361
8361
|
async setup(o, { expose: e, emit: t }) {
|
|
8362
|
-
var
|
|
8362
|
+
var u;
|
|
8363
8363
|
const { camera: n, renderer: s } = ye(), i = new Ta();
|
|
8364
|
-
(
|
|
8364
|
+
(u = n.value) == null || u.add(i);
|
|
8365
8365
|
const r = new $l(i), a = new ba();
|
|
8366
8366
|
e({ instance: r }), rt(() => {
|
|
8367
8367
|
r && r.disconnect();
|
|
@@ -8373,8 +8373,8 @@ const Rg = /* @__PURE__ */ me({
|
|
|
8373
8373
|
He(c, "click", () => {
|
|
8374
8374
|
r.isPlaying ? r.pause() : r.play(), t("isPlaying", r.isPlaying);
|
|
8375
8375
|
});
|
|
8376
|
-
const
|
|
8377
|
-
return
|
|
8376
|
+
const h = document.getElementById(o.stopTrigger ?? "");
|
|
8377
|
+
return h && He(h, "click", () => {
|
|
8378
8378
|
r.stop(), t("isPlaying", r.isPlaying);
|
|
8379
8379
|
}), null;
|
|
8380
8380
|
}
|
|
@@ -8468,8 +8468,8 @@ class Ms extends he {
|
|
|
8468
8468
|
depthTest: !1,
|
|
8469
8469
|
depthWrite: !1,
|
|
8470
8470
|
transparent: !1
|
|
8471
|
-
}), c = new he(r, a),
|
|
8472
|
-
name:
|
|
8471
|
+
}), c = new he(r, a), h = [], u = Ja.Shader, m = new Ei({
|
|
8472
|
+
name: u.name,
|
|
8473
8473
|
uniforms: {
|
|
8474
8474
|
map: { value: null },
|
|
8475
8475
|
occlusionMap: { value: s },
|
|
@@ -8477,14 +8477,14 @@ class Ms extends he {
|
|
|
8477
8477
|
scale: { value: new ge() },
|
|
8478
8478
|
screenPosition: { value: new $() }
|
|
8479
8479
|
},
|
|
8480
|
-
vertexShader:
|
|
8481
|
-
fragmentShader:
|
|
8480
|
+
vertexShader: u.vertexShader,
|
|
8481
|
+
fragmentShader: u.fragmentShader,
|
|
8482
8482
|
blending: Mr,
|
|
8483
8483
|
transparent: !0,
|
|
8484
8484
|
depthWrite: !1
|
|
8485
8485
|
}), f = new he(r, m);
|
|
8486
8486
|
this.addElement = function(w) {
|
|
8487
|
-
|
|
8487
|
+
h.push(w);
|
|
8488
8488
|
};
|
|
8489
8489
|
const g = new ge(), p = new ge(), v = new wa(), d = new it();
|
|
8490
8490
|
this.onBeforeRender = function(w, y, E) {
|
|
@@ -8498,8 +8498,8 @@ class Ms extends he {
|
|
|
8498
8498
|
let C = a.uniforms;
|
|
8499
8499
|
C.scale.value = g, C.screenPosition.value = e, w.renderBufferDirect(E, null, r, a, c, null), w.copyFramebufferToTexture(s, p), C = l.uniforms, C.scale.value = g, C.screenPosition.value = e, w.renderBufferDirect(E, null, r, l, c, null);
|
|
8500
8500
|
const R = -e.x * 2, B = -e.y * 2;
|
|
8501
|
-
for (let N = 0, j =
|
|
8502
|
-
const V =
|
|
8501
|
+
for (let N = 0, j = h.length; N < j; N++) {
|
|
8502
|
+
const V = h[N], Q = m.uniforms;
|
|
8503
8503
|
Q.color.value.copy(V.color), Q.map.value = V.texture, Q.screenPosition.value.x = e.x + R * V.distance, Q.screenPosition.value.y = e.y + B * V.distance, _ = V.size / d.w;
|
|
8504
8504
|
const Z = d.w / d.z;
|
|
8505
8505
|
Q.scale.value.set(_ * Z, _), m.uniformsNeedUpdate = !0, w.renderBufferDirect(E, null, r, m, f, null);
|
|
@@ -8507,8 +8507,8 @@ class Ms extends he {
|
|
|
8507
8507
|
}
|
|
8508
8508
|
}, this.dispose = function() {
|
|
8509
8509
|
a.dispose(), l.dispose(), m.dispose(), n.dispose(), s.dispose();
|
|
8510
|
-
for (let w = 0, y =
|
|
8511
|
-
|
|
8510
|
+
for (let w = 0, y = h.length; w < y; w++)
|
|
8511
|
+
h[w].texture.dispose();
|
|
8512
8512
|
};
|
|
8513
8513
|
}
|
|
8514
8514
|
}
|
|
@@ -8797,9 +8797,9 @@ const on = "https://raw.githubusercontent.com/Tresjs/assets/93976c7d63ac83d4a254
|
|
|
8797
8797
|
if (o !== void 0 && o.length > 0 && (typeof t == "number" || typeof n < "u")) {
|
|
8798
8798
|
const a = To(t ?? 0, n ?? vr), l = a.length, c = o.length;
|
|
8799
8799
|
return l >= c ? a.map(
|
|
8800
|
-
(
|
|
8800
|
+
(h, u) => Object.assign(h, e, u < c ? o[u] : {})
|
|
8801
8801
|
) : o.map(
|
|
8802
|
-
(
|
|
8802
|
+
(h, u) => Object.assign({}, s, u < l ? a[u] : {}, e, h)
|
|
8803
8803
|
);
|
|
8804
8804
|
}
|
|
8805
8805
|
if (o !== void 0 && o.length > 0) {
|
|
@@ -8842,13 +8842,13 @@ const Og = /* @__PURE__ */ me({
|
|
|
8842
8842
|
(f = n.value) == null || f.children.forEach((v) => {
|
|
8843
8843
|
"dispose" in v && v.dispose();
|
|
8844
8844
|
}), (g = n.value) == null || g.remove(...n.value.children), (p = n.value) == null || p.dispose();
|
|
8845
|
-
},
|
|
8845
|
+
}, h = (f) => {
|
|
8846
8846
|
if (typeof f.texture == "string") {
|
|
8847
8847
|
const g = f.texture;
|
|
8848
8848
|
f.texture = r.load(g), f.texture.name = g;
|
|
8849
8849
|
}
|
|
8850
8850
|
return f.color = _n(f.color), f;
|
|
8851
|
-
},
|
|
8851
|
+
}, u = () => {
|
|
8852
8852
|
for (let f = s.value.length - 1; f < l.length; f++)
|
|
8853
8853
|
l[f].size = 0;
|
|
8854
8854
|
s.value.forEach((f, g) => {
|
|
@@ -8856,7 +8856,7 @@ const Og = /* @__PURE__ */ me({
|
|
|
8856
8856
|
});
|
|
8857
8857
|
}, m = () => {
|
|
8858
8858
|
for (; s.value.length > l.length; ) {
|
|
8859
|
-
const g = { ...
|
|
8859
|
+
const g = { ...h(s.value[l.length]) };
|
|
8860
8860
|
l.push(g), a.addElement(g);
|
|
8861
8861
|
}
|
|
8862
8862
|
s.value.forEach((f, g) => {
|
|
@@ -8870,7 +8870,7 @@ const Og = /* @__PURE__ */ me({
|
|
|
8870
8870
|
} else
|
|
8871
8871
|
p.texture !== v && (p.texture.dispose(), p.texture = v);
|
|
8872
8872
|
p.size = d, p.distance = w, p.color = _n(y);
|
|
8873
|
-
}),
|
|
8873
|
+
}), u();
|
|
8874
8874
|
};
|
|
8875
8875
|
return rt(() => {
|
|
8876
8876
|
c();
|
|
@@ -8887,20 +8887,20 @@ const Og = /* @__PURE__ */ me({
|
|
|
8887
8887
|
}), ee(() => [i.value, t.elements, t.seed, t.seedProps], () => {
|
|
8888
8888
|
s.value = bo(t.elements, i.value, t.seed, t.seedProps);
|
|
8889
8889
|
}), ee(() => t.scale, () => {
|
|
8890
|
-
|
|
8890
|
+
u();
|
|
8891
8891
|
}), ee(() => s.value, () => {
|
|
8892
8892
|
m();
|
|
8893
|
-
}), (f, g) => (ce(),
|
|
8893
|
+
}), (f, g) => (ce(), de("TresGroup", {
|
|
8894
8894
|
ref_key: "lensflareRef",
|
|
8895
8895
|
ref: n
|
|
8896
8896
|
}, null, 512));
|
|
8897
8897
|
}
|
|
8898
8898
|
});
|
|
8899
8899
|
function bf(o) {
|
|
8900
|
-
const e =
|
|
8900
|
+
const e = fe(null), { height: t, width: n, settings: s, depth: i, autoRender: r = fe(!0) } = pc(o) ? De(o) : De(Es(o)), { onBeforeRender: a } = Ke(), { camera: l, renderer: c, scene: h, sizes: u, invalidate: m } = ye();
|
|
8901
8901
|
return ee(() => [n == null ? void 0 : n.value, u.width.value, t == null ? void 0 : t.value, u.height.value], () => {
|
|
8902
|
-
var
|
|
8903
|
-
(
|
|
8902
|
+
var f;
|
|
8903
|
+
(f = e.value) == null || f.dispose(), e.value = new Gt((n == null ? void 0 : n.value) || u.width.value, (t == null ? void 0 : t.value) || u.height.value, {
|
|
8904
8904
|
minFilter: yt,
|
|
8905
8905
|
magFilter: yt,
|
|
8906
8906
|
type: jt,
|
|
@@ -8909,12 +8909,12 @@ function bf(o) {
|
|
|
8909
8909
|
(n == null ? void 0 : n.value) || u.width.value,
|
|
8910
8910
|
(t == null ? void 0 : t.value) || u.height.value,
|
|
8911
8911
|
ii
|
|
8912
|
-
)),
|
|
8913
|
-
}, { immediate: !0 }),
|
|
8914
|
-
|
|
8912
|
+
)), m();
|
|
8913
|
+
}, { immediate: !0 }), a(() => {
|
|
8914
|
+
r.value && (c.value.setRenderTarget(e.value), c.value.clear(), c.value.render(h.value, l.value), c.value.setRenderTarget(null));
|
|
8915
8915
|
}, Number.POSITIVE_INFINITY), Pr(() => {
|
|
8916
|
-
var
|
|
8917
|
-
(
|
|
8916
|
+
var f;
|
|
8917
|
+
(f = e.value) == null || f.dispose();
|
|
8918
8918
|
}), e;
|
|
8919
8919
|
}
|
|
8920
8920
|
const Dg = /* @__PURE__ */ me({
|
|
@@ -8923,7 +8923,8 @@ const Dg = /* @__PURE__ */ me({
|
|
|
8923
8923
|
width: {},
|
|
8924
8924
|
height: {},
|
|
8925
8925
|
depth: { type: Boolean, default: !1 },
|
|
8926
|
-
settings: { default: void 0 }
|
|
8926
|
+
settings: { default: void 0 },
|
|
8927
|
+
autoRender: { type: Boolean, default: !0 }
|
|
8927
8928
|
},
|
|
8928
8929
|
setup(o, { expose: e }) {
|
|
8929
8930
|
const n = bf(o);
|
|
@@ -8933,22 +8934,22 @@ const Dg = /* @__PURE__ */ me({
|
|
|
8933
8934
|
};
|
|
8934
8935
|
}
|
|
8935
8936
|
}), Ef = (o, e = 16, t, n, s) => {
|
|
8936
|
-
const i = new Float32Array(e * 16), r =
|
|
8937
|
+
const i = new Float32Array(e * 16), r = fe(new Er(i, 16));
|
|
8937
8938
|
return (() => {
|
|
8938
8939
|
if (!o)
|
|
8939
8940
|
return;
|
|
8940
8941
|
const l = new lu(o);
|
|
8941
8942
|
n && l.setWeightAttribute(n), l.build();
|
|
8942
|
-
const c = new $(),
|
|
8943
|
+
const c = new $(), h = new $(), u = new Pe(), m = new At();
|
|
8943
8944
|
o.updateMatrixWorld(!0);
|
|
8944
8945
|
for (let f = 0; f < e; f++)
|
|
8945
|
-
l.sample(c,
|
|
8946
|
+
l.sample(c, h, u), typeof s == "function" ? s(
|
|
8946
8947
|
{
|
|
8947
8948
|
dummy: m,
|
|
8948
8949
|
sampledMesh: o,
|
|
8949
8950
|
position: c,
|
|
8950
|
-
normal:
|
|
8951
|
-
color:
|
|
8951
|
+
normal: h,
|
|
8952
|
+
color: u
|
|
8952
8953
|
},
|
|
8953
8954
|
f
|
|
8954
8955
|
) : m.position.copy(c), m.updateMatrix(), t && t.setMatrixAt(f, m.matrix), m.matrix.toArray(r.value.array, f * 16);
|
|
@@ -8964,13 +8965,13 @@ const Dg = /* @__PURE__ */ me({
|
|
|
8964
8965
|
instanceMesh: {}
|
|
8965
8966
|
},
|
|
8966
8967
|
setup(o, { expose: e }) {
|
|
8967
|
-
const t = o, n =
|
|
8968
|
+
const t = o, n = fe(), s = fe(), i = fe(), { invalidate: r } = ye();
|
|
8968
8969
|
return ee(t, () => r()), Pt(() => {
|
|
8969
8970
|
var a, l;
|
|
8970
8971
|
s.value = t.instanceMesh ?? ((a = n.value) == null ? void 0 : a.children.find((c) => Object.prototype.hasOwnProperty.call(c, "instanceMatrix"))), i.value = t.mesh ?? ((l = n.value) == null ? void 0 : l.children.find((c) => c.type === "Mesh")), Ef(i.value, t.count, s.value, t.weight, t.transform);
|
|
8971
8972
|
}), e({
|
|
8972
8973
|
samplerRef: n
|
|
8973
|
-
}), (a, l) => (ce(),
|
|
8974
|
+
}), (a, l) => (ce(), de("TresGroup", {
|
|
8974
8975
|
ref_key: "samplerRef",
|
|
8975
8976
|
ref: n
|
|
8976
8977
|
}, [
|
|
@@ -9150,20 +9151,20 @@ function Bf(o, e, t) {
|
|
|
9150
9151
|
}));
|
|
9151
9152
|
}
|
|
9152
9153
|
function Nf(o, e, t, n = "default") {
|
|
9153
|
-
const [s, i] = Array.isArray(o) ? o : [o, 1], r = e / s, a = t / i, l = (s * i).toString().length, c = 1 / s,
|
|
9154
|
+
const [s, i] = Array.isArray(o) ? o : [o, 1], r = e / s, a = t / i, l = (s * i).toString().length, c = 1 / s, h = 1 / i, u = [];
|
|
9154
9155
|
let m = 0;
|
|
9155
9156
|
for (let f = i - 1; f >= 0; f--)
|
|
9156
9157
|
for (let g = 0; g < s; g++)
|
|
9157
|
-
m++,
|
|
9158
|
+
m++, u.push({
|
|
9158
9159
|
name: n + String(m).padStart(l, "0"),
|
|
9159
9160
|
offsetX: g * c,
|
|
9160
|
-
offsetY: f *
|
|
9161
|
+
offsetY: f * h,
|
|
9161
9162
|
repeatX: c,
|
|
9162
|
-
repeatY:
|
|
9163
|
+
repeatY: h,
|
|
9163
9164
|
width: r,
|
|
9164
9165
|
height: a
|
|
9165
9166
|
});
|
|
9166
|
-
return
|
|
9167
|
+
return u;
|
|
9167
9168
|
}
|
|
9168
9169
|
function Uf(o, e = {}) {
|
|
9169
9170
|
const t = il(o.frames);
|
|
@@ -9235,7 +9236,7 @@ const Hf = ["scale", "position"], Gf = ["map", "alphaTest"], jf = ["scale", "pos
|
|
|
9235
9236
|
ee(i, () => {
|
|
9236
9237
|
a();
|
|
9237
9238
|
});
|
|
9238
|
-
const l =
|
|
9239
|
+
const l = fe(0), c = fe(0), h = fe(0), u = fe(0), m = ve();
|
|
9239
9240
|
e({ instance: m });
|
|
9240
9241
|
const [f, g] = ([n, s] = An(() => Df(i.image, i.atlas)), n = await n, s(), n);
|
|
9241
9242
|
f.matrixAutoUpdate = !1;
|
|
@@ -9243,7 +9244,7 @@ const Hf = ["scale", "position"], Gf = ["map", "alphaTest"], jf = ["scale", "pos
|
|
|
9243
9244
|
Ke().onBeforeRender(({ delta: M }) => {
|
|
9244
9245
|
for (!i.paused && !T && (w -= M * i.fps); w <= 0; )
|
|
9245
9246
|
w++, P++, i.loop ? (P >= p.length && r("loop", p[p.length - 1].name), P %= p.length) : P >= p.length && (T = !0, P = i.resetOnEnd ? 0 : p.length - 1, r("end", p[p.length - 1].name));
|
|
9246
|
-
p[P] !== y && (y = p[P], E = y.name, x()), b && (b = !1, f.offset.x = y.offsetX + (i.flipX ? y.repeatX : 0), f.offset.y = y.offsetY, f.repeat.x = y.repeatX * (i.flipX ? -1 : 1), f.repeat.y = y.repeatY, f.updateMatrix(),
|
|
9247
|
+
p[P] !== y && (y = p[P], E = y.name, x()), b && (b = !1, f.offset.x = y.offsetX + (i.flipX ? y.repeatX : 0), f.offset.y = y.offsetY, f.repeat.x = y.repeatX * (i.flipX ? -1 : 1), f.repeat.y = y.repeatY, f.updateMatrix(), h.value = y.width * Xs, u.value = y.height * Xs, l.value = (0.5 - v) * y.width * Xs, c.value = (0.5 - d) * y.height * Xs), E && (r("frame", E), E = null);
|
|
9247
9248
|
});
|
|
9248
9249
|
function x() {
|
|
9249
9250
|
b = !0;
|
|
@@ -9264,13 +9265,13 @@ const Hf = ["scale", "position"], Gf = ["map", "alphaTest"], jf = ["scale", "pos
|
|
|
9264
9265
|
Uf(g, i.definitions), p = _s(g, i.animation, i.reversed), w = 1, P = 0, x();
|
|
9265
9266
|
}, { immediate: !0 }), rt(() => {
|
|
9266
9267
|
f.dispose();
|
|
9267
|
-
}), (M, _) => (ce(),
|
|
9268
|
+
}), (M, _) => (ce(), de("TresGroup", je({
|
|
9268
9269
|
ref_key: "groupRef",
|
|
9269
9270
|
ref: m
|
|
9270
9271
|
}, M.$attrs), [
|
|
9271
|
-
i.asSprite ? (ce(),
|
|
9272
|
+
i.asSprite ? (ce(), de("TresSprite", {
|
|
9272
9273
|
key: 0,
|
|
9273
|
-
scale: [
|
|
9274
|
+
scale: [h.value, u.value, 1],
|
|
9274
9275
|
position: [l.value, c.value, 0]
|
|
9275
9276
|
}, [
|
|
9276
9277
|
_e("TresSpriteMaterial", {
|
|
@@ -9279,9 +9280,9 @@ const Hf = ["scale", "position"], Gf = ["map", "alphaTest"], jf = ["scale", "pos
|
|
|
9279
9280
|
transparent: !0,
|
|
9280
9281
|
alphaTest: i.alphaTest
|
|
9281
9282
|
}, null, 8, Gf)
|
|
9282
|
-
], 8, Hf)) : (ce(),
|
|
9283
|
+
], 8, Hf)) : (ce(), de("TresMesh", {
|
|
9283
9284
|
key: 1,
|
|
9284
|
-
scale: [
|
|
9285
|
+
scale: [h.value, u.value, 1],
|
|
9285
9286
|
position: [l.value, c.value, 0]
|
|
9286
9287
|
}, [
|
|
9287
9288
|
Vf,
|
|
@@ -9308,14 +9309,14 @@ class Xf extends Le {
|
|
|
9308
9309
|
}
|
|
9309
9310
|
update() {
|
|
9310
9311
|
const e = this.audio, t = this.range, n = this.divisionsInnerAngle, s = this.divisionsOuterAngle, i = Ze.degToRad(e.panner.coneInnerAngle), r = Ze.degToRad(e.panner.coneOuterAngle), a = i / 2, l = r / 2;
|
|
9311
|
-
let c = 0,
|
|
9312
|
+
let c = 0, h = 0, u, m;
|
|
9312
9313
|
const f = this.geometry, g = f.attributes.position;
|
|
9313
9314
|
f.clearGroups();
|
|
9314
9315
|
function p(v, d, w, y) {
|
|
9315
9316
|
const E = (d - v) / w;
|
|
9316
|
-
for (g.setXYZ(c, 0, 0, 0),
|
|
9317
|
-
m = c +
|
|
9318
|
-
f.addGroup(c,
|
|
9317
|
+
for (g.setXYZ(c, 0, 0, 0), h++, u = v; u < d; u += E)
|
|
9318
|
+
m = c + h, g.setXYZ(m, Math.sin(u) * t, 0, Math.cos(u) * t), g.setXYZ(m + 1, Math.sin(Math.min(u + E, d)) * t, 0, Math.cos(Math.min(u + E, d)) * t), g.setXYZ(m + 2, 0, 0, 0), h += 3;
|
|
9319
|
+
f.addGroup(c, h, y), c += h, h = 0;
|
|
9319
9320
|
}
|
|
9320
9321
|
p(-l, -a, s, 0), p(-a, a, n, 1), p(a, l, s, 0), g.needsUpdate = !0, i === r && (this.material[0].visible = !1);
|
|
9321
9322
|
}
|
|
@@ -9339,7 +9340,7 @@ const Wf = ["args"], kg = /* @__PURE__ */ me({
|
|
|
9339
9340
|
emits: ["isPlaying"],
|
|
9340
9341
|
async setup(o, { expose: e, emit: t }) {
|
|
9341
9342
|
let n, s;
|
|
9342
|
-
const i = o, r = t, { ready: a, url: l, distance: c, helper:
|
|
9343
|
+
const i = o, r = t, { ready: a, url: l, distance: c, helper: h, loop: u, autoplay: m, innerAngle: f, outerAngle: g, outerGain: p } = De(i), { camera: v } = ye(), d = ve(null), w = ve(null), y = ve(null), E = Sa(new Ta()), P = () => {
|
|
9343
9344
|
var B, N, j;
|
|
9344
9345
|
(B = d == null ? void 0 : d.value) != null && B.isPlaying || ((N = d == null ? void 0 : d.value) == null || N.play(), r("isPlaying", (j = d == null ? void 0 : d.value) == null ? void 0 : j.isPlaying));
|
|
9345
9346
|
}, T = () => {
|
|
@@ -9359,7 +9360,7 @@ const Wf = ["args"], kg = /* @__PURE__ */ me({
|
|
|
9359
9360
|
!(d != null && d.value) || !(w != null && w.value) || ((B = w == null ? void 0 : w.value) == null || B.dispose(), (N = d == null ? void 0 : d.value) == null || N.remove(w == null ? void 0 : w.value));
|
|
9360
9361
|
}, _ = () => {
|
|
9361
9362
|
var B;
|
|
9362
|
-
if (d.value && (d.value.setBuffer(y.value), d.value.setRefDistance(c.value), d.value.setLoop(
|
|
9363
|
+
if (d.value && (d.value.setBuffer(y.value), d.value.setRefDistance(c.value), d.value.setLoop(u.value), d.value.setDirectionalCone(f.value, g.value, p.value), (B = w == null ? void 0 : w.value) == null || B.update(), w != null && w.value)) {
|
|
9363
9364
|
const N = w.value.material[0];
|
|
9364
9365
|
!N.visible && g.value !== f.value && (N.visible = !0);
|
|
9365
9366
|
}
|
|
@@ -9379,19 +9380,19 @@ const Wf = ["args"], kg = /* @__PURE__ */ me({
|
|
|
9379
9380
|
pause: T,
|
|
9380
9381
|
dispose: R
|
|
9381
9382
|
}), y.value = ([n, s] = An(() => Un(ba, l.value)), n = await n, s(), n), ee(d, () => {
|
|
9382
|
-
d != null && d.value && (
|
|
9383
|
-
}), ee(
|
|
9384
|
-
|
|
9383
|
+
d != null && d.value && (h.value && C(), a.value && m && P());
|
|
9384
|
+
}), ee(h, () => {
|
|
9385
|
+
h.value ? C() : M();
|
|
9385
9386
|
}), ee(a, () => {
|
|
9386
9387
|
a.value && _(), m.value && a.value && P(), !m.value && a.value && b();
|
|
9387
|
-
}), ee([c,
|
|
9388
|
+
}), ee([c, u, y, f, g, p, m], () => {
|
|
9388
9389
|
_();
|
|
9389
9390
|
}), zn(() => {
|
|
9390
9391
|
var B;
|
|
9391
9392
|
(B = v == null ? void 0 : v.value) == null || B.add(E);
|
|
9392
9393
|
}), Pr(() => {
|
|
9393
9394
|
R();
|
|
9394
|
-
}), (B, N) => (ce(),
|
|
9395
|
+
}), (B, N) => (ce(), de("TresPositionalAudio", je({
|
|
9395
9396
|
ref_key: "positionalAudioRef",
|
|
9396
9397
|
ref: d,
|
|
9397
9398
|
args: [U(E)]
|
|
@@ -9422,13 +9423,13 @@ async function Zf(o, e) {
|
|
|
9422
9423
|
ee(o, () => {
|
|
9423
9424
|
n();
|
|
9424
9425
|
});
|
|
9425
|
-
const c =
|
|
9426
|
+
const c = fe(), h = Fe(() => Array.isArray(r.value)), u = Fe(() => h.value ? Zl : vo), m = fe(null);
|
|
9426
9427
|
return ee(() => [r, a], async ([f, g]) => {
|
|
9427
9428
|
if (f.value.length > 0 && !s.value) {
|
|
9428
9429
|
try {
|
|
9429
9430
|
m.value = await Un(
|
|
9430
|
-
U(
|
|
9431
|
-
|
|
9431
|
+
U(u),
|
|
9432
|
+
h.value ? [U(f)] : U(f),
|
|
9432
9433
|
(p) => {
|
|
9433
9434
|
g.value && p.setPath(U(g));
|
|
9434
9435
|
}
|
|
@@ -9436,7 +9437,7 @@ async function Zf(o, e) {
|
|
|
9436
9437
|
} catch (p) {
|
|
9437
9438
|
throw new Error(`Failed to load environment map: ${p}`);
|
|
9438
9439
|
}
|
|
9439
|
-
m.value && (c.value =
|
|
9440
|
+
m.value && (c.value = h.value ? m.value[0] : m.value, c.value.mapping = h.value ? Kl : cr);
|
|
9440
9441
|
}
|
|
9441
9442
|
}, {
|
|
9442
9443
|
immediate: !0
|
|
@@ -9499,7 +9500,7 @@ const Qf = ["object"], Bg = /* @__PURE__ */ me({
|
|
|
9499
9500
|
},
|
|
9500
9501
|
async setup(o, { expose: e }) {
|
|
9501
9502
|
let t, n;
|
|
9502
|
-
const s = o, i =
|
|
9503
|
+
const s = o, i = fe();
|
|
9503
9504
|
e({
|
|
9504
9505
|
instance: i
|
|
9505
9506
|
});
|
|
@@ -9509,7 +9510,7 @@ const Qf = ["object"], Bg = /* @__PURE__ */ me({
|
|
|
9509
9510
|
})), t = await t, n(), t);
|
|
9510
9511
|
return (s.castShadow || s.receiveShadow) && r.traverse((a) => {
|
|
9511
9512
|
a.isMesh && (a.castShadow = s.castShadow, a.receiveShadow = s.receiveShadow);
|
|
9512
|
-
}), (a, l) => (ce(),
|
|
9513
|
+
}), (a, l) => (ce(), de("primitive", je({
|
|
9513
9514
|
ref_key: "modelRef",
|
|
9514
9515
|
ref: i,
|
|
9515
9516
|
object: U(r)
|
|
@@ -9528,14 +9529,14 @@ const ed = ["object"], Ng = /* @__PURE__ */ me({
|
|
|
9528
9529
|
},
|
|
9529
9530
|
async setup(o, { expose: e }) {
|
|
9530
9531
|
let t, n;
|
|
9531
|
-
const s = o, i =
|
|
9532
|
+
const s = o, i = fe();
|
|
9532
9533
|
e({
|
|
9533
9534
|
instance: i
|
|
9534
9535
|
});
|
|
9535
9536
|
const r = ([t, n] = An(() => Jf(s.path)), t = await t, n(), t);
|
|
9536
9537
|
return (s.castShadow || s.receiveShadow) && r.traverse((a) => {
|
|
9537
9538
|
a.isMesh && (a.castShadow = s.castShadow, a.receiveShadow = s.receiveShadow);
|
|
9538
|
-
}), (a, l) => (ce(),
|
|
9539
|
+
}), (a, l) => (ce(), de("primitive", je({
|
|
9539
9540
|
ref_key: "modelRef",
|
|
9540
9541
|
ref: i,
|
|
9541
9542
|
object: U(r)
|
|
@@ -9554,8 +9555,8 @@ const ed = ["object"], Ng = /* @__PURE__ */ me({
|
|
|
9554
9555
|
depth: { default: "renderOrder" }
|
|
9555
9556
|
},
|
|
9556
9557
|
setup(o, { expose: e }) {
|
|
9557
|
-
const t = o, { src: n, skipStrokes: s, skipFills: i, fillMaterial: r, strokeMaterial: a, fillMeshProps: l, strokeMeshProps: c, depth:
|
|
9558
|
-
e({ instance:
|
|
9558
|
+
const t = o, { src: n, skipStrokes: s, skipFills: i, fillMaterial: r, strokeMaterial: a, fillMeshProps: l, strokeMeshProps: c, depth: h } = De(t), u = ve(), m = ve([]), f = ve([]);
|
|
9559
|
+
e({ instance: u }), Pt(async () => g(n.value).then((d) => f.value = d.paths)), ee([i, s, r, a, f], v);
|
|
9559
9560
|
async function g(d) {
|
|
9560
9561
|
const w = d.startsWith("<svg") ? encodeURI(`data:image/svg+xml;utf8,${d}`) : d;
|
|
9561
9562
|
return Un(ws, w);
|
|
@@ -9568,7 +9569,7 @@ const ed = ["object"], Ng = /* @__PURE__ */ me({
|
|
|
9568
9569
|
var P, T, b;
|
|
9569
9570
|
p();
|
|
9570
9571
|
const d = [], [w, y] = (() => {
|
|
9571
|
-
const x = { flat: !1, renderOrder: !1, offsetZ: !0 }, M = { flat: 0, renderOrder: 0, offsetZ: 0.025 }, _ =
|
|
9572
|
+
const x = { flat: !1, renderOrder: !1, offsetZ: !0 }, M = { flat: 0, renderOrder: 0, offsetZ: 0.025 }, _ = h.value;
|
|
9572
9573
|
return typeof _ == "number" ? [!0, _] : [x[_], M[_]];
|
|
9573
9574
|
})();
|
|
9574
9575
|
let E = 0;
|
|
@@ -9609,16 +9610,16 @@ const ed = ["object"], Ng = /* @__PURE__ */ me({
|
|
|
9609
9610
|
}
|
|
9610
9611
|
m.value = d;
|
|
9611
9612
|
}
|
|
9612
|
-
return (d, w) => (ce(),
|
|
9613
|
+
return (d, w) => (ce(), de("TresGroup", {
|
|
9613
9614
|
ref_key: "svgRef",
|
|
9614
|
-
ref:
|
|
9615
|
+
ref: u
|
|
9615
9616
|
}, [
|
|
9616
|
-
(ce(!0),
|
|
9617
|
+
(ce(!0), de(Pa, null, Ca(m.value, ({ geometry: y, material: E, isStroke: P }, T) => (ce(), de("TresMesh", je({
|
|
9617
9618
|
key: `${T}`,
|
|
9618
9619
|
ref_for: !0
|
|
9619
9620
|
}, P ? U(c) : U(l), {
|
|
9620
9621
|
geometry: y,
|
|
9621
|
-
"render-order": U(
|
|
9622
|
+
"render-order": U(h) === "renderOrder" ? T : 0
|
|
9622
9623
|
}), [
|
|
9623
9624
|
_e("TresMeshBasicMaterial", je({ ref_for: !0 }, E), null, 16)
|
|
9624
9625
|
], 16, td))), 128))
|
|
@@ -9642,7 +9643,7 @@ function rl() {
|
|
|
9642
9643
|
}
|
|
9643
9644
|
let Bi = 0;
|
|
9644
9645
|
function zg() {
|
|
9645
|
-
const o =
|
|
9646
|
+
const o = fe(!1), e = fe(0), t = fe([]), { logError: n } = rl();
|
|
9646
9647
|
return new Promise((s) => {
|
|
9647
9648
|
Us.onStart = () => {
|
|
9648
9649
|
o.value = !1;
|
|
@@ -9673,7 +9674,7 @@ async function Hg(o, e) {
|
|
|
9673
9674
|
...e
|
|
9674
9675
|
};
|
|
9675
9676
|
function c() {
|
|
9676
|
-
return new Promise((
|
|
9677
|
+
return new Promise((h, u) => {
|
|
9677
9678
|
const m = Object.assign(document.createElement("video"), {
|
|
9678
9679
|
src: typeof o == "string" && o || void 0,
|
|
9679
9680
|
crossOrigin: i,
|
|
@@ -9682,12 +9683,12 @@ async function Hg(o, e) {
|
|
|
9682
9683
|
autoplay: !0,
|
|
9683
9684
|
...l
|
|
9684
9685
|
}), f = new Ql(m);
|
|
9685
|
-
return m.addEventListener(n, () =>
|
|
9686
|
+
return m.addEventListener(n, () => h(f)), m.addEventListener("error", () => u(new Error("Error loading video"))), f;
|
|
9686
9687
|
});
|
|
9687
9688
|
}
|
|
9688
9689
|
try {
|
|
9689
|
-
const
|
|
9690
|
-
return s &&
|
|
9690
|
+
const h = await c();
|
|
9691
|
+
return s && h.image && h.image.play(), h;
|
|
9691
9692
|
} catch {
|
|
9692
9693
|
t("Error loading resource");
|
|
9693
9694
|
}
|
|
@@ -9728,8 +9729,8 @@ const nd = ["target", "auto-rotate", "auto-rotate-speed", "enable-damping", "dam
|
|
|
9728
9729
|
autoRotateSpeed: a,
|
|
9729
9730
|
enableDamping: l,
|
|
9730
9731
|
dampingFactor: c,
|
|
9731
|
-
enablePan:
|
|
9732
|
-
keyPanSpeed:
|
|
9732
|
+
enablePan: h,
|
|
9733
|
+
keyPanSpeed: u,
|
|
9733
9734
|
maxAzimuthAngle: m,
|
|
9734
9735
|
minAzimuthAngle: f,
|
|
9735
9736
|
maxPolarAngle: g,
|
|
@@ -9744,7 +9745,7 @@ const nd = ["target", "auto-rotate", "auto-rotate-speed", "enable-damping", "dam
|
|
|
9744
9745
|
touches: b,
|
|
9745
9746
|
rotateSpeed: x,
|
|
9746
9747
|
target: M
|
|
9747
|
-
} = De(n), { camera: _, renderer: C, extend: R, controls: B, invalidate: N } = ye(), j =
|
|
9748
|
+
} = De(n), { camera: _, renderer: C, extend: R, controls: B, invalidate: N } = ye(), j = fe(null);
|
|
9748
9749
|
R({ OrbitControls: Ga }), ee(j, (Z) => {
|
|
9749
9750
|
V(), Z && i.value ? B.value = Z : B.value = null;
|
|
9750
9751
|
});
|
|
@@ -9758,7 +9759,7 @@ const nd = ["target", "auto-rotate", "auto-rotate-speed", "enable-damping", "dam
|
|
|
9758
9759
|
j.value && (l.value || r.value) && (j.value.update(), r.value && Z());
|
|
9759
9760
|
}), rt(() => {
|
|
9760
9761
|
j.value && j.value.dispose();
|
|
9761
|
-
}), e({ instance: j }), (Z, ne) => (Z.camera || U(_)) && (Z.domElement || U(C)) ? (ce(),
|
|
9762
|
+
}), e({ instance: j }), (Z, ne) => (Z.camera || U(_)) && (Z.domElement || U(C)) ? (ce(), de("TresOrbitControls", {
|
|
9762
9763
|
key: 0,
|
|
9763
9764
|
ref_key: "controlsRef",
|
|
9764
9765
|
ref: j,
|
|
@@ -9767,8 +9768,8 @@ const nd = ["target", "auto-rotate", "auto-rotate-speed", "enable-damping", "dam
|
|
|
9767
9768
|
"auto-rotate-speed": U(a),
|
|
9768
9769
|
"enable-damping": U(l),
|
|
9769
9770
|
"damping-factor": U(c),
|
|
9770
|
-
"enable-pan": U(
|
|
9771
|
-
"key-pan-speed": U(
|
|
9771
|
+
"enable-pan": U(h),
|
|
9772
|
+
"key-pan-speed": U(u),
|
|
9772
9773
|
keys: Z.keys,
|
|
9773
9774
|
"max-azimuth-angle": U(m),
|
|
9774
9775
|
"min-azimuth-angle": U(f),
|
|
@@ -9801,9 +9802,9 @@ const nd = ["target", "auto-rotate", "auto-rotate-speed", "enable-damping", "dam
|
|
|
9801
9802
|
ee(n, () => {
|
|
9802
9803
|
c();
|
|
9803
9804
|
});
|
|
9804
|
-
const
|
|
9805
|
+
const h = fe(0), u = fe(0), { w: m, s: f, a: g, d: p, Up: v, Down: d, Left: w, Right: y } = ef();
|
|
9805
9806
|
Pt(() => {
|
|
9806
|
-
g.value || w.value ?
|
|
9807
|
+
g.value || w.value ? h.value = -i.value : p.value || y.value ? h.value = i.value : h.value = 0, m.value || v.value ? u.value = i.value : f.value || d.value ? u.value = -i.value : u.value = 0;
|
|
9807
9808
|
}), e({
|
|
9808
9809
|
instance: a
|
|
9809
9810
|
});
|
|
@@ -9812,11 +9813,11 @@ const nd = ["target", "auto-rotate", "auto-rotate-speed", "enable-damping", "dam
|
|
|
9812
9813
|
if (!((j = r.value) != null && j.position) && !T)
|
|
9813
9814
|
return;
|
|
9814
9815
|
const B = r.value, N = C * 1e-3;
|
|
9815
|
-
B == null || B.translateZ(-R), x.set(b.x * N, b.y * N, b.z * N, 1).normalize(), B == null || B.quaternion.multiply(x), (
|
|
9816
|
+
B == null || B.translateZ(-R), x.set(b.x * N, b.y * N, b.z * N, 1).normalize(), B == null || B.quaternion.multiply(x), (h.value || u.value) && s("change", a.value);
|
|
9816
9817
|
}, { onBeforeRender: _ } = Ke();
|
|
9817
9818
|
return _(({ delta: C, invalidate: R }) => {
|
|
9818
9819
|
var B;
|
|
9819
|
-
a.value instanceof Ha && ((B = a.value) != null && B.isLocked) && (M(C,
|
|
9820
|
+
a.value instanceof Ha && ((B = a.value) != null && B.isLocked) && (M(C, u.value), a.value.moveRight(h.value), R());
|
|
9820
9821
|
}), (C, R) => (ce(), Cr(U(rd), {
|
|
9821
9822
|
selector: C.selector,
|
|
9822
9823
|
"make-default": C.makeDefault,
|
|
@@ -9845,7 +9846,7 @@ const nd = ["target", "auto-rotate", "auto-rotate-speed", "enable-damping", "dam
|
|
|
9845
9846
|
},
|
|
9846
9847
|
emits: ["dragging", "change", "mouseDown", "mouseUp", "objectChange"],
|
|
9847
9848
|
setup(o, { expose: e, emit: t }) {
|
|
9848
|
-
const n = o, s = t, { object: i, mode: r, enabled: a, axis: l, translationSnap: c, rotationSnap:
|
|
9849
|
+
const n = o, s = t, { object: i, mode: r, enabled: a, axis: l, translationSnap: c, rotationSnap: h, scaleSnap: u, space: m, size: f, showX: g, showY: p, showZ: v } = De(n), d = ve(), { controls: w, camera: y, renderer: E, extend: P, invalidate: T } = ye();
|
|
9849
9850
|
ee(n, () => {
|
|
9850
9851
|
T();
|
|
9851
9852
|
}), P({ TransformControls: hu });
|
|
@@ -9871,7 +9872,7 @@ const nd = ["target", "auto-rotate", "auto-rotate-speed", "enable-damping", "dam
|
|
|
9871
9872
|
instance: d
|
|
9872
9873
|
}), (B, N) => {
|
|
9873
9874
|
var j;
|
|
9874
|
-
return (B.camera || U(y)) && U(E) ? (ce(),
|
|
9875
|
+
return (B.camera || U(y)) && U(E) ? (ce(), de("TresTransformControls", {
|
|
9875
9876
|
ref_key: "controlsRef",
|
|
9876
9877
|
ref: d,
|
|
9877
9878
|
key: (j = B.camera || U(y)) == null ? void 0 : j.uuid,
|
|
@@ -9881,8 +9882,8 @@ const nd = ["target", "auto-rotate", "auto-rotate-speed", "enable-damping", "dam
|
|
|
9881
9882
|
enabled: U(a),
|
|
9882
9883
|
axis: U(l),
|
|
9883
9884
|
"translation-snap": U(c),
|
|
9884
|
-
"rotation-snap": U(
|
|
9885
|
-
"scale-snap": U(
|
|
9885
|
+
"rotation-snap": U(h),
|
|
9886
|
+
"scale-snap": U(u),
|
|
9886
9887
|
space: U(m),
|
|
9887
9888
|
size: U(f),
|
|
9888
9889
|
"show-x": U(g),
|
|
@@ -9906,28 +9907,28 @@ const nd = ["target", "auto-rotate", "auto-rotate-speed", "enable-damping", "dam
|
|
|
9906
9907
|
ee(n, () => {
|
|
9907
9908
|
c();
|
|
9908
9909
|
});
|
|
9909
|
-
const
|
|
9910
|
-
let
|
|
9910
|
+
const h = fe(null);
|
|
9911
|
+
let u;
|
|
9911
9912
|
a({ PointerLockControls: Ha });
|
|
9912
9913
|
const m = (f) => {
|
|
9913
9914
|
s("isLock", f);
|
|
9914
9915
|
};
|
|
9915
|
-
return ee(
|
|
9916
|
-
f && n.makeDefault ? l.value = f : l.value = null,
|
|
9916
|
+
return ee(h, (f) => {
|
|
9917
|
+
f && n.makeDefault ? l.value = f : l.value = null, u = document.getElementById(n.selector || "") || r.value.domElement, He(l.value, "change", () => {
|
|
9917
9918
|
s("change", l.value), c();
|
|
9918
|
-
}), He(
|
|
9919
|
+
}), He(u, "click", () => {
|
|
9919
9920
|
var p, v, d;
|
|
9920
9921
|
(p = l.value) == null || p.lock(), (v = l.value) == null || v.addEventListener("lock", () => m(!0)), (d = l.value) == null || d.addEventListener("unlock", () => m(!1)), c();
|
|
9921
9922
|
});
|
|
9922
9923
|
}), rt(() => {
|
|
9923
9924
|
var f, g;
|
|
9924
|
-
(f = l.value) == null || f.removeEventListener("lock", () => m(!0)), (g = l.value) == null || g.removeEventListener("unlock", () => m(!1)),
|
|
9925
|
+
(f = l.value) == null || f.removeEventListener("lock", () => m(!0)), (g = l.value) == null || g.removeEventListener("unlock", () => m(!1)), h.value && h.value.dispose();
|
|
9925
9926
|
}), e({
|
|
9926
9927
|
instance: l
|
|
9927
|
-
}), (f, g) => (f.camera || U(i)) && (f.domElement || U(r)) ? (ce(),
|
|
9928
|
+
}), (f, g) => (f.camera || U(i)) && (f.domElement || U(r)) ? (ce(), de("TresPointerLockControls", {
|
|
9928
9929
|
key: 0,
|
|
9929
9930
|
ref_key: "controlsRef",
|
|
9930
|
-
ref:
|
|
9931
|
+
ref: h,
|
|
9931
9932
|
args: [f.camera || U(i), f.domElement || U(r).domElement]
|
|
9932
9933
|
}, null, 8, id)) : sn("", !0);
|
|
9933
9934
|
}
|
|
@@ -9968,8 +9969,8 @@ const nd = ["target", "auto-rotate", "auto-rotate-speed", "enable-damping", "dam
|
|
|
9968
9969
|
dampingFactor: a,
|
|
9969
9970
|
enablePan: l,
|
|
9970
9971
|
keyPanSpeed: c,
|
|
9971
|
-
maxAzimuthAngle:
|
|
9972
|
-
minAzimuthAngle:
|
|
9972
|
+
maxAzimuthAngle: h,
|
|
9973
|
+
minAzimuthAngle: u,
|
|
9973
9974
|
maxPolarAngle: m,
|
|
9974
9975
|
minPolarAngle: f,
|
|
9975
9976
|
minDistance: g,
|
|
@@ -9984,7 +9985,7 @@ const nd = ["target", "auto-rotate", "auto-rotate-speed", "enable-damping", "dam
|
|
|
9984
9985
|
ee(n, () => {
|
|
9985
9986
|
_();
|
|
9986
9987
|
});
|
|
9987
|
-
const C =
|
|
9988
|
+
const C = fe(null);
|
|
9988
9989
|
x({ MapControls: Tu }), ee(M, (B) => {
|
|
9989
9990
|
B && n.makeDefault ? M.value = B : M.value = null;
|
|
9990
9991
|
});
|
|
@@ -9995,7 +9996,7 @@ const nd = ["target", "auto-rotate", "auto-rotate-speed", "enable-damping", "dam
|
|
|
9995
9996
|
C.value && C.value.dispose();
|
|
9996
9997
|
}), e({
|
|
9997
9998
|
instance: C
|
|
9998
|
-
}), (B, N) => (B.camera || U(T)) && (B.domElement || U(b)) ? (ce(),
|
|
9999
|
+
}), (B, N) => (B.camera || U(T)) && (B.domElement || U(b)) ? (ce(), de("TresMapControls", {
|
|
9999
10000
|
key: 0,
|
|
10000
10001
|
ref_key: "controlsRef",
|
|
10001
10002
|
ref: C,
|
|
@@ -10007,8 +10008,8 @@ const nd = ["target", "auto-rotate", "auto-rotate-speed", "enable-damping", "dam
|
|
|
10007
10008
|
"enable-pan": U(l),
|
|
10008
10009
|
"key-pan-speed": U(c),
|
|
10009
10010
|
keys: B.keys,
|
|
10010
|
-
"max-azimuth-angle": U(
|
|
10011
|
-
"min-azimuth-angle": U(
|
|
10011
|
+
"max-azimuth-angle": U(h),
|
|
10012
|
+
"min-azimuth-angle": U(u),
|
|
10012
10013
|
"max-polar-angle": U(m),
|
|
10013
10014
|
"min-polar-angle": U(f),
|
|
10014
10015
|
"min-distance": U(g),
|
|
@@ -10038,9 +10039,9 @@ const nd = ["target", "auto-rotate", "auto-rotate-speed", "enable-damping", "dam
|
|
|
10038
10039
|
ee(n, () => {
|
|
10039
10040
|
c();
|
|
10040
10041
|
});
|
|
10041
|
-
const
|
|
10042
|
+
const h = ve(), u = document.createElement("div"), { y: m } = sf(), { x: f, y: g, isScrolling: p } = Qh(u), { height: v, width: d } = Qa();
|
|
10042
10043
|
let w = 0;
|
|
10043
|
-
const y =
|
|
10044
|
+
const y = fe(!1), E = fe(0), P = fe(0), T = fe(0), b = n.horizontal ? "x" : "y", x = ee(
|
|
10044
10045
|
r,
|
|
10045
10046
|
(_) => {
|
|
10046
10047
|
if (y.value) {
|
|
@@ -10076,7 +10077,7 @@ const nd = ["target", "auto-rotate", "auto-rotate-speed", "enable-damping", "dam
|
|
|
10076
10077
|
C != null && C.style.width && (C != null && C.style.position) && (C != null && C.style.top) && (C != null && C.style.left) && (C.style.width = "100%", C.style.position = "fixed", C.style.zIndex = " -99999", C.style.top = "0", C.style.left = "0"), T.value = document.body.scrollHeight;
|
|
10077
10078
|
else {
|
|
10078
10079
|
const N = document.createElement("div"), j = document.createElement("div");
|
|
10079
|
-
|
|
10080
|
+
u.style[n.horizontal ? "overflowX" : "overflowY"] = "auto", u.style[n.horizontal ? "overflowY" : "overflowX"] = "hidden", u.style.position = "absolute", u.style.width = "100%", u.style.height = " 100%", u.style.top = "0", u.style.left = "0", u.classList.add("scrollContainer"), N.style.position = "sticky", N.style.top = "0px", N.style.left = "0px", N.style.width = "100%", N.style.height = "100%", N.style.overflow = "hidden", u.appendChild(N), j.style.height = n.horizontal ? "100%" : `${v.value * n.pages}px`, j.style.width = n.horizontal ? `${d.value * n.pages}px` : "100vw", j.style.pointerEvents = "none", C.style.position = "fixed", C.style.zIndex = "0", C != null && C.style.width && (C.style.width = "100%"), u.appendChild(j), _.domElement.parentNode.style.position = "relative", (B = (R = _ == null ? void 0 : _.domElement) == null ? void 0 : R.parentNode) == null || B.appendChild(u), T.value = n.horizontal ? d.value * n.pages : v.value * n.pages;
|
|
10080
10081
|
}
|
|
10081
10082
|
},
|
|
10082
10083
|
{
|
|
@@ -10088,13 +10089,13 @@ const nd = ["target", "auto-rotate", "auto-rotate-speed", "enable-damping", "dam
|
|
|
10088
10089
|
var C;
|
|
10089
10090
|
if ((C = r.value) != null && C.position) {
|
|
10090
10091
|
const R = (E.value * n.distance - r.value.position[b] + w) * n.smoothScroll;
|
|
10091
|
-
r.value.position[b] += R,
|
|
10092
|
+
r.value.position[b] += R, h.value.children.length > 0 && (h.value.position[b] += R), _();
|
|
10092
10093
|
}
|
|
10093
10094
|
}), e({
|
|
10094
|
-
instance:
|
|
10095
|
-
}), (_, C) => (ce(),
|
|
10095
|
+
instance: h
|
|
10096
|
+
}), (_, C) => (ce(), de("TresGroup", {
|
|
10096
10097
|
ref_key: "wrapperRef",
|
|
10097
|
-
ref:
|
|
10098
|
+
ref: h
|
|
10098
10099
|
}, [
|
|
10099
10100
|
Ve(_.$slots, "default")
|
|
10100
10101
|
], 512));
|
|
@@ -10162,25 +10163,25 @@ function $s(o, e, t, n, s = 1 / 0, i) {
|
|
|
10162
10163
|
n = Math.max(1e-4, n);
|
|
10163
10164
|
const r = 2 / n, a = r * i, l = 1 / (1 + a + 0.48 * a * a + 0.235 * a * a * a);
|
|
10164
10165
|
let c = o - e;
|
|
10165
|
-
const
|
|
10166
|
-
c = Dt(c, -
|
|
10166
|
+
const h = e, u = s * n;
|
|
10167
|
+
c = Dt(c, -u, u), e = o - c;
|
|
10167
10168
|
const m = (t.value + r * c) * i;
|
|
10168
10169
|
t.value = (t.value - r * m) * l;
|
|
10169
10170
|
let f = e + (c + m) * l;
|
|
10170
|
-
return
|
|
10171
|
+
return h - o > 0 == f > h && (f = h, t.value = (f - h) / i), f;
|
|
10171
10172
|
}
|
|
10172
10173
|
function Po(o, e, t, n, s = 1 / 0, i, r) {
|
|
10173
10174
|
n = Math.max(1e-4, n);
|
|
10174
10175
|
const a = 2 / n, l = a * i, c = 1 / (1 + l + 0.48 * l * l + 0.235 * l * l * l);
|
|
10175
|
-
let
|
|
10176
|
-
const v =
|
|
10176
|
+
let h = e.x, u = e.y, m = e.z, f = o.x - h, g = o.y - u, p = o.z - m;
|
|
10177
|
+
const v = h, d = u, w = m, y = s * n, E = y * y, P = f * f + g * g + p * p;
|
|
10177
10178
|
if (P > E) {
|
|
10178
10179
|
const j = Math.sqrt(P);
|
|
10179
10180
|
f = f / j * y, g = g / j * y, p = p / j * y;
|
|
10180
10181
|
}
|
|
10181
|
-
|
|
10182
|
+
h = o.x - f, u = o.y - g, m = o.z - p;
|
|
10182
10183
|
const T = (t.x + a * f) * i, b = (t.y + a * g) * i, x = (t.z + a * p) * i;
|
|
10183
|
-
t.x = (t.x - a * T) * c, t.y = (t.y - a * b) * c, t.z = (t.z - a * x) * c, r.x =
|
|
10184
|
+
t.x = (t.x - a * T) * c, t.y = (t.y - a * b) * c, t.z = (t.z - a * x) * c, r.x = h + (f + T) * c, r.y = u + (g + b) * c, r.z = m + (p + x) * c;
|
|
10184
10185
|
const M = v - o.x, _ = d - o.y, C = w - o.z, R = r.x - v, B = r.y - d, N = r.z - w;
|
|
10185
10186
|
return M * R + _ * B + C * N > 0 && (r.x = v, r.y = d, r.z = w, t.x = (r.x - v) / i, t.y = (r.y - d) / i, t.z = (r.z - w) / i), r;
|
|
10186
10187
|
}
|
|
@@ -10432,7 +10433,7 @@ class at extends ad {
|
|
|
10432
10433
|
}
|
|
10433
10434
|
};
|
|
10434
10435
|
let c = -1;
|
|
10435
|
-
const
|
|
10436
|
+
const h = (d) => {
|
|
10436
10437
|
if (!this._domElement || !this._enabled || this.mouseButtons.wheel === J.NONE)
|
|
10437
10438
|
return;
|
|
10438
10439
|
if (this._interactiveArea.left !== 0 || this._interactiveArea.top !== 0 || this._interactiveArea.width !== 1 || this._interactiveArea.height !== 1) {
|
|
@@ -10468,7 +10469,7 @@ class at extends ad {
|
|
|
10468
10469
|
}
|
|
10469
10470
|
}
|
|
10470
10471
|
this.dispatchEvent({ type: "control" });
|
|
10471
|
-
},
|
|
10472
|
+
}, u = (d) => {
|
|
10472
10473
|
if (!(!this._domElement || !this._enabled)) {
|
|
10473
10474
|
if (this.mouseButtons.right === at.ACTION.NONE) {
|
|
10474
10475
|
const w = d instanceof PointerEvent ? d.pointerId : 0, y = this._findPointerById(w);
|
|
@@ -10541,9 +10542,9 @@ class at extends ad {
|
|
|
10541
10542
|
this.unlockPointer();
|
|
10542
10543
|
};
|
|
10543
10544
|
this._addAllEventListeners = (d) => {
|
|
10544
|
-
this._domElement = d, this._domElement.style.touchAction = "none", this._domElement.style.userSelect = "none", this._domElement.style.webkitUserSelect = "none", this._domElement.addEventListener("pointerdown", r), this._domElement.addEventListener("pointercancel", l), this._domElement.addEventListener("wheel",
|
|
10545
|
+
this._domElement = d, this._domElement.style.touchAction = "none", this._domElement.style.userSelect = "none", this._domElement.style.webkitUserSelect = "none", this._domElement.addEventListener("pointerdown", r), this._domElement.addEventListener("pointercancel", l), this._domElement.addEventListener("wheel", h, { passive: !1 }), this._domElement.addEventListener("contextmenu", u);
|
|
10545
10546
|
}, this._removeAllEventListeners = () => {
|
|
10546
|
-
this._domElement && (this._domElement.style.touchAction = "", this._domElement.style.userSelect = "", this._domElement.style.webkitUserSelect = "", this._domElement.removeEventListener("pointerdown", r), this._domElement.removeEventListener("pointercancel", l), this._domElement.removeEventListener("wheel",
|
|
10547
|
+
this._domElement && (this._domElement.style.touchAction = "", this._domElement.style.userSelect = "", this._domElement.style.webkitUserSelect = "", this._domElement.removeEventListener("pointerdown", r), this._domElement.removeEventListener("pointercancel", l), this._domElement.removeEventListener("wheel", h, { passive: !1 }), this._domElement.removeEventListener("contextmenu", u), this._domElement.ownerDocument.removeEventListener("pointermove", a, { passive: !1 }), this._domElement.ownerDocument.removeEventListener("pointerup", l), this._domElement.ownerDocument.removeEventListener("pointerlockchange", p), this._domElement.ownerDocument.removeEventListener("pointerlockerror", v));
|
|
10547
10548
|
}, this.cancel = () => {
|
|
10548
10549
|
this._state !== J.NONE && (this._state = J.NONE, this._activePointers.length = 0, g());
|
|
10549
10550
|
}, t && this.connect(t), this.update(0);
|
|
@@ -10910,10 +10911,10 @@ class at extends ad {
|
|
|
10910
10911
|
fitToBox(e, t, { cover: n = !1, paddingLeft: s = 0, paddingRight: i = 0, paddingBottom: r = 0, paddingTop: a = 0 } = {}) {
|
|
10911
10912
|
const l = [], c = e.isBox3 ? $n.copy(e) : $n.setFromObject(e);
|
|
10912
10913
|
c.isEmpty() && (console.warn("camera-controls: fitTo() cannot be used with an empty box. Aborting"), Promise.resolve());
|
|
10913
|
-
const
|
|
10914
|
-
l.push(this.rotateTo(
|
|
10914
|
+
const h = Ao(this._sphericalEnd.theta, So), u = Ao(this._sphericalEnd.phi, So);
|
|
10915
|
+
l.push(this.rotateTo(h, u, t));
|
|
10915
10916
|
const m = Se.setFromSpherical(this._sphericalEnd).normalize(), f = Do.setFromUnitVectors(m, Hi), g = Ne(Math.abs(m.y), 1);
|
|
10916
|
-
g && f.multiply(ji.setFromAxisAngle(Ks,
|
|
10917
|
+
g && f.multiply(ji.setFromAxisAngle(Ks, h)), f.multiply(this._yAxisUpSpaceInverse);
|
|
10917
10918
|
const p = Oo.makeEmpty();
|
|
10918
10919
|
ke.copy(c.min).applyQuaternion(f), p.expandByPoint(ke), ke.copy(c.min).setX(c.max.x).applyQuaternion(f), p.expandByPoint(ke), ke.copy(c.min).setY(c.max.y).applyQuaternion(f), p.expandByPoint(ke), ke.copy(c.max).setZ(c.min.z).applyQuaternion(f), p.expandByPoint(ke), ke.copy(c.min).setZ(c.max.z).applyQuaternion(f), p.expandByPoint(ke), ke.copy(c.max).setY(c.min.y).applyQuaternion(f), p.expandByPoint(ke), ke.copy(c.max).setX(c.min.x).applyQuaternion(f), p.expandByPoint(ke), ke.copy(c.max).applyQuaternion(f), p.expandByPoint(ke), p.min.x -= s, p.min.y -= r, p.max.x += i, p.max.y += a, f.setFromUnitVectors(Hi, m), g && f.premultiply(ji.invert()), f.premultiply(this._yAxisUpSpace);
|
|
10919
10920
|
const v = p.getSize(Se), d = p.getCenter(ke).applyQuaternion(f);
|
|
@@ -10958,8 +10959,8 @@ class at extends ad {
|
|
|
10958
10959
|
this._isUserControllingRotate = !1, this._isUserControllingDolly = !1, this._isUserControllingTruck = !1, this._lastDollyDirection = Yn.NONE, this._changedDolly = 0;
|
|
10959
10960
|
const l = ke.set(s, i, r), c = Se.set(e, t, n);
|
|
10960
10961
|
this._targetEnd.copy(l), this._sphericalEnd.setFromVector3(c.sub(l).applyQuaternion(this._yAxisUpSpace)), this.normalizeRotations(), this._needsUpdate = !0, a || (this._target.copy(this._targetEnd), this._spherical.copy(this._sphericalEnd));
|
|
10961
|
-
const
|
|
10962
|
-
return this._createOnRestPromise(
|
|
10962
|
+
const h = !a || Ne(this._target.x, this._targetEnd.x, this.restThreshold) && Ne(this._target.y, this._targetEnd.y, this.restThreshold) && Ne(this._target.z, this._targetEnd.z, this.restThreshold) && Ne(this._spherical.theta, this._sphericalEnd.theta, this.restThreshold) && Ne(this._spherical.phi, this._sphericalEnd.phi, this.restThreshold) && Ne(this._spherical.radius, this._sphericalEnd.radius, this.restThreshold);
|
|
10963
|
+
return this._createOnRestPromise(h);
|
|
10963
10964
|
}
|
|
10964
10965
|
/**
|
|
10965
10966
|
* Similar to setLookAt, but it interpolates between two states.
|
|
@@ -10979,11 +10980,11 @@ class at extends ad {
|
|
|
10979
10980
|
* @param enableTransition
|
|
10980
10981
|
* @category Methods
|
|
10981
10982
|
*/
|
|
10982
|
-
lerpLookAt(e, t, n, s, i, r, a, l, c,
|
|
10983
|
+
lerpLookAt(e, t, n, s, i, r, a, l, c, h, u, m, f, g = !1) {
|
|
10983
10984
|
this._isUserControllingRotate = !1, this._isUserControllingDolly = !1, this._isUserControllingTruck = !1, this._lastDollyDirection = Yn.NONE, this._changedDolly = 0;
|
|
10984
10985
|
const p = Se.set(s, i, r), v = ke.set(e, t, n);
|
|
10985
10986
|
Tt.setFromVector3(v.sub(p).applyQuaternion(this._yAxisUpSpace));
|
|
10986
|
-
const d = Wn.set(
|
|
10987
|
+
const d = Wn.set(h, u, m), w = ke.set(a, l, c);
|
|
10987
10988
|
ms.setFromVector3(w.sub(d).applyQuaternion(this._yAxisUpSpace)), this._targetEnd.copy(p.lerp(d, f));
|
|
10988
10989
|
const y = ms.theta - Tt.theta, E = ms.phi - Tt.phi, P = ms.radius - Tt.radius;
|
|
10989
10990
|
this._sphericalEnd.set(Tt.radius + P * f, Tt.phi + E * f, Tt.theta + y * f), this.normalizeRotations(), this._needsUpdate = !0, g || (this._target.copy(this._targetEnd), this._spherical.copy(this._sphericalEnd));
|
|
@@ -11194,64 +11195,64 @@ class at extends ad {
|
|
|
11194
11195
|
if (Ge(t))
|
|
11195
11196
|
this._thetaVelocity.value = 0, this._spherical.theta = this._sphericalEnd.theta;
|
|
11196
11197
|
else {
|
|
11197
|
-
const
|
|
11198
|
-
this._spherical.theta = $s(this._spherical.theta, this._sphericalEnd.theta, this._thetaVelocity,
|
|
11198
|
+
const u = this._isUserControllingRotate ? this.draggingSmoothTime : this.smoothTime;
|
|
11199
|
+
this._spherical.theta = $s(this._spherical.theta, this._sphericalEnd.theta, this._thetaVelocity, u, 1 / 0, e), this._needsUpdate = !0;
|
|
11199
11200
|
}
|
|
11200
11201
|
if (Ge(n))
|
|
11201
11202
|
this._phiVelocity.value = 0, this._spherical.phi = this._sphericalEnd.phi;
|
|
11202
11203
|
else {
|
|
11203
|
-
const
|
|
11204
|
-
this._spherical.phi = $s(this._spherical.phi, this._sphericalEnd.phi, this._phiVelocity,
|
|
11204
|
+
const u = this._isUserControllingRotate ? this.draggingSmoothTime : this.smoothTime;
|
|
11205
|
+
this._spherical.phi = $s(this._spherical.phi, this._sphericalEnd.phi, this._phiVelocity, u, 1 / 0, e), this._needsUpdate = !0;
|
|
11205
11206
|
}
|
|
11206
11207
|
if (Ge(s))
|
|
11207
11208
|
this._radiusVelocity.value = 0, this._spherical.radius = this._sphericalEnd.radius;
|
|
11208
11209
|
else {
|
|
11209
|
-
const
|
|
11210
|
-
this._spherical.radius = $s(this._spherical.radius, this._sphericalEnd.radius, this._radiusVelocity,
|
|
11210
|
+
const u = this._isUserControllingDolly ? this.draggingSmoothTime : this.smoothTime;
|
|
11211
|
+
this._spherical.radius = $s(this._spherical.radius, this._sphericalEnd.radius, this._radiusVelocity, u, this.maxSpeed, e), this._needsUpdate = !0;
|
|
11211
11212
|
}
|
|
11212
11213
|
if (Ge(i.x) && Ge(i.y) && Ge(i.z))
|
|
11213
11214
|
this._targetVelocity.set(0, 0, 0), this._target.copy(this._targetEnd);
|
|
11214
11215
|
else {
|
|
11215
|
-
const
|
|
11216
|
-
Po(this._target, this._targetEnd, this._targetVelocity,
|
|
11216
|
+
const u = this._isUserControllingTruck ? this.draggingSmoothTime : this.smoothTime;
|
|
11217
|
+
Po(this._target, this._targetEnd, this._targetVelocity, u, this.maxSpeed, e, this._target), this._needsUpdate = !0;
|
|
11217
11218
|
}
|
|
11218
11219
|
if (Ge(r.x) && Ge(r.y) && Ge(r.z))
|
|
11219
11220
|
this._focalOffsetVelocity.set(0, 0, 0), this._focalOffset.copy(this._focalOffsetEnd);
|
|
11220
11221
|
else {
|
|
11221
|
-
const
|
|
11222
|
-
Po(this._focalOffset, this._focalOffsetEnd, this._focalOffsetVelocity,
|
|
11222
|
+
const u = this._isUserControllingOffset ? this.draggingSmoothTime : this.smoothTime;
|
|
11223
|
+
Po(this._focalOffset, this._focalOffsetEnd, this._focalOffsetVelocity, u, this.maxSpeed, e, this._focalOffset), this._needsUpdate = !0;
|
|
11223
11224
|
}
|
|
11224
11225
|
if (Ge(a))
|
|
11225
11226
|
this._zoomVelocity.value = 0, this._zoom = this._zoomEnd;
|
|
11226
11227
|
else {
|
|
11227
|
-
const
|
|
11228
|
-
this._zoom = $s(this._zoom, this._zoomEnd, this._zoomVelocity,
|
|
11228
|
+
const u = this._isUserControllingZoom ? this.draggingSmoothTime : this.smoothTime;
|
|
11229
|
+
this._zoom = $s(this._zoom, this._zoomEnd, this._zoomVelocity, u, 1 / 0, e);
|
|
11229
11230
|
}
|
|
11230
11231
|
if (this.dollyToCursor) {
|
|
11231
11232
|
if (On(this._camera) && this._changedDolly !== 0) {
|
|
11232
|
-
const
|
|
11233
|
+
const u = this._spherical.radius - this._lastDistance, m = this._camera, f = this._getCameraDirection(ps), g = Se.copy(f).cross(m.up).normalize();
|
|
11233
11234
|
g.lengthSq() === 0 && (g.x = 1);
|
|
11234
|
-
const p = ke.crossVectors(g, f), v = this._sphericalEnd.radius * Math.tan(m.getEffectiveFOV() * hs * 0.5), w = (this._sphericalEnd.radius -
|
|
11235
|
+
const p = ke.crossVectors(g, f), v = this._sphericalEnd.radius * Math.tan(m.getEffectiveFOV() * hs * 0.5), w = (this._sphericalEnd.radius - u - this._sphericalEnd.radius) / this._sphericalEnd.radius, y = Wn.copy(this._targetEnd).add(g.multiplyScalar(this._dollyControlCoord.x * v * m.aspect)).add(p.multiplyScalar(this._dollyControlCoord.y * v)), E = Se.copy(this._targetEnd).lerp(y, w), P = this._lastDollyDirection === Yn.IN && this._spherical.radius <= this.minDistance, T = this._lastDollyDirection === Yn.OUT && this.maxDistance <= this._spherical.radius;
|
|
11235
11236
|
if (this.infinityDolly && (P || T)) {
|
|
11236
|
-
this._sphericalEnd.radius -=
|
|
11237
|
-
const x = ke.copy(f).multiplyScalar(-
|
|
11237
|
+
this._sphericalEnd.radius -= u, this._spherical.radius -= u;
|
|
11238
|
+
const x = ke.copy(f).multiplyScalar(-u);
|
|
11238
11239
|
E.add(x);
|
|
11239
11240
|
}
|
|
11240
11241
|
this._boundary.clampPoint(E, E);
|
|
11241
11242
|
const b = ke.subVectors(E, this._targetEnd);
|
|
11242
|
-
this._targetEnd.copy(E), this._target.add(b), this._changedDolly -=
|
|
11243
|
+
this._targetEnd.copy(E), this._target.add(b), this._changedDolly -= u, Ge(this._changedDolly) && (this._changedDolly = 0);
|
|
11243
11244
|
} else if (gn(this._camera) && this._changedZoom !== 0) {
|
|
11244
|
-
const
|
|
11245
|
+
const u = this._zoom - this._lastZoom, m = this._camera, f = Se.set(this._dollyControlCoord.x, this._dollyControlCoord.y, (m.near + m.far) / (m.near - m.far)).unproject(m), g = ke.set(0, 0, -1).applyQuaternion(m.quaternion), p = Wn.copy(f).add(g.multiplyScalar(-f.dot(m.up))), d = -(this._zoom - u - this._zoom) / this._zoom, w = this._getCameraDirection(ps), y = this._targetEnd.dot(w), E = Se.copy(this._targetEnd).lerp(p, d), P = E.dot(w), T = w.multiplyScalar(P - y);
|
|
11245
11246
|
E.sub(T), this._boundary.clampPoint(E, E);
|
|
11246
11247
|
const b = ke.subVectors(E, this._targetEnd);
|
|
11247
|
-
this._targetEnd.copy(E), this._target.add(b), this._changedZoom -=
|
|
11248
|
+
this._targetEnd.copy(E), this._target.add(b), this._changedZoom -= u, Ge(this._changedZoom) && (this._changedZoom = 0);
|
|
11248
11249
|
}
|
|
11249
11250
|
}
|
|
11250
11251
|
this._camera.zoom !== this._zoom && (this._camera.zoom = this._zoom, this._camera.updateProjectionMatrix(), this._updateNearPlaneCorners(), this._needsUpdate = !0), this._dragNeedsUpdate = !0;
|
|
11251
11252
|
const l = this._collisionTest();
|
|
11252
11253
|
this._spherical.radius = Math.min(this._spherical.radius, l), this._spherical.makeSafe(), this._camera.position.setFromSpherical(this._spherical).applyQuaternion(this._yAxisUpSpaceInverse).add(this._target), this._camera.lookAt(this._target), (!Ge(this._focalOffset.x) || !Ge(this._focalOffset.y) || !Ge(this._focalOffset.z)) && (this._camera.updateMatrixWorld(), Ft.setFromMatrixColumn(this._camera.matrix, 0), kt.setFromMatrixColumn(this._camera.matrix, 1), Dn.setFromMatrixColumn(this._camera.matrix, 2), Ft.multiplyScalar(this._focalOffset.x), kt.multiplyScalar(-this._focalOffset.y), Dn.multiplyScalar(this._focalOffset.z), Se.copy(Ft).add(kt).add(Dn), this._camera.position.add(Se)), this._boundaryEnclosesCamera && this._encloseToBoundary(this._camera.position.copy(this._target), Se.setFromSpherical(this._spherical).applyQuaternion(this._yAxisUpSpaceInverse), 1);
|
|
11253
|
-
const
|
|
11254
|
-
return
|
|
11254
|
+
const h = this._needsUpdate;
|
|
11255
|
+
return h && !this._updatedLastTime ? (this._hasRested = !1, this.dispatchEvent({ type: "wake" }), this.dispatchEvent({ type: "update" })) : h ? (this.dispatchEvent({ type: "update" }), Ge(t, this.restThreshold) && Ge(n, this.restThreshold) && Ge(s, this.restThreshold) && Ge(i.x, this.restThreshold) && Ge(i.y, this.restThreshold) && Ge(i.z, this.restThreshold) && Ge(r.x, this.restThreshold) && Ge(r.y, this.restThreshold) && Ge(r.z, this.restThreshold) && Ge(a, this.restThreshold) && !this._hasRested && (this._hasRested = !0, this.dispatchEvent({ type: "rest" }))) : !h && this._updatedLastTime && this.dispatchEvent({ type: "sleep" }), this._lastDistance = this._spherical.radius, this._lastZoom = this._zoom, this._updatedLastTime = h, this._needsUpdate = !1, h;
|
|
11255
11256
|
}
|
|
11256
11257
|
/**
|
|
11257
11258
|
* Get all state in JSON string
|
|
@@ -11442,9 +11443,9 @@ class at extends ad {
|
|
|
11442
11443
|
return;
|
|
11443
11444
|
const a = r, l = a.geometry.clone();
|
|
11444
11445
|
l.applyMatrix4(a.matrixWorld);
|
|
11445
|
-
const
|
|
11446
|
-
for (let
|
|
11447
|
-
Se.fromBufferAttribute(
|
|
11446
|
+
const h = l.attributes.position;
|
|
11447
|
+
for (let u = 0, m = h.count; u < m; u++)
|
|
11448
|
+
Se.fromBufferAttribute(h, u), i = Math.max(i, s.distanceToSquared(Se));
|
|
11448
11449
|
}), n.radius = Math.sqrt(i), n;
|
|
11449
11450
|
}
|
|
11450
11451
|
}
|
|
@@ -11500,8 +11501,8 @@ const al = (o) => !!(o && o.isPerspectiveCamera), ll = (o) => !!(o && o.isOrthog
|
|
|
11500
11501
|
maxPolarAngle: a,
|
|
11501
11502
|
minAzimuthAngle: l,
|
|
11502
11503
|
maxAzimuthAngle: c,
|
|
11503
|
-
distance:
|
|
11504
|
-
minDistance:
|
|
11504
|
+
distance: h,
|
|
11505
|
+
minDistance: u,
|
|
11505
11506
|
maxDistance: m,
|
|
11506
11507
|
infinityDolly: f,
|
|
11507
11508
|
minZoom: g,
|
|
@@ -11545,7 +11546,7 @@ const al = (o) => !!(o && o.isPerspectiveCamera), ll = (o) => !!(o && o.isOrthog
|
|
|
11545
11546
|
)), le = Fe(() => Fo(
|
|
11546
11547
|
n.camera || j.value,
|
|
11547
11548
|
n.touches
|
|
11548
|
-
)), ae =
|
|
11549
|
+
)), ae = fe(null);
|
|
11549
11550
|
Q({ CameraControls: at }), Pt(() => {
|
|
11550
11551
|
Te(), ae.value && i.value ? Z.value = ae.value : Z.value = null;
|
|
11551
11552
|
});
|
|
@@ -11562,7 +11563,7 @@ const al = (o) => !!(o && o.isPerspectiveCamera), ll = (o) => !!(o && o.isOrthog
|
|
|
11562
11563
|
ae.value && ae.value.disconnect();
|
|
11563
11564
|
}), e({
|
|
11564
11565
|
instance: ae
|
|
11565
|
-
}), (k, D) => (k.camera || U(j)) && (k.domElement || U(V)) ? (ce(),
|
|
11566
|
+
}), (k, D) => (k.camera || U(j)) && (k.domElement || U(V)) ? (ce(), de("TresCameraControls", {
|
|
11566
11567
|
key: 0,
|
|
11567
11568
|
ref_key: "controlsRef",
|
|
11568
11569
|
ref: ae,
|
|
@@ -11570,8 +11571,8 @@ const al = (o) => !!(o && o.isPerspectiveCamera), ll = (o) => !!(o && o.isOrthog
|
|
|
11570
11571
|
"max-polar-angle": U(a),
|
|
11571
11572
|
"min-azimuth-angle": U(l),
|
|
11572
11573
|
"max-azimuth-angle": U(c),
|
|
11573
|
-
distance: U(
|
|
11574
|
-
"min-distance": U(
|
|
11574
|
+
distance: U(h),
|
|
11575
|
+
"min-distance": U(u),
|
|
11575
11576
|
"max-distance": U(m),
|
|
11576
11577
|
"infinity-dolly": U(f),
|
|
11577
11578
|
"min-zoom": U(g),
|
|
@@ -11643,7 +11644,7 @@ const fd = ["factor"], $g = /* @__PURE__ */ me({
|
|
|
11643
11644
|
const { onBeforeRender: r } = Ke();
|
|
11644
11645
|
return r(({ elapsed: a, invalidate: l }) => {
|
|
11645
11646
|
n.value && (n.value.time = a * (t == null ? void 0 : t.speed), l());
|
|
11646
|
-
}), e({ instance: n }), (a, l) => (ce(),
|
|
11647
|
+
}), e({ instance: n }), (a, l) => (ce(), de("TresMeshWobbleMaterial", je({
|
|
11647
11648
|
ref_key: "materialRef",
|
|
11648
11649
|
ref: n,
|
|
11649
11650
|
factor: a.factor
|
|
@@ -11872,8 +11873,8 @@ class Rs {
|
|
|
11872
11873
|
], e !== void 0 && this.set(e, t, n, s, i, r, a, l, c);
|
|
11873
11874
|
}
|
|
11874
11875
|
set(e, t, n, s, i, r, a, l, c) {
|
|
11875
|
-
const
|
|
11876
|
-
return
|
|
11876
|
+
const h = this.elements;
|
|
11877
|
+
return h[0] = e, h[1] = s, h[2] = a, h[3] = t, h[4] = i, h[5] = l, h[6] = n, h[7] = r, h[8] = c, this;
|
|
11877
11878
|
}
|
|
11878
11879
|
identity() {
|
|
11879
11880
|
return this.set(
|
|
@@ -11916,22 +11917,22 @@ class Rs {
|
|
|
11916
11917
|
return this.multiplyMatrices(e, this);
|
|
11917
11918
|
}
|
|
11918
11919
|
multiplyMatrices(e, t) {
|
|
11919
|
-
const n = e.elements, s = t.elements, i = this.elements, r = n[0], a = n[3], l = n[6], c = n[1],
|
|
11920
|
-
return i[0] = r * p + a * w + l * P, i[3] = r * v + a * y + l * T, i[6] = r * d + a * E + l * b, i[1] = c * p +
|
|
11920
|
+
const n = e.elements, s = t.elements, i = this.elements, r = n[0], a = n[3], l = n[6], c = n[1], h = n[4], u = n[7], m = n[2], f = n[5], g = n[8], p = s[0], v = s[3], d = s[6], w = s[1], y = s[4], E = s[7], P = s[2], T = s[5], b = s[8];
|
|
11921
|
+
return i[0] = r * p + a * w + l * P, i[3] = r * v + a * y + l * T, i[6] = r * d + a * E + l * b, i[1] = c * p + h * w + u * P, i[4] = c * v + h * y + u * T, i[7] = c * d + h * E + u * b, i[2] = m * p + f * w + g * P, i[5] = m * v + f * y + g * T, i[8] = m * d + f * E + g * b, this;
|
|
11921
11922
|
}
|
|
11922
11923
|
multiplyScalar(e) {
|
|
11923
11924
|
const t = this.elements;
|
|
11924
11925
|
return t[0] *= e, t[3] *= e, t[6] *= e, t[1] *= e, t[4] *= e, t[7] *= e, t[2] *= e, t[5] *= e, t[8] *= e, this;
|
|
11925
11926
|
}
|
|
11926
11927
|
determinant() {
|
|
11927
|
-
const e = this.elements, t = e[0], n = e[1], s = e[2], i = e[3], r = e[4], a = e[5], l = e[6], c = e[7],
|
|
11928
|
-
return t * r *
|
|
11928
|
+
const e = this.elements, t = e[0], n = e[1], s = e[2], i = e[3], r = e[4], a = e[5], l = e[6], c = e[7], h = e[8];
|
|
11929
|
+
return t * r * h - t * a * c - n * i * h + n * a * l + s * i * c - s * r * l;
|
|
11929
11930
|
}
|
|
11930
11931
|
invert() {
|
|
11931
|
-
const e = this.elements, t = e[0], n = e[1], s = e[2], i = e[3], r = e[4], a = e[5], l = e[6], c = e[7],
|
|
11932
|
+
const e = this.elements, t = e[0], n = e[1], s = e[2], i = e[3], r = e[4], a = e[5], l = e[6], c = e[7], h = e[8], u = h * r - a * c, m = a * l - h * i, f = c * i - r * l, g = t * u + n * m + s * f;
|
|
11932
11933
|
if (g === 0) return this.set(0, 0, 0, 0, 0, 0, 0, 0, 0);
|
|
11933
11934
|
const p = 1 / g;
|
|
11934
|
-
return e[0] =
|
|
11935
|
+
return e[0] = u * p, e[1] = (s * c - h * n) * p, e[2] = (a * n - s * r) * p, e[3] = m * p, e[4] = (h * t - s * l) * p, e[5] = (s * i - a * t) * p, e[6] = f * p, e[7] = (n * l - c * t) * p, e[8] = (r * t - n * i) * p, this;
|
|
11935
11936
|
}
|
|
11936
11937
|
transpose() {
|
|
11937
11938
|
let e;
|
|
@@ -12391,25 +12392,25 @@ class hi {
|
|
|
12391
12392
|
It.fromWorkingColorSpace(ot.copy(this), t);
|
|
12392
12393
|
const n = ot.r, s = ot.g, i = ot.b, r = Math.max(n, s, i), a = Math.min(n, s, i);
|
|
12393
12394
|
let l, c;
|
|
12394
|
-
const
|
|
12395
|
+
const h = (a + r) / 2;
|
|
12395
12396
|
if (a === r)
|
|
12396
12397
|
l = 0, c = 0;
|
|
12397
12398
|
else {
|
|
12398
|
-
const
|
|
12399
|
-
switch (c =
|
|
12399
|
+
const u = r - a;
|
|
12400
|
+
switch (c = h <= 0.5 ? u / (r + a) : u / (2 - r - a), r) {
|
|
12400
12401
|
case n:
|
|
12401
|
-
l = (s - i) /
|
|
12402
|
+
l = (s - i) / u + (s < i ? 6 : 0);
|
|
12402
12403
|
break;
|
|
12403
12404
|
case s:
|
|
12404
|
-
l = (i - n) /
|
|
12405
|
+
l = (i - n) / u + 2;
|
|
12405
12406
|
break;
|
|
12406
12407
|
case i:
|
|
12407
|
-
l = (n - s) /
|
|
12408
|
+
l = (n - s) / u + 4;
|
|
12408
12409
|
break;
|
|
12409
12410
|
}
|
|
12410
12411
|
l /= 6;
|
|
12411
12412
|
}
|
|
12412
|
-
return e.h = l, e.s = c, e.l =
|
|
12413
|
+
return e.h = l, e.s = c, e.l = h, e;
|
|
12413
12414
|
}
|
|
12414
12415
|
getRGB(e, t = It.workingColorSpace) {
|
|
12415
12416
|
return It.fromWorkingColorSpace(ot.copy(this), t), e.r = ot.r, e.g = ot.g, e.b = ot.b, e;
|
|
@@ -12535,7 +12536,7 @@ const Zg = /* @__PURE__ */ me({
|
|
|
12535
12536
|
__name: "index",
|
|
12536
12537
|
setup(o, { expose: e }) {
|
|
12537
12538
|
const t = ve(), { extend: n } = ye();
|
|
12538
|
-
return n({ MeshGlassMaterial: yd }), e({ instance: t }), (s, i) => (ce(),
|
|
12539
|
+
return n({ MeshGlassMaterial: yd }), e({ instance: t }), (s, i) => (ce(), de("TresMeshGlassMaterial", {
|
|
12539
12540
|
ref_key: "MeshGlassMaterialClass",
|
|
12540
12541
|
ref: t
|
|
12541
12542
|
}, null, 512));
|
|
@@ -12554,25 +12555,25 @@ var hl = { exports: {} };
|
|
|
12554
12555
|
o.exports = t();
|
|
12555
12556
|
})(function() {
|
|
12556
12557
|
return function t(n, s, i) {
|
|
12557
|
-
function r(c,
|
|
12558
|
+
function r(c, h) {
|
|
12558
12559
|
if (!s[c]) {
|
|
12559
12560
|
if (!n[c]) {
|
|
12560
|
-
var
|
|
12561
|
-
if (!
|
|
12561
|
+
var u = typeof ei == "function" && ei;
|
|
12562
|
+
if (!h && u) return u(c, !0);
|
|
12562
12563
|
if (a) return a(c, !0);
|
|
12563
12564
|
throw new Error("Cannot find module '" + c + "'");
|
|
12564
12565
|
}
|
|
12565
|
-
|
|
12566
|
+
h = s[c] = { exports: {} }, n[c][0].call(h.exports, function(m) {
|
|
12566
12567
|
var f = n[c][1][m];
|
|
12567
12568
|
return r(f || m);
|
|
12568
|
-
},
|
|
12569
|
+
}, h, h.exports, t, n, s, i);
|
|
12569
12570
|
}
|
|
12570
12571
|
return s[c].exports;
|
|
12571
12572
|
}
|
|
12572
12573
|
for (var a = typeof ei == "function" && ei, l = 0; l < i.length; l++) r(i[l]);
|
|
12573
12574
|
return r;
|
|
12574
12575
|
}({ 1: [function(t, n, s) {
|
|
12575
|
-
(function(i, r, a, l, c,
|
|
12576
|
+
(function(i, r, a, l, c, h, u, m, f) {
|
|
12576
12577
|
var g = t("crypto");
|
|
12577
12578
|
function p(T, b) {
|
|
12578
12579
|
b = w(T, b);
|
|
@@ -12742,7 +12743,7 @@ Use "options.replacer" or "options.ignoreUnknown"
|
|
|
12742
12743
|
};
|
|
12743
12744
|
}).call(this, t("lYpoI2"), typeof self < "u" ? self : typeof window < "u" ? window : {}, t("buffer").Buffer, arguments[3], arguments[4], arguments[5], arguments[6], "/fake_9a5aa49d.js", "/");
|
|
12744
12745
|
}, { buffer: 3, crypto: 5, lYpoI2: 11 }], 2: [function(t, n, s) {
|
|
12745
|
-
(function(i, r, a, l, c,
|
|
12746
|
+
(function(i, r, a, l, c, h, u, m, f) {
|
|
12746
12747
|
(function(g) {
|
|
12747
12748
|
var p = typeof Uint8Array < "u" ? Uint8Array : Array, v = 43, d = 47, w = 48, y = 97, E = 65, P = 45, T = 95;
|
|
12748
12749
|
function b(x) {
|
|
@@ -12775,7 +12776,7 @@ Use "options.replacer" or "options.ignoreUnknown"
|
|
|
12775
12776
|
})(s === void 0 ? this.base64js = {} : s);
|
|
12776
12777
|
}).call(this, t("lYpoI2"), typeof self < "u" ? self : typeof window < "u" ? window : {}, t("buffer").Buffer, arguments[3], arguments[4], arguments[5], arguments[6], "/node_modules/gulp-browserify/node_modules/base64-js/lib/b64.js", "/node_modules/gulp-browserify/node_modules/base64-js/lib");
|
|
12777
12778
|
}, { buffer: 3, lYpoI2: 11 }], 3: [function(t, n, s) {
|
|
12778
|
-
(function(i, r, v, l, c,
|
|
12779
|
+
(function(i, r, v, l, c, h, u, m, f) {
|
|
12779
12780
|
var g = t("base64-js"), p = t("ieee754");
|
|
12780
12781
|
function v(S, A, L) {
|
|
12781
12782
|
if (!(this instanceof v)) return new v(S, A, L);
|
|
@@ -13140,7 +13141,7 @@ list should be an Array.`), S.length === 0) return new v(0);
|
|
|
13140
13141
|
};
|
|
13141
13142
|
}).call(this, t("lYpoI2"), typeof self < "u" ? self : typeof window < "u" ? window : {}, t("buffer").Buffer, arguments[3], arguments[4], arguments[5], arguments[6], "/node_modules/gulp-browserify/node_modules/buffer/index.js", "/node_modules/gulp-browserify/node_modules/buffer");
|
|
13142
13143
|
}, { "base64-js": 2, buffer: 3, ieee754: 10, lYpoI2: 11 }], 4: [function(t, n, s) {
|
|
13143
|
-
(function(i, r, g, l, c,
|
|
13144
|
+
(function(i, r, g, l, c, h, u, m, f) {
|
|
13144
13145
|
var g = t("buffer").Buffer, p = 4, v = new g(p);
|
|
13145
13146
|
v.fill(0), n.exports = { hash: function(d, w, y, E) {
|
|
13146
13147
|
for (var P = w(function(_, C) {
|
|
@@ -13152,7 +13153,7 @@ list should be an Array.`), S.length === 0) return new v(0);
|
|
|
13152
13153
|
} };
|
|
13153
13154
|
}).call(this, t("lYpoI2"), typeof self < "u" ? self : typeof window < "u" ? window : {}, t("buffer").Buffer, arguments[3], arguments[4], arguments[5], arguments[6], "/node_modules/gulp-browserify/node_modules/crypto-browserify/helpers.js", "/node_modules/gulp-browserify/node_modules/crypto-browserify");
|
|
13154
13155
|
}, { buffer: 3, lYpoI2: 11 }], 5: [function(t, n, s) {
|
|
13155
|
-
(function(i, r, g, l, c,
|
|
13156
|
+
(function(i, r, g, l, c, h, u, m, f) {
|
|
13156
13157
|
var g = t("buffer").Buffer, p = t("./sha"), v = t("./sha256"), d = t("./rng"), w = { sha1: p, sha256: v, md5: t("./md5") }, y = 64, E = new g(y);
|
|
13157
13158
|
function P(_, C) {
|
|
13158
13159
|
var R = w[_ = _ || "sha1"], B = [];
|
|
@@ -13190,7 +13191,7 @@ list should be an Array.`), S.length === 0) return new v(0);
|
|
|
13190
13191
|
for (b in x) M(x[b]);
|
|
13191
13192
|
}).call(this, t("lYpoI2"), typeof self < "u" ? self : typeof window < "u" ? window : {}, t("buffer").Buffer, arguments[3], arguments[4], arguments[5], arguments[6], "/node_modules/gulp-browserify/node_modules/crypto-browserify/index.js", "/node_modules/gulp-browserify/node_modules/crypto-browserify");
|
|
13192
13193
|
}, { "./md5": 6, "./rng": 7, "./sha": 8, "./sha256": 9, buffer: 3, lYpoI2: 11 }], 6: [function(t, n, s) {
|
|
13193
|
-
(function(i, r, a, l, c,
|
|
13194
|
+
(function(i, r, a, l, c, h, u, m, f) {
|
|
13194
13195
|
var g = t("./helpers");
|
|
13195
13196
|
function p(T, b) {
|
|
13196
13197
|
T[b >> 5] |= 128 << b % 32, T[14 + (b + 64 >>> 9 << 4)] = b;
|
|
@@ -13224,14 +13225,14 @@ list should be an Array.`), S.length === 0) return new v(0);
|
|
|
13224
13225
|
};
|
|
13225
13226
|
}).call(this, t("lYpoI2"), typeof self < "u" ? self : typeof window < "u" ? window : {}, t("buffer").Buffer, arguments[3], arguments[4], arguments[5], arguments[6], "/node_modules/gulp-browserify/node_modules/crypto-browserify/md5.js", "/node_modules/gulp-browserify/node_modules/crypto-browserify");
|
|
13226
13227
|
}, { "./helpers": 4, buffer: 3, lYpoI2: 11 }], 7: [function(t, n, s) {
|
|
13227
|
-
(function(i, r, a, l, c,
|
|
13228
|
+
(function(i, r, a, l, c, h, u, m, f) {
|
|
13228
13229
|
n.exports = function(g) {
|
|
13229
13230
|
for (var p, v = new Array(g), d = 0; d < g; d++) !(3 & d) && (p = 4294967296 * Math.random()), v[d] = p >>> ((3 & d) << 3) & 255;
|
|
13230
13231
|
return v;
|
|
13231
13232
|
};
|
|
13232
13233
|
}).call(this, t("lYpoI2"), typeof self < "u" ? self : typeof window < "u" ? window : {}, t("buffer").Buffer, arguments[3], arguments[4], arguments[5], arguments[6], "/node_modules/gulp-browserify/node_modules/crypto-browserify/rng.js", "/node_modules/gulp-browserify/node_modules/crypto-browserify");
|
|
13233
13234
|
}, { buffer: 3, lYpoI2: 11 }], 8: [function(t, n, s) {
|
|
13234
|
-
(function(i, r, a, l, c,
|
|
13235
|
+
(function(i, r, a, l, c, h, u, m, f) {
|
|
13235
13236
|
var g = t("./helpers");
|
|
13236
13237
|
function p(w, y) {
|
|
13237
13238
|
w[y >> 5] |= 128 << 24 - y % 32, w[15 + (y + 64 >> 9 << 4)] = y;
|
|
@@ -13256,7 +13257,7 @@ list should be an Array.`), S.length === 0) return new v(0);
|
|
|
13256
13257
|
};
|
|
13257
13258
|
}).call(this, t("lYpoI2"), typeof self < "u" ? self : typeof window < "u" ? window : {}, t("buffer").Buffer, arguments[3], arguments[4], arguments[5], arguments[6], "/node_modules/gulp-browserify/node_modules/crypto-browserify/sha.js", "/node_modules/gulp-browserify/node_modules/crypto-browserify");
|
|
13258
13259
|
}, { "./helpers": 4, buffer: 3, lYpoI2: 11 }], 9: [function(t, n, s) {
|
|
13259
|
-
(function(i, r, a, l, c,
|
|
13260
|
+
(function(i, r, a, l, c, h, u, m, f) {
|
|
13260
13261
|
function g(y, E) {
|
|
13261
13262
|
var P = (65535 & y) + (65535 & E);
|
|
13262
13263
|
return (y >> 16) + (E >> 16) + (P >> 16) << 16 | 65535 & P;
|
|
@@ -13280,7 +13281,7 @@ list should be an Array.`), S.length === 0) return new v(0);
|
|
|
13280
13281
|
};
|
|
13281
13282
|
}).call(this, t("lYpoI2"), typeof self < "u" ? self : typeof window < "u" ? window : {}, t("buffer").Buffer, arguments[3], arguments[4], arguments[5], arguments[6], "/node_modules/gulp-browserify/node_modules/crypto-browserify/sha256.js", "/node_modules/gulp-browserify/node_modules/crypto-browserify");
|
|
13282
13283
|
}, { "./helpers": 4, buffer: 3, lYpoI2: 11 }], 10: [function(t, n, s) {
|
|
13283
|
-
(function(i, r, a, l, c,
|
|
13284
|
+
(function(i, r, a, l, c, h, u, m, f) {
|
|
13284
13285
|
s.read = function(g, p, v, d, C) {
|
|
13285
13286
|
var y, E, P = 8 * C - d - 1, T = (1 << P) - 1, b = T >> 1, x = -7, M = v ? C - 1 : 0, _ = v ? -1 : 1, C = g[p + M];
|
|
13286
13287
|
for (M += _, y = C & (1 << -x) - 1, C >>= -x, x += P; 0 < x; y = 256 * y + g[p + M], M += _, x -= 8) ;
|
|
@@ -13299,7 +13300,7 @@ list should be an Array.`), S.length === 0) return new v(0);
|
|
|
13299
13300
|
};
|
|
13300
13301
|
}).call(this, t("lYpoI2"), typeof self < "u" ? self : typeof window < "u" ? window : {}, t("buffer").Buffer, arguments[3], arguments[4], arguments[5], arguments[6], "/node_modules/gulp-browserify/node_modules/ieee754/index.js", "/node_modules/gulp-browserify/node_modules/ieee754");
|
|
13301
13302
|
}, { buffer: 3, lYpoI2: 11 }], 11: [function(t, n, s) {
|
|
13302
|
-
(function(i, r, a, l, c,
|
|
13303
|
+
(function(i, r, a, l, c, h, u, m, f) {
|
|
13303
13304
|
var g, p, v;
|
|
13304
13305
|
function d() {
|
|
13305
13306
|
}
|
|
@@ -13771,7 +13772,7 @@ var Md = _r.concat([
|
|
|
13771
13772
|
"integer"
|
|
13772
13773
|
];
|
|
13773
13774
|
function kd(o) {
|
|
13774
|
-
var e = 0, t = 0, n = Ot, s, i, r = [], a = [], l = 1, c = 0,
|
|
13775
|
+
var e = 0, t = 0, n = Ot, s, i, r = [], a = [], l = 1, c = 0, h = 0, u = !1, m = !1, f = "", g;
|
|
13775
13776
|
o = o || {};
|
|
13776
13777
|
var p = Pd, v = Ad;
|
|
13777
13778
|
o.version === "300 es" && (p = Rd, v = Cd);
|
|
@@ -13786,7 +13787,7 @@ function kd(o) {
|
|
|
13786
13787
|
Q.length && a.push({
|
|
13787
13788
|
type: Fd[n],
|
|
13788
13789
|
data: Q,
|
|
13789
|
-
position:
|
|
13790
|
+
position: h,
|
|
13790
13791
|
line: l,
|
|
13791
13792
|
column: c
|
|
13792
13793
|
});
|
|
@@ -13844,7 +13845,7 @@ function kd(o) {
|
|
|
13844
13845
|
return r.length && y(r.join("")), n = Ld, y("(eof)"), a;
|
|
13845
13846
|
}
|
|
13846
13847
|
function T() {
|
|
13847
|
-
return r = r.length ? [] : r, i === "/" && s === "*" ? (
|
|
13848
|
+
return r = r.length ? [] : r, i === "/" && s === "*" ? (h = t + e - 1, n = Ki, i = s, e + 1) : i === "/" && s === "/" ? (h = t + e - 1, n = qi, i = s, e + 1) : s === "#" ? (n = jo, h = t + e, e) : /\s/.test(s) ? (n = Xo, h = t + e, e) : (u = /\d/.test(s), m = /[^\w_]/.test(s), h = t + e, n = u ? Yo : m ? Vo : Go, e);
|
|
13848
13849
|
}
|
|
13849
13850
|
function b() {
|
|
13850
13851
|
return /[^\s]/g.test(s) ? (y(r.join("")), n = Ot, e) : (r.push(s), i = s, e + 1);
|
|
@@ -13888,7 +13889,7 @@ function kd(o) {
|
|
|
13888
13889
|
if (Z-- + Q.length > 0) continue;
|
|
13889
13890
|
te = Q.slice(0, 1).join("");
|
|
13890
13891
|
}
|
|
13891
|
-
return y(te),
|
|
13892
|
+
return y(te), h += te.length, r = r.slice(te.length), r.length;
|
|
13892
13893
|
} while (!0);
|
|
13893
13894
|
}
|
|
13894
13895
|
function B() {
|
|
@@ -13923,19 +13924,19 @@ function Gd(o) {
|
|
|
13923
13924
|
const $o = /* @__PURE__ */ Is(Hd);
|
|
13924
13925
|
var jd = Vd;
|
|
13925
13926
|
function Vd(o) {
|
|
13926
|
-
var e = null, t = null, n = 0, s = 0, i = 0, r = 0, a = 0, l = [], c,
|
|
13927
|
-
for (c = 0,
|
|
13928
|
-
if (
|
|
13929
|
-
if (n && n++ || (
|
|
13930
|
-
n = 1, s = c, e = o[
|
|
13931
|
-
var m = f(
|
|
13927
|
+
var e = null, t = null, n = 0, s = 0, i = 0, r = 0, a = 0, l = [], c, h, u;
|
|
13928
|
+
for (c = 0, h; c < o.length; c++)
|
|
13929
|
+
if (u = o[c], u.data === "{") {
|
|
13930
|
+
if (n && n++ || (h = f(c, pn(")"), pn()), h < 0) || (r = h, h = f(h, pn("("), pn(")")), h < 0) || (a = h, h = f(h, vs), h < 0) || o[h].type !== "ident" || (t = o[h].data, h = f(h, vs), h < 0)) continue;
|
|
13931
|
+
n = 1, s = c, e = o[h].data, i = h;
|
|
13932
|
+
var m = f(h, vs);
|
|
13932
13933
|
switch (o[m] && o[m].data) {
|
|
13933
13934
|
case "lowp":
|
|
13934
13935
|
case "highp":
|
|
13935
13936
|
case "mediump":
|
|
13936
13937
|
i = m;
|
|
13937
13938
|
}
|
|
13938
|
-
} else if (n &&
|
|
13939
|
+
} else if (n && u.data === "}") {
|
|
13939
13940
|
if (--n) continue;
|
|
13940
13941
|
l.push({
|
|
13941
13942
|
name: t,
|
|
@@ -13946,14 +13947,14 @@ function Vd(o) {
|
|
|
13946
13947
|
});
|
|
13947
13948
|
}
|
|
13948
13949
|
for (c = 0; c < o.length; c++)
|
|
13949
|
-
if (
|
|
13950
|
-
if (
|
|
13951
|
-
e = o[
|
|
13950
|
+
if (u = o[c], u.data === ";") {
|
|
13951
|
+
if (h = f(c, pn(")"), pn()), h < 0 || (r = h, h = f(h, pn("("), pn(")")), h < 0) || (a = h, h = f(h, vs), h < 0) || o[h].type !== "ident" || (t = o[h].data, h = f(h, vs), h < 0) || o[h].type === "operator" || o[h].data === "return") continue;
|
|
13952
|
+
e = o[h].data, l.push({
|
|
13952
13953
|
name: t,
|
|
13953
13954
|
type: e,
|
|
13954
13955
|
body: !1,
|
|
13955
13956
|
args: [a, r + 1],
|
|
13956
|
-
outer: [
|
|
13957
|
+
outer: [h, c + 1]
|
|
13957
13958
|
});
|
|
13958
13959
|
}
|
|
13959
13960
|
return l.sort(function(g, p) {
|
|
@@ -14346,22 +14347,22 @@ var yp = /* @__PURE__ */ function(o) {
|
|
|
14346
14347
|
Qd(t, o);
|
|
14347
14348
|
var e = tp(t);
|
|
14348
14349
|
function t(n) {
|
|
14349
|
-
var s, i = n.baseMaterial, r = n.fragmentShader, a = n.vertexShader, l = n.uniforms, c = n.patchMap,
|
|
14350
|
+
var s, i = n.baseMaterial, r = n.fragmentShader, a = n.vertexShader, l = n.uniforms, c = n.patchMap, h = n.cacheKey, u = n.silent, m = $d(n, up);
|
|
14350
14351
|
Zd(this, t);
|
|
14351
14352
|
var f;
|
|
14352
14353
|
if (pp(i) ? f = new i(m) : (f = i, Object.assign(f, m)), f.type === "RawShaderMaterial")
|
|
14353
14354
|
throw new Error("CustomShaderMaterial does not support RawShaderMaterial");
|
|
14354
|
-
s = e.call(this), mp(ml(s), f,
|
|
14355
|
+
s = e.call(this), mp(ml(s), f, u), s.__csm = {
|
|
14355
14356
|
patchMap: c || {},
|
|
14356
14357
|
fragmentShader: r || "",
|
|
14357
14358
|
vertexShader: a || "",
|
|
14358
|
-
cacheKey:
|
|
14359
|
+
cacheKey: h,
|
|
14359
14360
|
baseMaterial: i,
|
|
14360
14361
|
instanceID: Xr.MathUtils.generateUUID(),
|
|
14361
14362
|
type: f.type,
|
|
14362
14363
|
isAlreadyExtended: !gp(f.onBeforeCompile),
|
|
14363
14364
|
cacheHash: "",
|
|
14364
|
-
silent:
|
|
14365
|
+
silent: u
|
|
14365
14366
|
}, s.uniforms = Zn(Zn({}, s.uniforms || {}), l || {});
|
|
14366
14367
|
{
|
|
14367
14368
|
var g = s.__csm, p = g.fragmentShader, v = g.vertexShader, d = s.uniforms;
|
|
@@ -14412,9 +14413,9 @@ var yp = /* @__PURE__ */ function(o) {
|
|
|
14412
14413
|
}, {
|
|
14413
14414
|
key: "getCacheHash",
|
|
14414
14415
|
value: function() {
|
|
14415
|
-
var s = this.__csm, i = s.fragmentShader, r = s.vertexShader, a = this.uniforms, l = Object.values(a).reduce(function(
|
|
14416
|
-
var m =
|
|
14417
|
-
return
|
|
14416
|
+
var s = this.__csm, i = s.fragmentShader, r = s.vertexShader, a = this.uniforms, l = Object.values(a).reduce(function(h, u) {
|
|
14417
|
+
var m = u.value;
|
|
14418
|
+
return h + JSON.stringify(m);
|
|
14418
14419
|
}, ""), c = Ko(i) + Ko(r) + l;
|
|
14419
14420
|
return c.trim().length > 0 ? wd(c) : this.customProgramCacheKey();
|
|
14420
14421
|
}
|
|
@@ -14432,7 +14433,7 @@ var yp = /* @__PURE__ */ function(o) {
|
|
|
14432
14433
|
this.uniforms = r || {}, this.customProgramCacheKey = function() {
|
|
14433
14434
|
return a.__csm.cacheHash;
|
|
14434
14435
|
};
|
|
14435
|
-
var
|
|
14436
|
+
var h = function(f) {
|
|
14436
14437
|
try {
|
|
14437
14438
|
if (l) {
|
|
14438
14439
|
var g = a.patchShader(l, f.fragmentShader, !0);
|
|
@@ -14449,12 +14450,12 @@ var yp = /* @__PURE__ */ function(o) {
|
|
|
14449
14450
|
}
|
|
14450
14451
|
};
|
|
14451
14452
|
if (this.__csm.isAlreadyExtended) {
|
|
14452
|
-
var
|
|
14453
|
+
var u = this.onBeforeCompile;
|
|
14453
14454
|
this.onBeforeCompile = function(m, f) {
|
|
14454
|
-
|
|
14455
|
+
u(m, f), h(m);
|
|
14455
14456
|
};
|
|
14456
14457
|
} else
|
|
14457
|
-
this.onBeforeCompile =
|
|
14458
|
+
this.onBeforeCompile = h;
|
|
14458
14459
|
this.needsUpdate = !0;
|
|
14459
14460
|
}
|
|
14460
14461
|
/**
|
|
@@ -14498,8 +14499,8 @@ var yp = /* @__PURE__ */ function(o) {
|
|
|
14498
14499
|
|
|
14499
14500
|
// CSM_START
|
|
14500
14501
|
`));
|
|
14501
|
-
var
|
|
14502
|
-
return
|
|
14502
|
+
var h = this.__csm.isAlreadyExtended, u = l.includes("// CSM_END");
|
|
14503
|
+
return h && u ? l = vp(l, "// CSM_END", `
|
|
14503
14504
|
// CSM_END
|
|
14504
14505
|
`.concat(s.main, `
|
|
14505
14506
|
// CSM_END
|
|
@@ -14522,13 +14523,13 @@ var yp = /* @__PURE__ */ function(o) {
|
|
|
14522
14523
|
key: "parseShader",
|
|
14523
14524
|
value: function(s) {
|
|
14524
14525
|
if (s) {
|
|
14525
|
-
var i = s.replace(/\/\*\*(.*?)\*\/|\/\/(.*?)\n/gm, ""), r = zd(i), a = Yd(r), l = a.map(function(
|
|
14526
|
-
return
|
|
14527
|
-
}).indexOf("main"), c = $o(r.slice(0, l >= 0 ? a[l].outer[0] : void 0)),
|
|
14526
|
+
var i = s.replace(/\/\*\*(.*?)\*\/|\/\/(.*?)\n/gm, ""), r = zd(i), a = Yd(r), l = a.map(function(u) {
|
|
14527
|
+
return u.name;
|
|
14528
|
+
}).indexOf("main"), c = $o(r.slice(0, l >= 0 ? a[l].outer[0] : void 0)), h = l >= 0 ? this.getShaderFromIndex(r, a[l].body) : "";
|
|
14528
14529
|
return {
|
|
14529
14530
|
defines: "",
|
|
14530
14531
|
header: c,
|
|
14531
|
-
main:
|
|
14532
|
+
main: h
|
|
14532
14533
|
};
|
|
14533
14534
|
}
|
|
14534
14535
|
}
|
|
@@ -14582,7 +14583,7 @@ const _p = ["args"], Kg = /* @__PURE__ */ me({
|
|
|
14582
14583
|
},
|
|
14583
14584
|
setup(o, { expose: e }) {
|
|
14584
14585
|
const t = o, n = ve(null), { extend: s, invalidate: i } = ye();
|
|
14585
|
-
return s({ CustomShaderMaterial: yp }), ee(t, () => i()), e({ instance: n }), (r, a) => (ce(),
|
|
14586
|
+
return s({ CustomShaderMaterial: yp }), ee(t, () => i()), e({ instance: n }), (r, a) => (ce(), de("TresCustomShaderMaterial", {
|
|
14586
14587
|
ref_key: "customShaderMaterialClass",
|
|
14587
14588
|
ref: n,
|
|
14588
14589
|
args: [t]
|
|
@@ -14706,17 +14707,17 @@ class bp {
|
|
|
14706
14707
|
depthBuffer: !1,
|
|
14707
14708
|
type: jt
|
|
14708
14709
|
}), this.renderTargetB = this.renderTargetA.clone(), this.convolutionMaterial = new Tp(), this.convolutionMaterial.setTexelSize(1 / t, 1 / n), this.convolutionMaterial.setResolution(new ge(t, n)), this.scene = new Ts(), this.camera = new ec(), this.convolutionMaterial.uniforms.depthEdge0.value = s, this.convolutionMaterial.uniforms.depthEdge1.value = i, this.convolutionMaterial.uniforms.depthScale.value = r, this.convolutionMaterial.uniforms.depthBias.value = a, this.convolutionMaterial.defines.USE_DEPTH = r > 0;
|
|
14709
|
-
const l = new Float32Array([-1, -1, 0, 3, -1, 0, -1, 3, 0]), c = new Float32Array([0, 0, 2, 0, 0, 2]),
|
|
14710
|
-
|
|
14710
|
+
const l = new Float32Array([-1, -1, 0, 3, -1, 0, -1, 3, 0]), c = new Float32Array([0, 0, 2, 0, 0, 2]), h = new mt();
|
|
14711
|
+
h.setAttribute("position", new pt(l, 3)), h.setAttribute("uv", new pt(c, 2)), this.screen = new he(h, this.convolutionMaterial), this.screen.frustumCulled = !1, this.scene.add(this.screen);
|
|
14711
14712
|
}
|
|
14712
14713
|
render(e, t, n) {
|
|
14713
14714
|
const s = this.scene, i = this.camera, r = this.renderTargetA, a = this.renderTargetB, l = this.convolutionMaterial, c = l.uniforms;
|
|
14714
14715
|
c.depthBuffer.value = t.depthTexture;
|
|
14715
|
-
const
|
|
14716
|
-
let
|
|
14717
|
-
for (f = 0, g =
|
|
14718
|
-
m = f & 1 ? a : r, c.kernel.value =
|
|
14719
|
-
c.kernel.value =
|
|
14716
|
+
const h = l.kernel;
|
|
14717
|
+
let u = t, m, f, g;
|
|
14718
|
+
for (f = 0, g = h.length - 1; f < g; ++f)
|
|
14719
|
+
m = f & 1 ? a : r, c.kernel.value = h[f], c.inputBuffer.value = u.texture, e.setRenderTarget(m), e.render(s, i), u = m;
|
|
14720
|
+
c.kernel.value = h[f], c.inputBuffer.value = u.texture, e.setRenderTarget(this.renderToScreen ? null : n), e.render(s, i);
|
|
14720
14721
|
}
|
|
14721
14722
|
dispose() {
|
|
14722
14723
|
this.screen.material.dispose(), this.screen.geometry.dispose(), this.renderTargetA.dispose(), this.renderTargetB.dispose(), this.convolutionMaterial.dispose();
|
|
@@ -14983,7 +14984,7 @@ const Mp = ["texture-matrix", "t-sharp", "t-depth", "t-blur", "defines-USE_BLUR"
|
|
|
14983
14984
|
setup(o, { expose: e }) {
|
|
14984
14985
|
const t = o, { extend: n, invalidate: s } = ye();
|
|
14985
14986
|
n({ MeshReflectionMaterial: Ep });
|
|
14986
|
-
const i = Fe(() => 500 - (Array.isArray(t.blurSize) ? t.blurSize[0] : t.blurSize)), r = Fe(() => 500 - (Array.isArray(t.blurSize) ? t.blurSize[1] : t.blurSize)), a = Fe(() => i.value > 0 || r.value > 0), l = Fe(() => t.sharpDepthScale > 0 || t.blurDepthScale > 0), c = Fe(() => !!t.distortionMap),
|
|
14987
|
+
const i = Fe(() => 500 - (Array.isArray(t.blurSize) ? t.blurSize[0] : t.blurSize)), r = Fe(() => 500 - (Array.isArray(t.blurSize) ? t.blurSize[1] : t.blurSize)), a = Fe(() => i.value > 0 || r.value > 0), l = Fe(() => t.sharpDepthScale > 0 || t.blurDepthScale > 0), c = Fe(() => !!t.distortionMap), h = Fe(() => !!t.roughnessMap), u = ve();
|
|
14987
14988
|
let m;
|
|
14988
14989
|
const f = {
|
|
14989
14990
|
reflectorPlane: new pi(),
|
|
@@ -15057,8 +15058,8 @@ const Mp = ["texture-matrix", "t-sharp", "t-depth", "t-blur", "defines-USE_BLUR"
|
|
|
15057
15058
|
depthScale: t.blurDepthScale,
|
|
15058
15059
|
depthBias: t.blurDepthBias
|
|
15059
15060
|
});
|
|
15060
|
-
}, { immediate: !0 }), ee(
|
|
15061
|
-
|
|
15061
|
+
}, { immediate: !0 }), ee(u, () => {
|
|
15062
|
+
u.value && (u.value.onBeforeRender = v);
|
|
15062
15063
|
}), ee(() => [a.value], () => {
|
|
15063
15064
|
vt().logWarning(
|
|
15064
15065
|
"MeshReflectionMaterial: Setting blurMixRough or blurMixSmooth to 0, then non-zero triggers a recompile.The TresJS core cannot currently handle recompiled materials."
|
|
@@ -15071,7 +15072,7 @@ const Mp = ["texture-matrix", "t-sharp", "t-depth", "t-blur", "defines-USE_BLUR"
|
|
|
15071
15072
|
vt().logWarning(
|
|
15072
15073
|
"MeshReflectionMaterial: Toggling distortionMap triggers a recompile.The TresJS core cannot currently handle recompiled materials."
|
|
15073
15074
|
);
|
|
15074
|
-
}), ee(
|
|
15075
|
+
}), ee(h, () => {
|
|
15075
15076
|
vt().logWarning(
|
|
15076
15077
|
"MeshReflectionMaterial: Toggling roughnessMap triggers a recompile.The TresJS core cannot currently handle recompiled materials."
|
|
15077
15078
|
);
|
|
@@ -15083,14 +15084,14 @@ const Mp = ["texture-matrix", "t-sharp", "t-depth", "t-blur", "defines-USE_BLUR"
|
|
|
15083
15084
|
g.dispose(), p.dispose(), m.dispose();
|
|
15084
15085
|
}), Ke().onBeforeRender(({ renderer: d, scene: w, camera: y, invalidate: E }) => {
|
|
15085
15086
|
var T, b;
|
|
15086
|
-
const P = (b = (T =
|
|
15087
|
+
const P = (b = (T = u.value) == null ? void 0 : T.__tres) == null ? void 0 : b.parent;
|
|
15087
15088
|
P && (v(d, w, y, P), E());
|
|
15088
|
-
}), e({ instance:
|
|
15089
|
+
}), e({ instance: u }), (d, w) => {
|
|
15089
15090
|
var y, E, P;
|
|
15090
|
-
return ce(),
|
|
15091
|
-
key: `key${a.value ? "0" : "1"}${l.value ? "0" : "1"}${c.value ? "0" : "1"}${
|
|
15091
|
+
return ce(), de("TresMeshReflectionMaterial", je({
|
|
15092
|
+
key: `key${a.value ? "0" : "1"}${l.value ? "0" : "1"}${c.value ? "0" : "1"}${h.value ? "0" : "1"}`,
|
|
15092
15093
|
ref_key: "materialRef",
|
|
15093
|
-
ref:
|
|
15094
|
+
ref: u
|
|
15094
15095
|
}, t, {
|
|
15095
15096
|
"texture-matrix": f.textureMatrix,
|
|
15096
15097
|
"t-sharp": (y = U(g)) == null ? void 0 : y.texture,
|
|
@@ -15336,7 +15337,7 @@ const Sp = ["uniforms-fresnelAmount-value", "uniforms-enableBlinking-value", "un
|
|
|
15336
15337
|
return i(({ invalidate: r }) => {
|
|
15337
15338
|
var a;
|
|
15338
15339
|
(a = n.value) == null || a.update(), r();
|
|
15339
|
-
}), (r, a) => (ce(),
|
|
15340
|
+
}), (r, a) => (ce(), de("TresHolographicMaterial", {
|
|
15340
15341
|
ref_key: "MeshHolographicMaterialClass",
|
|
15341
15342
|
ref: n,
|
|
15342
15343
|
"uniforms-fresnelAmount-value": t.fresnelAmount,
|
|
@@ -15364,7 +15365,7 @@ const Sp = ["uniforms-fresnelAmount-value", "uniforms-enableBlinking-value", "un
|
|
|
15364
15365
|
const r = ve();
|
|
15365
15366
|
return e({
|
|
15366
15367
|
instance: r
|
|
15367
|
-
}), (a, l) => (ce(),
|
|
15368
|
+
}), (a, l) => (ce(), de("TresMesh", je({
|
|
15368
15369
|
ref_key: "boxRef",
|
|
15369
15370
|
ref: r
|
|
15370
15371
|
}, a.$attrs), [
|
|
@@ -15915,11 +15916,11 @@ function Cp(o, e) {
|
|
|
15915
15916
|
const t = o.matrixWorld, n = o.geometry, s = n.attributes.instanceStart, i = n.attributes.instanceEnd, r = Math.min(n.instanceCount, s.count);
|
|
15916
15917
|
for (let a = 0, l = r; a < l; a++) {
|
|
15917
15918
|
st.start.fromBufferAttribute(s, a), st.end.fromBufferAttribute(i, a), st.applyMatrix4(t);
|
|
15918
|
-
const c = new $(),
|
|
15919
|
-
Ht.distanceSqToSegment(st.start, st.end,
|
|
15920
|
-
point:
|
|
15919
|
+
const c = new $(), h = new $();
|
|
15920
|
+
Ht.distanceSqToSegment(st.start, st.end, h, c), h.distanceTo(c) < kn * 0.5 && e.push({
|
|
15921
|
+
point: h,
|
|
15921
15922
|
pointOnLine: c,
|
|
15922
|
-
distance: Ht.origin.distanceTo(
|
|
15923
|
+
distance: Ht.origin.distanceTo(h),
|
|
15923
15924
|
object: o,
|
|
15924
15925
|
face: null,
|
|
15925
15926
|
faceIndex: a,
|
|
@@ -15929,16 +15930,16 @@ function Cp(o, e) {
|
|
|
15929
15930
|
}
|
|
15930
15931
|
}
|
|
15931
15932
|
function Rp(o, e, t) {
|
|
15932
|
-
const n = e.projectionMatrix, i = o.material.resolution, r = o.matrixWorld, a = o.geometry, l = a.attributes.instanceStart, c = a.attributes.instanceEnd,
|
|
15933
|
+
const n = e.projectionMatrix, i = o.material.resolution, r = o.matrixWorld, a = o.geometry, l = a.attributes.instanceStart, c = a.attributes.instanceEnd, h = Math.min(a.instanceCount, l.count), u = -e.near;
|
|
15933
15934
|
Ht.at(1, Bt), Bt.w = 1, Bt.applyMatrix4(e.matrixWorldInverse), Bt.applyMatrix4(n), Bt.multiplyScalar(1 / Bt.w), Bt.x *= i.x / 2, Bt.y *= i.y / 2, Bt.z = 0, Ji.copy(Bt), er.multiplyMatrices(e.matrixWorldInverse, r);
|
|
15934
|
-
for (let m = 0, f =
|
|
15935
|
-
if (tt.fromBufferAttribute(l, m), nt.fromBufferAttribute(c, m), tt.w = 1, nt.w = 1, tt.applyMatrix4(er), nt.applyMatrix4(er), tt.z >
|
|
15935
|
+
for (let m = 0, f = h; m < f; m++) {
|
|
15936
|
+
if (tt.fromBufferAttribute(l, m), nt.fromBufferAttribute(c, m), tt.w = 1, nt.w = 1, tt.applyMatrix4(er), nt.applyMatrix4(er), tt.z > u && nt.z > u)
|
|
15936
15937
|
continue;
|
|
15937
|
-
if (tt.z >
|
|
15938
|
-
const y = tt.z - nt.z, E = (tt.z -
|
|
15938
|
+
if (tt.z > u) {
|
|
15939
|
+
const y = tt.z - nt.z, E = (tt.z - u) / y;
|
|
15939
15940
|
tt.lerp(nt, E);
|
|
15940
|
-
} else if (nt.z >
|
|
15941
|
-
const y = nt.z - tt.z, E = (nt.z -
|
|
15941
|
+
} else if (nt.z > u) {
|
|
15942
|
+
const y = nt.z - tt.z, E = (nt.z - u) / y;
|
|
15942
15943
|
nt.lerp(tt, E);
|
|
15943
15944
|
}
|
|
15944
15945
|
tt.applyMatrix4(n), nt.applyMatrix4(n), tt.multiplyScalar(1 / tt.w), nt.multiplyScalar(1 / nt.w), tt.x *= i.x / 2, tt.y *= i.y / 2, nt.x *= i.x / 2, nt.y *= i.y / 2, st.start.copy(tt), st.start.z = 0, st.end.copy(nt), st.end.z = 0;
|
|
@@ -15984,20 +15985,20 @@ class Ip extends he {
|
|
|
15984
15985
|
if (n)
|
|
15985
15986
|
c = kn * 0.5;
|
|
15986
15987
|
else {
|
|
15987
|
-
const
|
|
15988
|
-
c = na(s,
|
|
15988
|
+
const u = Math.max(s.near, si.distanceToPoint(Ht.origin));
|
|
15989
|
+
c = na(s, u, l.resolution);
|
|
15989
15990
|
}
|
|
15990
15991
|
if (si.radius += c, Ht.intersectsSphere(si) === !1)
|
|
15991
15992
|
return;
|
|
15992
15993
|
a.boundingBox === null && a.computeBoundingBox(), ni.copy(a.boundingBox).applyMatrix4(r);
|
|
15993
|
-
let
|
|
15994
|
+
let h;
|
|
15994
15995
|
if (n)
|
|
15995
|
-
|
|
15996
|
+
h = kn * 0.5;
|
|
15996
15997
|
else {
|
|
15997
|
-
const
|
|
15998
|
-
|
|
15998
|
+
const u = Math.max(s.near, ni.distanceToPoint(Ht.origin));
|
|
15999
|
+
h = na(s, u, l.resolution);
|
|
15999
16000
|
}
|
|
16000
|
-
ni.expandByScalar(
|
|
16001
|
+
ni.expandByScalar(h), Ht.intersectsBox(ni) !== !1 && (n ? Cp(this, t) : Rp(this, s, t));
|
|
16001
16002
|
}
|
|
16002
16003
|
onBeforeRender(e) {
|
|
16003
16004
|
const t = this.material.uniforms;
|
|
@@ -16064,16 +16065,16 @@ const Dp = ["object"], Lp = /* @__PURE__ */ me({
|
|
|
16064
16065
|
return d.push(v[v.length - 1]), d;
|
|
16065
16066
|
}
|
|
16066
16067
|
const s = new Hr(), i = new vl(), r = new Op(i, s), { sizes: a, invalidate: l } = ye(), c = Fe(() => Array.isArray(t.vertexColors));
|
|
16067
|
-
function
|
|
16068
|
+
function h(f, g) {
|
|
16068
16069
|
f.color = _n(g.color), f.linewidth = g.lineWidth, f.alphaToCoverage = g.alphaToCoverage, f.worldUnits = g.worldUnits, f.vertexColors = Array.isArray(g.vertexColors), f.dashed = g.dashed, f.dashScale = g.dashScale, f.dashSize = g.dashSize, f.dashOffset = g.dashOffset, f.gapSize = g.gapSize, f.needsUpdate = !0;
|
|
16069
16070
|
}
|
|
16070
|
-
function
|
|
16071
|
+
function u(f, g, p) {
|
|
16071
16072
|
const v = g.map((w) => w instanceof $ ? [w.x, w.y, w.z] : w instanceof ge ? [w.x, w.y, 0] : Array.isArray(w) && w.length === 2 ? [w[0], w[1], 0] : w).flat();
|
|
16072
16073
|
f.setPositions(v.flat());
|
|
16073
16074
|
const d = n(p, g.length).map((w) => w.toArray()).flat();
|
|
16074
16075
|
f.setColors(d), r.computeLineDistances();
|
|
16075
16076
|
}
|
|
16076
|
-
|
|
16077
|
+
h(s, t), u(i, t.points, t.vertexColors), r.computeLineDistances(), ee(() => [
|
|
16077
16078
|
t.color,
|
|
16078
16079
|
t.lineWidth,
|
|
16079
16080
|
t.alphaToCoverage,
|
|
@@ -16084,16 +16085,16 @@ const Dp = ["object"], Lp = /* @__PURE__ */ me({
|
|
|
16084
16085
|
t.dashSize,
|
|
16085
16086
|
t.dashOffset
|
|
16086
16087
|
], () => {
|
|
16087
|
-
|
|
16088
|
+
h(s, t), l();
|
|
16088
16089
|
}), ee(() => [t.points, t.vertexColors], () => {
|
|
16089
|
-
|
|
16090
|
+
u(i, t.points, t.vertexColors), l();
|
|
16090
16091
|
}), ee(() => [a.height, a.width], () => {
|
|
16091
16092
|
s.resolution = new ge(a.width.value, a.height.value), l();
|
|
16092
16093
|
}), rt(() => {
|
|
16093
16094
|
i.dispose(), s.dispose();
|
|
16094
16095
|
});
|
|
16095
16096
|
const m = ve();
|
|
16096
|
-
return e({ instance: m }), (f, g) => (ce(),
|
|
16097
|
+
return e({ instance: m }), (f, g) => (ce(), de("primitive", {
|
|
16097
16098
|
ref: m.value,
|
|
16098
16099
|
object: U(r)
|
|
16099
16100
|
}, null, 8, Dp));
|
|
@@ -16119,11 +16120,11 @@ const Dp = ["object"], Lp = /* @__PURE__ */ me({
|
|
|
16119
16120
|
},
|
|
16120
16121
|
setup(o, { expose: e }) {
|
|
16121
16122
|
const t = o;
|
|
16122
|
-
function n(l, c,
|
|
16123
|
+
function n(l, c, h, u) {
|
|
16123
16124
|
const m = l.map(
|
|
16124
16125
|
(f) => f instanceof $ ? f : new $(...f)
|
|
16125
16126
|
);
|
|
16126
|
-
return new oc(m, c,
|
|
16127
|
+
return new oc(m, c, h, u);
|
|
16127
16128
|
}
|
|
16128
16129
|
function s(l, c) {
|
|
16129
16130
|
return l.getPoints(c);
|
|
@@ -16156,7 +16157,7 @@ const Dp = ["object"], Lp = /* @__PURE__ */ me({
|
|
|
16156
16157
|
const r = ve();
|
|
16157
16158
|
return e({
|
|
16158
16159
|
instance: r
|
|
16159
|
-
}), (a, l) => (ce(),
|
|
16160
|
+
}), (a, l) => (ce(), de("TresMesh", je({
|
|
16160
16161
|
ref_key: "circleRef",
|
|
16161
16162
|
ref: r
|
|
16162
16163
|
}, a.$attrs), [
|
|
@@ -16178,7 +16179,7 @@ const Dp = ["object"], Lp = /* @__PURE__ */ me({
|
|
|
16178
16179
|
const r = ve();
|
|
16179
16180
|
return e({
|
|
16180
16181
|
instance: r
|
|
16181
|
-
}), (a, l) => (ce(),
|
|
16182
|
+
}), (a, l) => (ce(), de("TresMesh", je({
|
|
16182
16183
|
ref_key: "coneRef",
|
|
16183
16184
|
ref: r
|
|
16184
16185
|
}, a.$attrs), [
|
|
@@ -16200,7 +16201,7 @@ const Dp = ["object"], Lp = /* @__PURE__ */ me({
|
|
|
16200
16201
|
const r = ve();
|
|
16201
16202
|
return e({
|
|
16202
16203
|
instance: r
|
|
16203
|
-
}), (a, l) => (ce(),
|
|
16204
|
+
}), (a, l) => (ce(), de("TresMesh", je({
|
|
16204
16205
|
ref_key: "cylinderRef",
|
|
16205
16206
|
ref: r
|
|
16206
16207
|
}, a.$attrs), [
|
|
@@ -16220,7 +16221,7 @@ const Dp = ["object"], Lp = /* @__PURE__ */ me({
|
|
|
16220
16221
|
const t = o, { args: n, color: s } = De(t), i = ve(), { invalidate: r } = ye();
|
|
16221
16222
|
return ee(n, () => r()), e({
|
|
16222
16223
|
instance: i
|
|
16223
|
-
}), (a, l) => (ce(),
|
|
16224
|
+
}), (a, l) => (ce(), de("TresMesh", je({
|
|
16224
16225
|
ref_key: "dodecahedronRef",
|
|
16225
16226
|
ref: i
|
|
16226
16227
|
}, a.$attrs), [
|
|
@@ -16242,7 +16243,7 @@ const Dp = ["object"], Lp = /* @__PURE__ */ me({
|
|
|
16242
16243
|
const r = ve();
|
|
16243
16244
|
return e({
|
|
16244
16245
|
instance: r
|
|
16245
|
-
}), (a, l) => (ce(),
|
|
16246
|
+
}), (a, l) => (ce(), de("TresMesh", je({
|
|
16246
16247
|
ref_key: "icosahedronRef",
|
|
16247
16248
|
ref: r
|
|
16248
16249
|
}, a.$attrs), [
|
|
@@ -16264,7 +16265,7 @@ const Dp = ["object"], Lp = /* @__PURE__ */ me({
|
|
|
16264
16265
|
const r = ve();
|
|
16265
16266
|
return e({
|
|
16266
16267
|
instance: r
|
|
16267
|
-
}), (a, l) => (ce(),
|
|
16268
|
+
}), (a, l) => (ce(), de("TresMesh", je({
|
|
16268
16269
|
ref_key: "octahedronRef",
|
|
16269
16270
|
ref: r
|
|
16270
16271
|
}, a.$attrs), [
|
|
@@ -16286,7 +16287,7 @@ const Dp = ["object"], Lp = /* @__PURE__ */ me({
|
|
|
16286
16287
|
const r = ve();
|
|
16287
16288
|
return e({
|
|
16288
16289
|
instance: r
|
|
16289
|
-
}), (a, l) => (ce(),
|
|
16290
|
+
}), (a, l) => (ce(), de("TresMesh", je({
|
|
16290
16291
|
ref_key: "planeRef",
|
|
16291
16292
|
ref: r,
|
|
16292
16293
|
rotation: [-Math.PI / 2, 0, 0]
|
|
@@ -16309,7 +16310,7 @@ const Dp = ["object"], Lp = /* @__PURE__ */ me({
|
|
|
16309
16310
|
const r = ve();
|
|
16310
16311
|
return e({
|
|
16311
16312
|
instance: r
|
|
16312
|
-
}), (a, l) => (ce(),
|
|
16313
|
+
}), (a, l) => (ce(), de("TresMesh", je({
|
|
16313
16314
|
ref_key: "ringRef",
|
|
16314
16315
|
ref: r
|
|
16315
16316
|
}, a.$attrs), [
|
|
@@ -16329,7 +16330,7 @@ const Dp = ["object"], Lp = /* @__PURE__ */ me({
|
|
|
16329
16330
|
const t = o, { args: n, color: s } = De(t), { invalidate: i, extend: r } = ye();
|
|
16330
16331
|
r({ RoundedBoxGeometry: rh }), ee(n, () => i());
|
|
16331
16332
|
const a = ve();
|
|
16332
|
-
return e({ instance: a }), (l, c) => (ce(),
|
|
16333
|
+
return e({ instance: a }), (l, c) => (ce(), de("TresMesh", {
|
|
16333
16334
|
ref_key: "roundedBoxRef",
|
|
16334
16335
|
ref: a
|
|
16335
16336
|
}, [
|
|
@@ -16351,7 +16352,7 @@ const Dp = ["object"], Lp = /* @__PURE__ */ me({
|
|
|
16351
16352
|
const r = ve();
|
|
16352
16353
|
return e({
|
|
16353
16354
|
instance: r
|
|
16354
|
-
}), (a, l) => (ce(),
|
|
16355
|
+
}), (a, l) => (ce(), de("TresMesh", je({
|
|
16355
16356
|
ref_key: "sphereRef",
|
|
16356
16357
|
ref: r
|
|
16357
16358
|
}, a.$attrs), [
|
|
@@ -16386,16 +16387,16 @@ const Dp = ["object"], Lp = /* @__PURE__ */ me({
|
|
|
16386
16387
|
}
|
|
16387
16388
|
return p.setIndex(y), p.setAttribute("position", new pt(d, 3)), p.setAttribute("normal", new pt(w, 3)), p;
|
|
16388
16389
|
}
|
|
16389
|
-
function
|
|
16390
|
+
function h(f, g, p, v, d) {
|
|
16390
16391
|
return (r(s(g * f * 0.25)) ** v + r(i(g * f * 0.25)) ** d) ** (-1 / p);
|
|
16391
16392
|
}
|
|
16392
|
-
function
|
|
16393
|
+
function u(f, g, p, v, d, w, y, E, P, T, b) {
|
|
16393
16394
|
const x = 2 * Math.PI / T, M = -Math.PI, _ = Math.PI / (b - 1), C = -0.5 * Math.PI, R = f.getAttribute("position");
|
|
16394
16395
|
let B = 0, N = 0, j = C;
|
|
16395
16396
|
for (let V = 0; V < b; V++) {
|
|
16396
16397
|
N = M;
|
|
16397
16398
|
for (let Q = 0; Q < T; Q++) {
|
|
16398
|
-
const Z =
|
|
16399
|
+
const Z = h(N, g, p, v, d), ne = h(j, w, y, E, P);
|
|
16399
16400
|
R.setXYZ(
|
|
16400
16401
|
B,
|
|
16401
16402
|
Z * s(N) * ne * s(j),
|
|
@@ -16419,14 +16420,14 @@ const Dp = ["object"], Lp = /* @__PURE__ */ me({
|
|
|
16419
16420
|
t.expB[1],
|
|
16420
16421
|
t.expB[2]
|
|
16421
16422
|
], () => {
|
|
16422
|
-
|
|
16423
|
+
u(a.value, t.numArmsA, t.expA[0], t.expA[1], t.expA[2], t.numArmsB, t.expB[0], t.expB[1], t.expB[2], t.widthSegments, t.heightSegments), n();
|
|
16423
16424
|
}, { immediate: !0 }), rt(() => {
|
|
16424
16425
|
a.value && a.value.dispose();
|
|
16425
16426
|
});
|
|
16426
16427
|
const m = ve();
|
|
16427
16428
|
return e({
|
|
16428
16429
|
instance: m
|
|
16429
|
-
}), (f, g) => (ce(),
|
|
16430
|
+
}), (f, g) => (ce(), de("TresMesh", je({
|
|
16430
16431
|
ref_key: "superformulaRef",
|
|
16431
16432
|
ref: m
|
|
16432
16433
|
}, f.$attrs, { geometry: a.value }), [
|
|
@@ -16445,7 +16446,7 @@ const Dp = ["object"], Lp = /* @__PURE__ */ me({
|
|
|
16445
16446
|
const t = o, { args: n, color: s } = De(t), i = ve();
|
|
16446
16447
|
return e({
|
|
16447
16448
|
instance: i
|
|
16448
|
-
}), (r, a) => (ce(),
|
|
16449
|
+
}), (r, a) => (ce(), de("TresMesh", je({
|
|
16449
16450
|
ref_key: "tetrahedronRef",
|
|
16450
16451
|
ref: i,
|
|
16451
16452
|
rotation: [-Math.PI / 2, 0, 0]
|
|
@@ -16468,7 +16469,7 @@ const Dp = ["object"], Lp = /* @__PURE__ */ me({
|
|
|
16468
16469
|
const r = ve();
|
|
16469
16470
|
return e({
|
|
16470
16471
|
instance: r
|
|
16471
|
-
}), (a, l) => (ce(),
|
|
16472
|
+
}), (a, l) => (ce(), de("TresMesh", je({
|
|
16472
16473
|
ref_key: "torusRef",
|
|
16473
16474
|
ref: r
|
|
16474
16475
|
}, a.$attrs), [
|
|
@@ -16490,7 +16491,7 @@ const Dp = ["object"], Lp = /* @__PURE__ */ me({
|
|
|
16490
16491
|
const r = ve();
|
|
16491
16492
|
return e({
|
|
16492
16493
|
instance: r
|
|
16493
|
-
}), (a, l) => (ce(),
|
|
16494
|
+
}), (a, l) => (ce(), de("TresMesh", je({
|
|
16494
16495
|
ref_key: "torusKnotRef",
|
|
16495
16496
|
ref: r
|
|
16496
16497
|
}, a.$attrs), [
|
|
@@ -16518,7 +16519,7 @@ const Dp = ["object"], Lp = /* @__PURE__ */ me({
|
|
|
16518
16519
|
const r = ve();
|
|
16519
16520
|
return e({
|
|
16520
16521
|
instance: r
|
|
16521
|
-
}), (a, l) => (ce(),
|
|
16522
|
+
}), (a, l) => (ce(), de("TresMesh", je({
|
|
16522
16523
|
ref_key: "tubeRef",
|
|
16523
16524
|
ref: r
|
|
16524
16525
|
}, a.$attrs), [
|
|
@@ -16559,33 +16560,33 @@ const g0 = /* @__PURE__ */ me({
|
|
|
16559
16560
|
},
|
|
16560
16561
|
async setup(o, { expose: e }) {
|
|
16561
16562
|
let t, n;
|
|
16562
|
-
const s = o, i =
|
|
16563
|
+
const s = o, i = fe(null);
|
|
16563
16564
|
e({ texture: i });
|
|
16564
16565
|
const { extend: r, renderer: a, scene: l } = ye();
|
|
16565
16566
|
let c = null;
|
|
16566
|
-
const
|
|
16567
|
-
let
|
|
16568
|
-
const m =
|
|
16567
|
+
const h = fe(null);
|
|
16568
|
+
let u = null;
|
|
16569
|
+
const m = fe(null), { onBeforeRender: f } = Ke();
|
|
16569
16570
|
let g = 1;
|
|
16570
16571
|
f(() => {
|
|
16571
|
-
|
|
16572
|
+
u && m.value && h.value && (s.frames === Number.POSITIVE_INFINITY || g < s.frames) && (u.update(a.value, mc(m.value.virtualScene)), g++);
|
|
16572
16573
|
}, -1);
|
|
16573
|
-
const p = ([t, n] = An(() => Zf(s,
|
|
16574
|
+
const p = ([t, n] = An(() => Zf(s, h)), t = await t, n(), t).texture, v = (d) => {
|
|
16574
16575
|
d ? (l.value.environment = d.texture, s.background && (l.value.background = d.texture)) : (l.value.environment = p.value, s.background && (l.value.background = p.value));
|
|
16575
16576
|
};
|
|
16576
16577
|
return ee(p, () => {
|
|
16577
|
-
|
|
16578
|
+
h.value && v(h.value);
|
|
16578
16579
|
}, { immediate: !0, deep: !0 }), ee(Sr().default, (d) => {
|
|
16579
16580
|
var w, y;
|
|
16580
16581
|
if (d && (c = d, Array.isArray(c) && c.length > 0 && typeof ((w = c[0]) == null ? void 0 : w.type) != "symbol")) {
|
|
16581
|
-
r({ EnvSence: dm }),
|
|
16582
|
+
r({ EnvSence: dm }), h.value = new lc(s.resolution), h.value.texture.type = jt, u = new cc(s.near, s.far, h.value), v(h.value);
|
|
16582
16583
|
return;
|
|
16583
16584
|
}
|
|
16584
|
-
(y =
|
|
16585
|
+
(y = h.value) == null || y.dispose(), h.value = null, v();
|
|
16585
16586
|
}, { immediate: !0, deep: !0 }), i.value = p, rt(() => {
|
|
16586
16587
|
var d, w;
|
|
16587
|
-
(d = m.value) == null || d.destructor(), (w =
|
|
16588
|
-
}), (d, w) =>
|
|
16588
|
+
(d = m.value) == null || d.destructor(), (w = h.value) == null || w.dispose();
|
|
16589
|
+
}), (d, w) => h.value ? (ce(), de("TresEnvSence", {
|
|
16589
16590
|
key: 0,
|
|
16590
16591
|
ref_key: "envSence",
|
|
16591
16592
|
ref: m
|
|
@@ -16610,11 +16611,11 @@ const g0 = /* @__PURE__ */ me({
|
|
|
16610
16611
|
color: { default: new Pe(16777215) }
|
|
16611
16612
|
},
|
|
16612
16613
|
setup(o) {
|
|
16613
|
-
const e = o, t =
|
|
16614
|
+
const e = o, t = fe();
|
|
16614
16615
|
return Pt(() => {
|
|
16615
16616
|
t.value && (t.value.color.multiplyScalar(e.intensity), t.value.needsUpdate = !0);
|
|
16616
|
-
}), (n, s) => (ce(),
|
|
16617
|
-
n.from === "circle" ? (ce(),
|
|
16617
|
+
}), (n, s) => (ce(), de("TresMesh", null, [
|
|
16618
|
+
n.from === "circle" ? (ce(), de("TresRingGeometry", pm)) : n.from === "ring" ? (ce(), de("TresRingGeometry", mm)) : n.from === "rect" ? (ce(), de("TresPlaneGeometry", gm)) : (ce(), Cr(e.from, {
|
|
16618
16619
|
key: 3,
|
|
16619
16620
|
args: e
|
|
16620
16621
|
})),
|
|
@@ -16639,27 +16640,27 @@ const g0 = /* @__PURE__ */ me({
|
|
|
16639
16640
|
receiveShadow: { type: Boolean, default: !1 }
|
|
16640
16641
|
},
|
|
16641
16642
|
setup(o, { expose: e }) {
|
|
16642
|
-
const t = o, n = (c) => c === 0 ? 0 : 2 ** (10 * c - 10), { floor: s, segments: i, receiveShadow: r } = De(t), a =
|
|
16643
|
+
const t = o, n = (c) => c === 0 ? 0 : 2 ** (10 * c - 10), { floor: s, segments: i, receiveShadow: r } = De(t), a = fe(null);
|
|
16643
16644
|
ee(
|
|
16644
16645
|
() => [i.value, s.value, a.value],
|
|
16645
|
-
([c,
|
|
16646
|
-
if (!
|
|
16646
|
+
([c, h, u]) => {
|
|
16647
|
+
if (!u || c === null)
|
|
16647
16648
|
return;
|
|
16648
16649
|
let m = 0;
|
|
16649
|
-
const f = c / c / 2, g =
|
|
16650
|
+
const f = c / c / 2, g = u.attributes.position;
|
|
16650
16651
|
for (let p = 0; p < c + 1; p++)
|
|
16651
16652
|
for (let v = 0; v < c + 1; v++)
|
|
16652
16653
|
g.setXYZ(
|
|
16653
16654
|
m++,
|
|
16654
|
-
p / c - f + (p === 0 ? -
|
|
16655
|
+
p / c - f + (p === 0 ? -h : 0),
|
|
16655
16656
|
v / c - f,
|
|
16656
16657
|
n(p / c)
|
|
16657
16658
|
);
|
|
16658
|
-
g.needsUpdate = !0,
|
|
16659
|
+
g.needsUpdate = !0, u.computeVertexNormals();
|
|
16659
16660
|
}
|
|
16660
16661
|
);
|
|
16661
16662
|
const l = ve();
|
|
16662
|
-
return e({ instance: l }), (c,
|
|
16663
|
+
return e({ instance: l }), (c, h) => (ce(), de("TresGroup", je({
|
|
16663
16664
|
ref_key: "backdropRef",
|
|
16664
16665
|
ref: l
|
|
16665
16666
|
}, c.$attrs), [
|
|
@@ -16762,26 +16763,26 @@ const g0 = /* @__PURE__ */ me({
|
|
|
16762
16763
|
`;
|
|
16763
16764
|
};
|
|
16764
16765
|
}
|
|
16765
|
-
const { onBeforeRender: c } = Ke(),
|
|
16766
|
-
let
|
|
16767
|
-
const m = () =>
|
|
16766
|
+
const { onBeforeRender: c } = Ke(), h = i(t);
|
|
16767
|
+
let u = 0;
|
|
16768
|
+
const m = () => u = u >= t.frames ? t.frames - 1 : u;
|
|
16768
16769
|
return c(
|
|
16769
16770
|
({ renderer: f, scene: g, invalidate: p }) => {
|
|
16770
|
-
|
|
16771
|
+
u < t.frames && (u++, s(t, g, f, h), p());
|
|
16771
16772
|
}
|
|
16772
16773
|
), ee(() => [t.opacity, t.depthWrite, t.blur, t.smooth], () => {
|
|
16773
|
-
|
|
16774
|
+
h.plane.material.opacity = t.opacity ?? 1, h.plane.material.depthWrite = t.depthWrite ?? !1, m();
|
|
16774
16775
|
}, { immediate: !0 }), ee(() => [t.color, t.tint], () => {
|
|
16775
|
-
l(t,
|
|
16776
|
+
l(t, h), m();
|
|
16776
16777
|
}, { immediate: !0 }), ee(() => [t.resolution], () => {
|
|
16777
|
-
a(t.resolution,
|
|
16778
|
+
a(t.resolution, h), m();
|
|
16778
16779
|
}), ee(() => [t.width, t.height, t.scale, t.far], () => {
|
|
16779
|
-
r(t,
|
|
16780
|
+
r(t, h), m();
|
|
16780
16781
|
}, { immediate: !0 }), rt(() => {
|
|
16781
|
-
for (const f of Object.values(
|
|
16782
|
+
for (const f of Object.values(h))
|
|
16782
16783
|
f && "dispose" in f && typeof f.dispose == "function" && f.dispose();
|
|
16783
|
-
}), e({ instance:
|
|
16784
|
-
object: U(
|
|
16784
|
+
}), e({ instance: h.shadowGroup }), (f, g) => (ce(), de("primitive", {
|
|
16785
|
+
object: U(h).shadowGroup
|
|
16785
16786
|
}, null, 8, wm));
|
|
16786
16787
|
}
|
|
16787
16788
|
}), x0 = /* @__PURE__ */ me({
|
|
@@ -16792,12 +16793,12 @@ const g0 = /* @__PURE__ */ me({
|
|
|
16792
16793
|
},
|
|
16793
16794
|
setup(o, { expose: e }) {
|
|
16794
16795
|
const t = o, { invalidate: n } = ye(), s = ve(new Mn()), i = ve(new Mn());
|
|
16795
|
-
function r(c,
|
|
16796
|
+
function r(c, h) {
|
|
16796
16797
|
if (s.value.position.set(0, 0, 0), s.value.updateMatrixWorld(), i.value.scale.set(1, 1, 1), i.value.updateMatrixWorld(), !i.value.children.length || c === null)
|
|
16797
16798
|
return;
|
|
16798
|
-
const { box3:
|
|
16799
|
-
i.value.children.forEach((w) => f.expandByObject(w,
|
|
16800
|
-
const g = f.getSize(new $()), p =
|
|
16799
|
+
const { box3: u, use: m } = a(c, h), f = new Et();
|
|
16800
|
+
i.value.children.forEach((w) => f.expandByObject(w, h));
|
|
16801
|
+
const g = f.getSize(new $()), p = u.getSize(new $()), v = Math.min(
|
|
16801
16802
|
p.x / g.x,
|
|
16802
16803
|
p.y / g.y,
|
|
16803
16804
|
p.z / g.z
|
|
@@ -16805,14 +16806,14 @@ const g0 = /* @__PURE__ */ me({
|
|
|
16805
16806
|
i.value.scale.setScalar(v === Number.POSITIVE_INFINITY ? 1 : v), i.value.updateMatrixWorld();
|
|
16806
16807
|
const d = s.value.worldToLocal(f.getCenter(new $()));
|
|
16807
16808
|
if (m.position) {
|
|
16808
|
-
const w = s.value.worldToLocal(
|
|
16809
|
+
const w = s.value.worldToLocal(u.getCenter(new $()));
|
|
16809
16810
|
s.value.position.copy(w.sub(d.multiplyScalar(v)));
|
|
16810
16811
|
} else
|
|
16811
16812
|
s.value.position.copy(d.sub(d.multiplyScalar(v)));
|
|
16812
16813
|
n();
|
|
16813
16814
|
}
|
|
16814
|
-
function a(c,
|
|
16815
|
-
return typeof c == "number" ? c = new $(c, c, c) : Array.isArray(c) && (c = new $(...c)), c && "isVector3" in c && c.isVector3 ? { box3: new Et(new $(0, 0, 0), c), use: { position: !1 } } : c && "isBox3" in c && c.isBox3 ? { box3: c, use: { position: !0 } } : c && "isObject3D" in c && c.isObject3D ? { box3: new Et().setFromObject(c,
|
|
16815
|
+
function a(c, h) {
|
|
16816
|
+
return typeof c == "number" ? c = new $(c, c, c) : Array.isArray(c) && (c = new $(...c)), c && "isVector3" in c && c.isVector3 ? { box3: new Et(new $(0, 0, 0), c), use: { position: !1 } } : c && "isBox3" in c && c.isBox3 ? { box3: c, use: { position: !0 } } : c && "isObject3D" in c && c.isObject3D ? { box3: new Et().setFromObject(c, h ?? !1), use: { position: !0 } } : {
|
|
16816
16817
|
box3: new Et(new $(-0.5, -0.5, -0.5), new $(0.5, 0.5, 0.5)),
|
|
16817
16818
|
use: { position: !0 }
|
|
16818
16819
|
};
|
|
@@ -16825,11 +16826,11 @@ const g0 = /* @__PURE__ */ me({
|
|
|
16825
16826
|
const l = ve();
|
|
16826
16827
|
return e({
|
|
16827
16828
|
instance: l,
|
|
16828
|
-
fit: (c = new Et(new $(-0.5, -0.5, -0.5), new $(0.5, 0.5, 0.5)),
|
|
16829
|
-
r(c,
|
|
16829
|
+
fit: (c = new Et(new $(-0.5, -0.5, -0.5), new $(0.5, 0.5, 0.5)), h = !1) => {
|
|
16830
|
+
r(c, h);
|
|
16830
16831
|
},
|
|
16831
16832
|
update: () => r(t.into, t.precise)
|
|
16832
|
-
}), (c,
|
|
16833
|
+
}), (c, h) => (ce(), de("TresGroup", {
|
|
16833
16834
|
ref_key: "outer",
|
|
16834
16835
|
ref: l
|
|
16835
16836
|
}, [
|
|
@@ -16872,8 +16873,8 @@ const g0 = /* @__PURE__ */ me({
|
|
|
16872
16873
|
map: a,
|
|
16873
16874
|
opacity: l,
|
|
16874
16875
|
alphaTest: c,
|
|
16875
|
-
depthWrite:
|
|
16876
|
-
transparent:
|
|
16876
|
+
depthWrite: h,
|
|
16877
|
+
transparent: u,
|
|
16877
16878
|
sizeAttenuation: m,
|
|
16878
16879
|
count: f,
|
|
16879
16880
|
speed: g,
|
|
@@ -16907,7 +16908,7 @@ const g0 = /* @__PURE__ */ me({
|
|
|
16907
16908
|
}
|
|
16908
16909
|
});
|
|
16909
16910
|
const T = ve();
|
|
16910
|
-
return e({ instance: T }), (b, x) => (ce(),
|
|
16911
|
+
return e({ instance: T }), (b, x) => (ce(), de("TresPoints", {
|
|
16911
16912
|
ref_key: "pointsRef",
|
|
16912
16913
|
ref: T
|
|
16913
16914
|
}, [
|
|
@@ -16918,8 +16919,8 @@ const g0 = /* @__PURE__ */ me({
|
|
|
16918
16919
|
map: U(a),
|
|
16919
16920
|
opacity: U(l),
|
|
16920
16921
|
"alpha-test": U(c),
|
|
16921
|
-
"depth-write": U(
|
|
16922
|
-
transparent: U(
|
|
16922
|
+
"depth-write": U(h),
|
|
16923
|
+
transparent: U(u),
|
|
16923
16924
|
"size-attenuation": U(m)
|
|
16924
16925
|
}, null, 8, Tm),
|
|
16925
16926
|
_e("TresBufferGeometry", {
|
|
@@ -16948,13 +16949,13 @@ const g0 = /* @__PURE__ */ me({
|
|
|
16948
16949
|
() => a(t.azimuth, t.elevation)
|
|
16949
16950
|
);
|
|
16950
16951
|
function a(l, c) {
|
|
16951
|
-
const
|
|
16952
|
-
return new $().setFromSphericalCoords(1,
|
|
16952
|
+
const h = Ze.degToRad(90 - c), u = Ze.degToRad(l);
|
|
16953
|
+
return new $().setFromSphericalCoords(1, h, u);
|
|
16953
16954
|
}
|
|
16954
16955
|
return e({
|
|
16955
16956
|
instance: s,
|
|
16956
16957
|
sunPosition: r.value
|
|
16957
|
-
}), (l, c) => (ce(),
|
|
16958
|
+
}), (l, c) => (ce(), de("primitive", {
|
|
16958
16959
|
ref_key: "skyRef",
|
|
16959
16960
|
ref: s,
|
|
16960
16961
|
object: U(i),
|
|
@@ -16980,7 +16981,7 @@ const g0 = /* @__PURE__ */ me({
|
|
|
16980
16981
|
},
|
|
16981
16982
|
async setup(o, { expose: e }) {
|
|
16982
16983
|
let t, n;
|
|
16983
|
-
const s = o, { width: i, depth: r, segments: a, texture: l, color: c, depthTest:
|
|
16984
|
+
const s = o, { width: i, depth: r, segments: a, texture: l, color: c, depthTest: h, opacity: u, speed: m } = De(s), f = ve(), g = ve();
|
|
16984
16985
|
e({
|
|
16985
16986
|
instance: f
|
|
16986
16987
|
});
|
|
@@ -16990,7 +16991,7 @@ const g0 = /* @__PURE__ */ me({
|
|
|
16990
16991
|
scale: 0.4 + Math.sin((b + 1) / a.value * Math.PI) * ((0.2 + Math.random()) * 10),
|
|
16991
16992
|
density: Math.max(0.2, Math.random()),
|
|
16992
16993
|
rotation: Math.max(2e-3, 5e-3 * Math.random()) * m.value
|
|
16993
|
-
})), v = (T, b) => T / 6 * b *
|
|
16994
|
+
})), v = (T, b) => T / 6 * b * u.value, { map: d } = ([t, n] = An(() => ci({ map: l.value })), t = await t, n(), t), { renderer: w, camera: y } = ye(), E = Fe(() => {
|
|
16994
16995
|
var T;
|
|
16995
16996
|
return (T = w.value) == null ? void 0 : T.outputColorSpace;
|
|
16996
16997
|
}), { onBeforeRender: P } = Ke();
|
|
@@ -16999,7 +17000,7 @@ const g0 = /* @__PURE__ */ me({
|
|
|
16999
17000
|
f.value && y.value && g.value && ((b = g.value) == null || b.children.forEach((M, _) => {
|
|
17000
17001
|
M.rotation.z += p[_].rotation;
|
|
17001
17002
|
}), f.value.lookAt((x = y.value) == null ? void 0 : x.position), T());
|
|
17002
|
-
}), (T, b) => (ce(),
|
|
17003
|
+
}), (T, b) => (ce(), de("TresGroup", je({
|
|
17003
17004
|
ref_key: "smokeRef",
|
|
17004
17005
|
ref: f
|
|
17005
17006
|
}, T.$attrs), [
|
|
@@ -17008,7 +17009,7 @@ const g0 = /* @__PURE__ */ me({
|
|
|
17008
17009
|
ref: g,
|
|
17009
17010
|
position: [0, 0, U(a) / 2 * U(r)]
|
|
17010
17011
|
}, [
|
|
17011
|
-
(ce(!0),
|
|
17012
|
+
(ce(!0), de(Pa, null, Ca(U(p), ({ scale: x, x: M, y: _, density: C }, R) => (ce(), de("TresMesh", {
|
|
17012
17013
|
key: `${R}`,
|
|
17013
17014
|
position: [M, _, -R * U(r)]
|
|
17014
17015
|
}, [
|
|
@@ -17018,7 +17019,7 @@ const g0 = /* @__PURE__ */ me({
|
|
|
17018
17019
|
}, null, 8, Am),
|
|
17019
17020
|
_e("TresMeshStandardMaterial", {
|
|
17020
17021
|
map: U(d),
|
|
17021
|
-
"depth-test": U(
|
|
17022
|
+
"depth-test": U(h),
|
|
17022
17023
|
"color-space": E.value,
|
|
17023
17024
|
color: U(c),
|
|
17024
17025
|
"depth-write": !1,
|
|
@@ -17071,9 +17072,9 @@ function Gr(o, e) {
|
|
|
17071
17072
|
return [[0, t(o)]];
|
|
17072
17073
|
if (r(o)) {
|
|
17073
17074
|
const l = o.length > 1 ? 1 / (o.length - 1) : 1;
|
|
17074
|
-
return o.map((c,
|
|
17075
|
+
return o.map((c, h) => [l * h, t(c)]);
|
|
17075
17076
|
} else if (a(o))
|
|
17076
|
-
return o.map(([l, c],
|
|
17077
|
+
return o.map(([l, c], h) => [l, t(c)]);
|
|
17077
17078
|
return [[0, n()]];
|
|
17078
17079
|
}
|
|
17079
17080
|
class Om {
|
|
@@ -17413,21 +17414,21 @@ const jm = ["object"], E0 = /* @__PURE__ */ me({
|
|
|
17413
17414
|
#include <tonemapping_fragment>
|
|
17414
17415
|
#include <${n >= 154 ? "colorspace_fragment" : "encodings_fragment"}>
|
|
17415
17416
|
}`
|
|
17416
|
-
}, c = new Lt(l),
|
|
17417
|
+
}, c = new Lt(l), h = new ya(void 0, c), u = c.uniforms, m = { immediate: !0 };
|
|
17417
17418
|
[
|
|
17418
|
-
[
|
|
17419
|
-
[
|
|
17420
|
-
[
|
|
17421
|
-
[
|
|
17422
|
-
[
|
|
17423
|
-
[
|
|
17424
|
-
[
|
|
17425
|
-
[
|
|
17426
|
-
[
|
|
17427
|
-
[
|
|
17428
|
-
[
|
|
17429
|
-
[
|
|
17430
|
-
[
|
|
17419
|
+
[u.uPixelRatio, ye().sizes.aspectRatio],
|
|
17420
|
+
[u.uSize, s.size],
|
|
17421
|
+
[u.uNormalThreshold, s.normalThreshold],
|
|
17422
|
+
[u.uAlpha, s.alpha],
|
|
17423
|
+
[u.uOffset, s.offset],
|
|
17424
|
+
[u.uOffsetNoise, s.offsetNoise],
|
|
17425
|
+
[u.uMixColor, s.mixColor],
|
|
17426
|
+
[u.uMixAlpha, s.mixAlpha],
|
|
17427
|
+
[u.uMixOffset, s.mixOffset],
|
|
17428
|
+
[u.uMixSize, s.mixSize],
|
|
17429
|
+
[u.uMixSurfaceDistance, s.mixSurfaceDistance],
|
|
17430
|
+
[u.uMixNoise, s.mixNoise],
|
|
17431
|
+
[u.uInfoTexture, r]
|
|
17431
17432
|
].forEach(
|
|
17432
17433
|
([y, E]) => ee(
|
|
17433
17434
|
E,
|
|
@@ -17437,15 +17438,15 @@ const jm = ["object"], E0 = /* @__PURE__ */ me({
|
|
|
17437
17438
|
m
|
|
17438
17439
|
)
|
|
17439
17440
|
), ee([s.noiseScale, s.lifetimeSec], () => {
|
|
17440
|
-
|
|
17441
|
+
u.uNoiseScale.value = s.noiseScale.value * s.lifetimeSec.value;
|
|
17441
17442
|
}, m), ee([s.lifetimeSec, s.cooldownSec], () => {
|
|
17442
|
-
|
|
17443
|
+
u.uCooldownRatio.value = s.cooldownSec.value / s.lifetimeSec.value;
|
|
17443
17444
|
}, m), ee(s.map, () => {
|
|
17444
17445
|
typeof s.map.value == "string" ? ci([s.map.value]).then((y) => c.uniforms.uMap.value = y) : c.uniforms.uMap.value = s.map.value;
|
|
17445
17446
|
});
|
|
17446
17447
|
const g = new ze(), p = new $();
|
|
17447
17448
|
Ke().onBeforeRender(({ elapsed: y, invalidate: E }) => {
|
|
17448
|
-
|
|
17449
|
+
h.getWorldQuaternion(g), p.copy(t.directionalLight ? t.directionalLight.position : At.DEFAULT_UP).normalize(), p.applyQuaternion(g.invert()), c.uniforms.uNormal.value = p, c.uniforms.uTime.value = y / (t.cooldownSec + t.lifetimeSec), E();
|
|
17449
17450
|
});
|
|
17450
17451
|
function v(y) {
|
|
17451
17452
|
return y && "isObject3D" in y;
|
|
@@ -17454,16 +17455,16 @@ const jm = ["object"], E0 = /* @__PURE__ */ me({
|
|
|
17454
17455
|
return y && "isBufferGeometry" in y;
|
|
17455
17456
|
}
|
|
17456
17457
|
zn(() => {
|
|
17457
|
-
t.geometry ? d(t.geometry) ?
|
|
17458
|
+
t.geometry ? d(t.geometry) ? h.geometry.copy(t.geometry) : v(t.geometry) && "geometry" in t.geometry && d(t.geometry.geometry) && h.geometry.copy(t.geometry.geometry) : v(h.parent) && "geometry" in h.parent && d(h.parent.geometry) ? h.geometry.copy(h.parent.geometry) : h.geometry = new hc(1, 16), typeof t.map == "string" && ci([t.map]).then((y) => c.uniforms.uMap.value = y);
|
|
17458
17459
|
}), rt(() => {
|
|
17459
17460
|
var y;
|
|
17460
17461
|
(y = c.uniforms.uMap.value) == null || y.dispose(), r.value.dispose(), c.dispose();
|
|
17461
17462
|
});
|
|
17462
17463
|
const w = ve();
|
|
17463
|
-
return e({ instance:
|
|
17464
|
+
return e({ instance: h }), (y, E) => (ce(), de("primitive", {
|
|
17464
17465
|
ref_key: "sparkleRef",
|
|
17465
17466
|
ref: w,
|
|
17466
|
-
object: U(
|
|
17467
|
+
object: U(h)
|
|
17467
17468
|
}, null, 8, jm));
|
|
17468
17469
|
}
|
|
17469
17470
|
}), Vm = ["position", "a-scale"], Ym = ["size", "size-attenuation", "transparent", "alpha-test", "alpha-map"], M0 = /* @__PURE__ */ me({
|
|
@@ -17479,7 +17480,7 @@ const jm = ["object"], E0 = /* @__PURE__ */ me({
|
|
|
17479
17480
|
alphaMap: { default: null }
|
|
17480
17481
|
},
|
|
17481
17482
|
setup(o, { expose: e }) {
|
|
17482
|
-
const t = o, n =
|
|
17483
|
+
const t = o, n = fe(), s = fe(), { radius: i, depth: r, count: a, size: l, sizeAttenuation: c, transparent: h, alphaMap: u, alphaTest: m } = De(t), { invalidate: f } = ye();
|
|
17483
17484
|
ee(t, () => {
|
|
17484
17485
|
f();
|
|
17485
17486
|
});
|
|
@@ -17499,7 +17500,7 @@ const jm = ["object"], E0 = /* @__PURE__ */ me({
|
|
|
17499
17500
|
const p = ve();
|
|
17500
17501
|
return e({
|
|
17501
17502
|
instance: p
|
|
17502
|
-
}), (v, d) => (ce(),
|
|
17503
|
+
}), (v, d) => (ce(), de("TresPoints", {
|
|
17503
17504
|
ref_key: "starsRef",
|
|
17504
17505
|
ref: p
|
|
17505
17506
|
}, [
|
|
@@ -17510,9 +17511,9 @@ const jm = ["object"], E0 = /* @__PURE__ */ me({
|
|
|
17510
17511
|
_e("TresPointsMaterial", {
|
|
17511
17512
|
size: U(l),
|
|
17512
17513
|
"size-attenuation": U(c),
|
|
17513
|
-
transparent: U(
|
|
17514
|
+
transparent: U(h),
|
|
17514
17515
|
"alpha-test": U(m),
|
|
17515
|
-
"alpha-map": U(
|
|
17516
|
+
"alpha-map": U(u)
|
|
17516
17517
|
}, null, 8, Ym)
|
|
17517
17518
|
], 512));
|
|
17518
17519
|
}
|
|
@@ -17533,7 +17534,7 @@ const jm = ["object"], E0 = /* @__PURE__ */ me({
|
|
|
17533
17534
|
},
|
|
17534
17535
|
async setup(o, { expose: e }) {
|
|
17535
17536
|
let t, n;
|
|
17536
|
-
const s = o, { textureWidth: i, textureHeight: r, waterNormals: a, sunDirection: l, sunColor: c, waterColor:
|
|
17537
|
+
const s = o, { textureWidth: i, textureHeight: r, waterNormals: a, sunDirection: l, sunColor: c, waterColor: h, distortionScale: u, size: m, clipBias: f, alpha: g, side: p } = De(s), { extend: v, scene: d } = ye();
|
|
17537
17538
|
v({ Water: ru });
|
|
17538
17539
|
const w = ve(), y = ve(), E = d.value.fog !== void 0;
|
|
17539
17540
|
e({
|
|
@@ -17551,7 +17552,7 @@ const jm = ["object"], E0 = /* @__PURE__ */ me({
|
|
|
17551
17552
|
const { onBeforeRender: T } = Ke();
|
|
17552
17553
|
return T(({ delta: b, invalidate: x }) => {
|
|
17553
17554
|
w.value.material.uniforms.time.value += b, x();
|
|
17554
|
-
}), (b, x) => (ce(),
|
|
17555
|
+
}), (b, x) => (ce(), de("TresWater", {
|
|
17555
17556
|
ref_key: "waterRef",
|
|
17556
17557
|
ref: w,
|
|
17557
17558
|
"rotation-x": -Math.PI / 2,
|
|
@@ -17561,8 +17562,8 @@ const jm = ["object"], E0 = /* @__PURE__ */ me({
|
|
|
17561
17562
|
waterNormals: U(P),
|
|
17562
17563
|
sunDirection: U(l),
|
|
17563
17564
|
sunColor: U(c),
|
|
17564
|
-
waterColor: U(
|
|
17565
|
-
distortionScale: U(
|
|
17565
|
+
waterColor: U(h),
|
|
17566
|
+
distortionScale: U(u),
|
|
17566
17567
|
fog: E,
|
|
17567
17568
|
size: U(m),
|
|
17568
17569
|
clipBias: U(f),
|
|
@@ -17593,14 +17594,14 @@ var _l = { exports: {} };
|
|
|
17593
17594
|
r.style.cssText = "position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000", r.addEventListener("click", function(f) {
|
|
17594
17595
|
f.preventDefault(), s(++i % r.children.length);
|
|
17595
17596
|
}, !1);
|
|
17596
|
-
var a = (performance || Date).now(), l = a, c = 0,
|
|
17597
|
+
var a = (performance || Date).now(), l = a, c = 0, h = n(new t.Panel("FPS", "#0ff", "#002")), u = n(new t.Panel("MS", "#0f0", "#020"));
|
|
17597
17598
|
if (self.performance && self.performance.memory) var m = n(new t.Panel("MB", "#f08", "#201"));
|
|
17598
17599
|
return s(0), { REVISION: 16, dom: r, addPanel: n, showPanel: s, begin: function() {
|
|
17599
17600
|
a = (performance || Date).now();
|
|
17600
17601
|
}, end: function() {
|
|
17601
17602
|
c++;
|
|
17602
17603
|
var f = (performance || Date).now();
|
|
17603
|
-
if (
|
|
17604
|
+
if (u.update(f - a, 200), f > l + 1e3 && (h.update(1e3 * c / (f - l), 100), l = f, c = 0, m)) {
|
|
17604
17605
|
var g = performance.memory;
|
|
17605
17606
|
m.update(g.usedJSHeapSize / 1048576, g.jsHeapSizeLimit / 1048576);
|
|
17606
17607
|
}
|
|
@@ -17610,11 +17611,11 @@ var _l = { exports: {} };
|
|
|
17610
17611
|
}, domElement: r, setMode: s };
|
|
17611
17612
|
};
|
|
17612
17613
|
return t.Panel = function(n, s, i) {
|
|
17613
|
-
var r = 1 / 0, a = 0, l = Math.round, c = l(window.devicePixelRatio || 1),
|
|
17614
|
-
w.width =
|
|
17614
|
+
var r = 1 / 0, a = 0, l = Math.round, c = l(window.devicePixelRatio || 1), h = 80 * c, u = 48 * c, m = 3 * c, f = 2 * c, g = 3 * c, p = 15 * c, v = 74 * c, d = 30 * c, w = document.createElement("canvas");
|
|
17615
|
+
w.width = h, w.height = u, w.style.cssText = "width:80px;height:48px";
|
|
17615
17616
|
var y = w.getContext("2d");
|
|
17616
|
-
return y.font = "bold " + 9 * c + "px Helvetica,Arial,sans-serif", y.textBaseline = "top", y.fillStyle = i, y.fillRect(0, 0,
|
|
17617
|
-
r = Math.min(r, E), a = Math.max(a, E), y.fillStyle = i, y.globalAlpha = 1, y.fillRect(0, 0,
|
|
17617
|
+
return y.font = "bold " + 9 * c + "px Helvetica,Arial,sans-serif", y.textBaseline = "top", y.fillStyle = i, y.fillRect(0, 0, h, u), y.fillStyle = s, y.fillText(n, m, f), y.fillRect(g, p, v, d), y.fillStyle = i, y.globalAlpha = 0.9, y.fillRect(g, p, v, d), { dom: w, update: function(E, P) {
|
|
17618
|
+
r = Math.min(r, E), a = Math.max(a, E), y.fillStyle = i, y.globalAlpha = 1, y.fillRect(0, 0, h, p), y.fillStyle = s, y.fillText(l(E) + " " + n + " (" + l(r) + "-" + l(a) + ")", m, f), y.drawImage(w, g + c, p, v - c, d, g, p, v - c, d), y.fillRect(g + v - c, p, c, d), y.fillStyle = i, y.globalAlpha = 0.9, y.fillRect(g + v - c, p, c, l((1 - E / P) * d));
|
|
17618
17619
|
} };
|
|
17619
17620
|
}, t;
|
|
17620
17621
|
});
|
|
@@ -17901,10 +17902,10 @@ const rg = /* @__PURE__ */ ((o) => (e) => wl(e, o))([1, -1, 1, 1, 1, -1, 1, 1, 1
|
|
|
17901
17902
|
},
|
|
17902
17903
|
emits: ["onOcclude"],
|
|
17903
17904
|
setup(o, { expose: e, emit: t }) {
|
|
17904
|
-
const n = o, s = t, i = Sr(), r = vc(), a =
|
|
17905
|
+
const n = o, s = t, i = Sr(), r = vc(), a = fe(), l = fe(), {
|
|
17905
17906
|
geometry: c,
|
|
17906
|
-
material:
|
|
17907
|
-
as:
|
|
17907
|
+
material: h,
|
|
17908
|
+
as: u,
|
|
17908
17909
|
transform: m,
|
|
17909
17910
|
portal: f,
|
|
17910
17911
|
wrapperClass: g,
|
|
@@ -17916,7 +17917,7 @@ const rg = /* @__PURE__ */ ((o) => (e) => wl(e, o))([1, -1, 1, 1, 1, -1, 1, 1, 1
|
|
|
17916
17917
|
sprite: E,
|
|
17917
17918
|
occlude: P,
|
|
17918
17919
|
zIndexRange: T
|
|
17919
|
-
} = De(n), { renderer: b, scene: x, camera: M, raycaster: _, sizes: C } = ye(), R = Fe(() => document.createElement(
|
|
17920
|
+
} = De(n), { renderer: b, scene: x, camera: M, raycaster: _, sizes: C } = ye(), R = Fe(() => document.createElement(u.value)), B = fe([0, 0]), N = fe(0), j = fe(), V = Fe(() => m.value ? {
|
|
17920
17921
|
position: "absolute",
|
|
17921
17922
|
top: 0,
|
|
17922
17923
|
left: 0,
|
|
@@ -17941,7 +17942,7 @@ const rg = /* @__PURE__ */ ((o) => (e) => wl(e, o))([1, -1, 1, 1, 1, -1, 1, 1, 1
|
|
|
17941
17942
|
}), Q = Fe(() => ({
|
|
17942
17943
|
position: "absolute",
|
|
17943
17944
|
pointerEvents: y.value
|
|
17944
|
-
})), Z =
|
|
17945
|
+
})), Z = fe(null), ne = fe(!1), te = Fe(
|
|
17945
17946
|
() => (P == null ? void 0 : P.value) && (P == null ? void 0 : P.value) !== "blending" || Array.isArray(P == null ? void 0 : P.value) && (P == null ? void 0 : P.value.length) && li(P.value[0])
|
|
17946
17947
|
);
|
|
17947
17948
|
ee(
|
|
@@ -17986,7 +17987,7 @@ const rg = /* @__PURE__ */ ((o) => (e) => wl(e, o))([1, -1, 1, 1, 1, -1, 1, 1, 1
|
|
|
17986
17987
|
), Pt(() => {
|
|
17987
17988
|
g != null && g.value && (R.value.className = g.value);
|
|
17988
17989
|
});
|
|
17989
|
-
const le =
|
|
17990
|
+
const le = fe(!0), { onBeforeRender: ae } = Ke();
|
|
17990
17991
|
ae(({ invalidate: k }) => {
|
|
17991
17992
|
var D, O, z, S, A, L, X;
|
|
17992
17993
|
if (k(), a.value && M.value && b.value) {
|
|
@@ -18058,7 +18059,7 @@ const rg = /* @__PURE__ */ ((o) => (e) => wl(e, o))([1, -1, 1, 1, 1, -1, 1, 1, 1
|
|
|
18058
18059
|
fragmentShader: Jm
|
|
18059
18060
|
})), I = Fe(() => {
|
|
18060
18061
|
const k = Te.value;
|
|
18061
|
-
return
|
|
18062
|
+
return h.value || new Lt({
|
|
18062
18063
|
vertexShader: k.vertexShader,
|
|
18063
18064
|
fragmentShader: k.fragmentShader,
|
|
18064
18065
|
side: tn
|
|
@@ -18066,11 +18067,11 @@ const rg = /* @__PURE__ */ ((o) => (e) => wl(e, o))([1, -1, 1, 1, 1, -1, 1, 1, 1
|
|
|
18066
18067
|
});
|
|
18067
18068
|
return rt(() => {
|
|
18068
18069
|
I.value && I.value.dispose(), R.value.remove();
|
|
18069
|
-
}), e({ instance: a }), (k, D) => (ce(),
|
|
18070
|
+
}), e({ instance: a }), (k, D) => (ce(), de("TresGroup", {
|
|
18070
18071
|
ref_key: "groupRef",
|
|
18071
18072
|
ref: a
|
|
18072
18073
|
}, [
|
|
18073
|
-
U(P) && !te.value ? (ce(),
|
|
18074
|
+
U(P) && !te.value ? (ce(), de("TresMesh", {
|
|
18074
18075
|
key: 0,
|
|
18075
18076
|
ref_key: "meshRef",
|
|
18076
18077
|
ref: l,
|