@cesium/engine 2.4.1 → 3.0.1

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.
Files changed (143) hide show
  1. package/Build/Workers/{BoxGeometry-af7d05ef.js → BoxGeometry-7aa4ce7f.js} +1 -1
  2. package/Build/Workers/{CylinderGeometry-dbaa1678.js → CylinderGeometry-8fc7c44b.js} +1 -1
  3. package/Build/Workers/{EllipseGeometry-6508b78b.js → EllipseGeometry-16b3736a.js} +1 -1
  4. package/Build/Workers/{EllipseOutlineGeometry-2a2510bb.js → EllipseOutlineGeometry-05d35d18.js} +1 -1
  5. package/Build/Workers/{EllipsoidGeometry-8155e3a2.js → EllipsoidGeometry-a503d1d6.js} +1 -1
  6. package/Build/Workers/{EllipsoidOutlineGeometry-c045678d.js → EllipsoidOutlineGeometry-7b09f24d.js} +1 -1
  7. package/Build/Workers/{FrustumGeometry-d3ff16d0.js → FrustumGeometry-87ce8622.js} +1 -1
  8. package/Build/Workers/{GeometryAttribute-13da9466.js → GeometryAttribute-8fcff0d5.js} +1 -1
  9. package/Build/Workers/{GeometryPipeline-03bc5709.js → GeometryPipeline-70d69a43.js} +1 -1
  10. package/Build/Workers/{PolygonGeometryLibrary-d447448d.js → PolygonGeometryLibrary-bad6329a.js} +1 -1
  11. package/Build/Workers/{PolygonPipeline-460cce4e.js → PolygonPipeline-dd13ee78.js} +1 -1
  12. package/Build/Workers/{PrimitivePipeline-e648752b.js → PrimitivePipeline-111ee29f.js} +1 -1
  13. package/Build/Workers/cesiumWorkerBootstrapper.js +1 -1
  14. package/Build/Workers/combineGeometry.js +1 -1
  15. package/Build/Workers/createBoxGeometry.js +1 -1
  16. package/Build/Workers/createBoxOutlineGeometry.js +1 -1
  17. package/Build/Workers/createCircleGeometry.js +1 -1
  18. package/Build/Workers/createCircleOutlineGeometry.js +1 -1
  19. package/Build/Workers/createCoplanarPolygonGeometry.js +1 -1
  20. package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +1 -1
  21. package/Build/Workers/createCorridorGeometry.js +1 -1
  22. package/Build/Workers/createCorridorOutlineGeometry.js +1 -1
  23. package/Build/Workers/createCylinderGeometry.js +1 -1
  24. package/Build/Workers/createCylinderOutlineGeometry.js +1 -1
  25. package/Build/Workers/createEllipseGeometry.js +1 -1
  26. package/Build/Workers/createEllipseOutlineGeometry.js +1 -1
  27. package/Build/Workers/createEllipsoidGeometry.js +1 -1
  28. package/Build/Workers/createEllipsoidOutlineGeometry.js +1 -1
  29. package/Build/Workers/createFrustumGeometry.js +1 -1
  30. package/Build/Workers/createFrustumOutlineGeometry.js +1 -1
  31. package/Build/Workers/createGeometry.js +1 -1
  32. package/Build/Workers/createGroundPolylineGeometry.js +1 -1
  33. package/Build/Workers/createPlaneGeometry.js +1 -1
  34. package/Build/Workers/createPlaneOutlineGeometry.js +1 -1
  35. package/Build/Workers/createPolygonGeometry.js +1 -1
  36. package/Build/Workers/createPolygonOutlineGeometry.js +1 -1
  37. package/Build/Workers/createPolylineGeometry.js +1 -1
  38. package/Build/Workers/createPolylineVolumeGeometry.js +1 -1
  39. package/Build/Workers/createPolylineVolumeOutlineGeometry.js +1 -1
  40. package/Build/Workers/createRectangleGeometry.js +1 -1
  41. package/Build/Workers/createRectangleOutlineGeometry.js +1 -1
  42. package/Build/Workers/createSimplePolylineGeometry.js +1 -1
  43. package/Build/Workers/createSphereGeometry.js +1 -1
  44. package/Build/Workers/createSphereOutlineGeometry.js +1 -1
  45. package/Build/Workers/createVectorTileGeometries.js +1 -1
  46. package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +0 -22
  47. package/Build/Workers/createWallGeometry.js +1 -1
  48. package/Build/Workers/createWallOutlineGeometry.js +1 -1
  49. package/Build/Workers/package.js +1 -1
  50. package/Build/Workers/transferTypedArrayTest.js +1 -1
  51. package/Source/Core/ArcGISTiledElevationTerrainProvider.js +0 -75
  52. package/Source/Core/CesiumTerrainProvider.js +0 -75
  53. package/Source/Core/CustomHeightmapTerrainProvider.js +0 -38
  54. package/Source/Core/EllipsoidTerrainProvider.js +0 -37
  55. package/Source/Core/Geometry.js +1 -1
  56. package/Source/Core/GoogleEarthEnterpriseMetadata.js +0 -53
  57. package/Source/Core/GoogleEarthEnterpriseTerrainProvider.js +1 -101
  58. package/Source/Core/GoogleMaps.js +1 -1
  59. package/Source/Core/Ion.js +1 -2
  60. package/Source/Core/TerrainProvider.js +0 -22
  61. package/Source/Core/VRTheWorldTerrainProvider.js +0 -59
  62. package/Source/Core/sampleTerrain.js +0 -7
  63. package/Source/Core/sampleTerrainMostDetailed.js +0 -7
  64. package/Source/DataSources/Cesium3DTilesetVisualizer.js +6 -5
  65. package/Source/DataSources/KmlTour.js +1 -12
  66. package/Source/DataSources/ModelVisualizer.js +0 -12
  67. package/Source/Renderer/Context.js +10 -2
  68. package/Source/Scene/ArcGisMapServerImageryProvider.js +7 -335
  69. package/Source/Scene/ArcGisMapService.js +1 -1
  70. package/Source/Scene/Billboard.js +7 -0
  71. package/Source/Scene/BingMapsImageryProvider.js +0 -326
  72. package/Source/Scene/{parseBoundingVolumeSemantics.js → BoundingVolumeSemantics.js} +71 -15
  73. package/Source/Scene/Camera.js +1 -1
  74. package/Source/Scene/Cesium3DTile.js +35 -18
  75. package/Source/Scene/Cesium3DTileContent.js +0 -16
  76. package/Source/Scene/Cesium3DTilesVoxelProvider.js +0 -123
  77. package/Source/Scene/Cesium3DTileset.js +183 -184
  78. package/Source/Scene/Cesium3DTilesetBaseTraversal.js +1 -1
  79. package/Source/Scene/Cesium3DTilesetCache.js +1 -3
  80. package/Source/Scene/Cesium3DTilesetSkipTraversal.js +5 -2
  81. package/Source/Scene/Cesium3DTilesetTraversal.js +2 -2
  82. package/Source/Scene/ClassificationPrimitive.js +5 -43
  83. package/Source/Scene/Composite3DTileContent.js +0 -27
  84. package/Source/Scene/CreditDisplay.js +0 -54
  85. package/Source/Scene/DerivedCommand.js +15 -10
  86. package/Source/Scene/Empty3DTileContent.js +0 -21
  87. package/Source/Scene/Geometry3DTileContent.js +0 -29
  88. package/Source/Scene/Globe.js +1 -9
  89. package/Source/Scene/GlobeSurfaceTile.js +13 -8
  90. package/Source/Scene/GlobeSurfaceTileProvider.js +8 -60
  91. package/Source/Scene/GltfPipeline/removeUnusedElements.js +27 -0
  92. package/Source/Scene/GltfPipeline/updateVersion.js +21 -4
  93. package/Source/Scene/GoogleEarthEnterpriseImageryProvider.js +1 -339
  94. package/Source/Scene/GoogleEarthEnterpriseMapsProvider.js +0 -326
  95. package/Source/Scene/GridImageryProvider.js +0 -274
  96. package/Source/Scene/GroundPolylinePrimitive.js +5 -38
  97. package/Source/Scene/GroundPrimitive.js +5 -43
  98. package/Source/Scene/I3SDataProvider.js +4 -99
  99. package/Source/Scene/I3SLayer.js +15 -22
  100. package/Source/Scene/Imagery.js +1 -9
  101. package/Source/Scene/ImageryLayer.js +1 -40
  102. package/Source/Scene/ImageryProvider.js +0 -138
  103. package/Source/Scene/Implicit3DTileContent.js +4 -25
  104. package/Source/Scene/IonImageryProvider.js +1 -369
  105. package/Source/Scene/MapboxImageryProvider.js +0 -276
  106. package/Source/Scene/MapboxStyleImageryProvider.js +0 -274
  107. package/Source/Scene/Model/CustomShaderPipelineStage.js +178 -164
  108. package/Source/Scene/Model/Model.js +9 -250
  109. package/Source/Scene/Model/Model3DTileContent.js +0 -50
  110. package/Source/Scene/Model/ModelAnimationCollection.js +1 -1
  111. package/Source/Scene/Model/PointCloudStylingPipelineStage.js +1 -1
  112. package/Source/Scene/Multiple3DTileContent.js +0 -27
  113. package/Source/Scene/Primitive.js +10 -38
  114. package/Source/Scene/QuadtreePrimitive.js +3 -5
  115. package/Source/Scene/QuadtreeTileProvider.js +0 -10
  116. package/Source/Scene/Scene.js +3 -3
  117. package/Source/Scene/ScreenSpaceCameraController.js +5 -5
  118. package/Source/Scene/SingleTileImageryProvider.js +6 -302
  119. package/Source/Scene/TileCoordinatesImageryProvider.js +0 -273
  120. package/Source/Scene/TileMapServiceImageryProvider.js +3 -48
  121. package/Source/Scene/Tileset3DTileContent.js +0 -22
  122. package/Source/Scene/TimeDynamicPointCloud.js +0 -28
  123. package/Source/Scene/UrlTemplateImageryProvider.js +0 -375
  124. package/Source/Scene/Vector3DTileContent.js +0 -29
  125. package/Source/Scene/VoxelPrimitive.js +9 -49
  126. package/Source/Scene/VoxelProvider.js +0 -24
  127. package/Source/Scene/WebMapServiceImageryProvider.js +0 -274
  128. package/Source/Scene/WebMapTileServiceImageryProvider.js +0 -274
  129. package/Source/Scene/computeFlyToLocationForRectangle.js +0 -6
  130. package/Source/Scene/createGooglePhotorealistic3DTileset.js +5 -0
  131. package/Source/Shaders/Builtin/Functions/eastNorthUpToEyeCoordinates.glsl +1 -1
  132. package/Source/Shaders/Builtin/Functions/eastNorthUpToEyeCoordinates.js +1 -1
  133. package/Source/Shaders/EllipsoidFS.glsl +1 -1
  134. package/Source/Shaders/EllipsoidFS.js +1 -1
  135. package/Source/Shaders/GlobeFS.glsl +1 -1
  136. package/Source/Shaders/GlobeFS.js +1 -1
  137. package/Source/Widget/CesiumWidget.js +2 -19
  138. package/index.d.ts +62 -1183
  139. package/index.js +63 -66
  140. package/package.json +2 -2
  141. package/Source/Core/createWorldTerrain.js +0 -61
  142. package/Source/Scene/createOsmBuildings.js +0 -82
  143. package/Source/Scene/createWorldImagery.js +0 -47
@@ -6,7 +6,6 @@ import Credit from "../../Core/Credit.js";
6
6
  import Color from "../../Core/Color.js";
7
7
  import defined from "../../Core/defined.js";
8
8
  import defaultValue from "../../Core/defaultValue.js";
9
- import deprecationWarning from "../../Core/deprecationWarning.js";
10
9
  import DeveloperError from "../../Core/DeveloperError.js";
11
10
  import destroyObject from "../../Core/destroyObject.js";
12
11
  import DistanceDisplayCondition from "../../Core/DistanceDisplayCondition.js";
@@ -457,62 +456,6 @@ function Model(options) {
457
456
  this._skipLevelOfDetail = false;
458
457
  this._ignoreCommands = defaultValue(options.ignoreCommands, false);
459
458
 
460
- this._texturesLoadedPromise = undefined;
461
-
462
- this._completeLoad = undefined;
463
- this._rejectLoad = undefined;
464
- this._completeTexturesLoad = undefined;
465
- this._rejectTexturesLoad = undefined;
466
-
467
- // This is for backward compatibility. When readyPromise is removed, this block can be too
468
- if (!defined(this._loader._promise)) {
469
- this._readyPromise = new Promise((resolve, reject) => {
470
- this._completeLoad = () => {
471
- resolve(this);
472
- return false;
473
- };
474
- this._rejectLoad = (error) => {
475
- reject(error);
476
- return false;
477
- };
478
- });
479
-
480
- // Transcoded .pnts models do not have textures
481
- if (this._loader instanceof PntsLoader) {
482
- this._texturesLoadedPromise = Promise.resolve(this);
483
- } else {
484
- this._texturesLoadedPromise = new Promise((resolve, reject) => {
485
- this._completeTexturesLoad = () => {
486
- resolve(this);
487
- return false;
488
- };
489
- this._rejectTexturesLoad = (error) => {
490
- reject(error);
491
- return false;
492
- };
493
- });
494
- }
495
-
496
- this._loader.load().catch((error) => {
497
- // If the model is destroyed before the promise resolves, then
498
- // the loader will have been destroyed as well. Return early.
499
- if (
500
- this.isDestroyed() ||
501
- !defined(this._loader) ||
502
- this._loader.isDestroyed()
503
- ) {
504
- return;
505
- }
506
-
507
- this._rejectLoad = this._rejectLoad(
508
- ModelUtility.getError("model", this._resource, error)
509
- );
510
- });
511
- } else {
512
- this._readyPromise = Promise.resolve(this);
513
- this._texturesLoadedPromise = Promise.resolve(this);
514
- }
515
-
516
459
  this._errorEvent = new Event();
517
460
  this._readyEvent = new Event();
518
461
  this._texturesReadyEvent = new Event();
@@ -682,7 +625,7 @@ Object.defineProperties(Model.prototype, {
682
625
  /**
683
626
  * Returns true if textures are loaded separately from the other glTF resources.
684
627
  *
685
- * @memberof GltfLoader.prototype
628
+ * @memberof Model.prototype
686
629
  *
687
630
  * @type {boolean}
688
631
  * @readonly
@@ -709,52 +652,6 @@ Object.defineProperties(Model.prototype, {
709
652
  },
710
653
  },
711
654
 
712
- /**
713
- * Gets the promise that will be resolved when this model is ready to render, i.e. when the external resources
714
- * have been downloaded and the WebGL resources are created.
715
- * <p>
716
- * This promise is resolved at the end of the frame before the first frame the model is rendered in.
717
- * </p>
718
- *
719
- * @memberof Model.prototype
720
- *
721
- * @type {Promise<Model>}
722
- * @readonly
723
- * @deprecated
724
- */
725
- readyPromise: {
726
- get: function () {
727
- deprecationWarning(
728
- "Model.readyPromise",
729
- "Model.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Use Model.fromGltfAsync and Model.readyEvent instead."
730
- );
731
- return this._readyPromise;
732
- },
733
- },
734
-
735
- /**
736
- * A promise that resolves when all textures are loaded.
737
- * When <code>incrementallyLoadTextures</code> is true this may resolve after
738
- * <code>promise</code> resolves.
739
- *
740
- * @memberof Model.prototype
741
- *
742
- * @type {Promise<void>}
743
- * @readonly
744
- * @deprecated
745
- *
746
- * @private
747
- */
748
- texturesLoadedPromise: {
749
- get: function () {
750
- deprecationWarning(
751
- "Model.texturesLoadedPromise",
752
- "Model.texturesLoadedPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Use Model.fromGltfAsync and Model.texturesReadyEvent instead."
753
- );
754
- return this._texturesLoadedPromise;
755
- },
756
- },
757
-
758
655
  /**
759
656
  * @private
760
657
  */
@@ -1820,22 +1717,11 @@ Model.prototype.update = function (frameState) {
1820
1717
  // are processed.
1821
1718
  finishedProcessing = processLoader(this, frameState);
1822
1719
  } catch (error) {
1823
- if (!this._loader.incrementallyLoadTextures) {
1824
- const runtimeError = ModelUtility.getError(
1825
- "model",
1826
- this._resource,
1827
- error
1828
- );
1829
- handleError(this, runtimeError);
1830
-
1831
- this._rejectLoad = this._rejectLoad && this._rejectLoad(runtimeError);
1832
- this._rejectTexturesLoad =
1833
- this._rejectTexturesLoad && this._rejectTexturesLoad(runtimeError);
1834
- } else if (error.name === "TextureError") {
1720
+ if (
1721
+ !this._loader.incrementallyLoadTextures &&
1722
+ error.name === "TextureError"
1723
+ ) {
1835
1724
  handleError(this, error);
1836
-
1837
- this._rejectTexturesLoad =
1838
- this._rejectTexturesLoad && this._rejectTexturesLoad(error);
1839
1725
  } else {
1840
1726
  const runtimeError = ModelUtility.getError(
1841
1727
  "model",
@@ -1843,8 +1729,6 @@ Model.prototype.update = function (frameState) {
1843
1729
  error
1844
1730
  );
1845
1731
  handleError(this, runtimeError);
1846
-
1847
- this._rejectLoad = this._rejectLoad && this._rejectLoad(runtimeError);
1848
1732
  }
1849
1733
  }
1850
1734
 
@@ -1926,17 +1810,9 @@ Model.prototype.update = function (frameState) {
1926
1810
  frameState.afterRender.push(() => {
1927
1811
  this._ready = true;
1928
1812
  this._readyEvent.raiseEvent(this);
1929
- // This is here for backwards compatibility and can be removed when readyPromise is removed.
1930
- this._completeLoad = this._completeLoad && this._completeLoad();
1931
- if (!this._loader.incrementallyLoadTextures) {
1932
- this._texturesLoaded = true;
1933
- this._texturesReadyEvent.raiseEvent(this);
1934
- this._completeTexturesLoad =
1935
- this._completeTexturesLoad && this._completeTexturesLoad();
1936
- }
1937
1813
  });
1938
1814
 
1939
- // Don't render until the next frame after the ready promise is resolved
1815
+ // Don't render until the next frame after the ready event has been raised.
1940
1816
  return;
1941
1817
  }
1942
1818
 
@@ -1950,8 +1826,6 @@ Model.prototype.update = function (frameState) {
1950
1826
 
1951
1827
  this._texturesLoaded = true;
1952
1828
  this._texturesReadyEvent.raiseEvent(this);
1953
- this._completeTexturesLoad =
1954
- this._completeTexturesLoad && this._completeTexturesLoad();
1955
1829
  }
1956
1830
 
1957
1831
  updatePickIds(this);
@@ -2718,123 +2592,6 @@ Model.prototype.destroyModelResources = function () {
2718
2592
  this._modelResources.length = 0;
2719
2593
  };
2720
2594
 
2721
- /**
2722
- * <p>
2723
- * Creates a model from a glTF asset. When the model is ready to render, i.e., when the external binary, image,
2724
- * and shader files are downloaded and the WebGL resources are created, the {@link Model#readyPromise} is resolved.
2725
- * </p>
2726
- * <p>
2727
- * The model can be a traditional glTF asset with a .gltf extension or a Binary glTF using the .glb extension.
2728
- *
2729
- * @param {object} options Object with the following properties:
2730
- * @param {string|Resource} options.url The url to the .gltf or .glb file.
2731
- * @param {string|Resource} [options.basePath=''] The base path that paths in the glTF JSON are relative to.
2732
- * @param {boolean} [options.show=true] Whether or not to render the model.
2733
- * @param {Matrix4} [options.modelMatrix=Matrix4.IDENTITY] The 4x4 transformation matrix that transforms the model from model to world coordinates.
2734
- * @param {number} [options.scale=1.0] A uniform scale applied to this model.
2735
- * @param {number} [options.minimumPixelSize=0.0] The approximate minimum pixel size of the model regardless of zoom.
2736
- * @param {number} [options.maximumScale] The maximum scale size of a model. An upper limit for minimumPixelSize.
2737
- * @param {object} [options.id] A user-defined object to return when the model is picked with {@link Scene#pick}.
2738
- * @param {boolean} [options.allowPicking=true] When <code>true</code>, each primitive is pickable with {@link Scene#pick}.
2739
- * @param {boolean} [options.incrementallyLoadTextures=true] Determine if textures may continue to stream in after the model is loaded.
2740
- * @param {boolean} [options.asynchronous=true] Determines if model WebGL resource creation will be spread out over several frames or block until completion once all glTF files are loaded.
2741
- * @param {boolean} [options.clampAnimations=true] Determines if the model's animations should hold a pose over frames where no keyframes are specified.
2742
- * @param {ShadowMode} [options.shadows=ShadowMode.ENABLED] Determines whether the model casts or receives shadows from light sources.
2743
- * @param {boolean} [options.releaseGltfJson=false] When true, the glTF JSON is released once the glTF is loaded. This is is especially useful for cases like 3D Tiles, where each .gltf model is unique and caching the glTF JSON is not effective.
2744
- * @param {boolean} [options.debugShowBoundingVolume=false] For debugging only. Draws the bounding sphere for each draw command in the model.
2745
- * @param {boolean} [options.enableDebugWireframe=false] For debugging only. This must be set to true for debugWireframe to work in WebGL1. This cannot be set after the model has loaded.
2746
- * @param {boolean} [options.debugWireframe=false] For debugging only. Draws the model in wireframe. Will only work for WebGL1 if enableDebugWireframe is set to true.
2747
- * @param {boolean} [options.cull=true] Whether or not to cull the model using frustum/horizon culling. If the model is part of a 3D Tiles tileset, this property will always be false, since the 3D Tiles culling system is used.
2748
- * @param {boolean} [options.opaquePass=Pass.OPAQUE] The pass to use in the {@link DrawCommand} for the opaque portions of the model.
2749
- * @param {Axis} [options.upAxis=Axis.Y] The up-axis of the glTF model.
2750
- * @param {Axis} [options.forwardAxis=Axis.Z] The forward-axis of the glTF model.
2751
- * @param {CustomShader} [options.customShader] A custom shader. This will add user-defined GLSL code to the vertex and fragment shaders. Using custom shaders with a {@link Cesium3DTileStyle} may lead to undefined behavior.
2752
- * @param {Cesium3DTileContent} [options.content] The tile content this model belongs to. This property will be undefined if model is not loaded as part of a tileset.
2753
- * @param {HeightReference} [options.heightReference=HeightReference.NONE] Determines how the model is drawn relative to terrain.
2754
- * @param {Scene} [options.scene] Must be passed in for models that use the height reference property.
2755
- * @param {DistanceDisplayCondition} [options.distanceDisplayCondition] The condition specifying at what distance from the camera that this model will be displayed.
2756
- * @param {Color} [options.color] A color that blends with the model's rendered color.
2757
- * @param {ColorBlendMode} [options.colorBlendMode=ColorBlendMode.HIGHLIGHT] Defines how the color blends with the model.
2758
- * @param {number} [options.colorBlendAmount=0.5] Value used to determine the color strength when the <code>colorBlendMode</code> is <code>MIX</code>. A value of 0.0 results in the model's rendered color while a value of 1.0 results in a solid color, with any value in-between resulting in a mix of the two.
2759
- * @param {Color} [options.silhouetteColor=Color.RED] The silhouette color. If more than 256 models have silhouettes enabled, there is a small chance that overlapping models will have minor artifacts.
2760
- * @param {number} [options.silhouetteSize=0.0] The size of the silhouette in pixels.
2761
- * @param {boolean} [options.enableShowOutline=true] Whether to enable outlines for models using the {@link https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/CESIUM_primitive_outline|CESIUM_primitive_outline} extension. This can be set false to avoid post-processing geometry at load time. When false, the showOutlines and outlineColor options are ignored.
2762
- * @param {boolean} [options.showOutline=true] Whether to display the outline for models using the {@link https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/CESIUM_primitive_outline|CESIUM_primitive_outline} extension. When true, outlines are displayed. When false, outlines are not displayed.
2763
- * @param {Color} [options.outlineColor=Color.BLACK] The color to use when rendering outlines.
2764
- * @param {ClippingPlaneCollection} [options.clippingPlanes] The {@link ClippingPlaneCollection} used to selectively disable rendering the model.
2765
- * @param {Cartesian3} [options.lightColor] The light color when shading the model. When <code>undefined</code> the scene's light color is used instead.
2766
- * @param {ImageBasedLighting} [options.imageBasedLighting] The properties for managing image-based lighting on this model.
2767
- * @param {boolean} [options.backFaceCulling=true] Whether to cull back-facing geometry. When true, back face culling is determined by the material's doubleSided property; when false, back face culling is disabled. Back faces are not culled if the model's color is translucent.
2768
- * @param {Credit|string} [options.credit] A credit for the data source, which is displayed on the canvas.
2769
- * @param {boolean} [options.showCreditsOnScreen=false] Whether to display the credits of this model on screen.
2770
- * @param {SplitDirection} [options.splitDirection=SplitDirection.NONE] The {@link SplitDirection} split to apply to this model.
2771
- * @param {boolean} [options.projectTo2D=false] Whether to accurately project the model's positions in 2D. If this is true, the model will be projected accurately to 2D, but it will use more memory to do so. If this is false, the model will use less memory and will still render in 2D / CV mode, but its positions may be inaccurate. This disables minimumPixelSize and prevents future modification to the model matrix. This also cannot be set after the model has loaded.
2772
- * @param {string|number} [options.featureIdLabel="featureId_0"] Label of the feature ID set to use for picking and styling. For EXT_mesh_features, this is the feature ID's label property, or "featureId_N" (where N is the index in the featureIds array) when not specified. EXT_feature_metadata did not have a label field, so such feature ID sets are always labeled "featureId_N" where N is the index in the list of all feature Ids, where feature ID attributes are listed before feature ID textures. If featureIdLabel is an integer N, it is converted to the string "featureId_N" automatically. If both per-primitive and per-instance feature IDs are present, the instance feature IDs take priority.
2773
- * @param {string|number} [options.instanceFeatureIdLabel="instanceFeatureId_0"] Label of the instance feature ID set used for picking and styling. If instanceFeatureIdLabel is set to an integer N, it is converted to the string "instanceFeatureId_N" automatically. If both per-primitive and per-instance feature IDs are present, the instance feature IDs take priority.
2774
- * @param {object} [options.pointCloudShading] Options for constructing a {@link PointCloudShading} object to control point attenuation and lighting.
2775
- * @param {ClassificationType} [options.classificationType] Determines whether terrain, 3D Tiles or both will be classified by this model. This cannot be set after the model has loaded.
2776
- *
2777
- * @returns {Model} The newly created model.
2778
- */
2779
- Model.fromGltf = function (options) {
2780
- deprecationWarning(
2781
- "Model.fromGltf",
2782
- "Model.fromGltf was deprecated in CesiumJS 1.104. It will be removed in 1.107. Use Model.fromGltfAsync instead."
2783
- );
2784
-
2785
- options = defaultValue(options, defaultValue.EMPTY_OBJECT);
2786
-
2787
- //>>includeStart('debug', pragmas.debug);
2788
- if (!defined(options.url) && !defined(options.gltf)) {
2789
- throw new DeveloperError("options.url is required.");
2790
- }
2791
- //>>includeEnd('debug');
2792
-
2793
- // options.gltf is used internally for 3D Tiles. It can be a Resource, a URL
2794
- // to a glTF/glb file, a binary glTF buffer, or a JSON object containing the
2795
- // glTF contents.
2796
- const gltf = defaultValue(options.url, options.gltf);
2797
-
2798
- const loaderOptions = {
2799
- releaseGltfJson: options.releaseGltfJson,
2800
- asynchronous: options.asynchronous,
2801
- incrementallyLoadTextures: options.incrementallyLoadTextures,
2802
- upAxis: options.upAxis,
2803
- forwardAxis: options.forwardAxis,
2804
- loadAttributesFor2D: options.projectTo2D,
2805
- loadIndicesForWireframe: options.enableDebugWireframe,
2806
- loadPrimitiveOutline: options.enableShowOutline,
2807
- loadForClassification: defined(options.classificationType),
2808
- };
2809
-
2810
- const basePath = defaultValue(options.basePath, "");
2811
- const baseResource = Resource.createIfNeeded(basePath);
2812
-
2813
- if (defined(gltf.asset)) {
2814
- loaderOptions.gltfJson = gltf;
2815
- loaderOptions.baseResource = baseResource;
2816
- loaderOptions.gltfResource = baseResource;
2817
- } else if (gltf instanceof Uint8Array) {
2818
- loaderOptions.typedArray = gltf;
2819
- loaderOptions.baseResource = baseResource;
2820
- loaderOptions.gltfResource = baseResource;
2821
- } else {
2822
- loaderOptions.gltfResource = Resource.createIfNeeded(gltf);
2823
- }
2824
-
2825
- const loader = new GltfLoader(loaderOptions);
2826
-
2827
- const is3DTiles = defined(options.content);
2828
- const type = is3DTiles ? ModelType.TILE_GLTF : ModelType.GLTF;
2829
-
2830
- const modelOptions = makeModelOptions(loader, type, options);
2831
- modelOptions.resource = loaderOptions.gltfResource;
2832
-
2833
- const model = new Model(modelOptions);
2834
-
2835
- return model;
2836
- };
2837
-
2838
2595
  /**
2839
2596
  * <p>
2840
2597
  * Asynchronously creates a model from a glTF asset. This function returns a promise that resolves when the model is ready to render, i.e., when the external binary, image,
@@ -3145,11 +2902,13 @@ Model.fromGeoJson = async function (options) {
3145
2902
  return model;
3146
2903
  };
3147
2904
 
2905
+ const scratchColor = new Color();
2906
+
3148
2907
  /**
3149
2908
  * @private
3150
2909
  */
3151
2910
  Model.prototype.applyColorAndShow = function (style) {
3152
- const previousColor = this._color;
2911
+ const previousColor = Color.clone(this._color, scratchColor);
3153
2912
  const hasColorStyle = defined(style) && defined(style.color);
3154
2913
  const hasShowStyle = defined(style) && defined(style.show);
3155
2914
 
@@ -2,7 +2,6 @@ import Color from "../../Core/Color.js";
2
2
  import combine from "../../Core/combine.js";
3
3
  import defined from "../../Core/defined.js";
4
4
  import destroyObject from "../../Core/destroyObject.js";
5
- import deprecationWarning from "../../Core/deprecationWarning.js";
6
5
  import DeveloperError from "../../Core/DeveloperError.js";
7
6
  import Pass from "../../Renderer/Pass.js";
8
7
  import ModelAnimationLoop from "../ModelAnimationLoop.js";
@@ -30,9 +29,6 @@ function Model3DTileContent(tileset, tile, resource) {
30
29
  this._metadata = undefined;
31
30
  this._group = undefined;
32
31
  this._ready = false;
33
-
34
- this._resolveContent = undefined;
35
- this._readyPromise = undefined;
36
32
  }
37
33
 
38
34
  Object.defineProperties(Model3DTileContent.prototype, {
@@ -104,26 +100,6 @@ Object.defineProperties(Model3DTileContent.prototype, {
104
100
  },
105
101
  },
106
102
 
107
- /**
108
- * Gets the promise that will be resolved when the tile's content is ready to render.
109
- *
110
- * @memberof Model3DTileContent.prototype
111
- *
112
- * @type {Promise<Model3DTileContent>}
113
- * @readonly
114
- * @deprecated
115
- * @private
116
- */
117
- readyPromise: {
118
- get: function () {
119
- deprecationWarning(
120
- "Model3DTileContent.readyPromise",
121
- "Model3DTileContent.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Wait for Model3DTileContent.ready to return true instead."
122
- );
123
- return this._readyPromise;
124
- },
125
- },
126
-
127
103
  tileset: {
128
104
  get: function () {
129
105
  return this._tileset;
@@ -287,7 +263,6 @@ Model3DTileContent.prototype.update = function (tileset, frameState) {
287
263
  });
288
264
 
289
265
  this._ready = true;
290
- this._resolveContent = this._resolveContent && this._resolveContent(this);
291
266
  }
292
267
  };
293
268
 
@@ -324,11 +299,6 @@ Model3DTileContent.fromGltf = async function (tileset, tile, resource, gltf) {
324
299
  const model = await Model.fromGltfAsync(modelOptions);
325
300
  content._model = model;
326
301
 
327
- // This is for backwards compatibility. It can be removed once readyPromise is removed.
328
- content._readyPromise = new Promise((resolve) => {
329
- content._resolveContent = resolve;
330
- });
331
-
332
302
  return content;
333
303
  };
334
304
 
@@ -363,11 +333,6 @@ Model3DTileContent.fromB3dm = async function (
363
333
  const model = await Model.fromB3dm(modelOptions);
364
334
  content._model = model;
365
335
 
366
- // This is for backwards compatibility. It can be removed once readyPromise is removed.
367
- content._readyPromise = new Promise((resolve) => {
368
- content._resolveContent = resolve;
369
- });
370
-
371
336
  return content;
372
337
  };
373
338
 
@@ -396,11 +361,6 @@ Model3DTileContent.fromI3dm = async function (
396
361
  const model = await Model.fromI3dm(modelOptions);
397
362
  content._model = model;
398
363
 
399
- // This is for backwards compatibility. It can be removed once readyPromise is removed.
400
- content._readyPromise = new Promise((resolve) => {
401
- content._resolveContent = resolve;
402
- });
403
-
404
364
  return content;
405
365
  };
406
366
 
@@ -428,11 +388,6 @@ Model3DTileContent.fromPnts = async function (
428
388
  const model = await Model.fromPnts(modelOptions);
429
389
  content._model = model;
430
390
 
431
- // This is for backwards compatibility. It can be removed once readyPromise is removed.
432
- content._readyPromise = new Promise((resolve) => {
433
- content._resolveContent = resolve;
434
- });
435
-
436
391
  return content;
437
392
  };
438
393
 
@@ -458,11 +413,6 @@ Model3DTileContent.fromGeoJson = async function (
458
413
  const model = await Model.fromGeoJson(modelOptions);
459
414
  content._model = model;
460
415
 
461
- // This is for backwards compatibility. It can be removed once readyPromise is removed.
462
- content._readyPromise = new Promise((resolve) => {
463
- content._resolveContent = resolve;
464
- });
465
-
466
416
  return content;
467
417
  };
468
418
 
@@ -241,7 +241,7 @@ ModelAnimationCollection.prototype.add = function (options) {
241
241
  * @param {ModelAnimation.AnimationTimeCallback} [options.animationTime=undefined] If defined, computes the local animation time for all of the animations.
242
242
  * @returns {ModelAnimation[]} An array of {@link ModelAnimation} objects, one for each animation added to the collection. If there are no glTF animations, the array is empty.
243
243
  *
244
- * @exception {DeveloperError} Animations are not loaded. Wait for the {@link Model#readyPromise} to resolve.
244
+ * @exception {DeveloperError} Animations are not loaded. Wait for the {@link Model#ready} to return true.
245
245
  * @exception {DeveloperError} options.multiplier must be greater than zero.
246
246
  *
247
247
  * @example
@@ -161,7 +161,7 @@ PointCloudStylingPipelineStage.process = function (
161
161
  if (is3DTiles) {
162
162
  defaultPointSize = usesAddRefinement
163
163
  ? 5.0
164
- : content.tileset.maximumScreenSpaceError;
164
+ : content.tileset.memoryAdjustedScreenSpaceError;
165
165
  }
166
166
  vec4.x = defaultValue(
167
167
  pointCloudShading.maximumAttenuation,
@@ -1,5 +1,4 @@
1
1
  import defined from "../Core/defined.js";
2
- import deprecationWarning from "../Core/deprecationWarning.js";
3
2
  import destroyObject from "../Core/destroyObject.js";
4
3
  import DeveloperError from "../Core/DeveloperError.js";
5
4
  import Request from "../Core/Request.js";
@@ -57,11 +56,6 @@ function Multiple3DTileContent(tileset, tile, tilesetResource, contentsJson) {
57
56
  this._requests = new Array(contentCount);
58
57
  this._ready = false;
59
58
 
60
- this._resolveContent = undefined;
61
- this._readyPromise = new Promise((resolve) => {
62
- this._resolveContent = resolve;
63
- });
64
-
65
59
  this._innerContentResources = new Array(contentCount);
66
60
  this._serverKeys = new Array(contentCount);
67
61
 
@@ -236,26 +230,6 @@ Object.defineProperties(Multiple3DTileContent.prototype, {
236
230
  },
237
231
  },
238
232
 
239
- /**
240
- * Gets the promise that will be resolved when the tile's content is ready to render.
241
- *
242
- * @memberof Multiple3DTileContent.prototype
243
- *
244
- * @type {Promise<Multiple3DTileContent>}
245
- * @readonly
246
- * @deprecated
247
- * @private
248
- */
249
- readyPromise: {
250
- get: function () {
251
- deprecationWarning(
252
- "Multiple3DTileContent.readyPromise",
253
- "Multiple3DTileContent.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Wait for Multiple3DTileContent.ready to return true instead."
254
- );
255
- return this._readyPromise;
256
- },
257
- },
258
-
259
233
  tileset: {
260
234
  get: function () {
261
235
  return this._tileset;
@@ -673,7 +647,6 @@ Multiple3DTileContent.prototype.update = function (tileset, frameState) {
673
647
 
674
648
  if (!this._ready && ready) {
675
649
  this._ready = true;
676
- this._resolveContent(this);
677
650
  }
678
651
  };
679
652
 
@@ -9,7 +9,6 @@ import combine from "../Core/combine.js";
9
9
  import ComponentDatatype from "../Core/ComponentDatatype.js";
10
10
  import defaultValue from "../Core/defaultValue.js";
11
11
  import defined from "../Core/defined.js";
12
- import deprecationWarning from "../Core/deprecationWarning.js";
13
12
  import destroyObject from "../Core/destroyObject.js";
14
13
  import DeveloperError from "../Core/DeveloperError.js";
15
14
  import EncodedCartesian3 from "../Core/EncodedCartesian3.js";
@@ -350,25 +349,6 @@ function Primitive(options) {
350
349
  this._createGeometryResults = undefined;
351
350
  this._ready = false;
352
351
 
353
- const primitive = this;
354
- // This is here for backwards compatibility. This promise wrapper can be removed once readyPromise is removed.
355
- this._readyPromise = new Promise((resolve, reject) => {
356
- primitive._completeLoad = (frameState, state, error) => {
357
- this._error = error;
358
- this._state = state;
359
- frameState.afterRender.push(function () {
360
- primitive._ready =
361
- primitive._state === PrimitiveState.COMPLETE ||
362
- primitive._state === PrimitiveState.FAILED;
363
- if (!defined(error)) {
364
- resolve(primitive);
365
- return true;
366
- }
367
- reject(error);
368
- });
369
- };
370
- });
371
-
372
352
  this._batchTable = undefined;
373
353
  this._batchTableAttributeIndices = undefined;
374
354
  this._offsetInstanceExtend = undefined;
@@ -507,23 +487,6 @@ Object.defineProperties(Primitive.prototype, {
507
487
  return this._ready;
508
488
  },
509
489
  },
510
-
511
- /**
512
- * Gets a promise that resolves when the primitive is ready to render.
513
- * @memberof Primitive.prototype
514
- * @type {Promise<Primitive>}
515
- * @readonly
516
- * @deprecated
517
- */
518
- readyPromise: {
519
- get: function () {
520
- deprecationWarning(
521
- "Primitive.readyPromise",
522
- "Primitive.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Wait for Primitive.ready to return true instead."
523
- );
524
- return this._readyPromise;
525
- },
526
- },
527
490
  });
528
491
 
529
492
  function getCommonPerInstanceAttributeNames(instances) {
@@ -2542,6 +2505,15 @@ Primitive.prototype.destroy = function () {
2542
2505
  };
2543
2506
 
2544
2507
  function setReady(primitive, frameState, state, error) {
2545
- primitive._completeLoad(frameState, state, error);
2508
+ primitive._error = error;
2509
+ primitive._state = state;
2510
+ frameState.afterRender.push(function () {
2511
+ primitive._ready =
2512
+ primitive._state === PrimitiveState.COMPLETE ||
2513
+ primitive._state === PrimitiveState.FAILED;
2514
+ if (!defined(error)) {
2515
+ return true;
2516
+ }
2517
+ });
2546
2518
  }
2547
2519
  export default Primitive;
@@ -520,8 +520,8 @@ function selectTilesForRendering(primitive, frameState) {
520
520
  let i;
521
521
  const tileProvider = primitive._tileProvider;
522
522
  if (!defined(primitive._levelZeroTiles)) {
523
- // ready is deprecated. This is here for backwards compatibility
524
- if (tileProvider.ready) {
523
+ const tilingScheme = tileProvider.tilingScheme;
524
+ if (defined(tilingScheme)) {
525
525
  const tilingScheme = tileProvider.tilingScheme;
526
526
  primitive._levelZeroTiles = QuadtreeTile.createLevelZeroTiles(
527
527
  tilingScheme
@@ -536,7 +536,6 @@ function selectTilesForRendering(primitive, frameState) {
536
536
  }
537
537
  }
538
538
  } else {
539
- // Nothing to do until the provider is ready.
540
539
  return;
541
540
  }
542
541
  }
@@ -1389,8 +1388,7 @@ const scratchPosition = new Cartesian3();
1389
1388
  const scratchArray = [];
1390
1389
 
1391
1390
  function updateHeights(primitive, frameState) {
1392
- // ready is deprecated. This is here for backwards compatibility.
1393
- if (!primitive.tileProvider.ready) {
1391
+ if (!defined(primitive.tileProvider.tilingScheme)) {
1394
1392
  return;
1395
1393
  }
1396
1394
 
@@ -42,16 +42,6 @@ Object.defineProperties(QuadtreeTileProvider.prototype, {
42
42
  set: DeveloperError.throwInstantiationError,
43
43
  },
44
44
 
45
- /**
46
- * Gets a value indicating whether or not the provider is ready for use.
47
- * @memberof QuadtreeTileProvider.prototype
48
- * @type {boolean}
49
- * @deprecated
50
- */
51
- ready: {
52
- get: DeveloperError.throwInstantiationError,
53
- },
54
-
55
45
  /**
56
46
  * Gets the tiling scheme used by the provider.
57
47
  * @memberof QuadtreeTileProvider.prototype
@@ -754,13 +754,13 @@ Object.defineProperties(Scene.prototype, {
754
754
  },
755
755
 
756
756
  /**
757
- * The drawingBufferHeight of the underlying GL context.
757
+ * The drawingBufferWidth of the underlying GL context.
758
758
  * @memberof Scene.prototype
759
759
  *
760
760
  * @type {number}
761
761
  * @readonly
762
762
  *
763
- * @see {@link https://www.khronos.org/registry/webgl/specs/1.0/#DOM-WebGLRenderingContext-drawingBufferHeight|drawingBufferHeight}
763
+ * @see {@link https://www.khronos.org/registry/webgl/specs/1.0/#DOM-WebGLRenderingContext-drawingBufferWidth|drawingBufferWidth}
764
764
  */
765
765
  drawingBufferWidth: {
766
766
  get: function () {
@@ -3867,7 +3867,7 @@ Scene.prototype.render = function (time) {
3867
3867
  updateDebugShowFramesPerSecond(this, shouldRender);
3868
3868
  tryAndCatchError(this, postPassesUpdate);
3869
3869
 
3870
- // Often used to trigger events (so don't want in trycatch) that the user might be subscribed to. Things like the tile load events, ready promises, etc.
3870
+ // Often used to trigger events (so don't want in trycatch) that the user might be subscribed to. Things like the tile load events, promises, etc.
3871
3871
  // We don't want those events to resolve during the render loop because the events might add new primitives
3872
3872
  callAfterRenderFunctions(this);
3873
3873