@cesium/engine 7.0.0 → 9.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (200) hide show
  1. package/Build/ThirdParty/Workers/z-worker-pako.js +1 -5
  2. package/Build/Workers/{chunk-7XEAYGZK.js → chunk-24YTYWNB.js} +10 -10
  3. package/Build/Workers/{chunk-IQBYFRVW.js → chunk-2632RVPI.js} +7 -7
  4. package/Build/Workers/chunk-2KACWKS4.js +501 -0
  5. package/Build/Workers/{chunk-QZAD5O7I.js → chunk-2XPLH3JY.js} +7 -7
  6. package/Build/Workers/{chunk-JY5YEZFA.js → chunk-2ZBL3MVO.js} +8 -8
  7. package/Build/Workers/{chunk-ZK5JOS3D.js → chunk-3NCVAGDA.js} +14 -14
  8. package/Build/Workers/{chunk-AR5DNBJ4.js → chunk-5R6VWLMH.js} +6 -6
  9. package/Build/Workers/{chunk-PTQQUQC3.js → chunk-5TIV3L26.js} +13 -13
  10. package/Build/Workers/{chunk-BZP4T2JJ.js → chunk-6WF3KIF5.js} +10 -10
  11. package/Build/Workers/{chunk-5WQ523AW.js → chunk-73FKKY52.js} +5 -5
  12. package/Build/Workers/{chunk-F6SE42BK.js → chunk-7COR472O.js} +15 -472
  13. package/Build/Workers/{chunk-72SANQJV.js → chunk-ADOVHYWO.js} +9 -5
  14. package/Build/Workers/{chunk-5YLJ77FF.js → chunk-BCU2LH5T.js} +12 -11
  15. package/Build/Workers/{chunk-4EBHOMFX.js → chunk-C3XBUYBO.js} +17 -17
  16. package/Build/Workers/{chunk-IX2JCCNM.js → chunk-C6OI26DR.js} +1 -1
  17. package/Build/Workers/{chunk-2HJWSU7B.js → chunk-CO35JNNE.js} +4 -4
  18. package/Build/Workers/{chunk-OVLG3FRS.js → chunk-DGDUKCJJ.js} +6 -6
  19. package/Build/Workers/{chunk-DTAIXKTO.js → chunk-DPUSFA7S.js} +6 -6
  20. package/Build/Workers/{chunk-R5X4OQT4.js → chunk-E6WXPSJS.js} +7 -7
  21. package/Build/Workers/{chunk-VK3EJHWI.js → chunk-EOXYZ34O.js} +2 -2
  22. package/Build/Workers/{chunk-RAEV7K66.js → chunk-EPKE7GE3.js} +5 -5
  23. package/Build/Workers/{chunk-GV56Q4LU.js → chunk-GFA4SMXV.js} +11 -11
  24. package/Build/Workers/{chunk-NKPBIX7F.js → chunk-GXUXEOE2.js} +1 -1
  25. package/Build/Workers/{chunk-NY3K4IM3.js → chunk-HBQPB6IH.js} +12 -12
  26. package/Build/Workers/{chunk-6HZQPRUS.js → chunk-I37B3MZ2.js} +1 -1
  27. package/Build/Workers/{chunk-VRGFV2UO.js → chunk-L4BW3RUA.js} +10 -10
  28. package/Build/Workers/{chunk-6VJVYK2V.js → chunk-LAQP3SCC.js} +2 -2
  29. package/Build/Workers/{chunk-PNBGBETF.js → chunk-LQJ5FFFR.js} +10 -10
  30. package/Build/Workers/{chunk-UAEW6HKG.js → chunk-M2AYBTNH.js} +13 -13
  31. package/Build/Workers/{chunk-YUCVWAY6.js → chunk-MWV7IZK4.js} +7 -7
  32. package/Build/Workers/{chunk-JXDC723O.js → chunk-N4KXMWQU.js} +2 -2
  33. package/Build/Workers/{chunk-XWXM2O2R.js → chunk-NP2GYYE5.js} +6 -6
  34. package/Build/Workers/{chunk-GEJTYLCO.js → chunk-NZWNZA6S.js} +5 -5
  35. package/Build/Workers/{chunk-LZGHD6NY.js → chunk-P2YAAMT2.js} +15 -15
  36. package/Build/Workers/{chunk-S6SKF6DT.js → chunk-P4XKB3QZ.js} +5 -5
  37. package/Build/Workers/{chunk-U2VCRRQW.js → chunk-PXB7T27O.js} +6 -6
  38. package/Build/Workers/{chunk-RV7ZYPFT.js → chunk-QCQUZGXI.js} +4 -4
  39. package/Build/Workers/{chunk-JJ4VBOQ3.js → chunk-QKBGRKKG.js} +4 -4
  40. package/Build/Workers/{chunk-ODW7WYM4.js → chunk-RMOEYCZW.js} +2 -2
  41. package/Build/Workers/{chunk-ZUA2UUNV.js → chunk-RSJXEO2A.js} +2 -2
  42. package/Build/Workers/{chunk-UDO6BFSF.js → chunk-RV7ZOSS6.js} +13 -13
  43. package/Build/Workers/{chunk-LZ7JIV3K.js → chunk-SE4PXOEA.js} +17 -17
  44. package/Build/Workers/{chunk-S4MAZ3SS.js → chunk-SS4ESNE3.js} +2 -2
  45. package/Build/Workers/{chunk-AIPU2VSX.js → chunk-TJBU6GML.js} +6 -6
  46. package/Build/Workers/{chunk-5M3U6ZMA.js → chunk-TZORKRNK.js} +1 -1
  47. package/Build/Workers/{chunk-MY3VNFGQ.js → chunk-VR5RBW52.js} +7 -7
  48. package/Build/Workers/{chunk-FP6GYBFX.js → chunk-WHUSTDIB.js} +10 -10
  49. package/Build/Workers/{chunk-5HDYHG3F.js → chunk-X2F6BEPY.js} +13 -13
  50. package/Build/Workers/{chunk-WZU2YLWG.js → chunk-X6XOMPWL.js} +3 -3
  51. package/Build/Workers/{chunk-UGK3FCDY.js → chunk-YDVSBWEO.js} +1 -1
  52. package/Build/Workers/{chunk-46UD5ABS.js → chunk-YV4H2Y7M.js} +4 -4
  53. package/Build/Workers/{chunk-WBQCVXR3.js → chunk-Z7FQLK6N.js} +4 -4
  54. package/Build/Workers/{chunk-L2ZN645J.js → chunk-ZNVSKMQ2.js} +6 -6
  55. package/Build/Workers/{chunk-JCNXK6EL.js → chunk-ZYPTP7GS.js} +11 -11
  56. package/Build/Workers/combineGeometry.js +24 -23
  57. package/Build/Workers/createBoxGeometry.js +18 -17
  58. package/Build/Workers/createBoxOutlineGeometry.js +16 -15
  59. package/Build/Workers/createCircleGeometry.js +26 -25
  60. package/Build/Workers/createCircleOutlineGeometry.js +19 -18
  61. package/Build/Workers/createCoplanarPolygonGeometry.js +33 -32
  62. package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +31 -30
  63. package/Build/Workers/createCorridorGeometry.js +29 -28
  64. package/Build/Workers/createCorridorOutlineGeometry.js +28 -27
  65. package/Build/Workers/createCylinderGeometry.js +20 -19
  66. package/Build/Workers/createCylinderOutlineGeometry.js +18 -17
  67. package/Build/Workers/createEllipseGeometry.js +26 -25
  68. package/Build/Workers/createEllipseOutlineGeometry.js +19 -18
  69. package/Build/Workers/createEllipsoidGeometry.js +19 -18
  70. package/Build/Workers/createEllipsoidOutlineGeometry.js +18 -17
  71. package/Build/Workers/createFrustumGeometry.js +18 -17
  72. package/Build/Workers/createFrustumOutlineGeometry.js +18 -17
  73. package/Build/Workers/createGeometry.js +54 -33
  74. package/Build/Workers/createGroundPolylineGeometry.js +22 -21
  75. package/Build/Workers/createPlaneGeometry.js +16 -15
  76. package/Build/Workers/createPlaneOutlineGeometry.js +15 -14
  77. package/Build/Workers/createPolygonGeometry.js +33 -32
  78. package/Build/Workers/createPolygonOutlineGeometry.js +30 -29
  79. package/Build/Workers/createPolylineGeometry.js +25 -24
  80. package/Build/Workers/createPolylineVolumeGeometry.js +31 -30
  81. package/Build/Workers/createPolylineVolumeOutlineGeometry.js +27 -26
  82. package/Build/Workers/createRectangleGeometry.js +27 -26
  83. package/Build/Workers/createRectangleOutlineGeometry.js +20 -19
  84. package/Build/Workers/createSimplePolylineGeometry.js +23 -22
  85. package/Build/Workers/createSphereGeometry.js +19 -18
  86. package/Build/Workers/createSphereOutlineGeometry.js +18 -17
  87. package/Build/Workers/createTaskProcessorWorker.js +3 -3
  88. package/Build/Workers/createVectorTileClampedPolylines.js +14 -14
  89. package/Build/Workers/createVectorTileGeometries.js +24 -23
  90. package/Build/Workers/createVectorTilePoints.js +12 -12
  91. package/Build/Workers/createVectorTilePolygons.js +22 -21
  92. package/Build/Workers/createVectorTilePolylines.js +14 -14
  93. package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +22 -21
  94. package/Build/Workers/createVerticesFromHeightmap.js +22 -21
  95. package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +19 -18
  96. package/Build/Workers/createWallGeometry.js +24 -23
  97. package/Build/Workers/createWallOutlineGeometry.js +23 -22
  98. package/Build/Workers/decodeDraco.js +11 -11
  99. package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +5 -5
  100. package/Build/Workers/decodeI3S.js +601 -92
  101. package/Build/Workers/transcodeKTX2.js +7 -7
  102. package/Build/Workers/transferTypedArrayTest.js +1 -1
  103. package/Build/Workers/upsampleQuantizedTerrainMesh.js +22 -21
  104. package/Source/Core/Check.d.ts +127 -0
  105. package/Source/Core/Check.js +0 -1
  106. package/Source/Core/Ellipsoid.js +6 -0
  107. package/Source/Core/Geometry.js +1 -1
  108. package/Source/Core/IntersectionTests.js +6 -3
  109. package/Source/Core/Ion.js +1 -1
  110. package/Source/Core/PixelFormat.js +5 -0
  111. package/Source/Core/PolygonGeometry.js +1 -1
  112. package/Source/Core/Transforms.js +3 -0
  113. package/Source/Core/VerticalExaggeration.js +2 -1
  114. package/Source/Core/srgbToLinear.js +32 -0
  115. package/Source/DataSources/CzmlDataSource.js +51 -23
  116. package/Source/DataSources/DataSourceDisplay.js +27 -0
  117. package/Source/DataSources/Entity.js +20 -2
  118. package/Source/DataSources/GeometryUpdaterSet.js +114 -0
  119. package/Source/DataSources/GeometryVisualizer.js +19 -83
  120. package/Source/Renderer/Context.js +10 -0
  121. package/Source/Renderer/ContextLimits.js +2 -0
  122. package/Source/Renderer/demodernizeShader.js +4 -1
  123. package/Source/Scene/ArcGisMapService.js +1 -1
  124. package/Source/Scene/Axis.js +12 -7
  125. package/Source/Scene/Billboard.js +32 -0
  126. package/Source/Scene/BillboardCollection.js +1 -1
  127. package/Source/Scene/BingMapsImageryProvider.js +4 -0
  128. package/Source/Scene/Camera.js +46 -4
  129. package/Source/Scene/Cesium3DTilesVoxelProvider.js +2 -9
  130. package/Source/Scene/Cesium3DTileset.js +10 -7
  131. package/Source/Scene/Cesium3DTilesetBaseTraversal.js +2 -4
  132. package/Source/Scene/FrameState.js +5 -0
  133. package/Source/Scene/Globe.js +0 -67
  134. package/Source/Scene/GlobeTranslucencyState.js +1 -1
  135. package/Source/Scene/GltfPipeline/updateVersion.js +69 -68
  136. package/Source/Scene/I3SDataProvider.js +270 -53
  137. package/Source/Scene/I3SDecoder.js +8 -1
  138. package/Source/Scene/I3SFeature.js +2 -5
  139. package/Source/Scene/I3SField.js +136 -31
  140. package/Source/Scene/I3SGeometry.js +70 -2
  141. package/Source/Scene/I3SLayer.js +55 -10
  142. package/Source/Scene/I3SNode.js +175 -18
  143. package/Source/Scene/I3SStatistics.js +94 -0
  144. package/Source/Scene/I3SSublayer.js +176 -0
  145. package/Source/Scene/I3SSymbology.js +337 -0
  146. package/Source/Scene/KeyframeNode.js +1 -1
  147. package/Source/Scene/Label.js +33 -0
  148. package/Source/Scene/LabelCollection.js +2 -1
  149. package/Source/Scene/Model/pickModel.js +25 -7
  150. package/Source/Scene/PickFramebuffer.js +37 -2
  151. package/Source/Scene/Picking.js +113 -39
  152. package/Source/Scene/Primitive.js +6 -5
  153. package/Source/Scene/Scene.js +126 -42
  154. package/Source/Scene/ScreenSpaceCameraController.js +21 -7
  155. package/Source/Scene/SensorVolumePortionToDisplay.js +69 -0
  156. package/Source/Scene/SpatialNode.js +12 -19
  157. package/Source/Scene/StructuralMetadata.js +1 -1
  158. package/Source/Scene/VoxelBoxShape.js +67 -6
  159. package/Source/Scene/VoxelCell.js +273 -0
  160. package/Source/Scene/VoxelCylinderShape.js +117 -163
  161. package/Source/Scene/VoxelEllipsoidShape.js +255 -304
  162. package/Source/Scene/VoxelPrimitive.js +109 -15
  163. package/Source/Scene/VoxelRenderResources.js +12 -3
  164. package/Source/Scene/VoxelShape.js +7 -4
  165. package/Source/Scene/VoxelTraversal.js +76 -54
  166. package/Source/Scene/buildVoxelDrawCommands.js +23 -0
  167. package/Source/Scene/createGooglePhotorealistic3DTileset.js +1 -0
  168. package/Source/Scene/processVoxelProperties.js +3 -0
  169. package/Source/Shaders/Voxels/IntersectBox.glsl +21 -47
  170. package/Source/Shaders/Voxels/IntersectBox.js +21 -47
  171. package/Source/Shaders/Voxels/IntersectClippingPlanes.glsl +1 -1
  172. package/Source/Shaders/Voxels/IntersectClippingPlanes.js +1 -1
  173. package/Source/Shaders/Voxels/IntersectCylinder.glsl +76 -203
  174. package/Source/Shaders/Voxels/IntersectCylinder.js +76 -203
  175. package/Source/Shaders/Voxels/IntersectEllipsoid.glsl +220 -229
  176. package/Source/Shaders/Voxels/IntersectEllipsoid.js +220 -229
  177. package/Source/Shaders/Voxels/IntersectLongitude.glsl +102 -0
  178. package/Source/Shaders/Voxels/IntersectLongitude.js +104 -0
  179. package/Source/Shaders/Voxels/IntersectionUtils.glsl +33 -11
  180. package/Source/Shaders/Voxels/IntersectionUtils.js +33 -11
  181. package/Source/Shaders/Voxels/Megatexture.glsl +1 -2
  182. package/Source/Shaders/Voxels/Megatexture.js +1 -2
  183. package/Source/Shaders/Voxels/Octree.glsl +14 -9
  184. package/Source/Shaders/Voxels/Octree.js +14 -9
  185. package/Source/Shaders/Voxels/VoxelFS.glsl +128 -40
  186. package/Source/Shaders/Voxels/VoxelFS.js +128 -40
  187. package/Source/Shaders/Voxels/VoxelUtils.glsl +31 -0
  188. package/Source/Shaders/Voxels/VoxelUtils.js +33 -0
  189. package/Source/Shaders/Voxels/convertUvToBox.glsl +24 -3
  190. package/Source/Shaders/Voxels/convertUvToBox.js +24 -4
  191. package/Source/Shaders/Voxels/convertUvToCylinder.glsl +64 -40
  192. package/Source/Shaders/Voxels/convertUvToCylinder.js +64 -40
  193. package/Source/Shaders/Voxels/convertUvToEllipsoid.glsl +100 -91
  194. package/Source/Shaders/Voxels/convertUvToEllipsoid.js +100 -91
  195. package/Source/ThirdParty/Workers/z-worker-pako.js +1 -1
  196. package/Source/Workers/createGeometry.js +40 -11
  197. package/Source/Workers/decodeI3S.js +720 -94
  198. package/index.d.ts +542 -40
  199. package/index.js +75 -66
  200. package/package.json +2 -2
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @license
3
3
  * Cesium - https://github.com/CesiumGS/cesium
4
- * Version 1.114
4
+ * Version 1.116
5
5
  *
6
6
  * Copyright 2011-2022 Cesium Contributors
7
7
  *
@@ -25,25 +25,25 @@
25
25
 
26
26
  import {
27
27
  createTaskProcessorWorker_default
28
- } from "./chunk-ODW7WYM4.js";
28
+ } from "./chunk-RMOEYCZW.js";
29
29
  import {
30
30
  WebGLConstants_default
31
- } from "./chunk-6HZQPRUS.js";
31
+ } from "./chunk-I37B3MZ2.js";
32
32
  import {
33
33
  RuntimeError_default
34
- } from "./chunk-JXDC723O.js";
34
+ } from "./chunk-N4KXMWQU.js";
35
35
  import {
36
36
  defaultValue_default
37
- } from "./chunk-5M3U6ZMA.js";
37
+ } from "./chunk-TZORKRNK.js";
38
38
  import {
39
39
  Check_default
40
- } from "./chunk-S4MAZ3SS.js";
40
+ } from "./chunk-SS4ESNE3.js";
41
41
  import {
42
42
  __commonJS,
43
43
  __require,
44
44
  __toESM,
45
45
  defined_default
46
- } from "./chunk-UGK3FCDY.js";
46
+ } from "./chunk-YDVSBWEO.js";
47
47
 
48
48
  // packages/engine/Source/ThirdParty/Workers/basis_transcoder.js
49
49
  var require_basis_transcoder = __commonJS({
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @license
3
3
  * Cesium - https://github.com/CesiumGS/cesium
4
- * Version 1.114
4
+ * Version 1.116
5
5
  *
6
6
  * Copyright 2011-2022 Cesium Contributors
7
7
  *
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @license
3
3
  * Cesium - https://github.com/CesiumGS/cesium
4
- * Version 1.114
4
+ * Version 1.116
5
5
  *
6
6
  * Copyright 2011-2022 Cesium Contributors
7
7
  *
@@ -26,50 +26,51 @@
26
26
  import {
27
27
  EllipsoidalOccluder_default,
28
28
  TerrainEncoding_default
29
- } from "./chunk-5YLJ77FF.js";
29
+ } from "./chunk-BCU2LH5T.js";
30
30
  import {
31
31
  createTaskProcessorWorker_default
32
- } from "./chunk-ODW7WYM4.js";
32
+ } from "./chunk-RMOEYCZW.js";
33
33
  import {
34
34
  OrientedBoundingBox_default
35
- } from "./chunk-FP6GYBFX.js";
35
+ } from "./chunk-WHUSTDIB.js";
36
36
  import {
37
37
  AttributeCompression_default
38
- } from "./chunk-R5X4OQT4.js";
39
- import "./chunk-PNBGBETF.js";
40
- import "./chunk-AIPU2VSX.js";
41
- import "./chunk-VRGFV2UO.js";
42
- import "./chunk-XWXM2O2R.js";
38
+ } from "./chunk-E6WXPSJS.js";
39
+ import "./chunk-LQJ5FFFR.js";
40
+ import "./chunk-TJBU6GML.js";
41
+ import "./chunk-L4BW3RUA.js";
42
+ import "./chunk-NP2GYYE5.js";
43
43
  import {
44
44
  IndexDatatype_default
45
- } from "./chunk-S6SKF6DT.js";
45
+ } from "./chunk-P4XKB3QZ.js";
46
46
  import {
47
47
  BoundingSphere_default
48
- } from "./chunk-F6SE42BK.js";
49
- import "./chunk-WZU2YLWG.js";
48
+ } from "./chunk-7COR472O.js";
49
+ import "./chunk-2KACWKS4.js";
50
+ import "./chunk-X6XOMPWL.js";
50
51
  import {
51
52
  Rectangle_default
52
- } from "./chunk-QZAD5O7I.js";
53
- import "./chunk-GEJTYLCO.js";
53
+ } from "./chunk-2XPLH3JY.js";
54
+ import "./chunk-NZWNZA6S.js";
54
55
  import {
55
56
  Cartesian2_default,
56
57
  Cartesian3_default,
57
58
  Cartographic_default,
58
59
  Ellipsoid_default
59
- } from "./chunk-72SANQJV.js";
60
+ } from "./chunk-ADOVHYWO.js";
60
61
  import {
61
62
  Math_default
62
- } from "./chunk-RV7ZYPFT.js";
63
- import "./chunk-6HZQPRUS.js";
64
- import "./chunk-JXDC723O.js";
65
- import "./chunk-5M3U6ZMA.js";
63
+ } from "./chunk-QCQUZGXI.js";
64
+ import "./chunk-I37B3MZ2.js";
65
+ import "./chunk-N4KXMWQU.js";
66
+ import "./chunk-TZORKRNK.js";
66
67
  import {
67
68
  Check_default,
68
69
  DeveloperError_default
69
- } from "./chunk-S4MAZ3SS.js";
70
+ } from "./chunk-SS4ESNE3.js";
70
71
  import {
71
72
  defined_default
72
- } from "./chunk-UGK3FCDY.js";
73
+ } from "./chunk-YDVSBWEO.js";
73
74
 
74
75
  // packages/engine/Source/Core/Intersections2D.js
75
76
  var Intersections2D = {};
@@ -0,0 +1,127 @@
1
+ /**
2
+ * Contains functions for checking that supplied arguments are of a specified type
3
+ * or meet specified conditions
4
+ */
5
+ export const Check: {
6
+ /**
7
+ * Throws if test is not defined
8
+ *
9
+ * @param {string} name The name of the variable being tested
10
+ * @param {*} test The value that is to be checked
11
+ * @exception {DeveloperError} test must be defined
12
+ */
13
+ defined<T>(name: string, test: T): asserts test is NonNullable<T>;
14
+ /**
15
+ * Contains type checking functions, all using the typeof operator
16
+ */
17
+ typeOf: {
18
+ /**
19
+ * Throws if test is not typeof 'string'
20
+ *
21
+ * @param {string} name The name of the variable being tested
22
+ * @param {*} test The value to test
23
+ * @exception {DeveloperError} test must be typeof 'string'
24
+ */
25
+ string(name: string, test: any): asserts test is string;
26
+ /**
27
+ * Throws if test is not typeof 'function'
28
+ *
29
+ * @param {string} name The name of the variable being tested
30
+ * @param {*} test The value to test
31
+ * @exception {DeveloperError} test must be typeof 'function'
32
+ */
33
+ func(name: string, test: any): asserts test is Function;
34
+ /**
35
+ * Throws if test is not typeof 'object'
36
+ *
37
+ * @param {string} name The name of the variable being tested
38
+ * @param {*} test The value to test
39
+ * @exception {DeveloperError} test must be typeof 'object'
40
+ */
41
+ object(name: string, test: any): asserts test is object;
42
+ /**
43
+ * Throws if test is not typeof 'boolean'
44
+ *
45
+ * @param {string} name The name of the variable being tested
46
+ * @param {*} test The value to test
47
+ * @exception {DeveloperError} test must be typeof 'boolean'
48
+ */
49
+ bool(name: string, test: any): asserts test is boolean;
50
+ /**
51
+ * Throws if test is not typeof 'bigint'
52
+ *
53
+ * @param {string} name The name of the variable being tested
54
+ * @param {*} test The value to test
55
+ * @exception {DeveloperError} test must be typeof 'bigint'
56
+ */
57
+ bigint(name: string, test: any): asserts test is bigint;
58
+ /**
59
+ * Throws if test is not typeof 'number'
60
+ *
61
+ * @param {string} name The name of the variable being tested
62
+ * @param {*} test The value to test
63
+ * @exception {DeveloperError} test must be typeof 'number'
64
+ */
65
+ number: {
66
+ (name: string, test: any): void;
67
+ /**
68
+ * Throws if test is not typeof 'number' and less than limit
69
+ *
70
+ * @param {string} name The name of the variable being tested
71
+ * @param {*} test The value to test
72
+ * @param {number} limit The limit value to compare against
73
+ * @exception {DeveloperError} test must be typeof 'number' and less than limit
74
+ */
75
+ lessThan(name: string, test: any, limit: number): asserts test is number;
76
+ /**
77
+ * Throws if test is not typeof 'number' and less than or equal to limit
78
+ *
79
+ * @param {string} name The name of the variable being tested
80
+ * @param {*} test The value to test
81
+ * @param {number} limit The limit value to compare against
82
+ * @exception {DeveloperError} test must be typeof 'number' and less than or equal to limit
83
+ */
84
+ lessThanOrEquals(
85
+ name: string,
86
+ test: any,
87
+ limit: number
88
+ ): asserts test is number;
89
+ /**
90
+ * Throws if test is not typeof 'number' and greater than limit
91
+ *
92
+ * @param {string} name The name of the variable being tested
93
+ * @param {*} test The value to test
94
+ * @param {number} limit The limit value to compare against
95
+ * @exception {DeveloperError} test must be typeof 'number' and greater than limit
96
+ */
97
+ greaterThan(
98
+ name: string,
99
+ test: any,
100
+ limit: number
101
+ ): asserts test is number;
102
+ /**
103
+ * Throws if test is not typeof 'number' and greater than or equal to limit
104
+ *
105
+ * @param {string} name The name of the variable being tested
106
+ * @param {*} test The value to test
107
+ * @param {number} limit The limit value to compare against
108
+ * @exception {DeveloperError} test must be typeof 'number' and greater than or equal to limit
109
+ */
110
+ greaterThanOrEquals(
111
+ name: string,
112
+ test: any,
113
+ limit: number
114
+ ): asserts test is number;
115
+ /**
116
+ * Throws if test1 and test2 is not typeof 'number' and not equal in value
117
+ *
118
+ * @param {string} name1 The name of the first variable being tested
119
+ * @param {string} name2 The name of the second variable being tested against
120
+ * @param {*} test1 The value to test
121
+ * @param {*} test2 The value to test against
122
+ * @exception {DeveloperError} test1 and test2 should be type of 'number' and be equal in value
123
+ */
124
+ equals(name1: string, name2: string, test1: any, test2: any): void;
125
+ };
126
+ };
127
+ };
@@ -4,7 +4,6 @@ import DeveloperError from "./DeveloperError.js";
4
4
  /**
5
5
  * Contains functions for checking that supplied arguments are of a specified type
6
6
  * or meet specified conditions
7
- * @private
8
7
  */
9
8
  const Check = {};
10
9
 
@@ -363,6 +363,12 @@ Ellipsoid.prototype.geodeticSurfaceNormalCartographic = function (
363
363
  * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if none was provided, or undefined if a normal cannot be found.
364
364
  */
365
365
  Ellipsoid.prototype.geodeticSurfaceNormal = function (cartesian, result) {
366
+ //>>includeStart('debug', pragmas.debug);
367
+ Check.typeOf.object("cartesian", cartesian);
368
+ if (isNaN(cartesian.x) || isNaN(cartesian.y) || isNaN(cartesian.z)) {
369
+ throw new DeveloperError("cartesian has a NaN component");
370
+ }
371
+ //>>includeEnd('debug');
366
372
  if (
367
373
  Cartesian3.equalsEpsilon(cartesian, Cartesian3.ZERO, CesiumMath.EPSILON14)
368
374
  ) {
@@ -95,7 +95,7 @@ function Geometry(options) {
95
95
  * <ul>
96
96
  * <li><code>position3DHigh</code> - High 32 bits for encoded 64-bit position computed with {@link GeometryPipeline.encodeAttribute}. 32-bit floating-point. 4 components per attribute.</li>
97
97
  * <li><code>position3DLow</code> - Low 32 bits for encoded 64-bit position computed with {@link GeometryPipeline.encodeAttribute}. 32-bit floating-point. 4 components per attribute.</li>
98
- * <li><code>position3DHigh</code> - High 32 bits for encoded 64-bit 2D (Columbus view) position computed with {@link GeometryPipeline.encodeAttribute}. 32-bit floating-point. 4 components per attribute.</li>
98
+ * <li><code>position2DHigh</code> - High 32 bits for encoded 64-bit 2D (Columbus view) position computed with {@link GeometryPipeline.encodeAttribute}. 32-bit floating-point. 4 components per attribute.</li>
99
99
  * <li><code>position2DLow</code> - Low 32 bits for encoded 64-bit 2D (Columbus view) position computed with {@link GeometryPipeline.encodeAttribute}. 32-bit floating-point. 4 components per attribute.</li>
100
100
  * <li><code>color</code> - RGBA color (normalized) usually from {@link GeometryInstance#color}. 32-bit floating-point. 4 components per attribute.</li>
101
101
  * <li><code>pickColor</code> - RGBA color used for picking. 32-bit floating-point. 4 components per attribute.</li>
@@ -508,7 +508,10 @@ function addWithCancellationCheck(left, right, tolerance) {
508
508
  return difference;
509
509
  }
510
510
 
511
- function quadraticVectorExpression(A, b, c, x, w) {
511
+ /**
512
+ * @private
513
+ */
514
+ IntersectionTests.quadraticVectorExpression = function (A, b, c, x, w) {
512
515
  const xSquared = x * x;
513
516
  const wSquared = w * w;
514
517
 
@@ -634,7 +637,7 @@ function quadraticVectorExpression(A, b, c, x, w) {
634
637
  }
635
638
 
636
639
  return solutions;
637
- }
640
+ };
638
641
 
639
642
  const firstAxisScratch = new Cartesian3();
640
643
  const secondAxisScratch = new Cartesian3();
@@ -740,7 +743,7 @@ IntersectionTests.grazingAltitudeLocation = function (ray, ellipsoid) {
740
743
  const b = Matrix3.multiplyByVector(temp, position, bCart);
741
744
 
742
745
  // Solve for the solutions to the expression in standard form:
743
- const solutions = quadraticVectorExpression(
746
+ const solutions = IntersectionTests.quadraticVectorExpression(
744
747
  A,
745
748
  Cartesian3.negate(b, firstAxisScratch),
746
749
  0.0,
@@ -4,7 +4,7 @@ import Resource from "./Resource.js";
4
4
 
5
5
  let defaultTokenCredit;
6
6
  const defaultAccessToken =
7
- "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJiOGQ5NjRhYy1lYzBmLTRjYjktODA5MC01M2FhYmE4YjliZTIiLCJpZCI6MjU5LCJpYXQiOjE3MDY4MDU1MTR9.3b1XUfaoUwtY0Mi87tOQUGTnU4oMyyzSwAYqkDENcHo";
7
+ "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJjM2I5YWEyNS02NzRiLTRmOTEtYWZhNi1jNzlhZTI5Yjc3YWYiLCJpZCI6MjU5LCJpYXQiOjE3MTE1NTQ2Njd9.dawdakmPEfdAKpH2-Cv-IDOlVHwicZ1Mgk7ZzI775hQ";
8
8
  /**
9
9
  * Default settings for accessing the Cesium ion API.
10
10
  *
@@ -402,6 +402,11 @@ PixelFormat.alignmentInBytes = function (pixelFormat, pixelDatatype, width) {
402
402
 
403
403
  /**
404
404
  * @private
405
+ * @param {PixelFormat} pixelFormat The pixel format.
406
+ * @param {PixelDatatype} pixelDatatype The pixel datatype.
407
+ * @param {Number} width The width of the texture.
408
+ * @param {Number} height The height of the texture.
409
+ * @returns {TypedArray} The typed array.
405
410
  */
406
411
  PixelFormat.createTypedArray = function (
407
412
  pixelFormat,
@@ -171,7 +171,7 @@ function computeAttributes(options) {
171
171
  scratchPosition
172
172
  );
173
173
  p = ellipsoid.scaleToGeodeticSurface(p, p);
174
- const st = projectTo2d(p, appendTextureCoordinatesCartesian2);
174
+ const st = projectTo2d([p], appendTextureCoordinatesCartesian2)[0];
175
175
  Cartesian2.subtract(st, origin, st);
176
176
 
177
177
  const stx = CesiumMath.clamp(st.x / boundingRectangle.width, 0, 1);
@@ -127,6 +127,9 @@ Transforms.localFrameToFixedFrameGenerator = function (firstAxis, secondAxis) {
127
127
  if (!defined(origin)) {
128
128
  throw new DeveloperError("origin is required.");
129
129
  }
130
+ if (isNaN(origin.x) || isNaN(origin.y) || isNaN(origin.z)) {
131
+ throw new DeveloperError("origin has a NaN component");
132
+ }
130
133
  //>>includeEnd('debug');
131
134
  if (!defined(result)) {
132
135
  result = new Matrix4();
@@ -1,4 +1,5 @@
1
1
  import Cartesian3 from "./Cartesian3.js";
2
+ import Cartographic from "./Cartographic.js";
2
3
  import DeveloperError from "./DeveloperError.js";
3
4
  import defined from "./defined.js";
4
5
 
@@ -26,7 +27,7 @@ VerticalExaggeration.getHeight = function (height, scale, relativeHeight) {
26
27
  return (height - relativeHeight) * scale + relativeHeight;
27
28
  };
28
29
 
29
- const scratchCartographic = new Cartesian3();
30
+ const scratchCartographic = new Cartographic();
30
31
 
31
32
  /**
32
33
  * Scales a position by exaggeration.
@@ -0,0 +1,32 @@
1
+ import Check from "./Check.js";
2
+
3
+ /**
4
+ * Converts the value from sRGB color space to linear color space.
5
+ *
6
+ * @function
7
+ *
8
+ * @param {number} value The color value in sRGB color space.
9
+ * @returns {number} Returns the color value in linear color space.
10
+ *
11
+ * @example
12
+ * const srgbColor = [0.5, 0.5, 0.5];
13
+ * const linearColor = srgbColor.map(function (c) {
14
+ * return Cesium.srgbToLinear(c);
15
+ * });
16
+ */
17
+ function srgbToLinear(value) {
18
+ //>>includeStart('debug', pragmas.debug);
19
+ Check.defined("value", value);
20
+ //>>includeEnd('debug');
21
+
22
+ if (value <= 0.04045) {
23
+ // eslint-disable-next-line no-loss-of-precision
24
+ return value * 0.07739938080495356037151702786378;
25
+ }
26
+ return Math.pow(
27
+ // eslint-disable-next-line no-loss-of-precision
28
+ (value + 0.055) * 0.94786729857819905213270142180095,
29
+ 2.4
30
+ );
31
+ }
32
+ export default srgbToLinear;
@@ -90,6 +90,7 @@ import VelocityOrientationProperty from "./VelocityOrientationProperty.js";
90
90
  import VelocityVectorProperty from "./VelocityVectorProperty.js";
91
91
  import WallGraphics from "./WallGraphics.js";
92
92
  import Cesium3DTilesetGraphics from "./Cesium3DTilesetGraphics.js";
93
+ import SensorVolumePortionToDisplay from "../Scene/SensorVolumePortionToDisplay.js";
93
94
 
94
95
  // A marker type to distinguish CZML properties where we need to end up with a unit vector.
95
96
  // The data is still loaded into Cartesian3 objects but they are normalized.
@@ -576,6 +577,10 @@ function unwrapInterval(type, czmlInterval, sourceUri) {
576
577
  return unwrapQuaternionInterval(czmlInterval);
577
578
  case Rotation:
578
579
  return defaultValue(czmlInterval.number, czmlInterval);
580
+ case SensorVolumePortionToDisplay:
581
+ return SensorVolumePortionToDisplay[
582
+ defaultValue(czmlInterval.portionToDisplay, czmlInterval)
583
+ ];
579
584
  case ShadowMode:
580
585
  return ShadowMode[
581
586
  defaultValue(
@@ -598,7 +603,7 @@ function unwrapInterval(type, czmlInterval, sourceUri) {
598
603
  defaultValue(czmlInterval.verticalOrigin, czmlInterval)
599
604
  ];
600
605
  default:
601
- throw new RuntimeError(type);
606
+ throw new RuntimeError(`Unknown CzmlDataSource interval type: ${type}`);
602
607
  }
603
608
  }
604
609
 
@@ -5006,31 +5011,54 @@ Object.defineProperties(CzmlDataSource.prototype, {
5006
5011
  * @type {CzmlDataSource.UpdaterFunction[]}
5007
5012
  */
5008
5013
  CzmlDataSource.updaters = [
5009
- processBillboard, //
5010
- processBox, //
5011
- processCorridor, //
5012
- processCylinder, //
5013
- processEllipse, //
5014
- processEllipsoid, //
5015
- processLabel, //
5016
- processModel, //
5017
- processName, //
5018
- processDescription, //
5019
- processPath, //
5020
- processPoint, //
5021
- processPolygon, //
5022
- processPolyline, //
5023
- processPolylineVolume, //
5024
- processProperties, //
5025
- processRectangle, //
5026
- processPosition, //
5027
- processTileset, //
5028
- processViewFrom, //
5029
- processWall, //
5030
- processOrientation, //
5014
+ processBillboard,
5015
+ processBox,
5016
+ processCorridor,
5017
+ processCylinder,
5018
+ processEllipse,
5019
+ processEllipsoid,
5020
+ processLabel,
5021
+ processModel,
5022
+ processName,
5023
+ processDescription,
5024
+ processPath,
5025
+ processPoint,
5026
+ processPolygon,
5027
+ processPolyline,
5028
+ processPolylineVolume,
5029
+ processProperties,
5030
+ processRectangle,
5031
+ processPosition,
5032
+ processTileset,
5033
+ processViewFrom,
5034
+ processWall,
5035
+ processOrientation,
5031
5036
  processAvailability,
5032
5037
  ];
5033
5038
 
5039
+ /**
5040
+ * Add the provided updater to the list of updaters if not already included
5041
+ * @private
5042
+ * @param {CzmlDataSource.UpdaterFunction} updater
5043
+ */
5044
+ CzmlDataSource.registerUpdater = function (updater) {
5045
+ if (!CzmlDataSource.updaters.includes(updater)) {
5046
+ CzmlDataSource.updaters.push(updater);
5047
+ }
5048
+ };
5049
+
5050
+ /**
5051
+ * Remove the provided updater from the list of updaters if already included
5052
+ * @private
5053
+ * @param {CzmlDataSource.UpdaterFunction} updater
5054
+ */
5055
+ CzmlDataSource.unregisterUpdater = function (updater) {
5056
+ if (CzmlDataSource.updaters.includes(updater)) {
5057
+ const index = CzmlDataSource.updaters.indexOf(updater);
5058
+ CzmlDataSource.updaters.splice(index, 1);
5059
+ }
5060
+ };
5061
+
5034
5062
  /**
5035
5063
  * Processes the provided url or CZML object without clearing any existing data.
5036
5064
  *
@@ -120,6 +120,30 @@ function DataSourceDisplay(options) {
120
120
  this._ready = false;
121
121
  }
122
122
 
123
+ const ExtraVisualizers = [];
124
+ /**
125
+ * Add the provided Visualizer to the default visualizers callback if not already included
126
+ * @private
127
+ * @param {Visualizer} visualizer Visualizer class to add
128
+ */
129
+ DataSourceDisplay.registerVisualizer = function (visualizer) {
130
+ if (!ExtraVisualizers.includes(visualizer)) {
131
+ ExtraVisualizers.push(visualizer);
132
+ }
133
+ };
134
+
135
+ /**
136
+ * Remove the provided Visualizer from the default visualizers callback if it's already included
137
+ * @private
138
+ * @param {Visualizer} visualizer Visualizer class to remove
139
+ */
140
+ DataSourceDisplay.unregisterVisualizer = function (visualizer) {
141
+ if (ExtraVisualizers.includes(visualizer)) {
142
+ const index = ExtraVisualizers.indexOf(visualizer);
143
+ ExtraVisualizers.splice(index, 1);
144
+ }
145
+ };
146
+
123
147
  /**
124
148
  * Gets or sets the default function which creates an array of visualizers used for visualization.
125
149
  * By default, this function uses all standard visualizers.
@@ -151,6 +175,9 @@ DataSourceDisplay.defaultVisualizersCallback = function (
151
175
  dataSource._primitives,
152
176
  dataSource._groundPrimitives
153
177
  ),
178
+ ...ExtraVisualizers.map(
179
+ (VisualizerClass) => new VisualizerClass(scene, entities)
180
+ ),
154
181
  ];
155
182
  };
156
183
 
@@ -41,6 +41,8 @@ import WallGraphics from "./WallGraphics.js";
41
41
 
42
42
  const cartoScratch = new Cartographic();
43
43
 
44
+ const ExtraPropertyNames = [];
45
+
44
46
  function createConstantPositionProperty(value) {
45
47
  return new ConstantPositionProperty(value);
46
48
  }
@@ -127,7 +129,7 @@ function Entity(options) {
127
129
  "corridor",
128
130
  "cylinder",
129
131
  "description",
130
- "ellipse", //
132
+ "ellipse",
131
133
  "ellipsoid",
132
134
  "label",
133
135
  "model",
@@ -136,7 +138,7 @@ function Entity(options) {
136
138
  "path",
137
139
  "plane",
138
140
  "point",
139
- "polygon", //
141
+ "polygon",
140
142
  "polyline",
141
143
  "polylineVolume",
142
144
  "position",
@@ -144,6 +146,7 @@ function Entity(options) {
144
146
  "rectangle",
145
147
  "viewFrom",
146
148
  "wall",
149
+ ...ExtraPropertyNames,
147
150
  ];
148
151
 
149
152
  this._billboard = undefined;
@@ -494,6 +497,21 @@ Object.defineProperties(Entity.prototype, {
494
497
  wall: createPropertyTypeDescriptor("wall", WallGraphics),
495
498
  });
496
499
 
500
+ /**
501
+ * Add the specified type and construct the properties for it in the Entity class
502
+ * @private
503
+ * @param {string} propertyName name of the property that controls/accesses this entity type
504
+ * @param {{ constructor: function }} Type The Graphics class to associate with this entity type
505
+ */
506
+ Entity.registerEntityType = function (propertyName, Type) {
507
+ Object.defineProperties(Entity.prototype, {
508
+ [propertyName]: createPropertyTypeDescriptor(propertyName, Type),
509
+ });
510
+ if (!ExtraPropertyNames.includes(propertyName)) {
511
+ ExtraPropertyNames.push(propertyName);
512
+ }
513
+ };
514
+
497
515
  /**
498
516
  * Given a time, returns true if this object should have data during that time.
499
517
  *