softbox 4.22.0 → 4.24.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/README.md +53 -0
- package/dist/{ThreePathTracingService-Io1vC_FO.cjs → ThreePathTracingService-CamzPwtW.cjs} +4 -4
- package/dist/{ThreePathTracingService-CcWLjj2l.js → ThreePathTracingService-yCaEtW_f.js} +51 -51
- package/dist/index.d.cts +53 -0
- package/dist/index.d.ts +53 -0
- package/dist/simple-viewer.cjs +7 -7
- package/dist/simple-viewer.es.js +1760 -1543
- package/dist/smoothstep-BsyRnZAu.cjs +2 -0
- package/dist/{smoothstep-DR5B0_eF.js → smoothstep-gC155W8-.js} +216 -214
- package/package.json +1 -1
- package/dist/smoothstep-DUhHZEuB.cjs +0 -2
|
@@ -507,7 +507,7 @@ var He = new class {
|
|
|
507
507
|
});
|
|
508
508
|
};
|
|
509
509
|
}
|
|
510
|
-
}(), Ue = /* @__PURE__ */ new r(),
|
|
510
|
+
}(), Ue = /* @__PURE__ */ new r(), V = /* @__PURE__ */ new Float32Array(6), We = class {
|
|
511
511
|
constructor() {
|
|
512
512
|
this._roots = null, this.primitiveBuffer = null, this.primitiveBufferStride = null;
|
|
513
513
|
}
|
|
@@ -529,8 +529,8 @@ var He = 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, V, 0);
|
|
533
|
+
let [e, t, r, u, d, f] = V;
|
|
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 He = 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, V, 0);
|
|
542
|
+
let [e, t, a, o, s, c] = V, 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;
|
|
@@ -569,7 +569,7 @@ var He = 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, V, 0), a.set(V, t);
|
|
573
573
|
} else {
|
|
574
574
|
let e = M(t), n = N(t, r);
|
|
575
575
|
for (let r = 0; r < 3; r++) {
|
|
@@ -606,44 +606,44 @@ var He = new class {
|
|
|
606
606
|
};
|
|
607
607
|
//#endregion
|
|
608
608
|
//#region node_modules/three-mesh-bvh/src/utils/BufferUtils.js
|
|
609
|
-
function
|
|
609
|
+
function Ge() {
|
|
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 Ke(e) {
|
|
615
615
|
return e.index ? e.index.count : e.attributes.position.count;
|
|
616
616
|
}
|
|
617
|
-
function
|
|
618
|
-
return
|
|
617
|
+
function qe(e) {
|
|
618
|
+
return Ke(e) / 3;
|
|
619
619
|
}
|
|
620
|
-
function
|
|
620
|
+
function Je(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 Ye(e, t) {
|
|
624
624
|
if (!e.index) {
|
|
625
|
-
let n = e.attributes.position.count, r =
|
|
625
|
+
let n = e.attributes.position.count, r = Je(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 Xe(e, t, n) {
|
|
631
|
+
let r = Ke(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 Ze(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 Qe(e, t, n) {
|
|
644
|
+
let r = Xe(e, t, n), i = Ze(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 = Ke(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 $e(e, t, n) {
|
|
|
667
667
|
}
|
|
668
668
|
//#endregion
|
|
669
669
|
//#region node_modules/three-mesh-bvh/src/core/GeometryBVH.js
|
|
670
|
-
function
|
|
670
|
+
function $e(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 et(e, t) {
|
|
|
676
676
|
}
|
|
677
677
|
return s;
|
|
678
678
|
}
|
|
679
|
-
var
|
|
679
|
+
var et = class extends We {
|
|
680
680
|
get indirect() {
|
|
681
681
|
return !!this._indirectBuffer;
|
|
682
682
|
}
|
|
@@ -694,7 +694,7 @@ var tt = class extends Ge {
|
|
|
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 && !Ge()) 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 tt = class extends Ge {
|
|
|
703
703
|
init(e) {
|
|
704
704
|
let { geometry: t, primitiveStride: n } = this;
|
|
705
705
|
if (e.indirect) {
|
|
706
|
-
let r =
|
|
706
|
+
let r = $e(Qe(t, e.range, n), e.useSharedArrayBuffer);
|
|
707
707
|
this._indirectBuffer = r;
|
|
708
|
-
} else
|
|
708
|
+
} else Ye(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
|
+
}] : Qe(this.geometry, e, this.primitiveStride);
|
|
716
716
|
}
|
|
717
717
|
raycastObject3D() {
|
|
718
718
|
throw Error("BVH: raycastObject3D() not implemented");
|
|
719
719
|
}
|
|
720
|
-
},
|
|
720
|
+
}, H = class {
|
|
721
721
|
constructor() {
|
|
722
722
|
this.min = Infinity, this.max = -Infinity;
|
|
723
723
|
}
|
|
@@ -741,7 +741,7 @@ var tt = class extends Ge {
|
|
|
741
741
|
return this.min > e.max || e.min > this.max;
|
|
742
742
|
}
|
|
743
743
|
};
|
|
744
|
-
|
|
744
|
+
H.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 @@ V.prototype.setFromBox = (function() {
|
|
|
755
755
|
})();
|
|
756
756
|
//#endregion
|
|
757
757
|
//#region node_modules/three-mesh-bvh/src/math/MathUtilities.js
|
|
758
|
-
var
|
|
758
|
+
var tt = (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 nt = (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
|
+
})(), nt = (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
|
+
tt(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 nt = (function() {
|
|
|
792
792
|
}
|
|
793
793
|
}
|
|
794
794
|
};
|
|
795
|
-
})(),
|
|
795
|
+
})(), rt = (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 nt = (function() {
|
|
|
804
804
|
}
|
|
805
805
|
return !1;
|
|
806
806
|
};
|
|
807
|
-
})(),
|
|
807
|
+
})(), it = [
|
|
808
808
|
"x",
|
|
809
809
|
"y",
|
|
810
810
|
"z"
|
|
811
|
-
],
|
|
812
|
-
function
|
|
813
|
-
return Math.abs(e) <
|
|
811
|
+
], U = 1e-15, at = U * U;
|
|
812
|
+
function W(e) {
|
|
813
|
+
return Math.abs(e) < U;
|
|
814
814
|
}
|
|
815
|
-
var
|
|
815
|
+
var G = class extends v {
|
|
816
816
|
constructor(...e) {
|
|
817
817
|
super(...e), this.isExtendedTriangle = !0, this.satAxes = [
|
|
818
818
|
,
|
|
@@ -824,14 +824,14 @@ var W = class extends v {
|
|
|
824
824
|
,
|
|
825
825
|
,
|
|
826
826
|
,
|
|
827
|
-
].fill().map(() => new
|
|
827
|
+
].fill().map(() => new H()), 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 rt(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 W = 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 < U ? h < U || g < U ? this.isDegenerateIntoPoint = !0 : (this.isDegenerateIntoSegment = !0, this.degenerateSegment.start.copy(e), this.degenerateSegment.end.copy(n)) : h < U ? g < U ? this.isDegenerateIntoPoint = !0 : (this.isDegenerateIntoSegment = !0, this.degenerateSegment.start.copy(t), this.degenerateSegment.end.copy(e)) : g < U && (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
|
+
G.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]), nt(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
|
+
})(), G.prototype.intersectsTriangle = (function() {
|
|
860
|
+
let e = /* @__PURE__ */ new G(), t = /* @__PURE__ */ new H(), n = /* @__PURE__ */ new H(), 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 @@ W.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 W(o) ? W(s) ? p(e, t, n, i) : (n && (n.start.copy(a.start), n.end.copy(a.start)), e.containsPoint(a.start)) : W(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 W(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) < at ? (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 (W(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 : W(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) < at ? (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 @@ W.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
|
+
W(g) && (g = 0), W(_) && (_ = 0), W(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
|
+
W(S) && (S = 0), W(C) && (C = 0), W(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 = it[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 @@ W.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
|
+
})(), G.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
|
+
})(), G.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 @@ W.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]), nt(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 @@ W.prototype.closestPointToSegment = (function() {
|
|
|
975
975
|
})();
|
|
976
976
|
//#endregion
|
|
977
977
|
//#region node_modules/three-mesh-bvh/src/math/OrientedBox.js
|
|
978
|
-
var
|
|
978
|
+
var K = 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 G = class {
|
|
|
985
985
|
,
|
|
986
986
|
,
|
|
987
987
|
,
|
|
988
|
-
].fill().map(() => new
|
|
988
|
+
].fill().map(() => new H()), this.alignedSatBounds = [
|
|
989
989
|
,
|
|
990
990
|
,
|
|
991
991
|
,
|
|
992
|
-
].fill().map(() => new
|
|
992
|
+
].fill().map(() => new H()), 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 G = 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
|
+
K.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 @@ G.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
|
+
})(), K.prototype.intersectsBox = (function() {
|
|
1017
|
+
let e = /* @__PURE__ */ new H();
|
|
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 @@ G.prototype.update = (function() {
|
|
|
1025
1025
|
}
|
|
1026
1026
|
return !0;
|
|
1027
1027
|
};
|
|
1028
|
-
})(),
|
|
1029
|
-
let e = /* @__PURE__ */ new
|
|
1028
|
+
})(), K.prototype.intersectsTriangle = (function() {
|
|
1029
|
+
let e = /* @__PURE__ */ new G(), t = [
|
|
1030
1030
|
,
|
|
1031
1031
|
,
|
|
1032
1032
|
,
|
|
1033
|
-
], n = /* @__PURE__ */ new
|
|
1033
|
+
], n = /* @__PURE__ */ new H(), r = /* @__PURE__ */ new H(), 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 @@ G.prototype.update = (function() {
|
|
|
1053
1053
|
}
|
|
1054
1054
|
return !0;
|
|
1055
1055
|
};
|
|
1056
|
-
})(),
|
|
1056
|
+
})(), K.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
|
+
})(), K.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
|
+
})(), K.prototype.distanceToBox = (function() {
|
|
1066
1066
|
let e = [
|
|
1067
1067
|
"x",
|
|
1068
1068
|
"y",
|
|
@@ -1093,7 +1093,7 @@ G.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
|
+
nt(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 @@ G.prototype.update = (function() {
|
|
|
1101
1101
|
return Math.sqrt(p);
|
|
1102
1102
|
};
|
|
1103
1103
|
})();
|
|
1104
|
-
var
|
|
1104
|
+
var q = /* @__PURE__ */ new class extends Oe {
|
|
1105
1105
|
constructor() {
|
|
1106
|
-
super(() => new
|
|
1106
|
+
super(() => new G());
|
|
1107
1107
|
}
|
|
1108
|
-
}(),
|
|
1109
|
-
function
|
|
1108
|
+
}(), ot = /* @__PURE__ */ new b(), st = /* @__PURE__ */ new b();
|
|
1109
|
+
function ct(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) => (ot.copy(t).clamp(e.min, e.max), ot.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, ot);
|
|
1116
|
+
let r = t.distanceToSquared(ot);
|
|
1117
|
+
return r < s && (st.copy(ot), 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(st) : n.point = st.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 lt = parseInt(h) >= 169, ut = parseInt(h) <= 161, J = /* @__PURE__ */ new b(), Y = /* @__PURE__ */ new b(), X = /* @__PURE__ */ new b(), dt = /* @__PURE__ */ new y(), ft = /* @__PURE__ */ new y(), pt = /* @__PURE__ */ new y(), mt = /* @__PURE__ */ new b(), ht = /* @__PURE__ */ new b(), gt = /* @__PURE__ */ new b(), _t = /* @__PURE__ */ new b();
|
|
1126
|
+
function vt(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 yt(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 yt(e, t, n, r, i, a, o, s, c, l, u) {
|
|
1136
|
+
J.fromBufferAttribute(t, a), Y.fromBufferAttribute(t, o), X.fromBufferAttribute(t, s);
|
|
1137
|
+
let d = vt(e, J, Y, X, _t, c, l, u);
|
|
1138
1138
|
if (d) {
|
|
1139
1139
|
if (r) {
|
|
1140
|
-
|
|
1141
|
-
let e = v.getInterpolation(
|
|
1142
|
-
|
|
1140
|
+
dt.fromBufferAttribute(r, a), ft.fromBufferAttribute(r, o), pt.fromBufferAttribute(r, s), d.uv = new y();
|
|
1141
|
+
let e = v.getInterpolation(_t, J, Y, X, dt, ft, pt, d.uv);
|
|
1142
|
+
lt || (d.uv = e);
|
|
1143
1143
|
}
|
|
1144
1144
|
if (i) {
|
|
1145
|
-
|
|
1146
|
-
let e = v.getInterpolation(
|
|
1147
|
-
|
|
1145
|
+
dt.fromBufferAttribute(i, a), ft.fromBufferAttribute(i, o), pt.fromBufferAttribute(i, s), d.uv1 = new y();
|
|
1146
|
+
let e = v.getInterpolation(_t, J, Y, X, dt, ft, pt, d.uv1);
|
|
1147
|
+
lt || (d.uv1 = e), ut && (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
|
+
mt.fromBufferAttribute(n, a), ht.fromBufferAttribute(n, o), gt.fromBufferAttribute(n, s), d.normal = new b();
|
|
1151
|
+
let t = v.getInterpolation(_t, J, Y, X, mt, ht, gt, d.normal);
|
|
1152
|
+
d.normal.dot(e.direction) > 0 && d.normal.multiplyScalar(-1), lt || (d.normal = t);
|
|
1153
1153
|
}
|
|
1154
1154
|
let t = {
|
|
1155
1155
|
a,
|
|
@@ -1158,17 +1158,17 @@ function bt(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(
|
|
1161
|
+
if (v.getNormal(J, Y, X, t.normal), d.face = t, d.faceIndex = a, lt) {
|
|
1162
1162
|
let e = new b();
|
|
1163
|
-
v.getBarycoord(
|
|
1163
|
+
v.getBarycoord(_t, J, Y, X, e), d.barycoord = e;
|
|
1164
1164
|
}
|
|
1165
1165
|
}
|
|
1166
1166
|
return d;
|
|
1167
1167
|
}
|
|
1168
|
-
function
|
|
1168
|
+
function bt(e) {
|
|
1169
1169
|
return e && e.isMaterial ? e.side : e;
|
|
1170
1170
|
}
|
|
1171
|
-
function
|
|
1171
|
+
function xt(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 St(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 = bt(t[v]), s = yt(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 = bt(t), s = yt(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 St(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 Z(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 St(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++) xt(c, t, n, e, a, o, s);
|
|
1203
1203
|
}
|
|
1204
|
-
function
|
|
1204
|
+
function Ct(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 = xt(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 wt(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, Z(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 Tt(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 Et(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 Q(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 Et(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++) xt(c, t, n, l ? l[e] : e, a, o, s);
|
|
1267
1267
|
}
|
|
1268
|
-
function
|
|
1268
|
+
function Dt(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 = xt(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 Ot(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), Z(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
|
|
1287
|
-
L.setBuffer(e._roots[t]),
|
|
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
1288
|
}
|
|
1289
|
-
function
|
|
1289
|
+
function At(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)) St(t, n, r, A(e, l), j(u, c), i, a, o);
|
|
1292
1292
|
else {
|
|
1293
1293
|
let c = M(e);
|
|
1294
|
-
|
|
1294
|
+
Q(c, s, r, a, o) && At(c, t, n, r, i, a, o);
|
|
1295
1295
|
let u = N(e, l);
|
|
1296
|
-
|
|
1296
|
+
Q(u, s, r, a, o) && At(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 jt = [
|
|
1302
1302
|
"x",
|
|
1303
1303
|
"y",
|
|
1304
1304
|
"z"
|
|
1305
1305
|
];
|
|
1306
|
-
function
|
|
1306
|
+
function Mt(e, t, n, r, i, a) {
|
|
1307
1307
|
L.setBuffer(e._roots[t]);
|
|
1308
|
-
let o =
|
|
1308
|
+
let o = Nt(0, e, n, r, i, a);
|
|
1309
1309
|
return L.clearBuffer(), o;
|
|
1310
1310
|
}
|
|
1311
|
-
function
|
|
1311
|
+
function Nt(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 Ct(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 = jt[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 = Q(d, o, r, i, a) ? Nt(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 = Q(f, o, r, i, a) ? Nt(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 Pt = /* @__PURE__ */ new r(), Ft = /* @__PURE__ */ new G(), It = /* @__PURE__ */ new G(), Lt = /* @__PURE__ */ new d(), Rt = /* @__PURE__ */ new K(), zt = /* @__PURE__ */ new K();
|
|
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 (Z(It, t, l, u), It.needsUpdate = !0, e.intersectsTriangle(It)) return !0;
|
|
1343
1343
|
return !1;
|
|
1344
1344
|
}
|
|
1345
1345
|
});
|
|
1346
1346
|
{
|
|
1347
|
-
let e =
|
|
1347
|
+
let e = qe(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
|
+
Z(Ft, t, l, u), Ft.a.applyMatrix4(Lt), Ft.b.applyMatrix4(Lt), Ft.c.applyMatrix4(Lt), Ft.needsUpdate = !0;
|
|
1350
|
+
for (let t = 0, n = e * 3; t < n; t += 3) if (Z(It, t, d, f), It.needsUpdate = !0, Ft.intersectsTriangle(It)) 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, Pt), !!(i.intersectsBox(Pt) && Vt(o, t, n, r, i) || (O(P(c), a, Pt), i.intersectsBox(Pt) && 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 K(), Wt = /* @__PURE__ */ new K(), 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 = q.getPrimitive(), p = q.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
|
+
Z(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
|
+
Z(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 = qe(t);
|
|
1386
1386
|
for (let t = 0, o = i; t < o; t++) {
|
|
1387
|
-
|
|
1387
|
+
Z(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
|
+
Z(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
|
+
}), q.releasePrimitive(f), q.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)) Et(t, n, r, A(e, l), j(u, c), i, a, o);
|
|
1447
1447
|
else {
|
|
1448
1448
|
let c = M(e);
|
|
1449
|
-
|
|
1449
|
+
Q(c, s, r, a, o) && Qt(c, t, n, r, i, a, o);
|
|
1450
1450
|
let u = N(e, l);
|
|
1451
|
-
|
|
1451
|
+
Q(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 Dt(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 = Q(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 = Q(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 G(), an = /* @__PURE__ */ new G(), on = /* @__PURE__ */ new d(), sn = /* @__PURE__ */ new K(), cn = /* @__PURE__ */ new K();
|
|
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 (Z(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 = qe(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
|
+
Z(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 (Z(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 K(), pn = /* @__PURE__ */ new K(), 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 = q.getPrimitive(), p = q.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
|
+
Z(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
|
+
Z(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 = qe(t);
|
|
1545
1545
|
for (let t = 0, s = o; t < s; t++) {
|
|
1546
|
-
|
|
1546
|
+
Z(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
|
+
Z(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
|
+
}), q.releasePrimitive(f), q.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 K(), 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 et {
|
|
1570
1570
|
static serialize(e, t = {}) {
|
|
1571
1571
|
t = {
|
|
1572
1572
|
cloneBuffers: !0,
|
|
@@ -1680,15 +1680,15 @@ var bn = /* @__PURE__ */ new G(), 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 : Tt)(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 : kt;
|
|
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 : Mt;
|
|
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 G(), xn = /* @__PURE__ */ new g(), Sn = /* @__PURE_
|
|
|
1701
1701
|
return n;
|
|
1702
1702
|
}
|
|
1703
1703
|
shapecast(e) {
|
|
1704
|
-
let t =
|
|
1704
|
+
let t = q.getPrimitive(), n = super.shapecast({
|
|
1705
1705
|
...e,
|
|
1706
1706
|
intersectsPrimitive: e.intersectsTriangle,
|
|
1707
1707
|
scratchPrimitive: t,
|
|
1708
|
-
iterate: this.indirect ?
|
|
1708
|
+
iterate: this.indirect ? Ot : wt
|
|
1709
1709
|
});
|
|
1710
|
-
return
|
|
1710
|
+
return q.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 = q.getPrimitive(), s = this.geometry.index, c = this.geometry.attributes.position, l = this.indirect ? (e) => {
|
|
1714
1714
|
let t = this.resolveTriangleIndex(e);
|
|
1715
|
-
|
|
1715
|
+
Z(o, t * 3, s, c);
|
|
1716
1716
|
} : (e) => {
|
|
1717
|
-
|
|
1718
|
-
}, u =
|
|
1717
|
+
Z(o, e * 3, s, c);
|
|
1718
|
+
}, u = q.getPrimitive(), d = t.geometry.index, f = t.geometry.attributes.position, p = t.indirect ? (e) => {
|
|
1719
1719
|
let n = t.resolveTriangleIndex(e);
|
|
1720
|
-
|
|
1720
|
+
Z(u, n * 3, d, f);
|
|
1721
1721
|
} : (e) => {
|
|
1722
|
-
|
|
1722
|
+
Z(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 G(), 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 ct(this, e, t, n, r);
|
|
1759
1759
|
}
|
|
1760
1760
|
}, Dn = {
|
|
1761
1761
|
Mesh: f.prototype.raycast,
|
|
@@ -1821,50 +1821,52 @@ function Mn(e) {
|
|
|
1821
1821
|
}
|
|
1822
1822
|
//#endregion
|
|
1823
1823
|
//#region src/infrastructure/three/disposal.ts
|
|
1824
|
-
var Nn = "softboxExternallyOwnedTextures", Pn = "softboxBackgroundNode";
|
|
1825
|
-
function
|
|
1826
|
-
if (!t.userData
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
let
|
|
1830
|
-
|
|
1824
|
+
var Nn = "softboxExternallyOwnedTextures", Pn = "softboxBackgroundNode", Fn = "softboxStashedMaterials";
|
|
1825
|
+
function In(t) {
|
|
1826
|
+
if (!t.userData.softboxDisposed) {
|
|
1827
|
+
if (!t.userData?.softboxExternallyOwnedTextures) {
|
|
1828
|
+
let n = t;
|
|
1829
|
+
for (let t of Object.keys(n)) {
|
|
1830
|
+
let r = n[t];
|
|
1831
|
+
r instanceof e.Texture && r.dispose();
|
|
1832
|
+
}
|
|
1833
|
+
let r = t;
|
|
1834
|
+
if (r.isShaderMaterial && r.uniforms) for (let t of Object.values(r.uniforms)) t?.value instanceof e.Texture && t.value.dispose();
|
|
1831
1835
|
}
|
|
1832
|
-
|
|
1833
|
-
if (r.isShaderMaterial && r.uniforms) for (let t of Object.values(r.uniforms)) t?.value instanceof e.Texture && t.value.dispose();
|
|
1836
|
+
t.dispose(), t.userData.softboxDisposed = !0;
|
|
1834
1837
|
}
|
|
1835
|
-
t.dispose(), t.userData.softboxDisposed = !0;
|
|
1836
1838
|
}
|
|
1837
|
-
function
|
|
1839
|
+
function Ln(e) {
|
|
1838
1840
|
e.traverse((e) => {
|
|
1839
1841
|
let t = e;
|
|
1840
1842
|
t.geometry && typeof t.geometry.dispose == "function" && (Mn(t.geometry), t.geometry.dispose());
|
|
1841
1843
|
let n = t.material;
|
|
1842
|
-
Array.isArray(n) ? n.forEach(
|
|
1844
|
+
Array.isArray(n) ? n.forEach(In) : n && In(n), (e.userData?.[Fn])?.forEach(In);
|
|
1843
1845
|
let r = e;
|
|
1844
1846
|
r.isLight && r.shadow?.dispose && r.shadow.dispose();
|
|
1845
1847
|
});
|
|
1846
1848
|
}
|
|
1847
|
-
function
|
|
1849
|
+
function Rn(t, n) {
|
|
1848
1850
|
if (!n?.keepBackgrounds) {
|
|
1849
1851
|
t.background instanceof e.Texture && (t.background.dispose(), t.background = null), t.environment instanceof e.Texture && (t.environment.dispose(), t.environment = null);
|
|
1850
1852
|
let n = t;
|
|
1851
1853
|
n.__originalEnvironmentTexture &&= void 0;
|
|
1852
1854
|
}
|
|
1853
|
-
for (let e of [...t.children]) n?.keepBackgrounds && e.userData?.softboxBackgroundNode || (
|
|
1855
|
+
for (let e of [...t.children]) n?.keepBackgrounds && e.userData?.softboxBackgroundNode || (Ln(e), t.remove(e));
|
|
1854
1856
|
}
|
|
1855
1857
|
//#endregion
|
|
1856
1858
|
//#region src/infrastructure/three/ContactShadowBaker.ts
|
|
1857
|
-
var
|
|
1858
|
-
function Un(e) {
|
|
1859
|
-
let t = e.getObjectByName(Rn);
|
|
1860
|
-
t && (e.remove(t), In(t));
|
|
1861
|
-
}
|
|
1859
|
+
var zn = "contact-shadow-baked", Bn = "contact-shadow-live", Vn = "softboxContactShadowHelper", Hn = "softboxPathTracingFloor", Un = Math.PI * (3 - Math.sqrt(5));
|
|
1862
1860
|
function Wn(e) {
|
|
1863
|
-
Un(e);
|
|
1864
1861
|
let t = e.getObjectByName(zn);
|
|
1862
|
+
t && (e.remove(t), Ln(t));
|
|
1863
|
+
}
|
|
1864
|
+
function Gn(e) {
|
|
1865
|
+
Wn(e);
|
|
1866
|
+
let t = e.getObjectByName(Bn);
|
|
1865
1867
|
t && (t.visible = !0);
|
|
1866
1868
|
}
|
|
1867
|
-
var
|
|
1869
|
+
var Kn = class t {
|
|
1868
1870
|
static {
|
|
1869
1871
|
this.AMBIENT_RATIO = .62;
|
|
1870
1872
|
}
|
|
@@ -1927,7 +1929,7 @@ var Gn = class t {
|
|
|
1927
1929
|
}
|
|
1928
1930
|
let s = this.measureBakeRegion(a);
|
|
1929
1931
|
if (!s) return;
|
|
1930
|
-
let c = i.getObjectByName(
|
|
1932
|
+
let c = i.getObjectByName(Bn);
|
|
1931
1933
|
c?.geometry instanceof e.CircleGeometry && (s.halfExtent = Math.min(s.halfExtent, c.geometry.parameters.radius));
|
|
1932
1934
|
let l = new e.WebGLRenderTarget(t.ACCUMULATION_TEXTURE_SIZE, t.ACCUMULATION_TEXTURE_SIZE, {
|
|
1933
1935
|
type: r.capabilities.isWebGL2 ? e.HalfFloatType : e.UnsignedByteType,
|
|
@@ -1946,10 +1948,10 @@ var Gn = class t {
|
|
|
1946
1948
|
this.installBakedMesh(i, s, l, u);
|
|
1947
1949
|
}
|
|
1948
1950
|
leaveLiveCatcherInCharge(e) {
|
|
1949
|
-
|
|
1951
|
+
Gn(e);
|
|
1950
1952
|
}
|
|
1951
1953
|
evictBakedMesh(e) {
|
|
1952
|
-
|
|
1954
|
+
Wn(e);
|
|
1953
1955
|
}
|
|
1954
1956
|
measureBakeRegion(n) {
|
|
1955
1957
|
let r = new e.Box3().setFromObject(n);
|
|
@@ -2018,12 +2020,12 @@ var Gn = class t {
|
|
|
2018
2020
|
l.lengthSq() < 1e-6 && l.set(1, 0, 0), l.normalize();
|
|
2019
2021
|
let u = new e.Vector3().crossVectors(c, l), d = Math.round(r * t.AMBIENT_RATIO), f = r - d, p = e.MathUtils.degToRad(t.LIGHT_APERTURE_DEGREES), m = Math.tan(p / 2) * s, h = [];
|
|
2020
2022
|
for (let e = 0; e < f; e++) {
|
|
2021
|
-
let t = m * Math.sqrt((e + .5) / f), n = e *
|
|
2023
|
+
let t = m * Math.sqrt((e + .5) / f), n = e * Un;
|
|
2022
2024
|
h.push(i.clone().addScaledVector(l, t * Math.cos(n)).addScaledVector(u, t * Math.sin(n)));
|
|
2023
2025
|
}
|
|
2024
2026
|
let g = Math.sin(e.MathUtils.degToRad(t.AMBIENT_MIN_ELEVATION_DEGREES)), _ = t.AMBIENT_MAX_ELEVATION_SIN;
|
|
2025
2027
|
for (let t = 0; t < d; t++) {
|
|
2026
|
-
let n = Math.sqrt((t + .5) / d), r = g + (_ - g) * n, i = Math.sqrt(1 - r * r), o = t *
|
|
2028
|
+
let n = Math.sqrt((t + .5) / d), r = g + (_ - g) * n, i = Math.sqrt(1 - r * r), o = t * Un;
|
|
2027
2029
|
h.push(new e.Vector3(i * Math.cos(o), r, i * Math.sin(o)).multiplyScalar(s).add(a));
|
|
2028
2030
|
}
|
|
2029
2031
|
return h;
|
|
@@ -2041,10 +2043,10 @@ var Gn = class t {
|
|
|
2041
2043
|
e.fragmentShader = e.fragmentShader.replace("#include <map_fragment>", "#include <map_fragment>\n diffuseColor.a = pow(diffuseColor.a, 0.75);");
|
|
2042
2044
|
}, o.customProgramCacheKey = () => "contact-shadow-alpha-gamma", o.addEventListener("dispose", () => i.dispose());
|
|
2043
2045
|
let s = new e.Mesh(a, o);
|
|
2044
|
-
s.name =
|
|
2046
|
+
s.name = zn, s.userData[Vn] = !0, s.rotation.x = -Math.PI / 2;
|
|
2045
2047
|
let c = e.MathUtils.clamp(r.objectHeight * t.FLOOR_LIFT_PER_HEIGHT, t.FLOOR_LIFT_MIN, t.FLOOR_LIFT_MAX);
|
|
2046
2048
|
s.position.set(r.center.x, c, r.center.z), s.userData.renderTarget = i, n.add(s);
|
|
2047
|
-
let l = n.getObjectByName(
|
|
2049
|
+
let l = n.getObjectByName(Bn);
|
|
2048
2050
|
l && (l.visible = !1);
|
|
2049
2051
|
}
|
|
2050
2052
|
disableColorWrite(e) {
|
|
@@ -2061,33 +2063,33 @@ var Gn = class t {
|
|
|
2061
2063
|
t.colorWrite = e;
|
|
2062
2064
|
});
|
|
2063
2065
|
}
|
|
2064
|
-
},
|
|
2066
|
+
}, qn = (e, t) => {
|
|
2065
2067
|
if (e && typeof e == "object") {
|
|
2066
2068
|
let n = e[t];
|
|
2067
2069
|
if (typeof n == "function") return n.call(e);
|
|
2068
2070
|
}
|
|
2069
2071
|
return null;
|
|
2070
2072
|
};
|
|
2071
|
-
function qn(t) {
|
|
2072
|
-
return Kn(t, "getThreeObject") ?? (t instanceof e.Object3D ? t : null);
|
|
2073
|
-
}
|
|
2074
2073
|
function Jn(t) {
|
|
2075
|
-
return
|
|
2074
|
+
return qn(t, "getThreeObject") ?? (t instanceof e.Object3D ? t : null);
|
|
2076
2075
|
}
|
|
2077
2076
|
function Yn(t) {
|
|
2078
|
-
return
|
|
2077
|
+
return qn(t, "getThreeCamera") ?? (t instanceof e.Camera ? t : null);
|
|
2079
2078
|
}
|
|
2080
2079
|
function Xn(t) {
|
|
2081
|
-
return
|
|
2080
|
+
return qn(t, "getThreeScene") ?? (t instanceof e.Scene ? t : null);
|
|
2082
2081
|
}
|
|
2083
2082
|
function Zn(t) {
|
|
2084
|
-
return
|
|
2083
|
+
return qn(t, "getThreeTexture") ?? (t instanceof e.Texture ? t : null);
|
|
2084
|
+
}
|
|
2085
|
+
function Qn(t) {
|
|
2086
|
+
return qn(t, "getThreeRenderer") ?? (t instanceof e.WebGLRenderer ? t : null);
|
|
2085
2087
|
}
|
|
2086
|
-
function
|
|
2087
|
-
return
|
|
2088
|
+
function $n(e) {
|
|
2089
|
+
return qn(e, "getThreeControls");
|
|
2088
2090
|
}
|
|
2089
2091
|
//#endregion
|
|
2090
2092
|
//#region src/utils/smoothstep.ts
|
|
2091
|
-
var
|
|
2093
|
+
var er = (e) => e * e * (3 - 2 * e);
|
|
2092
2094
|
//#endregion
|
|
2093
|
-
export {
|
|
2095
|
+
export { ee as A, Ke as C, A as D, k as E, x as F, w as M, C as N, ue as O, S as P, Je as S, j as T, In as _, Qn as a, jn as b, zn as c, Kn as d, Hn as f, Fn as g, Nn as h, Jn as i, T as j, ne as k, Vn as l, Pn as m, Yn as n, Xn as o, Gn as p, $n as r, Zn as s, er as t, Bn as u, Ln as v, P as w, En as x, Rn as y };
|