@cesium/engine 22.2.0 → 23.0.0
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/Build/Workers/{chunk-YFEZPDAY.js → chunk-2GL2EUEE.js} +11 -11
- package/Build/Workers/{chunk-A3NUMZBG.js → chunk-2WI4HGJU.js} +6 -6
- package/Build/Workers/{chunk-3JB2X2PR.js → chunk-36LBFITA.js} +665 -366
- package/Build/Workers/{chunk-VSZ5DB2W.js → chunk-3B65YFXC.js} +1 -1
- package/Build/Workers/{chunk-PSHZAHFE.js → chunk-4LGFX2P5.js} +11 -11
- package/Build/Workers/{chunk-AMWXJ5A7.js → chunk-4UNQX2MP.js} +2 -2
- package/Build/Workers/{chunk-LDSQMLRC.js → chunk-52K3GJKG.js} +3 -3
- package/Build/Workers/{chunk-MSTAVM2N.js → chunk-56OHFSLH.js} +10 -10
- package/Build/Workers/{chunk-IWOSJVFQ.js → chunk-5A7YSAXT.js} +14 -14
- package/Build/Workers/{chunk-PMDPP22G.js → chunk-5JP5FG7U.js} +7 -7
- package/Build/Workers/{chunk-DIJ7IG5D.js → chunk-5R7SBUTW.js} +10 -10
- package/Build/Workers/chunk-5VKZVPO5.js +1829 -0
- package/Build/Workers/{chunk-L2FSBEW2.js → chunk-6FVFM2KB.js} +5 -5
- package/Build/Workers/{chunk-G6WQA27G.js → chunk-6SLGTBB2.js} +5 -5
- package/Build/Workers/{chunk-3HUEBDFC.js → chunk-7KRN6JPQ.js} +14 -14
- package/Build/Workers/{chunk-GMHDOQPH.js → chunk-AA33B6PU.js} +4 -4
- package/Build/Workers/{chunk-7CDQUIP5.js → chunk-AP6XWET5.js} +8 -8
- package/Build/Workers/{chunk-IVN5HSOI.js → chunk-APDKMX7W.js} +6 -6
- package/Build/Workers/{chunk-72LZ3FN6.js → chunk-ARCFIOKA.js} +12 -12
- package/Build/Workers/{chunk-UBJYWGMV.js → chunk-BNBD2YZK.js} +16 -16
- package/Build/Workers/{chunk-VGH2CSC7.js → chunk-DT5SJBKA.js} +29 -15
- package/Build/Workers/{chunk-ED4UXMYY.js → chunk-ESD4IEOU.js} +5 -5
- package/Build/Workers/{chunk-JFN2DQHY.js → chunk-FSDVXW7M.js} +5 -5
- package/Build/Workers/{chunk-JERDRSEI.js → chunk-G3YT7M7A.js} +1 -1
- package/Build/Workers/{chunk-NY3CWLIZ.js → chunk-GN5NEUDT.js} +8 -8
- package/Build/Workers/{chunk-O3GWUTWM.js → chunk-HYLEKKO5.js} +1 -1
- package/Build/Workers/{chunk-64PJ4MTB.js → chunk-HYTFXWMY.js} +7 -7
- package/Build/Workers/{chunk-FPRM6PCE.js → chunk-IFA7VHHP.js} +560 -306
- package/Build/Workers/{chunk-FM5XPC2E.js → chunk-IYVDOB5V.js} +4 -4
- package/Build/Workers/{chunk-P7ISUYLW.js → chunk-JUGY5AZN.js} +4 -4
- package/Build/Workers/{chunk-JONWM4IO.js → chunk-KPYU6YZG.js} +1 -1
- package/Build/Workers/{chunk-JUOSYFXT.js → chunk-L7RDJ4V7.js} +1 -1
- package/Build/Workers/{chunk-MWGB6DLR.js → chunk-LDQWNMEC.js} +1 -1
- package/Build/Workers/{chunk-C6FTHSJA.js → chunk-MQJG522T.js} +6 -6
- package/Build/Workers/{chunk-WH4HDRGN.js → chunk-MT5M7RLZ.js} +2 -2
- package/Build/Workers/{chunk-4ZQN7M7E.js → chunk-N4AWE7TZ.js} +10 -10
- package/Build/Workers/{chunk-SDUH3N6G.js → chunk-NAYRNPEP.js} +4 -4
- package/Build/Workers/{chunk-7OPRTZBT.js → chunk-NNHU33JK.js} +7 -7
- package/Build/Workers/{chunk-CQCEPC6N.js → chunk-NQCAZU7S.js} +13 -13
- package/Build/Workers/{chunk-35J4D6PX.js → chunk-NUYLNQKV.js} +2 -2
- package/Build/Workers/{chunk-I45CATZK.js → chunk-OC6X22PG.js} +9 -9
- package/Build/Workers/{chunk-7MGTX4WP.js → chunk-OHBM4YG4.js} +12 -12
- package/Build/Workers/{chunk-DCR62BCO.js → chunk-OMXN7YF4.js} +12 -12
- package/Build/Workers/{chunk-XPNY2VY3.js → chunk-OQ3EAJNW.js} +2 -2
- package/Build/Workers/{chunk-4I7BCCNU.js → chunk-OQBPOKPZ.js} +6 -6
- package/Build/Workers/{chunk-2JNPWPLE.js → chunk-PQVNT5CJ.js} +6 -6
- package/Build/Workers/{chunk-K64RQCRK.js → chunk-QA24Q62E.js} +17 -17
- package/Build/Workers/{chunk-K6BXEBAF.js → chunk-QQX7S5QT.js} +17 -17
- package/Build/Workers/{chunk-2YVTOY5Z.js → chunk-QTOHIXGF.js} +10 -10
- package/Build/Workers/{chunk-4MCPC4TE.js → chunk-R7M4XNPP.js} +8 -8
- package/Build/Workers/{chunk-C35SJ4QP.js → chunk-SGKTBHFQ.js} +13 -13
- package/Build/Workers/{chunk-BKYJBTHW.js → chunk-SQTRWKO2.js} +5 -5
- package/Build/Workers/{chunk-I4D5IP46.js → chunk-T43FXHNC.js} +7 -7
- package/Build/Workers/{chunk-QO6Z5UJE.js → chunk-UEEGWJJP.js} +2 -2
- package/Build/Workers/{chunk-ZUWF63QU.js → chunk-WKXDCVBO.js} +4 -4
- package/Build/Workers/{chunk-N5MNKWED.js → chunk-Y5AJSEEN.js} +2 -2
- package/Build/Workers/{chunk-V26Y7ZQL.js → chunk-ZIW5FCIW.js} +37 -27
- package/Build/Workers/combineGeometry.js +24 -24
- package/Build/Workers/createBoxGeometry.js +18 -18
- package/Build/Workers/createBoxOutlineGeometry.js +16 -16
- package/Build/Workers/createCircleGeometry.js +26 -26
- package/Build/Workers/createCircleOutlineGeometry.js +19 -19
- package/Build/Workers/createCoplanarPolygonGeometry.js +33 -33
- package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +31 -31
- package/Build/Workers/createCorridorGeometry.js +29 -29
- package/Build/Workers/createCorridorOutlineGeometry.js +28 -28
- package/Build/Workers/createCylinderGeometry.js +20 -20
- package/Build/Workers/createCylinderOutlineGeometry.js +18 -18
- package/Build/Workers/createEllipseGeometry.js +26 -26
- package/Build/Workers/createEllipseOutlineGeometry.js +19 -19
- package/Build/Workers/createEllipsoidGeometry.js +19 -19
- package/Build/Workers/createEllipsoidOutlineGeometry.js +18 -18
- package/Build/Workers/createFrustumGeometry.js +18 -18
- package/Build/Workers/createFrustumOutlineGeometry.js +18 -18
- package/Build/Workers/createGeometry.js +24 -24
- package/Build/Workers/createGroundPolylineGeometry.js +22 -22
- package/Build/Workers/createPlaneGeometry.js +16 -16
- package/Build/Workers/createPlaneOutlineGeometry.js +15 -15
- package/Build/Workers/createPolygonGeometry.js +32 -32
- package/Build/Workers/createPolygonOutlineGeometry.js +30 -30
- package/Build/Workers/createPolylineGeometry.js +25 -25
- package/Build/Workers/createPolylineVolumeGeometry.js +31 -31
- package/Build/Workers/createPolylineVolumeOutlineGeometry.js +27 -27
- package/Build/Workers/createRectangleGeometry.js +27 -27
- package/Build/Workers/createRectangleOutlineGeometry.js +20 -20
- package/Build/Workers/createSimplePolylineGeometry.js +23 -23
- package/Build/Workers/createSphereGeometry.js +19 -19
- package/Build/Workers/createSphereOutlineGeometry.js +18 -18
- package/Build/Workers/createTaskProcessorWorker.js +3 -3
- package/Build/Workers/createVectorTileClampedPolylines.js +14 -14
- package/Build/Workers/createVectorTileGeometries.js +24 -24
- package/Build/Workers/createVectorTilePoints.js +13 -13
- package/Build/Workers/createVectorTilePolygons.js +22 -22
- package/Build/Workers/createVectorTilePolylines.js +14 -14
- package/Build/Workers/createVerticesFromCesium3DTilesTerrain.js +25 -25
- package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +22 -22
- package/Build/Workers/createVerticesFromHeightmap.js +22 -22
- package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +20 -20
- package/Build/Workers/createWallGeometry.js +24 -24
- package/Build/Workers/createWallOutlineGeometry.js +23 -23
- package/Build/Workers/decodeDraco.js +10 -10
- package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +5 -5
- package/Build/Workers/decodeI3S.js +10 -10
- package/Build/Workers/gaussianSplatSorter.js +4 -4
- package/Build/Workers/gaussianSplatTextureGenerator.js +4 -4
- package/Build/Workers/incrementallyBuildTerrainPicker.js +20 -12
- package/Build/Workers/transcodeKTX2.js +6 -6
- package/Build/Workers/transferTypedArrayTest.js +1 -1
- package/Build/Workers/upsampleQuantizedTerrainMesh.js +22 -22
- package/Build/Workers/upsampleVerticesFromCesium3DTilesTerrain.js +25 -25
- package/Source/Core/AttributeCompression.js +53 -6
- package/Source/Core/BoxGeometry.js +1 -1
- package/Source/Core/Cartesian2.js +689 -684
- package/Source/Core/Cartesian3.js +1044 -1043
- package/Source/Core/Cartesian4.js +816 -813
- package/Source/Core/CornerType.js +1 -1
- package/Source/Core/CorridorGeometry.js +1 -1
- package/Source/Core/FeatureDetection.js +1 -32
- package/Source/Core/Geometry.js +1 -1
- package/Source/Core/GoogleMaps.js +23 -2
- package/Source/Core/IntersectionTests.js +2 -2
- package/Source/Core/Ion.js +1 -1
- package/Source/Core/OpenCageGeocoderService.js +2 -3
- package/Source/Core/PinBuilder.js +1 -1
- package/Source/Core/PolygonGeometry.js +1 -1
- package/Source/Core/PolylineGeometry.js +1 -1
- package/Source/Core/PolylineVolumeGeometry.js +1 -1
- package/Source/Core/RectangleGeometry.js +1 -1
- package/Source/Core/ScreenSpaceEventHandler.js +4 -8
- package/Source/Core/TerrainMesh.js +11 -8
- package/Source/Core/TerrainPicker.js +24 -7
- package/Source/Core/VideoSynchronizer.js +1 -1
- package/Source/Core/WallGeometry.js +1 -1
- package/Source/Core/globalTypes.js +16 -0
- package/Source/Core/writeTextToCanvas.js +40 -86
- package/Source/DataSources/BillboardGraphics.js +1 -1
- package/Source/DataSources/BoxGraphics.js +1 -1
- package/Source/DataSources/CallbackPositionProperty.js +1 -1
- package/Source/DataSources/CorridorGraphics.js +1 -1
- package/Source/DataSources/CzmlDataSource.js +1 -1
- package/Source/DataSources/EllipseGraphics.js +1 -1
- package/Source/DataSources/EllipsoidGraphics.js +1 -1
- package/Source/DataSources/Entity.js +1 -1
- package/Source/DataSources/EntityCluster.js +2 -2
- package/Source/DataSources/GeoJsonDataSource.js +2 -2
- package/Source/DataSources/GpxDataSource.js +1 -1
- package/Source/DataSources/KmlDataSource.js +1 -1
- package/Source/DataSources/KmlTour.js +1 -1
- package/Source/DataSources/LabelGraphics.js +1 -1
- package/Source/DataSources/ModelGraphics.js +1 -1
- package/Source/DataSources/PlaneGraphics.js +1 -1
- package/Source/DataSources/PolygonGraphics.js +1 -1
- package/Source/DataSources/PolylineGraphics.js +1 -1
- package/Source/DataSources/PolylineVolumeGraphics.js +1 -1
- package/Source/DataSources/RectangleGraphics.js +1 -1
- package/Source/DataSources/WallGraphics.js +1 -1
- package/Source/DataSources/exportKml.js +1 -1
- package/Source/Renderer/Context.js +11 -10
- package/Source/Renderer/ContextLimits.js +66 -33
- package/Source/Renderer/ShaderDestination.js +54 -13
- package/Source/Renderer/ShaderSource.js +19 -18
- package/Source/Renderer/Texture.js +1 -1
- package/Source/Renderer/Texture3D.js +166 -7
- package/Source/Renderer/TextureAtlas.js +2 -2
- package/Source/Scene/Appearance.js +1 -1
- package/Source/Scene/ArcGisMapService.js +1 -1
- package/Source/Scene/Billboard.js +8 -5
- package/Source/Scene/BillboardCollection.js +65 -26
- package/Source/Scene/BillboardTexture.js +4 -1
- package/Source/Scene/BufferLoader.js +65 -74
- package/Source/Scene/Camera.js +13 -2
- package/Source/Scene/ClippingPlaneCollection.js +2 -2
- package/Source/Scene/CloudCollection.js +2 -2
- package/Source/Scene/CubeMapPanorama.js +351 -0
- package/Source/Scene/CumulusCloud.js +1 -1
- package/Source/Scene/DerivedCommand.js +8 -31
- package/Source/Scene/DracoLoader.js +79 -78
- package/Source/Scene/DynamicEnvironmentMapManager.js +41 -26
- package/Source/Scene/EquirectangularPanorama.js +264 -0
- package/Source/Scene/Fog.js +1 -1
- package/Source/Scene/FrameState.js +7 -0
- package/Source/Scene/GaussianSplatPrimitive.js +907 -168
- package/Source/Scene/Globe.js +3 -10
- package/Source/Scene/GlobeSurfaceShaderSet.js +36 -32
- package/Source/Scene/GltfBufferViewLoader.js +109 -118
- package/Source/Scene/GltfDracoLoader.js +167 -176
- package/Source/Scene/GltfImageLoader.js +91 -101
- package/Source/Scene/GltfIndexBufferLoader.js +228 -241
- package/Source/Scene/GltfJsonLoader.js +90 -99
- package/Source/Scene/GltfLoader.js +323 -324
- package/Source/Scene/GltfSpzLoader.js +127 -134
- package/Source/Scene/GltfStructuralMetadataLoader.js +181 -186
- package/Source/Scene/GltfTextureLoader.js +217 -231
- package/Source/Scene/GltfVertexBufferLoader.js +267 -276
- package/Source/Scene/GoogleStreetViewCubeMapPanoramaProvider.js +341 -0
- package/Source/Scene/ImageBasedLighting.js +2 -2
- package/Source/Scene/ImageryLayerCollection.js +2 -2
- package/Source/Scene/ImageryProvider.js +2 -2
- package/Source/Scene/Label.js +7 -5
- package/Source/Scene/LabelCollection.js +60 -2
- package/Source/Scene/Material.js +1 -1
- package/Source/Scene/MaterialAppearance.js +1 -1
- package/Source/Scene/Megatexture.js +174 -242
- package/Source/Scene/MetadataClassProperty.js +212 -7
- package/Source/Scene/MetadataComponentType.js +162 -127
- package/Source/Scene/MetadataSchemaLoader.js +60 -67
- package/Source/Scene/MetadataTable.js +14 -0
- package/Source/Scene/MetadataTableProperty.js +14 -0
- package/Source/Scene/Model/B3dmLoader.js +216 -224
- package/Source/Scene/Model/CustomShader.js +6 -1
- package/Source/Scene/Model/CustomShaderPipelineStage.js +122 -7
- package/Source/Scene/Model/GeoJsonLoader.js +53 -61
- package/Source/Scene/Model/GeometryPipelineStage.js +17 -3
- package/Source/Scene/Model/I3dmLoader.js +232 -240
- package/Source/Scene/Model/MaterialPipelineStage.js +17 -0
- package/Source/Scene/Model/MetadataPipelineStage.js +438 -22
- package/Source/Scene/Model/Model.js +1 -1
- package/Source/Scene/Model/PntsLoader.js +78 -89
- package/Source/Scene/ModelComponents.js +10 -0
- package/Source/Scene/Panorama.js +53 -0
- package/Source/Scene/PanoramaProvider.js +43 -0
- package/Source/Scene/ParticleSystem.js +2 -2
- package/Source/Scene/PointPrimitive.js +1 -1
- package/Source/Scene/PointPrimitiveCollection.js +14 -22
- package/Source/Scene/Polyline.js +0 -1
- package/Source/Scene/PolylineCollection.js +1 -4
- package/Source/Scene/PolylineColorAppearance.js +1 -6
- package/Source/Scene/PolylineMaterialAppearance.js +1 -6
- package/Source/Scene/PostProcessStageCollection.js +1 -1
- package/Source/Scene/PropertyTable.js +43 -0
- package/Source/Scene/PropertyTexture.js +1 -1
- package/Source/Scene/PropertyTextureProperty.js +0 -97
- package/Source/Scene/QuadtreePrimitive.js +6 -3
- package/Source/Scene/ResourceLoader.js +84 -92
- package/Source/Scene/Scene.js +12 -0
- package/Source/Scene/ShadowMap.js +1 -2
- package/Source/Scene/SkyBox.js +29 -164
- package/Source/Scene/StructuralMetadata.js +18 -3
- package/Source/Scene/Vector3DTileClampedPolylines.js +1 -5
- package/Source/Scene/Vector3DTilePolylines.js +1 -5
- package/Source/Scene/VoxelPrimitive.js +16 -33
- package/Source/Scene/VoxelRenderResources.js +1 -8
- package/Source/Scene/VoxelTraversal.js +16 -61
- package/Source/Scene/WebMapTileServiceImageryProvider.js +1 -1
- package/Source/Scene/createElevationBandMaterial.js +1 -1
- package/Source/Scene/parseStructuralMetadata.js +244 -0
- package/Source/Scene/processVoxelProperties.js +1 -1
- package/Source/Shaders/BillboardCollectionFS.glsl +66 -40
- package/Source/Shaders/BillboardCollectionFS.js +67 -40
- package/Source/Shaders/BillboardCollectionVS.glsl +22 -31
- package/Source/Shaders/BillboardCollectionVS.js +22 -31
- package/Source/Shaders/Builtin/CzmBuiltins.js +4 -0
- package/Source/Shaders/Builtin/Functions/columbusViewMorph.glsl +8 -1
- package/Source/Shaders/Builtin/Functions/columbusViewMorph.js +8 -1
- package/Source/Shaders/Builtin/Functions/decodeRGB8.glsl +22 -0
- package/Source/Shaders/Builtin/Functions/decodeRGB8.js +24 -0
- package/Source/Shaders/Builtin/Functions/unpackTexture.glsl +35 -0
- package/Source/Shaders/Builtin/Functions/unpackTexture.js +37 -0
- package/Source/Shaders/CubeMapPanoramaVS.glsl +11 -0
- package/Source/Shaders/CubeMapPanoramaVS.js +13 -0
- package/Source/Shaders/Model/MetadataStageFS.glsl +2 -1
- package/Source/Shaders/Model/MetadataStageFS.js +2 -1
- package/Source/Shaders/Model/MetadataStageVS.glsl +2 -1
- package/Source/Shaders/Model/MetadataStageVS.js +2 -1
- package/Source/Shaders/Model/ModelFS.glsl +9 -1
- package/Source/Shaders/Model/ModelFS.js +9 -1
- package/Source/Shaders/Model/ModelVS.glsl +4 -2
- package/Source/Shaders/Model/ModelVS.js +4 -2
- package/Source/Shaders/PointPrimitiveCollectionVS.glsl +8 -39
- package/Source/Shaders/PointPrimitiveCollectionVS.js +8 -39
- package/Source/Shaders/Voxels/IntersectionUtils.glsl +1 -1
- package/Source/Shaders/Voxels/IntersectionUtils.js +1 -1
- package/Source/Shaders/Voxels/Megatexture.glsl +15 -83
- package/Source/Shaders/Voxels/Megatexture.js +15 -83
- package/Source/Shaders/Voxels/Octree.glsl +6 -9
- package/Source/Shaders/Voxels/Octree.js +6 -9
- package/Source/Widget/CesiumWidget.js +1 -1
- package/Source/Workers/incrementallyBuildTerrainPicker.js +16 -2
- package/index.d.ts +582 -193
- package/index.js +91 -83
- package/package.json +2 -1
- package/Build/Workers/chunk-ZGWX2R5I.js +0 -1443
|
@@ -14,80 +14,71 @@ import ResourceLoaderState from "./ResourceLoaderState.js";
|
|
|
14
14
|
* Implements the {@link ResourceLoader} interface.
|
|
15
15
|
* </p>
|
|
16
16
|
*
|
|
17
|
-
* @alias GltfStructuralMetadataLoader
|
|
18
|
-
* @constructor
|
|
19
|
-
* @augments ResourceLoader
|
|
20
|
-
*
|
|
21
|
-
* @param {object} options Object with the following properties:
|
|
22
|
-
* @param {object} options.gltf The glTF JSON.
|
|
23
|
-
* @param {string} [options.extension] The <code>EXT_structural_metadata</code> extension object. If this is undefined, then extensionLegacy must be defined.
|
|
24
|
-
* @param {string} [options.extensionLegacy] The legacy <code>EXT_feature_metadata</code> extension for backwards compatibility.
|
|
25
|
-
* @param {Resource} options.gltfResource The {@link Resource} containing the glTF.
|
|
26
|
-
* @param {Resource} options.baseResource The {@link Resource} that paths in the glTF JSON are relative to.
|
|
27
|
-
* @param {SupportedImageFormats} options.supportedImageFormats The supported image formats.
|
|
28
|
-
* @param {FrameState} options.frameState The frame state.
|
|
29
|
-
* @param {string} [options.cacheKey] The cache key of the resource.
|
|
30
|
-
* @param {boolean} [options.asynchronous=true] Determines if WebGL resource creation will be spread out over several frames or block until all WebGL resources are created.
|
|
31
|
-
*
|
|
32
17
|
* @private
|
|
33
18
|
* @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.
|
|
34
19
|
*/
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
20
|
+
class GltfStructuralMetadataLoader extends ResourceLoader {
|
|
21
|
+
/**
|
|
22
|
+
* @param {object} options Object with the following properties:
|
|
23
|
+
* @param {object} options.gltf The glTF JSON.
|
|
24
|
+
* @param {string} [options.extension] The <code>EXT_structural_metadata</code> extension object. If this is undefined, then extensionLegacy must be defined.
|
|
25
|
+
* @param {string} [options.extensionLegacy] The legacy <code>EXT_feature_metadata</code> extension for backwards compatibility.
|
|
26
|
+
* @param {Resource} options.gltfResource The {@link Resource} containing the glTF.
|
|
27
|
+
* @param {Resource} options.baseResource The {@link Resource} that paths in the glTF JSON are relative to.
|
|
28
|
+
* @param {SupportedImageFormats} options.supportedImageFormats The supported image formats.
|
|
29
|
+
* @param {FrameState} options.frameState The frame state.
|
|
30
|
+
* @param {string} [options.cacheKey] The cache key of the resource.
|
|
31
|
+
* @param {boolean} [options.asynchronous=true] Determines if WebGL resource creation will be spread out over several frames or block until all WebGL resources are created.
|
|
32
|
+
*/
|
|
33
|
+
constructor(options) {
|
|
34
|
+
super();
|
|
35
|
+
|
|
36
|
+
options = options ?? Frozen.EMPTY_OBJECT;
|
|
37
|
+
const {
|
|
38
|
+
gltf,
|
|
39
|
+
extension,
|
|
40
|
+
extensionLegacy,
|
|
41
|
+
gltfResource,
|
|
42
|
+
baseResource,
|
|
43
|
+
supportedImageFormats,
|
|
44
|
+
frameState,
|
|
45
|
+
cacheKey,
|
|
46
|
+
asynchronous = true,
|
|
47
|
+
} = options;
|
|
48
|
+
|
|
49
|
+
//>>includeStart('debug', pragmas.debug);
|
|
50
|
+
Check.typeOf.object("options.gltf", gltf);
|
|
51
|
+
Check.typeOf.object("options.gltfResource", gltfResource);
|
|
52
|
+
Check.typeOf.object("options.baseResource", baseResource);
|
|
53
|
+
Check.typeOf.object("options.supportedImageFormats", supportedImageFormats);
|
|
54
|
+
Check.typeOf.object("options.frameState", frameState);
|
|
55
|
+
|
|
56
|
+
if (!defined(options.extension) && !defined(options.extensionLegacy)) {
|
|
57
|
+
throw new DeveloperError(
|
|
58
|
+
"One of options.extension or options.extensionLegacy must be specified",
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
//>>includeEnd('debug');
|
|
62
|
+
|
|
63
|
+
this._gltfResource = gltfResource;
|
|
64
|
+
this._baseResource = baseResource;
|
|
65
|
+
this._gltf = gltf;
|
|
66
|
+
this._extension = extension;
|
|
67
|
+
this._extensionLegacy = extensionLegacy;
|
|
68
|
+
this._supportedImageFormats = supportedImageFormats;
|
|
69
|
+
this._frameState = frameState;
|
|
70
|
+
this._cacheKey = cacheKey;
|
|
71
|
+
this._asynchronous = asynchronous;
|
|
72
|
+
this._bufferViewLoaders = [];
|
|
73
|
+
this._bufferViewIds = [];
|
|
74
|
+
this._textureLoaders = [];
|
|
75
|
+
this._textureIds = [];
|
|
76
|
+
this._schemaLoader = undefined;
|
|
77
|
+
this._structuralMetadata = undefined;
|
|
78
|
+
this._state = ResourceLoaderState.UNLOADED;
|
|
79
|
+
this._promise = undefined;
|
|
60
80
|
}
|
|
61
|
-
//>>includeEnd('debug');
|
|
62
|
-
|
|
63
|
-
this._gltfResource = gltfResource;
|
|
64
|
-
this._baseResource = baseResource;
|
|
65
|
-
this._gltf = gltf;
|
|
66
|
-
this._extension = extension;
|
|
67
|
-
this._extensionLegacy = extensionLegacy;
|
|
68
|
-
this._supportedImageFormats = supportedImageFormats;
|
|
69
|
-
this._frameState = frameState;
|
|
70
|
-
this._cacheKey = cacheKey;
|
|
71
|
-
this._asynchronous = asynchronous;
|
|
72
|
-
this._bufferViewLoaders = [];
|
|
73
|
-
this._bufferViewIds = [];
|
|
74
|
-
this._textureLoaders = [];
|
|
75
|
-
this._textureIds = [];
|
|
76
|
-
this._schemaLoader = undefined;
|
|
77
|
-
this._structuralMetadata = undefined;
|
|
78
|
-
this._state = ResourceLoaderState.UNLOADED;
|
|
79
|
-
this._promise = undefined;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
if (defined(Object.create)) {
|
|
83
|
-
GltfStructuralMetadataLoader.prototype = Object.create(
|
|
84
|
-
ResourceLoader.prototype,
|
|
85
|
-
);
|
|
86
|
-
GltfStructuralMetadataLoader.prototype.constructor =
|
|
87
|
-
GltfStructuralMetadataLoader;
|
|
88
|
-
}
|
|
89
81
|
|
|
90
|
-
Object.defineProperties(GltfStructuralMetadataLoader.prototype, {
|
|
91
82
|
/**
|
|
92
83
|
* The cache key of the resource.
|
|
93
84
|
*
|
|
@@ -97,11 +88,10 @@ Object.defineProperties(GltfStructuralMetadataLoader.prototype, {
|
|
|
97
88
|
* @readonly
|
|
98
89
|
* @private
|
|
99
90
|
*/
|
|
100
|
-
cacheKey
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
},
|
|
91
|
+
get cacheKey() {
|
|
92
|
+
return this._cacheKey;
|
|
93
|
+
}
|
|
94
|
+
|
|
105
95
|
/**
|
|
106
96
|
* The parsed structural metadata
|
|
107
97
|
*
|
|
@@ -111,12 +101,123 @@ Object.defineProperties(GltfStructuralMetadataLoader.prototype, {
|
|
|
111
101
|
* @readonly
|
|
112
102
|
* @private
|
|
113
103
|
*/
|
|
114
|
-
structuralMetadata
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
104
|
+
get structuralMetadata() {
|
|
105
|
+
return this._structuralMetadata;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Loads the resource.
|
|
110
|
+
* @returns {Promise<GltfStructuralMetadataLoader>} A promise which resolves to the loader when the resource loading is completed.
|
|
111
|
+
* @private
|
|
112
|
+
*/
|
|
113
|
+
load() {
|
|
114
|
+
if (defined(this._promise)) {
|
|
115
|
+
return this._promise;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
this._state = ResourceLoaderState.LOADING;
|
|
119
|
+
this._promise = loadResources(this);
|
|
120
|
+
return this._promise;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Processes the resource until it becomes ready.
|
|
125
|
+
*
|
|
126
|
+
* @param {FrameState} frameState The frame state.
|
|
127
|
+
* @private
|
|
128
|
+
*/
|
|
129
|
+
process(frameState) {
|
|
130
|
+
//>>includeStart('debug', pragmas.debug);
|
|
131
|
+
Check.typeOf.object("frameState", frameState);
|
|
132
|
+
//>>includeEnd('debug');
|
|
133
|
+
|
|
134
|
+
if (this._state === ResourceLoaderState.READY) {
|
|
135
|
+
return true;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
if (this._state !== ResourceLoaderState.LOADED) {
|
|
139
|
+
return false;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
const textureLoaders = this._textureLoaders;
|
|
143
|
+
const textureLoadersLength = textureLoaders.length;
|
|
144
|
+
let ready = true;
|
|
145
|
+
for (let i = 0; i < textureLoadersLength; ++i) {
|
|
146
|
+
const textureLoader = textureLoaders[i];
|
|
147
|
+
const textureReady = textureLoader.process(frameState);
|
|
148
|
+
ready = ready && textureReady;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
if (!ready) {
|
|
152
|
+
return false;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
const schema = this._schemaLoader.schema;
|
|
156
|
+
const bufferViews = {};
|
|
157
|
+
for (let i = 0; i < this._bufferViewIds.length; ++i) {
|
|
158
|
+
const bufferViewId = this._bufferViewIds[i];
|
|
159
|
+
const bufferViewLoader = this._bufferViewLoaders[i];
|
|
160
|
+
if (!bufferViewLoader.isDestroyed()) {
|
|
161
|
+
// Copy the typed array and let the underlying ArrayBuffer be freed
|
|
162
|
+
const bufferViewTypedArray = new Uint8Array(
|
|
163
|
+
bufferViewLoader.typedArray,
|
|
164
|
+
);
|
|
165
|
+
bufferViews[bufferViewId] = bufferViewTypedArray;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
const textures = {};
|
|
170
|
+
for (let i = 0; i < this._textureIds.length; ++i) {
|
|
171
|
+
const textureId = this._textureIds[i];
|
|
172
|
+
const textureLoader = textureLoaders[i];
|
|
173
|
+
if (!textureLoader.isDestroyed()) {
|
|
174
|
+
textures[textureId] = textureLoader.texture;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
if (defined(this._extension)) {
|
|
178
|
+
this._structuralMetadata = parseStructuralMetadata({
|
|
179
|
+
extension: this._extension,
|
|
180
|
+
schema: schema,
|
|
181
|
+
bufferViews: bufferViews,
|
|
182
|
+
textures: textures,
|
|
183
|
+
context: frameState.context,
|
|
184
|
+
});
|
|
185
|
+
} else {
|
|
186
|
+
this._structuralMetadata = parseFeatureMetadataLegacy({
|
|
187
|
+
extension: this._extensionLegacy,
|
|
188
|
+
schema: schema,
|
|
189
|
+
bufferViews: bufferViews,
|
|
190
|
+
textures: textures,
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
// Buffer views can be unloaded after the data has been copied
|
|
195
|
+
unloadBufferViews(this);
|
|
196
|
+
|
|
197
|
+
this._state = ResourceLoaderState.READY;
|
|
198
|
+
return true;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* Unloads the resource.
|
|
203
|
+
* @private
|
|
204
|
+
*/
|
|
205
|
+
unload() {
|
|
206
|
+
unloadBufferViews(this);
|
|
207
|
+
unloadTextures(this);
|
|
208
|
+
|
|
209
|
+
if (defined(this._schemaLoader)) {
|
|
210
|
+
ResourceCache.unload(this._schemaLoader);
|
|
211
|
+
}
|
|
212
|
+
this._schemaLoader = undefined;
|
|
213
|
+
|
|
214
|
+
if (defined(this._structuralMetadata)) {
|
|
215
|
+
this._structuralMetadata.destroy();
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
this._structuralMetadata = undefined;
|
|
219
|
+
}
|
|
220
|
+
}
|
|
120
221
|
|
|
121
222
|
async function loadResources(loader) {
|
|
122
223
|
try {
|
|
@@ -146,21 +247,6 @@ async function loadResources(loader) {
|
|
|
146
247
|
}
|
|
147
248
|
}
|
|
148
249
|
|
|
149
|
-
/**
|
|
150
|
-
* Loads the resource.
|
|
151
|
-
* @returns {Promise<GltfStructuralMetadataLoader>} A promise which resolves to the loader when the resource loading is completed.
|
|
152
|
-
* @private
|
|
153
|
-
*/
|
|
154
|
-
GltfStructuralMetadataLoader.prototype.load = function () {
|
|
155
|
-
if (defined(this._promise)) {
|
|
156
|
-
return this._promise;
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
this._state = ResourceLoaderState.LOADING;
|
|
160
|
-
this._promise = loadResources(this);
|
|
161
|
-
return this._promise;
|
|
162
|
-
};
|
|
163
|
-
|
|
164
250
|
function gatherBufferViewIdsFromProperties(properties, bufferViewIdSet) {
|
|
165
251
|
for (const propertyId in properties) {
|
|
166
252
|
if (properties.hasOwnProperty(propertyId)) {
|
|
@@ -391,81 +477,6 @@ async function loadSchema(structuralMetadataLoader) {
|
|
|
391
477
|
}
|
|
392
478
|
}
|
|
393
479
|
|
|
394
|
-
/**
|
|
395
|
-
* Processes the resource until it becomes ready.
|
|
396
|
-
*
|
|
397
|
-
* @param {FrameState} frameState The frame state.
|
|
398
|
-
* @private
|
|
399
|
-
*/
|
|
400
|
-
GltfStructuralMetadataLoader.prototype.process = function (frameState) {
|
|
401
|
-
//>>includeStart('debug', pragmas.debug);
|
|
402
|
-
Check.typeOf.object("frameState", frameState);
|
|
403
|
-
//>>includeEnd('debug');
|
|
404
|
-
|
|
405
|
-
if (this._state === ResourceLoaderState.READY) {
|
|
406
|
-
return true;
|
|
407
|
-
}
|
|
408
|
-
|
|
409
|
-
if (this._state !== ResourceLoaderState.LOADED) {
|
|
410
|
-
return false;
|
|
411
|
-
}
|
|
412
|
-
|
|
413
|
-
const textureLoaders = this._textureLoaders;
|
|
414
|
-
const textureLoadersLength = textureLoaders.length;
|
|
415
|
-
let ready = true;
|
|
416
|
-
for (let i = 0; i < textureLoadersLength; ++i) {
|
|
417
|
-
const textureLoader = textureLoaders[i];
|
|
418
|
-
const textureReady = textureLoader.process(frameState);
|
|
419
|
-
ready = ready && textureReady;
|
|
420
|
-
}
|
|
421
|
-
|
|
422
|
-
if (!ready) {
|
|
423
|
-
return false;
|
|
424
|
-
}
|
|
425
|
-
|
|
426
|
-
const schema = this._schemaLoader.schema;
|
|
427
|
-
const bufferViews = {};
|
|
428
|
-
for (let i = 0; i < this._bufferViewIds.length; ++i) {
|
|
429
|
-
const bufferViewId = this._bufferViewIds[i];
|
|
430
|
-
const bufferViewLoader = this._bufferViewLoaders[i];
|
|
431
|
-
if (!bufferViewLoader.isDestroyed()) {
|
|
432
|
-
// Copy the typed array and let the underlying ArrayBuffer be freed
|
|
433
|
-
const bufferViewTypedArray = new Uint8Array(bufferViewLoader.typedArray);
|
|
434
|
-
bufferViews[bufferViewId] = bufferViewTypedArray;
|
|
435
|
-
}
|
|
436
|
-
}
|
|
437
|
-
|
|
438
|
-
const textures = {};
|
|
439
|
-
for (let i = 0; i < this._textureIds.length; ++i) {
|
|
440
|
-
const textureId = this._textureIds[i];
|
|
441
|
-
const textureLoader = textureLoaders[i];
|
|
442
|
-
if (!textureLoader.isDestroyed()) {
|
|
443
|
-
textures[textureId] = textureLoader.texture;
|
|
444
|
-
}
|
|
445
|
-
}
|
|
446
|
-
if (defined(this._extension)) {
|
|
447
|
-
this._structuralMetadata = parseStructuralMetadata({
|
|
448
|
-
extension: this._extension,
|
|
449
|
-
schema: schema,
|
|
450
|
-
bufferViews: bufferViews,
|
|
451
|
-
textures: textures,
|
|
452
|
-
});
|
|
453
|
-
} else {
|
|
454
|
-
this._structuralMetadata = parseFeatureMetadataLegacy({
|
|
455
|
-
extension: this._extensionLegacy,
|
|
456
|
-
schema: schema,
|
|
457
|
-
bufferViews: bufferViews,
|
|
458
|
-
textures: textures,
|
|
459
|
-
});
|
|
460
|
-
}
|
|
461
|
-
|
|
462
|
-
// Buffer views can be unloaded after the data has been copied
|
|
463
|
-
unloadBufferViews(this);
|
|
464
|
-
|
|
465
|
-
this._state = ResourceLoaderState.READY;
|
|
466
|
-
return true;
|
|
467
|
-
};
|
|
468
|
-
|
|
469
480
|
function unloadBufferViews(structuralMetadataLoader) {
|
|
470
481
|
const bufferViewLoaders = structuralMetadataLoader._bufferViewLoaders;
|
|
471
482
|
const bufferViewLoadersLength = bufferViewLoaders.length;
|
|
@@ -486,20 +497,4 @@ function unloadTextures(structuralMetadataLoader) {
|
|
|
486
497
|
structuralMetadataLoader._textureIds.length = 0;
|
|
487
498
|
}
|
|
488
499
|
|
|
489
|
-
/**
|
|
490
|
-
* Unloads the resource.
|
|
491
|
-
* @private
|
|
492
|
-
*/
|
|
493
|
-
GltfStructuralMetadataLoader.prototype.unload = function () {
|
|
494
|
-
unloadBufferViews(this);
|
|
495
|
-
unloadTextures(this);
|
|
496
|
-
|
|
497
|
-
if (defined(this._schemaLoader)) {
|
|
498
|
-
ResourceCache.unload(this._schemaLoader);
|
|
499
|
-
}
|
|
500
|
-
this._schemaLoader = undefined;
|
|
501
|
-
|
|
502
|
-
this._structuralMetadata = undefined;
|
|
503
|
-
};
|
|
504
|
-
|
|
505
500
|
export default GltfStructuralMetadataLoader;
|