vis-core 0.22.8 → 0.22.9
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/index.d.ts +1 -1
- package/dist/index.js +7 -7
- package/dist/index.module.js +67 -61
- package/dist/version.d.ts +1 -1
- package/package.json +2 -2
package/dist/index.module.js
CHANGED
|
@@ -90,7 +90,7 @@ const publicKeyPEM = "LS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS0KTUlJQklqQU5CZ2txaGtpRz
|
|
|
90
90
|
).toString(CryptoJS.enc.Utf8), qe = JSON.parse($e), st = Date.now();
|
|
91
91
|
return !qe.s || qe.s > st ? (this.token = void 0, "") : qe.e && qe.e < st ? (this.token = void 0, "") : (qe.isValid = Qe, qe);
|
|
92
92
|
}
|
|
93
|
-
}, version = "0.22.
|
|
93
|
+
}, version = "0.22.9";
|
|
94
94
|
/**
|
|
95
95
|
* @license
|
|
96
96
|
* Copyright 2010-2024 Three.js Authors
|
|
@@ -22998,7 +22998,7 @@ o$3.prototype.removeAllListeners = function(c) {
|
|
|
22998
22998
|
this.removeListener(c, e[r]);
|
|
22999
22999
|
return this;
|
|
23000
23000
|
};
|
|
23001
|
-
function w
|
|
23001
|
+
function w(c, e, s) {
|
|
23002
23002
|
var r = c._events;
|
|
23003
23003
|
if (r === void 0)
|
|
23004
23004
|
return [];
|
|
@@ -23006,10 +23006,10 @@ function w$1(c, e, s) {
|
|
|
23006
23006
|
return T === void 0 ? [] : typeof T == "function" ? s ? [T.listener || T] : [T] : s ? N$3(T) : E$4(T, T.length);
|
|
23007
23007
|
}
|
|
23008
23008
|
o$3.prototype.listeners = function(c) {
|
|
23009
|
-
return w
|
|
23009
|
+
return w(this, c, !0);
|
|
23010
23010
|
};
|
|
23011
23011
|
o$3.prototype.rawListeners = function(c) {
|
|
23012
|
-
return w
|
|
23012
|
+
return w(this, c, !1);
|
|
23013
23013
|
};
|
|
23014
23014
|
o$3.listenerCount = function(c, e) {
|
|
23015
23015
|
return typeof c.listenerCount == "function" ? c.listenerCount(e) : b$3.call(c, e);
|
|
@@ -25458,7 +25458,7 @@ function ringRadians(c) {
|
|
|
25458
25458
|
function pointRadians(c) {
|
|
25459
25459
|
return [c[0] * radians$2, c[1] * radians$2];
|
|
25460
25460
|
}
|
|
25461
|
-
function We(c, e) {
|
|
25461
|
+
function We$1(c, e) {
|
|
25462
25462
|
return (c && containsObjectType.hasOwnProperty(c.type) ? containsObjectType[c.type] : containsGeometry)(c, e);
|
|
25463
25463
|
}
|
|
25464
25464
|
function Be$2(c, e) {
|
|
@@ -30778,7 +30778,7 @@ function Ue$1(c, { minLng: e, maxLng: s, minLat: r, maxLat: T } = {}) {
|
|
|
30778
30778
|
return qe;
|
|
30779
30779
|
}
|
|
30780
30780
|
function N$2(c, e, s = !1) {
|
|
30781
|
-
return s ? We(e, c) : turf_boolean_point_in_polygon_default(c, e);
|
|
30781
|
+
return s ? We$1(e, c) : turf_boolean_point_in_polygon_default(c, e);
|
|
30782
30782
|
}
|
|
30783
30783
|
function Ee$1(c, e) {
|
|
30784
30784
|
const s = { type: "Polygon", coordinates: c }, [[r, T], [de, Xe]] = le$1(s);
|
|
@@ -30794,7 +30794,7 @@ function Ee$1(c, e) {
|
|
|
30794
30794
|
(Je) => N$2(Je, s, Ke)
|
|
30795
30795
|
);
|
|
30796
30796
|
}
|
|
30797
|
-
function Ge$
|
|
30797
|
+
function Ge$2(c, { resolution: e = 1 / 0, bbox: s, projection: r } = {}) {
|
|
30798
30798
|
const T = Re$1(c, e), de = merge(T), Xe = Ee$1(c, e), Ke = [...de, ...Xe], Je = { type: "Polygon", coordinates: c }, [[Qe, _e], [$e, qe]] = le$1(Je), st = Qe > $e || // crosses antimeridian
|
|
30799
30799
|
qe >= 89 || // crosses north pole
|
|
30800
30800
|
_e <= -89;
|
|
@@ -30925,7 +30925,7 @@ const Ze$1 = ({
|
|
|
30925
30925
|
c.forEach((rt) => {
|
|
30926
30926
|
turf_boolean_clockwise_default(rt) || rt.reverse();
|
|
30927
30927
|
});
|
|
30928
|
-
const { contour: _e, triangles: $e } = Ge$
|
|
30928
|
+
const { contour: _e, triangles: $e } = Ge$2(c, {
|
|
30929
30929
|
resolution: r,
|
|
30930
30930
|
bbox: Qe,
|
|
30931
30931
|
projection: Je
|
|
@@ -34029,7 +34029,7 @@ class fe {
|
|
|
34029
34029
|
}
|
|
34030
34030
|
}
|
|
34031
34031
|
const at = 1 / 8, ge = /Mac/.test(navigator.platform);
|
|
34032
|
-
let v, Pt, ht$1, ut, L$1,
|
|
34032
|
+
let v, Pt, ht$1, ut, L$1, S$1, P$1, W, J$1, F$1, H, N$1, At, Dt, z$1, tt, G$1, bt, ft$1, Ut$1, gt$1, Ct, lt$1, q$1 = class Cn extends fe {
|
|
34033
34033
|
/**
|
|
34034
34034
|
* Injects THREE as the dependency. You can then proceed to use CameraControls.
|
|
34035
34035
|
*
|
|
@@ -34071,7 +34071,7 @@ let v, Pt, ht$1, ut, L$1, w, P$1, W, J$1, F$1, H, N$1, At, Dt, z$1, tt, G$1, bt,
|
|
|
34071
34071
|
* @category Statics
|
|
34072
34072
|
*/
|
|
34073
34073
|
static install(e) {
|
|
34074
|
-
v = e.THREE, Pt = Object.freeze(new v.Vector3(0, 0, 0)), ht$1 = Object.freeze(new v.Vector3(0, 1, 0)), ut = Object.freeze(new v.Vector3(0, 0, 1)), L$1 = new v.Vector2(),
|
|
34074
|
+
v = e.THREE, Pt = Object.freeze(new v.Vector3(0, 0, 0)), ht$1 = Object.freeze(new v.Vector3(0, 1, 0)), ut = Object.freeze(new v.Vector3(0, 0, 1)), L$1 = new v.Vector2(), S$1 = new v.Vector3(), P$1 = new v.Vector3(), W = new v.Vector3(), J$1 = new v.Vector3(), F$1 = new v.Vector3(), H = new v.Vector3(), N$1 = new v.Vector3(), At = new v.Vector3(), Dt = new v.Vector3(), z$1 = new v.Spherical(), tt = new v.Spherical(), G$1 = new v.Box3(), bt = new v.Box3(), ft$1 = new v.Sphere(), Ut$1 = new v.Quaternion(), gt$1 = new v.Quaternion(), Ct = new v.Matrix4(), lt$1 = new v.Raycaster();
|
|
34075
34075
|
}
|
|
34076
34076
|
/**
|
|
34077
34077
|
* list all ACTIONs
|
|
@@ -34102,7 +34102,7 @@ let v, Pt, ht$1, ut, L$1, w, P$1, W, J$1, F$1, H, N$1, At, Dt, z$1, tt, G$1, bt,
|
|
|
34102
34102
|
}, this._enabled = !0, this._state = h.NONE, this._viewport = null, this._changedDolly = 0, this._changedZoom = 0, this._hasRested = !0, this._boundaryEnclosesCamera = !1, this._needsUpdate = !0, this._updatedLastTime = !1, this._elementRect = new DOMRect(), this._isDragging = !1, this._dragNeedsUpdate = !0, this._activePointers = [], this._lockedPointer = null, this._interactiveArea = new DOMRect(0, 0, 1, 1), this._isUserControllingRotate = !1, this._isUserControllingDolly = !1, this._isUserControllingTruck = !1, this._isUserControllingOffset = !1, this._isUserControllingZoom = !1, this._lastDollyDirection = Y.NONE, this._thetaVelocity = { value: 0 }, this._phiVelocity = { value: 0 }, this._radiusVelocity = { value: 0 }, this._targetVelocity = new v.Vector3(), this._focalOffsetVelocity = new v.Vector3(), this._zoomVelocity = { value: 0 }, this._truckInternal = (rt, Zt, vt) => {
|
|
34103
34103
|
let Tt, Jt;
|
|
34104
34104
|
if (B$1(this._camera)) {
|
|
34105
|
-
const $t =
|
|
34105
|
+
const $t = S$1.copy(this._camera.position).sub(this._target), e0 = this._camera.getEffectiveFOV() * Q$1, t0 = $t.length() * Math.tan(e0 * 0.5);
|
|
34106
34106
|
Tt = this.truckSpeed * rt * t0 / this._elementRect.height, Jt = this.truckSpeed * Zt * t0 / this._elementRect.height;
|
|
34107
34107
|
} else if (V$1(this._camera)) {
|
|
34108
34108
|
const $t = this._camera;
|
|
@@ -34139,7 +34139,7 @@ let v, Pt, ht$1, ut, L$1, w, P$1, W, J$1, F$1, H, N$1, At, Dt, z$1, tt, G$1, bt,
|
|
|
34139
34139
|
this._camera.up,
|
|
34140
34140
|
ht$1
|
|
34141
34141
|
), this._yAxisUpSpaceInverse = this._yAxisUpSpace.clone().invert(), this._state = h.NONE, this._target = new v.Vector3(), this._targetEnd = this._target.clone(), this._focalOffset = new v.Vector3(), this._focalOffsetEnd = this._focalOffset.clone(), this._spherical = new v.Spherical().setFromVector3(
|
|
34142
|
-
|
|
34142
|
+
S$1.copy(this._camera.position).applyQuaternion(this._yAxisUpSpace)
|
|
34143
34143
|
), this._sphericalEnd = this._spherical.clone(), this._lastDistance = this._spherical.radius, this._zoom = this._camera.zoom, this._zoomEnd = this._zoom, this._lastZoom = this._zoom, this._nearPlaneCorners = [
|
|
34144
34144
|
new v.Vector3(),
|
|
34145
34145
|
new v.Vector3(),
|
|
@@ -34753,7 +34753,7 @@ let v, Pt, ht$1, ut, L$1, w, P$1, W, J$1, F$1, H, N$1, At, Dt, z$1, tt, G$1, bt,
|
|
|
34753
34753
|
*/
|
|
34754
34754
|
truck(e, s, r = !1) {
|
|
34755
34755
|
this._camera.updateMatrix(), F$1.setFromMatrixColumn(this._camera.matrix, 0), H.setFromMatrixColumn(this._camera.matrix, 1), F$1.multiplyScalar(e), H.multiplyScalar(-s);
|
|
34756
|
-
const T =
|
|
34756
|
+
const T = S$1.copy(F$1).add(H), de = P$1.copy(this._targetEnd).add(T);
|
|
34757
34757
|
return this.moveTo(de.x, de.y, de.z, r);
|
|
34758
34758
|
}
|
|
34759
34759
|
/**
|
|
@@ -34763,8 +34763,8 @@ let v, Pt, ht$1, ut, L$1, w, P$1, W, J$1, F$1, H, N$1, At, Dt, z$1, tt, G$1, bt,
|
|
|
34763
34763
|
* @category Methods
|
|
34764
34764
|
*/
|
|
34765
34765
|
forward(e, s = !1) {
|
|
34766
|
-
|
|
34767
|
-
const r = P$1.copy(this._targetEnd).add(
|
|
34766
|
+
S$1.setFromMatrixColumn(this._camera.matrix, 0), S$1.crossVectors(this._camera.up, S$1), S$1.multiplyScalar(e);
|
|
34767
|
+
const r = P$1.copy(this._targetEnd).add(S$1);
|
|
34768
34768
|
return this.moveTo(r.x, r.y, r.z, s);
|
|
34769
34769
|
}
|
|
34770
34770
|
/**
|
|
@@ -34774,10 +34774,10 @@ let v, Pt, ht$1, ut, L$1, w, P$1, W, J$1, F$1, H, N$1, At, Dt, z$1, tt, G$1, bt,
|
|
|
34774
34774
|
* @category Methods
|
|
34775
34775
|
*/
|
|
34776
34776
|
elevate(e, s = !1) {
|
|
34777
|
-
return
|
|
34778
|
-
this._targetEnd.x +
|
|
34779
|
-
this._targetEnd.y +
|
|
34780
|
-
this._targetEnd.z +
|
|
34777
|
+
return S$1.copy(this._camera.up).multiplyScalar(e), this.moveTo(
|
|
34778
|
+
this._targetEnd.x + S$1.x,
|
|
34779
|
+
this._targetEnd.y + S$1.y,
|
|
34780
|
+
this._targetEnd.z + S$1.z,
|
|
34781
34781
|
s
|
|
34782
34782
|
);
|
|
34783
34783
|
}
|
|
@@ -34791,7 +34791,7 @@ let v, Pt, ht$1, ut, L$1, w, P$1, W, J$1, F$1, H, N$1, At, Dt, z$1, tt, G$1, bt,
|
|
|
34791
34791
|
*/
|
|
34792
34792
|
moveTo(e, s, r, T = !1) {
|
|
34793
34793
|
this._isUserControllingTruck = !1;
|
|
34794
|
-
const de =
|
|
34794
|
+
const de = S$1.set(e, s, r).sub(this._targetEnd);
|
|
34795
34795
|
this._encloseToBoundary(this._targetEnd, de, this.boundaryFriction), this._needsUpdate = !0, T || this._target.copy(this._targetEnd);
|
|
34796
34796
|
const Xe = !T || A(this._target.x, this._targetEnd.x, this.restThreshold) && A(this._target.y, this._targetEnd.y, this.restThreshold) && A(this._target.z, this._targetEnd.z, this.restThreshold);
|
|
34797
34797
|
return this._createOnRestPromise(Xe);
|
|
@@ -34806,7 +34806,7 @@ let v, Pt, ht$1, ut, L$1, w, P$1, W, J$1, F$1, H, N$1, At, Dt, z$1, tt, G$1, bt,
|
|
|
34806
34806
|
* @category Methods
|
|
34807
34807
|
*/
|
|
34808
34808
|
lookInDirectionOf(e, s, r, T = !1) {
|
|
34809
|
-
const de =
|
|
34809
|
+
const de = S$1.set(e, s, r).sub(this._targetEnd).normalize().multiplyScalar(-this._sphericalEnd.radius).add(this._targetEnd);
|
|
34810
34810
|
return this.setPosition(
|
|
34811
34811
|
de.x,
|
|
34812
34812
|
de.y,
|
|
@@ -34840,11 +34840,11 @@ let v, Pt, ht$1, ut, L$1, w, P$1, W, J$1, F$1, H, N$1, At, Dt, z$1, tt, G$1, bt,
|
|
|
34840
34840
|
), Promise.resolve());
|
|
34841
34841
|
const _e = wt(this._sphericalEnd.theta, xt), $e = wt(this._sphericalEnd.phi, xt);
|
|
34842
34842
|
Je.push(this.rotateTo(_e, $e, s));
|
|
34843
|
-
const qe =
|
|
34843
|
+
const qe = S$1.setFromSpherical(this._sphericalEnd).normalize(), st = Ut$1.setFromUnitVectors(qe, ut), dt = A(Math.abs(qe.y), 1);
|
|
34844
34844
|
dt && st.multiply(gt$1.setFromAxisAngle(ht$1, _e)), st.multiply(this._yAxisUpSpaceInverse);
|
|
34845
34845
|
const Wt = bt.makeEmpty();
|
|
34846
34846
|
P$1.copy(Qe.min).applyQuaternion(st), Wt.expandByPoint(P$1), P$1.copy(Qe.min).setX(Qe.max.x).applyQuaternion(st), Wt.expandByPoint(P$1), P$1.copy(Qe.min).setY(Qe.max.y).applyQuaternion(st), Wt.expandByPoint(P$1), P$1.copy(Qe.max).setZ(Qe.min.z).applyQuaternion(st), Wt.expandByPoint(P$1), P$1.copy(Qe.min).setZ(Qe.max.z).applyQuaternion(st), Wt.expandByPoint(P$1), P$1.copy(Qe.max).setY(Qe.min.y).applyQuaternion(st), Wt.expandByPoint(P$1), P$1.copy(Qe.max).setX(Qe.min.x).applyQuaternion(st), Wt.expandByPoint(P$1), P$1.copy(Qe.max).applyQuaternion(st), Wt.expandByPoint(P$1), Wt.min.x -= T, Wt.min.y -= Xe, Wt.max.x += de, Wt.max.y += Ke, st.setFromUnitVectors(ut, qe), dt && st.premultiply(gt$1.invert()), st.premultiply(this._yAxisUpSpace);
|
|
34847
|
-
const Yt = Wt.getSize(
|
|
34847
|
+
const Yt = Wt.getSize(S$1), rt = Wt.getCenter(P$1).applyQuaternion(st);
|
|
34848
34848
|
if (B$1(this._camera)) {
|
|
34849
34849
|
const Zt = this.getDistanceToFitBox(
|
|
34850
34850
|
Yt.x,
|
|
@@ -34900,7 +34900,7 @@ let v, Pt, ht$1, ut, L$1, w, P$1, W, J$1, F$1, H, N$1, At, Dt, z$1, tt, G$1, bt,
|
|
|
34900
34900
|
*/
|
|
34901
34901
|
setLookAt(e, s, r, T, de, Xe, Ke = !1) {
|
|
34902
34902
|
this._isUserControllingRotate = !1, this._isUserControllingDolly = !1, this._isUserControllingTruck = !1, this._lastDollyDirection = Y.NONE, this._changedDolly = 0;
|
|
34903
|
-
const Je = P$1.set(T, de, Xe), Qe =
|
|
34903
|
+
const Je = P$1.set(T, de, Xe), Qe = S$1.set(e, s, r);
|
|
34904
34904
|
this._targetEnd.copy(Je), this._sphericalEnd.setFromVector3(
|
|
34905
34905
|
Qe.sub(Je).applyQuaternion(this._yAxisUpSpace)
|
|
34906
34906
|
), this.normalizeRotations(), this._needsUpdate = !0, Ke || (this._target.copy(this._targetEnd), this._spherical.copy(this._sphericalEnd));
|
|
@@ -34939,7 +34939,7 @@ let v, Pt, ht$1, ut, L$1, w, P$1, W, J$1, F$1, H, N$1, At, Dt, z$1, tt, G$1, bt,
|
|
|
34939
34939
|
*/
|
|
34940
34940
|
lerpLookAt(e, s, r, T, de, Xe, Ke, Je, Qe, _e, $e, qe, st, dt = !1) {
|
|
34941
34941
|
this._isUserControllingRotate = !1, this._isUserControllingDolly = !1, this._isUserControllingTruck = !1, this._lastDollyDirection = Y.NONE, this._changedDolly = 0;
|
|
34942
|
-
const Wt =
|
|
34942
|
+
const Wt = S$1.set(T, de, Xe), Yt = P$1.set(e, s, r);
|
|
34943
34943
|
z$1.setFromVector3(
|
|
34944
34944
|
Yt.sub(Wt).applyQuaternion(this._yAxisUpSpace)
|
|
34945
34945
|
);
|
|
@@ -34998,7 +34998,7 @@ let v, Pt, ht$1, ut, L$1, w, P$1, W, J$1, F$1, H, N$1, At, Dt, z$1, tt, G$1, bt,
|
|
|
34998
34998
|
* @category Methods
|
|
34999
34999
|
*/
|
|
35000
35000
|
setTarget(e, s, r, T = !1) {
|
|
35001
|
-
const de = this.getPosition(
|
|
35001
|
+
const de = this.getPosition(S$1), Xe = this.setLookAt(
|
|
35002
35002
|
de.x,
|
|
35003
35003
|
de.y,
|
|
35004
35004
|
de.z,
|
|
@@ -35048,8 +35048,8 @@ let v, Pt, ht$1, ut, L$1, w, P$1, W, J$1, F$1, H, N$1, At, Dt, z$1, tt, G$1, bt,
|
|
|
35048
35048
|
*/
|
|
35049
35049
|
setOrbitPoint(e, s, r) {
|
|
35050
35050
|
this._camera.updateMatrixWorld(), F$1.setFromMatrixColumn(this._camera.matrixWorldInverse, 0), H.setFromMatrixColumn(this._camera.matrixWorldInverse, 1), N$1.setFromMatrixColumn(this._camera.matrixWorldInverse, 2);
|
|
35051
|
-
const T =
|
|
35052
|
-
F$1.multiplyScalar(Xe.x), H.multiplyScalar(Xe.y), N$1.multiplyScalar(Xe.z),
|
|
35051
|
+
const T = S$1.set(e, s, r), de = T.distanceTo(this._camera.position), Xe = T.sub(this._camera.position);
|
|
35052
|
+
F$1.multiplyScalar(Xe.x), H.multiplyScalar(Xe.y), N$1.multiplyScalar(Xe.z), S$1.copy(F$1).add(H).add(N$1), S$1.z = S$1.z + de, this.dollyTo(de, !1), this.setFocalOffset(-S$1.x, S$1.y, -S$1.z, !1), this.moveTo(e, s, r, !1);
|
|
35053
35053
|
}
|
|
35054
35054
|
/**
|
|
35055
35055
|
* Set the boundary box that encloses the target of the camera. box3 is in THREE.Box3
|
|
@@ -35158,7 +35158,7 @@ let v, Pt, ht$1, ut, L$1, w, P$1, W, J$1, F$1, H, N$1, At, Dt, z$1, tt, G$1, bt,
|
|
|
35158
35158
|
reset(e = !1) {
|
|
35159
35159
|
if (!A(this._camera.up.x, this._cameraUp0.x) || !A(this._camera.up.y, this._cameraUp0.y) || !A(this._camera.up.z, this._cameraUp0.z)) {
|
|
35160
35160
|
this._camera.up.copy(this._cameraUp0);
|
|
35161
|
-
const r = this.getPosition(
|
|
35161
|
+
const r = this.getPosition(S$1);
|
|
35162
35162
|
this.updateCameraUp(), this.setPosition(r.x, r.y, r.z);
|
|
35163
35163
|
}
|
|
35164
35164
|
const s = [
|
|
@@ -35202,9 +35202,9 @@ let v, Pt, ht$1, ut, L$1, w, P$1, W, J$1, F$1, H, N$1, At, Dt, z$1, tt, G$1, bt,
|
|
|
35202
35202
|
* @category Methods
|
|
35203
35203
|
*/
|
|
35204
35204
|
applyCameraUp() {
|
|
35205
|
-
const e =
|
|
35205
|
+
const e = S$1.subVectors(this._target, this._camera.position).normalize(), s = P$1.crossVectors(e, this._camera.up);
|
|
35206
35206
|
this._camera.up.crossVectors(s, e).normalize(), this._camera.updateMatrixWorld();
|
|
35207
|
-
const r = this.getPosition(
|
|
35207
|
+
const r = this.getPosition(S$1);
|
|
35208
35208
|
this.updateCameraUp(), this.setPosition(r.x, r.y, r.z);
|
|
35209
35209
|
}
|
|
35210
35210
|
/**
|
|
@@ -35301,7 +35301,7 @@ let v, Pt, ht$1, ut, L$1, w, P$1, W, J$1, F$1, H, N$1, At, Dt, z$1, tt, G$1, bt,
|
|
|
35301
35301
|
}
|
|
35302
35302
|
if (this.dollyToCursor) {
|
|
35303
35303
|
if (B$1(this._camera) && this._changedDolly !== 0) {
|
|
35304
|
-
const _e = this._spherical.radius - this._lastDistance, $e = this._camera, qe = this._getCameraDirection(J$1), st =
|
|
35304
|
+
const _e = this._spherical.radius - this._lastDistance, $e = this._camera, qe = this._getCameraDirection(J$1), st = S$1.copy(qe).cross($e.up).normalize();
|
|
35305
35305
|
st.lengthSq() === 0 && (st.x = 1);
|
|
35306
35306
|
const dt = P$1.crossVectors(st, qe), Wt = this._sphericalEnd.radius * Math.tan($e.getEffectiveFOV() * Q$1 * 0.5), Yt = (this._sphericalEnd.radius - _e - this._sphericalEnd.radius) / this._sphericalEnd.radius, rt = W.copy(this._targetEnd).add(
|
|
35307
35307
|
st.multiplyScalar(
|
|
@@ -35309,7 +35309,7 @@ let v, Pt, ht$1, ut, L$1, w, P$1, W, J$1, F$1, H, N$1, At, Dt, z$1, tt, G$1, bt,
|
|
|
35309
35309
|
)
|
|
35310
35310
|
).add(
|
|
35311
35311
|
dt.multiplyScalar(this._dollyControlCoord.y * Wt)
|
|
35312
|
-
), Zt =
|
|
35312
|
+
), Zt = S$1.copy(this._targetEnd).lerp(rt, Yt), vt = this._lastDollyDirection === Y.IN && this._spherical.radius <= this.minDistance, Tt = this._lastDollyDirection === Y.OUT && this.maxDistance <= this._spherical.radius;
|
|
35313
35313
|
if (this.infinityDolly && (vt || Tt)) {
|
|
35314
35314
|
this._sphericalEnd.radius -= _e, this._spherical.radius -= _e;
|
|
35315
35315
|
const $t = P$1.copy(qe).multiplyScalar(-_e);
|
|
@@ -35319,11 +35319,11 @@ let v, Pt, ht$1, ut, L$1, w, P$1, W, J$1, F$1, H, N$1, At, Dt, z$1, tt, G$1, bt,
|
|
|
35319
35319
|
const Jt = P$1.subVectors(Zt, this._targetEnd);
|
|
35320
35320
|
this._targetEnd.copy(Zt), this._target.add(Jt), this._changedDolly -= _e, b$1(this._changedDolly) && (this._changedDolly = 0);
|
|
35321
35321
|
} else if (V$1(this._camera) && this._changedZoom !== 0) {
|
|
35322
|
-
const _e = this._zoom - this._lastZoom, $e = this._camera, qe =
|
|
35322
|
+
const _e = this._zoom - this._lastZoom, $e = this._camera, qe = S$1.set(
|
|
35323
35323
|
this._dollyControlCoord.x,
|
|
35324
35324
|
this._dollyControlCoord.y,
|
|
35325
35325
|
($e.near + $e.far) / ($e.near - $e.far)
|
|
35326
|
-
).unproject($e), st = P$1.set(0, 0, -1).applyQuaternion($e.quaternion), dt = W.copy(qe).add(st.multiplyScalar(-qe.dot($e.up))), Wt = -(this._zoom - _e - this._zoom) / this._zoom, Yt = this._getCameraDirection(J$1), rt = this._targetEnd.dot(Yt), Zt =
|
|
35326
|
+
).unproject($e), st = P$1.set(0, 0, -1).applyQuaternion($e.quaternion), dt = W.copy(qe).add(st.multiplyScalar(-qe.dot($e.up))), Wt = -(this._zoom - _e - this._zoom) / this._zoom, Yt = this._getCameraDirection(J$1), rt = this._targetEnd.dot(Yt), Zt = S$1.copy(this._targetEnd).lerp(dt, Wt), vt = Zt.dot(Yt), Tt = Yt.multiplyScalar(
|
|
35327
35327
|
vt - rt
|
|
35328
35328
|
);
|
|
35329
35329
|
Zt.sub(Tt), this._boundary.clampPoint(Zt, Zt);
|
|
@@ -35333,9 +35333,9 @@ let v, Pt, ht$1, ut, L$1, w, P$1, W, J$1, F$1, H, N$1, At, Dt, z$1, tt, G$1, bt,
|
|
|
35333
35333
|
}
|
|
35334
35334
|
this._camera.zoom !== this._zoom && (this._camera.zoom = this._zoom, this._camera.updateProjectionMatrix(), this._updateNearPlaneCorners(), this._needsUpdate = !0), this._dragNeedsUpdate = !0;
|
|
35335
35335
|
const Je = this._collisionTest();
|
|
35336
|
-
this._spherical.radius = Math.min(this._spherical.radius, Je), this._spherical.makeSafe(), this._camera.position.setFromSpherical(this._spherical).applyQuaternion(this._yAxisUpSpaceInverse).add(this._target), this._camera.lookAt(this._target), (!b$1(this._focalOffset.x) || !b$1(this._focalOffset.y) || !b$1(this._focalOffset.z)) && (this._camera.updateMatrixWorld(), F$1.setFromMatrixColumn(this._camera.matrix, 0), H.setFromMatrixColumn(this._camera.matrix, 1), N$1.setFromMatrixColumn(this._camera.matrix, 2), F$1.multiplyScalar(this._focalOffset.x), H.multiplyScalar(-this._focalOffset.y), N$1.multiplyScalar(this._focalOffset.z),
|
|
35336
|
+
this._spherical.radius = Math.min(this._spherical.radius, Je), this._spherical.makeSafe(), this._camera.position.setFromSpherical(this._spherical).applyQuaternion(this._yAxisUpSpaceInverse).add(this._target), this._camera.lookAt(this._target), (!b$1(this._focalOffset.x) || !b$1(this._focalOffset.y) || !b$1(this._focalOffset.z)) && (this._camera.updateMatrixWorld(), F$1.setFromMatrixColumn(this._camera.matrix, 0), H.setFromMatrixColumn(this._camera.matrix, 1), N$1.setFromMatrixColumn(this._camera.matrix, 2), F$1.multiplyScalar(this._focalOffset.x), H.multiplyScalar(-this._focalOffset.y), N$1.multiplyScalar(this._focalOffset.z), S$1.copy(F$1).add(H).add(N$1), this._camera.position.add(S$1)), this._boundaryEnclosesCamera && this._encloseToBoundary(
|
|
35337
35337
|
this._camera.position.copy(this._target),
|
|
35338
|
-
|
|
35338
|
+
S$1.setFromSpherical(this._spherical).applyQuaternion(this._yAxisUpSpaceInverse),
|
|
35339
35339
|
1
|
|
35340
35340
|
);
|
|
35341
35341
|
const Qe = this._needsUpdate;
|
|
@@ -35363,7 +35363,7 @@ let v, Pt, ht$1, ut, L$1, w, P$1, W, J$1, F$1, H, N$1, At, Dt, z$1, tt, G$1, bt,
|
|
|
35363
35363
|
dollyToCursor: this.dollyToCursor,
|
|
35364
35364
|
verticalDragToForward: this.verticalDragToForward,
|
|
35365
35365
|
target: this._targetEnd.toArray(),
|
|
35366
|
-
position:
|
|
35366
|
+
position: S$1.setFromSpherical(this._sphericalEnd).add(this._targetEnd).toArray(),
|
|
35367
35367
|
zoom: this._zoomEnd,
|
|
35368
35368
|
focalOffset: this._focalOffsetEnd.toArray(),
|
|
35369
35369
|
target0: this._target0.toArray(),
|
|
@@ -35381,7 +35381,7 @@ let v, Pt, ht$1, ut, L$1, w, P$1, W, J$1, F$1, H, N$1, At, Dt, z$1, tt, G$1, bt,
|
|
|
35381
35381
|
fromJSON(e, s = !1) {
|
|
35382
35382
|
const r = JSON.parse(e);
|
|
35383
35383
|
this.enabled = r.enabled, this.minDistance = r.minDistance, this.maxDistance = $$1(r.maxDistance), this.minZoom = r.minZoom, this.maxZoom = $$1(r.maxZoom), this.minPolarAngle = r.minPolarAngle, this.maxPolarAngle = $$1(r.maxPolarAngle), this.minAzimuthAngle = $$1(r.minAzimuthAngle), this.maxAzimuthAngle = $$1(r.maxAzimuthAngle), this.smoothTime = r.smoothTime, this.draggingSmoothTime = r.draggingSmoothTime, this.dollySpeed = r.dollySpeed, this.truckSpeed = r.truckSpeed, this.dollyToCursor = r.dollyToCursor, this.verticalDragToForward = r.verticalDragToForward, this._target0.fromArray(r.target0), this._position0.fromArray(r.position0), this._zoom0 = r.zoom0, this._focalOffset0.fromArray(r.focalOffset0), this.moveTo(r.target[0], r.target[1], r.target[2], s), z$1.setFromVector3(
|
|
35384
|
-
|
|
35384
|
+
S$1.fromArray(r.position).sub(this._targetEnd).applyQuaternion(this._yAxisUpSpace)
|
|
35385
35385
|
), this.rotateTo(z$1.theta, z$1.phi, s), this.dollyTo(z$1.radius, s), this.zoomTo(r.zoom, s), this.setFocalOffset(
|
|
35386
35386
|
r.focalOffset[0],
|
|
35387
35387
|
r.focalOffset[1],
|
|
@@ -35549,7 +35549,7 @@ let v, Pt, ht$1, ut, L$1, w, P$1, W, J$1, F$1, H, N$1, At, Dt, z$1, tt, G$1, bt,
|
|
|
35549
35549
|
Je.applyMatrix4(Ke.matrixWorld);
|
|
35550
35550
|
const Qe = Je.attributes.position;
|
|
35551
35551
|
for (let _e = 0, $e = Qe.count; _e < $e; _e++)
|
|
35552
|
-
|
|
35552
|
+
S$1.fromBufferAttribute(Qe, _e), de = Math.max(de, T.distanceToSquared(S$1));
|
|
35553
35553
|
}), r.radius = Math.sqrt(de), r;
|
|
35554
35554
|
}
|
|
35555
35555
|
};
|
|
@@ -36310,30 +36310,36 @@ const Fe = (c) => {
|
|
|
36310
36310
|
"baseTexture"
|
|
36311
36311
|
);
|
|
36312
36312
|
return e.needsSwap = !0, e;
|
|
36313
|
-
}, yt = 1, K$1 = !1, He = new MeshBasicMaterial({ color: "black" }), Ie = new
|
|
36313
|
+
}, yt = 1, K$1 = !1, He = new MeshBasicMaterial({ color: "black" }), Ie = new PointsMaterial({
|
|
36314
|
+
color: "black",
|
|
36315
|
+
sizeAttenuation: !1
|
|
36316
|
+
}), ke = new PointsMaterial({
|
|
36317
|
+
color: "black",
|
|
36318
|
+
sizeAttenuation: !0
|
|
36319
|
+
}), Ve = new SpriteMaterial({
|
|
36314
36320
|
color: "black",
|
|
36315
36321
|
sizeAttenuation: !0
|
|
36316
|
-
}),
|
|
36322
|
+
}), Be$1 = new SpriteMaterial({
|
|
36317
36323
|
color: "black",
|
|
36318
36324
|
sizeAttenuation: !1
|
|
36319
|
-
}),
|
|
36325
|
+
}), Ne = new it$1({
|
|
36320
36326
|
color: "black",
|
|
36321
36327
|
sizeAttenuation: 0,
|
|
36322
36328
|
lineWidth: 0
|
|
36323
|
-
}),
|
|
36329
|
+
}), Ye = {
|
|
36324
36330
|
kernelRadius: 8,
|
|
36325
36331
|
minDistance: 5e-3,
|
|
36326
36332
|
maxDistance: 0.1
|
|
36327
|
-
},
|
|
36333
|
+
}, Ze = {
|
|
36328
36334
|
threshold: 0,
|
|
36329
36335
|
strength: 0.4,
|
|
36330
36336
|
radius: 0.1,
|
|
36331
36337
|
bloomAlphaType: 0
|
|
36332
|
-
},
|
|
36338
|
+
}, We = {
|
|
36333
36339
|
multisampling: 4,
|
|
36334
36340
|
premultiplieAlpha: !1
|
|
36335
36341
|
};
|
|
36336
|
-
class
|
|
36342
|
+
let Ge$1 = class {
|
|
36337
36343
|
constructor(e) {
|
|
36338
36344
|
this.bloomComposerActive = !1, this.active = !0, this.bloomSelection = /* @__PURE__ */ new Set(), this.bloomLayer = new Layers(), this.bloomMaterials = {}, this.bloomVisible = {}, this.pipViewportState = null, this.options = e;
|
|
36339
36345
|
const {
|
|
@@ -36474,8 +36480,8 @@ class Ze {
|
|
|
36474
36480
|
this.bloomVisible[r.uuid] = r.visible, r.visible = !1;
|
|
36475
36481
|
}), s.forEach((r) => {
|
|
36476
36482
|
r.traverse((T) => {
|
|
36477
|
-
const de = T, Xe = T;
|
|
36478
|
-
de.material && this.bloomLayer.test(de.layers) === !1 && (this.bloomMaterials[de.uuid] = de.material, Xe.isSprite ? Xe.material.sizeAttenuation ? Xe.material =
|
|
36483
|
+
const de = T, Xe = T, Ke = T;
|
|
36484
|
+
de.material && this.bloomLayer.test(de.layers) === !1 && (this.bloomMaterials[de.uuid] = de.material, Xe.isSprite ? Xe.material.sizeAttenuation ? Xe.material = Ve : Xe.material = Be$1 : de.material instanceof it$1 ? de.material = Ne : Ke.isPoints ? Ke.material.sizeAttenuation ? Ke.material = ke : Ke.material = Ie : de.material = He);
|
|
36479
36485
|
});
|
|
36480
36486
|
});
|
|
36481
36487
|
}
|
|
@@ -36516,7 +36522,7 @@ class Ze {
|
|
|
36516
36522
|
var e;
|
|
36517
36523
|
this.bloomMaterials = {}, this.bloomVisible = {}, this.bloomSelection.clear(), this.finalComposer.dispose(), (e = this.bloomComposer) == null || e.dispose();
|
|
36518
36524
|
}
|
|
36519
|
-
}
|
|
36525
|
+
};
|
|
36520
36526
|
const ct = class vn {
|
|
36521
36527
|
constructor(e, s) {
|
|
36522
36528
|
this.raycaster = new Raycaster(), this.maxBackufferArea = 5760 * 5760, this.installPlugins = /* @__PURE__ */ new Map(), this._cameraPositon = new Vector3(), this._cameraTarget = new Vector3(), this.event = new P$2.EventEmitter(), this.clock = new Clock(), this.userData = {}, this.dprCache = 1, this.options = ee(vn.options, e, {
|
|
@@ -36622,7 +36628,7 @@ const ct = class vn {
|
|
|
36622
36628
|
ssao: r,
|
|
36623
36629
|
ssaoParams: T,
|
|
36624
36630
|
composer: de
|
|
36625
|
-
} = this.options, Xe = new
|
|
36631
|
+
} = this.options, Xe = new Ge$1({
|
|
36626
36632
|
rendererController: this.rendererController,
|
|
36627
36633
|
sceneController: this.sceneController,
|
|
36628
36634
|
cameraController: this.cameraController,
|
|
@@ -36801,20 +36807,20 @@ ct.options = {
|
|
|
36801
36807
|
transformControls: K$1,
|
|
36802
36808
|
resizeObserver: !0,
|
|
36803
36809
|
renderer: Ce,
|
|
36804
|
-
composer:
|
|
36810
|
+
composer: We,
|
|
36805
36811
|
scene: xe,
|
|
36806
36812
|
camera: Te$1,
|
|
36807
36813
|
bloom: !1,
|
|
36808
|
-
bloomParams:
|
|
36814
|
+
bloomParams: Ze,
|
|
36809
36815
|
ssao: !1,
|
|
36810
|
-
ssaoParams:
|
|
36816
|
+
ssaoParams: Ye,
|
|
36811
36817
|
css2DRenderer: !1,
|
|
36812
36818
|
css2DRendererParams: k$1({}, It),
|
|
36813
36819
|
css3DRenderer: !1,
|
|
36814
36820
|
css3DRendererParams: k$1({}, It)
|
|
36815
36821
|
};
|
|
36816
36822
|
let Vt$1 = ct;
|
|
36817
|
-
const
|
|
36823
|
+
const xs = q$1.ACTION;
|
|
36818
36824
|
class t extends A$1 {
|
|
36819
36825
|
create() {
|
|
36820
36826
|
this.createGroup();
|
|
@@ -50435,7 +50441,7 @@ class Base extends Event {
|
|
|
50435
50441
|
background: new Color$1(0)
|
|
50436
50442
|
}
|
|
50437
50443
|
}), this.pencilConfig), this.options.pencilConfig)), r = s.composerController.ssaoPass;
|
|
50438
|
-
r && (r.enabled = !1), this.leftTruck && (s.controls.mouseButtons.left =
|
|
50444
|
+
r && (r.enabled = !1), this.leftTruck && (s.controls.mouseButtons.left = xs.TRUCK, s.controls.mouseButtons.right = xs.ROTATE), s.use(this.mList), s.use(this.loader), s.use(this.worker), s.use(this.drawController), yield this.drawController.initGroup(), (T = this.drawController.group) == null || T.hide(), (de = this.drawController.prefabGroup) == null || de.hide(), this.pencil = s, this.initSceneUserData(), this.playing || (window.vis = this, window.pencil = s), this.initSettings();
|
|
50439
50445
|
});
|
|
50440
50446
|
}
|
|
50441
50447
|
initSceneUserData() {
|
|
@@ -50514,9 +50520,9 @@ class Base extends Event {
|
|
|
50514
50520
|
}
|
|
50515
50521
|
initSettings() {
|
|
50516
50522
|
const s = {
|
|
50517
|
-
mouseLeft: this.leftTruck ?
|
|
50518
|
-
mouseRight: this.leftTruck ?
|
|
50519
|
-
mouseWheel:
|
|
50523
|
+
mouseLeft: this.leftTruck ? xs.TRUCK : xs.ROTATE,
|
|
50524
|
+
mouseRight: this.leftTruck ? xs.ROTATE : xs.TRUCK,
|
|
50525
|
+
mouseWheel: xs.DOLLY
|
|
50520
50526
|
};
|
|
50521
50527
|
this.settings = new Proxy(
|
|
50522
50528
|
zi(ri(ri({}, this.initSettingsObj), s), {
|
|
@@ -50527,7 +50533,7 @@ class Base extends Event {
|
|
|
50527
50533
|
set: (r, T, de) => {
|
|
50528
50534
|
if (!(T in r) && !(T.replace(/(:::.+)\..*$/, "$1") in r))
|
|
50529
50535
|
return Reflect.set({}, T, de);
|
|
50530
|
-
T === "mouseWheel" ? typeof de == "boolean" && (de = de ? s.mouseWheel :
|
|
50536
|
+
T === "mouseWheel" ? typeof de == "boolean" && (de = de ? s.mouseWheel : xs.NONE) : T === "mouseLeft" ? typeof de == "boolean" && (de = de ? s.mouseLeft : xs.NONE) : T === "mouseRight" && typeof de == "boolean" && (de = de ? s.mouseRight : xs.NONE);
|
|
50531
50537
|
const Xe = T.includes(":::");
|
|
50532
50538
|
return Reflect.set(
|
|
50533
50539
|
r,
|
|
@@ -50552,7 +50558,7 @@ class Base extends Event {
|
|
|
50552
50558
|
mouseLeft: T.controls.mouseButtons.left,
|
|
50553
50559
|
mouseRight: T.controls.mouseButtons.right,
|
|
50554
50560
|
mouseWheel: T.controls.mouseButtons.wheel
|
|
50555
|
-
}, T.controls.mouseButtons.left =
|
|
50561
|
+
}, T.controls.mouseButtons.left = xs.NONE, T.controls.mouseButtons.right = xs.NONE, T.controls.mouseButtons.wheel = xs.NONE) : this.mouseButtonsActiveStore && (T.controls.mouseButtons.left = this.mouseButtonsActiveStore.mouseLeft, T.controls.mouseButtons.right = this.mouseButtonsActiveStore.mouseRight, T.controls.mouseButtons.wheel = this.mouseButtonsActiveStore.mouseWheel) : s === "viewportPadding" && T.rendererController.setViewPadding(...r);
|
|
50556
50562
|
return r;
|
|
50557
50563
|
});
|
|
50558
50564
|
}
|
package/dist/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "0.22.
|
|
1
|
+
declare const _default: "0.22.9";
|
|
2
2
|
export default _default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vis-core",
|
|
3
|
-
"version": "0.22.
|
|
3
|
+
"version": "0.22.9",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"start": "npm run version && PORT=5173 bundler-dev",
|
|
6
6
|
"build:site": "npm run version && bundler",
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"esus-lite": "^0.2.8",
|
|
69
69
|
"events": "^3.3.0",
|
|
70
70
|
"geojson-cn": "^0.1.30",
|
|
71
|
-
"gl-draw": "0.12.
|
|
71
|
+
"gl-draw": "0.12.7",
|
|
72
72
|
"jsrsasign": "^11.1.0",
|
|
73
73
|
"lodash-es": "^4.17.21"
|
|
74
74
|
},
|