@cesium/engine 26.0.0 → 26.1.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.
Files changed (160) hide show
  1. package/Build/Workers/{chunk-EF2QYXGA.js → chunk-2EFYUSUY.js} +14 -14
  2. package/Build/Workers/{chunk-KFSTQKNM.js → chunk-5LSOO2KD.js} +7 -7
  3. package/Build/Workers/{chunk-VQYETPWC.js → chunk-6HK6IXK2.js} +4 -4
  4. package/Build/Workers/{chunk-AYKR4VBR.js → chunk-6YR6JBMY.js} +2 -2
  5. package/Build/Workers/{chunk-DOBXCNC3.js → chunk-76FDC45O.js} +13 -13
  6. package/Build/Workers/{chunk-54I6Y66F.js → chunk-7D2HZKH7.js} +6 -6
  7. package/Build/Workers/{chunk-4MGMYHOO.js → chunk-7KVKHY7O.js} +6 -6
  8. package/Build/Workers/{chunk-IRBKFCEJ.js → chunk-A3O6EDBK.js} +2 -2
  9. package/Build/Workers/{chunk-V7VQKN6N.js → chunk-A6X24AZI.js} +5 -5
  10. package/Build/Workers/{chunk-ZP7JMQV4.js → chunk-AHWAZRBV.js} +6 -2
  11. package/Build/Workers/{chunk-YLY7NKAB.js → chunk-B4CQSLZJ.js} +4 -4
  12. package/Build/Workers/{chunk-J6BWOHUF.js → chunk-C7JQVRLM.js} +3 -3
  13. package/Build/Workers/{chunk-KSSWJIZW.js → chunk-CDJDJ5LK.js} +2 -2
  14. package/Build/Workers/{chunk-G7PXZRVF.js → chunk-CEEZE3YZ.js} +7 -7
  15. package/Build/Workers/{chunk-INUEEEQA.js → chunk-CLCTQVVL.js} +8 -8
  16. package/Build/Workers/{chunk-O3EA5HS7.js → chunk-DBD5WWG2.js} +10 -10
  17. package/Build/Workers/{chunk-E7VQ76KE.js → chunk-DIGUUD6G.js} +6 -6
  18. package/Build/Workers/{chunk-424RNO3D.js → chunk-E7NZJOK7.js} +196 -22
  19. package/Build/Workers/{chunk-ACXQXN46.js → chunk-EHTS2YPT.js} +16 -16
  20. package/Build/Workers/{chunk-VWV2IJRB.js → chunk-ENNFMWDW.js} +11 -11
  21. package/Build/Workers/{chunk-FRQZECAO.js → chunk-FCP2QY4G.js} +5 -5
  22. package/Build/Workers/{chunk-ZZ46LWL6.js → chunk-FDK4K5IA.js} +1 -1
  23. package/Build/Workers/{chunk-C6KNZ7T4.js → chunk-FGQFQHN5.js} +17 -17
  24. package/Build/Workers/{chunk-MYP774IS.js → chunk-GSWMAFTE.js} +8 -8
  25. package/Build/Workers/{chunk-Y5BF6AFU.js → chunk-GXWQZBAI.js} +2 -2
  26. package/Build/Workers/{chunk-DDWSZVMY.js → chunk-HHV3MCGV.js} +5 -5
  27. package/Build/Workers/{chunk-52JDLOEM.js → chunk-HS6AD4P2.js} +14 -14
  28. package/Build/Workers/{chunk-Q3PY526V.js → chunk-IGAZBTFZ.js} +6 -6
  29. package/Build/Workers/{chunk-EBSIOBXY.js → chunk-ILME5BXA.js} +8 -8
  30. package/Build/Workers/{chunk-C6J67V5A.js → chunk-JKXV6PG5.js} +1 -1
  31. package/Build/Workers/{chunk-SMQZZOW6.js → chunk-JW6OZT4R.js} +10 -10
  32. package/Build/Workers/{chunk-F6QDY6HU.js → chunk-KGXSYGBG.js} +13 -13
  33. package/Build/Workers/{chunk-UOOIQ3KX.js → chunk-LD64RPYV.js} +12 -12
  34. package/Build/Workers/{chunk-CFQP6LYM.js → chunk-LGNDTZVX.js} +4 -4
  35. package/Build/Workers/{chunk-U3ZA64U7.js → chunk-LNSQVXFH.js} +2 -2
  36. package/Build/Workers/{chunk-TKKIREQ6.js → chunk-N7CCOFLX.js} +1 -1
  37. package/Build/Workers/{chunk-UA25D5MX.js → chunk-NIWITKQK.js} +10 -10
  38. package/Build/Workers/{chunk-KKOSKAZB.js → chunk-OBEU25PI.js} +17 -17
  39. package/Build/Workers/{chunk-M3B5JKSM.js → chunk-QVLAFFJY.js} +1 -1
  40. package/Build/Workers/{chunk-6YEE6JDR.js → chunk-R4FPNAZ2.js} +6 -6
  41. package/Build/Workers/{chunk-7J2HKPRH.js → chunk-RG4F5R57.js} +9 -9
  42. package/Build/Workers/{chunk-CXOYE2WM.js → chunk-SF6K72D7.js} +5 -5
  43. package/Build/Workers/{chunk-CZEYZU4N.js → chunk-SGRGNDOD.js} +10 -10
  44. package/Build/Workers/{chunk-DBOEKL43.js → chunk-SM2CDCYF.js} +7 -7
  45. package/Build/Workers/{chunk-Y57HREW5.js → chunk-SS5ABQGY.js} +4 -4
  46. package/Build/Workers/{chunk-QRWGUWI6.js → chunk-T5QBPLE3.js} +11 -11
  47. package/Build/Workers/{chunk-ZK3CF7ZD.js → chunk-TVZD72WJ.js} +12 -12
  48. package/Build/Workers/{chunk-IYOUHCZB.js → chunk-UEY73NRN.js} +1 -1
  49. package/Build/Workers/{chunk-7WM2PX4V.js → chunk-UVO6COT2.js} +5 -5
  50. package/Build/Workers/{chunk-P3CK7MCY.js → chunk-VAL7DYNR.js} +4 -4
  51. package/Build/Workers/{chunk-EPYXRCDB.js → chunk-WBSY7HDY.js} +12 -12
  52. package/Build/Workers/{chunk-4S7IE3LB.js → chunk-XDWCTQCZ.js} +2 -2
  53. package/Build/Workers/{chunk-QN67VG36.js → chunk-XLXSDIP5.js} +6 -6
  54. package/Build/Workers/{chunk-S4MCOY6I.js → chunk-XQ3SKCMM.js} +5 -5
  55. package/Build/Workers/{chunk-XZMBNNDX.js → chunk-YKU2Q3A2.js} +9 -9
  56. package/Build/Workers/{chunk-3VFEWOBI.js → chunk-ZMBHFYOX.js} +7 -7
  57. package/Build/Workers/{chunk-MPZHGZU6.js → chunk-ZSGUV73H.js} +4 -4
  58. package/Build/Workers/combineGeometry.js +24 -24
  59. package/Build/Workers/createBoxGeometry.js +18 -18
  60. package/Build/Workers/createBoxOutlineGeometry.js +16 -16
  61. package/Build/Workers/createCircleGeometry.js +26 -26
  62. package/Build/Workers/createCircleOutlineGeometry.js +19 -19
  63. package/Build/Workers/createCoplanarPolygonGeometry.js +33 -33
  64. package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +31 -31
  65. package/Build/Workers/createCorridorGeometry.js +29 -29
  66. package/Build/Workers/createCorridorOutlineGeometry.js +28 -28
  67. package/Build/Workers/createCylinderGeometry.js +20 -20
  68. package/Build/Workers/createCylinderOutlineGeometry.js +18 -18
  69. package/Build/Workers/createEllipseGeometry.js +26 -26
  70. package/Build/Workers/createEllipseOutlineGeometry.js +19 -19
  71. package/Build/Workers/createEllipsoidGeometry.js +19 -19
  72. package/Build/Workers/createEllipsoidOutlineGeometry.js +18 -18
  73. package/Build/Workers/createFrustumGeometry.js +18 -18
  74. package/Build/Workers/createFrustumOutlineGeometry.js +18 -18
  75. package/Build/Workers/createGeometry.js +24 -24
  76. package/Build/Workers/createGroundPolylineGeometry.js +22 -22
  77. package/Build/Workers/createPlaneGeometry.js +16 -16
  78. package/Build/Workers/createPlaneOutlineGeometry.js +15 -15
  79. package/Build/Workers/createPolygonGeometry.js +32 -32
  80. package/Build/Workers/createPolygonOutlineGeometry.js +30 -30
  81. package/Build/Workers/createPolylineGeometry.js +25 -25
  82. package/Build/Workers/createPolylineVolumeGeometry.js +31 -31
  83. package/Build/Workers/createPolylineVolumeOutlineGeometry.js +27 -27
  84. package/Build/Workers/createRectangleGeometry.js +27 -27
  85. package/Build/Workers/createRectangleOutlineGeometry.js +20 -20
  86. package/Build/Workers/createSimplePolylineGeometry.js +23 -23
  87. package/Build/Workers/createSphereGeometry.js +19 -19
  88. package/Build/Workers/createSphereOutlineGeometry.js +18 -18
  89. package/Build/Workers/createTaskProcessorWorker.js +3 -3
  90. package/Build/Workers/createVectorTileClampedPolylines.js +14 -14
  91. package/Build/Workers/createVectorTileGeometries.js +24 -24
  92. package/Build/Workers/createVectorTilePoints.js +13 -13
  93. package/Build/Workers/createVectorTilePolygons.js +22 -22
  94. package/Build/Workers/createVectorTilePolylines.js +14 -14
  95. package/Build/Workers/createVerticesFromCesium3DTilesTerrain.js +25 -25
  96. package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +22 -22
  97. package/Build/Workers/createVerticesFromHeightmap.js +22 -22
  98. package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +20 -20
  99. package/Build/Workers/createWallGeometry.js +24 -24
  100. package/Build/Workers/createWallOutlineGeometry.js +23 -23
  101. package/Build/Workers/decodeDraco.js +10 -10
  102. package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +987 -2320
  103. package/Build/Workers/decodeI3S.js +10 -10
  104. package/Build/Workers/gaussianSplatSorter.js +4 -4
  105. package/Build/Workers/gaussianSplatTextureGenerator.js +4 -4
  106. package/Build/Workers/incrementallyBuildTerrainPicker.js +10 -10
  107. package/Build/Workers/transcodeKTX2.js +6 -6
  108. package/Build/Workers/transferTypedArrayTest.js +1 -1
  109. package/Build/Workers/upsampleQuantizedTerrainMesh.js +22 -22
  110. package/Build/Workers/upsampleVerticesFromCesium3DTilesTerrain.js +25 -25
  111. package/Source/Core/BoundingRectangle.js +6 -8
  112. package/Source/Core/Color.js +1 -0
  113. package/Source/Core/InterpolationAlgorithm.js +57 -50
  114. package/Source/Core/Ion.js +1 -1
  115. package/Source/Core/TerrainMesh.js +3 -3
  116. package/Source/Core/TerrainPicker.js +1 -0
  117. package/Source/Core/writeTextToCanvas.js +1 -0
  118. package/Source/DataSources/CzmlDataSource.js +12 -0
  119. package/Source/DataSources/KmlDataSource.js +528 -555
  120. package/Source/DataSources/PathGraphics.js +8 -1
  121. package/Source/DataSources/PathMode.js +27 -0
  122. package/Source/DataSources/PathVisualizer.js +298 -1
  123. package/Source/Renderer/Texture.js +1 -1
  124. package/Source/Renderer/VertexArray.js +1 -0
  125. package/Source/Scene/ArcGisMapService.js +1 -1
  126. package/Source/Scene/BillboardTexture.js +5 -3
  127. package/Source/Scene/Cesium3DTileOptimizations.js +4 -6
  128. package/Source/Scene/ClippingPlaneCollection.js +2 -2
  129. package/Source/Scene/ClippingPolygon.js +2 -0
  130. package/Source/Scene/ClippingPolygonCollection.js +2 -2
  131. package/Source/Scene/DerivedCommand.js +4 -0
  132. package/Source/Scene/Expression.js +6 -8
  133. package/Source/Scene/GlobeSurfaceShaderSet.js +501 -409
  134. package/Source/Scene/GlobeSurfaceTile.js +540 -401
  135. package/Source/Scene/GlobeSurfaceTileProvider.js +1259 -1146
  136. package/Source/Scene/GltfBufferViewLoader.js +3 -3
  137. package/Source/Scene/GltfLoader.js +1 -0
  138. package/Source/Scene/GltfLoaderUtil.js +20 -4
  139. package/Source/Scene/GltfPipeline/forEachTextureInMaterial.js +10 -0
  140. package/Source/Scene/GltfPipeline/removeUnusedElements.js +21 -11
  141. package/Source/Scene/ImageryLayer.js +2 -2
  142. package/Source/Scene/ImageryLayerCollection.js +2 -2
  143. package/Source/Scene/Material.js +1 -0
  144. package/Source/Scene/Model/Extensions/Gpm/GltfGpmLoader.js +4 -0
  145. package/Source/Scene/Model/Model.js +3 -0
  146. package/Source/Scene/Model/ModelUtility.js +1 -0
  147. package/Source/Scene/Picking.js +5 -0
  148. package/Source/Scene/PntsParser.js +1 -0
  149. package/Source/Scene/QuadtreePrimitive.js +3 -2
  150. package/Source/Scene/ResourceCacheKey.js +5 -5
  151. package/Source/Scene/Scene.js +1 -0
  152. package/Source/Scene/findMeshoptExtension.js +23 -0
  153. package/Source/Scene/renderBufferPointCollection.js +13 -8
  154. package/Source/Scene/renderBufferPolygonCollection.js +9 -13
  155. package/Source/Scene/renderBufferPolylineCollection.js +120 -192
  156. package/Source/Workers/decodeGoogleEarthEnterprisePacket.js +2 -2
  157. package/Source/Workers/incrementallyBuildTerrainPicker.js +2 -0
  158. package/index.d.ts +59 -254
  159. package/index.js +155 -153
  160. package/package.json +4 -4
@@ -14,10 +14,11 @@ import createPropertyDescriptor from "./createPropertyDescriptor.js";
14
14
  * @property {Property | number} [leadTime] A Property specifying the number of seconds in front the object to show.
15
15
  * @property {Property | number} [trailTime] A Property specifying the number of seconds behind of the object to show.
16
16
  * @property {Property | number} [width=1.0] A numeric Property specifying the width in pixels.
17
- * @property {Property | number} [resolution=60] A numeric Property specifying the maximum number of seconds to step when sampling the position.
17
+ * @property {Property | number} [resolution=60] A numeric Property specifying the maximum number of seconds to step when sampling the position. Fractional positive values are allowed; in PORTIONS materialMode, non-positive values fall back to the default resolution of 60 seconds.
18
18
  * @property {MaterialProperty | Color} [material=Color.WHITE] A Property specifying the material used to draw the path.
19
19
  * @property {Property | DistanceDisplayCondition} [distanceDisplayCondition] A Property specifying at what distance from the camera that this path will be displayed.
20
20
  * @property {Property | string} [relativeTo] A Property specifying the frame in which to visualize the path. Use another entity's id to visualize the path relative to that entity, or use the string values "FIXED" or "INERTIAL" to visualize the path in those reference frames.
21
+ * @property {Property | PathMode} [materialMode] A Property specifying how material properties are applied along the path.
21
22
  */
22
23
 
23
24
  /**
@@ -46,6 +47,8 @@ function PathGraphics(options) {
46
47
  this._distanceDisplayConditionSubscription = undefined;
47
48
  this._relativeTo = undefined;
48
49
  this._relativeToSubscription = undefined;
50
+ this._materialMode = undefined;
51
+ this._materialModeSubscription = undefined;
49
52
 
50
53
  this.merge(options ?? Frozen.EMPTY_OBJECT);
51
54
  }
@@ -95,6 +98,7 @@ Object.defineProperties(PathGraphics.prototype, {
95
98
 
96
99
  /**
97
100
  * Gets or sets the Property specifying the maximum number of seconds to step when sampling the position.
101
+ * Fractional positive values are allowed; in PORTIONS materialMode, non-positive values fall back to the default resolution of 60 seconds.
98
102
  * @memberof PathGraphics.prototype
99
103
  * @type {Property|undefined}
100
104
  * @default 60
@@ -125,6 +129,7 @@ Object.defineProperties(PathGraphics.prototype, {
125
129
  * @experimental This feature is not final and is subject to change without Cesium's standard deprecation policy.
126
130
  */
127
131
  relativeTo: createPropertyDescriptor("relativeTo"),
132
+ materialMode: createPropertyDescriptor("materialMode"),
128
133
  });
129
134
 
130
135
  /**
@@ -145,6 +150,7 @@ PathGraphics.prototype.clone = function (result) {
145
150
  result.material = this.material;
146
151
  result.distanceDisplayCondition = this.distanceDisplayCondition;
147
152
  result.relativeTo = this.relativeTo;
153
+ result.materialMode = this.materialMode;
148
154
  return result;
149
155
  };
150
156
 
@@ -170,5 +176,6 @@ PathGraphics.prototype.merge = function (source) {
170
176
  this.distanceDisplayCondition =
171
177
  this.distanceDisplayCondition ?? source.distanceDisplayCondition;
172
178
  this.relativeTo = this.relativeTo ?? source.relativeTo;
179
+ this.materialMode = this.materialMode ?? source.materialMode;
173
180
  };
174
181
  export default PathGraphics;
@@ -0,0 +1,27 @@
1
+ // @ts-check
2
+
3
+ /**
4
+ * Defines how material properties are applied along a path.
5
+ *
6
+ * @enum {number}
7
+ */
8
+ const PathMode = {
9
+ /**
10
+ * The material is applied to the entire path as a whole.
11
+ * @type {number}
12
+ * @constant
13
+ */
14
+ WHOLE: 0,
15
+
16
+ /**
17
+ * The material is applied in portions based on temporal position information,
18
+ * using interval-based material properties.
19
+ * @type {number}
20
+ * @constant
21
+ */
22
+ PORTIONS: 1,
23
+ };
24
+
25
+ Object.freeze(PathMode);
26
+
27
+ export default PathMode;
@@ -17,12 +17,14 @@ import CallbackPositionProperty from "./CallbackPositionProperty.js";
17
17
  import CompositePositionProperty from "./CompositePositionProperty.js";
18
18
  import ConstantPositionProperty from "./ConstantPositionProperty.js";
19
19
  import MaterialProperty from "./MaterialProperty.js";
20
+ import PathMode from "./PathMode.js";
20
21
  import Property from "./Property.js";
21
22
  import ReferenceProperty from "./ReferenceProperty.js";
22
23
  import SampledPositionProperty from "./SampledPositionProperty.js";
23
24
  import ScaledPositionProperty from "./ScaledPositionProperty.js";
24
25
  import TimeIntervalCollectionPositionProperty from "./TimeIntervalCollectionPositionProperty.js";
25
26
  import Quaternion from "../Core/Quaternion.js";
27
+ import arrayRemoveDuplicates from "../Core/arrayRemoveDuplicates.js";
26
28
 
27
29
  const update3DMatrix3Scratch1 = new Matrix3();
28
30
  const update3DMatrix3Scratch2 = new Matrix3();
@@ -210,6 +212,7 @@ const subSampleIntervalPropertyScratch = new TimeInterval();
210
212
  function EntityData(entity) {
211
213
  this.entity = entity;
212
214
  this.polyline = undefined;
215
+ this.segmentPolylines = [];
213
216
  this.index = undefined;
214
217
  this.updater = undefined;
215
218
  }
@@ -734,6 +737,111 @@ function subSample(
734
737
  const toFixedScratch = new Matrix3();
735
738
  const updateOrientationScratch = new Quaternion();
736
739
  const updateRotationScratch = new Matrix3();
740
+ const portionsVisibleIntervalScratch = new TimeInterval();
741
+ const portionsSegmentIntervalScratch = new TimeInterval();
742
+ const portionsDynamicIntervalScratch = new TimeInterval();
743
+
744
+ function getDynamicMaterialProperties(materialData) {
745
+ const dynamic = [];
746
+ if (!defined(materialData)) {
747
+ return dynamic;
748
+ }
749
+
750
+ for (const key in materialData) {
751
+ // Material properties store uniforms as underscored backing fields.
752
+ // Ignore event and subscription bookkeeping fields.
753
+ if (
754
+ key[0] !== "_" ||
755
+ key === "_definitionChanged" ||
756
+ key.endsWith("Subscription")
757
+ ) {
758
+ continue;
759
+ }
760
+
761
+ const prop = materialData[key];
762
+ if (
763
+ defined(prop) &&
764
+ typeof prop.getValue === "function" &&
765
+ !Property.isConstant(prop)
766
+ ) {
767
+ dynamic.push(prop);
768
+ }
769
+ }
770
+
771
+ return dynamic;
772
+ }
773
+
774
+ function emitSegmentsForSplitTimes(
775
+ splitTimes,
776
+ positionProperty,
777
+ time,
778
+ pathGraphics,
779
+ entity,
780
+ item,
781
+ polylineCollection,
782
+ resolution,
783
+ referenceFrame,
784
+ materialProp,
785
+ startingSegIndex,
786
+ ) {
787
+ // Sort and dedupe
788
+ splitTimes.sort(JulianDate.compare);
789
+ splitTimes = arrayRemoveDuplicates(splitTimes, JulianDate.equalsEpsilon);
790
+
791
+ let segIndex = startingSegIndex;
792
+ for (let j = 0; j < splitTimes.length - 1; j++) {
793
+ const splitStart = splitTimes[j];
794
+ const splitStop = splitTimes[j + 1];
795
+ if (!JulianDate.lessThan(splitStart, splitStop)) {
796
+ continue;
797
+ }
798
+
799
+ // Get segment midpoint
800
+ const splitMidTime = JulianDate.addSeconds(
801
+ splitStart,
802
+ JulianDate.secondsDifference(splitStop, splitStart) / 2,
803
+ new JulianDate(),
804
+ );
805
+
806
+ // Subsample positions
807
+ const subPositions = subSample(
808
+ positionProperty,
809
+ splitStart,
810
+ splitStop,
811
+ time,
812
+ referenceFrame,
813
+ resolution,
814
+ [],
815
+ );
816
+ if (subPositions.length < 2) {
817
+ continue;
818
+ }
819
+
820
+ // Get or create a polyline for this segment
821
+ let segPolyline = item.segmentPolylines[segIndex];
822
+ if (!defined(segPolyline)) {
823
+ segPolyline = polylineCollection.add();
824
+ segPolyline.id = entity;
825
+ item.segmentPolylines[segIndex] = segPolyline;
826
+ }
827
+ segPolyline.show = true;
828
+ segPolyline.positions = subPositions;
829
+ segPolyline.material = MaterialProperty.getValue(
830
+ splitMidTime,
831
+ materialProp,
832
+ segPolyline.material,
833
+ );
834
+ segPolyline.width = Property.getValueOrDefault(
835
+ pathGraphics._width,
836
+ time,
837
+ defaultWidth,
838
+ );
839
+
840
+ segIndex++;
841
+ }
842
+ return segIndex;
843
+ }
844
+
737
845
  function PolylineUpdater(scene, referenceFrame) {
738
846
  this._unusedIndexes = [];
739
847
  this._polylineCollection = new PolylineCollection();
@@ -845,6 +953,9 @@ PolylineUpdater.prototype.updateObject = function (time, item) {
845
953
  polyline.show = false;
846
954
  item.index = undefined;
847
955
  }
956
+ for (let j = 0; j < item.segmentPolylines.length; j++) {
957
+ item.segmentPolylines[j].show = false;
958
+ }
848
959
  return;
849
960
  }
850
961
 
@@ -883,16 +994,198 @@ PolylineUpdater.prototype.updateObject = function (time, item) {
883
994
  // This can happen if the position is sampled at a time when it is only defined at a single point
884
995
  if (positions.length < 2) {
885
996
  polyline.show = false;
997
+ for (let j = 0; j < item.segmentPolylines.length; j++) {
998
+ item.segmentPolylines[j].show = false;
999
+ }
886
1000
  return;
887
1001
  }
888
1002
 
889
1003
  polyline.show = true;
890
1004
  polyline.positions = positions;
1005
+
891
1006
  polyline.material = MaterialProperty.getValue(
892
1007
  time,
893
- pathGraphics._material,
1008
+ pathGraphics.material,
894
1009
  polyline.material,
895
1010
  );
1011
+
1012
+ const materialMode = Property.getValueOrUndefined(
1013
+ pathGraphics.materialMode,
1014
+ time,
1015
+ );
1016
+ const materialProp = pathGraphics.material;
1017
+ if (materialMode === PathMode.PORTIONS && !materialProp.isConstant) {
1018
+ // Hide the single polyline if it exists
1019
+ if (defined(polyline)) {
1020
+ polyline.show = false;
1021
+ }
1022
+
1023
+ // Prevent non-positive split steps from creating non-terminating loops.
1024
+ // Positive fractional resolutions are valid; only values <= 0 fall back to the default.
1025
+ const splitResolution = resolution > 0 ? resolution : defaultResolution;
1026
+
1027
+ const intervals = materialProp.intervals;
1028
+ let nextSegIndex = 0;
1029
+
1030
+ if (!defined(intervals)) {
1031
+ // Sampled/interpolated root material - generate synthetic times at resolution intervals
1032
+ const splitTimes = [
1033
+ JulianDate.clone(sampleStart),
1034
+ JulianDate.clone(sampleStop),
1035
+ ];
1036
+ let splitTime = JulianDate.addSeconds(
1037
+ sampleStart,
1038
+ splitResolution,
1039
+ new JulianDate(),
1040
+ );
1041
+ while (JulianDate.lessThan(splitTime, sampleStop)) {
1042
+ splitTimes.push(JulianDate.clone(splitTime));
1043
+ splitTime = JulianDate.addSeconds(
1044
+ splitTime,
1045
+ splitResolution,
1046
+ new JulianDate(),
1047
+ );
1048
+ }
1049
+ nextSegIndex = emitSegmentsForSplitTimes(
1050
+ splitTimes,
1051
+ positionProperty,
1052
+ time,
1053
+ pathGraphics,
1054
+ entity,
1055
+ item,
1056
+ this._polylineCollection,
1057
+ splitResolution,
1058
+ this._referenceFrame,
1059
+ pathGraphics.material,
1060
+ nextSegIndex,
1061
+ );
1062
+ } else {
1063
+ portionsVisibleIntervalScratch.start = sampleStart;
1064
+ portionsVisibleIntervalScratch.stop = sampleStop;
1065
+ portionsVisibleIntervalScratch.isStartIncluded = true;
1066
+ portionsVisibleIntervalScratch.isStopIncluded = true;
1067
+
1068
+ // Interval-based material - process each interval separately
1069
+ for (let i = 0; i < intervals.length; i++) {
1070
+ const interval = intervals.get(i);
1071
+
1072
+ if (
1073
+ !TimeInterval.intersect(
1074
+ interval,
1075
+ portionsVisibleIntervalScratch,
1076
+ portionsSegmentIntervalScratch,
1077
+ )
1078
+ ) {
1079
+ continue;
1080
+ }
1081
+
1082
+ const segStart = portionsSegmentIntervalScratch.start;
1083
+ const segStop = portionsSegmentIntervalScratch.stop;
1084
+
1085
+ if (JulianDate.greaterThanOrEquals(segStart, segStop)) {
1086
+ continue;
1087
+ }
1088
+
1089
+ // Detect dynamic properties and collect their split times
1090
+ const dynamic = getDynamicMaterialProperties(interval.data);
1091
+ const splitTimes = [
1092
+ JulianDate.clone(segStart),
1093
+ JulianDate.clone(segStop),
1094
+ ];
1095
+
1096
+ for (let j = 0; j < dynamic.length; j++) {
1097
+ const prop = dynamic[j];
1098
+ const timeDynamicIntervals = prop.intervals;
1099
+
1100
+ if (defined(timeDynamicIntervals)) {
1101
+ // Interval-based property: collect interval boundaries
1102
+ for (let k = 0; k < timeDynamicIntervals.length; k++) {
1103
+ const timeDynamicInterval = timeDynamicIntervals.get(k);
1104
+
1105
+ if (
1106
+ !TimeInterval.intersect(
1107
+ timeDynamicInterval,
1108
+ portionsSegmentIntervalScratch,
1109
+ portionsDynamicIntervalScratch,
1110
+ )
1111
+ ) {
1112
+ continue;
1113
+ }
1114
+
1115
+ if (
1116
+ JulianDate.greaterThan(
1117
+ portionsDynamicIntervalScratch.start,
1118
+ segStart,
1119
+ ) &&
1120
+ JulianDate.lessThan(
1121
+ portionsDynamicIntervalScratch.start,
1122
+ segStop,
1123
+ )
1124
+ ) {
1125
+ splitTimes.push(
1126
+ JulianDate.clone(portionsDynamicIntervalScratch.start),
1127
+ );
1128
+ }
1129
+
1130
+ if (
1131
+ JulianDate.greaterThan(
1132
+ portionsDynamicIntervalScratch.stop,
1133
+ segStart,
1134
+ ) &&
1135
+ JulianDate.lessThan(
1136
+ portionsDynamicIntervalScratch.stop,
1137
+ segStop,
1138
+ )
1139
+ ) {
1140
+ splitTimes.push(
1141
+ JulianDate.clone(portionsDynamicIntervalScratch.stop),
1142
+ );
1143
+ }
1144
+ }
1145
+ } else if (!Property.isConstant(prop)) {
1146
+ // Sampled/interpolated property: add resolution-based split times
1147
+ let sampledTime = JulianDate.clone(segStart);
1148
+ while (JulianDate.lessThan(sampledTime, segStop)) {
1149
+ splitTimes.push(JulianDate.clone(sampledTime));
1150
+ sampledTime = JulianDate.addSeconds(
1151
+ sampledTime,
1152
+ splitResolution,
1153
+ new JulianDate(),
1154
+ );
1155
+ }
1156
+ }
1157
+ }
1158
+
1159
+ // Emit segments for this interval's split times
1160
+ nextSegIndex = emitSegmentsForSplitTimes(
1161
+ splitTimes,
1162
+ positionProperty,
1163
+ time,
1164
+ pathGraphics,
1165
+ entity,
1166
+ item,
1167
+ this._polylineCollection,
1168
+ splitResolution,
1169
+ this._referenceFrame,
1170
+ interval.data,
1171
+ nextSegIndex,
1172
+ );
1173
+ }
1174
+ }
1175
+
1176
+ // Hide any excess segment polylines from previous frames.
1177
+ for (let j = nextSegIndex; j < item.segmentPolylines.length; j++) {
1178
+ if (defined(item.segmentPolylines[j])) {
1179
+ item.segmentPolylines[j].show = false;
1180
+ }
1181
+ }
1182
+ } else {
1183
+ // Not in PORTIONS mode, hide all segment polylines from previous frames
1184
+ for (let j = 0; j < item.segmentPolylines.length; j++) {
1185
+ item.segmentPolylines[j].show = false;
1186
+ }
1187
+ }
1188
+
896
1189
  polyline.width = Property.getValueOrDefault(
897
1190
  pathGraphics._width,
898
1191
  time,
@@ -914,6 +1207,10 @@ PolylineUpdater.prototype.removeObject = function (item) {
914
1207
  polyline.id = undefined;
915
1208
  item.index = undefined;
916
1209
  }
1210
+ for (let i = 0; i < item.segmentPolylines.length; i++) {
1211
+ item.segmentPolylines[i].show = false;
1212
+ }
1213
+ item.segmentPolylines.length = 0;
917
1214
  };
918
1215
 
919
1216
  PolylineUpdater.prototype.destroy = function () {
@@ -576,7 +576,7 @@ function loadNull(texture) {
576
576
  /**
577
577
  * This function is identical to using the Texture constructor except that it can be
578
578
  * replaced with a mock/spy in tests.
579
- * @private
579
+ * @ignore
580
580
  */
581
581
  Texture.create = function (options) {
582
582
  return new Texture(options);
@@ -16,6 +16,7 @@ import assert from "../Core/assert.js";
16
16
 
17
17
  /** @import {TypedArray, TypedArrayConstructor} from "../Core/globalTypes.js"; */
18
18
 
19
+ /** @ignore */
19
20
  function addAttribute(attributes, attribute, index, context) {
20
21
  const hasVertexBuffer = defined(attribute.vertexBuffer);
21
22
  const hasValue = defined(attribute.value);
@@ -4,7 +4,7 @@ import Resource from "../Core/Resource.js";
4
4
 
5
5
  let defaultTokenCredit;
6
6
  const defaultAccessToken =
7
- "AAPTauP-rqeCeHTtrSMga9XbPxQ..ZMIZzf1tcwicoJi5E5T2mG0EO3qlIRkQNe5S-uA95RJKU0YkrwOT0AF-lSIyXXBFakDJIPaxsZ5vpnzlaW3kCYG2Tk53bY6OntMqn1EBYtDPyqz38iM4NU_bbDN3DuxUdkxYDWnxJXxxWe3bEeUANbvhKK76PU7N0wjZgtEYHYocspYXSHxbCEYo_eXrHDkrWpgkzcmQ3WpQqf2XprJ39pbqVSZbxskDh3zBm92XxUaiSmdf7rC1w3VoAT1_UarLJfAQ";
7
+ "AAPTaNEKX8S_W5tHpwdW7Txp1uA..bCHyKIo32UDZUn0ep6bzo_JLzQdslNSJ9HpSru5K9nkNyUqvkKFceNFYUFPbtEEZPfCqpF_qVG3zdTZOzocx6Dnzy0e2LctUukYPVrG2GPAdcPN-M9nklag0M8cYMkSCHQOort_AeIxl8C7ORIX0KjE5Mrvbe0Rm3eC-YpZDiHp6PUyarwFpsRdcq1TvpcQqsqJQ3aoWdEIxnEjEZ6e6iZhte1i2oJgrZ8SxsSPaIbrjA4USgsQGeBjUAT1_V7gBCY6D";
8
8
  /**
9
9
  * Default options for accessing the ArcGIS image tile service.
10
10
  *
@@ -199,9 +199,11 @@ BillboardTexture.prototype.loadImage = async function (
199
199
  let index;
200
200
  const atlas = this._billboardCollection.textureAtlas;
201
201
  try {
202
- index = atlas.addImage(id, image, width, height);
203
- if (index instanceof Promise) {
204
- index = await index;
202
+ const indexOrPromise = atlas.addImage(id, image, width, height);
203
+ if (typeof indexOrPromise === "number") {
204
+ index = indexOrPromise;
205
+ } else {
206
+ index = await indexOrPromise;
205
207
  }
206
208
  } catch (error) {
207
209
  // There was an error loading the image
@@ -49,12 +49,10 @@ Cesium3DTileOptimizations.checkChildrenWithinParent = function (tile) {
49
49
 
50
50
  // Check if the child has an oriented bounding box.
51
51
  const childBoundingVolume = child.boundingVolume;
52
- if (
53
- !(
54
- childBoundingVolume instanceof TileOrientedBoundingBox ||
55
- childBoundingVolume instanceof TileBoundingRegion
56
- )
57
- ) {
52
+ if (!(
53
+ childBoundingVolume instanceof TileOrientedBoundingBox ||
54
+ childBoundingVolume instanceof TileBoundingRegion
55
+ )) {
58
56
  // Do not support if the parent and child both do not have oriented bounding boxes.
59
57
  tile._optimChildrenWithinParent =
60
58
  Cesium3DTileOptimizationHint.SKIP_OPTIMIZATION;
@@ -605,7 +605,7 @@ const scratchMatrix = new Matrix4();
605
605
  const scratchPlane = new Plane(Cartesian3.UNIT_X, 0.0);
606
606
  /**
607
607
  * Determines the type intersection with the planes of this ClippingPlaneCollection instance and the specified {@link TileBoundingVolume}.
608
- * @private
608
+ * @ignore
609
609
  *
610
610
  * @param {object} tileBoundingVolume The volume to determine the intersection with the planes.
611
611
  * @param {Matrix4} [transform] An optional, additional matrix to transform the plane to world coordinates.
@@ -656,7 +656,7 @@ ClippingPlaneCollection.prototype.computeIntersectionWithBoundingVolume =
656
656
  * @param {ClippingPlaneCollection} [clippingPlaneCollection] A ClippingPlaneCollection (or undefined) being attached to an object
657
657
  * @param {object} owner An Object that should receive the new ClippingPlaneCollection
658
658
  * @param {string} key The Key for the Object to reference the ClippingPlaneCollection
659
- * @private
659
+ * @ignore
660
660
  */
661
661
  ClippingPlaneCollection.setOwner = function (
662
662
  clippingPlaneCollection,
@@ -84,6 +84,7 @@ function ClippingPolygon(options) {
84
84
  *
85
85
  * @param {Cartesian3[]|undefined} input The input array
86
86
  * @returns {Cartesian3[]|undefined} The copy
87
+ * @ignore
87
88
  */
88
89
  function copyArrayCartesian3(input) {
89
90
  if (!defined(input)) {
@@ -110,6 +111,7 @@ function copyArrayCartesian3(input) {
110
111
  * @param {Cartesian3[]|undefined} a The first array
111
112
  * @param {Cartesian3[]|undefined} b The second array
112
113
  * @returns {boolean} Whether the arrays are equal
114
+ * @ignore
113
115
  */
114
116
  function equalsArrayCartesian3(a, b) {
115
117
  if (!defined(a) && !defined(b)) {
@@ -897,7 +897,7 @@ const scratchRectangleIntersection = new Rectangle();
897
897
  const scratchRectanglePolygon = new Rectangle();
898
898
  /**
899
899
  * Determines the type intersection with the polygons of this ClippingPolygonCollection instance and the specified {@link TileBoundingVolume}.
900
- * @private
900
+ * @ignore
901
901
  *
902
902
  * @param {object} tileBoundingVolume The volume to determine the intersection with the polygons.
903
903
  * @param {Ellipsoid} [ellipsoid=Ellipsoid.default] The ellipsoid on which the bounding volumes are defined.
@@ -963,7 +963,7 @@ ClippingPolygonCollection.prototype.computeIntersectionWithBoundingVolume =
963
963
  * @param {ClippingPolygonCollection} [clippingPolygonsCollection] A ClippingPolygonCollection (or undefined) being attached to an object
964
964
  * @param {object} owner An Object that should receive the new ClippingPolygonCollection
965
965
  * @param {string} key The Key for the Object to reference the ClippingPolygonCollection
966
- * @private
966
+ * @ignore
967
967
  */
968
968
  ClippingPolygonCollection.setOwner = function (
969
969
  clippingPolygonsCollection,
@@ -403,6 +403,7 @@ function getComponentCount(classProperty) {
403
403
  * @param {string} offset The offset
404
404
  * @param {string} scale The scale
405
405
  * @returns {string} The statement
406
+ * @ignore
406
407
  */
407
408
  function unapplyValueTransform(input, offset, scale) {
408
409
  return `((${input} - float(${offset})) / float(${scale}))`;
@@ -415,6 +416,7 @@ function unapplyValueTransform(input, offset, scale) {
415
416
  * @param {string} input The input value
416
417
  * @param {string} componentType The component type
417
418
  * @returns {string} The statement
419
+ * @ignore
418
420
  */
419
421
  function unnormalize(input, componentType) {
420
422
  const max = MetadataComponentType.getMaximum(componentType);
@@ -429,6 +431,7 @@ function unnormalize(input, componentType) {
429
431
  * @param {object} metadataProperty The metadata property, either
430
432
  * a `PropertyTextureProperty` or a `PropertyAttributeProperty`
431
433
  * @returns {string} The string
434
+ * @ignore
432
435
  */
433
436
  function getSourceValueStringScalar(classProperty, metadataProperty) {
434
437
  let result = `float(value)`;
@@ -457,6 +460,7 @@ function getSourceValueStringScalar(classProperty, metadataProperty) {
457
460
  * a `PropertyTextureProperty` or a `PropertyAttributeProperty`
458
461
  * @param {string} componentName The name, in ["x", "y", "z", "w"]
459
462
  * @returns {string} The string
463
+ * @ignore
460
464
  */
461
465
  function getSourceValueStringComponent(
462
466
  classProperty,
@@ -1341,14 +1341,12 @@ Node.prototype._evaluateNegative = function (feature) {
1341
1341
  Node.prototype._evaluatePositive = function (feature) {
1342
1342
  const left = this._left.evaluate(feature);
1343
1343
 
1344
- if (
1345
- !(
1346
- left instanceof Cartesian2 ||
1347
- left instanceof Cartesian3 ||
1348
- left instanceof Cartesian4 ||
1349
- typeof left === "number"
1350
- )
1351
- ) {
1344
+ if (!(
1345
+ left instanceof Cartesian2 ||
1346
+ left instanceof Cartesian3 ||
1347
+ left instanceof Cartesian4 ||
1348
+ typeof left === "number"
1349
+ )) {
1352
1350
  throw new RuntimeError(
1353
1351
  `Operator "+" requires a vector or number argument. Argument is ${left}.`,
1354
1352
  );