softbox 4.18.0 → 4.19.0
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/{ThreePathTracingService-B1WEEKgQ.cjs → ThreePathTracingService-CMw8SvGp.cjs} +51 -51
- package/dist/{ThreePathTracingService-qV8I_V9u.js → ThreePathTracingService-Dze7maGx.js} +415 -415
- package/dist/index.d.cts +13 -0
- package/dist/index.d.ts +13 -0
- package/dist/simple-viewer.cjs +3 -3
- package/dist/simple-viewer.es.js +1923 -1904
- package/dist/unwrap-CuSMMFPQ.cjs +2 -0
- package/dist/{ContactShadowBaker-MzqtJ-0h.js → unwrap-DdgS2iXe.js} +244 -209
- package/package.json +7 -3
- package/dist/ContactShadowBaker-lWQW97Cr.cjs +0 -2
|
@@ -18,7 +18,7 @@ var x = class e extends Error {
|
|
|
18
18
|
return new e(i, n, a);
|
|
19
19
|
}
|
|
20
20
|
}, S = /* @__PURE__ */ function(e) {
|
|
21
|
-
return e.SCENE_INIT_FAILED = "SCENE_INIT_FAILED", e.RENDERER_INIT_FAILED = "RENDERER_INIT_FAILED", e.RENDERER_NOT_INITIALIZED = "RENDERER_NOT_INITIALIZED", e.CAMERA_INIT_FAILED = "CAMERA_INIT_FAILED", e.WEBGL_NOT_SUPPORTED = "WEBGL_NOT_SUPPORTED", e.INITIALIZATION_FAILED = "INITIALIZATION_FAILED", e.PATH_TRACING_INIT_FAILED = "PATH_TRACING_INIT_FAILED", e.MODEL_LOAD_FAILED = "MODEL_LOAD_FAILED", e.TEXTURE_LOAD_FAILED = "TEXTURE_LOAD_FAILED", e.RESOURCE_NOT_FOUND = "RESOURCE_NOT_FOUND", e.UNSUPPORTED_FORMAT = "UNSUPPORTED_FORMAT", e.INVALID_CONFIGURATION = "INVALID_CONFIGURATION", e.RENDER_ERROR = "RENDER_ERROR", e.RENDER_FAILED = "RENDER_FAILED", e.SCENE_OPERATION_FAILED = "SCENE_OPERATION_FAILED", e.COMPONENT_NOT_MOUNTED = "COMPONENT_NOT_MOUNTED", e.INVALID_STATE = "INVALID_STATE", e.INVALID_PARAMETER = "INVALID_PARAMETER", e.OPERATION_FAILED = "OPERATION_FAILED", e.UNKNOWN = "UNKNOWN", e;
|
|
21
|
+
return e.SCENE_INIT_FAILED = "SCENE_INIT_FAILED", e.RENDERER_INIT_FAILED = "RENDERER_INIT_FAILED", e.RENDERER_NOT_INITIALIZED = "RENDERER_NOT_INITIALIZED", e.CAMERA_INIT_FAILED = "CAMERA_INIT_FAILED", e.WEBGL_NOT_SUPPORTED = "WEBGL_NOT_SUPPORTED", e.INITIALIZATION_FAILED = "INITIALIZATION_FAILED", e.PATH_TRACING_INIT_FAILED = "PATH_TRACING_INIT_FAILED", e.MODEL_LOAD_FAILED = "MODEL_LOAD_FAILED", e.TEXTURE_LOAD_FAILED = "TEXTURE_LOAD_FAILED", e.RESOURCE_NOT_FOUND = "RESOURCE_NOT_FOUND", e.UNSUPPORTED_FORMAT = "UNSUPPORTED_FORMAT", e.INVALID_CONFIGURATION = "INVALID_CONFIGURATION", e.RENDER_ERROR = "RENDER_ERROR", e.RENDER_FAILED = "RENDER_FAILED", e.SCENE_OPERATION_FAILED = "SCENE_OPERATION_FAILED", e.COMPONENT_NOT_MOUNTED = "COMPONENT_NOT_MOUNTED", e.INVALID_STATE = "INVALID_STATE", e.INVALID_PARAMETER = "INVALID_PARAMETER", e.OPERATION_FAILED = "OPERATION_FAILED", e.POST_PROCESSING_FAILED = "POST_PROCESSING_FAILED", e.UNKNOWN = "UNKNOWN", e;
|
|
22
22
|
}({}), C = {
|
|
23
23
|
ok(e) {
|
|
24
24
|
return {
|
|
@@ -409,21 +409,21 @@ function Ne(e, t, n, r, i = null, a = 0, o = 0) {
|
|
|
409
409
|
}
|
|
410
410
|
//#endregion
|
|
411
411
|
//#region node_modules/three-mesh-bvh/src/core/cast/bvhcast.js
|
|
412
|
-
var Pe = /* @__PURE__ */ new L.constructor(), Fe = /* @__PURE__ */ new L.constructor(), z = /* @__PURE__ */ new Oe(() => new r()),
|
|
413
|
-
function
|
|
414
|
-
if (
|
|
415
|
-
|
|
412
|
+
var Pe = /* @__PURE__ */ new L.constructor(), Fe = /* @__PURE__ */ new L.constructor(), z = /* @__PURE__ */ new Oe(() => new r()), Ie = /* @__PURE__ */ new r(), Le = /* @__PURE__ */ new r(), Re = /* @__PURE__ */ new r(), ze = /* @__PURE__ */ new r(), Be = !1;
|
|
413
|
+
function Ve(e, t, n, r) {
|
|
414
|
+
if (Be) throw Error("MeshBVH: Recursive calls to bvhcast not supported.");
|
|
415
|
+
Be = !0;
|
|
416
416
|
let i = e._roots, a = t._roots, o, s = 0, c = 0, l = new d().copy(n).invert();
|
|
417
417
|
for (let e = 0, t = i.length; e < t; e++) {
|
|
418
418
|
Pe.setBuffer(i[e]), c = 0;
|
|
419
419
|
let t = z.getPrimitive();
|
|
420
420
|
O(P(0), Pe.float32Array, t), t.applyMatrix4(l);
|
|
421
|
-
for (let e = 0, i = a.length; e < i && (Fe.setBuffer(a[e]), o =
|
|
421
|
+
for (let e = 0, i = a.length; e < i && (Fe.setBuffer(a[e]), o = B(0, 0, n, l, r, s, c, 0, 0, t), Fe.clearBuffer(), c += a[e].byteLength / 32, !o); e++);
|
|
422
422
|
if (z.releasePrimitive(t), Pe.clearBuffer(), s += i[e].byteLength / 32, o) break;
|
|
423
423
|
}
|
|
424
|
-
return
|
|
424
|
+
return Be = !1, o;
|
|
425
425
|
}
|
|
426
|
-
function
|
|
426
|
+
function B(e, t, n, r, i, a = 0, o = 0, s = 0, c = 0, l = null, u = !1) {
|
|
427
427
|
let d, f;
|
|
428
428
|
u ? (d = Fe, f = Pe) : (d = Pe, f = Fe);
|
|
429
429
|
let p = d.float32Array, m = d.uint32Array, h = d.uint16Array, g = f.float32Array, _ = f.uint32Array, v = f.uint16Array, y = e * 2, b = t * 2, x = k(y, h), S = k(b, v), C = !1;
|
|
@@ -432,38 +432,38 @@ function V(e, t, n, r, i, a = 0, o = 0, s = 0, c = 0, l = null, u = !1) {
|
|
|
432
432
|
let l = z.getPrimitive();
|
|
433
433
|
O(P(t), g, l), l.applyMatrix4(n);
|
|
434
434
|
let d = M(e), f = N(e, m);
|
|
435
|
-
O(P(d), p,
|
|
436
|
-
let h = l.intersectsBox(
|
|
437
|
-
C = h &&
|
|
435
|
+
O(P(d), p, Ie), O(P(f), p, Le);
|
|
436
|
+
let h = l.intersectsBox(Ie), _ = l.intersectsBox(Le);
|
|
437
|
+
C = h && B(t, d, r, n, i, o, a, c, s + 1, l, !u) || _ && B(t, f, r, n, i, o, a, c, s + 1, l, !u), z.releasePrimitive(l);
|
|
438
438
|
} else {
|
|
439
439
|
let d = M(t), f = N(t, _);
|
|
440
|
-
O(P(d), g,
|
|
441
|
-
let h = l.intersectsBox(
|
|
442
|
-
if (h && v) C =
|
|
443
|
-
else if (h) if (x) C =
|
|
440
|
+
O(P(d), g, Re), O(P(f), g, ze);
|
|
441
|
+
let h = l.intersectsBox(Re), v = l.intersectsBox(ze);
|
|
442
|
+
if (h && v) C = B(e, d, n, r, i, a, o, s, c + 1, l, u) || B(e, f, n, r, i, a, o, s, c + 1, l, u);
|
|
443
|
+
else if (h) if (x) C = B(e, d, n, r, i, a, o, s, c + 1, l, u);
|
|
444
444
|
else {
|
|
445
445
|
let t = z.getPrimitive();
|
|
446
|
-
t.copy(
|
|
446
|
+
t.copy(Re).applyMatrix4(n);
|
|
447
447
|
let l = M(e), f = N(e, m);
|
|
448
|
-
O(P(l), p,
|
|
449
|
-
let h = t.intersectsBox(
|
|
450
|
-
C = h &&
|
|
448
|
+
O(P(l), p, Ie), O(P(f), p, Le);
|
|
449
|
+
let h = t.intersectsBox(Ie), g = t.intersectsBox(Le);
|
|
450
|
+
C = h && B(d, l, r, n, i, o, a, c, s + 1, t, !u) || g && B(d, f, r, n, i, o, a, c, s + 1, t, !u), z.releasePrimitive(t);
|
|
451
451
|
}
|
|
452
|
-
else if (v) if (x) C =
|
|
452
|
+
else if (v) if (x) C = B(e, f, n, r, i, a, o, s, c + 1, l, u);
|
|
453
453
|
else {
|
|
454
454
|
let t = z.getPrimitive();
|
|
455
|
-
t.copy(
|
|
455
|
+
t.copy(ze).applyMatrix4(n);
|
|
456
456
|
let l = M(e), d = N(e, m);
|
|
457
|
-
O(P(l), p,
|
|
458
|
-
let h = t.intersectsBox(
|
|
459
|
-
C = h &&
|
|
457
|
+
O(P(l), p, Ie), O(P(d), p, Le);
|
|
458
|
+
let h = t.intersectsBox(Ie), g = t.intersectsBox(Le);
|
|
459
|
+
C = h && B(f, l, r, n, i, o, a, c, s + 1, t, !u) || g && B(f, d, r, n, i, o, a, c, s + 1, t, !u), z.releasePrimitive(t);
|
|
460
460
|
}
|
|
461
461
|
}
|
|
462
462
|
return C;
|
|
463
463
|
}
|
|
464
464
|
//#endregion
|
|
465
465
|
//#region node_modules/three-mesh-bvh/src/core/BVHTraversalHelper.js
|
|
466
|
-
var
|
|
466
|
+
var He = new class {
|
|
467
467
|
constructor() {
|
|
468
468
|
let e = null, t = null, n = null, r = !1;
|
|
469
469
|
this.root = null, this.buffer = null, this.uint32Array = null, this.uint16Array = null, this.setBVH = (i, a) => {
|
|
@@ -507,7 +507,7 @@ var Ve = new class {
|
|
|
507
507
|
});
|
|
508
508
|
};
|
|
509
509
|
}
|
|
510
|
-
}(),
|
|
510
|
+
}(), Ue = /* @__PURE__ */ new r(), We = /* @__PURE__ */ new Float32Array(6), Ge = class {
|
|
511
511
|
constructor() {
|
|
512
512
|
this._roots = null, this.primitiveBuffer = null, this.primitiveBufferStride = null;
|
|
513
513
|
}
|
|
@@ -529,8 +529,8 @@ var Ve = new class {
|
|
|
529
529
|
writePrimitiveRangeBounds(e, t, n, r) {
|
|
530
530
|
let i = Infinity, a = Infinity, o = Infinity, s = -Infinity, c = -Infinity, l = -Infinity;
|
|
531
531
|
for (let n = e, r = e + t; n < r; n++) {
|
|
532
|
-
this.writePrimitiveBounds(n,
|
|
533
|
-
let [e, t, r, u, d, f] =
|
|
532
|
+
this.writePrimitiveBounds(n, We, 0);
|
|
533
|
+
let [e, t, r, u, d, f] = We;
|
|
534
534
|
e < i && (i = e), u > s && (s = u), t < a && (a = t), d > c && (c = d), r < o && (o = r), f > l && (l = f);
|
|
535
535
|
}
|
|
536
536
|
return n[r + 0] = i, n[r + 1] = a, n[r + 2] = o, n[r + 3] = s, n[r + 4] = c, n[r + 5] = l, n;
|
|
@@ -538,8 +538,8 @@ var Ve = new class {
|
|
|
538
538
|
computePrimitiveBounds(e, t, n) {
|
|
539
539
|
let r = n.offset || 0;
|
|
540
540
|
for (let i = e, a = e + t; i < a; i++) {
|
|
541
|
-
this.writePrimitiveBounds(i,
|
|
542
|
-
let [e, t, a, o, s, c] =
|
|
541
|
+
this.writePrimitiveBounds(i, We, 0);
|
|
542
|
+
let [e, t, a, o, s, c] = We, l = (e + o) / 2, u = (t + s) / 2, d = (a + c) / 2, f = (o - e) / 2, p = (s - t) / 2, m = (c - a) / 2, h = (i - r) * 6;
|
|
543
543
|
n[h + 0] = l, n[h + 1] = f + (Math.abs(l) + f) * re, n[h + 2] = u, n[h + 3] = p + (Math.abs(u) + p) * re, n[h + 4] = d, n[h + 5] = m + (Math.abs(d) + m) * re;
|
|
544
544
|
}
|
|
545
545
|
return n;
|
|
@@ -559,7 +559,7 @@ var Ve = new class {
|
|
|
559
559
|
}
|
|
560
560
|
}
|
|
561
561
|
traverse(e, t = 0) {
|
|
562
|
-
|
|
562
|
+
He.setBVH(this, t), He.traverse(e), He.reset();
|
|
563
563
|
}
|
|
564
564
|
refit() {
|
|
565
565
|
let e = this._roots;
|
|
@@ -569,7 +569,7 @@ var Ve = new class {
|
|
|
569
569
|
let t = e * 8, n = t * 2;
|
|
570
570
|
if (k(n, i)) {
|
|
571
571
|
let e = A(t, r), o = j(n, i);
|
|
572
|
-
this.writePrimitiveRangeBounds(e, o,
|
|
572
|
+
this.writePrimitiveRangeBounds(e, o, We, 0), a.set(We, t);
|
|
573
573
|
} else {
|
|
574
574
|
let e = M(t), n = N(t, r);
|
|
575
575
|
for (let r = 0; r < 3; r++) {
|
|
@@ -582,7 +582,7 @@ var Ve = new class {
|
|
|
582
582
|
}
|
|
583
583
|
getBoundingBox(e) {
|
|
584
584
|
return e.makeEmpty(), this._roots.forEach((t) => {
|
|
585
|
-
O(0, new Float32Array(t),
|
|
585
|
+
O(0, new Float32Array(t), Ue), e.union(Ue);
|
|
586
586
|
}), e;
|
|
587
587
|
}
|
|
588
588
|
shapecast(e) {
|
|
@@ -601,49 +601,49 @@ var Ve = new class {
|
|
|
601
601
|
}
|
|
602
602
|
bvhcast(e, t, n) {
|
|
603
603
|
let { intersectsRanges: r } = n;
|
|
604
|
-
return
|
|
604
|
+
return Ve(this, e, t, r);
|
|
605
605
|
}
|
|
606
606
|
};
|
|
607
607
|
//#endregion
|
|
608
608
|
//#region node_modules/three-mesh-bvh/src/utils/BufferUtils.js
|
|
609
|
-
function
|
|
609
|
+
function Ke() {
|
|
610
610
|
return typeof SharedArrayBuffer < "u";
|
|
611
611
|
}
|
|
612
612
|
//#endregion
|
|
613
613
|
//#region node_modules/three-mesh-bvh/src/core/build/geometryUtils.js
|
|
614
|
-
function
|
|
614
|
+
function qe(e) {
|
|
615
615
|
return e.index ? e.index.count : e.attributes.position.count;
|
|
616
616
|
}
|
|
617
|
-
function
|
|
618
|
-
return
|
|
617
|
+
function Je(e) {
|
|
618
|
+
return qe(e) / 3;
|
|
619
619
|
}
|
|
620
|
-
function
|
|
620
|
+
function Ye(e, t = ArrayBuffer) {
|
|
621
621
|
return e > 65535 ? new Uint32Array(new t(4 * e)) : new Uint16Array(new t(2 * e));
|
|
622
622
|
}
|
|
623
|
-
function
|
|
623
|
+
function Xe(e, t) {
|
|
624
624
|
if (!e.index) {
|
|
625
|
-
let n = e.attributes.position.count, r =
|
|
625
|
+
let n = e.attributes.position.count, r = Ye(n, t.useSharedArrayBuffer ? SharedArrayBuffer : ArrayBuffer);
|
|
626
626
|
e.setIndex(new i(r, 1));
|
|
627
627
|
for (let e = 0; e < n; e++) r[e] = e;
|
|
628
628
|
}
|
|
629
629
|
}
|
|
630
|
-
function
|
|
631
|
-
let r =
|
|
630
|
+
function Ze(e, t, n) {
|
|
631
|
+
let r = qe(e) / n, i = t || e.drawRange, a = i.start / n, o = (i.start + i.count) / n, s = Math.max(0, a), c = Math.min(r, o) - s;
|
|
632
632
|
return {
|
|
633
633
|
offset: Math.floor(s),
|
|
634
634
|
count: Math.floor(c)
|
|
635
635
|
};
|
|
636
636
|
}
|
|
637
|
-
function
|
|
637
|
+
function Qe(e, t) {
|
|
638
638
|
return e.groups.map((e) => ({
|
|
639
639
|
offset: e.start / t,
|
|
640
640
|
count: e.count / t
|
|
641
641
|
}));
|
|
642
642
|
}
|
|
643
|
-
function
|
|
644
|
-
let r =
|
|
643
|
+
function $e(e, t, n) {
|
|
644
|
+
let r = Ze(e, t, n), i = Qe(e, n);
|
|
645
645
|
if (!i.length) return [r];
|
|
646
|
-
let a = [], o = r.offset, s = r.offset + r.count, c =
|
|
646
|
+
let a = [], o = r.offset, s = r.offset + r.count, c = qe(e) / n, l = [];
|
|
647
647
|
for (let e of i) {
|
|
648
648
|
let { offset: t, count: n } = e, r = t, i = t + (isFinite(n) ? n : c - t);
|
|
649
649
|
r < s && i > o && (l.push({
|
|
@@ -667,7 +667,7 @@ function Qe(e, t, n) {
|
|
|
667
667
|
}
|
|
668
668
|
//#endregion
|
|
669
669
|
//#region node_modules/three-mesh-bvh/src/core/GeometryBVH.js
|
|
670
|
-
function
|
|
670
|
+
function et(e, t) {
|
|
671
671
|
let n = e[e.length - 1], r = n.offset + n.count > 2 ** 16, i = e.reduce((e, t) => e + t.count, 0), a = r ? 4 : 2, o = t ? new SharedArrayBuffer(i * a) : new ArrayBuffer(i * a), s = r ? new Uint32Array(o) : new Uint16Array(o), c = 0;
|
|
672
672
|
for (let t = 0; t < e.length; t++) {
|
|
673
673
|
let { offset: n, count: r } = e[t];
|
|
@@ -676,7 +676,7 @@ function $e(e, t) {
|
|
|
676
676
|
}
|
|
677
677
|
return s;
|
|
678
678
|
}
|
|
679
|
-
var
|
|
679
|
+
var tt = class extends Ge {
|
|
680
680
|
get indirect() {
|
|
681
681
|
return !!this._indirectBuffer;
|
|
682
682
|
}
|
|
@@ -694,7 +694,7 @@ var et = class extends We {
|
|
|
694
694
|
constructor(e, t = {}) {
|
|
695
695
|
if (!e.isBufferGeometry) throw Error("BVH: Only BufferGeometries are supported.");
|
|
696
696
|
if (e.index && e.index.isInterleavedBufferAttribute) throw Error("BVH: InterleavedBufferAttribute is not supported for the index attribute.");
|
|
697
|
-
if (t.useSharedArrayBuffer && !
|
|
697
|
+
if (t.useSharedArrayBuffer && !Ke()) throw Error("BVH: SharedArrayBuffer is not available.");
|
|
698
698
|
super(), this.geometry = e, this.resolvePrimitiveIndex = t.indirect ? (e) => this._indirectBuffer[e] : (e) => e, this.primitiveBuffer = null, this.primitiveBufferStride = null, this._indirectBuffer = null, t = {
|
|
699
699
|
...ie,
|
|
700
700
|
...t
|
|
@@ -703,21 +703,21 @@ var et = class extends We {
|
|
|
703
703
|
init(e) {
|
|
704
704
|
let { geometry: t, primitiveStride: n } = this;
|
|
705
705
|
if (e.indirect) {
|
|
706
|
-
let r = $e(
|
|
706
|
+
let r = et($e(t, e.range, n), e.useSharedArrayBuffer);
|
|
707
707
|
this._indirectBuffer = r;
|
|
708
|
-
} else
|
|
708
|
+
} else Xe(t, e);
|
|
709
709
|
super.init(e), !t.boundingBox && e.setBoundingBox && (t.boundingBox = this.getBoundingBox(new r()));
|
|
710
710
|
}
|
|
711
711
|
getRootRanges(e) {
|
|
712
712
|
return this.indirect ? [{
|
|
713
713
|
offset: 0,
|
|
714
714
|
count: this._indirectBuffer.length
|
|
715
|
-
}] :
|
|
715
|
+
}] : $e(this.geometry, e, this.primitiveStride);
|
|
716
716
|
}
|
|
717
717
|
raycastObject3D() {
|
|
718
718
|
throw Error("BVH: raycastObject3D() not implemented");
|
|
719
719
|
}
|
|
720
|
-
},
|
|
720
|
+
}, V = class {
|
|
721
721
|
constructor() {
|
|
722
722
|
this.min = Infinity, this.max = -Infinity;
|
|
723
723
|
}
|
|
@@ -741,7 +741,7 @@ var et = class extends We {
|
|
|
741
741
|
return this.min > e.max || e.min > this.max;
|
|
742
742
|
}
|
|
743
743
|
};
|
|
744
|
-
|
|
744
|
+
V.prototype.setFromBox = (function() {
|
|
745
745
|
let e = /* @__PURE__ */ new b();
|
|
746
746
|
return function(t, n) {
|
|
747
747
|
let r = n.min, i = n.max, a = Infinity, o = -Infinity;
|
|
@@ -755,7 +755,7 @@ H.prototype.setFromBox = (function() {
|
|
|
755
755
|
})();
|
|
756
756
|
//#endregion
|
|
757
757
|
//#region node_modules/three-mesh-bvh/src/math/MathUtilities.js
|
|
758
|
-
var
|
|
758
|
+
var nt = (function() {
|
|
759
759
|
let e = /* @__PURE__ */ new b(), t = /* @__PURE__ */ new b(), n = /* @__PURE__ */ new b();
|
|
760
760
|
return function(r, i, a) {
|
|
761
761
|
let o = r.start, s = e, c = i.start, l = t;
|
|
@@ -763,10 +763,10 @@ var tt = (function() {
|
|
|
763
763
|
let u = n.dot(l), d = l.dot(s), f = l.dot(l), p = n.dot(s), m = s.dot(s) * f - d * d, h, g;
|
|
764
764
|
h = m === 0 ? 0 : (u * d - p * f) / m, g = (u + h * d) / f, a.x = h, a.y = g;
|
|
765
765
|
};
|
|
766
|
-
})(),
|
|
766
|
+
})(), rt = (function() {
|
|
767
767
|
let e = /* @__PURE__ */ new y(), t = /* @__PURE__ */ new b(), n = /* @__PURE__ */ new b();
|
|
768
768
|
return function(r, i, a, o) {
|
|
769
|
-
|
|
769
|
+
nt(r, i, e);
|
|
770
770
|
let s = e.x, c = e.y;
|
|
771
771
|
if (s >= 0 && s <= 1 && c >= 0 && c <= 1) {
|
|
772
772
|
r.at(s, a), i.at(c, o);
|
|
@@ -792,7 +792,7 @@ var tt = (function() {
|
|
|
792
792
|
}
|
|
793
793
|
}
|
|
794
794
|
};
|
|
795
|
-
})(),
|
|
795
|
+
})(), it = (function() {
|
|
796
796
|
let e = /* @__PURE__ */ new b(), t = /* @__PURE__ */ new b(), n = /* @__PURE__ */ new p(), r = /* @__PURE__ */ new c();
|
|
797
797
|
return function(i, a) {
|
|
798
798
|
let { radius: o, center: s } = i, { a: c, b: l, c: u } = a;
|
|
@@ -804,15 +804,15 @@ var tt = (function() {
|
|
|
804
804
|
}
|
|
805
805
|
return !1;
|
|
806
806
|
};
|
|
807
|
-
})(),
|
|
807
|
+
})(), at = [
|
|
808
808
|
"x",
|
|
809
809
|
"y",
|
|
810
810
|
"z"
|
|
811
|
-
],
|
|
812
|
-
function
|
|
813
|
-
return Math.abs(e) <
|
|
811
|
+
], H = 1e-15, ot = H * H;
|
|
812
|
+
function U(e) {
|
|
813
|
+
return Math.abs(e) < H;
|
|
814
814
|
}
|
|
815
|
-
var
|
|
815
|
+
var W = class extends v {
|
|
816
816
|
constructor(...e) {
|
|
817
817
|
super(...e), this.isExtendedTriangle = !0, this.satAxes = [
|
|
818
818
|
,
|
|
@@ -824,14 +824,14 @@ var G = class extends v {
|
|
|
824
824
|
,
|
|
825
825
|
,
|
|
826
826
|
,
|
|
827
|
-
].fill().map(() => new
|
|
827
|
+
].fill().map(() => new V()), this.points = [
|
|
828
828
|
this.a,
|
|
829
829
|
this.b,
|
|
830
830
|
this.c
|
|
831
831
|
], this.plane = new p(), this.isDegenerateIntoSegment = !1, this.isDegenerateIntoPoint = !1, this.degenerateSegment = new c(), this.needsUpdate = !0;
|
|
832
832
|
}
|
|
833
833
|
intersectsSphere(e) {
|
|
834
|
-
return
|
|
834
|
+
return it(e, this);
|
|
835
835
|
}
|
|
836
836
|
update() {
|
|
837
837
|
let e = this.a, t = this.b, n = this.c, r = this.points, i = this.satAxes, a = this.satBounds, o = i[0], s = a[0];
|
|
@@ -843,21 +843,21 @@ var G = class extends v {
|
|
|
843
843
|
let f = i[3], p = a[3];
|
|
844
844
|
f.subVectors(n, e), p.setFromPoints(f, r);
|
|
845
845
|
let m = c.length(), h = u.length(), g = f.length();
|
|
846
|
-
this.isDegenerateIntoPoint = !1, this.isDegenerateIntoSegment = !1, m <
|
|
846
|
+
this.isDegenerateIntoPoint = !1, this.isDegenerateIntoSegment = !1, m < H ? h < H || g < H ? this.isDegenerateIntoPoint = !0 : (this.isDegenerateIntoSegment = !0, this.degenerateSegment.start.copy(e), this.degenerateSegment.end.copy(n)) : h < H ? g < H ? this.isDegenerateIntoPoint = !0 : (this.isDegenerateIntoSegment = !0, this.degenerateSegment.start.copy(t), this.degenerateSegment.end.copy(e)) : g < H && (this.isDegenerateIntoSegment = !0, this.degenerateSegment.start.copy(n), this.degenerateSegment.end.copy(t)), this.plane.setFromNormalAndCoplanarPoint(o, e), this.needsUpdate = !1;
|
|
847
847
|
}
|
|
848
848
|
};
|
|
849
|
-
|
|
849
|
+
W.prototype.closestPointToSegment = (function() {
|
|
850
850
|
let e = /* @__PURE__ */ new b(), t = /* @__PURE__ */ new b(), n = /* @__PURE__ */ new c();
|
|
851
851
|
return function(r, i = null, a = null) {
|
|
852
852
|
let { start: o, end: s } = r, c = this.points, l, u = Infinity;
|
|
853
853
|
for (let o = 0; o < 3; o++) {
|
|
854
854
|
let s = (o + 1) % 3;
|
|
855
|
-
n.start.copy(c[o]), n.end.copy(c[s]),
|
|
855
|
+
n.start.copy(c[o]), n.end.copy(c[s]), rt(n, r, e, t), l = e.distanceToSquared(t), l < u && (u = l, i && i.copy(e), a && a.copy(t));
|
|
856
856
|
}
|
|
857
857
|
return this.closestPointToPoint(o, e), l = o.distanceToSquared(e), l < u && (u = l, i && i.copy(e), a && a.copy(o)), this.closestPointToPoint(s, e), l = s.distanceToSquared(e), l < u && (u = l, i && i.copy(e), a && a.copy(s)), Math.sqrt(u);
|
|
858
858
|
};
|
|
859
|
-
})(),
|
|
860
|
-
let e = /* @__PURE__ */ new
|
|
859
|
+
})(), W.prototype.intersectsTriangle = (function() {
|
|
860
|
+
let e = /* @__PURE__ */ new W(), t = /* @__PURE__ */ new V(), n = /* @__PURE__ */ new V(), r = /* @__PURE__ */ new b(), i = /* @__PURE__ */ new b(), a = /* @__PURE__ */ new b(), o = /* @__PURE__ */ new b(), s = /* @__PURE__ */ new c(), l = /* @__PURE__ */ new c(), u = /* @__PURE__ */ new b(), d = /* @__PURE__ */ new y(), f = /* @__PURE__ */ new y();
|
|
861
861
|
function p(e, i, a, s) {
|
|
862
862
|
let c = r;
|
|
863
863
|
!e.isDegenerateIntoPoint && !e.isDegenerateIntoSegment ? c.copy(e.plane.normal) : c.copy(i.plane.normal);
|
|
@@ -888,27 +888,27 @@ G.prototype.closestPointToSegment = (function() {
|
|
|
888
888
|
}
|
|
889
889
|
function g(e, t, n, i) {
|
|
890
890
|
let a = t.degenerateSegment, o = e.plane.distanceToPoint(a.start), s = e.plane.distanceToPoint(a.end);
|
|
891
|
-
return
|
|
891
|
+
return U(o) ? U(s) ? p(e, t, n, i) : (n && (n.start.copy(a.start), n.end.copy(a.start)), e.containsPoint(a.start)) : U(s) ? (n && (n.start.copy(a.end), n.end.copy(a.end)), e.containsPoint(a.end)) : e.plane.intersectLine(a, r) == null ? !1 : (n && (n.start.copy(r), n.end.copy(r)), e.containsPoint(r));
|
|
892
892
|
}
|
|
893
893
|
function _(e, t, n) {
|
|
894
894
|
let r = t.a;
|
|
895
|
-
return
|
|
895
|
+
return U(e.plane.distanceToPoint(r)) && e.containsPoint(r) ? (n && (n.start.copy(r), n.end.copy(r)), !0) : !1;
|
|
896
896
|
}
|
|
897
897
|
function v(e, t, n) {
|
|
898
898
|
let i = e.degenerateSegment, a = t.a;
|
|
899
|
-
return i.closestPointToPoint(a, !0, r), a.distanceToSquared(r) <
|
|
899
|
+
return i.closestPointToPoint(a, !0, r), a.distanceToSquared(r) < ot ? (n && (n.start.copy(a), n.end.copy(a)), !0) : !1;
|
|
900
900
|
}
|
|
901
901
|
function x(e, t, n, o) {
|
|
902
902
|
if (e.isDegenerateIntoSegment) if (t.isDegenerateIntoSegment) {
|
|
903
903
|
let o = e.degenerateSegment, s = t.degenerateSegment, c = i, l = a;
|
|
904
904
|
o.delta(c), s.delta(l);
|
|
905
905
|
let u = r.subVectors(s.start, o.start), d = c.x * l.y - c.y * l.x;
|
|
906
|
-
if (
|
|
906
|
+
if (U(d)) return !1;
|
|
907
907
|
let f = (u.x * l.y - u.y * l.x) / d, p = -(c.x * u.y - c.y * u.x) / d;
|
|
908
|
-
return f < 0 || f > 1 || p < 0 || p > 1 ? !1 :
|
|
908
|
+
return f < 0 || f > 1 || p < 0 || p > 1 ? !1 : U(o.start.z + c.z * f - (s.start.z + l.z * p)) ? (n && (n.start.copy(o.start).addScaledVector(c, f), n.end.copy(o.start).addScaledVector(c, f)), !0) : !1;
|
|
909
909
|
} else if (t.isDegenerateIntoPoint) return v(e, t, n);
|
|
910
910
|
else return g(t, e, n, o);
|
|
911
|
-
else if (e.isDegenerateIntoPoint) return t.isDegenerateIntoPoint ? t.a.distanceToSquared(e.a) <
|
|
911
|
+
else if (e.isDegenerateIntoPoint) return t.isDegenerateIntoPoint ? t.a.distanceToSquared(e.a) < ot ? (n && (n.start.copy(e.a), n.end.copy(e.a)), !0) : !1 : t.isDegenerateIntoSegment ? v(t, e, n) : _(t, e, n);
|
|
912
912
|
else if (t.isDegenerateIntoPoint) return _(e, t, n);
|
|
913
913
|
else if (t.isDegenerateIntoSegment) return g(e, t, n, o);
|
|
914
914
|
}
|
|
@@ -917,17 +917,17 @@ G.prototype.closestPointToSegment = (function() {
|
|
|
917
917
|
let o = x(this, t, n, r);
|
|
918
918
|
if (o !== void 0) return o;
|
|
919
919
|
let c = this.plane, m = t.plane, g = m.distanceToPoint(this.a), _ = m.distanceToPoint(this.b), v = m.distanceToPoint(this.c);
|
|
920
|
-
|
|
920
|
+
U(g) && (g = 0), U(_) && (_ = 0), U(v) && (v = 0);
|
|
921
921
|
let y = g * _, b = g * v;
|
|
922
922
|
if (y > 0 && b > 0) return !1;
|
|
923
923
|
let S = c.distanceToPoint(t.a), C = c.distanceToPoint(t.b), w = c.distanceToPoint(t.c);
|
|
924
|
-
|
|
924
|
+
U(S) && (S = 0), U(C) && (C = 0), U(w) && (w = 0);
|
|
925
925
|
let T = S * C, ee = S * w;
|
|
926
926
|
if (T > 0 && ee > 0) return !1;
|
|
927
927
|
i.copy(c.normal), a.copy(m.normal);
|
|
928
928
|
let te = i.cross(a), E = 0, ne = Math.abs(te.x), re = Math.abs(te.y);
|
|
929
929
|
re > ne && (ne = re, E = 1), Math.abs(te.z) > ne && (E = 2);
|
|
930
|
-
let D =
|
|
930
|
+
let D = at[E], ie = this.a[D], O = this.b[D], ae = this.c[D], oe = t.a[D], se = t.b[D], ce = t.c[D];
|
|
931
931
|
if (h(this, ie, O, ae, y, b, g, _, v, d, s) || h(t, oe, se, ce, T, ee, S, C, w, f, l)) return p(this, t, n, r);
|
|
932
932
|
if (d.y < d.x) {
|
|
933
933
|
let e = d.y;
|
|
@@ -939,12 +939,12 @@ G.prototype.closestPointToSegment = (function() {
|
|
|
939
939
|
}
|
|
940
940
|
return d.y < f.x || f.y < d.x ? !1 : (n && (f.x > d.x ? n.start.copy(l.start) : n.start.copy(s.start), f.y < d.y ? n.end.copy(l.end) : n.end.copy(s.end)), !0);
|
|
941
941
|
};
|
|
942
|
-
})(),
|
|
942
|
+
})(), W.prototype.distanceToPoint = (function() {
|
|
943
943
|
let e = /* @__PURE__ */ new b();
|
|
944
944
|
return function(t) {
|
|
945
945
|
return this.closestPointToPoint(t, e), t.distanceTo(e);
|
|
946
946
|
};
|
|
947
|
-
})(),
|
|
947
|
+
})(), W.prototype.distanceToTriangle = (function() {
|
|
948
948
|
let e = /* @__PURE__ */ new b(), t = /* @__PURE__ */ new b(), n = [
|
|
949
949
|
"a",
|
|
950
950
|
"b",
|
|
@@ -965,7 +965,7 @@ G.prototype.closestPointToSegment = (function() {
|
|
|
965
965
|
r.set(this[u], this[d]);
|
|
966
966
|
for (let c = 0; c < 3; c++) {
|
|
967
967
|
let u = n[c], d = n[(c + 1) % 3];
|
|
968
|
-
i.set(a[u], a[d]),
|
|
968
|
+
i.set(a[u], a[d]), rt(r, i, e, t);
|
|
969
969
|
let f = e.distanceToSquared(t);
|
|
970
970
|
f < l && (l = f, o && o.copy(e), s && s.copy(t));
|
|
971
971
|
}
|
|
@@ -975,7 +975,7 @@ G.prototype.closestPointToSegment = (function() {
|
|
|
975
975
|
})();
|
|
976
976
|
//#endregion
|
|
977
977
|
//#region node_modules/three-mesh-bvh/src/math/OrientedBox.js
|
|
978
|
-
var
|
|
978
|
+
var G = class {
|
|
979
979
|
constructor(e, t, n) {
|
|
980
980
|
this.isOrientedBox = !0, this.min = new b(), this.max = new b(), this.matrix = new d(), this.invMatrix = new d(), this.points = Array(8).fill().map(() => new b()), this.satAxes = [
|
|
981
981
|
,
|
|
@@ -985,11 +985,11 @@ var K = class {
|
|
|
985
985
|
,
|
|
986
986
|
,
|
|
987
987
|
,
|
|
988
|
-
].fill().map(() => new
|
|
988
|
+
].fill().map(() => new V()), this.alignedSatBounds = [
|
|
989
989
|
,
|
|
990
990
|
,
|
|
991
991
|
,
|
|
992
|
-
].fill().map(() => new
|
|
992
|
+
].fill().map(() => new V()), this.needsUpdate = !1, e && this.min.copy(e), t && this.max.copy(t), n && this.matrix.copy(n);
|
|
993
993
|
}
|
|
994
994
|
set(e, t, n) {
|
|
995
995
|
this.min.copy(e), this.max.copy(t), this.matrix.copy(n), this.needsUpdate = !0;
|
|
@@ -998,7 +998,7 @@ var K = class {
|
|
|
998
998
|
this.min.copy(e.min), this.max.copy(e.max), this.matrix.copy(e.matrix), this.needsUpdate = !0;
|
|
999
999
|
}
|
|
1000
1000
|
};
|
|
1001
|
-
|
|
1001
|
+
G.prototype.update = (function() {
|
|
1002
1002
|
return function() {
|
|
1003
1003
|
let e = this.matrix, t = this.min, n = this.max, r = this.points;
|
|
1004
1004
|
for (let i = 0; i <= 1; i++) for (let a = 0; a <= 1; a++) for (let o = 0; o <= 1; o++) {
|
|
@@ -1013,8 +1013,8 @@ K.prototype.update = (function() {
|
|
|
1013
1013
|
let s = this.alignedSatBounds;
|
|
1014
1014
|
s[0].setFromPointsField(r, "x"), s[1].setFromPointsField(r, "y"), s[2].setFromPointsField(r, "z"), this.invMatrix.copy(this.matrix).invert(), this.needsUpdate = !1;
|
|
1015
1015
|
};
|
|
1016
|
-
})(),
|
|
1017
|
-
let e = /* @__PURE__ */ new
|
|
1016
|
+
})(), G.prototype.intersectsBox = (function() {
|
|
1017
|
+
let e = /* @__PURE__ */ new V();
|
|
1018
1018
|
return function(t) {
|
|
1019
1019
|
this.needsUpdate && this.update();
|
|
1020
1020
|
let n = t.min, r = t.max, i = this.satBounds, a = this.satAxes, o = this.alignedSatBounds;
|
|
@@ -1025,12 +1025,12 @@ K.prototype.update = (function() {
|
|
|
1025
1025
|
}
|
|
1026
1026
|
return !0;
|
|
1027
1027
|
};
|
|
1028
|
-
})(),
|
|
1029
|
-
let e = /* @__PURE__ */ new
|
|
1028
|
+
})(), G.prototype.intersectsTriangle = (function() {
|
|
1029
|
+
let e = /* @__PURE__ */ new W(), t = [
|
|
1030
1030
|
,
|
|
1031
1031
|
,
|
|
1032
1032
|
,
|
|
1033
|
-
], n = /* @__PURE__ */ new
|
|
1033
|
+
], n = /* @__PURE__ */ new V(), r = /* @__PURE__ */ new V(), i = /* @__PURE__ */ new b();
|
|
1034
1034
|
return function(a) {
|
|
1035
1035
|
this.needsUpdate && this.update(), a.isExtendedTriangle ? a.needsUpdate && a.update() : (e.copy(a), e.update(), a = e);
|
|
1036
1036
|
let o = this.satBounds, s = this.satAxes;
|
|
@@ -1053,16 +1053,16 @@ K.prototype.update = (function() {
|
|
|
1053
1053
|
}
|
|
1054
1054
|
return !0;
|
|
1055
1055
|
};
|
|
1056
|
-
})(),
|
|
1056
|
+
})(), G.prototype.closestPointToPoint = (function() {
|
|
1057
1057
|
return function(e, t) {
|
|
1058
1058
|
return this.needsUpdate && this.update(), t.copy(e).applyMatrix4(this.invMatrix).clamp(this.min, this.max).applyMatrix4(this.matrix), t;
|
|
1059
1059
|
};
|
|
1060
|
-
})(),
|
|
1060
|
+
})(), G.prototype.distanceToPoint = (function() {
|
|
1061
1061
|
let e = new b();
|
|
1062
1062
|
return function(t) {
|
|
1063
1063
|
return this.closestPointToPoint(t, e), t.distanceTo(e);
|
|
1064
1064
|
};
|
|
1065
|
-
})(),
|
|
1065
|
+
})(), G.prototype.distanceToBox = (function() {
|
|
1066
1066
|
let e = [
|
|
1067
1067
|
"x",
|
|
1068
1068
|
"y",
|
|
@@ -1093,7 +1093,7 @@ K.prototype.update = (function() {
|
|
|
1093
1093
|
let a = t[e];
|
|
1094
1094
|
for (let e = 0; e < 12; e++) {
|
|
1095
1095
|
let t = n[e];
|
|
1096
|
-
|
|
1096
|
+
rt(a, t, r, i);
|
|
1097
1097
|
let o = r.distanceToSquared(i);
|
|
1098
1098
|
if (o < p && (p = o, s && s.copy(r), c && c.copy(i), o < l)) return Math.sqrt(o);
|
|
1099
1099
|
}
|
|
@@ -1101,29 +1101,29 @@ K.prototype.update = (function() {
|
|
|
1101
1101
|
return Math.sqrt(p);
|
|
1102
1102
|
};
|
|
1103
1103
|
})();
|
|
1104
|
-
var
|
|
1104
|
+
var K = /* @__PURE__ */ new class extends Oe {
|
|
1105
1105
|
constructor() {
|
|
1106
|
-
super(() => new
|
|
1106
|
+
super(() => new W());
|
|
1107
1107
|
}
|
|
1108
|
-
}(),
|
|
1109
|
-
function
|
|
1108
|
+
}(), st = /* @__PURE__ */ new b(), ct = /* @__PURE__ */ new b();
|
|
1109
|
+
function lt(e, t, n = {}, r = 0, i = Infinity) {
|
|
1110
1110
|
let a = r * r, o = i * i, s = Infinity, c = null;
|
|
1111
1111
|
if (e.shapecast({
|
|
1112
|
-
boundsTraverseOrder: (e) => (
|
|
1112
|
+
boundsTraverseOrder: (e) => (st.copy(t).clamp(e.min, e.max), st.distanceToSquared(t)),
|
|
1113
1113
|
intersectsBounds: (e, t, n) => n < s && n < o,
|
|
1114
1114
|
intersectsTriangle: (e, n) => {
|
|
1115
|
-
e.closestPointToPoint(t,
|
|
1116
|
-
let r = t.distanceToSquared(
|
|
1117
|
-
return r < s && (
|
|
1115
|
+
e.closestPointToPoint(t, st);
|
|
1116
|
+
let r = t.distanceToSquared(st);
|
|
1117
|
+
return r < s && (ct.copy(st), s = r, c = n), r < a;
|
|
1118
1118
|
}
|
|
1119
1119
|
}), s === Infinity) return null;
|
|
1120
1120
|
let l = Math.sqrt(s);
|
|
1121
|
-
return n.point ? n.point.copy(
|
|
1121
|
+
return n.point ? n.point.copy(ct) : n.point = ct.clone(), n.distance = l, n.faceIndex = c, n;
|
|
1122
1122
|
}
|
|
1123
1123
|
//#endregion
|
|
1124
1124
|
//#region node_modules/three-mesh-bvh/src/utils/ThreeRayIntersectUtilities.js
|
|
1125
|
-
var
|
|
1126
|
-
function
|
|
1125
|
+
var ut = parseInt(h) >= 169, dt = parseInt(h) <= 161, q = /* @__PURE__ */ new b(), J = /* @__PURE__ */ new b(), Y = /* @__PURE__ */ new b(), ft = /* @__PURE__ */ new y(), pt = /* @__PURE__ */ new y(), mt = /* @__PURE__ */ new y(), ht = /* @__PURE__ */ new b(), gt = /* @__PURE__ */ new b(), _t = /* @__PURE__ */ new b(), vt = /* @__PURE__ */ new b();
|
|
1126
|
+
function yt(e, n, r, i, o, s, c, l) {
|
|
1127
1127
|
let u;
|
|
1128
1128
|
if (u = s === t ? e.intersectTriangle(i, r, n, !0, o) : e.intersectTriangle(n, r, i, s !== a, o), u === null) return null;
|
|
1129
1129
|
let d = e.origin.distanceTo(o);
|
|
@@ -1132,24 +1132,24 @@ function vt(e, n, r, i, o, s, c, l) {
|
|
|
1132
1132
|
point: o.clone()
|
|
1133
1133
|
};
|
|
1134
1134
|
}
|
|
1135
|
-
function
|
|
1136
|
-
|
|
1137
|
-
let d =
|
|
1135
|
+
function bt(e, t, n, r, i, a, o, s, c, l, u) {
|
|
1136
|
+
q.fromBufferAttribute(t, a), J.fromBufferAttribute(t, o), Y.fromBufferAttribute(t, s);
|
|
1137
|
+
let d = yt(e, q, J, Y, vt, c, l, u);
|
|
1138
1138
|
if (d) {
|
|
1139
1139
|
if (r) {
|
|
1140
|
-
|
|
1141
|
-
let e = v.getInterpolation(
|
|
1142
|
-
|
|
1140
|
+
ft.fromBufferAttribute(r, a), pt.fromBufferAttribute(r, o), mt.fromBufferAttribute(r, s), d.uv = new y();
|
|
1141
|
+
let e = v.getInterpolation(vt, q, J, Y, ft, pt, mt, d.uv);
|
|
1142
|
+
ut || (d.uv = e);
|
|
1143
1143
|
}
|
|
1144
1144
|
if (i) {
|
|
1145
|
-
|
|
1146
|
-
let e = v.getInterpolation(
|
|
1147
|
-
|
|
1145
|
+
ft.fromBufferAttribute(i, a), pt.fromBufferAttribute(i, o), mt.fromBufferAttribute(i, s), d.uv1 = new y();
|
|
1146
|
+
let e = v.getInterpolation(vt, q, J, Y, ft, pt, mt, d.uv1);
|
|
1147
|
+
ut || (d.uv1 = e), dt && (d.uv2 = d.uv1);
|
|
1148
1148
|
}
|
|
1149
1149
|
if (n) {
|
|
1150
|
-
|
|
1151
|
-
let t = v.getInterpolation(
|
|
1152
|
-
d.normal.dot(e.direction) > 0 && d.normal.multiplyScalar(-1),
|
|
1150
|
+
ht.fromBufferAttribute(n, a), gt.fromBufferAttribute(n, o), _t.fromBufferAttribute(n, s), d.normal = new b();
|
|
1151
|
+
let t = v.getInterpolation(vt, q, J, Y, ht, gt, _t, d.normal);
|
|
1152
|
+
d.normal.dot(e.direction) > 0 && d.normal.multiplyScalar(-1), ut || (d.normal = t);
|
|
1153
1153
|
}
|
|
1154
1154
|
let t = {
|
|
1155
1155
|
a,
|
|
@@ -1158,17 +1158,17 @@ function yt(e, t, n, r, i, a, o, s, c, l, u) {
|
|
|
1158
1158
|
normal: new b(),
|
|
1159
1159
|
materialIndex: 0
|
|
1160
1160
|
};
|
|
1161
|
-
if (v.getNormal(J, Y,
|
|
1161
|
+
if (v.getNormal(q, J, Y, t.normal), d.face = t, d.faceIndex = a, ut) {
|
|
1162
1162
|
let e = new b();
|
|
1163
|
-
v.getBarycoord(
|
|
1163
|
+
v.getBarycoord(vt, q, J, Y, e), d.barycoord = e;
|
|
1164
1164
|
}
|
|
1165
1165
|
}
|
|
1166
1166
|
return d;
|
|
1167
1167
|
}
|
|
1168
|
-
function
|
|
1168
|
+
function xt(e) {
|
|
1169
1169
|
return e && e.isMaterial ? e.side : e;
|
|
1170
1170
|
}
|
|
1171
|
-
function
|
|
1171
|
+
function St(e, t, n, r, i, a, o) {
|
|
1172
1172
|
let s = r * 3, c = s + 0, l = s + 1, u = s + 2, { index: d, groups: f } = e;
|
|
1173
1173
|
e.index && (c = d.getX(c), l = d.getX(l), u = d.getX(u));
|
|
1174
1174
|
let { position: p, normal: m, uv: h, uv1: g } = e.attributes;
|
|
@@ -1177,13 +1177,13 @@ function xt(e, t, n, r, i, a, o) {
|
|
|
1177
1177
|
for (let s = 0, d = f.length; s < d; s++) {
|
|
1178
1178
|
let { start: d, count: _, materialIndex: v } = f[s];
|
|
1179
1179
|
if (e >= d && e < d + _) {
|
|
1180
|
-
let e =
|
|
1180
|
+
let e = xt(t[v]), s = bt(n, p, m, h, g, c, l, u, e, a, o);
|
|
1181
1181
|
if (s) if (s.faceIndex = r, s.face.materialIndex = v, i) i.push(s);
|
|
1182
1182
|
else return s;
|
|
1183
1183
|
}
|
|
1184
1184
|
}
|
|
1185
1185
|
} else {
|
|
1186
|
-
let e =
|
|
1186
|
+
let e = xt(t), s = bt(n, p, m, h, g, c, l, u, e, a, o);
|
|
1187
1187
|
if (s) if (s.faceIndex = r, s.face.materialIndex = 0, i) i.push(s);
|
|
1188
1188
|
else return s;
|
|
1189
1189
|
}
|
|
@@ -1191,35 +1191,35 @@ function xt(e, t, n, r, i, a, o) {
|
|
|
1191
1191
|
}
|
|
1192
1192
|
//#endregion
|
|
1193
1193
|
//#region node_modules/three-mesh-bvh/src/utils/TriangleUtilities.js
|
|
1194
|
-
function
|
|
1194
|
+
function X(e, t, n, r) {
|
|
1195
1195
|
let i = e.a, a = e.b, o = e.c, s = t, c = t + 1, l = t + 2;
|
|
1196
1196
|
n && (s = n.getX(s), c = n.getX(c), l = n.getX(l)), i.x = r.getX(s), i.y = r.getY(s), i.z = r.getZ(s), a.x = r.getX(c), a.y = r.getY(c), a.z = r.getZ(c), o.x = r.getX(l), o.y = r.getY(l), o.z = r.getZ(l);
|
|
1197
1197
|
}
|
|
1198
1198
|
//#endregion
|
|
1199
1199
|
//#region node_modules/three-mesh-bvh/src/core/utils/iterationUtils.generated.js
|
|
1200
|
-
function
|
|
1200
|
+
function Ct(e, t, n, r, i, a, o, s) {
|
|
1201
1201
|
let { geometry: c, _indirectBuffer: l } = e;
|
|
1202
|
-
for (let e = r, l = r + i; e < l; e++)
|
|
1202
|
+
for (let e = r, l = r + i; e < l; e++) St(c, t, n, e, a, o, s);
|
|
1203
1203
|
}
|
|
1204
|
-
function
|
|
1204
|
+
function wt(e, t, n, r, i, a, o) {
|
|
1205
1205
|
let { geometry: s, _indirectBuffer: c } = e, l = Infinity, u = null;
|
|
1206
1206
|
for (let e = r, c = r + i; e < c; e++) {
|
|
1207
1207
|
let r;
|
|
1208
|
-
r =
|
|
1208
|
+
r = St(s, t, n, e, null, a, o), r && r.distance < l && (u = r, l = r.distance);
|
|
1209
1209
|
}
|
|
1210
1210
|
return u;
|
|
1211
1211
|
}
|
|
1212
|
-
function
|
|
1212
|
+
function Tt(e, t, n, r, i, a, o) {
|
|
1213
1213
|
let { geometry: s } = n, { index: c } = s, l = s.attributes.position;
|
|
1214
1214
|
for (let n = e, s = t + e; n < s; n++) {
|
|
1215
1215
|
let e;
|
|
1216
|
-
if (e = n,
|
|
1216
|
+
if (e = n, X(o, e * 3, c, l), o.needsUpdate = !0, r(o, e, i, a)) return !0;
|
|
1217
1217
|
}
|
|
1218
1218
|
return !1;
|
|
1219
1219
|
}
|
|
1220
1220
|
//#endregion
|
|
1221
1221
|
//#region node_modules/three-mesh-bvh/src/core/cast/refit.generated.js
|
|
1222
|
-
function
|
|
1222
|
+
function Et(e, t = null) {
|
|
1223
1223
|
t && Array.isArray(t) && (t = new Set(t));
|
|
1224
1224
|
let n = e.geometry, r = n.index ? n.index.array : null, i = n.attributes.position, a, o, s, c, l = 0, u = e._roots;
|
|
1225
1225
|
for (let e = 0, t = u.length; e < t; e++) a = u[e], o = new Uint32Array(a), s = new Uint16Array(a), c = new Float32Array(a), d(0, l), l += a.byteLength;
|
|
@@ -1255,77 +1255,77 @@ function Tt(e, t = null) {
|
|
|
1255
1255
|
}
|
|
1256
1256
|
//#endregion
|
|
1257
1257
|
//#region node_modules/three-mesh-bvh/src/core/utils/intersectUtils.js
|
|
1258
|
-
function
|
|
1258
|
+
function Z(e, t, n, r, i) {
|
|
1259
1259
|
let a, o, s, c, l, u, d = 1 / n.direction.x, f = 1 / n.direction.y, p = 1 / n.direction.z, m = n.origin.x, h = n.origin.y, g = n.origin.z, _ = t[e], v = t[e + 3], y = t[e + 1], b = t[e + 3 + 1], x = t[e + 2], S = t[e + 3 + 2];
|
|
1260
1260
|
return d >= 0 ? (a = (_ - m) * d, o = (v - m) * d) : (a = (v - m) * d, o = (_ - m) * d), f >= 0 ? (s = (y - h) * f, c = (b - h) * f) : (s = (b - h) * f, c = (y - h) * f), a > c || s > o || ((s > a || isNaN(a)) && (a = s), (c < o || isNaN(o)) && (o = c), p >= 0 ? (l = (x - g) * p, u = (S - g) * p) : (l = (S - g) * p, u = (x - g) * p), a > u || l > o) ? !1 : ((l > a || a !== a) && (a = l), (u < o || o !== o) && (o = u), a <= i && o >= r);
|
|
1261
1261
|
}
|
|
1262
1262
|
//#endregion
|
|
1263
1263
|
//#region node_modules/three-mesh-bvh/src/core/utils/iterationUtils_indirect.generated.js
|
|
1264
|
-
function
|
|
1264
|
+
function Dt(e, t, n, r, i, a, o, s) {
|
|
1265
1265
|
let { geometry: c, _indirectBuffer: l } = e;
|
|
1266
|
-
for (let e = r, u = r + i; e < u; e++)
|
|
1266
|
+
for (let e = r, u = r + i; e < u; e++) St(c, t, n, l ? l[e] : e, a, o, s);
|
|
1267
1267
|
}
|
|
1268
|
-
function
|
|
1268
|
+
function Ot(e, t, n, r, i, a, o) {
|
|
1269
1269
|
let { geometry: s, _indirectBuffer: c } = e, l = Infinity, u = null;
|
|
1270
1270
|
for (let e = r, d = r + i; e < d; e++) {
|
|
1271
1271
|
let r;
|
|
1272
|
-
r =
|
|
1272
|
+
r = St(s, t, n, c ? c[e] : e, null, a, o), r && r.distance < l && (u = r, l = r.distance);
|
|
1273
1273
|
}
|
|
1274
1274
|
return u;
|
|
1275
1275
|
}
|
|
1276
|
-
function
|
|
1276
|
+
function kt(e, t, n, r, i, a, o) {
|
|
1277
1277
|
let { geometry: s } = n, { index: c } = s, l = s.attributes.position;
|
|
1278
1278
|
for (let s = e, u = t + e; s < u; s++) {
|
|
1279
1279
|
let e;
|
|
1280
|
-
if (e = n.resolveTriangleIndex(s),
|
|
1280
|
+
if (e = n.resolveTriangleIndex(s), X(o, e * 3, c, l), o.needsUpdate = !0, r(o, e, i, a)) return !0;
|
|
1281
1281
|
}
|
|
1282
1282
|
return !1;
|
|
1283
1283
|
}
|
|
1284
1284
|
//#endregion
|
|
1285
1285
|
//#region node_modules/three-mesh-bvh/src/core/cast/raycast.generated.js
|
|
1286
|
-
function kt(e, t, n, r, i, a, o) {
|
|
1287
|
-
L.setBuffer(e._roots[t]), At(0, e, n, r, i, a, o), L.clearBuffer();
|
|
1288
|
-
}
|
|
1289
1286
|
function At(e, t, n, r, i, a, o) {
|
|
1287
|
+
L.setBuffer(e._roots[t]), jt(0, e, n, r, i, a, o), L.clearBuffer();
|
|
1288
|
+
}
|
|
1289
|
+
function jt(e, t, n, r, i, a, o) {
|
|
1290
1290
|
let { float32Array: s, uint16Array: c, uint32Array: l } = L, u = e * 2;
|
|
1291
|
-
if (k(u, c))
|
|
1291
|
+
if (k(u, c)) Ct(t, n, r, A(e, l), j(u, c), i, a, o);
|
|
1292
1292
|
else {
|
|
1293
1293
|
let c = M(e);
|
|
1294
|
-
|
|
1294
|
+
Z(c, s, r, a, o) && jt(c, t, n, r, i, a, o);
|
|
1295
1295
|
let u = N(e, l);
|
|
1296
|
-
|
|
1296
|
+
Z(u, s, r, a, o) && jt(u, t, n, r, i, a, o);
|
|
1297
1297
|
}
|
|
1298
1298
|
}
|
|
1299
1299
|
//#endregion
|
|
1300
1300
|
//#region node_modules/three-mesh-bvh/src/core/cast/raycastFirst.generated.js
|
|
1301
|
-
var
|
|
1301
|
+
var Mt = [
|
|
1302
1302
|
"x",
|
|
1303
1303
|
"y",
|
|
1304
1304
|
"z"
|
|
1305
1305
|
];
|
|
1306
|
-
function
|
|
1306
|
+
function Nt(e, t, n, r, i, a) {
|
|
1307
1307
|
L.setBuffer(e._roots[t]);
|
|
1308
|
-
let o =
|
|
1308
|
+
let o = Pt(0, e, n, r, i, a);
|
|
1309
1309
|
return L.clearBuffer(), o;
|
|
1310
1310
|
}
|
|
1311
|
-
function
|
|
1311
|
+
function Pt(e, t, n, r, i, a) {
|
|
1312
1312
|
let { float32Array: o, uint16Array: s, uint32Array: c } = L, l = e * 2;
|
|
1313
|
-
if (k(l, s)) return
|
|
1313
|
+
if (k(l, s)) return wt(t, n, r, A(e, c), j(l, s), i, a);
|
|
1314
1314
|
{
|
|
1315
|
-
let s = ue(e, c), l =
|
|
1315
|
+
let s = ue(e, c), l = Mt[s], u = r.direction[l] >= 0, d, f;
|
|
1316
1316
|
u ? (d = M(e), f = N(e, c)) : (d = N(e, c), f = M(e));
|
|
1317
|
-
let p =
|
|
1317
|
+
let p = Z(d, o, r, i, a) ? Pt(d, t, n, r, i, a) : null;
|
|
1318
1318
|
if (p) {
|
|
1319
1319
|
let e = p.point[l];
|
|
1320
1320
|
if (u ? e <= o[f + s] : e >= o[f + s + 3]) return p;
|
|
1321
1321
|
}
|
|
1322
|
-
let m =
|
|
1322
|
+
let m = Z(f, o, r, i, a) ? Pt(f, t, n, r, i, a) : null;
|
|
1323
1323
|
return p && m ? p.distance <= m.distance ? p : m : p || m || null;
|
|
1324
1324
|
}
|
|
1325
1325
|
}
|
|
1326
1326
|
//#endregion
|
|
1327
1327
|
//#region node_modules/three-mesh-bvh/src/core/cast/intersectsGeometry.generated.js
|
|
1328
|
-
var
|
|
1328
|
+
var Ft = /* @__PURE__ */ new r(), It = /* @__PURE__ */ new W(), Q = /* @__PURE__ */ new W(), Lt = /* @__PURE__ */ new d(), Rt = /* @__PURE__ */ new G(), zt = /* @__PURE__ */ new G();
|
|
1329
1329
|
function Bt(e, t, n, r) {
|
|
1330
1330
|
L.setBuffer(e._roots[t]);
|
|
1331
1331
|
let i = Vt(0, e, n, r);
|
|
@@ -1339,28 +1339,28 @@ function Vt(e, t, n, r, i = null) {
|
|
|
1339
1339
|
intersectsBounds: (e) => zt.intersectsBox(e),
|
|
1340
1340
|
intersectsTriangle: (e) => {
|
|
1341
1341
|
e.a.applyMatrix4(r), e.b.applyMatrix4(r), e.c.applyMatrix4(r), e.needsUpdate = !0;
|
|
1342
|
-
for (let t = p * 3, n = (m + p) * 3; t < n; t += 3) if (
|
|
1342
|
+
for (let t = p * 3, n = (m + p) * 3; t < n; t += 3) if (X(Q, t, l, u), Q.needsUpdate = !0, e.intersectsTriangle(Q)) return !0;
|
|
1343
1343
|
return !1;
|
|
1344
1344
|
}
|
|
1345
1345
|
});
|
|
1346
1346
|
{
|
|
1347
|
-
let e =
|
|
1347
|
+
let e = Je(n);
|
|
1348
1348
|
for (let t = p * 3, n = (m + p) * 3; t < n; t += 3) {
|
|
1349
|
-
|
|
1350
|
-
for (let t = 0, n = e * 3; t < n; t += 3) if (
|
|
1349
|
+
X(It, t, l, u), It.a.applyMatrix4(Lt), It.b.applyMatrix4(Lt), It.c.applyMatrix4(Lt), It.needsUpdate = !0;
|
|
1350
|
+
for (let t = 0, n = e * 3; t < n; t += 3) if (X(Q, t, d, f), Q.needsUpdate = !0, It.intersectsTriangle(Q)) return !0;
|
|
1351
1351
|
}
|
|
1352
1352
|
}
|
|
1353
1353
|
} else {
|
|
1354
1354
|
let o = M(e), c = N(e, s);
|
|
1355
|
-
return O(P(o), a,
|
|
1355
|
+
return O(P(o), a, Ft), !!(i.intersectsBox(Ft) && Vt(o, t, n, r, i) || (O(P(c), a, Ft), i.intersectsBox(Ft) && Vt(c, t, n, r, i)));
|
|
1356
1356
|
}
|
|
1357
1357
|
}
|
|
1358
1358
|
//#endregion
|
|
1359
1359
|
//#region node_modules/three-mesh-bvh/src/core/cast/closestPointToGeometry.generated.js
|
|
1360
|
-
var Ht = /* @__PURE__ */ new d(), Ut = /* @__PURE__ */ new
|
|
1360
|
+
var Ht = /* @__PURE__ */ new d(), Ut = /* @__PURE__ */ new G(), Wt = /* @__PURE__ */ new G(), Gt = /* @__PURE__ */ new b(), Kt = /* @__PURE__ */ new b(), qt = /* @__PURE__ */ new b(), Jt = /* @__PURE__ */ new b();
|
|
1361
1361
|
function Yt(e, t, n, r = {}, i = {}, a = 0, o = Infinity) {
|
|
1362
1362
|
t.boundingBox || t.computeBoundingBox(), Ut.set(t.boundingBox.min, t.boundingBox.max, n), Ut.needsUpdate = !0;
|
|
1363
|
-
let s = e.geometry, c = s.attributes.position, l = s.index, u = t.attributes.position, d = t.index, f =
|
|
1363
|
+
let s = e.geometry, c = s.attributes.position, l = s.index, u = t.attributes.position, d = t.index, f = K.getPrimitive(), p = K.getPrimitive(), m = Gt, h = Kt, g = null, _ = null;
|
|
1364
1364
|
i && (g = qt, _ = Jt);
|
|
1365
1365
|
let v = Infinity, y = null, b = null;
|
|
1366
1366
|
return Ht.copy(n).invert(), Wt.matrix.copy(Ht), e.shapecast({
|
|
@@ -1372,9 +1372,9 @@ function Yt(e, t, n, r = {}, i = {}, a = 0, o = Infinity) {
|
|
|
1372
1372
|
intersectsBounds: (e, t, n) => n < v && n < o,
|
|
1373
1373
|
intersectsRange: (t, i) => {
|
|
1374
1374
|
for (let o = t, s = t + i; o < s; o++) {
|
|
1375
|
-
|
|
1375
|
+
X(p, 3 * o, d, u), p.a.applyMatrix4(n), p.b.applyMatrix4(n), p.c.applyMatrix4(n), p.needsUpdate = !0;
|
|
1376
1376
|
for (let t = e, n = e + r; t < n; t++) {
|
|
1377
|
-
|
|
1377
|
+
X(f, 3 * t, l, c), f.needsUpdate = !0;
|
|
1378
1378
|
let e = f.distanceToTriangle(p, m, g);
|
|
1379
1379
|
if (e < v && (h.copy(m), _ && _.copy(g), v = e, y = t, b = o), e < a) return !0;
|
|
1380
1380
|
}
|
|
@@ -1382,18 +1382,18 @@ function Yt(e, t, n, r = {}, i = {}, a = 0, o = Infinity) {
|
|
|
1382
1382
|
}
|
|
1383
1383
|
});
|
|
1384
1384
|
{
|
|
1385
|
-
let i =
|
|
1385
|
+
let i = Je(t);
|
|
1386
1386
|
for (let t = 0, o = i; t < o; t++) {
|
|
1387
|
-
|
|
1387
|
+
X(p, 3 * t, d, u), p.a.applyMatrix4(n), p.b.applyMatrix4(n), p.c.applyMatrix4(n), p.needsUpdate = !0;
|
|
1388
1388
|
for (let n = e, i = e + r; n < i; n++) {
|
|
1389
|
-
|
|
1389
|
+
X(f, 3 * n, l, c), f.needsUpdate = !0;
|
|
1390
1390
|
let e = f.distanceToTriangle(p, m, g);
|
|
1391
1391
|
if (e < v && (h.copy(m), _ && _.copy(g), v = e, y = n, b = t), e < a) return !0;
|
|
1392
1392
|
}
|
|
1393
1393
|
}
|
|
1394
1394
|
}
|
|
1395
1395
|
}
|
|
1396
|
-
}),
|
|
1396
|
+
}), K.releasePrimitive(f), K.releasePrimitive(p), v === Infinity ? null : (r.point ? r.point.copy(h) : r.point = h.clone(), r.distance = v, r.faceIndex = y, i && (i.point ? i.point.copy(_) : i.point = _.clone(), i.point.applyMatrix4(Ht), h.applyMatrix4(Ht), i.distance = h.sub(i.point).length(), i.faceIndex = b), r);
|
|
1397
1397
|
}
|
|
1398
1398
|
//#endregion
|
|
1399
1399
|
//#region node_modules/three-mesh-bvh/src/core/cast/refit_indirect.generated.js
|
|
@@ -1443,12 +1443,12 @@ function Zt(e, t, n, r, i, a, o) {
|
|
|
1443
1443
|
}
|
|
1444
1444
|
function Qt(e, t, n, r, i, a, o) {
|
|
1445
1445
|
let { float32Array: s, uint16Array: c, uint32Array: l } = L, u = e * 2;
|
|
1446
|
-
if (k(u, c))
|
|
1446
|
+
if (k(u, c)) Dt(t, n, r, A(e, l), j(u, c), i, a, o);
|
|
1447
1447
|
else {
|
|
1448
1448
|
let c = M(e);
|
|
1449
|
-
|
|
1449
|
+
Z(c, s, r, a, o) && Qt(c, t, n, r, i, a, o);
|
|
1450
1450
|
let u = N(e, l);
|
|
1451
|
-
|
|
1451
|
+
Z(u, s, r, a, o) && Qt(u, t, n, r, i, a, o);
|
|
1452
1452
|
}
|
|
1453
1453
|
}
|
|
1454
1454
|
//#endregion
|
|
@@ -1465,22 +1465,22 @@ function en(e, t, n, r, i, a) {
|
|
|
1465
1465
|
}
|
|
1466
1466
|
function tn(e, t, n, r, i, a) {
|
|
1467
1467
|
let { float32Array: o, uint16Array: s, uint32Array: c } = L, l = e * 2;
|
|
1468
|
-
if (k(l, s)) return
|
|
1468
|
+
if (k(l, s)) return Ot(t, n, r, A(e, c), j(l, s), i, a);
|
|
1469
1469
|
{
|
|
1470
1470
|
let s = ue(e, c), l = $t[s], u = r.direction[l] >= 0, d, f;
|
|
1471
1471
|
u ? (d = M(e), f = N(e, c)) : (d = N(e, c), f = M(e));
|
|
1472
|
-
let p =
|
|
1472
|
+
let p = Z(d, o, r, i, a) ? tn(d, t, n, r, i, a) : null;
|
|
1473
1473
|
if (p) {
|
|
1474
1474
|
let e = p.point[l];
|
|
1475
1475
|
if (u ? e <= o[f + s] : e >= o[f + s + 3]) return p;
|
|
1476
1476
|
}
|
|
1477
|
-
let m =
|
|
1477
|
+
let m = Z(f, o, r, i, a) ? tn(f, t, n, r, i, a) : null;
|
|
1478
1478
|
return p && m ? p.distance <= m.distance ? p : m : p || m || null;
|
|
1479
1479
|
}
|
|
1480
1480
|
}
|
|
1481
1481
|
//#endregion
|
|
1482
1482
|
//#region node_modules/three-mesh-bvh/src/core/cast/intersectsGeometry_indirect.generated.js
|
|
1483
|
-
var nn = /* @__PURE__ */ new r(), rn = /* @__PURE__ */ new
|
|
1483
|
+
var nn = /* @__PURE__ */ new r(), rn = /* @__PURE__ */ new W(), an = /* @__PURE__ */ new W(), on = /* @__PURE__ */ new d(), sn = /* @__PURE__ */ new G(), cn = /* @__PURE__ */ new G();
|
|
1484
1484
|
function ln(e, t, n, r) {
|
|
1485
1485
|
L.setBuffer(e._roots[t]);
|
|
1486
1486
|
let i = un(0, e, n, r);
|
|
@@ -1494,15 +1494,15 @@ function un(e, t, n, r, i = null) {
|
|
|
1494
1494
|
intersectsBounds: (e) => cn.intersectsBox(e),
|
|
1495
1495
|
intersectsTriangle: (e) => {
|
|
1496
1496
|
e.a.applyMatrix4(r), e.b.applyMatrix4(r), e.c.applyMatrix4(r), e.needsUpdate = !0;
|
|
1497
|
-
for (let n = p, r = m + p; n < r; n++) if (
|
|
1497
|
+
for (let n = p, r = m + p; n < r; n++) if (X(an, 3 * t.resolveTriangleIndex(n), l, u), an.needsUpdate = !0, e.intersectsTriangle(an)) return !0;
|
|
1498
1498
|
return !1;
|
|
1499
1499
|
}
|
|
1500
1500
|
});
|
|
1501
1501
|
{
|
|
1502
|
-
let e =
|
|
1502
|
+
let e = Je(n);
|
|
1503
1503
|
for (let n = p, r = m + p; n < r; n++) {
|
|
1504
|
-
|
|
1505
|
-
for (let t = 0, n = e * 3; t < n; t += 3) if (
|
|
1504
|
+
X(rn, 3 * t.resolveTriangleIndex(n), l, u), rn.a.applyMatrix4(on), rn.b.applyMatrix4(on), rn.c.applyMatrix4(on), rn.needsUpdate = !0;
|
|
1505
|
+
for (let t = 0, n = e * 3; t < n; t += 3) if (X(an, t, d, f), an.needsUpdate = !0, rn.intersectsTriangle(an)) return !0;
|
|
1506
1506
|
}
|
|
1507
1507
|
}
|
|
1508
1508
|
} else {
|
|
@@ -1512,10 +1512,10 @@ function un(e, t, n, r, i = null) {
|
|
|
1512
1512
|
}
|
|
1513
1513
|
//#endregion
|
|
1514
1514
|
//#region node_modules/three-mesh-bvh/src/core/cast/closestPointToGeometry_indirect.generated.js
|
|
1515
|
-
var dn = /* @__PURE__ */ new d(), fn = /* @__PURE__ */ new
|
|
1515
|
+
var dn = /* @__PURE__ */ new d(), fn = /* @__PURE__ */ new G(), pn = /* @__PURE__ */ new G(), mn = /* @__PURE__ */ new b(), hn = /* @__PURE__ */ new b(), gn = /* @__PURE__ */ new b(), _n = /* @__PURE__ */ new b();
|
|
1516
1516
|
function vn(e, t, n, r = {}, i = {}, a = 0, o = Infinity) {
|
|
1517
1517
|
t.boundingBox || t.computeBoundingBox(), fn.set(t.boundingBox.min, t.boundingBox.max, n), fn.needsUpdate = !0;
|
|
1518
|
-
let s = e.geometry, c = s.attributes.position, l = s.index, u = t.attributes.position, d = t.index, f =
|
|
1518
|
+
let s = e.geometry, c = s.attributes.position, l = s.index, u = t.attributes.position, d = t.index, f = K.getPrimitive(), p = K.getPrimitive(), m = mn, h = hn, g = null, _ = null;
|
|
1519
1519
|
i && (g = gn, _ = _n);
|
|
1520
1520
|
let v = Infinity, y = null, b = null;
|
|
1521
1521
|
return dn.copy(n).invert(), pn.matrix.copy(dn), e.shapecast({
|
|
@@ -1530,10 +1530,10 @@ function vn(e, t, n, r = {}, i = {}, a = 0, o = Infinity) {
|
|
|
1530
1530
|
intersectsRange: (t, o) => {
|
|
1531
1531
|
for (let x = t, S = t + o; x < S; x++) {
|
|
1532
1532
|
let t = s.resolveTriangleIndex(x);
|
|
1533
|
-
|
|
1533
|
+
X(p, 3 * t, d, u), p.a.applyMatrix4(n), p.b.applyMatrix4(n), p.c.applyMatrix4(n), p.needsUpdate = !0;
|
|
1534
1534
|
for (let t = r, n = r + i; t < n; t++) {
|
|
1535
1535
|
let n = e.resolveTriangleIndex(t);
|
|
1536
|
-
|
|
1536
|
+
X(f, 3 * n, l, c), f.needsUpdate = !0;
|
|
1537
1537
|
let r = f.distanceToTriangle(p, m, g);
|
|
1538
1538
|
if (r < v && (h.copy(m), _ && _.copy(g), v = r, y = t, b = x), r < a) return !0;
|
|
1539
1539
|
}
|
|
@@ -1541,19 +1541,19 @@ function vn(e, t, n, r = {}, i = {}, a = 0, o = Infinity) {
|
|
|
1541
1541
|
}
|
|
1542
1542
|
});
|
|
1543
1543
|
} else {
|
|
1544
|
-
let o =
|
|
1544
|
+
let o = Je(t);
|
|
1545
1545
|
for (let t = 0, s = o; t < s; t++) {
|
|
1546
|
-
|
|
1546
|
+
X(p, 3 * t, d, u), p.a.applyMatrix4(n), p.b.applyMatrix4(n), p.c.applyMatrix4(n), p.needsUpdate = !0;
|
|
1547
1547
|
for (let n = r, o = r + i; n < o; n++) {
|
|
1548
1548
|
let r = e.resolveTriangleIndex(n);
|
|
1549
|
-
|
|
1549
|
+
X(f, 3 * r, l, c), f.needsUpdate = !0;
|
|
1550
1550
|
let i = f.distanceToTriangle(p, m, g);
|
|
1551
1551
|
if (i < v && (h.copy(m), _ && _.copy(g), v = i, y = n, b = t), i < a) return !0;
|
|
1552
1552
|
}
|
|
1553
1553
|
}
|
|
1554
1554
|
}
|
|
1555
1555
|
}
|
|
1556
|
-
}),
|
|
1556
|
+
}), K.releasePrimitive(f), K.releasePrimitive(p), v === Infinity ? null : (r.point ? r.point.copy(h) : r.point = h.clone(), r.distance = v, r.faceIndex = y, i && (i.point ? i.point.copy(_) : i.point = _.clone(), i.point.applyMatrix4(dn), h.applyMatrix4(dn), i.distance = h.sub(i.point).length(), i.faceIndex = b), r);
|
|
1557
1557
|
}
|
|
1558
1558
|
//#endregion
|
|
1559
1559
|
//#region node_modules/three-mesh-bvh/src/utils/GeometryRayIntersectUtilities.js
|
|
@@ -1562,11 +1562,11 @@ function yn(e, t, n) {
|
|
|
1562
1562
|
}
|
|
1563
1563
|
//#endregion
|
|
1564
1564
|
//#region node_modules/three-mesh-bvh/src/core/MeshBVH.js
|
|
1565
|
-
var bn = /* @__PURE__ */ new
|
|
1565
|
+
var bn = /* @__PURE__ */ new G(), xn = /* @__PURE__ */ new g(), Sn = /* @__PURE__ */ new b(), Cn = /* @__PURE__ */ new d(), wn = /* @__PURE__ */ new b(), Tn = [
|
|
1566
1566
|
"getX",
|
|
1567
1567
|
"getY",
|
|
1568
1568
|
"getZ"
|
|
1569
|
-
], En = class e extends
|
|
1569
|
+
], En = class e extends tt {
|
|
1570
1570
|
static serialize(e, t = {}) {
|
|
1571
1571
|
t = {
|
|
1572
1572
|
cloneBuffers: !0,
|
|
@@ -1680,15 +1680,15 @@ var bn = /* @__PURE__ */ new K(), xn = /* @__PURE__ */ new g(), Sn = /* @__PURE_
|
|
|
1680
1680
|
return n;
|
|
1681
1681
|
}
|
|
1682
1682
|
refit(e = null) {
|
|
1683
|
-
return (this.indirect ? Xt :
|
|
1683
|
+
return (this.indirect ? Xt : Et)(this, e);
|
|
1684
1684
|
}
|
|
1685
1685
|
raycast(e, t = o, n = 0, r = Infinity) {
|
|
1686
|
-
let i = this._roots, a = [], s = this.indirect ? Zt :
|
|
1686
|
+
let i = this._roots, a = [], s = this.indirect ? Zt : At;
|
|
1687
1687
|
for (let o = 0, c = i.length; o < c; o++) s(this, o, t, e, a, n, r);
|
|
1688
1688
|
return a;
|
|
1689
1689
|
}
|
|
1690
1690
|
raycastFirst(e, t = o, n = 0, r = Infinity) {
|
|
1691
|
-
let i = this._roots, a = null, s = this.indirect ? en :
|
|
1691
|
+
let i = this._roots, a = null, s = this.indirect ? en : Nt;
|
|
1692
1692
|
for (let o = 0, c = i.length; o < c; o++) {
|
|
1693
1693
|
let i = s(this, o, t, e, n, r);
|
|
1694
1694
|
i != null && (a == null || i.distance < a.distance) && (a = i);
|
|
@@ -1701,25 +1701,25 @@ var bn = /* @__PURE__ */ new K(), xn = /* @__PURE__ */ new g(), Sn = /* @__PURE_
|
|
|
1701
1701
|
return n;
|
|
1702
1702
|
}
|
|
1703
1703
|
shapecast(e) {
|
|
1704
|
-
let t =
|
|
1704
|
+
let t = K.getPrimitive(), n = super.shapecast({
|
|
1705
1705
|
...e,
|
|
1706
1706
|
intersectsPrimitive: e.intersectsTriangle,
|
|
1707
1707
|
scratchPrimitive: t,
|
|
1708
|
-
iterate: this.indirect ?
|
|
1708
|
+
iterate: this.indirect ? kt : Tt
|
|
1709
1709
|
});
|
|
1710
|
-
return
|
|
1710
|
+
return K.releasePrimitive(t), n;
|
|
1711
1711
|
}
|
|
1712
1712
|
bvhcast(t, n, r) {
|
|
1713
|
-
let { intersectsRanges: i, intersectsTriangles: a } = r, o =
|
|
1713
|
+
let { intersectsRanges: i, intersectsTriangles: a } = r, o = K.getPrimitive(), s = this.geometry.index, c = this.geometry.attributes.position, l = this.indirect ? (e) => {
|
|
1714
1714
|
let t = this.resolveTriangleIndex(e);
|
|
1715
|
-
|
|
1715
|
+
X(o, t * 3, s, c);
|
|
1716
1716
|
} : (e) => {
|
|
1717
|
-
|
|
1718
|
-
}, u =
|
|
1717
|
+
X(o, e * 3, s, c);
|
|
1718
|
+
}, u = K.getPrimitive(), d = t.geometry.index, f = t.geometry.attributes.position, p = t.indirect ? (e) => {
|
|
1719
1719
|
let n = t.resolveTriangleIndex(e);
|
|
1720
|
-
|
|
1720
|
+
X(u, n * 3, d, f);
|
|
1721
1721
|
} : (e) => {
|
|
1722
|
-
|
|
1722
|
+
X(u, e * 3, d, f);
|
|
1723
1723
|
};
|
|
1724
1724
|
if (a) {
|
|
1725
1725
|
if (!(t instanceof e)) throw Error("MeshBVH: \"intersectsTriangles\" callback can only be used with another MeshBVH.");
|
|
@@ -1755,7 +1755,7 @@ var bn = /* @__PURE__ */ new K(), xn = /* @__PURE__ */ new g(), Sn = /* @__PURE_
|
|
|
1755
1755
|
return (this.indirect ? vn : Yt)(this, e, t, n, r, i, a);
|
|
1756
1756
|
}
|
|
1757
1757
|
closestPointToPoint(e, t = {}, n = 0, r = Infinity) {
|
|
1758
|
-
return
|
|
1758
|
+
return lt(this, e, t, n, r);
|
|
1759
1759
|
}
|
|
1760
1760
|
}, Dn = {
|
|
1761
1761
|
Mesh: f.prototype.raycast,
|
|
@@ -1868,6 +1868,12 @@ var Un = class t {
|
|
|
1868
1868
|
static {
|
|
1869
1869
|
this.LIGHT_APERTURE_DEGREES = 13;
|
|
1870
1870
|
}
|
|
1871
|
+
static {
|
|
1872
|
+
this.DEPTH_PADDING_FACTOR = 1.5;
|
|
1873
|
+
}
|
|
1874
|
+
static {
|
|
1875
|
+
this.AMBIENT_MAX_ELEVATION_SIN = .98;
|
|
1876
|
+
}
|
|
1871
1877
|
static {
|
|
1872
1878
|
this.AMBIENT_MIN_ELEVATION_DEGREES = 55;
|
|
1873
1879
|
}
|
|
@@ -1925,7 +1931,12 @@ var Un = class t {
|
|
|
1925
1931
|
depthBuffer: !1,
|
|
1926
1932
|
stencilBuffer: !1
|
|
1927
1933
|
}), u = new e.CircleGeometry(s.halfExtent, 64);
|
|
1928
|
-
|
|
1934
|
+
try {
|
|
1935
|
+
this.accumulateShadowPasses(r, a, o, s, l, u);
|
|
1936
|
+
} catch (e) {
|
|
1937
|
+
throw l.dispose(), u.dispose(), e;
|
|
1938
|
+
}
|
|
1939
|
+
if (r.getContext().isContextLost()) {
|
|
1929
1940
|
l.dispose(), u.dispose(), this.leaveLiveCatcherInCharge(i), console.warn("Contact-shadow bake aborted: WebGL context was lost mid-bake");
|
|
1930
1941
|
return;
|
|
1931
1942
|
}
|
|
@@ -1991,9 +2002,9 @@ var Un = class t {
|
|
|
1991
2002
|
let i = n.shadow.camera, a = r.shadow.camera;
|
|
1992
2003
|
return a.left = i.left, a.right = i.right, a.top = i.top, a.bottom = i.bottom, a.updateProjectionMatrix(), r;
|
|
1993
2004
|
}
|
|
1994
|
-
fitBakeDepthRange(e,
|
|
1995
|
-
let
|
|
1996
|
-
|
|
2005
|
+
fitBakeDepthRange(e, n) {
|
|
2006
|
+
let r = e.target.position.clone().sub(e.position).normalize(), i = n.center.clone().sub(e.position).dot(r), a = n.boundingRadius * t.DEPTH_PADDING_FACTOR + n.halfExtent, o = e.shadow.camera;
|
|
2007
|
+
o.near = Math.max(i - a, i * .01), o.far = i + a, o.updateProjectionMatrix();
|
|
1997
2008
|
}
|
|
1998
2009
|
createBakeCamera(t) {
|
|
1999
2010
|
let n = new e.OrthographicCamera(-t.halfExtent, t.halfExtent, t.halfExtent, -t.halfExtent, .1, Math.max(t.objectHeight, 1) * 4);
|
|
@@ -2007,9 +2018,9 @@ var Un = class t {
|
|
|
2007
2018
|
let t = m * Math.sqrt((e + .5) / f), n = e * Bn;
|
|
2008
2019
|
h.push(i.clone().addScaledVector(l, t * Math.cos(n)).addScaledVector(u, t * Math.sin(n)));
|
|
2009
2020
|
}
|
|
2010
|
-
let g = Math.sin(e.MathUtils.degToRad(t.AMBIENT_MIN_ELEVATION_DEGREES));
|
|
2021
|
+
let g = Math.sin(e.MathUtils.degToRad(t.AMBIENT_MIN_ELEVATION_DEGREES)), _ = t.AMBIENT_MAX_ELEVATION_SIN;
|
|
2011
2022
|
for (let t = 0; t < d; t++) {
|
|
2012
|
-
let n = Math.sqrt((t + .5) / d), r = g + (
|
|
2023
|
+
let n = Math.sqrt((t + .5) / d), r = g + (_ - g) * n, i = Math.sqrt(1 - r * r), o = t * Bn;
|
|
2013
2024
|
h.push(new e.Vector3(i * Math.cos(o), r, i * Math.sin(o)).multiplyScalar(s).add(a));
|
|
2014
2025
|
}
|
|
2015
2026
|
return h;
|
|
@@ -2047,6 +2058,30 @@ var Un = class t {
|
|
|
2047
2058
|
t.colorWrite = e;
|
|
2048
2059
|
});
|
|
2049
2060
|
}
|
|
2061
|
+
}, Wn = (e, t) => {
|
|
2062
|
+
if (e && typeof e == "object") {
|
|
2063
|
+
let n = e[t];
|
|
2064
|
+
if (typeof n == "function") return n.call(e);
|
|
2065
|
+
}
|
|
2066
|
+
return null;
|
|
2050
2067
|
};
|
|
2068
|
+
function Gn(t) {
|
|
2069
|
+
return Wn(t, "getThreeObject") ?? (t instanceof e.Object3D ? t : null);
|
|
2070
|
+
}
|
|
2071
|
+
function Kn(t) {
|
|
2072
|
+
return Wn(t, "getThreeCamera") ?? (t instanceof e.Camera ? t : null);
|
|
2073
|
+
}
|
|
2074
|
+
function qn(t) {
|
|
2075
|
+
return Wn(t, "getThreeScene") ?? (t instanceof e.Scene ? t : null);
|
|
2076
|
+
}
|
|
2077
|
+
function Jn(t) {
|
|
2078
|
+
return Wn(t, "getThreeTexture") ?? (t instanceof e.Texture ? t : null);
|
|
2079
|
+
}
|
|
2080
|
+
function Yn(t) {
|
|
2081
|
+
return Wn(t, "getThreeRenderer") ?? (t instanceof e.WebGLRenderer ? t : null);
|
|
2082
|
+
}
|
|
2083
|
+
function Xn(e) {
|
|
2084
|
+
return Wn(e, "getThreeControls");
|
|
2085
|
+
}
|
|
2051
2086
|
//#endregion
|
|
2052
|
-
export {
|
|
2087
|
+
export { x as A, ue as C, w as D, T as E, C as O, A as S, ee as T, Ye as _, qn as a, j as b, Rn as c, zn as d, Hn as f, En as g, jn as h, Yn as i, S as k, Ln as l, Fn as m, Xn as n, Jn as o, Pn as p, Gn as r, In as s, Kn as t, Un as u, qe as v, ne as w, k as x, P as y };
|