@cesium/engine 2.1.0 → 2.3.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/{AttributeCompression-8a5a065e.js → AttributeCompression-f9f6c717.js} +1 -1
- package/Build/Workers/{AxisAlignedBoundingBox-a6f9f0e5.js → AxisAlignedBoundingBox-31fadcf0.js} +1 -1
- package/Build/Workers/{BoundingRectangle-b0a68595.js → BoundingRectangle-995f0079.js} +1 -1
- package/Build/Workers/{BoxGeometry-baedd794.js → BoxGeometry-7eb1af60.js} +1 -1
- package/Build/Workers/{Color-f85df1be.js → Color-2dc49658.js} +1 -1
- package/Build/Workers/{CoplanarPolygonGeometryLibrary-30516950.js → CoplanarPolygonGeometryLibrary-d7d972d6.js} +1 -1
- package/Build/Workers/{CorridorGeometryLibrary-5d5d3b3a.js → CorridorGeometryLibrary-1f5ef7b3.js} +1 -1
- package/Build/Workers/{CylinderGeometry-d899ae26.js → CylinderGeometry-23c67a6c.js} +1 -1
- package/Build/Workers/{CylinderGeometryLibrary-135b0858.js → CylinderGeometryLibrary-7bf291b4.js} +1 -1
- package/Build/Workers/{EllipseGeometry-a49f8449.js → EllipseGeometry-37014da4.js} +1 -1
- package/Build/Workers/{EllipseGeometryLibrary-cba7edde.js → EllipseGeometryLibrary-92ab6b1e.js} +1 -1
- package/Build/Workers/{EllipseOutlineGeometry-8095c8cb.js → EllipseOutlineGeometry-12b6fef5.js} +1 -1
- package/Build/Workers/{EllipsoidGeodesic-dcff5cbd.js → EllipsoidGeodesic-5b3623dc.js} +1 -1
- package/Build/Workers/{EllipsoidGeometry-ed93f571.js → EllipsoidGeometry-508da15c.js} +1 -1
- package/Build/Workers/{EllipsoidOutlineGeometry-e4854854.js → EllipsoidOutlineGeometry-40d97455.js} +1 -1
- package/Build/Workers/{EllipsoidRhumbLine-b672d507.js → EllipsoidRhumbLine-ef872433.js} +1 -1
- package/Build/Workers/{EllipsoidTangentPlane-7ae1aa9a.js → EllipsoidTangentPlane-46d4d9c2.js} +1 -1
- package/Build/Workers/{EncodedCartesian3-e8bbca36.js → EncodedCartesian3-57415c8a.js} +1 -1
- package/Build/Workers/{FrustumGeometry-b62db3e3.js → FrustumGeometry-38605e69.js} +32 -4
- package/Build/Workers/{GeometryAttribute-780af4fa.js → GeometryAttribute-a466e9c7.js} +1 -1
- package/Build/Workers/{GeometryInstance-3fb607b7.js → GeometryInstance-34d9e21e.js} +1 -1
- package/Build/Workers/{GeometryPipeline-36b61c99.js → GeometryPipeline-dcf79306.js} +1 -1
- package/Build/Workers/{IndexDatatype-b8f3e09d.js → IndexDatatype-2643aa47.js} +1 -1
- package/Build/Workers/{IntersectionTests-e889fcf0.js → IntersectionTests-88c49b2e.js} +1 -1
- package/Build/Workers/{Math-dad82b4d.js → Math-0a2ac845.js} +12 -2
- package/Build/Workers/{Matrix2-1e403d0e.js → Matrix2-e1298525.js} +1 -1
- package/Build/Workers/{Matrix3-fa806b97.js → Matrix3-41c58dde.js} +1 -1
- package/Build/Workers/{OrientedBoundingBox-43478ac8.js → OrientedBoundingBox-2dd47921.js} +5 -3
- package/Build/Workers/{Plane-c27e1ac6.js → Plane-4c3d403b.js} +1 -1
- package/Build/Workers/{PolygonGeometryLibrary-38a98276.js → PolygonGeometryLibrary-59126025.js} +1 -1
- package/Build/Workers/PolygonPipeline-1fe328c0.js +1344 -0
- package/Build/Workers/{PolylinePipeline-30e4cec9.js → PolylinePipeline-896735cc.js} +1 -1
- package/Build/Workers/{PolylineVolumeGeometryLibrary-90551d26.js → PolylineVolumeGeometryLibrary-9c0639f7.js} +1 -1
- package/Build/Workers/{PrimitivePipeline-558d9cb0.js → PrimitivePipeline-fc1a47ff.js} +1 -1
- package/Build/Workers/{RectangleGeometryLibrary-815c68df.js → RectangleGeometryLibrary-a23c9ebe.js} +1 -1
- package/Build/Workers/{TerrainEncoding-341ead52.js → TerrainEncoding-51b8b33b.js} +1 -1
- package/Build/Workers/Transforms-bc45e707.js +14699 -0
- package/Build/Workers/{WallGeometryLibrary-ccf90976.js → WallGeometryLibrary-007e9883.js} +1 -1
- package/Build/Workers/{WebMercatorProjection-76a3fcc0.js → WebMercatorProjection-13ed1a6e.js} +1 -1
- package/Build/Workers/{arrayRemoveDuplicates-fac118a8.js → arrayRemoveDuplicates-d2061e85.js} +1 -1
- package/Build/Workers/cesiumWorkerBootstrapper.js +1 -1
- package/Build/Workers/combineGeometry.js +1 -1
- package/Build/Workers/createBoxGeometry.js +1 -1
- package/Build/Workers/createBoxOutlineGeometry.js +1 -1
- package/Build/Workers/createCircleGeometry.js +1 -1
- package/Build/Workers/createCircleOutlineGeometry.js +1 -1
- package/Build/Workers/createCoplanarPolygonGeometry.js +1 -1
- package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +1 -1
- package/Build/Workers/createCorridorGeometry.js +1 -1
- package/Build/Workers/createCorridorOutlineGeometry.js +1 -1
- package/Build/Workers/createCylinderGeometry.js +1 -1
- package/Build/Workers/createCylinderOutlineGeometry.js +1 -1
- package/Build/Workers/createEllipseGeometry.js +1 -1
- package/Build/Workers/createEllipseOutlineGeometry.js +1 -1
- package/Build/Workers/createEllipsoidGeometry.js +1 -1
- package/Build/Workers/createEllipsoidOutlineGeometry.js +1 -1
- package/Build/Workers/createFrustumGeometry.js +1 -1
- package/Build/Workers/createFrustumOutlineGeometry.js +1 -1
- package/Build/Workers/createGeometry.js +1 -1
- package/Build/Workers/createGroundPolylineGeometry.js +1 -1
- package/Build/Workers/createPlaneGeometry.js +1 -1
- package/Build/Workers/createPlaneOutlineGeometry.js +1 -1
- package/Build/Workers/createPolygonGeometry.js +1 -1
- package/Build/Workers/createPolygonOutlineGeometry.js +1 -1
- package/Build/Workers/createPolylineGeometry.js +1 -1
- package/Build/Workers/createPolylineVolumeGeometry.js +1 -1
- package/Build/Workers/createPolylineVolumeOutlineGeometry.js +1 -1
- package/Build/Workers/createRectangleGeometry.js +1 -1
- package/Build/Workers/createRectangleOutlineGeometry.js +1 -1
- package/Build/Workers/createSimplePolylineGeometry.js +1 -1
- package/Build/Workers/createSphereGeometry.js +1 -1
- package/Build/Workers/createSphereOutlineGeometry.js +1 -1
- package/Build/Workers/createVectorTileClampedPolylines.js +1 -1
- package/Build/Workers/createVectorTileGeometries.js +1 -1
- package/Build/Workers/createVectorTilePoints.js +1 -1
- package/Build/Workers/createVectorTilePolygons.js +1 -1
- package/Build/Workers/createVectorTilePolylines.js +1 -1
- package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +1 -1
- package/Build/Workers/createVerticesFromHeightmap.js +5 -8
- package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +10 -15
- package/Build/Workers/createWallGeometry.js +1 -1
- package/Build/Workers/createWallOutlineGeometry.js +1 -1
- package/Build/Workers/decodeDraco.js +1 -1
- package/Build/Workers/decodeI3S.js +1 -1
- package/Build/Workers/package.js +1 -1
- package/Build/Workers/transferTypedArrayTest.js +1 -1
- package/Build/Workers/upsampleQuantizedTerrainMesh.js +1 -1
- package/Source/Core/ArcGISTiledElevationTerrainProvider.js +291 -191
- package/Source/Core/BingMapsGeocoderService.js +19 -1
- package/Source/Core/CartographicGeocoderService.js +15 -0
- package/Source/Core/CesiumTerrainProvider.js +571 -434
- package/Source/Core/Credit.js +1 -1
- package/Source/Core/CustomHeightmapTerrainProvider.js +12 -0
- package/Source/Core/EllipsoidTerrainProvider.js +17 -10
- package/Source/Core/FrustumGeometry.js +4 -3
- package/Source/Core/GeocoderService.js +32 -1
- package/Source/Core/GoogleEarthEnterpriseMetadata.js +86 -34
- package/Source/Core/GoogleEarthEnterpriseTerrainProvider.js +119 -82
- package/Source/Core/Ion.js +1 -1
- package/Source/Core/IonGeocoderService.js +17 -2
- package/Source/Core/IonResource.js +14 -3
- package/Source/Core/OpenCageGeocoderService.js +18 -1
- package/Source/Core/OrientedBoundingBox.js +4 -2
- package/Source/Core/OrthographicFrustum.js +13 -0
- package/Source/Core/PeliasGeocoderService.js +14 -1
- package/Source/Core/PerspectiveFrustum.js +14 -0
- package/Source/Core/Request.js +3 -2
- package/Source/Core/RequestScheduler.js +10 -5
- package/Source/Core/Resource.js +230 -236
- package/Source/Core/TerrainProvider.js +9 -14
- package/Source/Core/TileProviderError.js +8 -8
- package/Source/Core/VRTheWorldTerrainProvider.js +193 -124
- package/Source/Core/buildModuleUrl.js +4 -3
- package/Source/Core/createWorldTerrain.js +20 -2
- package/Source/Core/createWorldTerrainAsync.js +48 -0
- package/Source/Core/sampleTerrain.js +9 -10
- package/Source/Core/sampleTerrainMostDetailed.js +66 -72
- package/Source/DataSources/Cesium3DTilesetVisualizer.js +37 -26
- package/Source/DataSources/DataSourceDisplay.js +2 -2
- package/Source/DataSources/Entity.js +6 -1
- package/Source/DataSources/EntityCluster.js +126 -128
- package/Source/DataSources/ModelVisualizer.js +104 -34
- package/Source/DataSources/PolygonGraphics.js +1 -1
- package/Source/Renderer/UniformState.js +3 -2
- package/Source/Renderer/demodernizeShader.js +5 -5
- package/Source/Scene/ArcGisBaseMapType.js +12 -0
- package/Source/Scene/ArcGisMapServerImageryProvider.js +694 -376
- package/Source/Scene/ArcGisMapService.js +83 -0
- package/Source/Scene/BingMapsImageryProvider.js +511 -305
- package/Source/Scene/BufferLoader.js +29 -34
- package/Source/Scene/Camera.js +8 -7
- package/Source/Scene/Cesium3DTile.js +392 -254
- package/Source/Scene/Cesium3DTileBatchTable.js +2 -2
- package/Source/Scene/Cesium3DTileContent.js +16 -0
- package/Source/Scene/Cesium3DTileContentFactory.js +4 -4
- package/Source/Scene/Cesium3DTilePass.js +8 -11
- package/Source/Scene/Cesium3DTileStyleEngine.js +1 -1
- package/Source/Scene/Cesium3DTilesVoxelProvider.js +225 -117
- package/Source/Scene/Cesium3DTileset.js +756 -482
- package/Source/Scene/Cesium3DTilesetBaseTraversal.js +301 -0
- package/Source/Scene/Cesium3DTilesetMostDetailedTraversal.js +33 -46
- package/Source/Scene/Cesium3DTilesetSkipTraversal.js +421 -0
- package/Source/Scene/Cesium3DTilesetTraversal.js +219 -671
- package/Source/Scene/ClassificationPrimitive.js +7 -0
- package/Source/Scene/Composite3DTileContent.js +69 -26
- package/Source/Scene/CreditDisplay.js +132 -20
- package/Source/Scene/DepthPlane.js +1 -1
- package/Source/Scene/Empty3DTileContent.js +31 -1
- package/Source/Scene/Geometry3DTileContent.js +47 -7
- package/Source/Scene/Globe.js +5 -1
- package/Source/Scene/GlobeSurfaceTile.js +2 -1
- package/Source/Scene/GlobeSurfaceTileProvider.js +53 -30
- package/Source/Scene/GltfBufferViewLoader.js +47 -91
- package/Source/Scene/GltfDracoLoader.js +110 -112
- package/Source/Scene/GltfImageLoader.js +71 -78
- package/Source/Scene/GltfIndexBufferLoader.js +108 -121
- package/Source/Scene/GltfJsonLoader.js +87 -74
- package/Source/Scene/GltfLoader.js +381 -300
- package/Source/Scene/GltfStructuralMetadataLoader.js +109 -110
- package/Source/Scene/GltfTextureLoader.js +97 -96
- package/Source/Scene/GltfVertexBufferLoader.js +128 -133
- package/Source/Scene/GoogleEarthEnterpriseImageryProvider.js +353 -225
- package/Source/Scene/GoogleEarthEnterpriseMapsProvider.js +491 -331
- package/Source/Scene/GridImageryProvider.js +267 -104
- package/Source/Scene/GroundPolylinePrimitive.js +12 -1
- package/Source/Scene/GroundPrimitive.js +8 -1
- package/Source/Scene/I3SDataProvider.js +214 -113
- package/Source/Scene/I3SFeature.js +7 -6
- package/Source/Scene/I3SLayer.js +26 -37
- package/Source/Scene/I3SNode.js +59 -66
- package/Source/Scene/Imagery.js +6 -1
- package/Source/Scene/ImageryLayer.js +299 -48
- package/Source/Scene/ImageryLayerCollection.js +26 -0
- package/Source/Scene/ImageryProvider.js +129 -111
- package/Source/Scene/Implicit3DTileContent.js +72 -23
- package/Source/Scene/ImplicitSubtree.js +66 -45
- package/Source/Scene/IonImageryProvider.js +482 -275
- package/Source/Scene/MapboxImageryProvider.js +272 -112
- package/Source/Scene/MapboxStyleImageryProvider.js +270 -111
- package/Source/Scene/MetadataSchemaLoader.js +26 -36
- package/Source/Scene/Model/B3dmLoader.js +42 -46
- package/Source/Scene/Model/GeoJsonLoader.js +8 -32
- package/Source/Scene/Model/I3dmLoader.js +48 -74
- package/Source/Scene/Model/MaterialPipelineStage.js +12 -12
- package/Source/Scene/Model/Model.js +514 -135
- package/Source/Scene/Model/Model3DTileContent.js +83 -31
- package/Source/Scene/Model/ModelAnimationCollection.js +3 -3
- package/Source/Scene/Model/ModelDrawCommand.js +15 -26
- package/Source/Scene/Model/ModelUtility.js +16 -16
- package/Source/Scene/Model/PntsLoader.js +27 -32
- package/Source/Scene/Model/UniformType.js +1 -1
- package/Source/Scene/Multiple3DTileContent.js +134 -115
- package/Source/Scene/Picking.js +3 -2
- package/Source/Scene/PointCloud.js +11 -19
- package/Source/Scene/Primitive.js +20 -0
- package/Source/Scene/QuadtreePrimitive.js +5 -2
- package/Source/Scene/QuadtreeTileProvider.js +4 -8
- package/Source/Scene/ResourceCache.js +47 -105
- package/Source/Scene/ResourceCacheStatistics.js +24 -58
- package/Source/Scene/ResourceLoader.js +5 -17
- package/Source/Scene/ResourceLoaderState.js +12 -4
- package/Source/Scene/Scene.js +65 -0
- package/Source/Scene/SceneTransforms.js +3 -2
- package/Source/Scene/ScreenSpaceCameraController.js +2 -2
- package/Source/Scene/SingleTileImageryProvider.js +382 -209
- package/Source/Scene/Terrain.js +196 -0
- package/Source/Scene/TileCoordinatesImageryProvider.js +267 -104
- package/Source/Scene/TileMapServiceImageryProvider.js +177 -85
- package/Source/Scene/Tileset3DTileContent.js +47 -5
- package/Source/Scene/TimeDynamicPointCloud.js +15 -2
- package/Source/Scene/UrlTemplateImageryProvider.js +343 -215
- package/Source/Scene/Vector3DTileClampedPolylines.js +96 -84
- package/Source/Scene/Vector3DTileContent.js +47 -22
- package/Source/Scene/Vector3DTileGeometry.js +57 -52
- package/Source/Scene/Vector3DTilePoints.js +97 -81
- package/Source/Scene/Vector3DTilePolygons.js +118 -117
- package/Source/Scene/Vector3DTilePolylines.js +86 -82
- package/Source/Scene/Vector3DTilePrimitive.js +0 -1
- package/Source/Scene/VoxelContent.js +61 -63
- package/Source/Scene/VoxelPrimitive.js +39 -91
- package/Source/Scene/VoxelProvider.js +2 -2
- package/Source/Scene/WebMapServiceImageryProvider.js +272 -111
- package/Source/Scene/WebMapTileServiceImageryProvider.js +270 -107
- package/Source/Scene/computeFlyToLocationForRectangle.js +33 -37
- package/Source/Scene/createOsmBuildings.js +6 -0
- package/Source/Scene/createOsmBuildingsAsync.js +82 -0
- package/Source/Scene/createWorldImagery.js +14 -5
- package/Source/Scene/createWorldImageryAsync.js +39 -0
- package/Source/Shaders/AtmosphereCommon.glsl +51 -8
- package/Source/Shaders/AtmosphereCommon.js +51 -8
- package/Source/Shaders/PostProcessStages/AmbientOcclusionGenerate.glsl +1 -1
- package/Source/Shaders/PostProcessStages/AmbientOcclusionGenerate.js +1 -1
- package/Source/Shaders/PostProcessStages/AmbientOcclusionModulate.glsl +3 -3
- package/Source/Shaders/PostProcessStages/AmbientOcclusionModulate.js +3 -3
- package/Source/Widget/CesiumWidget.js +67 -27
- package/index.d.ts +2429 -1475
- package/index.js +324 -315
- package/package.json +4 -4
- package/Build/Workers/PolygonPipeline-d31ff61c.js +0 -1345
- package/Build/Workers/Transforms-9e9df299.js +0 -14714
|
@@ -112,9 +112,8 @@ function Vector3DTileClampedPolylines(options) {
|
|
|
112
112
|
this._geometryByteLength = 0;
|
|
113
113
|
|
|
114
114
|
this._ready = false;
|
|
115
|
-
this.
|
|
116
|
-
this.
|
|
117
|
-
this._verticesPromise = undefined;
|
|
115
|
+
this._promise = undefined;
|
|
116
|
+
this._error = undefined;
|
|
118
117
|
}
|
|
119
118
|
|
|
120
119
|
Object.defineProperties(Vector3DTileClampedPolylines.prototype, {
|
|
@@ -147,14 +146,14 @@ Object.defineProperties(Vector3DTileClampedPolylines.prototype, {
|
|
|
147
146
|
},
|
|
148
147
|
|
|
149
148
|
/**
|
|
150
|
-
*
|
|
149
|
+
* Returns true when the primitive is ready to render.
|
|
151
150
|
* @memberof Vector3DTileClampedPolylines.prototype
|
|
152
|
-
* @type {
|
|
151
|
+
* @type {boolean}
|
|
153
152
|
* @readonly
|
|
154
153
|
*/
|
|
155
|
-
|
|
154
|
+
ready: {
|
|
156
155
|
get: function () {
|
|
157
|
-
return this.
|
|
156
|
+
return this._ready;
|
|
158
157
|
},
|
|
159
158
|
},
|
|
160
159
|
});
|
|
@@ -222,51 +221,55 @@ function createVertexArray(polylines, context) {
|
|
|
222
221
|
return;
|
|
223
222
|
}
|
|
224
223
|
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
let batchIds = polylines._transferrableBatchIds;
|
|
224
|
+
let positions = polylines._positions;
|
|
225
|
+
let widths = polylines._widths;
|
|
226
|
+
let counts = polylines._counts;
|
|
227
|
+
let batchIds = polylines._transferrableBatchIds;
|
|
230
228
|
|
|
231
|
-
|
|
229
|
+
let packedBuffer = polylines._packedBuffer;
|
|
232
230
|
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
231
|
+
if (!defined(packedBuffer)) {
|
|
232
|
+
// Copy because they may be the views on the same buffer.
|
|
233
|
+
positions = polylines._positions = positions.slice();
|
|
234
|
+
widths = polylines._widths = widths.slice();
|
|
235
|
+
counts = polylines._counts = counts.slice();
|
|
238
236
|
|
|
239
|
-
|
|
237
|
+
batchIds = polylines._transferrableBatchIds = polylines._batchIds.slice();
|
|
240
238
|
|
|
241
|
-
|
|
242
|
-
|
|
239
|
+
packedBuffer = polylines._packedBuffer = packBuffer(polylines);
|
|
240
|
+
}
|
|
243
241
|
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
242
|
+
const transferrableObjects = [
|
|
243
|
+
positions.buffer,
|
|
244
|
+
widths.buffer,
|
|
245
|
+
counts.buffer,
|
|
246
|
+
batchIds.buffer,
|
|
247
|
+
packedBuffer.buffer,
|
|
248
|
+
];
|
|
249
|
+
const parameters = {
|
|
250
|
+
positions: positions.buffer,
|
|
251
|
+
widths: widths.buffer,
|
|
252
|
+
counts: counts.buffer,
|
|
253
|
+
batchIds: batchIds.buffer,
|
|
254
|
+
packedBuffer: packedBuffer.buffer,
|
|
255
|
+
keepDecodedPositions: polylines._keepDecodedPositions,
|
|
256
|
+
};
|
|
257
|
+
|
|
258
|
+
const verticesPromise = createVerticesTaskProcessor.scheduleTask(
|
|
259
|
+
parameters,
|
|
260
|
+
transferrableObjects
|
|
261
|
+
);
|
|
262
|
+
if (!defined(verticesPromise)) {
|
|
263
|
+
// Postponed
|
|
264
|
+
return;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
return verticesPromise
|
|
268
|
+
.then(function (result) {
|
|
269
|
+
if (polylines.isDestroyed()) {
|
|
270
|
+
return;
|
|
271
|
+
}
|
|
268
272
|
|
|
269
|
-
return verticesPromise.then(function (result) {
|
|
270
273
|
if (polylines._keepDecodedPositions) {
|
|
271
274
|
polylines._decodedPositions = new Float64Array(result.decodedPositions);
|
|
272
275
|
polylines._decodedPositionOffsets = new Uint32Array(
|
|
@@ -300,13 +303,21 @@ function createVertexArray(polylines, context) {
|
|
|
300
303
|
? new Uint16Array(result.indices)
|
|
301
304
|
: new Uint32Array(result.indices);
|
|
302
305
|
|
|
306
|
+
finishVertexArray(polylines, context);
|
|
303
307
|
polylines._ready = true;
|
|
308
|
+
})
|
|
309
|
+
.catch((error) => {
|
|
310
|
+
if (polylines.isDestroyed()) {
|
|
311
|
+
return;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
// Throw the error next frame
|
|
315
|
+
polylines._error = error;
|
|
304
316
|
});
|
|
305
|
-
}
|
|
306
317
|
}
|
|
307
318
|
|
|
308
319
|
function finishVertexArray(polylines, context) {
|
|
309
|
-
if (
|
|
320
|
+
if (!defined(polylines._va)) {
|
|
310
321
|
const startEllipsoidNormals = polylines._startEllipsoidNormals;
|
|
311
322
|
const endEllipsoidNormals = polylines._endEllipsoidNormals;
|
|
312
323
|
const startPositionAndHeights = polylines._startPositionAndHeights;
|
|
@@ -692,43 +703,22 @@ Vector3DTileClampedPolylines.prototype.applyStyle = function (style, features) {
|
|
|
692
703
|
};
|
|
693
704
|
|
|
694
705
|
function initialize(polylines) {
|
|
695
|
-
return ApproximateTerrainHeights.initialize()
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
706
|
+
return ApproximateTerrainHeights.initialize()
|
|
707
|
+
.then(function () {
|
|
708
|
+
updateMinimumMaximumHeights(
|
|
709
|
+
polylines,
|
|
710
|
+
polylines._rectangle,
|
|
711
|
+
polylines._ellipsoid
|
|
712
|
+
);
|
|
713
|
+
})
|
|
714
|
+
.catch((error) => {
|
|
715
|
+
if (polylines.isDestroyed()) {
|
|
716
|
+
return;
|
|
717
|
+
}
|
|
701
718
|
|
|
702
|
-
|
|
703
|
-
polylines.
|
|
704
|
-
const context = frameState.context;
|
|
705
|
-
const promise = createVertexArray(polylines, context);
|
|
706
|
-
createUniformMap(polylines, context);
|
|
707
|
-
createShaders(polylines, context);
|
|
708
|
-
createRenderStates(polylines);
|
|
709
|
-
|
|
710
|
-
if (polylines._ready) {
|
|
711
|
-
const passes = frameState.passes;
|
|
712
|
-
if (passes.render || passes.pick) {
|
|
713
|
-
queueCommands(polylines, frameState);
|
|
714
|
-
}
|
|
715
|
-
}
|
|
716
|
-
|
|
717
|
-
if (!defined(promise)) {
|
|
718
|
-
return;
|
|
719
|
-
}
|
|
720
|
-
|
|
721
|
-
promise
|
|
722
|
-
.then(function () {
|
|
723
|
-
finishVertexArray(polylines, context);
|
|
724
|
-
resolve(polylines);
|
|
725
|
-
})
|
|
726
|
-
.catch(function (e) {
|
|
727
|
-
reject(e);
|
|
728
|
-
});
|
|
729
|
-
};
|
|
719
|
+
// Throw the error next frame
|
|
720
|
+
polylines._error = error;
|
|
730
721
|
});
|
|
731
|
-
});
|
|
732
722
|
}
|
|
733
723
|
|
|
734
724
|
/**
|
|
@@ -737,7 +727,29 @@ function initialize(polylines) {
|
|
|
737
727
|
* @param {FrameState} frameState The current frame state.
|
|
738
728
|
*/
|
|
739
729
|
Vector3DTileClampedPolylines.prototype.update = function (frameState) {
|
|
740
|
-
|
|
730
|
+
const context = frameState.context;
|
|
731
|
+
if (!this._ready) {
|
|
732
|
+
if (!defined(this._promise)) {
|
|
733
|
+
this._promise = initialize(this).then(createVertexArray(this, context));
|
|
734
|
+
}
|
|
735
|
+
|
|
736
|
+
if (defined(this._error)) {
|
|
737
|
+
const error = this._error;
|
|
738
|
+
this._error = undefined;
|
|
739
|
+
throw error;
|
|
740
|
+
}
|
|
741
|
+
|
|
742
|
+
return;
|
|
743
|
+
}
|
|
744
|
+
|
|
745
|
+
createUniformMap(this, context);
|
|
746
|
+
createShaders(this, context);
|
|
747
|
+
createRenderStates(this);
|
|
748
|
+
|
|
749
|
+
const passes = frameState.passes;
|
|
750
|
+
if (passes.render || passes.pick) {
|
|
751
|
+
queueCommands(this, frameState);
|
|
752
|
+
}
|
|
741
753
|
};
|
|
742
754
|
|
|
743
755
|
/**
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import Cartesian3 from "../Core/Cartesian3.js";
|
|
2
2
|
import defaultValue from "../Core/defaultValue.js";
|
|
3
3
|
import defined from "../Core/defined.js";
|
|
4
|
+
import deprecationWarning from "../Core/deprecationWarning.js";
|
|
4
5
|
import destroyObject from "../Core/destroyObject.js";
|
|
5
6
|
import DeveloperError from "../Core/DeveloperError.js";
|
|
6
7
|
import Ellipsoid from "../Core/Ellipsoid.js";
|
|
@@ -51,6 +52,14 @@ function Vector3DTileContent(tileset, tile, resource, arrayBuffer, byteOffset) {
|
|
|
51
52
|
this.featurePropertiesDirty = false;
|
|
52
53
|
this._group = undefined;
|
|
53
54
|
|
|
55
|
+
this._ready = false;
|
|
56
|
+
|
|
57
|
+
// This is here for backwards compatibility and can be removed when readyPromise is removed.
|
|
58
|
+
this._resolveContent = undefined;
|
|
59
|
+
this._readyPromise = new Promise((resolve) => {
|
|
60
|
+
this._resolveContent = resolve;
|
|
61
|
+
});
|
|
62
|
+
|
|
54
63
|
initialize(this, arrayBuffer, byteOffset);
|
|
55
64
|
}
|
|
56
65
|
|
|
@@ -119,24 +128,38 @@ Object.defineProperties(Vector3DTileContent.prototype, {
|
|
|
119
128
|
},
|
|
120
129
|
},
|
|
121
130
|
|
|
131
|
+
/**
|
|
132
|
+
* Returns true when the tile's content is ready to render; otherwise false
|
|
133
|
+
*
|
|
134
|
+
* @memberof Vector3DTileContent.prototype
|
|
135
|
+
*
|
|
136
|
+
* @type {boolean}
|
|
137
|
+
* @readonly
|
|
138
|
+
* @private
|
|
139
|
+
*/
|
|
140
|
+
ready: {
|
|
141
|
+
get: function () {
|
|
142
|
+
return this._ready;
|
|
143
|
+
},
|
|
144
|
+
},
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Gets the promise that will be resolved when the tile's content is ready to render.
|
|
148
|
+
*
|
|
149
|
+
* @memberof Vector3DTileContent.prototype
|
|
150
|
+
*
|
|
151
|
+
* @type {Promise<Vector3DTileContent>}
|
|
152
|
+
* @readonly
|
|
153
|
+
* @deprecated
|
|
154
|
+
* @private
|
|
155
|
+
*/
|
|
122
156
|
readyPromise: {
|
|
123
157
|
get: function () {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
const polygonPromise = defined(this._polygons)
|
|
128
|
-
? this._polygons.readyPromise
|
|
129
|
-
: undefined;
|
|
130
|
-
const polylinePromise = defined(this._polylines)
|
|
131
|
-
? this._polylines.readyPromise
|
|
132
|
-
: undefined;
|
|
133
|
-
|
|
134
|
-
const that = this;
|
|
135
|
-
return Promise.all([pointsPromise, polygonPromise, polylinePromise]).then(
|
|
136
|
-
function () {
|
|
137
|
-
return that;
|
|
138
|
-
}
|
|
158
|
+
deprecationWarning(
|
|
159
|
+
"Vector3DTileContent.readyPromise",
|
|
160
|
+
"Vector3DTileContent.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Wait for Vector3DTileContent.ready to return true instead."
|
|
139
161
|
);
|
|
162
|
+
return this._readyPromise;
|
|
140
163
|
},
|
|
141
164
|
},
|
|
142
165
|
|
|
@@ -245,7 +268,7 @@ function getBatchIds(featureTableJson, featureTableBinary) {
|
|
|
245
268
|
|
|
246
269
|
if (atLeastOneDefined && atLeastOneUndefined) {
|
|
247
270
|
throw new RuntimeError(
|
|
248
|
-
"If one group of batch ids is defined, then all batch ids must be defined
|
|
271
|
+
"If one group of batch ids is defined, then all batch ids must be defined"
|
|
249
272
|
);
|
|
250
273
|
}
|
|
251
274
|
|
|
@@ -311,7 +334,9 @@ function initialize(content, arrayBuffer, byteOffset) {
|
|
|
311
334
|
byteOffset += sizeOfUint32;
|
|
312
335
|
|
|
313
336
|
if (byteLength === 0) {
|
|
314
|
-
|
|
337
|
+
content._ready = true;
|
|
338
|
+
content._resolveContent(content);
|
|
339
|
+
return;
|
|
315
340
|
}
|
|
316
341
|
|
|
317
342
|
const featureTableJSONByteLength = view.getUint32(byteOffset, true);
|
|
@@ -635,8 +660,6 @@ function initialize(content, arrayBuffer, byteOffset) {
|
|
|
635
660
|
batchTable: batchTable,
|
|
636
661
|
});
|
|
637
662
|
}
|
|
638
|
-
|
|
639
|
-
return Promise.resolve(content);
|
|
640
663
|
}
|
|
641
664
|
|
|
642
665
|
function createFeatures(content) {
|
|
@@ -713,21 +736,23 @@ Vector3DTileContent.prototype.update = function (tileset, frameState) {
|
|
|
713
736
|
this._polygons.classificationType = this._tileset.classificationType;
|
|
714
737
|
this._polygons.debugWireframe = this._tileset.debugWireframe;
|
|
715
738
|
this._polygons.update(frameState);
|
|
716
|
-
ready = ready && this._polygons.
|
|
739
|
+
ready = ready && this._polygons.ready;
|
|
717
740
|
}
|
|
718
741
|
if (defined(this._polylines)) {
|
|
719
742
|
this._polylines.update(frameState);
|
|
720
|
-
ready = ready && this._polylines.
|
|
743
|
+
ready = ready && this._polylines.ready;
|
|
721
744
|
}
|
|
722
745
|
if (defined(this._points)) {
|
|
723
746
|
this._points.update(frameState);
|
|
724
|
-
ready = ready && this._points.
|
|
747
|
+
ready = ready && this._points.ready;
|
|
725
748
|
}
|
|
726
749
|
if (defined(this._batchTable) && ready) {
|
|
727
750
|
if (!defined(this._features)) {
|
|
728
751
|
createFeatures(this);
|
|
729
752
|
}
|
|
730
753
|
this._batchTable.update(tileset, frameState);
|
|
754
|
+
this._ready = true;
|
|
755
|
+
this._resolveContent(this);
|
|
731
756
|
}
|
|
732
757
|
};
|
|
733
758
|
|
|
@@ -71,8 +71,8 @@ function Vector3DTileGeometry(options) {
|
|
|
71
71
|
this._packedBuffer = undefined;
|
|
72
72
|
|
|
73
73
|
this._ready = false;
|
|
74
|
-
this.
|
|
75
|
-
this.
|
|
74
|
+
this._promise = undefined;
|
|
75
|
+
this._error = undefined;
|
|
76
76
|
|
|
77
77
|
this._verticesPromise = undefined;
|
|
78
78
|
|
|
@@ -108,6 +108,7 @@ Object.defineProperties(Vector3DTileGeometry.prototype, {
|
|
|
108
108
|
*
|
|
109
109
|
* @type {number}
|
|
110
110
|
* @readonly
|
|
111
|
+
* @private
|
|
111
112
|
*/
|
|
112
113
|
trianglesLength: {
|
|
113
114
|
get: function () {
|
|
@@ -125,6 +126,7 @@ Object.defineProperties(Vector3DTileGeometry.prototype, {
|
|
|
125
126
|
*
|
|
126
127
|
* @type {number}
|
|
127
128
|
* @readonly
|
|
129
|
+
* @private
|
|
128
130
|
*/
|
|
129
131
|
geometryByteLength: {
|
|
130
132
|
get: function () {
|
|
@@ -136,14 +138,15 @@ Object.defineProperties(Vector3DTileGeometry.prototype, {
|
|
|
136
138
|
},
|
|
137
139
|
|
|
138
140
|
/**
|
|
139
|
-
*
|
|
141
|
+
* Return true when the primitive is ready to render.
|
|
140
142
|
* @memberof Vector3DTileGeometry.prototype
|
|
141
|
-
* @type {
|
|
143
|
+
* @type {boolean}
|
|
142
144
|
* @readonly
|
|
145
|
+
* @private
|
|
143
146
|
*/
|
|
144
|
-
|
|
147
|
+
ready: {
|
|
145
148
|
get: function () {
|
|
146
|
-
return this.
|
|
149
|
+
return this._ready;
|
|
147
150
|
},
|
|
148
151
|
},
|
|
149
152
|
});
|
|
@@ -308,31 +311,45 @@ function createPrimitive(geometries) {
|
|
|
308
311
|
return;
|
|
309
312
|
}
|
|
310
313
|
|
|
311
|
-
return verticesPromise
|
|
312
|
-
|
|
313
|
-
|
|
314
|
+
return verticesPromise
|
|
315
|
+
.then(function (result) {
|
|
316
|
+
if (geometries.isDestroyed()) {
|
|
317
|
+
return;
|
|
318
|
+
}
|
|
314
319
|
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
} else {
|
|
318
|
-
geometries._indices = new Uint32Array(result.indices);
|
|
319
|
-
}
|
|
320
|
+
const packedBuffer = new Float64Array(result.packedBuffer);
|
|
321
|
+
const indicesBytesPerElement = unpackBuffer(geometries, packedBuffer);
|
|
320
322
|
|
|
321
|
-
|
|
322
|
-
|
|
323
|
+
if (indicesBytesPerElement === 2) {
|
|
324
|
+
geometries._indices = new Uint16Array(result.indices);
|
|
325
|
+
} else {
|
|
326
|
+
geometries._indices = new Uint32Array(result.indices);
|
|
327
|
+
}
|
|
323
328
|
|
|
324
|
-
|
|
325
|
-
|
|
329
|
+
geometries._indexOffsets = new Uint32Array(result.indexOffsets);
|
|
330
|
+
geometries._indexCounts = new Uint32Array(result.indexCounts);
|
|
326
331
|
|
|
327
|
-
|
|
332
|
+
geometries._positions = new Float32Array(result.positions);
|
|
333
|
+
geometries._vertexBatchIds = new Uint16Array(result.vertexBatchIds);
|
|
328
334
|
|
|
329
|
-
|
|
330
|
-
|
|
335
|
+
geometries._batchIds = new Uint16Array(result.batchIds);
|
|
336
|
+
|
|
337
|
+
finishPrimitive(geometries);
|
|
338
|
+
|
|
339
|
+
geometries._ready = true;
|
|
340
|
+
})
|
|
341
|
+
.catch((error) => {
|
|
342
|
+
if (geometries.isDestroyed()) {
|
|
343
|
+
return;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
geometries._error = error;
|
|
347
|
+
});
|
|
331
348
|
}
|
|
332
349
|
}
|
|
333
350
|
|
|
334
351
|
function finishPrimitive(geometries) {
|
|
335
|
-
if (
|
|
352
|
+
if (!defined(geometries._primitive)) {
|
|
336
353
|
geometries._primitive = new Vector3DTilePrimitive({
|
|
337
354
|
batchTable: geometries._batchTable,
|
|
338
355
|
positions: geometries._positions,
|
|
@@ -421,42 +438,30 @@ Vector3DTileGeometry.prototype.updateCommands = function (batchId, color) {
|
|
|
421
438
|
this._primitive.updateCommands(batchId, color);
|
|
422
439
|
};
|
|
423
440
|
|
|
424
|
-
function initialize(geometries) {
|
|
425
|
-
return new Promise(function (resolve, reject) {
|
|
426
|
-
geometries._update = function (geometries, frameState) {
|
|
427
|
-
const promise = createPrimitive(geometries);
|
|
428
|
-
|
|
429
|
-
if (geometries._ready) {
|
|
430
|
-
geometries._primitive.debugWireframe = geometries.debugWireframe;
|
|
431
|
-
geometries._primitive.forceRebatch = geometries.forceRebatch;
|
|
432
|
-
geometries._primitive.classificationType =
|
|
433
|
-
geometries.classificationType;
|
|
434
|
-
geometries._primitive.update(frameState);
|
|
435
|
-
}
|
|
436
|
-
|
|
437
|
-
if (!defined(promise)) {
|
|
438
|
-
return;
|
|
439
|
-
}
|
|
440
|
-
|
|
441
|
-
promise
|
|
442
|
-
.then(function () {
|
|
443
|
-
finishPrimitive(geometries);
|
|
444
|
-
resolve(geometries);
|
|
445
|
-
})
|
|
446
|
-
.catch(function (e) {
|
|
447
|
-
reject(e);
|
|
448
|
-
});
|
|
449
|
-
};
|
|
450
|
-
});
|
|
451
|
-
}
|
|
452
|
-
|
|
453
441
|
/**
|
|
454
442
|
* Updates the batches and queues the commands for rendering.
|
|
455
443
|
*
|
|
456
444
|
* @param {FrameState} frameState The current frame state.
|
|
457
445
|
*/
|
|
458
446
|
Vector3DTileGeometry.prototype.update = function (frameState) {
|
|
459
|
-
this.
|
|
447
|
+
if (!this._ready) {
|
|
448
|
+
if (!defined(this._promise)) {
|
|
449
|
+
this._promise = createPrimitive(this);
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
if (defined(this._error)) {
|
|
453
|
+
const error = this._error;
|
|
454
|
+
this._error = undefined;
|
|
455
|
+
throw error;
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
return;
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
this._primitive.debugWireframe = this.debugWireframe;
|
|
462
|
+
this._primitive.forceRebatch = this.forceRebatch;
|
|
463
|
+
this._primitive.classificationType = this.classificationType;
|
|
464
|
+
this._primitive.update(frameState);
|
|
460
465
|
};
|
|
461
466
|
|
|
462
467
|
/**
|