@wemap/viewer 14.8.0-beta.6 → 14.8.0-beta.7
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/cdn/wemap-viewer.umd.js +5 -5
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +634 -359
- package/dist/src/WemapViewer.d.ts +8 -1
- package/dist/src/WemapViewer.d.ts.map +1 -1
- package/dist/src/graph/LabelOverlay.d.ts +22 -0
- package/dist/src/graph/LabelOverlay.d.ts.map +1 -0
- package/dist/src/graph/PolygonOverlay.d.ts +2 -0
- package/dist/src/graph/PolygonOverlay.d.ts.map +1 -1
- package/dist/src/types/index.d.ts +10 -0
- package/dist/src/types/index.d.ts.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -8795,15 +8795,231 @@ var yo = class extends Kt {
|
|
|
8795
8795
|
let t = super.toJSON(e);
|
|
8796
8796
|
return this.fog !== null && (t.object.fog = this.fog.toJSON()), this.backgroundBlurriness > 0 && (t.object.backgroundBlurriness = this.backgroundBlurriness), this.backgroundIntensity !== 1 && (t.object.backgroundIntensity = this.backgroundIntensity), t;
|
|
8797
8797
|
}
|
|
8798
|
-
}, bo = class
|
|
8798
|
+
}, bo = class {
|
|
8799
|
+
constructor(e, t) {
|
|
8800
|
+
this.isInterleavedBuffer = !0, this.array = e, this.stride = t, this.count = e === void 0 ? 0 : e.length / t, this.usage = F, this._updateRange = {
|
|
8801
|
+
offset: 0,
|
|
8802
|
+
count: -1
|
|
8803
|
+
}, this.updateRanges = [], this.version = 0, this.uuid = L();
|
|
8804
|
+
}
|
|
8805
|
+
onUploadCallback() {}
|
|
8806
|
+
set needsUpdate(e) {
|
|
8807
|
+
e === !0 && this.version++;
|
|
8808
|
+
}
|
|
8809
|
+
get updateRange() {
|
|
8810
|
+
return console.warn("THREE.InterleavedBuffer: \"updateRange\" is deprecated and removed in r169. Use \"addUpdateRange()\" instead."), this._updateRange;
|
|
8811
|
+
}
|
|
8812
|
+
setUsage(e) {
|
|
8813
|
+
return this.usage = e, this;
|
|
8814
|
+
}
|
|
8815
|
+
addUpdateRange(e, t) {
|
|
8816
|
+
this.updateRanges.push({
|
|
8817
|
+
start: e,
|
|
8818
|
+
count: t
|
|
8819
|
+
});
|
|
8820
|
+
}
|
|
8821
|
+
clearUpdateRanges() {
|
|
8822
|
+
this.updateRanges.length = 0;
|
|
8823
|
+
}
|
|
8824
|
+
copy(e) {
|
|
8825
|
+
return this.array = new e.array.constructor(e.array), this.count = e.count, this.stride = e.stride, this.usage = e.usage, this;
|
|
8826
|
+
}
|
|
8827
|
+
copyAt(e, t, n) {
|
|
8828
|
+
e *= this.stride, n *= t.stride;
|
|
8829
|
+
for (let r = 0, i = this.stride; r < i; r++) this.array[e + r] = t.array[n + r];
|
|
8830
|
+
return this;
|
|
8831
|
+
}
|
|
8832
|
+
set(e, t = 0) {
|
|
8833
|
+
return this.array.set(e, t), this;
|
|
8834
|
+
}
|
|
8835
|
+
clone(e) {
|
|
8836
|
+
e.arrayBuffers === void 0 && (e.arrayBuffers = {}), this.array.buffer._uuid === void 0 && (this.array.buffer._uuid = L()), e.arrayBuffers[this.array.buffer._uuid] === void 0 && (e.arrayBuffers[this.array.buffer._uuid] = this.array.slice(0).buffer);
|
|
8837
|
+
let t = new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]), n = new this.constructor(t, this.stride);
|
|
8838
|
+
return n.setUsage(this.usage), n;
|
|
8839
|
+
}
|
|
8840
|
+
onUpload(e) {
|
|
8841
|
+
return this.onUploadCallback = e, this;
|
|
8842
|
+
}
|
|
8843
|
+
toJSON(e) {
|
|
8844
|
+
return e.arrayBuffers === void 0 && (e.arrayBuffers = {}), this.array.buffer._uuid === void 0 && (this.array.buffer._uuid = L()), e.arrayBuffers[this.array.buffer._uuid] === void 0 && (e.arrayBuffers[this.array.buffer._uuid] = Array.from(new Uint32Array(this.array.buffer))), {
|
|
8845
|
+
uuid: this.uuid,
|
|
8846
|
+
buffer: this.array.buffer._uuid,
|
|
8847
|
+
type: this.array.constructor.name,
|
|
8848
|
+
stride: this.stride
|
|
8849
|
+
};
|
|
8850
|
+
}
|
|
8851
|
+
}, xo = /*@__PURE__*/ new X(), So = class e {
|
|
8852
|
+
constructor(e, t, n, r = !1) {
|
|
8853
|
+
this.isInterleavedBufferAttribute = !0, this.name = "", this.data = e, this.itemSize = t, this.offset = n, this.normalized = r;
|
|
8854
|
+
}
|
|
8855
|
+
get count() {
|
|
8856
|
+
return this.data.count;
|
|
8857
|
+
}
|
|
8858
|
+
get array() {
|
|
8859
|
+
return this.data.array;
|
|
8860
|
+
}
|
|
8861
|
+
set needsUpdate(e) {
|
|
8862
|
+
this.data.needsUpdate = e;
|
|
8863
|
+
}
|
|
8864
|
+
applyMatrix4(e) {
|
|
8865
|
+
for (let t = 0, n = this.data.count; t < n; t++) xo.fromBufferAttribute(this, t), xo.applyMatrix4(e), this.setXYZ(t, xo.x, xo.y, xo.z);
|
|
8866
|
+
return this;
|
|
8867
|
+
}
|
|
8868
|
+
applyNormalMatrix(e) {
|
|
8869
|
+
for (let t = 0, n = this.count; t < n; t++) xo.fromBufferAttribute(this, t), xo.applyNormalMatrix(e), this.setXYZ(t, xo.x, xo.y, xo.z);
|
|
8870
|
+
return this;
|
|
8871
|
+
}
|
|
8872
|
+
transformDirection(e) {
|
|
8873
|
+
for (let t = 0, n = this.count; t < n; t++) xo.fromBufferAttribute(this, t), xo.transformDirection(e), this.setXYZ(t, xo.x, xo.y, xo.z);
|
|
8874
|
+
return this;
|
|
8875
|
+
}
|
|
8876
|
+
setX(e, t) {
|
|
8877
|
+
return this.normalized && (t = G(t, this.array)), this.data.array[e * this.data.stride + this.offset] = t, this;
|
|
8878
|
+
}
|
|
8879
|
+
setY(e, t) {
|
|
8880
|
+
return this.normalized && (t = G(t, this.array)), this.data.array[e * this.data.stride + this.offset + 1] = t, this;
|
|
8881
|
+
}
|
|
8882
|
+
setZ(e, t) {
|
|
8883
|
+
return this.normalized && (t = G(t, this.array)), this.data.array[e * this.data.stride + this.offset + 2] = t, this;
|
|
8884
|
+
}
|
|
8885
|
+
setW(e, t) {
|
|
8886
|
+
return this.normalized && (t = G(t, this.array)), this.data.array[e * this.data.stride + this.offset + 3] = t, this;
|
|
8887
|
+
}
|
|
8888
|
+
getX(e) {
|
|
8889
|
+
let t = this.data.array[e * this.data.stride + this.offset];
|
|
8890
|
+
return this.normalized && (t = be(t, this.array)), t;
|
|
8891
|
+
}
|
|
8892
|
+
getY(e) {
|
|
8893
|
+
let t = this.data.array[e * this.data.stride + this.offset + 1];
|
|
8894
|
+
return this.normalized && (t = be(t, this.array)), t;
|
|
8895
|
+
}
|
|
8896
|
+
getZ(e) {
|
|
8897
|
+
let t = this.data.array[e * this.data.stride + this.offset + 2];
|
|
8898
|
+
return this.normalized && (t = be(t, this.array)), t;
|
|
8899
|
+
}
|
|
8900
|
+
getW(e) {
|
|
8901
|
+
let t = this.data.array[e * this.data.stride + this.offset + 3];
|
|
8902
|
+
return this.normalized && (t = be(t, this.array)), t;
|
|
8903
|
+
}
|
|
8904
|
+
setXY(e, t, n) {
|
|
8905
|
+
return e = e * this.data.stride + this.offset, this.normalized && (t = G(t, this.array), n = G(n, this.array)), this.data.array[e + 0] = t, this.data.array[e + 1] = n, this;
|
|
8906
|
+
}
|
|
8907
|
+
setXYZ(e, t, n, r) {
|
|
8908
|
+
return e = e * this.data.stride + this.offset, this.normalized && (t = G(t, this.array), n = G(n, this.array), r = G(r, this.array)), this.data.array[e + 0] = t, this.data.array[e + 1] = n, this.data.array[e + 2] = r, this;
|
|
8909
|
+
}
|
|
8910
|
+
setXYZW(e, t, n, r, i) {
|
|
8911
|
+
return e = e * this.data.stride + this.offset, this.normalized && (t = G(t, this.array), n = G(n, this.array), r = G(r, this.array), i = G(i, this.array)), this.data.array[e + 0] = t, this.data.array[e + 1] = n, this.data.array[e + 2] = r, this.data.array[e + 3] = i, this;
|
|
8912
|
+
}
|
|
8913
|
+
clone(t) {
|
|
8914
|
+
if (t === void 0) {
|
|
8915
|
+
console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");
|
|
8916
|
+
let e = [];
|
|
8917
|
+
for (let t = 0; t < this.count; t++) {
|
|
8918
|
+
let n = t * this.data.stride + this.offset;
|
|
8919
|
+
for (let t = 0; t < this.itemSize; t++) e.push(this.data.array[n + t]);
|
|
8920
|
+
}
|
|
8921
|
+
return new gn(new this.array.constructor(e), this.itemSize, this.normalized);
|
|
8922
|
+
} else return t.interleavedBuffers === void 0 && (t.interleavedBuffers = {}), t.interleavedBuffers[this.data.uuid] === void 0 && (t.interleavedBuffers[this.data.uuid] = this.data.clone(t)), new e(t.interleavedBuffers[this.data.uuid], this.itemSize, this.offset, this.normalized);
|
|
8923
|
+
}
|
|
8924
|
+
toJSON(e) {
|
|
8925
|
+
if (e === void 0) {
|
|
8926
|
+
console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");
|
|
8927
|
+
let e = [];
|
|
8928
|
+
for (let t = 0; t < this.count; t++) {
|
|
8929
|
+
let n = t * this.data.stride + this.offset;
|
|
8930
|
+
for (let t = 0; t < this.itemSize; t++) e.push(this.data.array[n + t]);
|
|
8931
|
+
}
|
|
8932
|
+
return {
|
|
8933
|
+
itemSize: this.itemSize,
|
|
8934
|
+
type: this.array.constructor.name,
|
|
8935
|
+
array: e,
|
|
8936
|
+
normalized: this.normalized
|
|
8937
|
+
};
|
|
8938
|
+
} else return e.interleavedBuffers === void 0 && (e.interleavedBuffers = {}), e.interleavedBuffers[this.data.uuid] === void 0 && (e.interleavedBuffers[this.data.uuid] = this.data.toJSON(e)), {
|
|
8939
|
+
isInterleavedBufferAttribute: !0,
|
|
8940
|
+
itemSize: this.itemSize,
|
|
8941
|
+
data: this.data.uuid,
|
|
8942
|
+
offset: this.offset,
|
|
8943
|
+
normalized: this.normalized
|
|
8944
|
+
};
|
|
8945
|
+
}
|
|
8946
|
+
}, Co = class extends fn {
|
|
8947
|
+
constructor(e) {
|
|
8948
|
+
super(), this.isSpriteMaterial = !0, this.type = "SpriteMaterial", this.color = new Z(16777215), this.map = null, this.alphaMap = null, this.rotation = 0, this.sizeAttenuation = !0, this.transparent = !0, this.fog = !0, this.setValues(e);
|
|
8949
|
+
}
|
|
8950
|
+
copy(e) {
|
|
8951
|
+
return super.copy(e), this.color.copy(e.color), this.map = e.map, this.alphaMap = e.alphaMap, this.rotation = e.rotation, this.sizeAttenuation = e.sizeAttenuation, this.fog = e.fog, this;
|
|
8952
|
+
}
|
|
8953
|
+
}, wo, To = /*@__PURE__*/ new X(), Eo = /*@__PURE__*/ new X(), Do = /*@__PURE__*/ new X(), Oo = /*@__PURE__*/ new K(), ko = /*@__PURE__*/ new K(), Ao = /*@__PURE__*/ new xt(), jo = /*@__PURE__*/ new X(), Mo = /*@__PURE__*/ new X(), No = /*@__PURE__*/ new X(), Po = /*@__PURE__*/ new K(), Fo = /*@__PURE__*/ new K(), Io = /*@__PURE__*/ new K(), Lo = class extends Kt {
|
|
8954
|
+
constructor(e = new Co()) {
|
|
8955
|
+
if (super(), this.isSprite = !0, this.type = "Sprite", wo === void 0) {
|
|
8956
|
+
wo = new Dn();
|
|
8957
|
+
let e = new bo(new Float32Array([
|
|
8958
|
+
-.5,
|
|
8959
|
+
-.5,
|
|
8960
|
+
0,
|
|
8961
|
+
0,
|
|
8962
|
+
0,
|
|
8963
|
+
.5,
|
|
8964
|
+
-.5,
|
|
8965
|
+
0,
|
|
8966
|
+
1,
|
|
8967
|
+
0,
|
|
8968
|
+
.5,
|
|
8969
|
+
.5,
|
|
8970
|
+
0,
|
|
8971
|
+
1,
|
|
8972
|
+
1,
|
|
8973
|
+
-.5,
|
|
8974
|
+
.5,
|
|
8975
|
+
0,
|
|
8976
|
+
0,
|
|
8977
|
+
1
|
|
8978
|
+
]), 5);
|
|
8979
|
+
wo.setIndex([
|
|
8980
|
+
0,
|
|
8981
|
+
1,
|
|
8982
|
+
2,
|
|
8983
|
+
0,
|
|
8984
|
+
2,
|
|
8985
|
+
3
|
|
8986
|
+
]), wo.setAttribute("position", new So(e, 3, 0, !1)), wo.setAttribute("uv", new So(e, 2, 3, !1));
|
|
8987
|
+
}
|
|
8988
|
+
this.geometry = wo, this.material = e, this.center = new K(.5, .5);
|
|
8989
|
+
}
|
|
8990
|
+
raycast(e, t) {
|
|
8991
|
+
e.camera === null && console.error("THREE.Sprite: \"Raycaster.camera\" needs to be set in order to raycast against sprites."), Eo.setFromMatrixScale(this.matrixWorld), Ao.copy(e.camera.matrixWorld), this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse, this.matrixWorld), Do.setFromMatrixPosition(this.modelViewMatrix), e.camera.isPerspectiveCamera && this.material.sizeAttenuation === !1 && Eo.multiplyScalar(-Do.z);
|
|
8992
|
+
let n = this.material.rotation, r, i;
|
|
8993
|
+
n !== 0 && (i = Math.cos(n), r = Math.sin(n));
|
|
8994
|
+
let a = this.center;
|
|
8995
|
+
Ro(jo.set(-.5, -.5, 0), Do, a, Eo, r, i), Ro(Mo.set(.5, -.5, 0), Do, a, Eo, r, i), Ro(No.set(.5, .5, 0), Do, a, Eo, r, i), Po.set(0, 0), Fo.set(1, 0), Io.set(1, 1);
|
|
8996
|
+
let o = e.ray.intersectTriangle(jo, Mo, No, !1, To);
|
|
8997
|
+
if (o === null && (Ro(Mo.set(-.5, .5, 0), Do, a, Eo, r, i), Fo.set(0, 1), o = e.ray.intersectTriangle(jo, No, Mo, !1, To), o === null)) return;
|
|
8998
|
+
let s = e.ray.origin.distanceTo(To);
|
|
8999
|
+
s < e.near || s > e.far || t.push({
|
|
9000
|
+
distance: s,
|
|
9001
|
+
point: To.clone(),
|
|
9002
|
+
uv: an.getInterpolation(To, jo, Mo, No, Po, Fo, Io, new K()),
|
|
9003
|
+
face: null,
|
|
9004
|
+
object: this
|
|
9005
|
+
});
|
|
9006
|
+
}
|
|
9007
|
+
copy(e, t) {
|
|
9008
|
+
return super.copy(e, t), e.center !== void 0 && this.center.copy(e.center), this.material = e.material, this;
|
|
9009
|
+
}
|
|
9010
|
+
};
|
|
9011
|
+
function Ro(e, t, n, r, i, a) {
|
|
9012
|
+
Oo.subVectors(e, n).addScalar(.5).multiply(r), i === void 0 ? ko.copy(Oo) : (ko.x = a * Oo.x - i * Oo.y, ko.y = i * Oo.x + a * Oo.y), e.copy(t), e.x += ko.x, e.y += ko.y, e.applyMatrix4(Ao);
|
|
9013
|
+
}
|
|
9014
|
+
var zo = class extends fn {
|
|
8799
9015
|
constructor(e) {
|
|
8800
9016
|
super(), this.isLineBasicMaterial = !0, this.type = "LineBasicMaterial", this.color = new Z(16777215), this.map = null, this.linewidth = 1, this.linecap = "round", this.linejoin = "round", this.fog = !0, this.setValues(e);
|
|
8801
9017
|
}
|
|
8802
9018
|
copy(e) {
|
|
8803
9019
|
return super.copy(e), this.color.copy(e.color), this.map = e.map, this.linewidth = e.linewidth, this.linecap = e.linecap, this.linejoin = e.linejoin, this.fog = e.fog, this;
|
|
8804
9020
|
}
|
|
8805
|
-
},
|
|
8806
|
-
constructor(e = new Dn(), t = new
|
|
9021
|
+
}, Bo = /*@__PURE__*/ new X(), Vo = /*@__PURE__*/ new X(), Ho = /*@__PURE__*/ new xt(), Uo = /*@__PURE__*/ new bt(), Wo = /*@__PURE__*/ new ft(), Go = class extends Kt {
|
|
9022
|
+
constructor(e = new Dn(), t = new zo()) {
|
|
8807
9023
|
super(), this.isLine = !0, this.type = "Line", this.geometry = e, this.material = t, this.updateMorphTargets();
|
|
8808
9024
|
}
|
|
8809
9025
|
copy(e, t) {
|
|
@@ -8813,21 +9029,21 @@ var yo = class extends Kt {
|
|
|
8813
9029
|
let e = this.geometry;
|
|
8814
9030
|
if (e.index === null) {
|
|
8815
9031
|
let t = e.attributes.position, n = [0];
|
|
8816
|
-
for (let e = 1, r = t.count; e < r; e++)
|
|
9032
|
+
for (let e = 1, r = t.count; e < r; e++) Bo.fromBufferAttribute(t, e - 1), Vo.fromBufferAttribute(t, e), n[e] = n[e - 1], n[e] += Bo.distanceTo(Vo);
|
|
8817
9033
|
e.setAttribute("lineDistance", new yn(n, 1));
|
|
8818
9034
|
} else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");
|
|
8819
9035
|
return this;
|
|
8820
9036
|
}
|
|
8821
9037
|
raycast(e, t) {
|
|
8822
9038
|
let n = this.geometry, r = this.matrixWorld, i = e.params.Line.threshold, a = n.drawRange;
|
|
8823
|
-
if (n.boundingSphere === null && n.computeBoundingSphere(),
|
|
8824
|
-
|
|
9039
|
+
if (n.boundingSphere === null && n.computeBoundingSphere(), Wo.copy(n.boundingSphere), Wo.applyMatrix4(r), Wo.radius += i, e.ray.intersectsSphere(Wo) === !1) return;
|
|
9040
|
+
Ho.copy(r).invert(), Uo.copy(e.ray).applyMatrix4(Ho);
|
|
8825
9041
|
let o = i / ((this.scale.x + this.scale.y + this.scale.z) / 3), s = o * o, c = new X(), l = new X(), u = new X(), d = new X(), f = this.isLineSegments ? 2 : 1, p = n.index, m = n.attributes.position;
|
|
8826
9042
|
if (p !== null) {
|
|
8827
9043
|
let n = Math.max(0, a.start), r = Math.min(p.count, a.start + a.count);
|
|
8828
9044
|
for (let i = n, a = r - 1; i < a; i += f) {
|
|
8829
9045
|
let n = p.getX(i), r = p.getX(i + 1);
|
|
8830
|
-
if (c.fromBufferAttribute(m, n), l.fromBufferAttribute(m, r),
|
|
9046
|
+
if (c.fromBufferAttribute(m, n), l.fromBufferAttribute(m, r), Uo.distanceSqToSegment(c, l, d, u) > s) continue;
|
|
8831
9047
|
d.applyMatrix4(this.matrixWorld);
|
|
8832
9048
|
let a = e.ray.origin.distanceTo(d);
|
|
8833
9049
|
a < e.near || a > e.far || t.push({
|
|
@@ -8842,7 +9058,7 @@ var yo = class extends Kt {
|
|
|
8842
9058
|
} else {
|
|
8843
9059
|
let n = Math.max(0, a.start), r = Math.min(m.count, a.start + a.count);
|
|
8844
9060
|
for (let i = n, a = r - 1; i < a; i += f) {
|
|
8845
|
-
if (c.fromBufferAttribute(m, i), l.fromBufferAttribute(m, i + 1),
|
|
9061
|
+
if (c.fromBufferAttribute(m, i), l.fromBufferAttribute(m, i + 1), Uo.distanceSqToSegment(c, l, d, u) > s) continue;
|
|
8846
9062
|
d.applyMatrix4(this.matrixWorld);
|
|
8847
9063
|
let n = e.ray.origin.distanceTo(d);
|
|
8848
9064
|
n < e.near || n > e.far || t.push({
|
|
@@ -8869,11 +9085,15 @@ var yo = class extends Kt {
|
|
|
8869
9085
|
}
|
|
8870
9086
|
}
|
|
8871
9087
|
}
|
|
8872
|
-
},
|
|
9088
|
+
}, Ko = class extends Go {
|
|
8873
9089
|
constructor(e, t) {
|
|
8874
9090
|
super(e, t), this.isLineLoop = !0, this.type = "LineLoop";
|
|
8875
9091
|
}
|
|
8876
|
-
},
|
|
9092
|
+
}, qo = class extends ze {
|
|
9093
|
+
constructor(e, t, n, r, i, a, o, s, c) {
|
|
9094
|
+
super(e, t, n, r, i, a, o, s, c), this.isCanvasTexture = !0, this.needsUpdate = !0;
|
|
9095
|
+
}
|
|
9096
|
+
}, Jo = class {
|
|
8877
9097
|
constructor() {
|
|
8878
9098
|
this.type = "Curve", this.arcLengthDivisions = 200;
|
|
8879
9099
|
}
|
|
@@ -8978,7 +9198,7 @@ var yo = class extends Kt {
|
|
|
8978
9198
|
fromJSON(e) {
|
|
8979
9199
|
return this.arcLengthDivisions = e.arcLengthDivisions, this;
|
|
8980
9200
|
}
|
|
8981
|
-
},
|
|
9201
|
+
}, Yo = class extends Jo {
|
|
8982
9202
|
constructor(e = 0, t = 0, n = 1, r = 1, i = 0, a = Math.PI * 2, o = !1, s = 0) {
|
|
8983
9203
|
super(), this.isEllipseCurve = !0, this.type = "EllipseCurve", this.aX = e, this.aY = t, this.xRadius = n, this.yRadius = r, this.aStartAngle = i, this.aEndAngle = a, this.aClockwise = o, this.aRotation = s;
|
|
8984
9204
|
}
|
|
@@ -9004,12 +9224,12 @@ var yo = class extends Kt {
|
|
|
9004
9224
|
fromJSON(e) {
|
|
9005
9225
|
return super.fromJSON(e), this.aX = e.aX, this.aY = e.aY, this.xRadius = e.xRadius, this.yRadius = e.yRadius, this.aStartAngle = e.aStartAngle, this.aEndAngle = e.aEndAngle, this.aClockwise = e.aClockwise, this.aRotation = e.aRotation, this;
|
|
9006
9226
|
}
|
|
9007
|
-
},
|
|
9227
|
+
}, Xo = class extends Yo {
|
|
9008
9228
|
constructor(e, t, n, r, i, a) {
|
|
9009
9229
|
super(e, t, n, n, r, i, a), this.isArcCurve = !0, this.type = "ArcCurve";
|
|
9010
9230
|
}
|
|
9011
9231
|
};
|
|
9012
|
-
function
|
|
9232
|
+
function Zo() {
|
|
9013
9233
|
let e = 0, t = 0, n = 0, r = 0;
|
|
9014
9234
|
function i(i, a, o, s) {
|
|
9015
9235
|
e = i, t = o, n = -3 * i + 3 * a - 2 * o - s, r = 2 * i - 2 * a + o + s;
|
|
@@ -9028,7 +9248,7 @@ function jo() {
|
|
|
9028
9248
|
}
|
|
9029
9249
|
};
|
|
9030
9250
|
}
|
|
9031
|
-
var
|
|
9251
|
+
var Qo = /*@__PURE__*/ new X(), $o = /*@__PURE__*/ new Zo(), es = /*@__PURE__*/ new Zo(), ts = /*@__PURE__*/ new Zo(), ns = class extends Jo {
|
|
9032
9252
|
constructor(e = [], t = !1, n = "centripetal", r = .5) {
|
|
9033
9253
|
super(), this.isCatmullRomCurve3 = !0, this.type = "CatmullRomCurve3", this.points = e, this.closed = t, this.curveType = n, this.tension = r;
|
|
9034
9254
|
}
|
|
@@ -9036,13 +9256,13 @@ var Mo = /*@__PURE__*/ new X(), No = /*@__PURE__*/ new jo(), Po = /*@__PURE__*/
|
|
|
9036
9256
|
let n = t, r = this.points, i = r.length, a = (i - +!this.closed) * e, o = Math.floor(a), s = a - o;
|
|
9037
9257
|
this.closed ? o += o > 0 ? 0 : (Math.floor(Math.abs(o) / i) + 1) * i : s === 0 && o === i - 1 && (o = i - 2, s = 1);
|
|
9038
9258
|
let c, l;
|
|
9039
|
-
this.closed || o > 0 ? c = r[(o - 1) % i] : (
|
|
9259
|
+
this.closed || o > 0 ? c = r[(o - 1) % i] : (Qo.subVectors(r[0], r[1]).add(r[0]), c = Qo);
|
|
9040
9260
|
let u = r[o % i], d = r[(o + 1) % i];
|
|
9041
|
-
if (this.closed || o + 2 < i ? l = r[(o + 2) % i] : (
|
|
9261
|
+
if (this.closed || o + 2 < i ? l = r[(o + 2) % i] : (Qo.subVectors(r[i - 1], r[i - 2]).add(r[i - 1]), l = Qo), this.curveType === "centripetal" || this.curveType === "chordal") {
|
|
9042
9262
|
let e = this.curveType === "chordal" ? .5 : .25, t = c.distanceToSquared(u) ** +e, n = u.distanceToSquared(d) ** +e, r = d.distanceToSquared(l) ** +e;
|
|
9043
|
-
n < 1e-4 && (n = 1), t < 1e-4 && (t = n), r < 1e-4 && (r = n),
|
|
9044
|
-
} else this.curveType === "catmullrom" && (
|
|
9045
|
-
return n.set(
|
|
9263
|
+
n < 1e-4 && (n = 1), t < 1e-4 && (t = n), r < 1e-4 && (r = n), $o.initNonuniformCatmullRom(c.x, u.x, d.x, l.x, t, n, r), es.initNonuniformCatmullRom(c.y, u.y, d.y, l.y, t, n, r), ts.initNonuniformCatmullRom(c.z, u.z, d.z, l.z, t, n, r);
|
|
9264
|
+
} else this.curveType === "catmullrom" && ($o.initCatmullRom(c.x, u.x, d.x, l.x, this.tension), es.initCatmullRom(c.y, u.y, d.y, l.y, this.tension), ts.initCatmullRom(c.z, u.z, d.z, l.z, this.tension));
|
|
9265
|
+
return n.set($o.calc(s), es.calc(s), ts.calc(s)), n;
|
|
9046
9266
|
}
|
|
9047
9267
|
copy(e) {
|
|
9048
9268
|
super.copy(e), this.points = [];
|
|
@@ -9070,47 +9290,47 @@ var Mo = /*@__PURE__*/ new X(), No = /*@__PURE__*/ new jo(), Po = /*@__PURE__*/
|
|
|
9070
9290
|
return this.closed = e.closed, this.curveType = e.curveType, this.tension = e.tension, this;
|
|
9071
9291
|
}
|
|
9072
9292
|
};
|
|
9073
|
-
function
|
|
9293
|
+
function rs(e, t, n, r, i) {
|
|
9074
9294
|
let a = (r - t) * .5, o = (i - n) * .5, s = e * e, c = e * s;
|
|
9075
9295
|
return (2 * n - 2 * r + a + o) * c + (-3 * n + 3 * r - 2 * a - o) * s + a * e + n;
|
|
9076
9296
|
}
|
|
9077
|
-
function
|
|
9297
|
+
function is(e, t) {
|
|
9078
9298
|
let n = 1 - e;
|
|
9079
9299
|
return n * n * t;
|
|
9080
9300
|
}
|
|
9081
|
-
function
|
|
9301
|
+
function as(e, t) {
|
|
9082
9302
|
return 2 * (1 - e) * e * t;
|
|
9083
9303
|
}
|
|
9084
|
-
function
|
|
9304
|
+
function os(e, t) {
|
|
9085
9305
|
return e * e * t;
|
|
9086
9306
|
}
|
|
9087
|
-
function
|
|
9088
|
-
return
|
|
9307
|
+
function ss(e, t, n, r) {
|
|
9308
|
+
return is(e, t) + as(e, n) + os(e, r);
|
|
9089
9309
|
}
|
|
9090
|
-
function
|
|
9310
|
+
function cs(e, t) {
|
|
9091
9311
|
let n = 1 - e;
|
|
9092
9312
|
return n * n * n * t;
|
|
9093
9313
|
}
|
|
9094
|
-
function
|
|
9314
|
+
function ls(e, t) {
|
|
9095
9315
|
let n = 1 - e;
|
|
9096
9316
|
return 3 * n * n * e * t;
|
|
9097
9317
|
}
|
|
9098
|
-
function
|
|
9318
|
+
function us(e, t) {
|
|
9099
9319
|
return 3 * (1 - e) * e * e * t;
|
|
9100
9320
|
}
|
|
9101
|
-
function
|
|
9321
|
+
function ds(e, t) {
|
|
9102
9322
|
return e * e * e * t;
|
|
9103
9323
|
}
|
|
9104
|
-
function
|
|
9105
|
-
return
|
|
9324
|
+
function fs(e, t, n, r, i) {
|
|
9325
|
+
return cs(e, t) + ls(e, n) + us(e, r) + ds(e, i);
|
|
9106
9326
|
}
|
|
9107
|
-
var
|
|
9327
|
+
var ps = class extends Jo {
|
|
9108
9328
|
constructor(e = new K(), t = new K(), n = new K(), r = new K()) {
|
|
9109
9329
|
super(), this.isCubicBezierCurve = !0, this.type = "CubicBezierCurve", this.v0 = e, this.v1 = t, this.v2 = n, this.v3 = r;
|
|
9110
9330
|
}
|
|
9111
9331
|
getPoint(e, t = new K()) {
|
|
9112
9332
|
let n = t, r = this.v0, i = this.v1, a = this.v2, o = this.v3;
|
|
9113
|
-
return n.set(
|
|
9333
|
+
return n.set(fs(e, r.x, i.x, a.x, o.x), fs(e, r.y, i.y, a.y, o.y)), n;
|
|
9114
9334
|
}
|
|
9115
9335
|
copy(e) {
|
|
9116
9336
|
return super.copy(e), this.v0.copy(e.v0), this.v1.copy(e.v1), this.v2.copy(e.v2), this.v3.copy(e.v3), this;
|
|
@@ -9122,13 +9342,13 @@ var qo = class extends Oo {
|
|
|
9122
9342
|
fromJSON(e) {
|
|
9123
9343
|
return super.fromJSON(e), this.v0.fromArray(e.v0), this.v1.fromArray(e.v1), this.v2.fromArray(e.v2), this.v3.fromArray(e.v3), this;
|
|
9124
9344
|
}
|
|
9125
|
-
},
|
|
9345
|
+
}, ms = class extends Jo {
|
|
9126
9346
|
constructor(e = new X(), t = new X(), n = new X(), r = new X()) {
|
|
9127
9347
|
super(), this.isCubicBezierCurve3 = !0, this.type = "CubicBezierCurve3", this.v0 = e, this.v1 = t, this.v2 = n, this.v3 = r;
|
|
9128
9348
|
}
|
|
9129
9349
|
getPoint(e, t = new X()) {
|
|
9130
9350
|
let n = t, r = this.v0, i = this.v1, a = this.v2, o = this.v3;
|
|
9131
|
-
return n.set(
|
|
9351
|
+
return n.set(fs(e, r.x, i.x, a.x, o.x), fs(e, r.y, i.y, a.y, o.y), fs(e, r.z, i.z, a.z, o.z)), n;
|
|
9132
9352
|
}
|
|
9133
9353
|
copy(e) {
|
|
9134
9354
|
return super.copy(e), this.v0.copy(e.v0), this.v1.copy(e.v1), this.v2.copy(e.v2), this.v3.copy(e.v3), this;
|
|
@@ -9140,7 +9360,7 @@ var qo = class extends Oo {
|
|
|
9140
9360
|
fromJSON(e) {
|
|
9141
9361
|
return super.fromJSON(e), this.v0.fromArray(e.v0), this.v1.fromArray(e.v1), this.v2.fromArray(e.v2), this.v3.fromArray(e.v3), this;
|
|
9142
9362
|
}
|
|
9143
|
-
},
|
|
9363
|
+
}, hs = class extends Jo {
|
|
9144
9364
|
constructor(e = new K(), t = new K()) {
|
|
9145
9365
|
super(), this.isLineCurve = !0, this.type = "LineCurve", this.v1 = e, this.v2 = t;
|
|
9146
9366
|
}
|
|
@@ -9167,7 +9387,7 @@ var qo = class extends Oo {
|
|
|
9167
9387
|
fromJSON(e) {
|
|
9168
9388
|
return super.fromJSON(e), this.v1.fromArray(e.v1), this.v2.fromArray(e.v2), this;
|
|
9169
9389
|
}
|
|
9170
|
-
},
|
|
9390
|
+
}, gs = class extends Jo {
|
|
9171
9391
|
constructor(e = new X(), t = new X()) {
|
|
9172
9392
|
super(), this.isLineCurve3 = !0, this.type = "LineCurve3", this.v1 = e, this.v2 = t;
|
|
9173
9393
|
}
|
|
@@ -9194,13 +9414,13 @@ var qo = class extends Oo {
|
|
|
9194
9414
|
fromJSON(e) {
|
|
9195
9415
|
return super.fromJSON(e), this.v1.fromArray(e.v1), this.v2.fromArray(e.v2), this;
|
|
9196
9416
|
}
|
|
9197
|
-
},
|
|
9417
|
+
}, _s = class extends Jo {
|
|
9198
9418
|
constructor(e = new K(), t = new K(), n = new K()) {
|
|
9199
9419
|
super(), this.isQuadraticBezierCurve = !0, this.type = "QuadraticBezierCurve", this.v0 = e, this.v1 = t, this.v2 = n;
|
|
9200
9420
|
}
|
|
9201
9421
|
getPoint(e, t = new K()) {
|
|
9202
9422
|
let n = t, r = this.v0, i = this.v1, a = this.v2;
|
|
9203
|
-
return n.set(
|
|
9423
|
+
return n.set(ss(e, r.x, i.x, a.x), ss(e, r.y, i.y, a.y)), n;
|
|
9204
9424
|
}
|
|
9205
9425
|
copy(e) {
|
|
9206
9426
|
return super.copy(e), this.v0.copy(e.v0), this.v1.copy(e.v1), this.v2.copy(e.v2), this;
|
|
@@ -9212,13 +9432,13 @@ var qo = class extends Oo {
|
|
|
9212
9432
|
fromJSON(e) {
|
|
9213
9433
|
return super.fromJSON(e), this.v0.fromArray(e.v0), this.v1.fromArray(e.v1), this.v2.fromArray(e.v2), this;
|
|
9214
9434
|
}
|
|
9215
|
-
},
|
|
9435
|
+
}, vs = class extends Jo {
|
|
9216
9436
|
constructor(e = new X(), t = new X(), n = new X()) {
|
|
9217
9437
|
super(), this.isQuadraticBezierCurve3 = !0, this.type = "QuadraticBezierCurve3", this.v0 = e, this.v1 = t, this.v2 = n;
|
|
9218
9438
|
}
|
|
9219
9439
|
getPoint(e, t = new X()) {
|
|
9220
9440
|
let n = t, r = this.v0, i = this.v1, a = this.v2;
|
|
9221
|
-
return n.set(
|
|
9441
|
+
return n.set(ss(e, r.x, i.x, a.x), ss(e, r.y, i.y, a.y), ss(e, r.z, i.z, a.z)), n;
|
|
9222
9442
|
}
|
|
9223
9443
|
copy(e) {
|
|
9224
9444
|
return super.copy(e), this.v0.copy(e.v0), this.v1.copy(e.v1), this.v2.copy(e.v2), this;
|
|
@@ -9230,13 +9450,13 @@ var qo = class extends Oo {
|
|
|
9230
9450
|
fromJSON(e) {
|
|
9231
9451
|
return super.fromJSON(e), this.v0.fromArray(e.v0), this.v1.fromArray(e.v1), this.v2.fromArray(e.v2), this;
|
|
9232
9452
|
}
|
|
9233
|
-
},
|
|
9453
|
+
}, ys = class extends Jo {
|
|
9234
9454
|
constructor(e = []) {
|
|
9235
9455
|
super(), this.isSplineCurve = !0, this.type = "SplineCurve", this.points = e;
|
|
9236
9456
|
}
|
|
9237
9457
|
getPoint(e, t = new K()) {
|
|
9238
9458
|
let n = t, r = this.points, i = (r.length - 1) * e, a = Math.floor(i), o = i - a, s = r[a === 0 ? a : a - 1], c = r[a], l = r[a > r.length - 2 ? r.length - 1 : a + 1], u = r[a > r.length - 3 ? r.length - 1 : a + 2];
|
|
9239
|
-
return n.set(
|
|
9459
|
+
return n.set(rs(o, s.x, c.x, l.x, u.x), rs(o, s.y, c.y, l.y, u.y)), n;
|
|
9240
9460
|
}
|
|
9241
9461
|
copy(e) {
|
|
9242
9462
|
super.copy(e), this.points = [];
|
|
@@ -9263,19 +9483,19 @@ var qo = class extends Oo {
|
|
|
9263
9483
|
}
|
|
9264
9484
|
return this;
|
|
9265
9485
|
}
|
|
9266
|
-
},
|
|
9486
|
+
}, bs = /*#__PURE__*/ Object.freeze({
|
|
9267
9487
|
__proto__: null,
|
|
9268
|
-
ArcCurve:
|
|
9269
|
-
CatmullRomCurve3:
|
|
9270
|
-
CubicBezierCurve:
|
|
9271
|
-
CubicBezierCurve3:
|
|
9272
|
-
EllipseCurve:
|
|
9273
|
-
LineCurve:
|
|
9274
|
-
LineCurve3:
|
|
9275
|
-
QuadraticBezierCurve:
|
|
9276
|
-
QuadraticBezierCurve3:
|
|
9277
|
-
SplineCurve:
|
|
9278
|
-
}),
|
|
9488
|
+
ArcCurve: Xo,
|
|
9489
|
+
CatmullRomCurve3: ns,
|
|
9490
|
+
CubicBezierCurve: ps,
|
|
9491
|
+
CubicBezierCurve3: ms,
|
|
9492
|
+
EllipseCurve: Yo,
|
|
9493
|
+
LineCurve: hs,
|
|
9494
|
+
LineCurve3: gs,
|
|
9495
|
+
QuadraticBezierCurve: _s,
|
|
9496
|
+
QuadraticBezierCurve3: vs,
|
|
9497
|
+
SplineCurve: ys
|
|
9498
|
+
}), xs = class extends Jo {
|
|
9279
9499
|
constructor() {
|
|
9280
9500
|
super(), this.type = "CurvePath", this.curves = [], this.autoClose = !1;
|
|
9281
9501
|
}
|
|
@@ -9286,7 +9506,7 @@ var qo = class extends Oo {
|
|
|
9286
9506
|
let e = this.curves[0].getPoint(0), t = this.curves[this.curves.length - 1].getPoint(1);
|
|
9287
9507
|
if (!e.equals(t)) {
|
|
9288
9508
|
let n = e.isVector2 === !0 ? "LineCurve" : "LineCurve3";
|
|
9289
|
-
this.curves.push(new
|
|
9509
|
+
this.curves.push(new bs[n](t, e));
|
|
9290
9510
|
}
|
|
9291
9511
|
return this;
|
|
9292
9512
|
}
|
|
@@ -9351,11 +9571,11 @@ var qo = class extends Oo {
|
|
|
9351
9571
|
super.fromJSON(e), this.autoClose = e.autoClose, this.curves = [];
|
|
9352
9572
|
for (let t = 0, n = e.curves.length; t < n; t++) {
|
|
9353
9573
|
let n = e.curves[t];
|
|
9354
|
-
this.curves.push(new
|
|
9574
|
+
this.curves.push(new bs[n.type]().fromJSON(n));
|
|
9355
9575
|
}
|
|
9356
9576
|
return this;
|
|
9357
9577
|
}
|
|
9358
|
-
},
|
|
9578
|
+
}, Ss = class extends xs {
|
|
9359
9579
|
constructor(e) {
|
|
9360
9580
|
super(), this.type = "Path", this.currentPoint = new K(), e && this.setFromPoints(e);
|
|
9361
9581
|
}
|
|
@@ -9368,19 +9588,19 @@ var qo = class extends Oo {
|
|
|
9368
9588
|
return this.currentPoint.set(e, t), this;
|
|
9369
9589
|
}
|
|
9370
9590
|
lineTo(e, t) {
|
|
9371
|
-
let n = new
|
|
9591
|
+
let n = new hs(this.currentPoint.clone(), new K(e, t));
|
|
9372
9592
|
return this.curves.push(n), this.currentPoint.set(e, t), this;
|
|
9373
9593
|
}
|
|
9374
9594
|
quadraticCurveTo(e, t, n, r) {
|
|
9375
|
-
let i = new
|
|
9595
|
+
let i = new _s(this.currentPoint.clone(), new K(e, t), new K(n, r));
|
|
9376
9596
|
return this.curves.push(i), this.currentPoint.set(n, r), this;
|
|
9377
9597
|
}
|
|
9378
9598
|
bezierCurveTo(e, t, n, r, i, a) {
|
|
9379
|
-
let o = new
|
|
9599
|
+
let o = new ps(this.currentPoint.clone(), new K(e, t), new K(n, r), new K(i, a));
|
|
9380
9600
|
return this.curves.push(o), this.currentPoint.set(i, a), this;
|
|
9381
9601
|
}
|
|
9382
9602
|
splineThru(e) {
|
|
9383
|
-
let t = new
|
|
9603
|
+
let t = new ys([this.currentPoint.clone()].concat(e));
|
|
9384
9604
|
return this.curves.push(t), this.currentPoint.copy(e[e.length - 1]), this;
|
|
9385
9605
|
}
|
|
9386
9606
|
arc(e, t, n, r, i, a) {
|
|
@@ -9395,7 +9615,7 @@ var qo = class extends Oo {
|
|
|
9395
9615
|
return this.absellipse(e + c, t + l, n, r, i, a, o, s), this;
|
|
9396
9616
|
}
|
|
9397
9617
|
absellipse(e, t, n, r, i, a, o, s) {
|
|
9398
|
-
let c = new
|
|
9618
|
+
let c = new Yo(e, t, n, r, i, a, o, s);
|
|
9399
9619
|
if (this.curves.length > 0) {
|
|
9400
9620
|
let e = c.getPoint(0);
|
|
9401
9621
|
e.equals(this.currentPoint) || this.lineTo(e.x, e.y);
|
|
@@ -9414,7 +9634,7 @@ var qo = class extends Oo {
|
|
|
9414
9634
|
fromJSON(e) {
|
|
9415
9635
|
return super.fromJSON(e), this.currentPoint.fromArray(e.currentPoint), this;
|
|
9416
9636
|
}
|
|
9417
|
-
},
|
|
9637
|
+
}, Cs = class e extends Dn {
|
|
9418
9638
|
constructor(e = 1, t = 32, n = 0, r = Math.PI * 2) {
|
|
9419
9639
|
super(), this.type = "CircleGeometry", this.parameters = {
|
|
9420
9640
|
radius: e,
|
|
@@ -9437,7 +9657,7 @@ var qo = class extends Oo {
|
|
|
9437
9657
|
static fromJSON(t) {
|
|
9438
9658
|
return new e(t.radius, t.segments, t.thetaStart, t.thetaLength);
|
|
9439
9659
|
}
|
|
9440
|
-
},
|
|
9660
|
+
}, ws = class extends Ss {
|
|
9441
9661
|
constructor(e) {
|
|
9442
9662
|
super(e), this.uuid = L(), this.type = "Shape", this.holes = [];
|
|
9443
9663
|
}
|
|
@@ -9473,98 +9693,98 @@ var qo = class extends Oo {
|
|
|
9473
9693
|
super.fromJSON(e), this.uuid = e.uuid, this.holes = [];
|
|
9474
9694
|
for (let t = 0, n = e.holes.length; t < n; t++) {
|
|
9475
9695
|
let n = e.holes[t];
|
|
9476
|
-
this.holes.push(new
|
|
9696
|
+
this.holes.push(new Ss().fromJSON(n));
|
|
9477
9697
|
}
|
|
9478
9698
|
return this;
|
|
9479
9699
|
}
|
|
9480
|
-
},
|
|
9481
|
-
let r = t && t.length, i = r ? t[0] * n : e.length, a =
|
|
9700
|
+
}, Ts = { triangulate: function(e, t, n = 2) {
|
|
9701
|
+
let r = t && t.length, i = r ? t[0] * n : e.length, a = Es(e, 0, i, n, !0), o = [];
|
|
9482
9702
|
if (!a || a.next === a.prev) return o;
|
|
9483
9703
|
let s, c, l, u, d, f, p;
|
|
9484
|
-
if (r && (a =
|
|
9704
|
+
if (r && (a = Ns(e, t, a, n)), e.length > 80 * n) {
|
|
9485
9705
|
s = l = e[0], c = u = e[1];
|
|
9486
9706
|
for (let t = n; t < i; t += n) d = e[t], f = e[t + 1], d < s && (s = d), f < c && (c = f), d > l && (l = d), f > u && (u = f);
|
|
9487
9707
|
p = Math.max(l - s, u - c), p = p === 0 ? 0 : 32767 / p;
|
|
9488
9708
|
}
|
|
9489
|
-
return
|
|
9709
|
+
return Os(a, o, n, s, c, p, 0), o;
|
|
9490
9710
|
} };
|
|
9491
|
-
function
|
|
9711
|
+
function Es(e, t, n, r, i) {
|
|
9492
9712
|
let a, o;
|
|
9493
|
-
if (i ===
|
|
9494
|
-
else for (a = n - r; a >= t; a -= r) o =
|
|
9495
|
-
return o &&
|
|
9713
|
+
if (i === nc(e, t, n, r) > 0) for (a = t; a < n; a += r) o = $s(a, e[a], e[a + 1], o);
|
|
9714
|
+
else for (a = n - r; a >= t; a -= r) o = $s(a, e[a], e[a + 1], o);
|
|
9715
|
+
return o && Gs(o, o.next) && (ec(o), o = o.next), o;
|
|
9496
9716
|
}
|
|
9497
|
-
function
|
|
9717
|
+
function Ds(e, t) {
|
|
9498
9718
|
if (!e) return e;
|
|
9499
9719
|
t ||= e;
|
|
9500
9720
|
let n = e, r;
|
|
9501
9721
|
do
|
|
9502
|
-
if (r = !1, !n.steiner && (
|
|
9503
|
-
if (
|
|
9722
|
+
if (r = !1, !n.steiner && (Gs(n, n.next) || Ws(n.prev, n, n.next) === 0)) {
|
|
9723
|
+
if (ec(n), n = t = n.prev, n === n.next) break;
|
|
9504
9724
|
r = !0;
|
|
9505
9725
|
} else n = n.next;
|
|
9506
9726
|
while (r || n !== t);
|
|
9507
9727
|
return t;
|
|
9508
9728
|
}
|
|
9509
|
-
function
|
|
9729
|
+
function Os(e, t, n, r, i, a, o) {
|
|
9510
9730
|
if (!e) return;
|
|
9511
|
-
!o && a &&
|
|
9731
|
+
!o && a && Rs(e, r, i, a);
|
|
9512
9732
|
let s = e, c, l;
|
|
9513
9733
|
for (; e.prev !== e.next;) {
|
|
9514
|
-
if (c = e.prev, l = e.next, a ?
|
|
9515
|
-
t.push(c.i / n | 0), t.push(e.i / n | 0), t.push(l.i / n | 0),
|
|
9734
|
+
if (c = e.prev, l = e.next, a ? As(e, r, i, a) : ks(e)) {
|
|
9735
|
+
t.push(c.i / n | 0), t.push(e.i / n | 0), t.push(l.i / n | 0), ec(e), e = l.next, s = l.next;
|
|
9516
9736
|
continue;
|
|
9517
9737
|
}
|
|
9518
9738
|
if (e = l, e === s) {
|
|
9519
|
-
o ? o === 1 ? (e =
|
|
9739
|
+
o ? o === 1 ? (e = js(Ds(e), t, n), Os(e, t, n, r, i, a, 2)) : o === 2 && Ms(e, t, n, r, i, a) : Os(Ds(e), t, n, r, i, a, 1);
|
|
9520
9740
|
break;
|
|
9521
9741
|
}
|
|
9522
9742
|
}
|
|
9523
9743
|
}
|
|
9524
|
-
function
|
|
9744
|
+
function ks(e) {
|
|
9525
9745
|
let t = e.prev, n = e, r = e.next;
|
|
9526
|
-
if (
|
|
9746
|
+
if (Ws(t, n, r) >= 0) return !1;
|
|
9527
9747
|
let i = t.x, a = n.x, o = r.x, s = t.y, c = n.y, l = r.y, u = i < a ? i < o ? i : o : a < o ? a : o, d = s < c ? s < l ? s : l : c < l ? c : l, f = i > a ? i > o ? i : o : a > o ? a : o, p = s > c ? s > l ? s : l : c > l ? c : l, m = r.next;
|
|
9528
9748
|
for (; m !== t;) {
|
|
9529
|
-
if (m.x >= u && m.x <= f && m.y >= d && m.y <= p &&
|
|
9749
|
+
if (m.x >= u && m.x <= f && m.y >= d && m.y <= p && Hs(i, s, a, c, o, l, m.x, m.y) && Ws(m.prev, m, m.next) >= 0) return !1;
|
|
9530
9750
|
m = m.next;
|
|
9531
9751
|
}
|
|
9532
9752
|
return !0;
|
|
9533
9753
|
}
|
|
9534
|
-
function
|
|
9754
|
+
function As(e, t, n, r) {
|
|
9535
9755
|
let i = e.prev, a = e, o = e.next;
|
|
9536
|
-
if (
|
|
9537
|
-
let s = i.x, c = a.x, l = o.x, u = i.y, d = a.y, f = o.y, p = s < c ? s < l ? s : l : c < l ? c : l, m = u < d ? u < f ? u : f : d < f ? d : f, h = s > c ? s > l ? s : l : c > l ? c : l, g = u > d ? u > f ? u : f : d > f ? d : f, _ =
|
|
9756
|
+
if (Ws(i, a, o) >= 0) return !1;
|
|
9757
|
+
let s = i.x, c = a.x, l = o.x, u = i.y, d = a.y, f = o.y, p = s < c ? s < l ? s : l : c < l ? c : l, m = u < d ? u < f ? u : f : d < f ? d : f, h = s > c ? s > l ? s : l : c > l ? c : l, g = u > d ? u > f ? u : f : d > f ? d : f, _ = Bs(p, m, t, n, r), v = Bs(h, g, t, n, r), y = e.prevZ, b = e.nextZ;
|
|
9538
9758
|
for (; y && y.z >= _ && b && b.z <= v;) {
|
|
9539
|
-
if (y.x >= p && y.x <= h && y.y >= m && y.y <= g && y !== i && y !== o &&
|
|
9759
|
+
if (y.x >= p && y.x <= h && y.y >= m && y.y <= g && y !== i && y !== o && Hs(s, u, c, d, l, f, y.x, y.y) && Ws(y.prev, y, y.next) >= 0 || (y = y.prevZ, b.x >= p && b.x <= h && b.y >= m && b.y <= g && b !== i && b !== o && Hs(s, u, c, d, l, f, b.x, b.y) && Ws(b.prev, b, b.next) >= 0)) return !1;
|
|
9540
9760
|
b = b.nextZ;
|
|
9541
9761
|
}
|
|
9542
9762
|
for (; y && y.z >= _;) {
|
|
9543
|
-
if (y.x >= p && y.x <= h && y.y >= m && y.y <= g && y !== i && y !== o &&
|
|
9763
|
+
if (y.x >= p && y.x <= h && y.y >= m && y.y <= g && y !== i && y !== o && Hs(s, u, c, d, l, f, y.x, y.y) && Ws(y.prev, y, y.next) >= 0) return !1;
|
|
9544
9764
|
y = y.prevZ;
|
|
9545
9765
|
}
|
|
9546
9766
|
for (; b && b.z <= v;) {
|
|
9547
|
-
if (b.x >= p && b.x <= h && b.y >= m && b.y <= g && b !== i && b !== o &&
|
|
9767
|
+
if (b.x >= p && b.x <= h && b.y >= m && b.y <= g && b !== i && b !== o && Hs(s, u, c, d, l, f, b.x, b.y) && Ws(b.prev, b, b.next) >= 0) return !1;
|
|
9548
9768
|
b = b.nextZ;
|
|
9549
9769
|
}
|
|
9550
9770
|
return !0;
|
|
9551
9771
|
}
|
|
9552
|
-
function
|
|
9772
|
+
function js(e, t, n) {
|
|
9553
9773
|
let r = e;
|
|
9554
9774
|
do {
|
|
9555
9775
|
let i = r.prev, a = r.next.next;
|
|
9556
|
-
!
|
|
9776
|
+
!Gs(i, a) && Ks(i, r, r.next, a) && Xs(i, a) && Xs(a, i) && (t.push(i.i / n | 0), t.push(r.i / n | 0), t.push(a.i / n | 0), ec(r), ec(r.next), r = e = a), r = r.next;
|
|
9557
9777
|
} while (r !== e);
|
|
9558
|
-
return
|
|
9778
|
+
return Ds(r);
|
|
9559
9779
|
}
|
|
9560
|
-
function
|
|
9780
|
+
function Ms(e, t, n, r, i, a) {
|
|
9561
9781
|
let o = e;
|
|
9562
9782
|
do {
|
|
9563
9783
|
let e = o.next.next;
|
|
9564
9784
|
for (; e !== o.prev;) {
|
|
9565
|
-
if (o.i !== e.i &&
|
|
9566
|
-
let s =
|
|
9567
|
-
o =
|
|
9785
|
+
if (o.i !== e.i && Us(o, e)) {
|
|
9786
|
+
let s = Qs(o, e);
|
|
9787
|
+
o = Ds(o, o.next), s = Ds(s, s.next), Os(o, t, n, r, i, a, 0), Os(s, t, n, r, i, a, 0);
|
|
9568
9788
|
return;
|
|
9569
9789
|
}
|
|
9570
9790
|
e = e.next;
|
|
@@ -9572,22 +9792,22 @@ function fs(e, t, n, r, i, a) {
|
|
|
9572
9792
|
o = o.next;
|
|
9573
9793
|
} while (o !== e);
|
|
9574
9794
|
}
|
|
9575
|
-
function
|
|
9795
|
+
function Ns(e, t, n, r) {
|
|
9576
9796
|
let i = [], a, o, s, c, l;
|
|
9577
|
-
for (a = 0, o = t.length; a < o; a++) s = t[a] * r, c = a < o - 1 ? t[a + 1] * r : e.length, l =
|
|
9578
|
-
for (i.sort(
|
|
9797
|
+
for (a = 0, o = t.length; a < o; a++) s = t[a] * r, c = a < o - 1 ? t[a + 1] * r : e.length, l = Es(e, s, c, r, !1), l === l.next && (l.steiner = !0), i.push(Vs(l));
|
|
9798
|
+
for (i.sort(Ps), a = 0; a < i.length; a++) n = Fs(i[a], n);
|
|
9579
9799
|
return n;
|
|
9580
9800
|
}
|
|
9581
|
-
function
|
|
9801
|
+
function Ps(e, t) {
|
|
9582
9802
|
return e.x - t.x;
|
|
9583
9803
|
}
|
|
9584
|
-
function
|
|
9585
|
-
let n =
|
|
9804
|
+
function Fs(e, t) {
|
|
9805
|
+
let n = Is(e, t);
|
|
9586
9806
|
if (!n) return t;
|
|
9587
|
-
let r =
|
|
9588
|
-
return
|
|
9807
|
+
let r = Qs(n, e);
|
|
9808
|
+
return Ds(r, r.next), Ds(n, n.next);
|
|
9589
9809
|
}
|
|
9590
|
-
function
|
|
9810
|
+
function Is(e, t) {
|
|
9591
9811
|
let n = t, r = -Infinity, i, a = e.x, o = e.y;
|
|
9592
9812
|
do {
|
|
9593
9813
|
if (o <= n.y && o >= n.next.y && n.next.y !== n.y) {
|
|
@@ -9600,21 +9820,21 @@ function gs(e, t) {
|
|
|
9600
9820
|
let s = i, c = i.x, l = i.y, u = Infinity, d;
|
|
9601
9821
|
n = i;
|
|
9602
9822
|
do
|
|
9603
|
-
a >= n.x && n.x >= c && a !== n.x &&
|
|
9823
|
+
a >= n.x && n.x >= c && a !== n.x && Hs(o < l ? a : r, o, c, l, o < l ? r : a, o, n.x, n.y) && (d = Math.abs(o - n.y) / (a - n.x), Xs(n, e) && (d < u || d === u && (n.x > i.x || n.x === i.x && Ls(i, n))) && (i = n, u = d)), n = n.next;
|
|
9604
9824
|
while (n !== s);
|
|
9605
9825
|
return i;
|
|
9606
9826
|
}
|
|
9607
|
-
function
|
|
9608
|
-
return
|
|
9827
|
+
function Ls(e, t) {
|
|
9828
|
+
return Ws(e.prev, e, t.prev) < 0 && Ws(t.next, e, e.next) < 0;
|
|
9609
9829
|
}
|
|
9610
|
-
function
|
|
9830
|
+
function Rs(e, t, n, r) {
|
|
9611
9831
|
let i = e;
|
|
9612
9832
|
do
|
|
9613
|
-
i.z === 0 && (i.z =
|
|
9833
|
+
i.z === 0 && (i.z = Bs(i.x, i.y, t, n, r)), i.prevZ = i.prev, i.nextZ = i.next, i = i.next;
|
|
9614
9834
|
while (i !== e);
|
|
9615
|
-
i.prevZ.nextZ = null, i.prevZ = null,
|
|
9835
|
+
i.prevZ.nextZ = null, i.prevZ = null, zs(i);
|
|
9616
9836
|
}
|
|
9617
|
-
function
|
|
9837
|
+
function zs(e) {
|
|
9618
9838
|
let t, n, r, i, a, o, s, c, l = 1;
|
|
9619
9839
|
do {
|
|
9620
9840
|
for (n = e, e = null, a = null, o = 0; n;) {
|
|
@@ -9626,76 +9846,76 @@ function ys(e) {
|
|
|
9626
9846
|
} while (o > 1);
|
|
9627
9847
|
return e;
|
|
9628
9848
|
}
|
|
9629
|
-
function
|
|
9849
|
+
function Bs(e, t, n, r, i) {
|
|
9630
9850
|
return e = (e - n) * i | 0, t = (t - r) * i | 0, e = (e | e << 8) & 16711935, e = (e | e << 4) & 252645135, e = (e | e << 2) & 858993459, e = (e | e << 1) & 1431655765, t = (t | t << 8) & 16711935, t = (t | t << 4) & 252645135, t = (t | t << 2) & 858993459, t = (t | t << 1) & 1431655765, e | t << 1;
|
|
9631
9851
|
}
|
|
9632
|
-
function
|
|
9852
|
+
function Vs(e) {
|
|
9633
9853
|
let t = e, n = e;
|
|
9634
9854
|
do
|
|
9635
9855
|
(t.x < n.x || t.x === n.x && t.y < n.y) && (n = t), t = t.next;
|
|
9636
9856
|
while (t !== e);
|
|
9637
9857
|
return n;
|
|
9638
9858
|
}
|
|
9639
|
-
function
|
|
9859
|
+
function Hs(e, t, n, r, i, a, o, s) {
|
|
9640
9860
|
return (i - o) * (t - s) >= (e - o) * (a - s) && (e - o) * (r - s) >= (n - o) * (t - s) && (n - o) * (a - s) >= (i - o) * (r - s);
|
|
9641
9861
|
}
|
|
9642
|
-
function
|
|
9643
|
-
return e.next.i !== t.i && e.prev.i !== t.i && !
|
|
9862
|
+
function Us(e, t) {
|
|
9863
|
+
return e.next.i !== t.i && e.prev.i !== t.i && !Ys(e, t) && (Xs(e, t) && Xs(t, e) && Zs(e, t) && (Ws(e.prev, e, t.prev) || Ws(e, t.prev, t)) || Gs(e, t) && Ws(e.prev, e, e.next) > 0 && Ws(t.prev, t, t.next) > 0);
|
|
9644
9864
|
}
|
|
9645
|
-
function
|
|
9865
|
+
function Ws(e, t, n) {
|
|
9646
9866
|
return (t.y - e.y) * (n.x - t.x) - (t.x - e.x) * (n.y - t.y);
|
|
9647
9867
|
}
|
|
9648
|
-
function
|
|
9868
|
+
function Gs(e, t) {
|
|
9649
9869
|
return e.x === t.x && e.y === t.y;
|
|
9650
9870
|
}
|
|
9651
|
-
function
|
|
9652
|
-
let i =
|
|
9653
|
-
return !!(i !== a && o !== s || i === 0 &&
|
|
9871
|
+
function Ks(e, t, n, r) {
|
|
9872
|
+
let i = Js(Ws(e, t, n)), a = Js(Ws(e, t, r)), o = Js(Ws(n, r, e)), s = Js(Ws(n, r, t));
|
|
9873
|
+
return !!(i !== a && o !== s || i === 0 && qs(e, n, t) || a === 0 && qs(e, r, t) || o === 0 && qs(n, e, r) || s === 0 && qs(n, t, r));
|
|
9654
9874
|
}
|
|
9655
|
-
function
|
|
9875
|
+
function qs(e, t, n) {
|
|
9656
9876
|
return t.x <= Math.max(e.x, n.x) && t.x >= Math.min(e.x, n.x) && t.y <= Math.max(e.y, n.y) && t.y >= Math.min(e.y, n.y);
|
|
9657
9877
|
}
|
|
9658
|
-
function
|
|
9878
|
+
function Js(e) {
|
|
9659
9879
|
return e > 0 ? 1 : e < 0 ? -1 : 0;
|
|
9660
9880
|
}
|
|
9661
|
-
function
|
|
9881
|
+
function Ys(e, t) {
|
|
9662
9882
|
let n = e;
|
|
9663
9883
|
do {
|
|
9664
|
-
if (n.i !== e.i && n.next.i !== e.i && n.i !== t.i && n.next.i !== t.i &&
|
|
9884
|
+
if (n.i !== e.i && n.next.i !== e.i && n.i !== t.i && n.next.i !== t.i && Ks(n, n.next, e, t)) return !0;
|
|
9665
9885
|
n = n.next;
|
|
9666
9886
|
} while (n !== e);
|
|
9667
9887
|
return !1;
|
|
9668
9888
|
}
|
|
9669
|
-
function
|
|
9670
|
-
return
|
|
9889
|
+
function Xs(e, t) {
|
|
9890
|
+
return Ws(e.prev, e, e.next) < 0 ? Ws(e, t, e.next) >= 0 && Ws(e, e.prev, t) >= 0 : Ws(e, t, e.prev) < 0 || Ws(e, e.next, t) < 0;
|
|
9671
9891
|
}
|
|
9672
|
-
function
|
|
9892
|
+
function Zs(e, t) {
|
|
9673
9893
|
let n = e, r = !1, i = (e.x + t.x) / 2, a = (e.y + t.y) / 2;
|
|
9674
9894
|
do
|
|
9675
9895
|
n.y > a != n.next.y > a && n.next.y !== n.y && i < (n.next.x - n.x) * (a - n.y) / (n.next.y - n.y) + n.x && (r = !r), n = n.next;
|
|
9676
9896
|
while (n !== e);
|
|
9677
9897
|
return r;
|
|
9678
9898
|
}
|
|
9679
|
-
function
|
|
9680
|
-
let n = new
|
|
9899
|
+
function Qs(e, t) {
|
|
9900
|
+
let n = new tc(e.i, e.x, e.y), r = new tc(t.i, t.x, t.y), i = e.next, a = t.prev;
|
|
9681
9901
|
return e.next = t, t.prev = e, n.next = i, i.prev = n, r.next = n, n.prev = r, a.next = r, r.prev = a, r;
|
|
9682
9902
|
}
|
|
9683
|
-
function
|
|
9684
|
-
let i = new
|
|
9903
|
+
function $s(e, t, n, r) {
|
|
9904
|
+
let i = new tc(e, t, n);
|
|
9685
9905
|
return r ? (i.next = r.next, i.prev = r, r.next.prev = i, r.next = i) : (i.prev = i, i.next = i), i;
|
|
9686
9906
|
}
|
|
9687
|
-
function
|
|
9907
|
+
function ec(e) {
|
|
9688
9908
|
e.next.prev = e.prev, e.prev.next = e.next, e.prevZ && (e.prevZ.nextZ = e.nextZ), e.nextZ && (e.nextZ.prevZ = e.prevZ);
|
|
9689
9909
|
}
|
|
9690
|
-
function
|
|
9910
|
+
function tc(e, t, n) {
|
|
9691
9911
|
this.i = e, this.x = t, this.y = n, this.prev = null, this.next = null, this.z = 0, this.prevZ = null, this.nextZ = null, this.steiner = !1;
|
|
9692
9912
|
}
|
|
9693
|
-
function
|
|
9913
|
+
function nc(e, t, n, r) {
|
|
9694
9914
|
let i = 0;
|
|
9695
9915
|
for (let a = t, o = n - r; a < n; a += r) i += (e[o] - e[a]) * (e[a + 1] + e[o + 1]), o = a;
|
|
9696
9916
|
return i;
|
|
9697
9917
|
}
|
|
9698
|
-
var
|
|
9918
|
+
var rc = class e {
|
|
9699
9919
|
static area(e) {
|
|
9700
9920
|
let t = e.length, n = 0;
|
|
9701
9921
|
for (let r = t - 1, i = 0; i < t; r = i++) n += e[r].x * e[i].y - e[i].x * e[r].y;
|
|
@@ -9706,23 +9926,23 @@ var Ls = class e {
|
|
|
9706
9926
|
}
|
|
9707
9927
|
static triangulateShape(e, t) {
|
|
9708
9928
|
let n = [], r = [], i = [];
|
|
9709
|
-
|
|
9929
|
+
ic(e), ac(n, e);
|
|
9710
9930
|
let a = e.length;
|
|
9711
|
-
t.forEach(
|
|
9712
|
-
for (let e = 0; e < t.length; e++) r.push(a), a += t[e].length,
|
|
9713
|
-
let o =
|
|
9931
|
+
t.forEach(ic);
|
|
9932
|
+
for (let e = 0; e < t.length; e++) r.push(a), a += t[e].length, ac(n, t[e]);
|
|
9933
|
+
let o = Ts.triangulate(n, r);
|
|
9714
9934
|
for (let e = 0; e < o.length; e += 3) i.push(o.slice(e, e + 3));
|
|
9715
9935
|
return i;
|
|
9716
9936
|
}
|
|
9717
9937
|
};
|
|
9718
|
-
function
|
|
9938
|
+
function ic(e) {
|
|
9719
9939
|
let t = e.length;
|
|
9720
9940
|
t > 2 && e[t - 1].equals(e[0]) && e.pop();
|
|
9721
9941
|
}
|
|
9722
|
-
function
|
|
9942
|
+
function ac(e, t) {
|
|
9723
9943
|
for (let n = 0; n < t.length; n++) e.push(t[n].x), e.push(t[n].y);
|
|
9724
9944
|
}
|
|
9725
|
-
var
|
|
9945
|
+
var oc = class e extends Dn {
|
|
9726
9946
|
constructor(e = .5, t = 1, n = 32, r = 1, i = 0, a = Math.PI * 2) {
|
|
9727
9947
|
super(), this.type = "RingGeometry", this.parameters = {
|
|
9728
9948
|
innerRadius: e,
|
|
@@ -9755,8 +9975,8 @@ var Bs = class e extends Dn {
|
|
|
9755
9975
|
static fromJSON(t) {
|
|
9756
9976
|
return new e(t.innerRadius, t.outerRadius, t.thetaSegments, t.phiSegments, t.thetaStart, t.thetaLength);
|
|
9757
9977
|
}
|
|
9758
|
-
},
|
|
9759
|
-
constructor(e = new
|
|
9978
|
+
}, sc = class e extends Dn {
|
|
9979
|
+
constructor(e = new ws([
|
|
9760
9980
|
new K(0, .5),
|
|
9761
9981
|
new K(-.5, -.5),
|
|
9762
9982
|
new K(.5, -.5)
|
|
@@ -9771,12 +9991,12 @@ var Bs = class e extends Dn {
|
|
|
9771
9991
|
this.setIndex(n), this.setAttribute("position", new yn(r, 3)), this.setAttribute("normal", new yn(i, 3)), this.setAttribute("uv", new yn(a, 2));
|
|
9772
9992
|
function c(e) {
|
|
9773
9993
|
let o = r.length / 3, c = e.extractPoints(t), l = c.shape, u = c.holes;
|
|
9774
|
-
|
|
9994
|
+
rc.isClockWise(l) === !1 && (l = l.reverse());
|
|
9775
9995
|
for (let e = 0, t = u.length; e < t; e++) {
|
|
9776
9996
|
let t = u[e];
|
|
9777
|
-
|
|
9997
|
+
rc.isClockWise(t) === !0 && (u[e] = t.reverse());
|
|
9778
9998
|
}
|
|
9779
|
-
let d =
|
|
9999
|
+
let d = rc.triangulateShape(l, u);
|
|
9780
10000
|
for (let e = 0, t = u.length; e < t; e++) {
|
|
9781
10001
|
let t = u[e];
|
|
9782
10002
|
l = l.concat(t);
|
|
@@ -9796,7 +10016,7 @@ var Bs = class e extends Dn {
|
|
|
9796
10016
|
}
|
|
9797
10017
|
toJSON() {
|
|
9798
10018
|
let e = super.toJSON(), t = this.parameters.shapes;
|
|
9799
|
-
return
|
|
10019
|
+
return cc(t, e);
|
|
9800
10020
|
}
|
|
9801
10021
|
static fromJSON(t, n) {
|
|
9802
10022
|
let r = [];
|
|
@@ -9807,7 +10027,7 @@ var Bs = class e extends Dn {
|
|
|
9807
10027
|
return new e(r, t.curveSegments);
|
|
9808
10028
|
}
|
|
9809
10029
|
};
|
|
9810
|
-
function
|
|
10030
|
+
function cc(e, t) {
|
|
9811
10031
|
if (t.shapes = [], Array.isArray(e)) for (let n = 0, r = e.length; n < r; n++) {
|
|
9812
10032
|
let r = e[n];
|
|
9813
10033
|
t.shapes.push(r.uuid);
|
|
@@ -9815,7 +10035,7 @@ function Hs(e, t) {
|
|
|
9815
10035
|
else t.shapes.push(e.uuid);
|
|
9816
10036
|
return t;
|
|
9817
10037
|
}
|
|
9818
|
-
var
|
|
10038
|
+
var lc = class e extends Dn {
|
|
9819
10039
|
constructor(e = 1, t = 32, n = 16, r = 0, i = Math.PI * 2, a = 0, o = Math.PI) {
|
|
9820
10040
|
super(), this.type = "SphereGeometry", this.parameters = {
|
|
9821
10041
|
radius: e,
|
|
@@ -9848,7 +10068,7 @@ var Us = class e extends Dn {
|
|
|
9848
10068
|
static fromJSON(t) {
|
|
9849
10069
|
return new e(t.radius, t.widthSegments, t.heightSegments, t.phiStart, t.phiLength, t.thetaStart, t.thetaLength);
|
|
9850
10070
|
}
|
|
9851
|
-
},
|
|
10071
|
+
}, uc = class extends zo {
|
|
9852
10072
|
constructor(e) {
|
|
9853
10073
|
super(), this.isLineDashedMaterial = !0, this.type = "LineDashedMaterial", this.scale = 1, this.dashSize = 3, this.gapSize = 1, this.setValues(e);
|
|
9854
10074
|
}
|
|
@@ -9856,13 +10076,13 @@ var Us = class e extends Dn {
|
|
|
9856
10076
|
return super.copy(e), this.scale = e.scale, this.dashSize = e.dashSize, this.gapSize = e.gapSize, this;
|
|
9857
10077
|
}
|
|
9858
10078
|
};
|
|
9859
|
-
function
|
|
10079
|
+
function dc(e, t, n) {
|
|
9860
10080
|
return !e || !n && e.constructor === t ? e : typeof t.BYTES_PER_ELEMENT == "number" ? new t(e) : Array.prototype.slice.call(e);
|
|
9861
10081
|
}
|
|
9862
|
-
function
|
|
10082
|
+
function fc(e) {
|
|
9863
10083
|
return ArrayBuffer.isView(e) && !(e instanceof DataView);
|
|
9864
10084
|
}
|
|
9865
|
-
var
|
|
10085
|
+
var pc = class {
|
|
9866
10086
|
constructor(e, t, n, r) {
|
|
9867
10087
|
this.parameterPositions = e, this._cachedIndex = 0, this.resultBuffer = r === void 0 ? new t.constructor(n) : r, this.sampleValues = t, this.valueSize = n, this.settings = null, this.DefaultSettings_ = {};
|
|
9868
10088
|
}
|
|
@@ -9920,7 +10140,7 @@ var qs = class {
|
|
|
9920
10140
|
throw Error("call to abstract method");
|
|
9921
10141
|
}
|
|
9922
10142
|
intervalChanged_() {}
|
|
9923
|
-
},
|
|
10143
|
+
}, mc = class extends pc {
|
|
9924
10144
|
constructor(e, t, n, r) {
|
|
9925
10145
|
super(e, t, n, r), this._weightPrev = -0, this._offsetPrev = -0, this._weightNext = -0, this._offsetNext = -0, this.DefaultSettings_ = {
|
|
9926
10146
|
endingStart: S,
|
|
@@ -9955,7 +10175,7 @@ var qs = class {
|
|
|
9955
10175
|
for (let e = 0; e !== o; ++e) i[e] = g * a[l + e] + _ * a[c + e] + v * a[s + e] + y * a[u + e];
|
|
9956
10176
|
return i;
|
|
9957
10177
|
}
|
|
9958
|
-
},
|
|
10178
|
+
}, hc = class extends pc {
|
|
9959
10179
|
constructor(e, t, n, r) {
|
|
9960
10180
|
super(e, t, n, r);
|
|
9961
10181
|
}
|
|
@@ -9964,18 +10184,18 @@ var qs = class {
|
|
|
9964
10184
|
for (let e = 0; e !== o; ++e) i[e] = a[c + e] * u + a[s + e] * l;
|
|
9965
10185
|
return i;
|
|
9966
10186
|
}
|
|
9967
|
-
},
|
|
10187
|
+
}, gc = class extends pc {
|
|
9968
10188
|
constructor(e, t, n, r) {
|
|
9969
10189
|
super(e, t, n, r);
|
|
9970
10190
|
}
|
|
9971
10191
|
interpolate_(e) {
|
|
9972
10192
|
return this.copySampleValue_(e - 1);
|
|
9973
10193
|
}
|
|
9974
|
-
},
|
|
10194
|
+
}, _c = class {
|
|
9975
10195
|
constructor(e, t, n, r) {
|
|
9976
10196
|
if (e === void 0) throw Error("THREE.KeyframeTrack: track name is undefined");
|
|
9977
10197
|
if (t === void 0 || t.length === 0) throw Error("THREE.KeyframeTrack: no keyframes in track named " + e);
|
|
9978
|
-
this.name = e, this.times =
|
|
10198
|
+
this.name = e, this.times = dc(t, this.TimeBufferType), this.values = dc(n, this.ValueBufferType), this.setInterpolation(r || this.DefaultInterpolation);
|
|
9979
10199
|
}
|
|
9980
10200
|
static toJSON(e) {
|
|
9981
10201
|
let t = e.constructor, n;
|
|
@@ -9983,8 +10203,8 @@ var qs = class {
|
|
|
9983
10203
|
else {
|
|
9984
10204
|
n = {
|
|
9985
10205
|
name: e.name,
|
|
9986
|
-
times:
|
|
9987
|
-
values:
|
|
10206
|
+
times: dc(e.times, Array),
|
|
10207
|
+
values: dc(e.values, Array)
|
|
9988
10208
|
};
|
|
9989
10209
|
let t = e.getInterpolation();
|
|
9990
10210
|
t !== e.DefaultInterpolation && (n.interpolation = t);
|
|
@@ -9992,13 +10212,13 @@ var qs = class {
|
|
|
9992
10212
|
return n.type = e.ValueTypeName, n;
|
|
9993
10213
|
}
|
|
9994
10214
|
InterpolantFactoryMethodDiscrete(e) {
|
|
9995
|
-
return new
|
|
10215
|
+
return new gc(this.times, this.values, this.getValueSize(), e);
|
|
9996
10216
|
}
|
|
9997
10217
|
InterpolantFactoryMethodLinear(e) {
|
|
9998
|
-
return new
|
|
10218
|
+
return new hc(this.times, this.values, this.getValueSize(), e);
|
|
9999
10219
|
}
|
|
10000
10220
|
InterpolantFactoryMethodSmooth(e) {
|
|
10001
|
-
return new
|
|
10221
|
+
return new mc(this.times, this.values, this.getValueSize(), e);
|
|
10002
10222
|
}
|
|
10003
10223
|
setInterpolation(e) {
|
|
10004
10224
|
let t;
|
|
@@ -10074,7 +10294,7 @@ var qs = class {
|
|
|
10074
10294
|
}
|
|
10075
10295
|
a = r;
|
|
10076
10296
|
}
|
|
10077
|
-
if (r !== void 0 &&
|
|
10297
|
+
if (r !== void 0 && fc(r)) for (let t = 0, n = r.length; t !== n; ++t) {
|
|
10078
10298
|
let n = r[t];
|
|
10079
10299
|
if (isNaN(n)) {
|
|
10080
10300
|
console.error("THREE.KeyframeTrack: Value is not a valid number.", this, t, n), e = !1;
|
|
@@ -10119,14 +10339,14 @@ var qs = class {
|
|
|
10119
10339
|
return r.createInterpolant = this.createInterpolant, r;
|
|
10120
10340
|
}
|
|
10121
10341
|
};
|
|
10122
|
-
|
|
10123
|
-
var
|
|
10124
|
-
|
|
10125
|
-
var
|
|
10126
|
-
|
|
10127
|
-
var
|
|
10128
|
-
|
|
10129
|
-
var
|
|
10342
|
+
_c.prototype.TimeBufferType = Float32Array, _c.prototype.ValueBufferType = Float32Array, _c.prototype.DefaultInterpolation = b;
|
|
10343
|
+
var vc = class extends _c {};
|
|
10344
|
+
vc.prototype.ValueTypeName = "bool", vc.prototype.ValueBufferType = Array, vc.prototype.DefaultInterpolation = y, vc.prototype.InterpolantFactoryMethodLinear = void 0, vc.prototype.InterpolantFactoryMethodSmooth = void 0;
|
|
10345
|
+
var yc = class extends _c {};
|
|
10346
|
+
yc.prototype.ValueTypeName = "color";
|
|
10347
|
+
var bc = class extends _c {};
|
|
10348
|
+
bc.prototype.ValueTypeName = "number";
|
|
10349
|
+
var xc = class extends pc {
|
|
10130
10350
|
constructor(e, t, n, r) {
|
|
10131
10351
|
super(e, t, n, r);
|
|
10132
10352
|
}
|
|
@@ -10135,17 +10355,17 @@ var tc = class extends qs {
|
|
|
10135
10355
|
for (let e = c + o; c !== e; c += 4) Ge.slerpFlat(i, 0, a, c - o, a, c, s);
|
|
10136
10356
|
return i;
|
|
10137
10357
|
}
|
|
10138
|
-
},
|
|
10358
|
+
}, Sc = class extends _c {
|
|
10139
10359
|
InterpolantFactoryMethodLinear(e) {
|
|
10140
|
-
return new
|
|
10360
|
+
return new xc(this.times, this.values, this.getValueSize(), e);
|
|
10141
10361
|
}
|
|
10142
10362
|
};
|
|
10143
|
-
|
|
10144
|
-
var
|
|
10145
|
-
|
|
10146
|
-
var
|
|
10147
|
-
|
|
10148
|
-
var
|
|
10363
|
+
Sc.prototype.ValueTypeName = "quaternion", Sc.prototype.DefaultInterpolation = b, Sc.prototype.InterpolantFactoryMethodSmooth = void 0;
|
|
10364
|
+
var Cc = class extends _c {};
|
|
10365
|
+
Cc.prototype.ValueTypeName = "string", Cc.prototype.ValueBufferType = Array, Cc.prototype.DefaultInterpolation = y, Cc.prototype.InterpolantFactoryMethodLinear = void 0, Cc.prototype.InterpolantFactoryMethodSmooth = void 0;
|
|
10366
|
+
var wc = class extends _c {};
|
|
10367
|
+
wc.prototype.ValueTypeName = "vector";
|
|
10368
|
+
var Tc = {
|
|
10149
10369
|
enabled: !1,
|
|
10150
10370
|
files: {},
|
|
10151
10371
|
add: function(e, t) {
|
|
@@ -10160,7 +10380,7 @@ var ac = {
|
|
|
10160
10380
|
clear: function() {
|
|
10161
10381
|
this.files = {};
|
|
10162
10382
|
}
|
|
10163
|
-
},
|
|
10383
|
+
}, Ec = /*@__PURE__*/ new class {
|
|
10164
10384
|
constructor(e, t, n) {
|
|
10165
10385
|
let r = this, i = !1, a = 0, o = 0, s, c = [];
|
|
10166
10386
|
this.onStart = void 0, this.onLoad = e, this.onProgress = t, this.onError = n, this.itemStart = function(e) {
|
|
@@ -10186,9 +10406,9 @@ var ac = {
|
|
|
10186
10406
|
return null;
|
|
10187
10407
|
};
|
|
10188
10408
|
}
|
|
10189
|
-
}(),
|
|
10409
|
+
}(), Dc = class {
|
|
10190
10410
|
constructor(e) {
|
|
10191
|
-
this.manager = e === void 0 ?
|
|
10411
|
+
this.manager = e === void 0 ? Ec : e, this.crossOrigin = "anonymous", this.withCredentials = !1, this.path = "", this.resourcePath = "", this.requestHeader = {};
|
|
10192
10412
|
}
|
|
10193
10413
|
load() {}
|
|
10194
10414
|
loadAsync(e, t) {
|
|
@@ -10214,20 +10434,20 @@ var ac = {
|
|
|
10214
10434
|
return this.requestHeader = e, this;
|
|
10215
10435
|
}
|
|
10216
10436
|
};
|
|
10217
|
-
|
|
10218
|
-
var
|
|
10437
|
+
Dc.DEFAULT_MATERIAL_NAME = "__DEFAULT";
|
|
10438
|
+
var Oc = class extends Dc {
|
|
10219
10439
|
constructor(e) {
|
|
10220
10440
|
super(e);
|
|
10221
10441
|
}
|
|
10222
10442
|
load(e, t, n, r) {
|
|
10223
10443
|
this.path !== void 0 && (e = this.path + e), e = this.manager.resolveURL(e);
|
|
10224
|
-
let i = this, a =
|
|
10444
|
+
let i = this, a = Tc.get(e);
|
|
10225
10445
|
if (a !== void 0) return i.manager.itemStart(e), setTimeout(function() {
|
|
10226
10446
|
t && t(a), i.manager.itemEnd(e);
|
|
10227
10447
|
}, 0), a;
|
|
10228
10448
|
let o = Ce("img");
|
|
10229
10449
|
function s() {
|
|
10230
|
-
l(),
|
|
10450
|
+
l(), Tc.add(e, this), t && t(this), i.manager.itemEnd(e);
|
|
10231
10451
|
}
|
|
10232
10452
|
function c(t) {
|
|
10233
10453
|
l(), r && r(t), i.manager.itemError(e), i.manager.itemEnd(e);
|
|
@@ -10237,24 +10457,24 @@ var cc = class extends sc {
|
|
|
10237
10457
|
}
|
|
10238
10458
|
return o.addEventListener("load", s, !1), o.addEventListener("error", c, !1), e.slice(0, 5) !== "data:" && this.crossOrigin !== void 0 && (o.crossOrigin = this.crossOrigin), i.manager.itemStart(e), o.src = e, o;
|
|
10239
10459
|
}
|
|
10240
|
-
},
|
|
10460
|
+
}, kc = class extends Dc {
|
|
10241
10461
|
constructor(e) {
|
|
10242
10462
|
super(e);
|
|
10243
10463
|
}
|
|
10244
10464
|
load(e, t, n, r) {
|
|
10245
|
-
let i = new ze(), a = new
|
|
10465
|
+
let i = new ze(), a = new Oc(this.manager);
|
|
10246
10466
|
return a.setCrossOrigin(this.crossOrigin), a.setPath(this.path), a.load(e, function(e) {
|
|
10247
10467
|
i.image = e, i.needsUpdate = !0, t !== void 0 && t(i);
|
|
10248
10468
|
}, n, r), i;
|
|
10249
10469
|
}
|
|
10250
|
-
},
|
|
10470
|
+
}, Ac = "\\[\\]\\.:\\/", jc = /* @__PURE__ */ RegExp("[\\[\\]\\.:\\/]", "g"), Mc = "[^\\[\\]\\.:\\/]", Nc = "[^" + Ac.replace("\\.", "") + "]", Pc = /*@__PURE__*/ "((?:WC+[\\/:])*)".replace("WC", Mc), Fc = /*@__PURE__*/ "(WCOD+)?".replace("WCOD", Nc), Ic = /*@__PURE__*/ "(?:\\.(WC+)(?:\\[(.+)\\])?)?".replace("WC", Mc), Lc = /*@__PURE__*/ "\\.(WC+)(?:\\[(.+)\\])?".replace("WC", Mc), Rc = RegExp("^" + Pc + Fc + Ic + Lc + "$"), zc = [
|
|
10251
10471
|
"material",
|
|
10252
10472
|
"materials",
|
|
10253
10473
|
"bones",
|
|
10254
10474
|
"map"
|
|
10255
|
-
],
|
|
10475
|
+
], Bc = class {
|
|
10256
10476
|
constructor(e, t, n) {
|
|
10257
|
-
let r = n ||
|
|
10477
|
+
let r = n || Vc.parseTrackName(t);
|
|
10258
10478
|
this._targetGroup = e, this._bindings = e.subscribe_(t, r);
|
|
10259
10479
|
}
|
|
10260
10480
|
getValue(e, t) {
|
|
@@ -10274,7 +10494,7 @@ var cc = class extends sc {
|
|
|
10274
10494
|
let e = this._bindings;
|
|
10275
10495
|
for (let t = this._targetGroup.nCachedObjects_, n = e.length; t !== n; ++t) e[t].unbind();
|
|
10276
10496
|
}
|
|
10277
|
-
},
|
|
10497
|
+
}, Vc = class e {
|
|
10278
10498
|
constructor(t, n, r) {
|
|
10279
10499
|
this.path = n, this.parsedPath = r || e.parseTrackName(n), this.node = e.findNode(t, this.parsedPath.nodeName), this.rootNode = t, this.getValue = this._getValue_unbound, this.setValue = this._setValue_unbound;
|
|
10280
10500
|
}
|
|
@@ -10282,10 +10502,10 @@ var cc = class extends sc {
|
|
|
10282
10502
|
return t && t.isAnimationObjectGroup ? new e.Composite(t, n, r) : new e(t, n, r);
|
|
10283
10503
|
}
|
|
10284
10504
|
static sanitizeNodeName(e) {
|
|
10285
|
-
return e.replace(/\s/g, "_").replace(
|
|
10505
|
+
return e.replace(/\s/g, "_").replace(jc, "");
|
|
10286
10506
|
}
|
|
10287
10507
|
static parseTrackName(e) {
|
|
10288
|
-
let t =
|
|
10508
|
+
let t = Rc.exec(e);
|
|
10289
10509
|
if (t === null) throw Error("PropertyBinding: Cannot parse trackName: " + e);
|
|
10290
10510
|
let n = {
|
|
10291
10511
|
nodeName: t[2],
|
|
@@ -10296,7 +10516,7 @@ var cc = class extends sc {
|
|
|
10296
10516
|
}, r = n.nodeName && n.nodeName.lastIndexOf(".");
|
|
10297
10517
|
if (r !== void 0 && r !== -1) {
|
|
10298
10518
|
let e = n.nodeName.substring(r + 1);
|
|
10299
|
-
|
|
10519
|
+
zc.indexOf(e) !== -1 && (n.nodeName = n.nodeName.substring(0, r), n.objectName = e);
|
|
10300
10520
|
}
|
|
10301
10521
|
if (n.propertyName === null || n.propertyName.length === 0) throw Error("PropertyBinding: can not parse propertyName from trackName: " + e);
|
|
10302
10522
|
return n;
|
|
@@ -10473,43 +10693,43 @@ var cc = class extends sc {
|
|
|
10473
10693
|
this.node = null, this.getValue = this._getValue_unbound, this.setValue = this._setValue_unbound;
|
|
10474
10694
|
}
|
|
10475
10695
|
};
|
|
10476
|
-
|
|
10696
|
+
Vc.Composite = Bc, Vc.prototype.BindingType = {
|
|
10477
10697
|
Direct: 0,
|
|
10478
10698
|
EntireArray: 1,
|
|
10479
10699
|
ArrayElement: 2,
|
|
10480
10700
|
HasFromToArray: 3
|
|
10481
|
-
},
|
|
10701
|
+
}, Vc.prototype.Versioning = {
|
|
10482
10702
|
None: 0,
|
|
10483
10703
|
NeedsUpdate: 1,
|
|
10484
10704
|
MatrixWorldNeedsUpdate: 2
|
|
10485
|
-
},
|
|
10486
|
-
|
|
10487
|
-
|
|
10488
|
-
|
|
10489
|
-
|
|
10490
|
-
],
|
|
10705
|
+
}, Vc.prototype.GetterByBindingType = [
|
|
10706
|
+
Vc.prototype._getValue_direct,
|
|
10707
|
+
Vc.prototype._getValue_array,
|
|
10708
|
+
Vc.prototype._getValue_arrayElement,
|
|
10709
|
+
Vc.prototype._getValue_toArray
|
|
10710
|
+
], Vc.prototype.SetterByBindingTypeAndVersioning = [
|
|
10491
10711
|
[
|
|
10492
|
-
|
|
10493
|
-
|
|
10494
|
-
|
|
10712
|
+
Vc.prototype._setValue_direct,
|
|
10713
|
+
Vc.prototype._setValue_direct_setNeedsUpdate,
|
|
10714
|
+
Vc.prototype._setValue_direct_setMatrixWorldNeedsUpdate
|
|
10495
10715
|
],
|
|
10496
10716
|
[
|
|
10497
|
-
|
|
10498
|
-
|
|
10499
|
-
|
|
10717
|
+
Vc.prototype._setValue_array,
|
|
10718
|
+
Vc.prototype._setValue_array_setNeedsUpdate,
|
|
10719
|
+
Vc.prototype._setValue_array_setMatrixWorldNeedsUpdate
|
|
10500
10720
|
],
|
|
10501
10721
|
[
|
|
10502
|
-
|
|
10503
|
-
|
|
10504
|
-
|
|
10722
|
+
Vc.prototype._setValue_arrayElement,
|
|
10723
|
+
Vc.prototype._setValue_arrayElement_setNeedsUpdate,
|
|
10724
|
+
Vc.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate
|
|
10505
10725
|
],
|
|
10506
10726
|
[
|
|
10507
|
-
|
|
10508
|
-
|
|
10509
|
-
|
|
10727
|
+
Vc.prototype._setValue_fromArray,
|
|
10728
|
+
Vc.prototype._setValue_fromArray_setNeedsUpdate,
|
|
10729
|
+
Vc.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate
|
|
10510
10730
|
]
|
|
10511
10731
|
];
|
|
10512
|
-
var
|
|
10732
|
+
var Hc = class {
|
|
10513
10733
|
constructor(e, t, n = 0, r = Infinity) {
|
|
10514
10734
|
this.ray = new bt(e, t), this.near = n, this.far = r, this.camera = null, this.layers = new Mt(), this.params = {
|
|
10515
10735
|
Mesh: {},
|
|
@@ -10526,26 +10746,26 @@ var Sc = class {
|
|
|
10526
10746
|
t.isPerspectiveCamera ? (this.ray.origin.setFromMatrixPosition(t.matrixWorld), this.ray.direction.set(e.x, e.y, .5).unproject(t).sub(this.ray.origin).normalize(), this.camera = t) : t.isOrthographicCamera ? (this.ray.origin.set(e.x, e.y, (t.near + t.far) / (t.near - t.far)).unproject(t), this.ray.direction.set(0, 0, -1).transformDirection(t.matrixWorld), this.camera = t) : console.error("THREE.Raycaster: Unsupported camera type: " + t.type);
|
|
10527
10747
|
}
|
|
10528
10748
|
intersectObject(e, t = !0, n = []) {
|
|
10529
|
-
return
|
|
10749
|
+
return Wc(e, this, n, t), n.sort(Uc), n;
|
|
10530
10750
|
}
|
|
10531
10751
|
intersectObjects(e, t = !0, n = []) {
|
|
10532
|
-
for (let r = 0, i = e.length; r < i; r++)
|
|
10533
|
-
return n.sort(
|
|
10752
|
+
for (let r = 0, i = e.length; r < i; r++) Wc(e[r], this, n, t);
|
|
10753
|
+
return n.sort(Uc), n;
|
|
10534
10754
|
}
|
|
10535
10755
|
};
|
|
10536
|
-
function
|
|
10756
|
+
function Uc(e, t) {
|
|
10537
10757
|
return e.distance - t.distance;
|
|
10538
10758
|
}
|
|
10539
|
-
function
|
|
10759
|
+
function Wc(e, t, n, r) {
|
|
10540
10760
|
if (e.layers.test(t.layers) && e.raycast(t, n), r === !0) {
|
|
10541
10761
|
let r = e.children;
|
|
10542
|
-
for (let e = 0, i = r.length; e < i; e++)
|
|
10762
|
+
for (let e = 0, i = r.length; e < i; e++) Wc(r[e], t, n, !0);
|
|
10543
10763
|
}
|
|
10544
10764
|
}
|
|
10545
10765
|
typeof __THREE_DEVTOOLS__ < "u" && __THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register", { detail: { revision: "159" } })), typeof window < "u" && (window.__THREE__ ? console.warn("WARNING: Multiple instances of Three.js being imported.") : window.__THREE__ = "159");
|
|
10546
10766
|
//#endregion
|
|
10547
10767
|
//#region ../../node_modules/@tweenjs/tween.js/dist/tween.esm.js
|
|
10548
|
-
var
|
|
10768
|
+
var Gc = {
|
|
10549
10769
|
Linear: { None: function(e) {
|
|
10550
10770
|
return e;
|
|
10551
10771
|
} },
|
|
@@ -10653,21 +10873,21 @@ var Tc = {
|
|
|
10653
10873
|
},
|
|
10654
10874
|
Bounce: {
|
|
10655
10875
|
In: function(e) {
|
|
10656
|
-
return 1 -
|
|
10876
|
+
return 1 - Gc.Bounce.Out(1 - e);
|
|
10657
10877
|
},
|
|
10658
10878
|
Out: function(e) {
|
|
10659
10879
|
return e < 1 / 2.75 ? 7.5625 * e * e : e < 2 / 2.75 ? 7.5625 * (e -= 1.5 / 2.75) * e + .75 : e < 2.5 / 2.75 ? 7.5625 * (e -= 2.25 / 2.75) * e + .9375 : 7.5625 * (e -= 2.625 / 2.75) * e + .984375;
|
|
10660
10880
|
},
|
|
10661
10881
|
InOut: function(e) {
|
|
10662
|
-
return e < .5 ?
|
|
10882
|
+
return e < .5 ? Gc.Bounce.In(e * 2) * .5 : Gc.Bounce.Out(e * 2 - 1) * .5 + .5;
|
|
10663
10883
|
}
|
|
10664
10884
|
}
|
|
10665
|
-
},
|
|
10885
|
+
}, Kc = typeof self > "u" && typeof process < "u" && process.hrtime ? function() {
|
|
10666
10886
|
var e = process.hrtime();
|
|
10667
10887
|
return e[0] * 1e3 + e[1] / 1e6;
|
|
10668
10888
|
} : typeof self < "u" && self.performance !== void 0 && self.performance.now !== void 0 ? self.performance.now.bind(self.performance) : Date.now === void 0 ? function() {
|
|
10669
10889
|
return (/* @__PURE__ */ new Date()).getTime();
|
|
10670
|
-
} : Date.now,
|
|
10890
|
+
} : Date.now, qc = function() {
|
|
10671
10891
|
function e() {
|
|
10672
10892
|
this._tweens = {}, this._tweensAddedDuringUpdate = {};
|
|
10673
10893
|
}
|
|
@@ -10683,7 +10903,7 @@ var Tc = {
|
|
|
10683
10903
|
}, e.prototype.remove = function(e) {
|
|
10684
10904
|
delete this._tweens[e.getId()], delete this._tweensAddedDuringUpdate[e.getId()];
|
|
10685
10905
|
}, e.prototype.update = function(e, t) {
|
|
10686
|
-
e === void 0 && (e =
|
|
10906
|
+
e === void 0 && (e = Kc()), t === void 0 && (t = !1);
|
|
10687
10907
|
var n = Object.keys(this._tweens);
|
|
10688
10908
|
if (n.length === 0) return !1;
|
|
10689
10909
|
for (; n.length > 0;) {
|
|
@@ -10696,17 +10916,17 @@ var Tc = {
|
|
|
10696
10916
|
}
|
|
10697
10917
|
return !0;
|
|
10698
10918
|
}, e;
|
|
10699
|
-
}(),
|
|
10919
|
+
}(), Jc = {
|
|
10700
10920
|
Linear: function(e, t) {
|
|
10701
|
-
var n = e.length - 1, r = n * t, i = Math.floor(r), a =
|
|
10921
|
+
var n = e.length - 1, r = n * t, i = Math.floor(r), a = Jc.Utils.Linear;
|
|
10702
10922
|
return t < 0 ? a(e[0], e[1], r) : t > 1 ? a(e[n], e[n - 1], n - r) : a(e[i], e[i + 1 > n ? n : i + 1], r - i);
|
|
10703
10923
|
},
|
|
10704
10924
|
Bezier: function(e, t) {
|
|
10705
|
-
for (var n = 0, r = e.length - 1, i = Math.pow, a =
|
|
10925
|
+
for (var n = 0, r = e.length - 1, i = Math.pow, a = Jc.Utils.Bernstein, o = 0; o <= r; o++) n += i(1 - t, r - o) * i(t, o) * e[o] * a(r, o);
|
|
10706
10926
|
return n;
|
|
10707
10927
|
},
|
|
10708
10928
|
CatmullRom: function(e, t) {
|
|
10709
|
-
var n = e.length - 1, r = n * t, i = Math.floor(r), a =
|
|
10929
|
+
var n = e.length - 1, r = n * t, i = Math.floor(r), a = Jc.Utils.CatmullRom;
|
|
10710
10930
|
return e[0] === e[n] ? (t < 0 && (i = Math.floor(r = n * (1 + t))), a(e[(i - 1 + n) % n], e[i], e[(i + 1) % n], e[(i + 2) % n], r - i)) : t < 0 ? e[0] - (a(e[0], e[0], e[1], e[1], -r) - e[0]) : t > 1 ? e[n] - (a(e[n], e[n], e[n - 1], e[n - 1], r - n) - e[n]) : a(e[i ? i - 1 : 0], e[i], e[n < i + 1 ? n : i + 1], e[n < i + 2 ? n : i + 2], r - i);
|
|
10711
10931
|
},
|
|
10712
10932
|
Utils: {
|
|
@@ -10714,7 +10934,7 @@ var Tc = {
|
|
|
10714
10934
|
return (t - e) * n + e;
|
|
10715
10935
|
},
|
|
10716
10936
|
Bernstein: function(e, t) {
|
|
10717
|
-
var n =
|
|
10937
|
+
var n = Jc.Utils.Factorial;
|
|
10718
10938
|
return n(e) / n(t) / n(e - t);
|
|
10719
10939
|
},
|
|
10720
10940
|
Factorial: (function() {
|
|
@@ -10731,14 +10951,14 @@ var Tc = {
|
|
|
10731
10951
|
return (2 * t - 2 * n + a + o) * c + (-3 * t + 3 * n - 2 * a - o) * s + a * i + t;
|
|
10732
10952
|
}
|
|
10733
10953
|
}
|
|
10734
|
-
},
|
|
10954
|
+
}, Yc = function() {
|
|
10735
10955
|
function e() {}
|
|
10736
10956
|
return e.nextId = function() {
|
|
10737
10957
|
return e._nextId++;
|
|
10738
10958
|
}, e._nextId = 0, e;
|
|
10739
|
-
}(),
|
|
10959
|
+
}(), Xc = new qc(), Zc = function() {
|
|
10740
10960
|
function e(e, t) {
|
|
10741
|
-
t === void 0 && (t =
|
|
10961
|
+
t === void 0 && (t = Xc), this._object = e, this._group = t, this._isPaused = !1, this._pauseStart = 0, this._valuesStart = {}, this._valuesEnd = {}, this._valuesStartRepeat = {}, this._duration = 1e3, this._initialRepeat = 0, this._repeat = 0, this._yoyo = !1, this._isPlaying = !1, this._reversed = !1, this._delayTime = 0, this._startTime = 0, this._easingFunction = Gc.Linear.None, this._interpolationFunction = Jc.Linear, this._chainedTweens = [], this._onStartCallbackFired = !1, this._id = Yc.nextId(), this._isChainStopped = !1, this._goToEnd = !1;
|
|
10742
10962
|
}
|
|
10743
10963
|
return e.prototype.getId = function() {
|
|
10744
10964
|
return this._id;
|
|
@@ -10753,7 +10973,7 @@ var Tc = {
|
|
|
10753
10973
|
}, e.prototype.start = function(e) {
|
|
10754
10974
|
if (this._isPlaying) return this;
|
|
10755
10975
|
if (this._group && this._group.add(this), this._repeat = this._initialRepeat, this._reversed) for (var t in this._reversed = !1, this._valuesStartRepeat) this._swapEndStartRepeatValues(t), this._valuesStart[t] = this._valuesStartRepeat[t];
|
|
10756
|
-
return this._isPlaying = !0, this._isPaused = !1, this._onStartCallbackFired = !1, this._isChainStopped = !1, this._startTime = e === void 0 ?
|
|
10976
|
+
return this._isPlaying = !0, this._isPaused = !1, this._onStartCallbackFired = !1, this._isChainStopped = !1, this._startTime = e === void 0 ? Kc() : typeof e == "string" ? Kc() + parseFloat(e) : e, this._startTime += this._delayTime, this._setupProperties(this._object, this._valuesStart, this._valuesEnd, this._valuesStartRepeat), this;
|
|
10757
10977
|
}, e.prototype._setupProperties = function(e, t, n, r) {
|
|
10758
10978
|
for (var i in n) {
|
|
10759
10979
|
var a = e[i], o = Array.isArray(a), s = o ? "array" : typeof a, c = !o && Array.isArray(n[i]);
|
|
@@ -10774,9 +10994,9 @@ var Tc = {
|
|
|
10774
10994
|
}, e.prototype.end = function() {
|
|
10775
10995
|
return this._goToEnd = !0, this.update(Infinity), this;
|
|
10776
10996
|
}, e.prototype.pause = function(e) {
|
|
10777
|
-
return e === void 0 && (e =
|
|
10997
|
+
return e === void 0 && (e = Kc()), this._isPaused || !this._isPlaying ? this : (this._isPaused = !0, this._pauseStart = e, this._group && this._group.remove(this), this);
|
|
10778
10998
|
}, e.prototype.resume = function(e) {
|
|
10779
|
-
return e === void 0 && (e =
|
|
10999
|
+
return e === void 0 && (e = Kc()), !this._isPaused || !this._isPlaying ? this : (this._isPaused = !1, this._startTime += e - this._pauseStart, this._pauseStart = 0, this._group && this._group.add(this), this);
|
|
10780
11000
|
}, e.prototype.stopChainedTweens = function() {
|
|
10781
11001
|
for (var e = 0, t = this._chainedTweens.length; e < t; e++) this._chainedTweens[e].stop();
|
|
10782
11002
|
return this;
|
|
@@ -10808,7 +11028,7 @@ var Tc = {
|
|
|
10808
11028
|
}, e.prototype.onStop = function(e) {
|
|
10809
11029
|
return this._onStopCallback = e, this;
|
|
10810
11030
|
}, e.prototype.update = function(e, t) {
|
|
10811
|
-
if (e === void 0 && (e =
|
|
11031
|
+
if (e === void 0 && (e = Kc()), t === void 0 && (t = !0), this._isPaused) return !0;
|
|
10812
11032
|
var n, r, i = this._startTime + this._duration;
|
|
10813
11033
|
if (!this._goToEnd && !this._isPlaying) {
|
|
10814
11034
|
if (e > i) return !1;
|
|
@@ -10838,56 +11058,56 @@ var Tc = {
|
|
|
10838
11058
|
typeof n == "string" ? this._valuesStartRepeat[e] = this._valuesStartRepeat[e] + parseFloat(n) : this._valuesStartRepeat[e] = this._valuesEnd[e], this._valuesEnd[e] = t;
|
|
10839
11059
|
}, e;
|
|
10840
11060
|
}();
|
|
10841
|
-
|
|
10842
|
-
var
|
|
10843
|
-
|
|
11061
|
+
Yc.nextId;
|
|
11062
|
+
var Qc = Xc;
|
|
11063
|
+
Qc.getAll.bind(Qc), Qc.removeAll.bind(Qc), Qc.add.bind(Qc), Qc.remove.bind(Qc), Qc.update.bind(Qc);
|
|
10844
11064
|
//#endregion
|
|
10845
11065
|
//#region src/tweens.ts
|
|
10846
|
-
var
|
|
10847
|
-
function
|
|
10848
|
-
return
|
|
11066
|
+
var $c = new qc(), el = new X(0, -1, 0), tl = new X(1, 0, 0), nl = new X(0, 0, -1), rl = 8, il = (e) => (e % 1 + 1) % 1, al = (e) => (e % 360 + 360) % 360;
|
|
11067
|
+
function ol(e) {
|
|
11068
|
+
return il(.75 - e / 360);
|
|
10849
11069
|
}
|
|
10850
|
-
function
|
|
11070
|
+
function sl(e, t) {
|
|
10851
11071
|
let n = e.clone().normalize();
|
|
10852
|
-
return [
|
|
11072
|
+
return [il(Math.atan2(n.z, n.x) / (2 * Math.PI) + ol(t)), 1 - Math.acos(xe.clamp(n.y, -1, 1)) / Math.PI];
|
|
10853
11073
|
}
|
|
10854
|
-
function
|
|
10855
|
-
let [i, a] =
|
|
11074
|
+
function cl(e, t, n, r) {
|
|
11075
|
+
let [i, a] = sl(e, t);
|
|
10856
11076
|
return [Math.min(n - 1, Math.floor(i * n)), Math.min(r - 1, Math.floor((1 - a) * r))];
|
|
10857
11077
|
}
|
|
10858
|
-
function
|
|
10859
|
-
return n.setFromAxisAngle(
|
|
11078
|
+
function ll(e, t = 0, n = new Ge()) {
|
|
11079
|
+
return n.setFromAxisAngle(el, xe.degToRad(e)).multiply(new Ge().setFromAxisAngle(tl, xe.degToRad(t)));
|
|
10860
11080
|
}
|
|
10861
|
-
function
|
|
11081
|
+
function ul(e) {
|
|
10862
11082
|
let t = e.clone().normalize();
|
|
10863
11083
|
return {
|
|
10864
|
-
heading:
|
|
11084
|
+
heading: al(xe.radToDeg(Math.atan2(t.x, -t.z))),
|
|
10865
11085
|
pitch: xe.radToDeg(Math.asin(xe.clamp(t.y, -1, 1)))
|
|
10866
11086
|
};
|
|
10867
11087
|
}
|
|
10868
|
-
function
|
|
10869
|
-
let t =
|
|
10870
|
-
return
|
|
11088
|
+
function dl(e) {
|
|
11089
|
+
let t = nl.clone().applyQuaternion(e);
|
|
11090
|
+
return al(xe.radToDeg(Math.atan2(t.x, -t.z)));
|
|
10871
11091
|
}
|
|
10872
|
-
function
|
|
11092
|
+
function fl(e, t, n = new X()) {
|
|
10873
11093
|
let r = e.distanceTo(t), i = e.bearingTo(t);
|
|
10874
11094
|
return n.set(r * Math.sin(i), 0, -r * Math.cos(i));
|
|
10875
11095
|
}
|
|
10876
|
-
function
|
|
11096
|
+
function pl(e, t, n = new X()) {
|
|
10877
11097
|
if (e.alt === null || t.alt === null) throw Error("Placing a point in the panorama needs its altitude and the node's.");
|
|
10878
|
-
return
|
|
11098
|
+
return fl(e, t, n).setY(t.alt - e.alt);
|
|
10879
11099
|
}
|
|
10880
|
-
function
|
|
11100
|
+
function ml(e, t) {
|
|
10881
11101
|
let n = t.x, r = -t.z;
|
|
10882
11102
|
return e.destinationPoint(Math.hypot(n, r), Math.atan2(n, r));
|
|
10883
11103
|
}
|
|
10884
|
-
function
|
|
11104
|
+
function hl(e, t) {
|
|
10885
11105
|
let n = new X();
|
|
10886
|
-
return e && e.level === t.level &&
|
|
11106
|
+
return e && e.level === t.level && fl(e.coordinates, t.coordinates, n), n.length() > rl ? n.set(0, 0, 0) : n;
|
|
10887
11107
|
}
|
|
10888
11108
|
//#endregion
|
|
10889
11109
|
//#region src/controls/SphereControls.ts
|
|
10890
|
-
var
|
|
11110
|
+
var gl = 4, _l = .95, vl = .01, yl = .3, bl = { type: "change" }, xl = { type: "start" }, Sl = { type: "end" }, Cl = class extends ie {
|
|
10891
11111
|
config;
|
|
10892
11112
|
minFov = 20;
|
|
10893
11113
|
maxFov = 100;
|
|
@@ -10941,12 +11161,12 @@ var Xc = 4, Zc = .95, Qc = .01, $c = .3, el = { type: "change" }, tl = { type: "
|
|
|
10941
11161
|
}
|
|
10942
11162
|
updateFov(e) {
|
|
10943
11163
|
if (this.config.zoomEnable) {
|
|
10944
|
-
let t = { fov: this.camera.fov }, n = { fov: e }, r = new
|
|
11164
|
+
let t = { fov: this.camera.fov }, n = { fov: e }, r = new Zc(t).to(n, 400).easing(Gc.Cubic.InOut).onUpdate((e) => {
|
|
10945
11165
|
this.camera.fov = e.fov, this.camera.updateProjectionMatrix();
|
|
10946
11166
|
}).onComplete(() => {
|
|
10947
|
-
|
|
11167
|
+
$c.remove(r);
|
|
10948
11168
|
});
|
|
10949
|
-
|
|
11169
|
+
$c.add(r), r.start();
|
|
10950
11170
|
}
|
|
10951
11171
|
}
|
|
10952
11172
|
retrieveLatLonFromCamera() {
|
|
@@ -10956,20 +11176,20 @@ var Xc = 4, Zc = .95, Qc = .01, $c = .3, el = { type: "change" }, tl = { type: "
|
|
|
10956
11176
|
onPointerStart = (e) => {
|
|
10957
11177
|
e.preventDefault(), this.element.focus({ preventScroll: !0 }), this.isUserInteracting = !0;
|
|
10958
11178
|
let t = e instanceof MouseEvent ? e.clientX : e.touches[0].screenX, n = e instanceof MouseEvent ? e.clientY : e.touches[0].screenY;
|
|
10959
|
-
this.onMouseDownMouseX = t, this.onMouseDownMouseY = n, this.retrieveLatLonFromCamera(), this.onMouseDownLon = this._lon, this.onMouseDownLat = this._lat, this.animationFrameId !== null && (cancelAnimationFrame(this.animationFrameId), this.animationFrameId = null), this.velocityLon = 0, this.velocityLat = 0, this.dispatchEvent(
|
|
11179
|
+
this.onMouseDownMouseX = t, this.onMouseDownMouseY = n, this.retrieveLatLonFromCamera(), this.onMouseDownLon = this._lon, this.onMouseDownLat = this._lat, this.animationFrameId !== null && (cancelAnimationFrame(this.animationFrameId), this.animationFrameId = null), this.velocityLon = 0, this.velocityLat = 0, this.dispatchEvent(xl);
|
|
10960
11180
|
};
|
|
10961
11181
|
onPointerMove = (e) => {
|
|
10962
11182
|
if (e.preventDefault(), e.stopPropagation(), this.isUserInteracting) {
|
|
10963
11183
|
let t = e instanceof MouseEvent ? e.clientX : e.touches[0].screenX, n = e instanceof MouseEvent ? e.clientY : e.touches[0].screenY, r = performance.now(), i = r - this.lastUpdateTime;
|
|
10964
11184
|
if (i > 0) {
|
|
10965
11185
|
let e = t - this.lastMouseX, r = n - this.lastMouseY;
|
|
10966
|
-
this.velocityLon = -e / i *
|
|
11186
|
+
this.velocityLon = -e / i * yl, this.velocityLat = r / i * yl;
|
|
10967
11187
|
}
|
|
10968
|
-
this._lon = (this.onMouseDownMouseX - t) * this.sensibility + this.onMouseDownLon, this._lat = (n - this.onMouseDownMouseY) * this.sensibility + this.onMouseDownLat, this.lastMouseX = t, this.lastMouseY = n, this.lastUpdateTime = r, this.update(), this.dispatchEvent(
|
|
11188
|
+
this._lon = (this.onMouseDownMouseX - t) * this.sensibility + this.onMouseDownLon, this._lat = (n - this.onMouseDownMouseY) * this.sensibility + this.onMouseDownLat, this.lastMouseX = t, this.lastMouseY = n, this.lastUpdateTime = r, this.update(), this.dispatchEvent(bl);
|
|
10969
11189
|
}
|
|
10970
11190
|
};
|
|
10971
11191
|
onPointerUp = (e) => {
|
|
10972
|
-
e.preventDefault(), this.isUserInteracting = !1, (Math.abs(this.velocityLon) >
|
|
11192
|
+
e.preventDefault(), this.isUserInteracting = !1, (Math.abs(this.velocityLon) > vl || Math.abs(this.velocityLat) > vl) && (this.animationFrameId = requestAnimationFrame(this.updateVelocity)), this.dispatchEvent(Sl);
|
|
10973
11193
|
};
|
|
10974
11194
|
onDocumentMouseWheel = (e) => {
|
|
10975
11195
|
e.preventDefault();
|
|
@@ -10980,20 +11200,20 @@ var Xc = 4, Zc = .95, Qc = .01, $c = .3, el = { type: "change" }, tl = { type: "
|
|
|
10980
11200
|
let t = !0;
|
|
10981
11201
|
switch (e.key) {
|
|
10982
11202
|
case "ArrowLeft":
|
|
10983
|
-
this._lon = (this._lon -
|
|
11203
|
+
this._lon = (this._lon - gl) % 360;
|
|
10984
11204
|
break;
|
|
10985
11205
|
case "ArrowRight":
|
|
10986
|
-
this._lon = (this._lon +
|
|
11206
|
+
this._lon = (this._lon + gl) % 360;
|
|
10987
11207
|
break;
|
|
10988
11208
|
case "ArrowUp":
|
|
10989
|
-
this._lat = Math.max(-85, Math.min(85, this._lat +
|
|
11209
|
+
this._lat = Math.max(-85, Math.min(85, this._lat + gl));
|
|
10990
11210
|
break;
|
|
10991
11211
|
case "ArrowDown":
|
|
10992
|
-
this._lat = Math.max(-85, Math.min(85, this._lat -
|
|
11212
|
+
this._lat = Math.max(-85, Math.min(85, this._lat - gl));
|
|
10993
11213
|
break;
|
|
10994
11214
|
default: t = !1;
|
|
10995
11215
|
}
|
|
10996
|
-
t && (e.preventDefault(), this.isArrowKeyPressed = !0, this.update(), this.dispatchEvent(
|
|
11216
|
+
t && (e.preventDefault(), this.isArrowKeyPressed = !0, this.update(), this.dispatchEvent(bl));
|
|
10997
11217
|
};
|
|
10998
11218
|
update() {
|
|
10999
11219
|
if (this._autoRotate && !this.isUserInteracting && !this.isArrowKeyPressed) {
|
|
@@ -11003,29 +11223,29 @@ var Xc = 4, Zc = .95, Qc = .01, $c = .3, el = { type: "change" }, tl = { type: "
|
|
|
11003
11223
|
this._lon = (this._lon + this.autoRotateSpeed * 360 * t) % 360;
|
|
11004
11224
|
}
|
|
11005
11225
|
}
|
|
11006
|
-
let e =
|
|
11226
|
+
let e = ll(this._lon, this._lat);
|
|
11007
11227
|
if (this.isArrowKeyPressed) {
|
|
11008
11228
|
this.isArrowKeyPressed = !1;
|
|
11009
11229
|
let t = this.camera.quaternion.clone(), n = this.sphere.quaternion.clone().multiply(e), r = { t: 0 };
|
|
11010
11230
|
this.currentTween && this.currentTween.stop();
|
|
11011
|
-
let i = new Ge(), a = new
|
|
11231
|
+
let i = new Ge(), a = new Zc(r).to({ t: 1 }, 400).easing(Gc.Cubic.Out).onUpdate(() => {
|
|
11012
11232
|
i.slerpQuaternions(t, n, r.t), this.camera.quaternion.set(i.x, i.y, i.z, i.w);
|
|
11013
11233
|
}).start().onStop(() => {
|
|
11014
|
-
|
|
11234
|
+
$c.remove(a);
|
|
11015
11235
|
}).onComplete(() => {
|
|
11016
|
-
|
|
11236
|
+
$c.remove(a);
|
|
11017
11237
|
});
|
|
11018
|
-
|
|
11238
|
+
$c.add(a), this.currentTween = a;
|
|
11019
11239
|
} else this.camera.quaternion.copy(this.sphere.quaternion.clone().multiply(e));
|
|
11020
11240
|
}
|
|
11021
11241
|
updateVelocity = () => {
|
|
11022
|
-
Math.abs(this.velocityLon) >
|
|
11242
|
+
Math.abs(this.velocityLon) > vl || Math.abs(this.velocityLat) > vl ? (this._lon = (this._lon + this.velocityLon) % 360, this._lat = Math.max(-85, Math.min(85, this._lat + this.velocityLat)), this.velocityLon *= _l, this.velocityLat *= _l, Math.abs(this.velocityLon) < vl && (this.velocityLon = 0), Math.abs(this.velocityLat) < vl && (this.velocityLat = 0), this.update(), this.dispatchEvent(bl), this.animationFrameId = requestAnimationFrame(this.updateVelocity)) : this.animationFrameId = null;
|
|
11023
11243
|
};
|
|
11024
|
-
},
|
|
11025
|
-
function
|
|
11026
|
-
return new
|
|
11244
|
+
}, wl = 1.5, Tl = 50, El = 5, Dl = .01;
|
|
11245
|
+
function Ol(e, t) {
|
|
11246
|
+
return new ws().moveTo(-t, -e).lineTo(t, -e).lineTo(t, -t).lineTo(e, -t).lineTo(e, t).lineTo(t, t).lineTo(t, e).lineTo(-t, e).lineTo(-t, t).lineTo(-e, t).lineTo(-e, -t).lineTo(-t, -t).lineTo(-t, -e);
|
|
11027
11247
|
}
|
|
11028
|
-
function
|
|
11248
|
+
function kl(e, t) {
|
|
11029
11249
|
return new pn({
|
|
11030
11250
|
color: e,
|
|
11031
11251
|
transparent: !0,
|
|
@@ -11034,15 +11254,15 @@ function ll(e, t) {
|
|
|
11034
11254
|
depthTest: !1
|
|
11035
11255
|
});
|
|
11036
11256
|
}
|
|
11037
|
-
var
|
|
11257
|
+
var Al = class {
|
|
11038
11258
|
mode = "navigate";
|
|
11039
11259
|
scene;
|
|
11040
11260
|
camera;
|
|
11041
11261
|
element;
|
|
11042
11262
|
callbacks;
|
|
11043
11263
|
walk;
|
|
11044
|
-
raycaster = new
|
|
11045
|
-
floor = new pr(new X(0, 1, 0),
|
|
11264
|
+
raycaster = new Hc();
|
|
11265
|
+
floor = new pr(new X(0, 1, 0), wl);
|
|
11046
11266
|
pointer = new K();
|
|
11047
11267
|
hit = new X();
|
|
11048
11268
|
disc;
|
|
@@ -11050,10 +11270,10 @@ var ul = class {
|
|
|
11050
11270
|
pressedAt = null;
|
|
11051
11271
|
target = null;
|
|
11052
11272
|
constructor(e, t, n, r, i = !0) {
|
|
11053
|
-
this.scene = e, this.camera = t, this.element = n, this.callbacks = r, this.walk = i, this.disc = new Gn(new
|
|
11054
|
-
let a = new Gn(new
|
|
11273
|
+
this.scene = e, this.camera = t, this.element = n, this.callbacks = r, this.walk = i, this.disc = new Gn(new Cs(.2, 48), kl(5096447, .55)), this.disc.rotation.x = -Math.PI / 2, this.disc.renderOrder = 999;
|
|
11274
|
+
let a = new Gn(new sc(Ol(.17, .03)), kl(16777215, .5));
|
|
11055
11275
|
a.renderOrder = 999;
|
|
11056
|
-
let o = new Gn(new
|
|
11276
|
+
let o = new Gn(new sc(Ol(.16, .02)), kl(7105644, .75));
|
|
11057
11277
|
o.renderOrder = 1e3, this.cross = new Kt(), this.cross.add(a, o), this.cross.rotation.x = -Math.PI / 2, this.hide(), e.add(this.disc, this.cross), n.addEventListener("pointermove", this.onPointerMove), n.addEventListener("pointerdown", this.onPointerDown), n.addEventListener("pointerup", this.onPointerUp), n.addEventListener("pointerleave", this.onPointerLeave);
|
|
11058
11278
|
}
|
|
11059
11279
|
hide() {
|
|
@@ -11074,7 +11294,7 @@ var ul = class {
|
|
|
11074
11294
|
};
|
|
11075
11295
|
onPointerUp = (e) => {
|
|
11076
11296
|
let t = this.pressedAt;
|
|
11077
|
-
if (this.pressedAt = null, !(!t || Math.abs(e.clientX - t.x) >
|
|
11297
|
+
if (this.pressedAt = null, !(!t || Math.abs(e.clientX - t.x) > El || Math.abs(e.clientY - t.y) > El)) {
|
|
11078
11298
|
if (this.mode !== "navigate") {
|
|
11079
11299
|
this.callbacks.current() && (this.aim(e), this.callbacks.pick(this.raycaster.ray.direction.clone()));
|
|
11080
11300
|
return;
|
|
@@ -11107,19 +11327,19 @@ var ul = class {
|
|
|
11107
11327
|
}
|
|
11108
11328
|
}
|
|
11109
11329
|
let n = this.raycaster.ray.intersectPlane(this.floor, this.hit);
|
|
11110
|
-
if (!t || !n || n.length() >
|
|
11330
|
+
if (!t || !n || n.length() > Tl) {
|
|
11111
11331
|
this.hide();
|
|
11112
11332
|
return;
|
|
11113
11333
|
}
|
|
11114
|
-
this.disc.position.set(n.x, n.y +
|
|
11115
|
-
let r = this.callbacks.nearest(
|
|
11334
|
+
this.disc.position.set(n.x, n.y + Dl, n.z), this.disc.visible = !0;
|
|
11335
|
+
let r = this.callbacks.nearest(ml(t.coordinates, n));
|
|
11116
11336
|
if (this.target = r, !r) {
|
|
11117
11337
|
this.cross.visible = !1, this.element.style.cursor = "";
|
|
11118
11338
|
return;
|
|
11119
11339
|
}
|
|
11120
|
-
|
|
11340
|
+
fl(t.coordinates, r.coordinates, this.cross.position).y = -1.49, this.cross.visible = !0, this.element.style.cursor = "pointer";
|
|
11121
11341
|
}
|
|
11122
|
-
},
|
|
11342
|
+
}, jl = 4, Ml = .065, Nl = .075, Pl = 1e3, Fl = (e) => (e.depthTest = !1, e.transparent = !0, e), Il = class {
|
|
11123
11343
|
scene;
|
|
11124
11344
|
group = new uo();
|
|
11125
11345
|
constructor(e) {
|
|
@@ -11129,35 +11349,35 @@ var ul = class {
|
|
|
11129
11349
|
return this.group.children.filter((e) => e instanceof uo).length;
|
|
11130
11350
|
}
|
|
11131
11351
|
add(e) {
|
|
11132
|
-
let t = e.clone().normalize().multiplyScalar(
|
|
11352
|
+
let t = e.clone().normalize().multiplyScalar(jl), n = new uo(), r = new Gn(new oc(Ml, Nl, 48), Fl(new pn({
|
|
11133
11353
|
color: 16777215,
|
|
11134
11354
|
opacity: .8,
|
|
11135
11355
|
side: 2
|
|
11136
|
-
}))), i = new Gn(new
|
|
11356
|
+
}))), i = new Gn(new Cs(Ml, 48), Fl(new pn({
|
|
11137
11357
|
color: 16711680,
|
|
11138
11358
|
side: 2
|
|
11139
11359
|
})));
|
|
11140
|
-
r.renderOrder =
|
|
11360
|
+
r.renderOrder = Pl, i.renderOrder = Pl, n.add(r, i), n.position.copy(t), n.lookAt(0, 0, 0), this.group.add(n);
|
|
11141
11361
|
let a = this.group.children.filter((e) => e instanceof uo);
|
|
11142
11362
|
if (a.length === 2) {
|
|
11143
|
-
let e = new
|
|
11363
|
+
let e = new Go(new Dn().setFromPoints([a[0].position, a[1].position]), Fl(new uc({
|
|
11144
11364
|
color: 16711680,
|
|
11145
11365
|
dashSize: .06,
|
|
11146
11366
|
gapSize: .04
|
|
11147
11367
|
})));
|
|
11148
|
-
e.computeLineDistances(), e.renderOrder =
|
|
11368
|
+
e.computeLineDistances(), e.renderOrder = Pl - 1, this.group.add(e);
|
|
11149
11369
|
}
|
|
11150
11370
|
}
|
|
11151
11371
|
clear() {
|
|
11152
11372
|
for (let e of [...this.group.children]) e.traverse((e) => {
|
|
11153
|
-
(e instanceof Gn || e instanceof
|
|
11373
|
+
(e instanceof Gn || e instanceof Go) && (e.geometry.dispose(), e.material.dispose());
|
|
11154
11374
|
}), this.group.remove(e);
|
|
11155
11375
|
}
|
|
11156
11376
|
dispose() {
|
|
11157
11377
|
this.clear(), this.scene.remove(this.group);
|
|
11158
11378
|
}
|
|
11159
|
-
},
|
|
11160
|
-
function
|
|
11379
|
+
}, Ll = "#2F7DE1", Rl = .25, zl = 1001;
|
|
11380
|
+
function Bl(e) {
|
|
11161
11381
|
let t = new X();
|
|
11162
11382
|
e.forEach((n, r) => {
|
|
11163
11383
|
let i = e[(r + 1) % e.length];
|
|
@@ -11169,7 +11389,7 @@ function bl(e) {
|
|
|
11169
11389
|
return new K(i.dot(n), i.dot(r));
|
|
11170
11390
|
});
|
|
11171
11391
|
}
|
|
11172
|
-
var
|
|
11392
|
+
var Vl = class {
|
|
11173
11393
|
scene;
|
|
11174
11394
|
group = new uo();
|
|
11175
11395
|
polygons = [];
|
|
@@ -11180,6 +11400,9 @@ var xl = class {
|
|
|
11180
11400
|
set(e) {
|
|
11181
11401
|
this.polygons = e, this.build();
|
|
11182
11402
|
}
|
|
11403
|
+
setVisible(e) {
|
|
11404
|
+
this.group.visible = e;
|
|
11405
|
+
}
|
|
11183
11406
|
placeAt(e) {
|
|
11184
11407
|
e !== this.origin && (this.origin = e, this.build());
|
|
11185
11408
|
}
|
|
@@ -11188,30 +11411,78 @@ var xl = class {
|
|
|
11188
11411
|
let e = this.origin;
|
|
11189
11412
|
if (e) for (let t of this.polygons) {
|
|
11190
11413
|
if (t.coordinates.length < 3) continue;
|
|
11191
|
-
let n = t.coordinates.map((t) =>
|
|
11414
|
+
let n = t.coordinates.map((t) => pl(e.coordinates, t)), r = new Z(t.color ?? Ll), i = rc.triangulateShape(Bl(n), []), a = new Gn(new Dn().setFromPoints(i.flat().map((e) => n[e])), new pn({
|
|
11192
11415
|
color: r,
|
|
11193
|
-
opacity: t.fillOpacity ??
|
|
11416
|
+
opacity: t.fillOpacity ?? Rl,
|
|
11194
11417
|
transparent: !0,
|
|
11195
11418
|
side: 2,
|
|
11196
11419
|
depthTest: !1
|
|
11197
|
-
})), o = new
|
|
11198
|
-
color: new Z(t.outlineColor ?? t.color ??
|
|
11420
|
+
})), o = new Ko(new Dn().setFromPoints(n), new zo({
|
|
11421
|
+
color: new Z(t.outlineColor ?? t.color ?? Ll),
|
|
11199
11422
|
transparent: !0,
|
|
11200
11423
|
depthTest: !1
|
|
11201
11424
|
}));
|
|
11202
|
-
a.renderOrder =
|
|
11425
|
+
a.renderOrder = zl, o.renderOrder = zl, this.group.add(a, o);
|
|
11426
|
+
}
|
|
11427
|
+
}
|
|
11428
|
+
clear() {
|
|
11429
|
+
for (let e of [...this.group.children]) (e instanceof Gn || e instanceof Ko) && (e.geometry.dispose(), e.material.dispose()), this.group.remove(e);
|
|
11430
|
+
}
|
|
11431
|
+
dispose() {
|
|
11432
|
+
this.clear(), this.scene.remove(this.group);
|
|
11433
|
+
}
|
|
11434
|
+
}, Hl = "#0D2126", Ul = "#ffffff", Wl = 64, Gl = .07, Kl = 1002;
|
|
11435
|
+
function ql(e) {
|
|
11436
|
+
let t = document.createElement("canvas"), n = t.getContext("2d"), r = `700 ${Wl}px system-ui, -apple-system, 'Segoe UI', sans-serif`;
|
|
11437
|
+
n.font = r;
|
|
11438
|
+
let i = Wl / 6;
|
|
11439
|
+
t.width = Math.ceil(n.measureText(e.text).width + 2 * i), t.height = 105, n.font = r, n.textAlign = "center", n.textBaseline = "middle", n.lineJoin = "round", n.lineWidth = i, n.strokeStyle = e.haloColor ?? Ul, n.strokeText(e.text, t.width / 2, t.height / 2), n.fillStyle = e.color ?? Hl, n.fillText(e.text, t.width / 2, t.height / 2);
|
|
11440
|
+
let a = new qo(t);
|
|
11441
|
+
return a.minFilter = c, {
|
|
11442
|
+
map: a,
|
|
11443
|
+
aspect: t.width / t.height
|
|
11444
|
+
};
|
|
11445
|
+
}
|
|
11446
|
+
var Jl = class {
|
|
11447
|
+
scene;
|
|
11448
|
+
group = new uo();
|
|
11449
|
+
labels = [];
|
|
11450
|
+
origin = null;
|
|
11451
|
+
constructor(e) {
|
|
11452
|
+
this.scene = e, e.add(this.group);
|
|
11453
|
+
}
|
|
11454
|
+
set(e) {
|
|
11455
|
+
this.labels = e, this.build();
|
|
11456
|
+
}
|
|
11457
|
+
setVisible(e) {
|
|
11458
|
+
this.group.visible = e;
|
|
11459
|
+
}
|
|
11460
|
+
placeAt(e) {
|
|
11461
|
+
e !== this.origin && (this.origin = e, this.build());
|
|
11462
|
+
}
|
|
11463
|
+
build() {
|
|
11464
|
+
this.clear();
|
|
11465
|
+
let e = this.origin;
|
|
11466
|
+
if (e) for (let t of this.labels) {
|
|
11467
|
+
let { map: n, aspect: r } = ql(t), i = new Lo(new Co({
|
|
11468
|
+
map: n,
|
|
11469
|
+
transparent: !0,
|
|
11470
|
+
depthTest: !1,
|
|
11471
|
+
sizeAttenuation: !1
|
|
11472
|
+
}));
|
|
11473
|
+
i.position.copy(pl(e.coordinates, t.coordinates)), i.scale.set(Gl * r, Gl, 1), i.renderOrder = Kl, this.group.add(i);
|
|
11203
11474
|
}
|
|
11204
11475
|
}
|
|
11205
11476
|
clear() {
|
|
11206
|
-
for (let e of [...this.group.children])
|
|
11477
|
+
for (let e of [...this.group.children]) e instanceof Lo && (e.material.map?.dispose(), e.material.dispose()), this.group.remove(e);
|
|
11207
11478
|
}
|
|
11208
11479
|
dispose() {
|
|
11209
11480
|
this.clear(), this.scene.remove(this.group);
|
|
11210
11481
|
}
|
|
11211
|
-
},
|
|
11482
|
+
}, Yl = 700, Xl = 300, Zl = 5, Ql = (e) => new kc().loadAsync(e).catch(() => {
|
|
11212
11483
|
throw Error(`Failed to load panorama image: ${e}`);
|
|
11213
|
-
}),
|
|
11214
|
-
function
|
|
11484
|
+
}), $l = (e) => e < .5 ? 2 * e * e : 1 - (-2 * e + 2) ** 2 / 2;
|
|
11485
|
+
function eu() {
|
|
11215
11486
|
return new nr({
|
|
11216
11487
|
uniforms: {
|
|
11217
11488
|
t1: { value: null },
|
|
@@ -11219,7 +11490,7 @@ function Dl() {
|
|
|
11219
11490
|
o1: { value: 0 },
|
|
11220
11491
|
o2: { value: 0 },
|
|
11221
11492
|
c2: { value: new X() },
|
|
11222
|
-
radius: { value:
|
|
11493
|
+
radius: { value: Zl },
|
|
11223
11494
|
transition: { value: 0 }
|
|
11224
11495
|
},
|
|
11225
11496
|
depthWrite: !1,
|
|
@@ -11228,15 +11499,15 @@ function Dl() {
|
|
|
11228
11499
|
fragmentShader: "\n const float PI = 3.141592653589793;\n uniform sampler2D t1;\n uniform sampler2D t2;\n uniform float o1;\n uniform float o2;\n uniform vec3 c2;\n uniform float radius;\n uniform float transition;\n varying vec3 vWorld;\n\n // Where the view ray hits the proxy sphere around `center`, as a direction from it.\n vec3 proxyDirection(vec3 ray, vec3 center) {\n vec3 p = cameraPosition - center;\n float b = dot(p, ray);\n return normalize(p + (-b + sqrt(b * b - dot(p, p) + radius * radius)) * ray);\n }\n\n // Shader twin of SceneFrame.imageUv(): keep the two in step.\n vec2 equirect(vec3 d, float offset) {\n return vec2(atan(d.z, d.x) / (2.0 * PI) + offset, 1.0 - acos(clamp(d.y, -1.0, 1.0)) / PI);\n }\n\n void main() {\n vec3 ray = normalize(vWorld - cameraPosition);\n vec4 tex1 = texture2D(t1, equirect(proxyDirection(ray, vec3(0.0)), o1));\n vec4 tex2 = texture2D(t2, equirect(proxyDirection(ray, c2), o2));\n gl_FragColor = mix(tex1, tex2, transition);\n }\n "
|
|
11229
11500
|
});
|
|
11230
11501
|
}
|
|
11231
|
-
var
|
|
11232
|
-
material =
|
|
11502
|
+
var tu = class {
|
|
11503
|
+
material = eu();
|
|
11233
11504
|
shownNode = null;
|
|
11234
11505
|
pending = null;
|
|
11235
11506
|
fade = null;
|
|
11236
11507
|
disposed = !1;
|
|
11237
11508
|
cameraOffset = new X();
|
|
11238
11509
|
loadImage;
|
|
11239
|
-
constructor(e =
|
|
11510
|
+
constructor(e = Ql) {
|
|
11240
11511
|
this.loadImage = e;
|
|
11241
11512
|
}
|
|
11242
11513
|
get shown() {
|
|
@@ -11263,12 +11534,12 @@ var Ol = class {
|
|
|
11263
11534
|
}
|
|
11264
11535
|
if (this.pending !== e || this.disposed) return t.dispose(), !1;
|
|
11265
11536
|
this.fade && this.settle(), t.wrapS = n, t.generateMipmaps = !1, t.minFilter = c;
|
|
11266
|
-
let r =
|
|
11267
|
-
return i.t2.value = t, i.o2.value =
|
|
11537
|
+
let r = hl(this.shownNode, e), i = this.material.uniforms;
|
|
11538
|
+
return i.t2.value = t, i.o2.value = ol(e.heading), i.c2.value.copy(r), i.radius.value = Math.max(Zl, r.length() * 1.5), i.transition.value = 0, this.fade = {
|
|
11268
11539
|
node: e,
|
|
11269
11540
|
texture: t,
|
|
11270
11541
|
move: r,
|
|
11271
|
-
duration: this.shownNode ?
|
|
11542
|
+
duration: this.shownNode ? Yl : Xl,
|
|
11272
11543
|
start: null
|
|
11273
11544
|
}, !0;
|
|
11274
11545
|
}
|
|
@@ -11278,7 +11549,7 @@ var Ol = class {
|
|
|
11278
11549
|
t.start ??= e;
|
|
11279
11550
|
let n = Math.min(1, (e - t.start) / t.duration);
|
|
11280
11551
|
if (n >= 1) return this.settle(), this.cameraOffset.set(0, 0, 0);
|
|
11281
|
-
let r =
|
|
11552
|
+
let r = $l(n);
|
|
11282
11553
|
return this.material.uniforms.transition.value = r, this.cameraOffset.copy(t.move).multiplyScalar(r);
|
|
11283
11554
|
}
|
|
11284
11555
|
dispose() {
|
|
@@ -11295,12 +11566,12 @@ var Ol = class {
|
|
|
11295
11566
|
};
|
|
11296
11567
|
//#endregion
|
|
11297
11568
|
//#region src/data/ViewerDataClient.ts
|
|
11298
|
-
async function
|
|
11569
|
+
async function nu(e, t) {
|
|
11299
11570
|
let n = await fetch(e, t);
|
|
11300
11571
|
if (!n.ok) throw Error(`Request failed (${n.status}): ${e}`);
|
|
11301
11572
|
return n.json();
|
|
11302
11573
|
}
|
|
11303
|
-
function
|
|
11574
|
+
function ru(t, n) {
|
|
11304
11575
|
return t.images.map((t) => ({
|
|
11305
11576
|
id: t.id,
|
|
11306
11577
|
coordinates: new e(t.coords.lat, t.coords.lng, t.coords.alt ?? null, t.coords.level),
|
|
@@ -11309,7 +11580,7 @@ function Al(t, n) {
|
|
|
11309
11580
|
heading: t.heading
|
|
11310
11581
|
}));
|
|
11311
11582
|
}
|
|
11312
|
-
var
|
|
11583
|
+
var iu = class {
|
|
11313
11584
|
endpoint;
|
|
11314
11585
|
constructor(e) {
|
|
11315
11586
|
let n = e ?? t.getViewerOptions().vpsEndpoint;
|
|
@@ -11320,16 +11591,16 @@ var jl = class {
|
|
|
11320
11591
|
return `${this.endpoint}360-viewer/image/${e}`;
|
|
11321
11592
|
}
|
|
11322
11593
|
getGraph() {
|
|
11323
|
-
return
|
|
11594
|
+
return nu(`${this.endpoint}360-viewer/graph.json`);
|
|
11324
11595
|
}
|
|
11325
11596
|
getGraphGeojson() {
|
|
11326
|
-
return
|
|
11597
|
+
return nu(`${this.endpoint}360-viewer/graph.geojson`);
|
|
11327
11598
|
}
|
|
11328
11599
|
async getNodes() {
|
|
11329
|
-
return
|
|
11600
|
+
return ru(await this.getGraph(), (e) => this.imageUrl(e));
|
|
11330
11601
|
}
|
|
11331
11602
|
async locate(t, n, r) {
|
|
11332
|
-
let i = await
|
|
11603
|
+
let i = await nu(`${this.endpoint}360-viewer/image/${t.id}/coordinates`, {
|
|
11333
11604
|
method: "POST",
|
|
11334
11605
|
headers: { "Content-Type": "application/json" },
|
|
11335
11606
|
body: JSON.stringify({
|
|
@@ -11340,7 +11611,7 @@ var jl = class {
|
|
|
11340
11611
|
return new e(i.lat, i.lng, i.alt ?? null, i.level ?? t.level);
|
|
11341
11612
|
}
|
|
11342
11613
|
async measure(e, t, n) {
|
|
11343
|
-
let r = await
|
|
11614
|
+
let r = await nu(`${this.endpoint}360-viewer/image/${e.id}/measure`, {
|
|
11344
11615
|
method: "POST",
|
|
11345
11616
|
headers: { "Content-Type": "application/json" },
|
|
11346
11617
|
body: JSON.stringify({
|
|
@@ -11353,7 +11624,7 @@ var jl = class {
|
|
|
11353
11624
|
if (typeof i != "number" || !Number.isFinite(i)) throw Error("The VPS returned no distance for this measurement.");
|
|
11354
11625
|
return i;
|
|
11355
11626
|
}
|
|
11356
|
-
},
|
|
11627
|
+
}, au = 1e4, ou = 65, su = 80, cu = class {
|
|
11357
11628
|
container;
|
|
11358
11629
|
options;
|
|
11359
11630
|
scene = new yo();
|
|
@@ -11366,6 +11637,7 @@ var jl = class {
|
|
|
11366
11637
|
pointer;
|
|
11367
11638
|
measureOverlay;
|
|
11368
11639
|
polygonOverlay;
|
|
11640
|
+
labelOverlay;
|
|
11369
11641
|
measureStart = null;
|
|
11370
11642
|
measureRun = 0;
|
|
11371
11643
|
data = null;
|
|
@@ -11388,13 +11660,13 @@ var jl = class {
|
|
|
11388
11660
|
rafId = null;
|
|
11389
11661
|
resizeObserver;
|
|
11390
11662
|
constructor(e, t = {}) {
|
|
11391
|
-
this.container = e, this.options = t, this.transition = new
|
|
11663
|
+
this.container = e, this.options = t, this.transition = new tu();
|
|
11392
11664
|
let { clientWidth: n, clientHeight: r } = e;
|
|
11393
|
-
this.camera = new ir(
|
|
11665
|
+
this.camera = new ir(ou, n / Math.max(r, 1), .1, au * 2), this.renderer = new _o({ antialias: !0 }), this.renderer.setPixelRatio(window.devicePixelRatio), this.renderer.setSize(n, r), this.renderer.domElement.classList.add("wemap-viewer__canvas"), e.appendChild(this.renderer.domElement), this.sphere = new Gn(new lc(au, 64, 64), this.transition.material), this.sphere.geometry.scale(-1, 1, 1), this.sphereObject.add(this.sphere), this.scene.add(this.sphereObject), this.controls = new Cl(this.renderer.domElement, this.camera, this.sphereObject, {
|
|
11394
11666
|
zoomEnable: t.zoom ?? !0,
|
|
11395
11667
|
minFov: 10,
|
|
11396
|
-
maxFov: t.maxFov ??
|
|
11397
|
-
}), this.controls.addEventListener("change", this.emitHeading), this.controls.addEventListener("end", this.emitHeading), this.controls.addEventListener("start", () => this.turn?.stop()), this.pointer = new
|
|
11668
|
+
maxFov: t.maxFov ?? su
|
|
11669
|
+
}), this.controls.addEventListener("change", this.emitHeading), this.controls.addEventListener("end", this.emitHeading), this.controls.addEventListener("start", () => this.turn?.stop()), this.pointer = new Al(this.scene, this.camera, this.renderer.domElement, {
|
|
11398
11670
|
current: () => this.transition.busy ? null : this.current,
|
|
11399
11671
|
nearest: (e) => this.closestNode(e, this.current?.level, this.current, this.options.walkable),
|
|
11400
11672
|
select: (e) => this.navigateTo(e.id),
|
|
@@ -11405,7 +11677,7 @@ var jl = class {
|
|
|
11405
11677
|
let t = this.transition.shown;
|
|
11406
11678
|
if (t) {
|
|
11407
11679
|
let n = {
|
|
11408
|
-
...
|
|
11680
|
+
...ul(e),
|
|
11409
11681
|
node: t
|
|
11410
11682
|
};
|
|
11411
11683
|
this.options.onClick?.(n), this.emit("click", n);
|
|
@@ -11414,18 +11686,18 @@ var jl = class {
|
|
|
11414
11686
|
claims: (e) => {
|
|
11415
11687
|
let t = this.transition.shown;
|
|
11416
11688
|
return !!t && !!this.options.claimClick?.({
|
|
11417
|
-
...
|
|
11689
|
+
...ul(e),
|
|
11418
11690
|
node: t
|
|
11419
11691
|
});
|
|
11420
11692
|
},
|
|
11421
11693
|
hover: (e) => {
|
|
11422
11694
|
let t = this.transition.shown;
|
|
11423
11695
|
this.emit("hover", e && t ? {
|
|
11424
|
-
...
|
|
11696
|
+
...ul(e),
|
|
11425
11697
|
node: t
|
|
11426
11698
|
} : null);
|
|
11427
11699
|
}
|
|
11428
|
-
}, t.navigation ?? !0), this.measureOverlay = new
|
|
11700
|
+
}, t.navigation ?? !0), this.measureOverlay = new Il(this.scene), this.polygonOverlay = new Vl(this.scene), this.labelOverlay = new Jl(this.scene), this.resizeObserver = new ResizeObserver(() => this.resize()), this.resizeObserver.observe(e), this.rafId = requestAnimationFrame(this.animate);
|
|
11429
11701
|
}
|
|
11430
11702
|
async open(e, t = {}) {
|
|
11431
11703
|
try {
|
|
@@ -11439,7 +11711,7 @@ var jl = class {
|
|
|
11439
11711
|
}
|
|
11440
11712
|
loadGraph() {
|
|
11441
11713
|
return this.graph ??= (async () => {
|
|
11442
|
-
this.data ??= new
|
|
11714
|
+
this.data ??= new iu();
|
|
11443
11715
|
let e = await this.data.getNodes();
|
|
11444
11716
|
if (!e.length) throw Error("The 360° image graph is empty for this livemap.");
|
|
11445
11717
|
return this.nodes = e, e;
|
|
@@ -11469,7 +11741,7 @@ var jl = class {
|
|
|
11469
11741
|
return this.current;
|
|
11470
11742
|
}
|
|
11471
11743
|
async getGraphGeojson() {
|
|
11472
|
-
return this.data ??= new
|
|
11744
|
+
return this.data ??= new iu(), this.geojson ??= await this.data.getGraphGeojson(), this.geojson;
|
|
11473
11745
|
}
|
|
11474
11746
|
on(e, t) {
|
|
11475
11747
|
return this.listeners[e].add(t), () => {
|
|
@@ -11512,26 +11784,29 @@ var jl = class {
|
|
|
11512
11784
|
setPolygons(e) {
|
|
11513
11785
|
this.polygonOverlay.set(e);
|
|
11514
11786
|
}
|
|
11787
|
+
setLabels(e) {
|
|
11788
|
+
this.labelOverlay.set(e);
|
|
11789
|
+
}
|
|
11515
11790
|
lookAt(e, t = 0) {
|
|
11516
11791
|
let n = this.controls;
|
|
11517
11792
|
this.turn?.stop();
|
|
11518
11793
|
let r = {
|
|
11519
11794
|
lon: n.lon,
|
|
11520
11795
|
lat: n.lat
|
|
11521
|
-
}, i = ((e - r.lon) % 360 + 540) % 360 - 180, a = new
|
|
11796
|
+
}, i = ((e - r.lon) % 360 + 540) % 360 - 180, a = new Zc(r).to({
|
|
11522
11797
|
lon: r.lon + i,
|
|
11523
11798
|
lat: t
|
|
11524
|
-
}, 800).easing(
|
|
11799
|
+
}, 800).easing(Gc.Cubic.InOut).onUpdate(({ lon: e, lat: t }) => {
|
|
11525
11800
|
n.lon = e, n.lat = t, this.emitHeading();
|
|
11526
|
-
}).onStop(() =>
|
|
11527
|
-
|
|
11801
|
+
}).onStop(() => $c.remove(a)).onComplete(() => $c.remove(a)).start();
|
|
11802
|
+
$c.add(a), this.turn = a;
|
|
11528
11803
|
}
|
|
11529
11804
|
resize() {
|
|
11530
11805
|
let { clientWidth: e, clientHeight: t } = this.container;
|
|
11531
11806
|
!e || !t || (this.camera.aspect = e / t, this.camera.updateProjectionMatrix(), this.renderer.setSize(e, t));
|
|
11532
11807
|
}
|
|
11533
11808
|
destroy() {
|
|
11534
|
-
this.rafId !== null && (cancelAnimationFrame(this.rafId), this.rafId = null), this.resizeObserver.disconnect(), this.turn?.stop(), this.controls.dispose(), this.pointer.dispose(), this.measureOverlay.dispose(), this.polygonOverlay.dispose(), this.transition.dispose(), this.sphere.geometry.dispose(), this.renderer.dispose(), this.renderer.domElement.remove();
|
|
11809
|
+
this.rafId !== null && (cancelAnimationFrame(this.rafId), this.rafId = null), this.resizeObserver.disconnect(), this.turn?.stop(), this.controls.dispose(), this.pointer.dispose(), this.measureOverlay.dispose(), this.polygonOverlay.dispose(), this.labelOverlay.dispose(), this.transition.dispose(), this.sphere.geometry.dispose(), this.renderer.dispose(), this.renderer.domElement.remove();
|
|
11535
11810
|
}
|
|
11536
11811
|
get clickMode() {
|
|
11537
11812
|
return this.pointer.mode;
|
|
@@ -11546,7 +11821,7 @@ var jl = class {
|
|
|
11546
11821
|
this.clearMeasurement();
|
|
11547
11822
|
return;
|
|
11548
11823
|
}
|
|
11549
|
-
let r =
|
|
11824
|
+
let r = cl(e, t.heading, n.width, n.height);
|
|
11550
11825
|
if (this.measureOverlay.add(e), !this.measureStart) {
|
|
11551
11826
|
this.measureStart = r;
|
|
11552
11827
|
return;
|
|
@@ -11570,7 +11845,7 @@ var jl = class {
|
|
|
11570
11845
|
async locateAt(e) {
|
|
11571
11846
|
let t = this.transition.shown, n = this.transition.shownImageSize;
|
|
11572
11847
|
if (!(!t || !n || !this.data)) try {
|
|
11573
|
-
let [r, i] =
|
|
11848
|
+
let [r, i] = cl(e, t.heading, n.width, n.height), a = {
|
|
11574
11849
|
coordinates: await this.data.locate(t, r, i),
|
|
11575
11850
|
node: t
|
|
11576
11851
|
};
|
|
@@ -11580,15 +11855,15 @@ var jl = class {
|
|
|
11580
11855
|
}
|
|
11581
11856
|
}
|
|
11582
11857
|
getHeading() {
|
|
11583
|
-
return
|
|
11858
|
+
return dl(this.camera.quaternion);
|
|
11584
11859
|
}
|
|
11585
11860
|
emitHeading = () => {
|
|
11586
11861
|
let e = this.getHeading();
|
|
11587
11862
|
this.options.onHeadingChange?.(e), this.emit("heading", e);
|
|
11588
11863
|
};
|
|
11589
11864
|
animate = (e) => {
|
|
11590
|
-
this.rafId = requestAnimationFrame(this.animate),
|
|
11865
|
+
this.rafId = requestAnimationFrame(this.animate), $c.update(e), this.camera.position.copy(this.transition.update(e)), this.polygonOverlay.placeAt(this.transition.shown), this.labelOverlay.placeAt(this.transition.shown), this.polygonOverlay.setVisible(!this.transition.busy), this.labelOverlay.setVisible(!this.transition.busy), this.controls.autoRotate && this.controls.update(), this.renderer.render(this.scene, this.camera);
|
|
11591
11866
|
};
|
|
11592
11867
|
};
|
|
11593
11868
|
//#endregion
|
|
11594
|
-
export {
|
|
11869
|
+
export { Cl as SphereControls, iu as ViewerDataClient, cu as WemapViewer, ru as graphToNodes };
|