soonspacejs 2.16.2 → 2.16.3
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 +54 -1
- package/package.json +1 -1
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.3", 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 = `${p - 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
|
I.material.map?.dispose(), A.material.map?.dispose(), O.material.map?.dispose(), I.material.dispose(), A.material.dispose(), O.material.dispose(), I.material = Q(s, l.labelX), A.material = Q(r, l.labelY), O.material = Q(a, l.labelZ);
|
|
7600
7615
|
}
|
|
7601
7616
|
}
|
|
7617
|
+
camera;
|
|
7618
|
+
controls;
|
|
7602
7619
|
setLabels;
|
|
7603
7620
|
setLabelStyle;
|
|
7604
7621
|
render;
|
|
@@ -8410,6 +8427,7 @@ class Hp {
|
|
|
8410
8427
|
constructor(e) {
|
|
8411
8428
|
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);
|
|
8412
8429
|
}
|
|
8430
|
+
viewport;
|
|
8413
8431
|
proxyRoot = new gn();
|
|
8414
8432
|
roots = /* @__PURE__ */ new Map();
|
|
8415
8433
|
pendingRoots = /* @__PURE__ */ new Map();
|
|
@@ -9112,6 +9130,9 @@ class qp {
|
|
|
9112
9130
|
isDisposed: !1
|
|
9113
9131
|
}, 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);
|
|
9114
9132
|
}
|
|
9133
|
+
options;
|
|
9134
|
+
signals;
|
|
9135
|
+
cache;
|
|
9115
9136
|
clock = new Dc();
|
|
9116
9137
|
raycaster = new qn();
|
|
9117
9138
|
scene;
|
|
@@ -9706,6 +9727,7 @@ class Pi extends je {
|
|
|
9706
9727
|
} = e ?? {};
|
|
9707
9728
|
super(e), this.params = e, this.updateGeometry(t), this.updateMaterialOpacity(s), this.updateMaterial(n, r), this.stype = "Point";
|
|
9708
9729
|
}
|
|
9730
|
+
params;
|
|
9709
9731
|
updateGeometry(e) {
|
|
9710
9732
|
this.geometry.dispose(), this.geometry = new Fi(e);
|
|
9711
9733
|
}
|
|
@@ -9730,6 +9752,7 @@ class Ai extends je {
|
|
|
9730
9752
|
} = e ?? {};
|
|
9731
9753
|
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);
|
|
9732
9754
|
}
|
|
9755
|
+
params;
|
|
9733
9756
|
updateGeometry(e) {
|
|
9734
9757
|
this.geometry.dispose(), this.geometry = new Uc(e);
|
|
9735
9758
|
}
|
|
@@ -9758,6 +9781,7 @@ class tl extends je {
|
|
|
9758
9781
|
this.geometry.dispose(), this.material.dispose(), l?.dispose();
|
|
9759
9782
|
});
|
|
9760
9783
|
}
|
|
9784
|
+
params;
|
|
9761
9785
|
passable = 0;
|
|
9762
9786
|
updateGeometry(e) {
|
|
9763
9787
|
this.params && Object.assign(this.params, e), this.computeVertex();
|
|
@@ -10011,6 +10035,7 @@ class nl extends je {
|
|
|
10011
10035
|
} = e ?? {};
|
|
10012
10036
|
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";
|
|
10013
10037
|
}
|
|
10038
|
+
params;
|
|
10014
10039
|
updateGeometry(e, t) {
|
|
10015
10040
|
if (e.length < 2) return;
|
|
10016
10041
|
const n = t / 2;
|
|
@@ -10080,6 +10105,7 @@ class sl extends je {
|
|
|
10080
10105
|
} = e ?? {};
|
|
10081
10106
|
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);
|
|
10082
10107
|
}
|
|
10108
|
+
params;
|
|
10083
10109
|
updateGeometry(e, t) {
|
|
10084
10110
|
this.geometry.dispose();
|
|
10085
10111
|
const n = [];
|
|
@@ -11531,6 +11557,7 @@ class Hr extends Ae {
|
|
|
11531
11557
|
const { material: t } = this.decalMesh;
|
|
11532
11558
|
t.transparent = !0, t.depthWrite = !1, t.polygonOffset = !0, t.polygonOffsetFactor = -4, this.add(this.decalMesh);
|
|
11533
11559
|
}
|
|
11560
|
+
params;
|
|
11534
11561
|
decalMesh = new le(void 0, new We());
|
|
11535
11562
|
textureAspect = new P(1, 1, 1);
|
|
11536
11563
|
async updateTexture(e) {
|
|
@@ -11744,6 +11771,8 @@ class Lf extends Ya {
|
|
|
11744
11771
|
constructor(e, t) {
|
|
11745
11772
|
super(), this.ssp = e, this.target = t;
|
|
11746
11773
|
}
|
|
11774
|
+
ssp;
|
|
11775
|
+
target;
|
|
11747
11776
|
/** 当前 in-flight 的 tween 集合,{@link stop} 时统一打断 */
|
|
11748
11777
|
tweenSet = /* @__PURE__ */ new Set();
|
|
11749
11778
|
/** 是否仍有 tween 在执行 */
|
|
@@ -11935,6 +11964,9 @@ class wt {
|
|
|
11935
11964
|
constructor(e, t, n) {
|
|
11936
11965
|
this.type = e, this.viewport = t, this.objectsCache = n, this.scene = t.scene;
|
|
11937
11966
|
}
|
|
11967
|
+
type;
|
|
11968
|
+
viewport;
|
|
11969
|
+
objectsCache;
|
|
11938
11970
|
scene;
|
|
11939
11971
|
/***
|
|
11940
11972
|
* group
|
|
@@ -11966,6 +11998,8 @@ class Ff extends wt {
|
|
|
11966
11998
|
constructor(e, t) {
|
|
11967
11999
|
super(rt.Light, e, t.classified.Light), this.viewport = e, this.cache = t, Sh.init();
|
|
11968
12000
|
}
|
|
12001
|
+
viewport;
|
|
12002
|
+
cache;
|
|
11969
12003
|
createAmbientLight(e) {
|
|
11970
12004
|
const {
|
|
11971
12005
|
id: t,
|
|
@@ -14373,6 +14407,8 @@ class ym extends wt {
|
|
|
14373
14407
|
constructor(e, t) {
|
|
14374
14408
|
super(rt.Model, e, t.classified.Model), this.viewport = e, this.cache = t, this.gltfLoader.setMeshoptDecoder(Dh), this._initLoadingManager(this.loadingManager);
|
|
14375
14409
|
}
|
|
14410
|
+
viewport;
|
|
14411
|
+
cache;
|
|
14376
14412
|
/**
|
|
14377
14413
|
* 场景是否卸载
|
|
14378
14414
|
*/
|
|
@@ -14616,6 +14652,8 @@ class vm extends wt {
|
|
|
14616
14652
|
constructor(e, t) {
|
|
14617
14653
|
super(rt.Poi, e, t.classified.Poi), this.viewport = e, this.cache = t;
|
|
14618
14654
|
}
|
|
14655
|
+
viewport;
|
|
14656
|
+
cache;
|
|
14619
14657
|
textures = /* @__PURE__ */ new Map();
|
|
14620
14658
|
dispose() {
|
|
14621
14659
|
this.textures.forEach((e) => e.dispose()), this.textures.clear();
|
|
@@ -14738,6 +14776,8 @@ class xm extends wt {
|
|
|
14738
14776
|
constructor(e, t) {
|
|
14739
14777
|
super(rt.PoiNode, e, t.classified.PoiNode), this.viewport = e, this.cache = t;
|
|
14740
14778
|
}
|
|
14779
|
+
viewport;
|
|
14780
|
+
cache;
|
|
14741
14781
|
create(e) {
|
|
14742
14782
|
this._openEnableRenderCss(e);
|
|
14743
14783
|
const t = new Xt(e);
|
|
@@ -14777,6 +14817,8 @@ class wm extends wt {
|
|
|
14777
14817
|
constructor(e, t) {
|
|
14778
14818
|
super(rt.Canvas3D, e, t.classified.Canvas3D), this.viewport = e, this.cache = t;
|
|
14779
14819
|
}
|
|
14820
|
+
viewport;
|
|
14821
|
+
cache;
|
|
14780
14822
|
create(e, t) {
|
|
14781
14823
|
const n = new bs(e);
|
|
14782
14824
|
return t !== null && this.viewport.scener.addObject(n, t), n;
|
|
@@ -14881,6 +14923,7 @@ class Sm {
|
|
|
14881
14923
|
constructor(e) {
|
|
14882
14924
|
this.dijkstra = e, this.workerPool.setWorkerCreator(() => new Mm());
|
|
14883
14925
|
}
|
|
14926
|
+
dijkstra;
|
|
14884
14927
|
workerPool = new ro(4);
|
|
14885
14928
|
_mainThreadGraph = [];
|
|
14886
14929
|
_needsUpdateGraph = !1;
|
|
@@ -14897,6 +14940,8 @@ class Tm extends wt {
|
|
|
14897
14940
|
constructor(e, t) {
|
|
14898
14941
|
super(rt.Topology, e, t.classified.Topology), this.viewport = e, this.cache = t;
|
|
14899
14942
|
}
|
|
14943
|
+
viewport;
|
|
14944
|
+
cache;
|
|
14900
14945
|
dijkstra = new bm();
|
|
14901
14946
|
dijkstraWorker = new Sm(this.dijkstra);
|
|
14902
14947
|
async createFromGml(e) {
|
|
@@ -15259,6 +15304,8 @@ class Cm extends wt {
|
|
|
15259
15304
|
constructor(e, t) {
|
|
15260
15305
|
super(rt.Helper, e, t.classified.Helper), this.viewport = e, this.cache = t;
|
|
15261
15306
|
}
|
|
15307
|
+
viewport;
|
|
15308
|
+
cache;
|
|
15262
15309
|
addGridHelper(e) {
|
|
15263
15310
|
const {
|
|
15264
15311
|
id: t,
|
|
@@ -15363,6 +15410,8 @@ class Im extends wt {
|
|
|
15363
15410
|
constructor(e, t) {
|
|
15364
15411
|
super(rt.PluginObject, e, t.classified.PluginObject), this.viewport = e, this.cache = t;
|
|
15365
15412
|
}
|
|
15413
|
+
viewport;
|
|
15414
|
+
cache;
|
|
15366
15415
|
createObject(e, t) {
|
|
15367
15416
|
const n = new $o(e);
|
|
15368
15417
|
return t && n.add(t), this.viewport.scener.addObject(n, this.scene), n;
|
|
@@ -15375,12 +15424,16 @@ class Pm extends wt {
|
|
|
15375
15424
|
constructor(e, t) {
|
|
15376
15425
|
super(rt.Group, e, t.classified.Group), this.viewport = e, this.cache = t;
|
|
15377
15426
|
}
|
|
15427
|
+
viewport;
|
|
15428
|
+
cache;
|
|
15378
15429
|
}
|
|
15379
15430
|
const ys = new qn();
|
|
15380
15431
|
class Am extends wt {
|
|
15381
15432
|
constructor(e, t) {
|
|
15382
15433
|
super(rt.Decal, e, t.classified.Decal), this.viewport = e, this.cache = t;
|
|
15383
15434
|
}
|
|
15435
|
+
viewport;
|
|
15436
|
+
cache;
|
|
15384
15437
|
/**
|
|
15385
15438
|
* 创建贴花
|
|
15386
15439
|
*/
|