@cesium/engine 22.3.0 → 23.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 (193) hide show
  1. package/Build/Workers/{chunk-EAAH543Q.js → chunk-2GL2EUEE.js} +11 -11
  2. package/Build/Workers/{chunk-EUDHHS7K.js → chunk-2WI4HGJU.js} +6 -6
  3. package/Build/Workers/{chunk-LWZHJWYK.js → chunk-36LBFITA.js} +665 -366
  4. package/Build/Workers/{chunk-7U5YNLF3.js → chunk-3B65YFXC.js} +1 -1
  5. package/Build/Workers/{chunk-D63Z7KKL.js → chunk-4LGFX2P5.js} +11 -11
  6. package/Build/Workers/{chunk-D6OKR3BQ.js → chunk-4UNQX2MP.js} +2 -2
  7. package/Build/Workers/{chunk-BO22JHBX.js → chunk-52K3GJKG.js} +3 -3
  8. package/Build/Workers/{chunk-XLIJV3YZ.js → chunk-56OHFSLH.js} +10 -10
  9. package/Build/Workers/{chunk-AWELU5C6.js → chunk-5A7YSAXT.js} +14 -14
  10. package/Build/Workers/{chunk-T5MJDW43.js → chunk-5JP5FG7U.js} +7 -7
  11. package/Build/Workers/{chunk-NVL7JXAQ.js → chunk-5R7SBUTW.js} +10 -10
  12. package/Build/Workers/chunk-5VKZVPO5.js +1829 -0
  13. package/Build/Workers/{chunk-YHPBT4I5.js → chunk-6FVFM2KB.js} +5 -5
  14. package/Build/Workers/{chunk-WHLGBMBC.js → chunk-6SLGTBB2.js} +5 -5
  15. package/Build/Workers/{chunk-VIQIKMTZ.js → chunk-7KRN6JPQ.js} +14 -14
  16. package/Build/Workers/{chunk-TCOUGKXF.js → chunk-AA33B6PU.js} +4 -4
  17. package/Build/Workers/{chunk-S2KVL7OJ.js → chunk-AP6XWET5.js} +8 -8
  18. package/Build/Workers/{chunk-5PJB7ASO.js → chunk-APDKMX7W.js} +6 -6
  19. package/Build/Workers/{chunk-IXL46IYV.js → chunk-ARCFIOKA.js} +12 -12
  20. package/Build/Workers/{chunk-KIJR26N3.js → chunk-BNBD2YZK.js} +16 -16
  21. package/Build/Workers/{chunk-4R6FGUFP.js → chunk-DT5SJBKA.js} +29 -15
  22. package/Build/Workers/{chunk-FUDC3KOT.js → chunk-ESD4IEOU.js} +5 -5
  23. package/Build/Workers/{chunk-K2PLKJJG.js → chunk-FSDVXW7M.js} +5 -5
  24. package/Build/Workers/{chunk-4BBANFU6.js → chunk-G3YT7M7A.js} +1 -1
  25. package/Build/Workers/{chunk-K4PGSAR5.js → chunk-GN5NEUDT.js} +8 -8
  26. package/Build/Workers/{chunk-OOYICVOK.js → chunk-HYLEKKO5.js} +1 -1
  27. package/Build/Workers/{chunk-FDOLXORR.js → chunk-HYTFXWMY.js} +7 -7
  28. package/Build/Workers/{chunk-7SLNBIZS.js → chunk-IFA7VHHP.js} +560 -277
  29. package/Build/Workers/{chunk-N66PIK46.js → chunk-IYVDOB5V.js} +4 -4
  30. package/Build/Workers/{chunk-ZWWN2CQH.js → chunk-JUGY5AZN.js} +4 -4
  31. package/Build/Workers/{chunk-4O2ARYS7.js → chunk-KPYU6YZG.js} +1 -1
  32. package/Build/Workers/{chunk-TY5JXMVO.js → chunk-L7RDJ4V7.js} +1 -1
  33. package/Build/Workers/{chunk-L4OFWHNI.js → chunk-LDQWNMEC.js} +1 -1
  34. package/Build/Workers/{chunk-N6XBJBI7.js → chunk-MQJG522T.js} +6 -6
  35. package/Build/Workers/{chunk-FS42VX2H.js → chunk-MT5M7RLZ.js} +2 -2
  36. package/Build/Workers/{chunk-7ATKQRBM.js → chunk-N4AWE7TZ.js} +10 -10
  37. package/Build/Workers/{chunk-EOSX23OS.js → chunk-NAYRNPEP.js} +4 -4
  38. package/Build/Workers/{chunk-NO3LMU7T.js → chunk-NNHU33JK.js} +7 -7
  39. package/Build/Workers/{chunk-HWGP4GVC.js → chunk-NQCAZU7S.js} +13 -13
  40. package/Build/Workers/{chunk-6GBGEUWR.js → chunk-NUYLNQKV.js} +2 -2
  41. package/Build/Workers/{chunk-E4YDCSQK.js → chunk-OC6X22PG.js} +9 -9
  42. package/Build/Workers/{chunk-ZGGVEGTA.js → chunk-OHBM4YG4.js} +12 -12
  43. package/Build/Workers/{chunk-6WDMPXQ7.js → chunk-OMXN7YF4.js} +12 -12
  44. package/Build/Workers/{chunk-LK7GEFGB.js → chunk-OQ3EAJNW.js} +2 -2
  45. package/Build/Workers/{chunk-M5DVYXJJ.js → chunk-OQBPOKPZ.js} +6 -6
  46. package/Build/Workers/{chunk-WUWPKBOZ.js → chunk-PQVNT5CJ.js} +6 -6
  47. package/Build/Workers/{chunk-W5NV72VR.js → chunk-QA24Q62E.js} +17 -17
  48. package/Build/Workers/{chunk-PJLRXIMS.js → chunk-QQX7S5QT.js} +17 -17
  49. package/Build/Workers/{chunk-D2PEV362.js → chunk-QTOHIXGF.js} +10 -10
  50. package/Build/Workers/{chunk-MASEF4OV.js → chunk-R7M4XNPP.js} +8 -8
  51. package/Build/Workers/{chunk-2MLJ46ZZ.js → chunk-SGKTBHFQ.js} +13 -13
  52. package/Build/Workers/{chunk-EY5HOJFQ.js → chunk-SQTRWKO2.js} +5 -5
  53. package/Build/Workers/{chunk-AFGP5BXS.js → chunk-T43FXHNC.js} +7 -7
  54. package/Build/Workers/{chunk-IHFAFGR2.js → chunk-UEEGWJJP.js} +2 -2
  55. package/Build/Workers/{chunk-TMGLPEZW.js → chunk-WKXDCVBO.js} +4 -4
  56. package/Build/Workers/{chunk-VRAAQ3FS.js → chunk-Y5AJSEEN.js} +2 -2
  57. package/Build/Workers/{chunk-Y5MRBKQN.js → chunk-ZIW5FCIW.js} +18 -18
  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 +5 -5
  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/AttributeCompression.js +53 -6
  112. package/Source/Core/Cartesian2.js +689 -684
  113. package/Source/Core/Cartesian3.js +1044 -1043
  114. package/Source/Core/Cartesian4.js +816 -813
  115. package/Source/Core/GoogleMaps.js +23 -2
  116. package/Source/Core/Ion.js +1 -1
  117. package/Source/Core/OpenCageGeocoderService.js +2 -3
  118. package/Source/Core/globalTypes.js +16 -0
  119. package/Source/Renderer/ShaderDestination.js +54 -13
  120. package/Source/Scene/ArcGisMapService.js +1 -1
  121. package/Source/Scene/Billboard.js +7 -4
  122. package/Source/Scene/BillboardCollection.js +64 -25
  123. package/Source/Scene/BufferLoader.js +65 -74
  124. package/Source/Scene/CubeMapPanorama.js +351 -0
  125. package/Source/Scene/DerivedCommand.js +8 -31
  126. package/Source/Scene/DracoLoader.js +79 -78
  127. package/Source/Scene/EquirectangularPanorama.js +264 -0
  128. package/Source/Scene/FrameState.js +7 -0
  129. package/Source/Scene/GaussianSplatPrimitive.js +906 -167
  130. package/Source/Scene/GlobeSurfaceShaderSet.js +36 -32
  131. package/Source/Scene/GltfBufferViewLoader.js +109 -118
  132. package/Source/Scene/GltfDracoLoader.js +167 -176
  133. package/Source/Scene/GltfImageLoader.js +91 -101
  134. package/Source/Scene/GltfIndexBufferLoader.js +228 -241
  135. package/Source/Scene/GltfJsonLoader.js +90 -99
  136. package/Source/Scene/GltfLoader.js +313 -324
  137. package/Source/Scene/GltfSpzLoader.js +127 -134
  138. package/Source/Scene/GltfStructuralMetadataLoader.js +181 -186
  139. package/Source/Scene/GltfTextureLoader.js +217 -231
  140. package/Source/Scene/GltfVertexBufferLoader.js +267 -276
  141. package/Source/Scene/GoogleStreetViewCubeMapPanoramaProvider.js +341 -0
  142. package/Source/Scene/Label.js +6 -4
  143. package/Source/Scene/LabelCollection.js +59 -1
  144. package/Source/Scene/MetadataClassProperty.js +212 -7
  145. package/Source/Scene/MetadataComponentType.js +162 -127
  146. package/Source/Scene/MetadataSchemaLoader.js +60 -67
  147. package/Source/Scene/MetadataTable.js +14 -0
  148. package/Source/Scene/MetadataTableProperty.js +14 -0
  149. package/Source/Scene/Model/B3dmLoader.js +216 -224
  150. package/Source/Scene/Model/CustomShader.js +6 -1
  151. package/Source/Scene/Model/CustomShaderPipelineStage.js +122 -7
  152. package/Source/Scene/Model/GeoJsonLoader.js +53 -61
  153. package/Source/Scene/Model/GeometryPipelineStage.js +17 -3
  154. package/Source/Scene/Model/I3dmLoader.js +232 -240
  155. package/Source/Scene/Model/MaterialPipelineStage.js +1 -1
  156. package/Source/Scene/Model/MetadataPipelineStage.js +438 -22
  157. package/Source/Scene/Model/PntsLoader.js +78 -89
  158. package/Source/Scene/Panorama.js +53 -0
  159. package/Source/Scene/PanoramaProvider.js +43 -0
  160. package/Source/Scene/PointPrimitiveCollection.js +14 -22
  161. package/Source/Scene/PropertyTable.js +43 -0
  162. package/Source/Scene/PropertyTexture.js +1 -1
  163. package/Source/Scene/PropertyTextureProperty.js +0 -97
  164. package/Source/Scene/ResourceLoader.js +84 -92
  165. package/Source/Scene/Scene.js +12 -0
  166. package/Source/Scene/SkyBox.js +29 -164
  167. package/Source/Scene/StructuralMetadata.js +18 -3
  168. package/Source/Scene/parseStructuralMetadata.js +244 -0
  169. package/Source/Shaders/BillboardCollectionFS.glsl +66 -40
  170. package/Source/Shaders/BillboardCollectionFS.js +67 -40
  171. package/Source/Shaders/BillboardCollectionVS.glsl +22 -31
  172. package/Source/Shaders/BillboardCollectionVS.js +22 -31
  173. package/Source/Shaders/Builtin/CzmBuiltins.js +4 -0
  174. package/Source/Shaders/Builtin/Functions/decodeRGB8.glsl +22 -0
  175. package/Source/Shaders/Builtin/Functions/decodeRGB8.js +24 -0
  176. package/Source/Shaders/Builtin/Functions/unpackTexture.glsl +35 -0
  177. package/Source/Shaders/Builtin/Functions/unpackTexture.js +37 -0
  178. package/Source/Shaders/CubeMapPanoramaVS.glsl +11 -0
  179. package/Source/Shaders/CubeMapPanoramaVS.js +13 -0
  180. package/Source/Shaders/Model/MetadataStageFS.glsl +2 -1
  181. package/Source/Shaders/Model/MetadataStageFS.js +2 -1
  182. package/Source/Shaders/Model/MetadataStageVS.glsl +2 -1
  183. package/Source/Shaders/Model/MetadataStageVS.js +2 -1
  184. package/Source/Shaders/Model/ModelFS.glsl +2 -2
  185. package/Source/Shaders/Model/ModelFS.js +2 -2
  186. package/Source/Shaders/Model/ModelVS.glsl +2 -2
  187. package/Source/Shaders/Model/ModelVS.js +2 -2
  188. package/Source/Shaders/PointPrimitiveCollectionVS.glsl +8 -39
  189. package/Source/Shaders/PointPrimitiveCollectionVS.js +8 -39
  190. package/index.d.ts +564 -189
  191. package/index.js +127 -119
  192. package/package.json +1 -1
  193. package/Build/Workers/chunk-LYBNPUEI.js +0 -1443
@@ -37,50 +37,45 @@ const MetallicRoughness = ModelComponents.MetallicRoughness;
37
37
  /**
38
38
  * Loads a .pnts point cloud and transcodes it into a {@link ModelComponents}
39
39
  *
40
- * @alias PntsLoader
41
- * @constructor
42
- * @augments ResourceLoader
43
40
  * @private
44
- *
45
- * @param {object} options An object containing the following properties
46
- * @param {ArrayBuffer} options.arrayBuffer The array buffer of the pnts contents
47
- * @param {number} [options.byteOffset] The byte offset to the beginning of the pnts contents in the array buffer
48
- * @param {boolean} [options.loadAttributesFor2D=false] If true, load the positions buffer as a typed array for accurately projecting models to 2D.
49
41
  */
50
- function PntsLoader(options) {
51
- options = options ?? Frozen.EMPTY_OBJECT;
42
+ class PntsLoader extends ResourceLoader {
43
+ /**
44
+ * @param {object} options An object containing the following properties
45
+ * @param {ArrayBuffer} options.arrayBuffer The array buffer of the pnts contents
46
+ * @param {number} [options.byteOffset] The byte offset to the beginning of the pnts contents in the array buffer
47
+ * @param {boolean} [options.loadAttributesFor2D=false] If true, load the positions buffer as a typed array for accurately projecting models to 2D.
48
+ */
49
+ constructor(options) {
50
+ super();
52
51
 
53
- const arrayBuffer = options.arrayBuffer;
54
- const byteOffset = options.byteOffset ?? 0;
52
+ options = options ?? Frozen.EMPTY_OBJECT;
55
53
 
56
- //>>includeStart('debug', pragmas.debug);
57
- Check.typeOf.object("options.arrayBuffer", arrayBuffer);
58
- //>>includeEnd('debug');
54
+ const arrayBuffer = options.arrayBuffer;
55
+ const byteOffset = options.byteOffset ?? 0;
59
56
 
60
- this._arrayBuffer = arrayBuffer;
61
- this._byteOffset = byteOffset;
62
- this._loadAttributesFor2D = options.loadAttributesFor2D ?? false;
57
+ //>>includeStart('debug', pragmas.debug);
58
+ Check.typeOf.object("options.arrayBuffer", arrayBuffer);
59
+ //>>includeEnd('debug');
63
60
 
64
- this._parsedContent = undefined;
65
- this._decodePromise = undefined;
66
- this._decodedAttributes = undefined;
61
+ this._arrayBuffer = arrayBuffer;
62
+ this._byteOffset = byteOffset;
63
+ this._loadAttributesFor2D = options.loadAttributesFor2D ?? false;
67
64
 
68
- this._promise = undefined;
69
- this._error = undefined;
70
- this._state = ResourceLoaderState.UNLOADED;
71
- this._buffers = [];
65
+ this._parsedContent = undefined;
66
+ this._decodePromise = undefined;
67
+ this._decodedAttributes = undefined;
72
68
 
73
- // The batch table object contains a json and a binary component access using keys of the same name.
74
- this._components = undefined;
75
- this._transform = Matrix4.IDENTITY;
76
- }
69
+ this._promise = undefined;
70
+ this._error = undefined;
71
+ this._state = ResourceLoaderState.UNLOADED;
72
+ this._buffers = [];
77
73
 
78
- if (defined(Object.create)) {
79
- PntsLoader.prototype = Object.create(ResourceLoader.prototype);
80
- PntsLoader.prototype.constructor = PntsLoader;
81
- }
74
+ // The batch table object contains a json and a binary component access using keys of the same name.
75
+ this._components = undefined;
76
+ this._transform = Matrix4.IDENTITY;
77
+ }
82
78
 
83
- Object.defineProperties(PntsLoader.prototype, {
84
79
  /**
85
80
  * The cache key of the resource
86
81
  *
@@ -90,11 +85,9 @@ Object.defineProperties(PntsLoader.prototype, {
90
85
  * @readonly
91
86
  * @private
92
87
  */
93
- cacheKey: {
94
- get: function () {
95
- return undefined;
96
- },
97
- },
88
+ get cacheKey() {
89
+ return undefined;
90
+ }
98
91
 
99
92
  /**
100
93
  * The loaded components.
@@ -105,11 +98,9 @@ Object.defineProperties(PntsLoader.prototype, {
105
98
  * @readonly
106
99
  * @private
107
100
  */
108
- components: {
109
- get: function () {
110
- return this._components;
111
- },
112
- },
101
+ get components() {
102
+ return this._components;
103
+ }
113
104
 
114
105
  /**
115
106
  * A world-space transform to apply to the primitives.
@@ -121,50 +112,60 @@ Object.defineProperties(PntsLoader.prototype, {
121
112
  * @readonly
122
113
  * @private
123
114
  */
124
- transform: {
125
- get: function () {
126
- return this._transform;
127
- },
128
- },
129
- });
130
-
131
- /**
132
- * Loads the resource.
133
- * @returns {Promise<PntsLoader>} A promise which resolves to the loader when the resource loading is completed.
134
- * @private
135
- */
136
- PntsLoader.prototype.load = function () {
137
- if (defined(this._promise)) {
138
- return this._promise;
115
+ get transform() {
116
+ return this._transform;
139
117
  }
140
118
 
141
- this._parsedContent = PntsParser.parse(this._arrayBuffer, this._byteOffset);
142
- this._state = ResourceLoaderState.PROCESSING;
119
+ /**
120
+ * Loads the resource.
121
+ * @returns {Promise<PntsLoader>} A promise which resolves to the loader when the resource loading is completed.
122
+ * @private
123
+ */
124
+ load() {
125
+ if (defined(this._promise)) {
126
+ return this._promise;
127
+ }
143
128
 
144
- this._promise = Promise.resolve(this);
145
- };
129
+ this._parsedContent = PntsParser.parse(this._arrayBuffer, this._byteOffset);
130
+ this._state = ResourceLoaderState.PROCESSING;
146
131
 
147
- PntsLoader.prototype.process = function (frameState) {
148
- if (defined(this._error)) {
149
- const error = this._error;
150
- this._error = undefined;
151
- throw error;
132
+ this._promise = Promise.resolve(this);
152
133
  }
153
134
 
154
- if (this._state === ResourceLoaderState.READY) {
155
- return true;
156
- }
135
+ process(frameState) {
136
+ if (defined(this._error)) {
137
+ const error = this._error;
138
+ this._error = undefined;
139
+ throw error;
140
+ }
141
+
142
+ if (this._state === ResourceLoaderState.READY) {
143
+ return true;
144
+ }
145
+
146
+ if (this._state === ResourceLoaderState.PROCESSING) {
147
+ if (defined(this._decodePromise)) {
148
+ return false;
149
+ }
157
150
 
158
- if (this._state === ResourceLoaderState.PROCESSING) {
159
- if (defined(this._decodePromise)) {
160
- return false;
151
+ this._decodePromise = decodeDraco(this, frameState.context);
161
152
  }
162
153
 
163
- this._decodePromise = decodeDraco(this, frameState.context);
154
+ return false;
164
155
  }
165
156
 
166
- return false;
167
- };
157
+ unload() {
158
+ const buffers = this._buffers;
159
+ for (let i = 0; i < buffers.length; i++) {
160
+ buffers[i].destroy();
161
+ }
162
+ buffers.length = 0;
163
+
164
+ this._components = undefined;
165
+ this._parsedContent = undefined;
166
+ this._arrayBuffer = undefined;
167
+ }
168
+ }
168
169
 
169
170
  function decodeDraco(loader, context) {
170
171
  const parsedContent = loader._parsedContent;
@@ -701,16 +702,4 @@ function addPropertyAttributesToPrimitive(
701
702
  primitive.propertyAttributeIds = [0];
702
703
  }
703
704
 
704
- PntsLoader.prototype.unload = function () {
705
- const buffers = this._buffers;
706
- for (let i = 0; i < buffers.length; i++) {
707
- buffers[i].destroy();
708
- }
709
- buffers.length = 0;
710
-
711
- this._components = undefined;
712
- this._parsedContent = undefined;
713
- this._arrayBuffer = undefined;
714
- };
715
-
716
705
  export default PntsLoader;
@@ -0,0 +1,53 @@
1
+ import DeveloperError from "../Core/DeveloperError.js";
2
+
3
+ /**
4
+ * Displays panorama imagery in a scene. This type describes an interface and is not intended to be instantiated directly.
5
+ *
6
+ * @alias Panorama
7
+ * @constructor
8
+ * @abstract
9
+ *
10
+ * @see EquirectangularPanorama
11
+ * @see CubeMapPanorama
12
+ * @see GoogleStreetViewCubeMapPanoramaProvider
13
+ *
14
+ *
15
+ * @demo {@link https://sandcastle.cesium.com/index.html?id=panorama|Cesium Sandcastle Panorama}
16
+ */
17
+ function Panorama() {
18
+ DeveloperError.throwInstantiationError();
19
+ }
20
+
21
+ Object.defineProperties(Panorama.prototype, {
22
+ /**
23
+ * Determines if the panorama will be shown.
24
+ * @memberof Panorama.prototype
25
+ * @type {boolean}
26
+ */
27
+ show: {
28
+ get: DeveloperError.throwInstantiationError,
29
+ set: DeveloperError.throwInstantiationError,
30
+ },
31
+
32
+ /**
33
+ * Gets the transform of the panorama.
34
+ * @memberof Panorama.prototype
35
+ * @type {Matrix4}
36
+ * @readonly
37
+ */
38
+ transform: {
39
+ get: DeveloperError.throwInstantiationError,
40
+ },
41
+
42
+ /**
43
+ * Gets the credits of the panorama.
44
+ * @memberof Panorama.prototype
45
+ * @type {Credit}
46
+ * @readonly
47
+ */
48
+ credit: {
49
+ get: DeveloperError.throwInstantiationError,
50
+ },
51
+ });
52
+
53
+ export default Panorama;
@@ -0,0 +1,43 @@
1
+ import DeveloperError from "../Core/DeveloperError.js";
2
+
3
+ /**
4
+ * Provides imagery to be displayed on the surface of an ellipsoid. This type describes an
5
+ * interface and is not intended to be instantiated directly.
6
+ *
7
+ * @alias PanoramaProvider
8
+ * @constructor
9
+ * @abstract
10
+ *
11
+ * @see GoogleStreetViewCubeMapPanoramaProvider
12
+ * @see EquirectangularPanorama
13
+ * @see CubeMapPanorama
14
+ *
15
+ * @demo {@link https://sandcastle.cesium.com/index.html?id=panorama|Cesium Sandcastle Panorama}
16
+ */
17
+ function PanoramaProvider() {
18
+ DeveloperError.throwInstantiationError();
19
+ }
20
+
21
+ Object.defineProperties(PanoramaProvider.prototype, {});
22
+
23
+ /**
24
+ * Returns a panorama provider.
25
+ *
26
+ * @param {object} options Input options to create the panorama provider.
27
+ * @returns {PanoramaProvider} The panorama provider for loading panoramas into a scene.
28
+ */
29
+ PanoramaProvider.fromUrl = function (options) {
30
+ DeveloperError.throwInstantiationError();
31
+ };
32
+
33
+ /**
34
+ * Returns a panorama primitive.
35
+ *
36
+ * @param {object} options Input options to create the panorama primitive.
37
+ * @returns {Panorama} The panorama primitive for displaying panoramas in a scene.
38
+ */
39
+ PanoramaProvider.prototype.loadPanorama = function (options) {
40
+ DeveloperError.throwInstantiationError();
41
+ };
42
+
43
+ export default PanoramaProvider;
@@ -24,6 +24,7 @@ import BlendingState from "./BlendingState.js";
24
24
  import BlendOption from "./BlendOption.js";
25
25
  import PointPrimitive from "./PointPrimitive.js";
26
26
  import SceneMode from "./SceneMode.js";
27
+ import AttributeCompression from "../Core/AttributeCompression.js";
27
28
 
28
29
  const SHOW_INDEX = PointPrimitive.SHOW_INDEX;
29
30
  const POSITION_INDEX = PointPrimitive.POSITION_INDEX;
@@ -501,6 +502,7 @@ function createVAF(context, numberOfPointPrimitives, buffersUsage) {
501
502
  // instead of storing it in a vertex buffer.
502
503
 
503
504
  const writePositionScratch = new EncodedCartesian3();
505
+ const writeColorScratch = new Color();
504
506
 
505
507
  function writePositionSizeAndOutline(
506
508
  pointPrimitiveCollection,
@@ -539,7 +541,6 @@ function writePositionSizeAndOutline(
539
541
  positionLowWriter(i, low.x, low.y, low.z, outlineWidth);
540
542
  }
541
543
 
542
- const LEFT_SHIFT16 = 65536.0; // 2^16
543
544
  const LEFT_SHIFT8 = 256.0; // 2^8
544
545
 
545
546
  function writeCompressedAttrib0(
@@ -551,31 +552,22 @@ function writeCompressedAttrib0(
551
552
  const i = pointPrimitive._index;
552
553
 
553
554
  const color = pointPrimitive.color;
554
- const pickColor = pointPrimitive.getPickId(context).color;
555
555
  const outlineColor = pointPrimitive.outlineColor;
556
+ const pickColor = pointPrimitive.getPickId(context).color;
556
557
 
557
- let red = Color.floatToByte(color.red);
558
- let green = Color.floatToByte(color.green);
559
- let blue = Color.floatToByte(color.blue);
560
- const compressed0 = red * LEFT_SHIFT16 + green * LEFT_SHIFT8 + blue;
561
-
562
- red = Color.floatToByte(outlineColor.red);
563
- green = Color.floatToByte(outlineColor.green);
564
- blue = Color.floatToByte(outlineColor.blue);
565
- const compressed1 = red * LEFT_SHIFT16 + green * LEFT_SHIFT8 + blue;
566
-
567
- red = Color.floatToByte(pickColor.red);
568
- green = Color.floatToByte(pickColor.green);
569
- blue = Color.floatToByte(pickColor.blue);
570
- const compressed2 = red * LEFT_SHIFT16 + green * LEFT_SHIFT8 + blue;
571
-
572
- const compressed3 =
573
- Color.floatToByte(color.alpha) * LEFT_SHIFT16 +
574
- Color.floatToByte(outlineColor.alpha) * LEFT_SHIFT8 +
575
- Color.floatToByte(pickColor.alpha);
558
+ // Pack all three alpha channels into an RGB-encoded component.
559
+ writeColorScratch.red = color.alpha;
560
+ writeColorScratch.green = outlineColor.alpha;
561
+ writeColorScratch.blue = pickColor.alpha;
576
562
 
577
563
  const writer = vafWriters[attributeLocations.compressedAttribute0];
578
- writer(i, compressed0, compressed1, compressed2, compressed3);
564
+ writer(
565
+ i,
566
+ AttributeCompression.encodeRGB8(color),
567
+ AttributeCompression.encodeRGB8(outlineColor),
568
+ AttributeCompression.encodeRGB8(pickColor),
569
+ AttributeCompression.encodeRGB8(writeColorScratch),
570
+ );
579
571
  }
580
572
 
581
573
  function writeCompressedAttrib1(
@@ -4,6 +4,7 @@ import DeveloperError from "../Core/DeveloperError.js";
4
4
  import defined from "../Core/defined.js";
5
5
  import JsonMetadataTable from "./JsonMetadataTable.js";
6
6
  import addAllToArray from "../Core/addAllToArray.js";
7
+ import { destroyObject } from "@cesium/engine";
7
8
 
8
9
  /**
9
10
  * A property table for use with the <code>EXT_structural_metadata</code> extension or
@@ -53,6 +54,7 @@ function PropertyTable(options) {
53
54
  this._metadataTable = options.metadataTable;
54
55
  this._jsonMetadataTable = options.jsonMetadataTable;
55
56
  this._batchTableHierarchy = options.batchTableHierarchy;
57
+ this._texture = options.texture; // Property table buffer data packed into a GPU texture
56
58
  }
57
59
 
58
60
  Object.defineProperties(PropertyTable.prototype, {
@@ -113,6 +115,23 @@ Object.defineProperties(PropertyTable.prototype, {
113
115
  },
114
116
  },
115
117
 
118
+ /**
119
+ * The properties stored in this table.
120
+ *
121
+ * @memberof PropertyTable.prototype
122
+ * @type {Object<string, MetadataTableProperty>}
123
+ * @readonly
124
+ */
125
+ properties: {
126
+ get: function () {
127
+ if (defined(this._metadataTable)) {
128
+ return this._metadataTable.properties;
129
+ }
130
+
131
+ return undefined;
132
+ },
133
+ },
134
+
116
135
  /**
117
136
  * Extra user-defined properties.
118
137
  *
@@ -164,6 +183,20 @@ Object.defineProperties(PropertyTable.prototype, {
164
183
  return totalByteLength;
165
184
  },
166
185
  },
186
+
187
+ /**
188
+ * The texture containing the property table data, if any.
189
+ *
190
+ * @memberof PropertyTable.prototype
191
+ * @type {Texture | undefined}
192
+ * @readonly
193
+ * @private
194
+ */
195
+ texture: {
196
+ get: function () {
197
+ return this._texture;
198
+ },
199
+ },
167
200
  });
168
201
 
169
202
  /**
@@ -533,4 +566,14 @@ PropertyTable.prototype.getExactClassName = function (featureId) {
533
566
  return hierarchy.getClassName(featureId);
534
567
  };
535
568
 
569
+ /**
570
+ * Destroys any resources that need cleaning up in the property table.
571
+ *
572
+ * @private
573
+ */
574
+ PropertyTable.prototype.destroy = function () {
575
+ this._texture = this._texture && this._texture.destroy();
576
+ return destroyObject(this);
577
+ };
578
+
536
579
  export default PropertyTable;
@@ -105,7 +105,7 @@ Object.defineProperties(PropertyTexture.prototype, {
105
105
  *
106
106
  * @memberof PropertyTexture.prototype
107
107
  *
108
- * @type {PropertyTextureProperty}
108
+ * @type {Object<string, PropertyTextureProperty>}
109
109
  * @readonly
110
110
  * @private
111
111
  */
@@ -2,9 +2,6 @@ import Check from "../Core/Check.js";
2
2
  import Frozen from "../Core/Frozen.js";
3
3
  import defined from "../Core/defined.js";
4
4
  import GltfLoaderUtil from "./GltfLoaderUtil.js";
5
- import MetadataType from "./MetadataType.js";
6
- import MetadataComponentType from "./MetadataComponentType.js";
7
- import oneTimeWarning from "../Core/oneTimeWarning.js";
8
5
 
9
6
  /**
10
7
  * A property in a property texture.
@@ -191,100 +188,6 @@ Object.defineProperties(PropertyTextureProperty.prototype, {
191
188
  },
192
189
  });
193
190
 
194
- PropertyTextureProperty.prototype.isGpuCompatible = function () {
195
- const classProperty = this._classProperty;
196
- const type = classProperty.type;
197
- const componentType = classProperty.componentType;
198
-
199
- if (classProperty.isArray) {
200
- // only support arrays of 1-4 UINT8 scalars (normalized or unnormalized)
201
- if (classProperty.isVariableLengthArray) {
202
- oneTimeWarning(
203
- `Property texture property ${classProperty.id} is a variable-length array, which is not supported`,
204
- );
205
- return false;
206
- }
207
- if (classProperty.arrayLength > 4) {
208
- oneTimeWarning(
209
- `Property texture property ${classProperty.id} is an array of length ${classProperty.arrayLength}, but may have at most a length of 4`,
210
- );
211
- return false;
212
- }
213
- if (type !== MetadataType.SCALAR) {
214
- oneTimeWarning(
215
- `Property texture property ${classProperty.id} is an array of type ${type}, but only SCALAR is supported`,
216
- );
217
- return false;
218
- }
219
- if (componentType !== MetadataComponentType.UINT8) {
220
- oneTimeWarning(
221
- `Property texture property ${classProperty.id} is an array with component type ${componentType}, but only UINT8 is supported`,
222
- );
223
- return false;
224
- }
225
- return true;
226
- }
227
-
228
- if (MetadataType.isVectorType(type) || type === MetadataType.SCALAR) {
229
- if (componentType !== MetadataComponentType.UINT8) {
230
- oneTimeWarning(
231
- `Property texture property ${classProperty.id} has component type ${componentType}, but only UINT8 is supported`,
232
- );
233
- return false;
234
- }
235
- return true;
236
- }
237
-
238
- // For this initial implementation, only UINT8-based properties
239
- // are supported.
240
- oneTimeWarning(
241
- `Property texture property ${classProperty.id} has an unsupported type`,
242
- );
243
- return false;
244
- };
245
-
246
- const floatTypesByComponentCount = [undefined, "float", "vec2", "vec3", "vec4"];
247
- const integerTypesByComponentCount = [
248
- undefined,
249
- "int",
250
- "ivec2",
251
- "ivec3",
252
- "ivec4",
253
- ];
254
- PropertyTextureProperty.prototype.getGlslType = function () {
255
- const classProperty = this._classProperty;
256
-
257
- let componentCount = MetadataType.getComponentCount(classProperty.type);
258
- if (classProperty.isArray) {
259
- // fixed-sized arrays of length 2-4 UINT8s are represented as vectors as the
260
- // shader since those are more useful in GLSL.
261
- componentCount = classProperty.arrayLength;
262
- }
263
-
264
- // Normalized UINT8 properties are float types in the shader
265
- if (classProperty.normalized) {
266
- return floatTypesByComponentCount[componentCount];
267
- }
268
-
269
- // other UINT8-based properties are represented as integer types.
270
- return integerTypesByComponentCount[componentCount];
271
- };
272
-
273
- PropertyTextureProperty.prototype.unpackInShader = function (packedValueGlsl) {
274
- const classProperty = this._classProperty;
275
-
276
- // no unpacking needed if for normalized types
277
- if (classProperty.normalized) {
278
- return packedValueGlsl;
279
- }
280
-
281
- // integer types are read from the texture as normalized float values.
282
- // these need to be rescaled to [0, 255] and cast to the appropriate integer
283
- // type.
284
- const glslType = this.getGlslType();
285
- return `${glslType}(255.0 * ${packedValueGlsl})`;
286
- };
287
-
288
191
  /**
289
192
  * Reformat from an array of channel indices like <code>[0, 1]</code> to a
290
193
  * string of channels as would be used in GLSL swizzling (e.g. "rg")