soonspacejs 2.16.4 → 2.16.5
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.esm.js
CHANGED
|
@@ -24,7 +24,7 @@ import * as Vi from "three/examples/jsm/utils/SkeletonUtils.js";
|
|
|
24
24
|
import * as Eh from "three/examples/jsm/libs/fflate.module.js";
|
|
25
25
|
import { NURBSCurve as Oh } from "three/examples/jsm/curves/NURBSCurve.js";
|
|
26
26
|
import { RectAreaLightHelper as Lh } from "three/examples/jsm/helpers/RectAreaLightHelper.js";
|
|
27
|
-
const Bh = "soonspacejs", Rh = "2.16.
|
|
27
|
+
const Bh = "soonspacejs", Rh = "2.16.5", Wi = {
|
|
28
28
|
name: Bh,
|
|
29
29
|
version: Rh
|
|
30
30
|
}, io = "[soonspacejs]: ";
|
|
@@ -537,6 +537,8 @@ class Hi {
|
|
|
537
537
|
constructor(e, t, n = {}) {
|
|
538
538
|
this.target = e, this.points = t, Object.assign(this, n);
|
|
539
539
|
}
|
|
540
|
+
target;
|
|
541
|
+
points;
|
|
540
542
|
/**
|
|
541
543
|
* 移动速度
|
|
542
544
|
*/
|
|
@@ -4142,6 +4144,8 @@ class $u {
|
|
|
4142
4144
|
}
|
|
4143
4145
|
};
|
|
4144
4146
|
}
|
|
4147
|
+
signals;
|
|
4148
|
+
viewportState;
|
|
4145
4149
|
scene;
|
|
4146
4150
|
selectedObjects;
|
|
4147
4151
|
intersectsList;
|
|
@@ -4456,6 +4460,7 @@ class ed {
|
|
|
4456
4460
|
h[f].element.style.zIndex = `${d - f}`;
|
|
4457
4461
|
}
|
|
4458
4462
|
}
|
|
4463
|
+
viewport;
|
|
4459
4464
|
domElement = document.createElement("div");
|
|
4460
4465
|
getSize;
|
|
4461
4466
|
render;
|
|
@@ -4545,6 +4550,7 @@ class sd {
|
|
|
4545
4550
|
});
|
|
4546
4551
|
};
|
|
4547
4552
|
}
|
|
4553
|
+
viewport;
|
|
4548
4554
|
domElement = document.createElement("div");
|
|
4549
4555
|
getSize;
|
|
4550
4556
|
render;
|
|
@@ -4558,6 +4564,7 @@ class ad {
|
|
|
4558
4564
|
enableRenderCss3D: !1
|
|
4559
4565
|
}, this.container = this._initContainer(), this.renderer = this._initRenderer(), this.rendererCSS2D = this._initRenderCSS2D(), this.rendererCSS3D = this._initRenderCSS3D(), this.interactiveContainer = this._initInteractiveContainer();
|
|
4560
4566
|
}
|
|
4567
|
+
viewport;
|
|
4561
4568
|
internalOptions;
|
|
4562
4569
|
renderer;
|
|
4563
4570
|
container;
|
|
@@ -6145,6 +6152,9 @@ class Ke {
|
|
|
6145
6152
|
constructor(e, t, n) {
|
|
6146
6153
|
this.renderer = e, this.scene = t, this.camera = n, this.effectComposer = this._initEffectComposer(), this._initPasses(), this._initEffects();
|
|
6147
6154
|
}
|
|
6155
|
+
renderer;
|
|
6156
|
+
scene;
|
|
6157
|
+
camera;
|
|
6148
6158
|
static CONSTANTS = {
|
|
6149
6159
|
renderPass: "renderPass",
|
|
6150
6160
|
normalPass: "normalPass",
|
|
@@ -6322,6 +6332,7 @@ class bd {
|
|
|
6322
6332
|
}, xd);
|
|
6323
6333
|
});
|
|
6324
6334
|
}
|
|
6335
|
+
viewport;
|
|
6325
6336
|
cameraChanging = !1;
|
|
6326
6337
|
timer = null;
|
|
6327
6338
|
computedGeometriesUuid = /* @__PURE__ */ new Map();
|
|
@@ -6427,6 +6438,7 @@ class Md extends Nn {
|
|
|
6427
6438
|
constructor(e) {
|
|
6428
6439
|
super(e.cameraManager.mainCamera, e.interactiveContainer), this.viewport = e;
|
|
6429
6440
|
}
|
|
6441
|
+
viewport;
|
|
6430
6442
|
dollySpeed = 0.2;
|
|
6431
6443
|
azimuthRotateSpeed = 0.5;
|
|
6432
6444
|
polarRotateSpeed = 0.5;
|
|
@@ -7321,6 +7333,7 @@ class $d {
|
|
|
7321
7333
|
constructor(e) {
|
|
7322
7334
|
this.viewport = e, this.options = e.options, this.signals = e.signals, this.container = e.container, this.dblClickMaxInterval = 300, this.mouseDownTimes = [0, 0], this.mouseDownEvent = null, this.handleMouseDown = this.handleMouseDown.bind(this), this.handleMouseMove = this.handleMouseMove.bind(this), this.handleMouseUp = this.handleMouseUp.bind(this), this.handleDblClick = this.handleDblClick.bind(this), this.handleMouseWheel = this.handleMouseWheel.bind(this), this.handleTouchStart = this.handleTouchStart.bind(this), this.handleTouchEnd = this.handleTouchEnd.bind(this), this.handleKeyDown = this.handleKeyDown.bind(this), this.handleKeyUp = this.handleKeyUp.bind(this), this.addEventListeners();
|
|
7323
7335
|
}
|
|
7336
|
+
viewport;
|
|
7324
7337
|
// 双击时最大间隔时长限制
|
|
7325
7338
|
dblClickMaxInterval;
|
|
7326
7339
|
/**
|
|
@@ -7492,6 +7505,8 @@ class ep {
|
|
|
7492
7505
|
frametime: 0
|
|
7493
7506
|
};
|
|
7494
7507
|
}
|
|
7508
|
+
scene;
|
|
7509
|
+
signals;
|
|
7495
7510
|
container;
|
|
7496
7511
|
renderStateFrame = null;
|
|
7497
7512
|
disposed = !1;
|
|
@@ -7599,6 +7614,8 @@ class tp extends Se {
|
|
|
7599
7614
|
C.material.map?.dispose(), D.material.map?.dispose(), L.material.map?.dispose(), C.material.dispose(), D.material.dispose(), L.material.dispose(), C.material = Z(s, l.labelX), D.material = Z(r, l.labelY), L.material = Z(a, l.labelZ);
|
|
7600
7615
|
}
|
|
7601
7616
|
}
|
|
7617
|
+
camera;
|
|
7618
|
+
controls;
|
|
7602
7619
|
setLabels;
|
|
7603
7620
|
setLabelStyle;
|
|
7604
7621
|
render;
|
|
@@ -8407,9 +8424,11 @@ class Hp {
|
|
|
8407
8424
|
constructor(e) {
|
|
8408
8425
|
this.viewport = e, this.proxyRoot.name = "__soonspace_auto_instancing__", this.proxyRoot.matrixAutoUpdate = !1, this.proxyRoot.matrixWorldAutoUpdate = !1, this.proxyRoot.matrix.identity(), this.proxyRoot.matrixWorld.identity(), this.proxyRoot.userData.__soonspaceAutoInstancing = !0, this.viewport.signals.objectAdded.add(this._handleObjectAdded), this.viewport.signals.objectRemoved.add(this._handleObjectRemoved), this.viewport.signals.objectChanged.add(this._handleSourceChanged), this.viewport.signals.geometryChanged.add(this._handleSourceChanged), this.viewport.signals.materialAdded.add(this._handleMaterialChanged), this.viewport.signals.materialChanged.add(this._handleMaterialChanged), this.viewport.signals.materialRemoved.add(this._handleMaterialChanged), this.viewport.signals.modelAnimation.add(this._handleSourceChanged), this.viewport.signals.tweenUpdate.add(this._handleSourceChanged);
|
|
8409
8426
|
}
|
|
8427
|
+
viewport;
|
|
8410
8428
|
proxyRoot = new gn();
|
|
8411
8429
|
roots = /* @__PURE__ */ new Map();
|
|
8412
8430
|
pendingRoots = /* @__PURE__ */ new Map();
|
|
8431
|
+
pendingRootSyncRequested = !1;
|
|
8413
8432
|
sourceToProxy = /* @__PURE__ */ new WeakMap();
|
|
8414
8433
|
sourceBindings = /* @__PURE__ */ new WeakMap();
|
|
8415
8434
|
proxyBindings = /* @__PURE__ */ new WeakMap();
|
|
@@ -8467,7 +8486,7 @@ class Hp {
|
|
|
8467
8486
|
requestSync() {
|
|
8468
8487
|
this.roots.forEach((e) => {
|
|
8469
8488
|
e.options.syncMode === "safe" && (e.sourceSyncRequired = !0, e.sourceSyncIndexes = null, e.materialSyncRequired = !0, e.materialTexturesDirty = !0);
|
|
8470
|
-
}), this.
|
|
8489
|
+
}), this.pendingRootSyncRequested = !0;
|
|
8471
8490
|
}
|
|
8472
8491
|
markBeforeRenderListenerSafe(e) {
|
|
8473
8492
|
this.safeBeforeRenderListeners.add(e);
|
|
@@ -8515,7 +8534,7 @@ class Hp {
|
|
|
8515
8534
|
if (!this.isRendering) {
|
|
8516
8535
|
this.isRendering = !0;
|
|
8517
8536
|
try {
|
|
8518
|
-
this._removeInvalidRoots(), this._partitionNestedRoots(), this._rebuildDirtyRoots();
|
|
8537
|
+
this.pendingRootSyncRequested && (this.pendingRootSyncRequested = !1, this._retryPendingRoots((t) => this.pendingRoots.get(t)?.syncMode !== "signal")), this._removeInvalidRoots(), this._partitionNestedRoots(), this._rebuildDirtyRoots();
|
|
8519
8538
|
for (const t of this.roots.values()) {
|
|
8520
8539
|
if ((e || t.sourceSyncRequired) && this._syncRoot(t, e)) {
|
|
8521
8540
|
t.dirty = !0;
|
|
@@ -8598,7 +8617,7 @@ class Hp {
|
|
|
8598
8617
|
}
|
|
8599
8618
|
clear() {
|
|
8600
8619
|
for (const e of [...this.roots.keys()]) this.unregisterRoot(e);
|
|
8601
|
-
this.pendingRoots.clear(), this.dynamicSources = /* @__PURE__ */ new WeakSet(), this.outlineIndependentSources = /* @__PURE__ */ new WeakSet();
|
|
8620
|
+
this.pendingRoots.clear(), this.pendingRootSyncRequested = !1, this.dynamicSources = /* @__PURE__ */ new WeakSet(), this.outlineIndependentSources = /* @__PURE__ */ new WeakSet();
|
|
8602
8621
|
}
|
|
8603
8622
|
dispose() {
|
|
8604
8623
|
this.endRender(), this.autoMode = !1, this.clear(), this.safeBeforeRenderListeners.clear(), this.viewport.signals.objectAdded.remove(this._handleObjectAdded), this.viewport.signals.objectRemoved.remove(this._handleObjectRemoved), this.viewport.signals.objectChanged.remove(this._handleSourceChanged), this.viewport.signals.geometryChanged.remove(this._handleSourceChanged), this.viewport.signals.materialAdded.remove(this._handleMaterialChanged), this.viewport.signals.materialChanged.remove(this._handleMaterialChanged), this.viewport.signals.materialRemoved.remove(this._handleMaterialChanged), this.viewport.signals.modelAnimation.remove(this._handleSourceChanged), this.viewport.signals.tweenUpdate.remove(this._handleSourceChanged), this.proxyRoot.removeFromParent();
|
|
@@ -9153,6 +9172,9 @@ class qp {
|
|
|
9153
9172
|
isDisposed: !1
|
|
9154
9173
|
}, this.scener = new $u(this.signals, this.state), this.scene = this.scener.scene, this.cameraManager = new ld(this), this.camera = this.cameraManager.currentCamera, this.rendererManager = new ad(this), this.container = this.rendererManager.container, this.interactiveContainer = this.rendererManager.interactiveContainer, this.renderer = this.rendererManager.renderer, this.rendererCSS3D = this.rendererManager.rendererCSS3D, this.rendererCSS2D = this.rendererManager.rendererCSS2D, this.autoInstancingManager = new Hp(this), this.pmremGenerator = new Pc(this.renderer), this.pmremGenerator.compileEquirectangularShader(), this.effectManager = new Ke(this.renderer, this.scene, this.camera), this.effectComposer = this.effectManager.effectComposer, this.bvh = new bd(this), this.controls = new Md(this), this.info = new ep(this.scene, this.signals), this.stats = new gh(), this.mixer = new Ac(this.scene), this.clipsSet = /* @__PURE__ */ new Set(), this.postUpdate = /* @__PURE__ */ new Map(), this.postRender = /* @__PURE__ */ new Map(), this._loop = 0, this.viewHelper = new tp(this.camera, this.container, this.controls), this.viewHelper.setLabels("x", "y", "z"), this.eventHandler = new $d(this), this.resizeObserver.observe(this.container), this._initInfo(), this._initStats(), this._signalsEventListenr(), this.animate(0);
|
|
9155
9174
|
}
|
|
9175
|
+
options;
|
|
9176
|
+
signals;
|
|
9177
|
+
cache;
|
|
9156
9178
|
clock = new Dc();
|
|
9157
9179
|
raycaster = new qn();
|
|
9158
9180
|
scene;
|
|
@@ -9748,6 +9770,7 @@ class Pi extends je {
|
|
|
9748
9770
|
} = e ?? {};
|
|
9749
9771
|
super(e), this.params = e, this.updateGeometry(t), this.updateMaterialOpacity(s), this.updateMaterial(n, r), this.stype = "Point";
|
|
9750
9772
|
}
|
|
9773
|
+
params;
|
|
9751
9774
|
updateGeometry(e) {
|
|
9752
9775
|
this.geometry.dispose(), this.geometry = new Fi(e);
|
|
9753
9776
|
}
|
|
@@ -9772,6 +9795,7 @@ class Ai extends je {
|
|
|
9772
9795
|
} = e ?? {};
|
|
9773
9796
|
super(e, void 0, new We({ side: st })), this.params = e, this.updateGeometry(t), this.updateMaterialOpacity(s), this.updateMaterial(n, r), this.stype = "Circle", this.rotation.set(-Math.PI / 2, 0, 0);
|
|
9774
9797
|
}
|
|
9798
|
+
params;
|
|
9775
9799
|
updateGeometry(e) {
|
|
9776
9800
|
this.geometry.dispose(), this.geometry = new Uc(e);
|
|
9777
9801
|
}
|
|
@@ -9800,6 +9824,7 @@ class tl extends je {
|
|
|
9800
9824
|
this.geometry.dispose(), this.material.dispose(), l?.dispose();
|
|
9801
9825
|
});
|
|
9802
9826
|
}
|
|
9827
|
+
params;
|
|
9803
9828
|
passable = 0;
|
|
9804
9829
|
updateGeometry(e) {
|
|
9805
9830
|
this.params && Object.assign(this.params, e), this.computeVertex();
|
|
@@ -10053,6 +10078,7 @@ class nl extends je {
|
|
|
10053
10078
|
} = e ?? {};
|
|
10054
10079
|
super(e, void 0, new We({ side: st, flatShading: !0 })), this.params = e, this.updateGeometry(t, n), this.updateMaterialOpacity(r), this.updateMaterial(s, a), this.stype = "Line";
|
|
10055
10080
|
}
|
|
10081
|
+
params;
|
|
10056
10082
|
updateGeometry(e, t) {
|
|
10057
10083
|
if (e.length < 2) return;
|
|
10058
10084
|
const n = t / 2;
|
|
@@ -10122,6 +10148,7 @@ class sl extends je {
|
|
|
10122
10148
|
} = e ?? {};
|
|
10123
10149
|
super(e), this.params = e, this.updateGeometry(n, s), this.updateMaterialOpacity(a), this.updateMaterial(r, o), this.stype = "Polygon", this.position.set(0, t, 0), this.rotation.set(-Math.PI / 2, 0, 0), this.scale.setScalar(0.999);
|
|
10124
10150
|
}
|
|
10151
|
+
params;
|
|
10125
10152
|
updateGeometry(e, t) {
|
|
10126
10153
|
this.geometry.dispose();
|
|
10127
10154
|
const n = [];
|
|
@@ -11573,6 +11600,7 @@ class Hr extends Ae {
|
|
|
11573
11600
|
const { material: t } = this.decalMesh;
|
|
11574
11601
|
t.transparent = !0, t.depthWrite = !1, t.polygonOffset = !0, t.polygonOffsetFactor = -4, this.add(this.decalMesh);
|
|
11575
11602
|
}
|
|
11603
|
+
params;
|
|
11576
11604
|
decalMesh = new le(void 0, new We());
|
|
11577
11605
|
textureAspect = new A(1, 1, 1);
|
|
11578
11606
|
async updateTexture(e) {
|
|
@@ -11786,6 +11814,8 @@ class Lf extends Ya {
|
|
|
11786
11814
|
constructor(e, t) {
|
|
11787
11815
|
super(), this.ssp = e, this.target = t;
|
|
11788
11816
|
}
|
|
11817
|
+
ssp;
|
|
11818
|
+
target;
|
|
11789
11819
|
/** 当前 in-flight 的 tween 集合,{@link stop} 时统一打断 */
|
|
11790
11820
|
tweenSet = /* @__PURE__ */ new Set();
|
|
11791
11821
|
/** 是否仍有 tween 在执行 */
|
|
@@ -11977,6 +12007,9 @@ class wt {
|
|
|
11977
12007
|
constructor(e, t, n) {
|
|
11978
12008
|
this.type = e, this.viewport = t, this.objectsCache = n, this.scene = t.scene;
|
|
11979
12009
|
}
|
|
12010
|
+
type;
|
|
12011
|
+
viewport;
|
|
12012
|
+
objectsCache;
|
|
11980
12013
|
scene;
|
|
11981
12014
|
/***
|
|
11982
12015
|
* group
|
|
@@ -12008,6 +12041,8 @@ class Ff extends wt {
|
|
|
12008
12041
|
constructor(e, t) {
|
|
12009
12042
|
super(rt.Light, e, t.classified.Light), this.viewport = e, this.cache = t, Sh.init();
|
|
12010
12043
|
}
|
|
12044
|
+
viewport;
|
|
12045
|
+
cache;
|
|
12011
12046
|
createAmbientLight(e) {
|
|
12012
12047
|
const {
|
|
12013
12048
|
id: t,
|
|
@@ -14415,6 +14450,8 @@ class ym extends wt {
|
|
|
14415
14450
|
constructor(e, t) {
|
|
14416
14451
|
super(rt.Model, e, t.classified.Model), this.viewport = e, this.cache = t, this.gltfLoader.setMeshoptDecoder(Dh), this._initLoadingManager(this.loadingManager);
|
|
14417
14452
|
}
|
|
14453
|
+
viewport;
|
|
14454
|
+
cache;
|
|
14418
14455
|
/**
|
|
14419
14456
|
* 场景是否卸载
|
|
14420
14457
|
*/
|
|
@@ -14658,6 +14695,8 @@ class vm extends wt {
|
|
|
14658
14695
|
constructor(e, t) {
|
|
14659
14696
|
super(rt.Poi, e, t.classified.Poi), this.viewport = e, this.cache = t;
|
|
14660
14697
|
}
|
|
14698
|
+
viewport;
|
|
14699
|
+
cache;
|
|
14661
14700
|
textures = /* @__PURE__ */ new Map();
|
|
14662
14701
|
dispose() {
|
|
14663
14702
|
this.textures.forEach((e) => e.dispose()), this.textures.clear();
|
|
@@ -14780,6 +14819,8 @@ class xm extends wt {
|
|
|
14780
14819
|
constructor(e, t) {
|
|
14781
14820
|
super(rt.PoiNode, e, t.classified.PoiNode), this.viewport = e, this.cache = t;
|
|
14782
14821
|
}
|
|
14822
|
+
viewport;
|
|
14823
|
+
cache;
|
|
14783
14824
|
create(e) {
|
|
14784
14825
|
this._openEnableRenderCss(e);
|
|
14785
14826
|
const t = new Xt(e);
|
|
@@ -14819,6 +14860,8 @@ class wm extends wt {
|
|
|
14819
14860
|
constructor(e, t) {
|
|
14820
14861
|
super(rt.Canvas3D, e, t.classified.Canvas3D), this.viewport = e, this.cache = t;
|
|
14821
14862
|
}
|
|
14863
|
+
viewport;
|
|
14864
|
+
cache;
|
|
14822
14865
|
create(e, t) {
|
|
14823
14866
|
const n = new bs(e);
|
|
14824
14867
|
return t !== null && this.viewport.scener.addObject(n, t), n;
|
|
@@ -14923,6 +14966,7 @@ class Sm {
|
|
|
14923
14966
|
constructor(e) {
|
|
14924
14967
|
this.dijkstra = e, this.workerPool.setWorkerCreator(() => new Mm());
|
|
14925
14968
|
}
|
|
14969
|
+
dijkstra;
|
|
14926
14970
|
workerPool = new ro(4);
|
|
14927
14971
|
_mainThreadGraph = [];
|
|
14928
14972
|
_needsUpdateGraph = !1;
|
|
@@ -14939,6 +14983,8 @@ class Tm extends wt {
|
|
|
14939
14983
|
constructor(e, t) {
|
|
14940
14984
|
super(rt.Topology, e, t.classified.Topology), this.viewport = e, this.cache = t;
|
|
14941
14985
|
}
|
|
14986
|
+
viewport;
|
|
14987
|
+
cache;
|
|
14942
14988
|
dijkstra = new bm();
|
|
14943
14989
|
dijkstraWorker = new Sm(this.dijkstra);
|
|
14944
14990
|
async createFromGml(e) {
|
|
@@ -15301,6 +15347,8 @@ class Im extends wt {
|
|
|
15301
15347
|
constructor(e, t) {
|
|
15302
15348
|
super(rt.Helper, e, t.classified.Helper), this.viewport = e, this.cache = t;
|
|
15303
15349
|
}
|
|
15350
|
+
viewport;
|
|
15351
|
+
cache;
|
|
15304
15352
|
addGridHelper(e) {
|
|
15305
15353
|
const {
|
|
15306
15354
|
id: t,
|
|
@@ -15405,6 +15453,8 @@ class Cm extends wt {
|
|
|
15405
15453
|
constructor(e, t) {
|
|
15406
15454
|
super(rt.PluginObject, e, t.classified.PluginObject), this.viewport = e, this.cache = t;
|
|
15407
15455
|
}
|
|
15456
|
+
viewport;
|
|
15457
|
+
cache;
|
|
15408
15458
|
createObject(e, t) {
|
|
15409
15459
|
const n = new $o(e);
|
|
15410
15460
|
return t && n.add(t), this.viewport.scener.addObject(n, this.scene), n;
|
|
@@ -15417,12 +15467,16 @@ class Pm extends wt {
|
|
|
15417
15467
|
constructor(e, t) {
|
|
15418
15468
|
super(rt.Group, e, t.classified.Group), this.viewport = e, this.cache = t;
|
|
15419
15469
|
}
|
|
15470
|
+
viewport;
|
|
15471
|
+
cache;
|
|
15420
15472
|
}
|
|
15421
15473
|
const ys = new qn();
|
|
15422
15474
|
class Am extends wt {
|
|
15423
15475
|
constructor(e, t) {
|
|
15424
15476
|
super(rt.Decal, e, t.classified.Decal), this.viewport = e, this.cache = t;
|
|
15425
15477
|
}
|
|
15478
|
+
viewport;
|
|
15479
|
+
cache;
|
|
15426
15480
|
/**
|
|
15427
15481
|
* 创建贴花
|
|
15428
15482
|
*/
|
package/package.json
CHANGED
|
@@ -48,6 +48,7 @@ declare class AutoInstancingManager {
|
|
|
48
48
|
readonly proxyRoot: ThreeGroup<import('three').Object3DEventMap>;
|
|
49
49
|
private roots;
|
|
50
50
|
private pendingRoots;
|
|
51
|
+
private pendingRootSyncRequested;
|
|
51
52
|
private sourceToProxy;
|
|
52
53
|
private sourceBindings;
|
|
53
54
|
private proxyBindings;
|