@cesium/engine 17.0.0 → 18.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/ThirdParty/Workers/z-worker-pako.js +1 -1
- package/Build/Workers/{chunk-4TIR5UPL.js → chunk-2AXPWBJG.js} +1 -1
- package/Build/Workers/{chunk-CAKU6ZPR.js → chunk-2CAYUY2B.js} +8 -8
- package/Build/Workers/{chunk-PS3OKVOQ.js → chunk-2NKHPWDY.js} +12 -12
- package/Build/Workers/{chunk-VXAKU6EV.js → chunk-2QNKQVUT.js} +5 -5
- package/Build/Workers/{chunk-ZTBZMRQT.js → chunk-3RKVDGRF.js} +8 -8
- package/Build/Workers/{chunk-J2HTPGC7.js → chunk-4DSTDGY3.js} +2 -2
- package/Build/Workers/{chunk-P2N5IDWU.js → chunk-4MIY63FM.js} +13 -13
- package/Build/Workers/{chunk-XYGBWBD5.js → chunk-5OL6XFNS.js} +1 -1
- package/Build/Workers/{chunk-E7SMO47Q.js → chunk-5WVF4BK7.js} +5 -5
- package/Build/Workers/{chunk-SQKTLDSD.js → chunk-AEGAQ6FD.js} +12 -12
- package/Build/Workers/{chunk-4BGKMM7J.js → chunk-CES6DHHV.js} +1 -1
- package/Build/Workers/{chunk-MAIKDIBS.js → chunk-DINSLSJD.js} +6 -6
- package/Build/Workers/{chunk-G6JUXZUO.js → chunk-EHB2OCQX.js} +4 -4
- package/Build/Workers/{chunk-SSLK4U3V.js → chunk-EXEZHW3P.js} +4 -4
- package/Build/Workers/{chunk-236N6BJN.js → chunk-F4ZAKN4V.js} +2 -2
- package/Build/Workers/{chunk-HBNWBMAM.js → chunk-FPYBD2P5.js} +1 -1
- package/Build/Workers/{chunk-5PC577K7.js → chunk-GAUF4F5A.js} +16 -16
- package/Build/Workers/{chunk-YE6MDFDA.js → chunk-GM55YFOB.js} +14 -14
- package/Build/Workers/{chunk-HGEGZ67N.js → chunk-GS55WTRX.js} +6 -6
- package/Build/Workers/{chunk-LPGOAMYH.js → chunk-HQE7KSR4.js} +2 -2
- package/Build/Workers/{chunk-IFIS4CVK.js → chunk-HS76VTVY.js} +2 -2
- package/Build/Workers/{chunk-7IIMO7ZZ.js → chunk-I3BAKR4S.js} +16 -16
- package/Build/Workers/{chunk-PM4Q36WX.js → chunk-IWGMVQGG.js} +9 -9
- package/Build/Workers/{chunk-UFV3YUIN.js → chunk-IWZK2AIH.js} +5 -5
- package/Build/Workers/{chunk-QJTIOB2Z.js → chunk-J4MAVE6J.js} +6 -6
- package/Build/Workers/{chunk-RX65FA7X.js → chunk-JF4IYQYC.js} +7 -7
- package/Build/Workers/{chunk-7PHT4JHA.js → chunk-KGXTCGX3.js} +12 -12
- package/Build/Workers/{chunk-K5JTWJPE.js → chunk-KNA65INJ.js} +4 -4
- package/Build/Workers/{chunk-CBFJVM6I.js → chunk-LIPZUYNR.js} +11 -11
- package/Build/Workers/{chunk-C5DCX2YQ.js → chunk-LWJWWCZ4.js} +6 -6
- package/Build/Workers/{chunk-KE45DUDH.js → chunk-LZFUG3GO.js} +10 -10
- package/Build/Workers/{chunk-P57PR3WM.js → chunk-MFGVMUN3.js} +5 -5
- package/Build/Workers/{chunk-QUFN3GEO.js → chunk-NR7KSD56.js} +3 -3
- package/Build/Workers/{chunk-MS5NWDHH.js → chunk-NVJ5JRIM.js} +2 -2
- package/Build/Workers/{chunk-CQMXZF4A.js → chunk-NWSAYFZG.js} +6 -6
- package/Build/Workers/{chunk-5YEFZMMM.js → chunk-OATG6PKE.js} +12 -12
- package/Build/Workers/{chunk-UX5JWAC7.js → chunk-OIHAAHBK.js} +10 -10
- package/Build/Workers/{chunk-DRMXU674.js → chunk-QN7JEOQV.js} +5 -5
- package/Build/Workers/{chunk-77MDEA47.js → chunk-QUSP3NWA.js} +5 -5
- package/Build/Workers/{chunk-GO3RZX2R.js → chunk-RWFYLWSF.js} +9 -9
- package/Build/Workers/{chunk-UZ6KXWCA.js → chunk-SIOVJ4L5.js} +4 -4
- package/Build/Workers/{chunk-OBHLT34A.js → chunk-T6B6H3GR.js} +7 -7
- package/Build/Workers/{chunk-IKDQX7DY.js → chunk-UK33ZN4K.js} +4 -4
- package/Build/Workers/{chunk-2BJXFXD7.js → chunk-VGJSKEIB.js} +4 -4
- package/Build/Workers/{chunk-5RPUEFSA.js → chunk-W6CPO62M.js} +6 -6
- package/Build/Workers/{chunk-37PA7GZW.js → chunk-WGHUCZMX.js} +7 -7
- package/Build/Workers/{chunk-UC7KH56Y.js → chunk-WTFZHPUW.js} +5 -5
- package/Build/Workers/{chunk-NZSBSY5K.js → chunk-WYCR5DWQ.js} +2 -2
- package/Build/Workers/{chunk-WP3IJYLC.js → chunk-YV37YFUM.js} +9 -9
- package/Build/Workers/{chunk-LVGYWPEX.js → chunk-ZADJ6FRX.js} +4 -4
- package/Build/Workers/{chunk-CC2WKHIW.js → chunk-ZIP27IX6.js} +6 -6
- package/Build/Workers/combineGeometry.js +21 -21
- package/Build/Workers/createBoxGeometry.js +15 -15
- package/Build/Workers/createBoxOutlineGeometry.js +13 -13
- package/Build/Workers/createCircleGeometry.js +23 -23
- package/Build/Workers/createCircleOutlineGeometry.js +16 -16
- package/Build/Workers/createCoplanarPolygonGeometry.js +30 -30
- package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +28 -28
- package/Build/Workers/createCorridorGeometry.js +26 -26
- package/Build/Workers/createCorridorOutlineGeometry.js +25 -25
- package/Build/Workers/createCylinderGeometry.js +17 -17
- package/Build/Workers/createCylinderOutlineGeometry.js +15 -15
- package/Build/Workers/createEllipseGeometry.js +23 -23
- package/Build/Workers/createEllipseOutlineGeometry.js +16 -16
- package/Build/Workers/createEllipsoidGeometry.js +16 -16
- package/Build/Workers/createEllipsoidOutlineGeometry.js +15 -15
- package/Build/Workers/createFrustumGeometry.js +15 -15
- package/Build/Workers/createFrustumOutlineGeometry.js +15 -15
- package/Build/Workers/createGeometry.js +21 -21
- package/Build/Workers/createGroundPolylineGeometry.js +19 -19
- package/Build/Workers/createPlaneGeometry.js +13 -13
- package/Build/Workers/createPlaneOutlineGeometry.js +12 -12
- package/Build/Workers/createPolygonGeometry.js +29 -29
- package/Build/Workers/createPolygonOutlineGeometry.js +27 -27
- package/Build/Workers/createPolylineGeometry.js +22 -22
- package/Build/Workers/createPolylineVolumeGeometry.js +28 -28
- package/Build/Workers/createPolylineVolumeOutlineGeometry.js +24 -24
- package/Build/Workers/createRectangleGeometry.js +24 -24
- package/Build/Workers/createRectangleOutlineGeometry.js +17 -17
- package/Build/Workers/createSimplePolylineGeometry.js +20 -20
- package/Build/Workers/createSphereGeometry.js +16 -16
- package/Build/Workers/createSphereOutlineGeometry.js +15 -15
- package/Build/Workers/createTaskProcessorWorker.js +3 -3
- package/Build/Workers/createVectorTileClampedPolylines.js +12 -12
- package/Build/Workers/createVectorTileGeometries.js +21 -21
- package/Build/Workers/createVectorTilePoints.js +11 -11
- package/Build/Workers/createVectorTilePolygons.js +19 -19
- package/Build/Workers/createVectorTilePolylines.js +12 -12
- package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +19 -19
- package/Build/Workers/createVerticesFromHeightmap.js +19 -19
- package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +16 -16
- package/Build/Workers/createWallGeometry.js +21 -21
- package/Build/Workers/createWallOutlineGeometry.js +20 -20
- package/Build/Workers/decodeDraco.js +10 -10
- package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +5 -5
- package/Build/Workers/decodeI3S.js +9 -9
- package/Build/Workers/transcodeKTX2.js +25 -6
- package/Build/Workers/transferTypedArrayTest.js +1 -1
- package/Build/Workers/upsampleQuantizedTerrainMesh.js +19 -19
- package/Source/Core/Ion.js +1 -1
- package/Source/Core/PixelFormat.js +36 -0
- package/Source/Renderer/Texture3D.js +568 -0
- package/Source/Renderer/createUniform.js +1 -0
- package/Source/Renderer/createUniformArray.js +1 -0
- package/Source/Scene/ArcGisMapService.js +1 -1
- package/Source/Scene/Cesium3DTileset.js +138 -0
- package/Source/Scene/GlobeSurfaceShaderSet.js +4 -5
- package/Source/Scene/ImageryLayer.js +19 -4
- package/Source/Scene/ImageryLayerCollection.js +3 -2
- package/Source/Scene/Model/CartesianRectangle.js +108 -0
- package/Source/Scene/Model/ImageryConfiguration.js +25 -0
- package/Source/Scene/Model/ImageryCoverage.js +488 -0
- package/Source/Scene/Model/ImageryFlags.js +31 -0
- package/Source/Scene/Model/ImageryInput.js +60 -0
- package/Source/Scene/Model/ImageryPipelineStage.js +1040 -0
- package/Source/Scene/Model/MappedPositions.js +84 -0
- package/Source/Scene/Model/Model.js +38 -0
- package/Source/Scene/Model/ModelImagery.js +403 -0
- package/Source/Scene/Model/ModelImageryMapping.js +489 -0
- package/Source/Scene/Model/ModelPrimitiveImagery.js +972 -0
- package/Source/Scene/Model/ModelReader.js +810 -0
- package/Source/Scene/Model/ModelRenderResources.js +13 -0
- package/Source/Scene/Model/ModelRuntimePrimitive.js +19 -0
- package/Source/Scene/Model/ModelSceneGraph.js +133 -27
- package/Source/Scene/Model/NodeRenderResources.js +10 -0
- package/Source/Scene/ModelComponents.js +10 -0
- package/Source/Scene/VoxelPrimitive.js +22 -37
- package/Source/Scene/VoxelRenderResources.js +1 -1
- package/Source/Scene/processVoxelProperties.js +41 -100
- package/Source/Shaders/Builtin/Functions/windowToEyeCoordinates.glsl +0 -1
- package/Source/Shaders/Builtin/Functions/windowToEyeCoordinates.js +0 -1
- package/Source/Shaders/GlobeFS.glsl +22 -0
- package/Source/Shaders/GlobeFS.js +22 -0
- package/Source/Shaders/Model/MaterialStageFS.glsl +4 -0
- package/Source/Shaders/Model/MaterialStageFS.js +4 -0
- package/Source/Shaders/Model/ModelVS.glsl +4 -0
- package/Source/Shaders/Model/ModelVS.js +4 -0
- package/Source/Shaders/Voxels/IntersectDepth.glsl +10 -3
- package/Source/Shaders/Voxels/IntersectDepth.js +10 -3
- package/Source/Shaders/Voxels/Intersection.glsl +1 -3
- package/Source/Shaders/Voxels/Intersection.js +1 -3
- package/Source/Shaders/Voxels/IntersectionUtils.glsl +1 -0
- package/Source/Shaders/Voxels/IntersectionUtils.js +1 -0
- package/Source/Shaders/Voxels/VoxelFS.glsl +37 -24
- package/Source/Shaders/Voxels/VoxelFS.js +37 -24
- package/Source/ThirdParty/Workers/z-worker-pako.js +1 -1
- package/index.d.ts +50 -2
- package/index.js +100 -88
- package/package.json +3 -3
|
@@ -62,6 +62,7 @@ import Cesium3DTilesetBaseTraversal from "./Cesium3DTilesetBaseTraversal.js";
|
|
|
62
62
|
import Cesium3DTilesetSkipTraversal from "./Cesium3DTilesetSkipTraversal.js";
|
|
63
63
|
import Ray from "../Core/Ray.js";
|
|
64
64
|
import DynamicEnvironmentMapManager from "./DynamicEnvironmentMapManager.js";
|
|
65
|
+
import ImageryLayerCollection from "./ImageryLayerCollection.js";
|
|
65
66
|
|
|
66
67
|
/**
|
|
67
68
|
* @typedef {Object} Cesium3DTileset.ConstructorOptions
|
|
@@ -119,6 +120,7 @@ import DynamicEnvironmentMapManager from "./DynamicEnvironmentMapManager.js";
|
|
|
119
120
|
* @property {boolean} [enableCollision=false] When <code>true</code>, enables collisions for camera or CPU picking. While this is <code>true</code> the camera will be prevented from going below the tileset surface if {@link ScreenSpaceCameraController#enableCollisionDetection} is true.
|
|
120
121
|
* @property {boolean} [projectTo2D=false] Whether to accurately project the tileset to 2D. If this is true, the tileset will be projected accurately to 2D, but it will use more memory to do so. If this is false, the tileset will use less memory and will still render in 2D / CV mode, but its projected positions may be inaccurate. This cannot be set after the tileset has been created.
|
|
121
122
|
* @property {boolean} [enablePick=false] Whether to allow collision and CPU picking with <code>pick</code> when using WebGL 1. If using WebGL 2 or above, this option will be ignored. If using WebGL 1 and this is true, the <code>pick</code> operation will work correctly, but it will use more memory to do so. If running with WebGL 1 and this is false, the model will use less memory, but <code>pick</code> will always return <code>undefined</code>. This cannot be set after the tileset has loaded.
|
|
123
|
+
* @property {boolean} [asynchronouslyLoadImagery=false] Whether loading imagery that is draped over the tileset should be done asynchronously. If this is <code>true</code>, then tile content will be displayed with its original texture until the imagery texture is loaded. If this is <code>false</code>, then the tile content will not be displayed until the imagery is ready.
|
|
122
124
|
* @property {string} [debugHeatmapTilePropertyName] The tile variable to colorize as a heatmap. All rendered tiles will be colorized relative to each other's specified variable value.
|
|
123
125
|
* @property {boolean} [debugFreezeFrame=false] For debugging only. Determines if only the tiles from last frame should be used for rendering.
|
|
124
126
|
* @property {boolean} [debugColorizeTiles=false] For debugging only. When true, assigns a random color to each tile.
|
|
@@ -347,6 +349,60 @@ function Cesium3DTileset(options) {
|
|
|
347
349
|
this._vectorKeepDecodedPositions =
|
|
348
350
|
options.vectorKeepDecodedPositions ?? false;
|
|
349
351
|
|
|
352
|
+
/**
|
|
353
|
+
* The collection of <code>ImageryLayer</code> objects providing 2D georeferenced
|
|
354
|
+
* image data that will be rendered over the tileset.
|
|
355
|
+
*
|
|
356
|
+
* @private
|
|
357
|
+
* @type {ImageryLayerCollection}
|
|
358
|
+
* @readonly
|
|
359
|
+
*/
|
|
360
|
+
this._imageryLayers = new ImageryLayerCollection(this);
|
|
361
|
+
|
|
362
|
+
/**
|
|
363
|
+
* A counter that will be increased for each modification of the
|
|
364
|
+
* imagery layers (i.e. for each layerAdded, layerRemoved,
|
|
365
|
+
* layerMoved, or layerShownOrHidden event). This can be used
|
|
366
|
+
* by the <code>ModelImagery</code> class to detect changes in
|
|
367
|
+
* the imagery, and trigger the appropriate updates.
|
|
368
|
+
*
|
|
369
|
+
* @private
|
|
370
|
+
*/
|
|
371
|
+
this._imageryLayersModificationCounter = 0;
|
|
372
|
+
|
|
373
|
+
/**
|
|
374
|
+
* A listener that will be attached to the layerAdded, layerRemoved,
|
|
375
|
+
* layerMoved, and layerShownOrHidden events of the imagery layers,
|
|
376
|
+
* and increment the imagery layers modification counter for each
|
|
377
|
+
* event.
|
|
378
|
+
*
|
|
379
|
+
* @private
|
|
380
|
+
* @readonly
|
|
381
|
+
*/
|
|
382
|
+
this._imageryLayersListener = () => {
|
|
383
|
+
this._imageryLayersModificationCounter++;
|
|
384
|
+
};
|
|
385
|
+
|
|
386
|
+
// Attach the imagery layers listener to all events of
|
|
387
|
+
// the imagery layers collection
|
|
388
|
+
this.imageryLayers.layerAdded.addEventListener(this._imageryLayersListener);
|
|
389
|
+
this.imageryLayers.layerRemoved.addEventListener(this._imageryLayersListener);
|
|
390
|
+
this.imageryLayers.layerMoved.addEventListener(this._imageryLayersListener);
|
|
391
|
+
this.imageryLayers.layerShownOrHidden.addEventListener(
|
|
392
|
+
this._imageryLayersListener,
|
|
393
|
+
);
|
|
394
|
+
|
|
395
|
+
/**
|
|
396
|
+
* Whether loading imagery that is draped over the tileset should be
|
|
397
|
+
* done asynchronously. If this is <code>true</code>, then tile content
|
|
398
|
+
* will be displayed with its original texture until the imagery texture
|
|
399
|
+
* is loaded. If this is <code>false</code>, then the tile content will
|
|
400
|
+
* not be displayed until the imagery is ready.
|
|
401
|
+
*
|
|
402
|
+
* @private
|
|
403
|
+
*/
|
|
404
|
+
this._asynchronouslyLoadImagery = options.asynchronouslyLoadImagery ?? false;
|
|
405
|
+
|
|
350
406
|
/**
|
|
351
407
|
* Preload tiles when <code>tileset.show</code> is <code>false</code>. Loads tiles as if the tileset is visible but does not render them.
|
|
352
408
|
*
|
|
@@ -1097,6 +1153,69 @@ Object.defineProperties(Cesium3DTileset.prototype, {
|
|
|
1097
1153
|
},
|
|
1098
1154
|
},
|
|
1099
1155
|
|
|
1156
|
+
/**
|
|
1157
|
+
* The collection of <code>ImageryLayer</code> objects providing 2D georeferenced
|
|
1158
|
+
* image data that will be rendered over the tileset.
|
|
1159
|
+
*
|
|
1160
|
+
* The imagery will be draped over glTF, B3DM, PNTS, or GeoJSON tile content.
|
|
1161
|
+
*
|
|
1162
|
+
* @see ImageryLayer
|
|
1163
|
+
*
|
|
1164
|
+
* @memberof Cesium3DTileset.prototype
|
|
1165
|
+
* @readonly
|
|
1166
|
+
* @type {ImageryLayerCollection}
|
|
1167
|
+
*
|
|
1168
|
+
* @experimental This feature is not final and is subject to change without Cesium's standard deprecation policy.
|
|
1169
|
+
*
|
|
1170
|
+
* @example
|
|
1171
|
+
* // Drape Bing Maps Aerial imagery over the tileset
|
|
1172
|
+
* const imageryProvider = await Cesium.createWorldImageryAsync({
|
|
1173
|
+
* style: Cesium.IonWorldImageryStyle.AERIAL,
|
|
1174
|
+
* });
|
|
1175
|
+
* const imageryLayer = new ImageryLayer(imageryProvider);
|
|
1176
|
+
* tileset.imageryLayers.add(imageryLayer);
|
|
1177
|
+
*/
|
|
1178
|
+
imageryLayers: {
|
|
1179
|
+
get: function () {
|
|
1180
|
+
return this._imageryLayers;
|
|
1181
|
+
},
|
|
1182
|
+
},
|
|
1183
|
+
|
|
1184
|
+
/**
|
|
1185
|
+
* The modification counter of the imagery layers.
|
|
1186
|
+
*
|
|
1187
|
+
* This is incremented for each modification (layerAdded, layerMoved,
|
|
1188
|
+
* layerRemoved, layerShownOrHidden) of the imagery layers, and can
|
|
1189
|
+
* be used <b>internally</b> (by <code>ModelPrimitiveImagery</code>)
|
|
1190
|
+
* to trigger updates whenever the collection of imagery layers
|
|
1191
|
+
* changes.
|
|
1192
|
+
*
|
|
1193
|
+
* @memberof Cesium3DTileset.prototype
|
|
1194
|
+
* @readonly
|
|
1195
|
+
* @type {number}
|
|
1196
|
+
* @private
|
|
1197
|
+
*/
|
|
1198
|
+
imageryLayersModificationCounter: {
|
|
1199
|
+
get: function () {
|
|
1200
|
+
return this._imageryLayersModificationCounter;
|
|
1201
|
+
},
|
|
1202
|
+
},
|
|
1203
|
+
|
|
1204
|
+
/**
|
|
1205
|
+
* Whether loading imagery that is draped over the tileset should be
|
|
1206
|
+
* done asynchronously.
|
|
1207
|
+
*
|
|
1208
|
+
* @memberof Cesium3DTileset.prototype
|
|
1209
|
+
* @readonly
|
|
1210
|
+
* @type {boolean}
|
|
1211
|
+
* @private
|
|
1212
|
+
*/
|
|
1213
|
+
asynchronouslyLoadImagery: {
|
|
1214
|
+
get: function () {
|
|
1215
|
+
return this._asynchronouslyLoadImagery;
|
|
1216
|
+
},
|
|
1217
|
+
},
|
|
1218
|
+
|
|
1100
1219
|
/**
|
|
1101
1220
|
* Gets the tileset's properties dictionary object, which contains metadata about per-feature properties.
|
|
1102
1221
|
* <p>
|
|
@@ -3338,6 +3457,8 @@ Cesium3DTileset.prototype.updateForPass = function (
|
|
|
3338
3457
|
Check.typeOf.object("tilesetPassState", tilesetPassState);
|
|
3339
3458
|
//>>includeEnd('debug');
|
|
3340
3459
|
|
|
3460
|
+
this.imageryLayers._update();
|
|
3461
|
+
|
|
3341
3462
|
const pass = tilesetPassState.pass;
|
|
3342
3463
|
if (
|
|
3343
3464
|
(pass === Cesium3DTilePass.PRELOAD &&
|
|
@@ -3484,6 +3605,23 @@ Cesium3DTileset.prototype.destroy = function () {
|
|
|
3484
3605
|
}
|
|
3485
3606
|
this._environmentMapManager = undefined;
|
|
3486
3607
|
|
|
3608
|
+
if (!this._imageryLayers.isDestroyed()) {
|
|
3609
|
+
this.imageryLayers.layerAdded.removeEventListener(
|
|
3610
|
+
this._imageryLayersListener,
|
|
3611
|
+
);
|
|
3612
|
+
this.imageryLayers.layerRemoved.removeEventListener(
|
|
3613
|
+
this._imageryLayersListener,
|
|
3614
|
+
);
|
|
3615
|
+
this.imageryLayers.layerMoved.removeEventListener(
|
|
3616
|
+
this._imageryLayersListener,
|
|
3617
|
+
);
|
|
3618
|
+
this.imageryLayers.layerShownOrHidden.removeEventListener(
|
|
3619
|
+
this._imageryLayersListener,
|
|
3620
|
+
);
|
|
3621
|
+
this._imageryLayers.destroy();
|
|
3622
|
+
}
|
|
3623
|
+
this._imageryLayers = undefined;
|
|
3624
|
+
|
|
3487
3625
|
return destroyObject(this);
|
|
3488
3626
|
};
|
|
3489
3627
|
|
|
@@ -409,17 +409,16 @@ GlobeSurfaceShaderSet.prototype.getShaderProgram = function (options) {
|
|
|
409
409
|
u_dayTextureTexCoordsRectangle[${i}],\n\
|
|
410
410
|
u_dayTextureTranslationAndScale[${i}],\n\
|
|
411
411
|
${applyAlpha ? `u_dayTextureAlpha[${i}]` : "1.0"},\n\
|
|
412
|
-
${applyDayNightAlpha ? `u_dayTextureNightAlpha[${i}]` : "1.0"},\n
|
|
413
|
-
|
|
414
|
-
|
|
412
|
+
${applyDayNightAlpha ? `u_dayTextureNightAlpha[${i}]` : "1.0"},\n\
|
|
413
|
+
${applyDayNightAlpha ? `u_dayTextureDayAlpha[${i}]` : "1.0"},\n\
|
|
414
|
+
${applyBrightness ? `u_dayTextureBrightness[${i}]` : "0.0"},\n\
|
|
415
415
|
${applyContrast ? `u_dayTextureContrast[${i}]` : "0.0"},\n\
|
|
416
416
|
${applyHue ? `u_dayTextureHue[${i}]` : "0.0"},\n\
|
|
417
417
|
${applySaturation ? `u_dayTextureSaturation[${i}]` : "0.0"},\n\
|
|
418
418
|
${applyGamma ? `u_dayTextureOneOverGamma[${i}]` : "0.0"},\n\
|
|
419
419
|
${applySplit ? `u_dayTextureSplit[${i}]` : "0.0"},\n\
|
|
420
420
|
${colorToAlpha ? `u_colorsToAlpha[${i}]` : "vec4(0.0)"},\n\
|
|
421
|
-
|
|
422
|
-
);\n`;
|
|
421
|
+
nightBlend\);\n`;
|
|
423
422
|
if (hasImageryLayerCutout) {
|
|
424
423
|
computeDayColor +=
|
|
425
424
|
"\
|
|
@@ -127,7 +127,7 @@ import TileImagery from "./TileImagery.js";
|
|
|
127
127
|
|
|
128
128
|
/**
|
|
129
129
|
* An imagery layer that displays tiled image data from a single imagery provider
|
|
130
|
-
* on a {@link Globe}.
|
|
130
|
+
* on a {@link Globe} or {@link Cesium3DTileset}.
|
|
131
131
|
*
|
|
132
132
|
* @alias ImageryLayer
|
|
133
133
|
* @constructor
|
|
@@ -135,8 +135,10 @@ import TileImagery from "./TileImagery.js";
|
|
|
135
135
|
* @param {ImageryProvider} [imageryProvider] The imagery provider to use.
|
|
136
136
|
* @param {ImageryLayer.ConstructorOptions} [options] An object describing initialization options
|
|
137
137
|
*
|
|
138
|
-
* @see ImageryLayer.fromProviderAsync
|
|
139
|
-
* @see ImageryLayer.fromWorldImagery
|
|
138
|
+
* @see {@link ImageryLayer.fromProviderAsync} for creating an imagery layer from an asynchronous imagery provider.
|
|
139
|
+
* @see {@link ImageryLayer.fromWorldImagery} for creating an imagery layer for Cesium ion's default global base imagery layer.
|
|
140
|
+
* @see {@link Scene#imageryLayers} for adding an imagery layer to the globe.
|
|
141
|
+
* @see {@link Cesium3DTileset#imageryLayers} for adding an imagery layer to a 3D tileset.
|
|
140
142
|
*
|
|
141
143
|
* @example
|
|
142
144
|
* // Add an OpenStreetMaps layer
|
|
@@ -155,6 +157,19 @@ import TileImagery from "./TileImagery.js";
|
|
|
155
157
|
* const imageryLayer = Cesium.ImageryLayer.fromProviderAsync(Cesium.IonImageryProvider.fromAssetId(3812));
|
|
156
158
|
* imageryLayer.alpha = 0.5;
|
|
157
159
|
* scene.imageryLayers.add(imageryLayer);
|
|
160
|
+
*
|
|
161
|
+
* @example
|
|
162
|
+
* // Drape Bing Maps Aerial imagery over a 3D tileset
|
|
163
|
+
* const tileset = await Cesium.Cesium3DTileset.fromUrl(
|
|
164
|
+
* "http://localhost:8002/tilesets/Seattle/tileset.json"
|
|
165
|
+
* );
|
|
166
|
+
* scene.primitives.add(tileset);
|
|
167
|
+
*
|
|
168
|
+
* const imageryProvider = await Cesium.createWorldImageryAsync({
|
|
169
|
+
* style: Cesium.IonWorldImageryStyle.AERIAL,
|
|
170
|
+
* });
|
|
171
|
+
* const imageryLayer = new ImageryLayer(imageryProvider);
|
|
172
|
+
* tileset.imageryLayers.add(imageryLayer);
|
|
158
173
|
*/
|
|
159
174
|
function ImageryLayer(imageryProvider, options) {
|
|
160
175
|
this._imageryProvider = imageryProvider;
|
|
@@ -663,7 +678,7 @@ ImageryLayer.prototype.getImageryRectangle = function () {
|
|
|
663
678
|
*
|
|
664
679
|
* @private
|
|
665
680
|
*
|
|
666
|
-
* @param {
|
|
681
|
+
* @param {QuadtreeTile} tile The terrain tile.
|
|
667
682
|
* @param {TerrainProvider|undefined} terrainProvider The terrain provider associated with the terrain tile.
|
|
668
683
|
* @param {number} insertionPoint The position to insert new skeletons before in the tile's imagery list.
|
|
669
684
|
* @returns {boolean} true if this layer overlaps any portion of the terrain tile; otherwise, false.
|
|
@@ -7,11 +7,12 @@ import Rectangle from "../Core/Rectangle.js";
|
|
|
7
7
|
import ImageryLayer from "./ImageryLayer.js";
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
|
-
* An ordered collection of imagery layers.
|
|
10
|
+
* An ordered collection of imagery layers for rendering raster imagery on a {@link Globe} or {@link Cesium3DTileset}.
|
|
11
11
|
*
|
|
12
12
|
* @alias ImageryLayerCollection
|
|
13
13
|
* @constructor
|
|
14
|
-
*
|
|
14
|
+
* @see {@link Scene#imageryLayers} for manipulating imagery layers on the globe.
|
|
15
|
+
* @see {@link Cesium3DTileset#imageryLayers} for manipulating imagery layers on a 3D tileset.
|
|
15
16
|
* @demo {@link https://sandcastle.cesium.com/index.html?src=Imagery%20Adjustment.html|Cesium Sandcastle Imagery Adjustment Demo}
|
|
16
17
|
* @demo {@link https://sandcastle.cesium.com/index.html?src=Imagery%20Layers%20Manipulation.html|Cesium Sandcastle Imagery Manipulation Demo}
|
|
17
18
|
*/
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal class for texture coordinate and index range computations.
|
|
3
|
+
*
|
|
4
|
+
* @private
|
|
5
|
+
*/
|
|
6
|
+
class CartesianRectangle {
|
|
7
|
+
/**
|
|
8
|
+
* Creates a new instance
|
|
9
|
+
*
|
|
10
|
+
* @param {number} [minX=0] The minimum x-coordinate
|
|
11
|
+
* @param {number} [minY=0] The minimum y-coordinate
|
|
12
|
+
* @param {number} [maxX=0] The maximum x-coordinate
|
|
13
|
+
* @param {number} [maxY=0] The maximum y-coordinate
|
|
14
|
+
*/
|
|
15
|
+
constructor(minX, minY, maxX, maxY) {
|
|
16
|
+
this._minX = minX ?? 0.0;
|
|
17
|
+
this._minY = minY ?? 0.0;
|
|
18
|
+
this._maxX = maxX ?? 0.0;
|
|
19
|
+
this._maxY = maxY ?? 0.0;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Returns the minimum x-coordinate
|
|
24
|
+
*
|
|
25
|
+
* @returns {number} The coordinate
|
|
26
|
+
*/
|
|
27
|
+
get minX() {
|
|
28
|
+
return this._minX;
|
|
29
|
+
}
|
|
30
|
+
set minX(value) {
|
|
31
|
+
this._minX = value;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Returns the minimum y-coordinate
|
|
36
|
+
*
|
|
37
|
+
* @returns {number} The coordinate
|
|
38
|
+
*/
|
|
39
|
+
get minY() {
|
|
40
|
+
return this._minY;
|
|
41
|
+
}
|
|
42
|
+
set minY(value) {
|
|
43
|
+
this._minY = value;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Returns the maximum x-coordinate
|
|
48
|
+
*
|
|
49
|
+
* @returns {number} The coordinate
|
|
50
|
+
*/
|
|
51
|
+
get maxX() {
|
|
52
|
+
return this._maxX;
|
|
53
|
+
}
|
|
54
|
+
set maxX(value) {
|
|
55
|
+
this._maxX = value;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Returns the maximum y-coordinate
|
|
60
|
+
*
|
|
61
|
+
* @returns {number} The coordinate
|
|
62
|
+
*/
|
|
63
|
+
get maxY() {
|
|
64
|
+
return this._maxY;
|
|
65
|
+
}
|
|
66
|
+
set maxY(value) {
|
|
67
|
+
this._maxY = value;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Returns whether this rectangle contains the given coordinates,
|
|
72
|
+
* using the default containment check, which includes the
|
|
73
|
+
* minimum point, but excludes the maximum point
|
|
74
|
+
*
|
|
75
|
+
* @param {number} x The x-coordinate
|
|
76
|
+
* @param {number} y The y-coordinate
|
|
77
|
+
* @returns {boolean} The result
|
|
78
|
+
*/
|
|
79
|
+
contains(x, y) {
|
|
80
|
+
return x >= this.minX && x < this.maxX && y >= this.minY && y < this.maxY;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Returns whether this rectangle contains the given coordinates,
|
|
85
|
+
* excluding the border
|
|
86
|
+
*
|
|
87
|
+
* @param {number} x The x-coordinate
|
|
88
|
+
* @param {number} y The y-coordinate
|
|
89
|
+
* @returns {boolean} The result
|
|
90
|
+
*/
|
|
91
|
+
containsExclusive(x, y) {
|
|
92
|
+
return x > this.minX && x < this.maxX && y > this.minY && y < this.maxY;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Returns whether this rectangle contains the given coordinates,
|
|
97
|
+
* including the border
|
|
98
|
+
*
|
|
99
|
+
* @param {number} x The x-coordinate
|
|
100
|
+
* @param {number} y The y-coordinate
|
|
101
|
+
* @returns {boolean} The result
|
|
102
|
+
*/
|
|
103
|
+
containsInclusive(x, y) {
|
|
104
|
+
return x >= this.minX && x <= this.maxX && y >= this.minY && y <= this.maxY;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export default CartesianRectangle;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A class containing a the values that affect the appearance of
|
|
3
|
+
* an <code>ImageryLayer</code>.
|
|
4
|
+
*
|
|
5
|
+
* This is used in the <code>ModelImagery</code> to detect changes in
|
|
6
|
+
* the imagery settings: The <code>ModelImagery</code> stores one
|
|
7
|
+
* instance per imagery layer. During the <code>update</code>
|
|
8
|
+
* call, it checks whether any of the settings was changed.
|
|
9
|
+
* If this is the case, the draw commands of the model are reset.
|
|
10
|
+
*
|
|
11
|
+
* @private
|
|
12
|
+
*/
|
|
13
|
+
class ImageryConfiguration {
|
|
14
|
+
constructor(imageryLayer) {
|
|
15
|
+
this.alpha = imageryLayer.alpha;
|
|
16
|
+
this.brightness = imageryLayer.brightness;
|
|
17
|
+
this.contrast = imageryLayer.contrast;
|
|
18
|
+
this.hue = imageryLayer.hue;
|
|
19
|
+
this.saturation = imageryLayer.saturation;
|
|
20
|
+
this.gamma = imageryLayer.gamma;
|
|
21
|
+
this.colorToAlpha = imageryLayer.colorToAlpha;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export default ImageryConfiguration;
|