@threepipe/plugin-3d-tiles-renderer 0.3.1 → 0.3.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/CHANGELOG.md +12 -3
- package/README.md +1 -1
- package/dist/B3DMLoadPlugin.d.ts +3 -2
- package/dist/B3DMLoadPlugin.d.ts.map +1 -1
- package/dist/CMPTLoadPlugin.d.ts +2 -1
- package/dist/CMPTLoadPlugin.d.ts.map +1 -1
- package/dist/DeepZoomImageLoadPlugin.d.ts +2 -2
- package/dist/DeepZoomImageLoadPlugin.d.ts.map +1 -1
- package/dist/I3DMLoadPlugin.d.ts +2 -1
- package/dist/I3DMLoadPlugin.d.ts.map +1 -1
- package/dist/PNTSLoadPlugin.d.ts +2 -1
- package/dist/PNTSLoadPlugin.d.ts.map +1 -1
- package/dist/SlippyMapTilesLoadPlugin.d.ts +2 -2
- package/dist/SlippyMapTilesLoadPlugin.d.ts.map +1 -1
- package/dist/dependencies.txt +1 -1
- package/dist/index.d.ts +9 -9
- package/dist/index.js +57 -86
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +54 -83
- package/dist/index.mjs.map +1 -1
- package/docs/assets/icons.js +1 -1
- package/docs/assets/icons.svg +1 -1
- package/docs/assets/main.js +2 -2
- package/docs/assets/search.js +1 -1
- package/docs/assets/style.css +3 -3
- package/docs/classes/B3DMLoadPlugin.html +2 -2
- package/docs/classes/CMPTLoadPlugin.html +2 -2
- package/docs/classes/DeepZoomImageLoadPlugin.html +2 -2
- package/docs/classes/EnvironmentControls2.html +2 -2
- package/docs/classes/EnvironmentControlsPlugin.html +4 -3
- package/docs/classes/GlobeControls2.html +2 -2
- package/docs/classes/GlobeControlsPlugin.html +4 -3
- package/docs/classes/I3DMLoadPlugin.html +2 -2
- package/docs/classes/PNTSLoadPlugin.html +2 -2
- package/docs/classes/SlippyMapTilesLoadPlugin.html +2 -2
- package/docs/classes/TilesRendererLoader.html +2 -2
- package/docs/classes/TilesRendererPlugin.html +3 -2
- package/docs/index.html +1 -1
- package/docs/interfaces/TilesImportOptions.html +3 -3
- package/docs/types/TilesRendererGroup.html +1 -1
- package/package.json +10 -3
- package/src/B3DMLoadPlugin.ts +4 -2
- package/src/CMPTLoadPlugin.ts +3 -1
- package/src/DeepZoomImageLoadPlugin.ts +1 -1
- package/src/I3DMLoadPlugin.ts +3 -1
- package/src/PNTSLoadPlugin.ts +3 -1
- package/src/SlippyMapTilesLoadPlugin.ts +1 -1
- package/src/TilesRendererPlugin.ts +1 -1
- package/tsconfig.json +42 -0
- package/docs/.nojekyll +0 -1
package/dist/index.mjs
CHANGED
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* @threepipe/plugin-3d-tiles-renderer v0.3.1
|
|
4
|
-
* Copyright 2022-2025 repalash <palash@shaders.app>
|
|
5
|
-
* Apache-2.0 License
|
|
6
|
-
* See ./dependencies.txt for any bundled third-party dependencies and licenses.
|
|
7
|
-
*/
|
|
8
1
|
import * as THREE from "threepipe";
|
|
9
2
|
import { DefaultLoadingManager, Matrix4, GLTFLoader, Vector3, Vector2, MathUtils, PointsMaterial, BufferGeometry, BufferAttribute, Color, Points, Spherical, Sphere, Ray, Euler, InstancedMesh, Quaternion, Group, Box3, Plane, Frustum, Matrix3, estimateBytesUsed as estimateBytesUsed$1, LoadingManager, EventDispatcher, Mesh, PlaneGeometry, ShaderMaterial, Raycaster, Clock, Texture, SRGBColorSpace, MeshBasicMaterial, MeshStandardMaterial, DataTexture, RGFormat, UnsignedByteType, LinearMipMapLinearFilter, LinearFilter, Triangle, Matrix2, Vector4, WebGLRenderer, WebGLRenderTarget, FullScreenQuad, OneFactor, ZeroFactor, CustomBlending, Box2, FileLoader, LineSegments, LineBasicMaterial, EdgesGeometry, BoxGeometry, Box3Helper, uiButton, uiFolderContainer, AViewerPluginSync, Importer, generateUUID, DropzonePlugin, Loader, iObjectCommons, Box3B, BaseImporterPlugin, GLTFLoader2, LoaderUtils, ACameraControlsPlugin, uiToggle, serialize, uiInput, uiVector } from "threepipe";
|
|
10
3
|
function getUrlExtension(url) {
|
|
@@ -614,7 +607,7 @@ function throttle(callback) {
|
|
|
614
607
|
}
|
|
615
608
|
};
|
|
616
609
|
}
|
|
617
|
-
const PLUGIN_REGISTERED = Symbol("PLUGIN_REGISTERED");
|
|
610
|
+
const PLUGIN_REGISTERED = /* @__PURE__ */ Symbol("PLUGIN_REGISTERED");
|
|
618
611
|
const priorityCallback = (a, b) => {
|
|
619
612
|
if (a.__depthFromRenderedParent !== b.__depthFromRenderedParent) {
|
|
620
613
|
return a.__depthFromRenderedParent > b.__depthFromRenderedParent ? -1 : 1;
|
|
@@ -880,7 +873,6 @@ class TilesRendererBase {
|
|
|
880
873
|
}
|
|
881
874
|
}
|
|
882
875
|
preprocessNode(tile, tileSetDir, parentTile = null) {
|
|
883
|
-
var _a;
|
|
884
876
|
if (tile.content) {
|
|
885
877
|
if (!("uri" in tile.content) && "url" in tile.content) {
|
|
886
878
|
tile.content.uri = tile.content.url;
|
|
@@ -892,7 +884,7 @@ class TilesRendererBase {
|
|
|
892
884
|
}
|
|
893
885
|
tile.parent = parentTile;
|
|
894
886
|
tile.children = tile.children || [];
|
|
895
|
-
if (
|
|
887
|
+
if (tile.content?.uri) {
|
|
896
888
|
const extension = getUrlExtension(tile.content.uri);
|
|
897
889
|
tile.__hasContent = true;
|
|
898
890
|
tile.__hasUnrenderableContent = Boolean(extension && /json$/.test(extension));
|
|
@@ -2898,7 +2890,7 @@ function estimateBytesUsed(object) {
|
|
|
2898
2890
|
}
|
|
2899
2891
|
const _mat = new Matrix4();
|
|
2900
2892
|
const _euler = new Euler();
|
|
2901
|
-
const INITIAL_FRUSTUM_CULLED = Symbol("INITIAL_FRUSTUM_CULLED");
|
|
2893
|
+
const INITIAL_FRUSTUM_CULLED = /* @__PURE__ */ Symbol("INITIAL_FRUSTUM_CULLED");
|
|
2902
2894
|
const tempMat = new Matrix4();
|
|
2903
2895
|
const tempVector = new Vector3();
|
|
2904
2896
|
const tempVector2 = new Vector2();
|
|
@@ -5173,10 +5165,10 @@ class GoogleCloudAuthPlugin {
|
|
|
5173
5165
|
return this._tokenRefreshPromise;
|
|
5174
5166
|
}
|
|
5175
5167
|
}
|
|
5176
|
-
const TILE_X$1 = Symbol("TILE_X");
|
|
5177
|
-
const TILE_Y$1 = Symbol("TILE_Y");
|
|
5178
|
-
const TILE_LEVEL$1 = Symbol("TILE_LEVEL");
|
|
5179
|
-
const UV_BOUNDS = Symbol("UV_BOUNDS");
|
|
5168
|
+
const TILE_X$1 = /* @__PURE__ */ Symbol("TILE_X");
|
|
5169
|
+
const TILE_Y$1 = /* @__PURE__ */ Symbol("TILE_Y");
|
|
5170
|
+
const TILE_LEVEL$1 = /* @__PURE__ */ Symbol("TILE_LEVEL");
|
|
5171
|
+
const UV_BOUNDS = /* @__PURE__ */ Symbol("UV_BOUNDS");
|
|
5180
5172
|
class ImageFormatPlugin {
|
|
5181
5173
|
get maxLevel() {
|
|
5182
5174
|
return this.levels - 1;
|
|
@@ -6074,9 +6066,9 @@ class QuantizedMeshLoader extends QuantizedMeshLoaderBase {
|
|
|
6074
6066
|
}
|
|
6075
6067
|
}
|
|
6076
6068
|
}
|
|
6077
|
-
const TILE_X = Symbol("TILE_X");
|
|
6078
|
-
const TILE_Y = Symbol("TILE_Y");
|
|
6079
|
-
const TILE_LEVEL = Symbol("TILE_LEVEL");
|
|
6069
|
+
const TILE_X = /* @__PURE__ */ Symbol("TILE_X");
|
|
6070
|
+
const TILE_Y = /* @__PURE__ */ Symbol("TILE_Y");
|
|
6071
|
+
const TILE_LEVEL = /* @__PURE__ */ Symbol("TILE_LEVEL");
|
|
6080
6072
|
const INITIAL_HEIGHT_RANGE = 1e5;
|
|
6081
6073
|
const _vec$1 = /* @__PURE__ */ new Vector3();
|
|
6082
6074
|
function isAvailable(layer, level, x, y) {
|
|
@@ -7040,7 +7032,7 @@ class PropertySetAccessor {
|
|
|
7040
7032
|
class PropertyAttributeClassProperty extends ClassProperty {
|
|
7041
7033
|
constructor(enums, classProperty, attributeProperty = null) {
|
|
7042
7034
|
super(enums, classProperty, attributeProperty);
|
|
7043
|
-
this.attribute =
|
|
7035
|
+
this.attribute = attributeProperty?.attribute ?? null;
|
|
7044
7036
|
}
|
|
7045
7037
|
}
|
|
7046
7038
|
class PropertyAttributeAccessor extends PropertySetAccessor {
|
|
@@ -7091,7 +7083,7 @@ class PropertyAttributeAccessor extends PropertySetAccessor {
|
|
|
7091
7083
|
class PropertyTableClassProperty extends ClassProperty {
|
|
7092
7084
|
constructor(enums, classProperty, tableProperty = null) {
|
|
7093
7085
|
super(enums, classProperty, tableProperty);
|
|
7094
|
-
this.values =
|
|
7086
|
+
this.values = tableProperty?.values ?? null;
|
|
7095
7087
|
this.valueLength = typeToComponentCount(this.type);
|
|
7096
7088
|
this.arrayOffsets = getField(tableProperty, "arrayOffsets", null);
|
|
7097
7089
|
this.stringOffsets = getField(tableProperty, "stringOffsets", null);
|
|
@@ -7565,8 +7557,7 @@ class StructuralMetadata {
|
|
|
7565
7557
|
}
|
|
7566
7558
|
const EXT_NAME$1 = "EXT_structural_metadata";
|
|
7567
7559
|
function getRelevantTextures(parser, propertyTextures = []) {
|
|
7568
|
-
|
|
7569
|
-
const textureCount = ((_a = parser.json.textures) == null ? void 0 : _a.length) || 0;
|
|
7560
|
+
const textureCount = parser.json.textures?.length || 0;
|
|
7570
7561
|
const result = new Array(textureCount).fill(null);
|
|
7571
7562
|
propertyTextures.forEach(({ properties }) => {
|
|
7572
7563
|
for (const key in properties) {
|
|
@@ -7579,8 +7570,7 @@ function getRelevantTextures(parser, propertyTextures = []) {
|
|
|
7579
7570
|
return Promise.all(result);
|
|
7580
7571
|
}
|
|
7581
7572
|
function getRelevantBuffers(parser, propertyTables = []) {
|
|
7582
|
-
|
|
7583
|
-
const textureCount = ((_a = parser.json.bufferViews) == null ? void 0 : _a.length) || 0;
|
|
7573
|
+
const textureCount = parser.json.bufferViews?.length || 0;
|
|
7584
7574
|
const result = new Array(textureCount).fill(null);
|
|
7585
7575
|
propertyTables.forEach(({ properties }) => {
|
|
7586
7576
|
for (const key in properties) {
|
|
@@ -7629,10 +7619,9 @@ class GLTFStructuralMetadataExtension {
|
|
|
7629
7619
|
const rootMetadata = new StructuralMetadata(rootExtension, textures, buffers);
|
|
7630
7620
|
scene.userData.structuralMetadata = rootMetadata;
|
|
7631
7621
|
scene.traverse((child) => {
|
|
7632
|
-
var _a;
|
|
7633
7622
|
if (parser.associations.has(child)) {
|
|
7634
7623
|
const { meshes, primitives } = parser.associations.get(child);
|
|
7635
|
-
const primitive =
|
|
7624
|
+
const primitive = parser.json.meshes[meshes]?.primitives[primitives];
|
|
7636
7625
|
if (primitive && primitive.extensions && primitive.extensions[EXT_NAME$1]) {
|
|
7637
7626
|
const extension = primitive.extensions[EXT_NAME$1];
|
|
7638
7627
|
child.userData.structuralMetadata = new StructuralMetadata(rootExtension, textures, buffers, extension, child);
|
|
@@ -7767,10 +7756,9 @@ class MeshFeatures {
|
|
|
7767
7756
|
const EXT_NAME = "EXT_mesh_features";
|
|
7768
7757
|
function forEachPrimitiveExtension(scene, parser, callback) {
|
|
7769
7758
|
scene.traverse((c) => {
|
|
7770
|
-
var _a;
|
|
7771
7759
|
if (parser.associations.has(c)) {
|
|
7772
7760
|
const { meshes, primitives } = parser.associations.get(c);
|
|
7773
|
-
const primitive =
|
|
7761
|
+
const primitive = parser.json.meshes[meshes]?.primitives[primitives];
|
|
7774
7762
|
if (primitive && primitive.extensions && primitive.extensions[EXT_NAME]) {
|
|
7775
7763
|
callback(c, primitive.extensions[EXT_NAME]);
|
|
7776
7764
|
}
|
|
@@ -7783,12 +7771,11 @@ class GLTFMeshFeaturesExtension {
|
|
|
7783
7771
|
this.name = EXT_NAME;
|
|
7784
7772
|
}
|
|
7785
7773
|
async afterRoot({ scene, parser }) {
|
|
7786
|
-
var _a;
|
|
7787
7774
|
const extensionsUsed = parser.json.extensionsUsed;
|
|
7788
7775
|
if (!extensionsUsed || !extensionsUsed.includes(EXT_NAME)) {
|
|
7789
7776
|
return;
|
|
7790
7777
|
}
|
|
7791
|
-
const textureCount =
|
|
7778
|
+
const textureCount = parser.json.textures?.length || 0;
|
|
7792
7779
|
const promises = new Array(textureCount).fill(null);
|
|
7793
7780
|
forEachPrimitiveExtension(scene, parser, (child, { featureIds }) => {
|
|
7794
7781
|
featureIds.forEach((info) => {
|
|
@@ -8480,7 +8467,7 @@ class InstanceDataTexture extends DataTexture {
|
|
|
8480
8467
|
}
|
|
8481
8468
|
}
|
|
8482
8469
|
}
|
|
8483
|
-
const HAS_POPPED_IN = Symbol("HAS_POPPED_IN");
|
|
8470
|
+
const HAS_POPPED_IN = /* @__PURE__ */ Symbol("HAS_POPPED_IN");
|
|
8484
8471
|
const _fromPos = new Vector3();
|
|
8485
8472
|
const _toPos = new Vector3();
|
|
8486
8473
|
const _fromQuat = new Quaternion();
|
|
@@ -8663,8 +8650,7 @@ class TilesFadePlugin {
|
|
|
8663
8650
|
}
|
|
8664
8651
|
// initializes the batched mesh if it needs to be, dispose if it it's no longer needed
|
|
8665
8652
|
initBatchedMesh() {
|
|
8666
|
-
|
|
8667
|
-
const otherBatchedMesh = (_a = this.tiles.getPluginByName("BATCHED_TILES_PLUGIN")) == null ? void 0 : _a.batchedMesh;
|
|
8653
|
+
const otherBatchedMesh = this.tiles.getPluginByName("BATCHED_TILES_PLUGIN")?.batchedMesh;
|
|
8668
8654
|
if (otherBatchedMesh) {
|
|
8669
8655
|
if (this.batchedMesh === null) {
|
|
8670
8656
|
this._onBatchedMeshDispose = () => {
|
|
@@ -8893,11 +8879,11 @@ class EllipsoidRegionLineHelper extends LineSegments {
|
|
|
8893
8879
|
this.material.dispose();
|
|
8894
8880
|
}
|
|
8895
8881
|
}
|
|
8896
|
-
const ORIGINAL_MATERIAL = Symbol("ORIGINAL_MATERIAL");
|
|
8897
|
-
const HAS_RANDOM_COLOR = Symbol("HAS_RANDOM_COLOR");
|
|
8898
|
-
const HAS_RANDOM_NODE_COLOR = Symbol("HAS_RANDOM_NODE_COLOR");
|
|
8899
|
-
const LOAD_TIME = Symbol("LOAD_TIME");
|
|
8900
|
-
const PARENT_BOUND_REF_COUNT = Symbol("PARENT_BOUND_REF_COUNT");
|
|
8882
|
+
const ORIGINAL_MATERIAL = /* @__PURE__ */ Symbol("ORIGINAL_MATERIAL");
|
|
8883
|
+
const HAS_RANDOM_COLOR = /* @__PURE__ */ Symbol("HAS_RANDOM_COLOR");
|
|
8884
|
+
const HAS_RANDOM_NODE_COLOR = /* @__PURE__ */ Symbol("HAS_RANDOM_NODE_COLOR");
|
|
8885
|
+
const LOAD_TIME = /* @__PURE__ */ Symbol("LOAD_TIME");
|
|
8886
|
+
const PARENT_BOUND_REF_COUNT = /* @__PURE__ */ Symbol("PARENT_BOUND_REF_COUNT");
|
|
8901
8887
|
const _sphere = /* @__PURE__ */ new Sphere();
|
|
8902
8888
|
const emptyRaycast = () => {
|
|
8903
8889
|
};
|
|
@@ -9377,7 +9363,6 @@ class DebugTilesPlugin {
|
|
|
9377
9363
|
}
|
|
9378
9364
|
}
|
|
9379
9365
|
dispose() {
|
|
9380
|
-
var _a, _b, _c;
|
|
9381
9366
|
const tiles = this.tiles;
|
|
9382
9367
|
if (tiles) {
|
|
9383
9368
|
tiles.removeEventListener("load-tile-set", this._onLoadTileSetCB);
|
|
@@ -9391,9 +9376,9 @@ class DebugTilesPlugin {
|
|
|
9391
9376
|
this._onDisposeModel(tile);
|
|
9392
9377
|
});
|
|
9393
9378
|
}
|
|
9394
|
-
|
|
9395
|
-
|
|
9396
|
-
|
|
9379
|
+
this.boxGroup?.removeFromParent();
|
|
9380
|
+
this.sphereGroup?.removeFromParent();
|
|
9381
|
+
this.regionGroup?.removeFromParent();
|
|
9397
9382
|
}
|
|
9398
9383
|
}
|
|
9399
9384
|
class DeepZoomImagePlugin extends ImageFormatPlugin {
|
|
@@ -10041,7 +10026,6 @@ class ImplicitTilingPlugin {
|
|
|
10041
10026
|
this.tiles = tiles;
|
|
10042
10027
|
}
|
|
10043
10028
|
preprocessNode(tile, tileSetDir, parentTile) {
|
|
10044
|
-
var _a;
|
|
10045
10029
|
if (tile.implicitTiling) {
|
|
10046
10030
|
tile.__hasUnrenderableContent = true;
|
|
10047
10031
|
tile.__hasRenderableContent = false;
|
|
@@ -10051,7 +10035,7 @@ class ImplicitTilingPlugin {
|
|
|
10051
10035
|
tile.__y = 0;
|
|
10052
10036
|
tile.__z = 0;
|
|
10053
10037
|
tile.__level = 0;
|
|
10054
|
-
} else if (/.subtree$/i.test(
|
|
10038
|
+
} else if (/.subtree$/i.test(tile.content?.uri)) {
|
|
10055
10039
|
tile.__hasUnrenderableContent = true;
|
|
10056
10040
|
tile.__hasRenderableContent = false;
|
|
10057
10041
|
}
|
|
@@ -10072,8 +10056,7 @@ class ImplicitTilingPlugin {
|
|
|
10072
10056
|
return url;
|
|
10073
10057
|
}
|
|
10074
10058
|
disposeTile(tile) {
|
|
10075
|
-
|
|
10076
|
-
if (/.subtree$/i.test((_a = tile.content) == null ? void 0 : _a.uri)) {
|
|
10059
|
+
if (/.subtree$/i.test(tile.content?.uri)) {
|
|
10077
10060
|
tile.children.length = 0;
|
|
10078
10061
|
tile.__childrenProcessed = 0;
|
|
10079
10062
|
}
|
|
@@ -10127,8 +10110,7 @@ let TilesRendererPlugin = class extends AViewerPluginSync {
|
|
|
10127
10110
|
this.objects = [];
|
|
10128
10111
|
this._importer = new Importer(TilesRendererLoader, [TilesRendererPlugin.DUMMY_EXT, TilesRendererPlugin.DUMMY_EXT + ".json"], [], false);
|
|
10129
10112
|
this._preRender = () => {
|
|
10130
|
-
|
|
10131
|
-
const camera = (_a = this._viewer) == null ? void 0 : _a.scene.renderCamera;
|
|
10113
|
+
const camera = this._viewer?.scene.renderCamera;
|
|
10132
10114
|
if (!this._viewer || !camera) return;
|
|
10133
10115
|
if (this._viewer.renderManager.frameCount > 0) return;
|
|
10134
10116
|
camera.updateProjectionMatrix();
|
|
@@ -10198,8 +10180,7 @@ let TilesRendererPlugin = class extends AViewerPluginSync {
|
|
|
10198
10180
|
fileExtension: TilesRendererPlugin.DUMMY_EXT,
|
|
10199
10181
|
fileHandler: importer
|
|
10200
10182
|
}).finally(() => {
|
|
10201
|
-
|
|
10202
|
-
(_a = this._viewer) == null ? void 0 : _a.assetManager.importer.unregisterFile(temp);
|
|
10183
|
+
this._viewer?.assetManager.importer.unregisterFile(temp);
|
|
10203
10184
|
});
|
|
10204
10185
|
}
|
|
10205
10186
|
async loadCesiumIon(info, options) {
|
|
@@ -10208,7 +10189,7 @@ let TilesRendererPlugin = class extends AViewerPluginSync {
|
|
|
10208
10189
|
...options,
|
|
10209
10190
|
tiles: {
|
|
10210
10191
|
CesiumIonAuthPlugin: info,
|
|
10211
|
-
...options
|
|
10192
|
+
...options?.tiles
|
|
10212
10193
|
}
|
|
10213
10194
|
});
|
|
10214
10195
|
}
|
|
@@ -10237,10 +10218,9 @@ let TilesRendererPlugin = class extends AViewerPluginSync {
|
|
|
10237
10218
|
super.onRemove(viewer);
|
|
10238
10219
|
}
|
|
10239
10220
|
async promptForURL() {
|
|
10240
|
-
|
|
10241
|
-
const url = await ((_a = this._viewer) == null ? void 0 : _a.dialog.prompt("TilesRendererPlugin: Enter URL for the root tileset", "", true));
|
|
10221
|
+
const url = await this._viewer?.dialog.prompt("TilesRendererPlugin: Enter URL for the root tileset", "", true);
|
|
10242
10222
|
if (!url) return;
|
|
10243
|
-
const loader =
|
|
10223
|
+
const loader = this._viewer?.getPlugin(DropzonePlugin) ?? this._viewer ?? this;
|
|
10244
10224
|
return await loader.load(url, { fileExtension: TilesRendererPlugin.DUMMY_EXT });
|
|
10245
10225
|
}
|
|
10246
10226
|
};
|
|
@@ -10258,9 +10238,9 @@ class TilesRendererLoader extends Loader {
|
|
|
10258
10238
|
this.isTilesRendererLoader = true;
|
|
10259
10239
|
this.plugins = [
|
|
10260
10240
|
() => new UpdateOnChangePlugin(),
|
|
10261
|
-
(opts) =>
|
|
10262
|
-
(opts) =>
|
|
10263
|
-
(opts) =>
|
|
10241
|
+
(opts) => opts?.ImplicitTilingPlugin !== false ? new ImplicitTilingPlugin() : void 0,
|
|
10242
|
+
(opts) => opts?.TilesFadePlugin !== false ? new TilesFadePlugin(typeof opts?.TilesFadePlugin === "object" ? opts.TilesFadePlugin : void 0) : void 0,
|
|
10243
|
+
(opts) => opts?.CesiumIonAuthPlugin ? new CesiumIonAuthPlugin(typeof opts?.CesiumIonAuthPlugin === "object" ? opts.CesiumIonAuthPlugin : void 0) : void 0
|
|
10264
10244
|
];
|
|
10265
10245
|
}
|
|
10266
10246
|
_createTilesRenderer(url) {
|
|
@@ -10272,11 +10252,10 @@ class TilesRendererLoader extends Loader {
|
|
|
10272
10252
|
return tiles;
|
|
10273
10253
|
}
|
|
10274
10254
|
load(url, onLoad, _onProgress, _onError) {
|
|
10275
|
-
var _a;
|
|
10276
10255
|
const tiles = this._createTilesRenderer(url);
|
|
10277
10256
|
const group = iObjectCommons.upgradeObject3D.call(tiles.group);
|
|
10278
10257
|
group.autoUpgradeChildren = false;
|
|
10279
|
-
const opts =
|
|
10258
|
+
const opts = this.importOptions?.tiles ?? {};
|
|
10280
10259
|
tiles.errorTarget = opts.errorTarget ?? 1;
|
|
10281
10260
|
const plugins = [...this.plugins, ...opts.plugins ?? []];
|
|
10282
10261
|
for (const plugin of plugins) {
|
|
@@ -10318,8 +10297,7 @@ class TilesRendererLoader extends Loader {
|
|
|
10318
10297
|
group._sChildren = [];
|
|
10319
10298
|
tiles.registerPlugin({
|
|
10320
10299
|
processTileModel: (model, tile) => {
|
|
10321
|
-
|
|
10322
|
-
if (tile === ((_a2 = tiles.rootTileSet) == null ? void 0 : _a2.root)) {
|
|
10300
|
+
if (tile === tiles.rootTileSet?.root) {
|
|
10323
10301
|
group._sChildren = [model];
|
|
10324
10302
|
}
|
|
10325
10303
|
}
|
|
@@ -10347,7 +10325,7 @@ class TilesRendererLoader extends Loader {
|
|
|
10347
10325
|
tiles.addEventListener("tile-visibility-change", (_e) => {
|
|
10348
10326
|
});
|
|
10349
10327
|
const setDirty = (_e) => {
|
|
10350
|
-
group.setDirty({ frameFade: false });
|
|
10328
|
+
group.setDirty && group.setDirty({ frameFade: false });
|
|
10351
10329
|
};
|
|
10352
10330
|
tiles.addEventListener("load-content", setDirty);
|
|
10353
10331
|
tiles.addEventListener("load-tile-set", setDirty);
|
|
@@ -10380,16 +10358,14 @@ class B3DMLoader2 extends GLTFLoader2 {
|
|
|
10380
10358
|
return super.transform(res, options);
|
|
10381
10359
|
}
|
|
10382
10360
|
parse(data, _path, onLoad, onError, _url) {
|
|
10383
|
-
var _a;
|
|
10384
10361
|
if (!this.ai) {
|
|
10385
10362
|
console.error("[B3DMLoader] load failed, IAssetImporter not set");
|
|
10386
10363
|
}
|
|
10387
10364
|
const tmpFile = generateUUID() + ".gltf";
|
|
10388
|
-
|
|
10365
|
+
this.ai?.registerFile(tmpFile);
|
|
10389
10366
|
this.loader.workingPath = _path;
|
|
10390
10367
|
this.loader.parse(data).then(onLoad).catch(onError).finally(() => {
|
|
10391
|
-
|
|
10392
|
-
if (tmpFile) (_a2 = this.ai) == null ? void 0 : _a2.unregisterFile(tmpFile);
|
|
10368
|
+
if (tmpFile) this.ai?.unregisterFile(tmpFile);
|
|
10393
10369
|
});
|
|
10394
10370
|
}
|
|
10395
10371
|
}
|
|
@@ -10417,16 +10393,14 @@ class I3DMLoader2 extends GLTFLoader2 {
|
|
|
10417
10393
|
return super.transform(res, options);
|
|
10418
10394
|
}
|
|
10419
10395
|
parse(data, _path, onLoad, onError, _url) {
|
|
10420
|
-
var _a;
|
|
10421
10396
|
if (!this.ai) {
|
|
10422
10397
|
console.error("[I3DMLoader] load failed, IAssetImporter not set");
|
|
10423
10398
|
}
|
|
10424
10399
|
const tmpFile = generateUUID() + ".gltf";
|
|
10425
|
-
|
|
10400
|
+
this.ai?.registerFile(tmpFile);
|
|
10426
10401
|
this.loader.workingPath = _path;
|
|
10427
10402
|
this.loader.parse(data).then(onLoad).catch(onError).finally(() => {
|
|
10428
|
-
|
|
10429
|
-
if (tmpFile) (_a2 = this.ai) == null ? void 0 : _a2.unregisterFile(tmpFile);
|
|
10403
|
+
if (tmpFile) this.ai?.unregisterFile(tmpFile);
|
|
10430
10404
|
});
|
|
10431
10405
|
}
|
|
10432
10406
|
}
|
|
@@ -10490,16 +10464,14 @@ class PNTSLoader2 extends Loader {
|
|
|
10490
10464
|
return res.scene;
|
|
10491
10465
|
}
|
|
10492
10466
|
parse(data, _path, onLoad, onError, _url) {
|
|
10493
|
-
var _a;
|
|
10494
10467
|
if (!this.ai) {
|
|
10495
10468
|
console.error("[PNTSLoader] load failed, IAssetImporter not set");
|
|
10496
10469
|
}
|
|
10497
10470
|
const tmpFile = generateUUID() + ".drc";
|
|
10498
|
-
|
|
10471
|
+
this.ai?.registerFile(tmpFile);
|
|
10499
10472
|
this.loader.workingPath = _path;
|
|
10500
10473
|
this.loader.parse(data).then(onLoad).catch(onError).finally(() => {
|
|
10501
|
-
|
|
10502
|
-
if (tmpFile) (_a2 = this.ai) == null ? void 0 : _a2.unregisterFile(tmpFile);
|
|
10474
|
+
if (tmpFile) this.ai?.unregisterFile(tmpFile);
|
|
10503
10475
|
});
|
|
10504
10476
|
}
|
|
10505
10477
|
}
|
|
@@ -10563,13 +10535,12 @@ class CMPTLoader2 extends Loader {
|
|
|
10563
10535
|
return res.scene;
|
|
10564
10536
|
}
|
|
10565
10537
|
parse(data, _path, onLoad, onError, _url) {
|
|
10566
|
-
var _a, _b;
|
|
10567
10538
|
if (!this.ai) {
|
|
10568
10539
|
console.error("[CMPTLoader] load failed, IAssetImporter not set");
|
|
10569
10540
|
}
|
|
10570
10541
|
const tmpFile = generateUUID();
|
|
10571
|
-
|
|
10572
|
-
|
|
10542
|
+
this.ai?.registerFile(tmpFile + ".gltf");
|
|
10543
|
+
this.ai?.registerFile(tmpFile + ".drc");
|
|
10573
10544
|
this.loader.workingPath = _path;
|
|
10574
10545
|
this.loader.parse(data).then(onLoad).catch(onError).finally(() => {
|
|
10575
10546
|
if (tmpFile && this.ai) {
|
|
@@ -10600,8 +10571,8 @@ class DeepZoomImageLoader extends TilesRendererLoader {
|
|
|
10600
10571
|
super(manager);
|
|
10601
10572
|
this.plugins.push(
|
|
10602
10573
|
(opts) => {
|
|
10603
|
-
if (
|
|
10604
|
-
const op = typeof
|
|
10574
|
+
if (opts?.DeepZoomImagePlugin === false) return void 0;
|
|
10575
|
+
const op = typeof opts?.DeepZoomImagePlugin === "object" ? opts.DeepZoomImagePlugin : {};
|
|
10605
10576
|
return new DeepZoomImagePlugin({
|
|
10606
10577
|
// center: true,
|
|
10607
10578
|
...op
|
|
@@ -10632,8 +10603,8 @@ class SlippyMapTilesLoader extends TilesRendererLoader {
|
|
|
10632
10603
|
super(manager);
|
|
10633
10604
|
this.plugins.push(
|
|
10634
10605
|
(opts) => {
|
|
10635
|
-
if (
|
|
10636
|
-
const op = typeof
|
|
10606
|
+
if (opts?.XYZTilesPlugin === false) return void 0;
|
|
10607
|
+
const op = typeof opts?.XYZTilesPlugin === "object" ? opts.XYZTilesPlugin : {};
|
|
10637
10608
|
return new XYZTilesPlugin(op);
|
|
10638
10609
|
}
|
|
10639
10610
|
);
|
|
@@ -10654,7 +10625,7 @@ const _EnvironmentControlsPlugin = class _EnvironmentControlsPlugin extends ACam
|
|
|
10654
10625
|
super(...arguments);
|
|
10655
10626
|
this.controlsKey = "environment";
|
|
10656
10627
|
this._controlsCtor = (object, domElement) => {
|
|
10657
|
-
return new EnvironmentControls2(object.parent ?? void 0, object, !
|
|
10628
|
+
return new EnvironmentControls2(object.parent ?? void 0, object, !domElement?.ownerDocument ? (domElement || document).documentElement : domElement);
|
|
10658
10629
|
};
|
|
10659
10630
|
}
|
|
10660
10631
|
};
|
|
@@ -10753,7 +10724,7 @@ const _GlobeControlsPlugin = class _GlobeControlsPlugin extends ACameraControlsP
|
|
|
10753
10724
|
console.warn("GlobeControlsPlugin: autoNearFar is not supported with GlobeControlsPlugin, it will be disabled, use EnvironmentControlsPlugin instead to keep default behaviour");
|
|
10754
10725
|
object.userData.autoNearFar = false;
|
|
10755
10726
|
}
|
|
10756
|
-
return new GlobeControls2(object.parent ?? void 0, object, !
|
|
10727
|
+
return new GlobeControls2(object.parent ?? void 0, object, !domElement?.ownerDocument ? (domElement || document).documentElement : domElement);
|
|
10757
10728
|
};
|
|
10758
10729
|
}
|
|
10759
10730
|
};
|