@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
|
@@ -10,46 +10,40 @@ import ResourceLoaderState from "./ResourceLoaderState.js";
|
|
|
10
10
|
* Implements the {@link ResourceLoader} interface.
|
|
11
11
|
* </p>
|
|
12
12
|
*
|
|
13
|
-
* @alias BufferLoader
|
|
14
|
-
* @constructor
|
|
15
|
-
* @augments ResourceLoader
|
|
16
|
-
*
|
|
17
|
-
* @param {object} options Object with the following properties:
|
|
18
|
-
* @param {Uint8Array} [options.typedArray] The typed array containing the embedded buffer contents. Mutually exclusive with options.resource.
|
|
19
|
-
* @param {Resource} [options.resource] The {@link Resource} pointing to the external buffer. Mutually exclusive with options.typedArray.
|
|
20
|
-
* @param {string} [options.cacheKey] The cache key of the resource.
|
|
21
|
-
*
|
|
22
|
-
* @exception {DeveloperError} One of options.typedArray and options.resource must be defined.
|
|
23
|
-
*
|
|
24
13
|
* @private
|
|
25
14
|
*/
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
15
|
+
class BufferLoader extends ResourceLoader {
|
|
16
|
+
/**
|
|
17
|
+
* @param {object} options Object with the following properties:
|
|
18
|
+
* @param {Uint8Array} [options.typedArray] The typed array containing the embedded buffer contents. Mutually exclusive with options.resource.
|
|
19
|
+
* @param {Resource} [options.resource] The {@link Resource} pointing to the external buffer. Mutually exclusive with options.typedArray.
|
|
20
|
+
* @param {string} [options.cacheKey] The cache key of the resource.
|
|
21
|
+
*
|
|
22
|
+
* @exception {DeveloperError} One of options.typedArray and options.resource must be defined.
|
|
23
|
+
*/
|
|
24
|
+
constructor(options) {
|
|
25
|
+
super();
|
|
31
26
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
);
|
|
37
|
-
}
|
|
38
|
-
//>>includeEnd('debug');
|
|
27
|
+
options = options ?? Frozen.EMPTY_OBJECT;
|
|
28
|
+
const typedArray = options.typedArray;
|
|
29
|
+
const resource = options.resource;
|
|
30
|
+
const cacheKey = options.cacheKey;
|
|
39
31
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}
|
|
32
|
+
//>>includeStart('debug', pragmas.debug);
|
|
33
|
+
if (defined(typedArray) === defined(resource)) {
|
|
34
|
+
throw new DeveloperError(
|
|
35
|
+
"One of options.typedArray and options.resource must be defined.",
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
//>>includeEnd('debug');
|
|
46
39
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
40
|
+
this._typedArray = typedArray;
|
|
41
|
+
this._resource = resource;
|
|
42
|
+
this._cacheKey = cacheKey;
|
|
43
|
+
this._state = ResourceLoaderState.UNLOADED;
|
|
44
|
+
this._promise = undefined;
|
|
45
|
+
}
|
|
51
46
|
|
|
52
|
-
Object.defineProperties(BufferLoader.prototype, {
|
|
53
47
|
/**
|
|
54
48
|
* The cache key of the resource.
|
|
55
49
|
*
|
|
@@ -59,11 +53,10 @@ Object.defineProperties(BufferLoader.prototype, {
|
|
|
59
53
|
* @readonly
|
|
60
54
|
* @private
|
|
61
55
|
*/
|
|
62
|
-
cacheKey
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
},
|
|
56
|
+
get cacheKey() {
|
|
57
|
+
return this._cacheKey;
|
|
58
|
+
}
|
|
59
|
+
|
|
67
60
|
/**
|
|
68
61
|
* The typed array containing the embedded buffer contents.
|
|
69
62
|
*
|
|
@@ -73,31 +66,45 @@ Object.defineProperties(BufferLoader.prototype, {
|
|
|
73
66
|
* @readonly
|
|
74
67
|
* @private
|
|
75
68
|
*/
|
|
76
|
-
typedArray
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
},
|
|
80
|
-
},
|
|
81
|
-
});
|
|
69
|
+
get typedArray() {
|
|
70
|
+
return this._typedArray;
|
|
71
|
+
}
|
|
82
72
|
|
|
83
|
-
/**
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
73
|
+
/**
|
|
74
|
+
* Loads the resource.
|
|
75
|
+
* @returns {Promise<BufferLoader>} A promise which resolves to the loader when the resource loading is completed.
|
|
76
|
+
* @private
|
|
77
|
+
*/
|
|
78
|
+
async load() {
|
|
79
|
+
if (defined(this._promise)) {
|
|
80
|
+
return this._promise;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
if (defined(this._typedArray)) {
|
|
84
|
+
this._promise = Promise.resolve(this);
|
|
85
|
+
return this._promise;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
this._promise = loadExternalBuffer(this);
|
|
90
89
|
return this._promise;
|
|
91
90
|
}
|
|
92
91
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
92
|
+
/**
|
|
93
|
+
* Exposed for testing
|
|
94
|
+
* @private
|
|
95
|
+
*/
|
|
96
|
+
static _fetchArrayBuffer(resource) {
|
|
97
|
+
return resource.fetchArrayBuffer();
|
|
96
98
|
}
|
|
97
99
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
100
|
+
/**
|
|
101
|
+
* Unloads the resource.
|
|
102
|
+
* @private
|
|
103
|
+
*/
|
|
104
|
+
unload() {
|
|
105
|
+
this._typedArray = undefined;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
101
108
|
|
|
102
109
|
async function loadExternalBuffer(bufferLoader) {
|
|
103
110
|
const resource = bufferLoader._resource;
|
|
@@ -122,20 +129,4 @@ async function loadExternalBuffer(bufferLoader) {
|
|
|
122
129
|
}
|
|
123
130
|
}
|
|
124
131
|
|
|
125
|
-
/**
|
|
126
|
-
* Exposed for testing
|
|
127
|
-
* @private
|
|
128
|
-
*/
|
|
129
|
-
BufferLoader._fetchArrayBuffer = function (resource) {
|
|
130
|
-
return resource.fetchArrayBuffer();
|
|
131
|
-
};
|
|
132
|
-
|
|
133
|
-
/**
|
|
134
|
-
* Unloads the resource.
|
|
135
|
-
* @private
|
|
136
|
-
*/
|
|
137
|
-
BufferLoader.prototype.unload = function () {
|
|
138
|
-
this._typedArray = undefined;
|
|
139
|
-
};
|
|
140
|
-
|
|
141
132
|
export default BufferLoader;
|
package/Source/Scene/Camera.js
CHANGED
|
@@ -63,8 +63,8 @@ import SceneMode from "./SceneMode.js";
|
|
|
63
63
|
*
|
|
64
64
|
* @param {Scene} scene The scene.
|
|
65
65
|
*
|
|
66
|
-
* @demo {@link https://sandcastle.cesium.com/index.html?
|
|
67
|
-
* @demo {@link https://sandcastle.cesium.com/index.html?
|
|
66
|
+
* @demo {@link https://sandcastle.cesium.com/index.html?id=camera|Cesium Sandcastle Camera Demo}
|
|
67
|
+
* @demo {@link https://sandcastle.cesium.com/index.html?id=camera-tutorial|Cesium Sandcastle Camera Tutorial Example}
|
|
68
68
|
* @demo {@link https://cesium.com/learn/cesiumjs-learn/cesiumjs-camera|Camera Tutorial}
|
|
69
69
|
*
|
|
70
70
|
* @example
|
|
@@ -3005,6 +3005,17 @@ function getPickRayOrthographic(camera, windowPosition, result) {
|
|
|
3005
3005
|
|
|
3006
3006
|
Cartesian3.clone(camera.directionWC, result.direction);
|
|
3007
3007
|
|
|
3008
|
+
// Account for wrap-around in 2D infinite scroll mode
|
|
3009
|
+
if (
|
|
3010
|
+
camera._mode === SceneMode.SCENE2D &&
|
|
3011
|
+
camera._scene.mapMode2D === MapMode2D.INFINITE_SCROLL
|
|
3012
|
+
) {
|
|
3013
|
+
const maxHorizontal = camera._maxCoord.x;
|
|
3014
|
+
origin.y =
|
|
3015
|
+
CesiumMath.mod(origin.y + maxHorizontal, 2.0 * maxHorizontal) -
|
|
3016
|
+
maxHorizontal;
|
|
3017
|
+
}
|
|
3018
|
+
|
|
3008
3019
|
return result;
|
|
3009
3020
|
}
|
|
3010
3021
|
|
|
@@ -41,8 +41,8 @@ import ClippingPlane from "./ClippingPlane.js";
|
|
|
41
41
|
* @param {Color} [options.edgeColor=Color.WHITE] The color applied to highlight the edge along which an object is clipped.
|
|
42
42
|
* @param {number} [options.edgeWidth=0.0] The width, in pixels, of the highlight applied to the edge along which an object is clipped.
|
|
43
43
|
*
|
|
44
|
-
* @demo {@link https://sandcastle.cesium.com/?
|
|
45
|
-
* @demo {@link https://sandcastle.cesium.com/?
|
|
44
|
+
* @demo {@link https://sandcastle.cesium.com/?id=3d-tiles-clipping-planes|Clipping 3D Tiles and glTF models.}
|
|
45
|
+
* @demo {@link https://sandcastle.cesium.com/?id=terrain-clipping-planes|Clipping the Globe.}
|
|
46
46
|
*
|
|
47
47
|
* @example
|
|
48
48
|
* // This clipping plane's distance is positive, which means its normal
|
|
@@ -86,8 +86,8 @@ const COLOR_INDEX = CumulusCloud.COLOR_INDEX;
|
|
|
86
86
|
* @see CloudCollection#remove
|
|
87
87
|
* @see CumulusCloud
|
|
88
88
|
*
|
|
89
|
-
* @demo {@link https://sandcastle.cesium.com/index.html?
|
|
90
|
-
* @demo {@link https://sandcastle.cesium.com/index.html?
|
|
89
|
+
* @demo {@link https://sandcastle.cesium.com/index.html?id=clouds|Cesium Sandcastle Clouds Demo}
|
|
90
|
+
* @demo {@link https://sandcastle.cesium.com/index.html?id=cloud-parameters|Cesium Sandcastle Cloud Parameters Demo}
|
|
91
91
|
*
|
|
92
92
|
* @example
|
|
93
93
|
* // Create a cloud collection with two cumulus clouds
|
|
@@ -0,0 +1,351 @@
|
|
|
1
|
+
import BoxGeometry from "../Core/BoxGeometry.js";
|
|
2
|
+
import Cartesian3 from "../Core/Cartesian3.js";
|
|
3
|
+
import Check from "../Core/Check.js";
|
|
4
|
+
import defined from "../Core/defined.js";
|
|
5
|
+
import destroyObject from "../Core/destroyObject.js";
|
|
6
|
+
import DeveloperError from "../Core/DeveloperError.js";
|
|
7
|
+
import GeometryPipeline from "../Core/GeometryPipeline.js";
|
|
8
|
+
import Matrix4 from "../Core/Matrix4.js";
|
|
9
|
+
import VertexFormat from "../Core/VertexFormat.js";
|
|
10
|
+
import BufferUsage from "../Renderer/BufferUsage.js";
|
|
11
|
+
import CubeMap from "../Renderer/CubeMap.js";
|
|
12
|
+
import DrawCommand from "../Renderer/DrawCommand.js";
|
|
13
|
+
import loadCubeMap from "../Renderer/loadCubeMap.js";
|
|
14
|
+
import RenderState from "../Renderer/RenderState.js";
|
|
15
|
+
import ShaderProgram from "../Renderer/ShaderProgram.js";
|
|
16
|
+
import ShaderSource from "../Renderer/ShaderSource.js";
|
|
17
|
+
import VertexArray from "../Renderer/VertexArray.js";
|
|
18
|
+
import SkyBoxFS from "../Shaders/SkyBoxFS.js";
|
|
19
|
+
import SkyBoxVS from "../Shaders/SkyBoxVS.js";
|
|
20
|
+
import CubeMapPanoramaVS from "../Shaders/CubeMapPanoramaVS.js";
|
|
21
|
+
import BlendingState from "./BlendingState.js";
|
|
22
|
+
import SceneMode from "./SceneMode.js";
|
|
23
|
+
import Pass from "../Renderer/Pass.js";
|
|
24
|
+
import Credit from "../Core/Credit.js";
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* @typedef {object} CubeMapPanorama.ConstructorOptions
|
|
28
|
+
*
|
|
29
|
+
* Initialization options for the CubeMapPanorama constructor
|
|
30
|
+
*
|
|
31
|
+
* @property {object} [options.sources] The source URL or <code>Image</code> object for each of the six cube map faces. See the example below.
|
|
32
|
+
* @property {Matrix4} [options.transform] A 4x4 transformation matrix that defines the panorama’s position and orientation
|
|
33
|
+
* @property {boolean} [options.show=true] Determines if this primitive will be shown.
|
|
34
|
+
* @property {Credit|string} [options.credit] A credit for the panorama, which is displayed on the canvas.
|
|
35
|
+
*
|
|
36
|
+
*/
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* A {@link Panorama} that displays imagery in cube map format in a scene.
|
|
40
|
+
* <p>
|
|
41
|
+
* This is only supported in 3D. The cube map panorama is faded out when morphing to 2D or Columbus view. The size of
|
|
42
|
+
* the cube map panorama must not exceed {@link Scene#maximumSkyBoxSize}.
|
|
43
|
+
* </p>
|
|
44
|
+
*
|
|
45
|
+
* @alias CubeMapPanorama
|
|
46
|
+
* @constructor
|
|
47
|
+
*
|
|
48
|
+
* @param {CubeMapPanorama.ConstructorOptions} options Object describing initialization options
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* const modelMatrix = Cesium.Matrix4.getMatrix3(
|
|
52
|
+
* Cesium.Transforms.localFrameToFixedFrameGenerator("north", "down")(
|
|
53
|
+
* Cesium.Cartesian3.fromDegrees(longitude, latitude, height),
|
|
54
|
+
* Cesium.Ellipsoid.default
|
|
55
|
+
* ),
|
|
56
|
+
* new Cesium.Matrix3()
|
|
57
|
+
* );
|
|
58
|
+
*
|
|
59
|
+
*
|
|
60
|
+
* scene.primitives.add(new Cesium.CubeMapPanorama({
|
|
61
|
+
* sources : {
|
|
62
|
+
* positiveX : 'cubemap_px.png',
|
|
63
|
+
* negativeX : 'cubemap_nx.png',
|
|
64
|
+
* positiveY : 'cubemap_py.png',
|
|
65
|
+
* negativeY : 'cubemap_ny.png',
|
|
66
|
+
* positiveZ : 'cubemap_pz.png',
|
|
67
|
+
* negativeZ : 'cubemap_nz.png'
|
|
68
|
+
* }
|
|
69
|
+
* transform: modelMatrix,
|
|
70
|
+
* }));
|
|
71
|
+
*
|
|
72
|
+
* @see SkyBox
|
|
73
|
+
*
|
|
74
|
+
* @demo {@link https://sandcastle.cesium.com/index.html?id=panorama|Cesium Sandcastle Panorama}
|
|
75
|
+
*/
|
|
76
|
+
function CubeMapPanorama(options) {
|
|
77
|
+
/**
|
|
78
|
+
* The sources used to create the cube map faces: an object
|
|
79
|
+
* with <code>positiveX</code>, <code>negativeX</code>, <code>positiveY</code>,
|
|
80
|
+
* <code>negativeY</code>, <code>positiveZ</code>, and <code>negativeZ</code> properties.
|
|
81
|
+
* These can be either URLs or <code>Image</code> objects.
|
|
82
|
+
*
|
|
83
|
+
* @type {object}
|
|
84
|
+
* @default undefined
|
|
85
|
+
*/
|
|
86
|
+
this.sources = options.sources;
|
|
87
|
+
this._sources = undefined;
|
|
88
|
+
|
|
89
|
+
this._transform = options.transform ?? undefined;
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Determines if the cube map panorama will be shown.
|
|
93
|
+
*
|
|
94
|
+
* @type {boolean}
|
|
95
|
+
* @default true
|
|
96
|
+
*/
|
|
97
|
+
this.show = options.show ?? true;
|
|
98
|
+
|
|
99
|
+
this._returnCommand = options.returnCommand ?? false;
|
|
100
|
+
this._addToPanoramaCommandList = !this._returnCommand;
|
|
101
|
+
|
|
102
|
+
this._command = new DrawCommand({
|
|
103
|
+
modelMatrix: Matrix4.clone(Matrix4.IDENTITY),
|
|
104
|
+
owner: this,
|
|
105
|
+
// render before everything else
|
|
106
|
+
pass: Pass.ENVIRONMENT,
|
|
107
|
+
});
|
|
108
|
+
this._cubeMap = undefined;
|
|
109
|
+
|
|
110
|
+
this._attributeLocations = undefined;
|
|
111
|
+
this._useHdr = undefined;
|
|
112
|
+
this._hasError = false;
|
|
113
|
+
this._error = undefined;
|
|
114
|
+
|
|
115
|
+
// Credit specified by the user.
|
|
116
|
+
let credit = options.credit;
|
|
117
|
+
if (typeof credit === "string") {
|
|
118
|
+
credit = new Credit(credit);
|
|
119
|
+
}
|
|
120
|
+
this._credit = credit;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
Object.defineProperties(CubeMapPanorama.prototype, {
|
|
124
|
+
/**
|
|
125
|
+
* Gets the transform of the panorama.
|
|
126
|
+
* @memberof CubeMapPanorama.prototype
|
|
127
|
+
* @type {Matrix4}
|
|
128
|
+
* @readonly
|
|
129
|
+
*/
|
|
130
|
+
transform: {
|
|
131
|
+
get: function () {
|
|
132
|
+
return this._transform;
|
|
133
|
+
},
|
|
134
|
+
},
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Gets the credits of the panorama.
|
|
138
|
+
* @memberof CubeMapPanorama.prototype
|
|
139
|
+
* @type {Credit}
|
|
140
|
+
* @readonly
|
|
141
|
+
*/
|
|
142
|
+
credit: {
|
|
143
|
+
get: function () {
|
|
144
|
+
return defined(this._credit) ? this._credit : undefined;
|
|
145
|
+
},
|
|
146
|
+
},
|
|
147
|
+
});
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Called when {@link Viewer} or {@link CesiumWidget} render the scene to
|
|
151
|
+
* get the draw commands needed to render this primitive.
|
|
152
|
+
* <p>
|
|
153
|
+
* Do not call this function directly. This is documented just to
|
|
154
|
+
* list the exceptions that may be propagated when the scene is rendered:
|
|
155
|
+
* </p>
|
|
156
|
+
*
|
|
157
|
+
* @exception {DeveloperError} this.sources is required and must have positiveX, negativeX, positiveY, negativeY, positiveZ, and negativeZ properties.
|
|
158
|
+
* @exception {DeveloperError} this.sources properties must all be the same type.
|
|
159
|
+
*/
|
|
160
|
+
CubeMapPanorama.prototype.update = function (frameState, useHdr) {
|
|
161
|
+
const that = this;
|
|
162
|
+
const { mode, passes, context, panoramaCommandList } = frameState;
|
|
163
|
+
|
|
164
|
+
if (!this.show) {
|
|
165
|
+
return undefined;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
if (mode !== SceneMode.SCENE3D && mode !== SceneMode.MORPHING) {
|
|
169
|
+
return undefined;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
// The cube map panorama is only rendered during the render pass; it is not pickable, it doesn't cast shadows, etc.
|
|
173
|
+
if (!passes.render) {
|
|
174
|
+
return undefined;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
// Throw any errors that had previously occurred asynchronously so they aren't
|
|
178
|
+
// ignored when running. See https://github.com/CesiumGS/cesium/pull/12307
|
|
179
|
+
if (this._hasError) {
|
|
180
|
+
const error = this._error;
|
|
181
|
+
this._hasError = false;
|
|
182
|
+
this._error = undefined;
|
|
183
|
+
throw error;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
if (this._sources !== this.sources) {
|
|
187
|
+
this._sources = this.sources;
|
|
188
|
+
const sources = this.sources;
|
|
189
|
+
|
|
190
|
+
//>>includeStart('debug', pragmas.debug);
|
|
191
|
+
Check.defined("this.sources", sources);
|
|
192
|
+
if (
|
|
193
|
+
Object.values(CubeMap.FaceName).some(
|
|
194
|
+
(faceName) => !defined(sources[faceName]),
|
|
195
|
+
)
|
|
196
|
+
) {
|
|
197
|
+
throw new DeveloperError(
|
|
198
|
+
"this.sources must have positiveX, negativeX, positiveY, negativeY, positiveZ, and negativeZ properties.",
|
|
199
|
+
);
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
const sourceType = typeof sources.positiveX;
|
|
203
|
+
if (
|
|
204
|
+
Object.values(CubeMap.FaceName).some(
|
|
205
|
+
(faceName) => typeof sources[faceName] !== sourceType,
|
|
206
|
+
)
|
|
207
|
+
) {
|
|
208
|
+
throw new DeveloperError(
|
|
209
|
+
"this.sources properties must all be the same type.",
|
|
210
|
+
);
|
|
211
|
+
}
|
|
212
|
+
//>>includeEnd('debug');
|
|
213
|
+
|
|
214
|
+
if (typeof sources.positiveX === "string") {
|
|
215
|
+
// Given urls for cube-map images. Load them.
|
|
216
|
+
loadCubeMap(context, this._sources)
|
|
217
|
+
.then(function (cubeMap) {
|
|
218
|
+
that._cubeMap = that._cubeMap && that._cubeMap.destroy();
|
|
219
|
+
that._cubeMap = cubeMap;
|
|
220
|
+
})
|
|
221
|
+
.catch((error) => {
|
|
222
|
+
// Defer throwing the error until the next call to update to prevent
|
|
223
|
+
// test from failing in `afterAll` if this is rejected after the test
|
|
224
|
+
// using the Skybox ends. See https://github.com/CesiumGS/cesium/pull/12307
|
|
225
|
+
this._hasError = true;
|
|
226
|
+
this._error = error;
|
|
227
|
+
});
|
|
228
|
+
} else {
|
|
229
|
+
this._cubeMap = this._cubeMap && this._cubeMap.destroy();
|
|
230
|
+
this._cubeMap = new CubeMap({
|
|
231
|
+
context: context,
|
|
232
|
+
source: sources,
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
this._addToPanoramaCommandList = true;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
const command = this._command;
|
|
239
|
+
|
|
240
|
+
if (!defined(command.vertexArray)) {
|
|
241
|
+
command.uniformMap = {
|
|
242
|
+
u_cubeMap: function () {
|
|
243
|
+
return that._cubeMap;
|
|
244
|
+
},
|
|
245
|
+
u_cubeMapPanoramaTransform: function () {
|
|
246
|
+
return that._transform;
|
|
247
|
+
},
|
|
248
|
+
};
|
|
249
|
+
|
|
250
|
+
const geometry = BoxGeometry.createGeometry(
|
|
251
|
+
BoxGeometry.fromDimensions({
|
|
252
|
+
dimensions: new Cartesian3(2.0, 2.0, 2.0),
|
|
253
|
+
vertexFormat: VertexFormat.POSITION_ONLY,
|
|
254
|
+
}),
|
|
255
|
+
);
|
|
256
|
+
const attributeLocations = (this._attributeLocations =
|
|
257
|
+
GeometryPipeline.createAttributeLocations(geometry));
|
|
258
|
+
|
|
259
|
+
command.vertexArray = VertexArray.fromGeometry({
|
|
260
|
+
context: context,
|
|
261
|
+
geometry: geometry,
|
|
262
|
+
attributeLocations: attributeLocations,
|
|
263
|
+
bufferUsage: BufferUsage.STATIC_DRAW,
|
|
264
|
+
});
|
|
265
|
+
|
|
266
|
+
// no depth test/write
|
|
267
|
+
command.renderState = RenderState.fromCache({
|
|
268
|
+
depthTest: { enabled: false },
|
|
269
|
+
depthMask: false,
|
|
270
|
+
blending: BlendingState.ALPHA_BLEND,
|
|
271
|
+
});
|
|
272
|
+
this._addToPanoramaCommandList = true;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
if (!defined(command.shaderProgram) || this._useHdr !== useHdr) {
|
|
276
|
+
const fs = new ShaderSource({
|
|
277
|
+
defines: [useHdr ? "HDR" : ""],
|
|
278
|
+
sources: [SkyBoxFS],
|
|
279
|
+
});
|
|
280
|
+
command.shaderProgram = ShaderProgram.fromCache({
|
|
281
|
+
context: context,
|
|
282
|
+
//vertexShaderSource: SkyBoxVS,
|
|
283
|
+
vertexShaderSource: defined(this._transform)
|
|
284
|
+
? CubeMapPanoramaVS
|
|
285
|
+
: SkyBoxVS,
|
|
286
|
+
fragmentShaderSource: fs,
|
|
287
|
+
attributeLocations: this._attributeLocations,
|
|
288
|
+
});
|
|
289
|
+
this._useHdr = useHdr;
|
|
290
|
+
this._addToPanoramaCommandList = true;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
if (!defined(this._cubeMap)) {
|
|
294
|
+
return undefined;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
if (this.show && defined(this._credit) && !this._returnCommand) {
|
|
298
|
+
const creditDisplay = frameState.creditDisplay;
|
|
299
|
+
creditDisplay.addCreditToNextFrame(this._credit);
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
if (this._returnCommand) {
|
|
303
|
+
return command;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
if (this._addToPanoramaCommandList) {
|
|
307
|
+
panoramaCommandList.push(command);
|
|
308
|
+
this._addToPanoramaCommandList = false;
|
|
309
|
+
}
|
|
310
|
+
};
|
|
311
|
+
|
|
312
|
+
/**
|
|
313
|
+
* Returns true if this object was destroyed; otherwise, false.
|
|
314
|
+
* <br /><br />
|
|
315
|
+
* If this object was destroyed, it should not be used; calling any function other than
|
|
316
|
+
* <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
|
|
317
|
+
*
|
|
318
|
+
* @returns {boolean} <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
|
|
319
|
+
*
|
|
320
|
+
* @see CubeMapPanorama#destroy
|
|
321
|
+
*/
|
|
322
|
+
CubeMapPanorama.prototype.isDestroyed = function () {
|
|
323
|
+
return false;
|
|
324
|
+
};
|
|
325
|
+
|
|
326
|
+
/**
|
|
327
|
+
* Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
|
|
328
|
+
* release of WebGL resources, instead of relying on the garbage collector to destroy this object.
|
|
329
|
+
* <br /><br />
|
|
330
|
+
* Once an object is destroyed, it should not be used; calling any function other than
|
|
331
|
+
* <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
|
|
332
|
+
* assign the return value (<code>undefined</code>) to the object as done in the example.
|
|
333
|
+
*
|
|
334
|
+
* @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.
|
|
335
|
+
*
|
|
336
|
+
*
|
|
337
|
+
* @example
|
|
338
|
+
* cubeMapPanorama = cubeMapPanorama && cubeMapPanorama.destroy();
|
|
339
|
+
*
|
|
340
|
+
* @see CubeMapPanorama#isDestroyed
|
|
341
|
+
*/
|
|
342
|
+
CubeMapPanorama.prototype.destroy = function () {
|
|
343
|
+
const command = this._command;
|
|
344
|
+
command.vertexArray = command.vertexArray && command.vertexArray.destroy();
|
|
345
|
+
command.shaderProgram =
|
|
346
|
+
command.shaderProgram && command.shaderProgram.destroy();
|
|
347
|
+
this._cubeMap = this._cubeMap && this._cubeMap.destroy();
|
|
348
|
+
return destroyObject(this);
|
|
349
|
+
};
|
|
350
|
+
|
|
351
|
+
export default CubeMapPanorama;
|
|
@@ -31,7 +31,7 @@ import defined from "../Core/defined.js";
|
|
|
31
31
|
* @internalConstructor
|
|
32
32
|
* @class
|
|
33
33
|
*
|
|
34
|
-
* @demo {@link https://sandcastle.cesium.com/index.html?
|
|
34
|
+
* @demo {@link https://sandcastle.cesium.com/index.html?id=cloud-parameters|Cesium Sandcastle Cloud Parameters Demo}
|
|
35
35
|
*/
|
|
36
36
|
function CumulusCloud(options, cloudCollection) {
|
|
37
37
|
options = options ?? Frozen.EMPTY_OBJECT;
|
|
@@ -264,13 +264,13 @@ function getPickShaderProgram(context, shaderProgram, pickId) {
|
|
|
264
264
|
|
|
265
265
|
const hasFragData = sources.some((source) => source.includes("out_FragData"));
|
|
266
266
|
const outputColorVariable = hasFragData ? "out_FragData_0" : "out_FragColor";
|
|
267
|
-
const newMain = `void main ()
|
|
268
|
-
{
|
|
269
|
-
czm_non_pick_main();
|
|
270
|
-
if (${outputColorVariable}.a == 0.0) {
|
|
271
|
-
discard;
|
|
272
|
-
}
|
|
273
|
-
${outputColorVariable} = ${pickId};
|
|
267
|
+
const newMain = `void main ()
|
|
268
|
+
{
|
|
269
|
+
czm_non_pick_main();
|
|
270
|
+
if (${outputColorVariable}.a == 0.0) {
|
|
271
|
+
discard;
|
|
272
|
+
}
|
|
273
|
+
${outputColorVariable} = ${pickId};
|
|
274
274
|
} `;
|
|
275
275
|
|
|
276
276
|
const length = sources.length;
|
|
@@ -394,29 +394,6 @@ function getComponentCount(classProperty) {
|
|
|
394
394
|
return classProperty.arrayLength;
|
|
395
395
|
}
|
|
396
396
|
|
|
397
|
-
/**
|
|
398
|
-
* Returns the type that the given class property has in a GLSL shader.
|
|
399
|
-
*
|
|
400
|
-
* It returns the same string as `PropertyTextureProperty.prototype.getGlslType`
|
|
401
|
-
* for a property texture property with the given class property
|
|
402
|
-
*
|
|
403
|
-
* @param {MetadataClassProperty} classProperty The class property
|
|
404
|
-
* @returns {string} The GLSL shader type string for the property
|
|
405
|
-
*/
|
|
406
|
-
function getGlslType(classProperty) {
|
|
407
|
-
const componentCount = getComponentCount(classProperty);
|
|
408
|
-
if (classProperty.normalized) {
|
|
409
|
-
if (componentCount === 1) {
|
|
410
|
-
return "float";
|
|
411
|
-
}
|
|
412
|
-
return `vec${componentCount}`;
|
|
413
|
-
}
|
|
414
|
-
if (componentCount === 1) {
|
|
415
|
-
return "int";
|
|
416
|
-
}
|
|
417
|
-
return `ivec${componentCount}`;
|
|
418
|
-
}
|
|
419
|
-
|
|
420
397
|
/**
|
|
421
398
|
* Returns a shader statement that applies the inverse of the
|
|
422
399
|
* value transform to the given value, based on the given offset
|
|
@@ -547,7 +524,7 @@ function getPickMetadataShaderProgram(
|
|
|
547
524
|
|
|
548
525
|
const metadataProperty = pickedMetadataInfo.metadataProperty;
|
|
549
526
|
const classProperty = pickedMetadataInfo.classProperty;
|
|
550
|
-
const glslType = getGlslType(
|
|
527
|
+
const glslType = classProperty.getGlslType();
|
|
551
528
|
|
|
552
529
|
// Define the components that will go into the output `metadataValues`.
|
|
553
530
|
// This will be the 'color' that is written into the frame buffer,
|