@cesium/engine 17.0.0 → 18.0.1-splats.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 (188) hide show
  1. package/Build/ThirdParty/Workers/z-worker-pako.js +1 -1
  2. package/Build/Workers/{chunk-UC7KH56Y.js → chunk-2AXKROJA.js} +5 -5
  3. package/Build/Workers/{chunk-IKDQX7DY.js → chunk-2J5ZZ7CY.js} +4 -4
  4. package/Build/Workers/{chunk-4TIR5UPL.js → chunk-2SYY3UBI.js} +1 -1
  5. package/Build/Workers/{chunk-CC2WKHIW.js → chunk-2WKW3BEB.js} +6 -6
  6. package/Build/Workers/{chunk-CBFJVM6I.js → chunk-2ZO6BCHN.js} +11 -11
  7. package/Build/Workers/{chunk-7PHT4JHA.js → chunk-3UKG5X7F.js} +12 -12
  8. package/Build/Workers/{chunk-PM4Q36WX.js → chunk-4GYIDPXP.js} +9 -9
  9. package/Build/Workers/{chunk-QUFN3GEO.js → chunk-6EP7ED36.js} +3 -3
  10. package/Build/Workers/{chunk-QJTIOB2Z.js → chunk-6QOBORNG.js} +6 -6
  11. package/Build/Workers/{chunk-YE6MDFDA.js → chunk-6WWHK2ER.js} +14 -14
  12. package/Build/Workers/{chunk-RX65FA7X.js → chunk-6Y6TVYHS.js} +7 -7
  13. package/Build/Workers/{chunk-P2N5IDWU.js → chunk-744VWE2U.js} +13 -13
  14. package/Build/Workers/{chunk-LVGYWPEX.js → chunk-7PQ52XCW.js} +4 -4
  15. package/Build/Workers/{chunk-PS3OKVOQ.js → chunk-A5UFJW2M.js} +12 -12
  16. package/Build/Workers/{chunk-CAKU6ZPR.js → chunk-AQKVFTWV.js} +8 -8
  17. package/Build/Workers/{chunk-236N6BJN.js → chunk-BKTEHJFD.js} +2 -2
  18. package/Build/Workers/{chunk-5PC577K7.js → chunk-CQXYKPAW.js} +16 -16
  19. package/Build/Workers/{chunk-DRMXU674.js → chunk-DI7PHKC6.js} +5 -5
  20. package/Build/Workers/{chunk-CQMXZF4A.js → chunk-DKKIQS6F.js} +6 -6
  21. package/Build/Workers/{chunk-J2HTPGC7.js → chunk-DTVWE5YL.js} +2 -2
  22. package/Build/Workers/{chunk-SSLK4U3V.js → chunk-ERPS2WZC.js} +4 -4
  23. package/Build/Workers/chunk-EYMZ5FSQ.js +280 -0
  24. package/Build/Workers/{chunk-LPGOAMYH.js → chunk-F43TQW5B.js} +2 -2
  25. package/Build/Workers/{chunk-5RPUEFSA.js → chunk-FOMRN6II.js} +6 -6
  26. package/Build/Workers/{chunk-2BJXFXD7.js → chunk-FOTXJYKS.js} +4 -4
  27. package/Build/Workers/{chunk-VXAKU6EV.js → chunk-G2Y7EA4W.js} +5 -5
  28. package/Build/Workers/{chunk-KE45DUDH.js → chunk-GY4E4ZP6.js} +10 -10
  29. package/Build/Workers/{chunk-NZSBSY5K.js → chunk-HDG3VHYL.js} +2 -2
  30. package/Build/Workers/{chunk-WP3IJYLC.js → chunk-HOEUXPBL.js} +9 -9
  31. package/Build/Workers/{chunk-5YEFZMMM.js → chunk-IWDYVJ56.js} +12 -12
  32. package/Build/Workers/{chunk-SQKTLDSD.js → chunk-JA4KPQJL.js} +12 -12
  33. package/Build/Workers/{chunk-MAIKDIBS.js → chunk-JZZQEZMA.js} +6 -6
  34. package/Build/Workers/{chunk-77MDEA47.js → chunk-KPLU3WDY.js} +5 -5
  35. package/Build/Workers/{chunk-E7SMO47Q.js → chunk-LHM6V4D6.js} +5 -5
  36. package/Build/Workers/{chunk-HBNWBMAM.js → chunk-LMTGCD6P.js} +1 -1
  37. package/Build/Workers/{chunk-XYGBWBD5.js → chunk-LWZOYSSF.js} +1 -1
  38. package/Build/Workers/{chunk-OBHLT34A.js → chunk-M6U7SV4T.js} +7 -7
  39. package/Build/Workers/{chunk-MS5NWDHH.js → chunk-O25M56DO.js} +2 -2
  40. package/Build/Workers/{chunk-UX5JWAC7.js → chunk-OE2WXO2Z.js} +10 -10
  41. package/Build/Workers/{chunk-C5DCX2YQ.js → chunk-PFD462OE.js} +6 -6
  42. package/Build/Workers/{chunk-37PA7GZW.js → chunk-PPI33PXH.js} +7 -7
  43. package/Build/Workers/{chunk-4BGKMM7J.js → chunk-PRQQHLUB.js} +1 -1
  44. package/Build/Workers/{chunk-IFIS4CVK.js → chunk-RTUZ7MJB.js} +2 -2
  45. package/Build/Workers/{chunk-G6JUXZUO.js → chunk-S6QBTP5U.js} +4 -4
  46. package/Build/Workers/{chunk-UFV3YUIN.js → chunk-SMFCIGM3.js} +5 -5
  47. package/Build/Workers/{chunk-P57PR3WM.js → chunk-TC3LEKFJ.js} +5 -5
  48. package/Build/Workers/{chunk-7IIMO7ZZ.js → chunk-UTLYCPFY.js} +16 -16
  49. package/Build/Workers/{chunk-HGEGZ67N.js → chunk-V7LEBY53.js} +6 -6
  50. package/Build/Workers/{chunk-GO3RZX2R.js → chunk-VE3UKRDB.js} +9 -9
  51. package/Build/Workers/{chunk-ZTBZMRQT.js → chunk-W3FBD4FE.js} +8 -8
  52. package/Build/Workers/{chunk-K5JTWJPE.js → chunk-YRR6CJGG.js} +4 -4
  53. package/Build/Workers/{chunk-UZ6KXWCA.js → chunk-ZVTKMLU6.js} +4 -4
  54. package/Build/Workers/combineGeometry.js +21 -21
  55. package/Build/Workers/createBoxGeometry.js +15 -15
  56. package/Build/Workers/createBoxOutlineGeometry.js +13 -13
  57. package/Build/Workers/createCircleGeometry.js +23 -23
  58. package/Build/Workers/createCircleOutlineGeometry.js +16 -16
  59. package/Build/Workers/createCoplanarPolygonGeometry.js +30 -30
  60. package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +28 -28
  61. package/Build/Workers/createCorridorGeometry.js +26 -26
  62. package/Build/Workers/createCorridorOutlineGeometry.js +25 -25
  63. package/Build/Workers/createCylinderGeometry.js +17 -17
  64. package/Build/Workers/createCylinderOutlineGeometry.js +15 -15
  65. package/Build/Workers/createEllipseGeometry.js +23 -23
  66. package/Build/Workers/createEllipseOutlineGeometry.js +16 -16
  67. package/Build/Workers/createEllipsoidGeometry.js +16 -16
  68. package/Build/Workers/createEllipsoidOutlineGeometry.js +15 -15
  69. package/Build/Workers/createFrustumGeometry.js +15 -15
  70. package/Build/Workers/createFrustumOutlineGeometry.js +15 -15
  71. package/Build/Workers/createGeometry.js +23 -21
  72. package/Build/Workers/createGroundPolylineGeometry.js +19 -19
  73. package/Build/Workers/createPlaneGeometry.js +13 -13
  74. package/Build/Workers/createPlaneOutlineGeometry.js +12 -12
  75. package/Build/Workers/createPolygonGeometry.js +29 -29
  76. package/Build/Workers/createPolygonOutlineGeometry.js +27 -27
  77. package/Build/Workers/createPolylineGeometry.js +22 -22
  78. package/Build/Workers/createPolylineVolumeGeometry.js +28 -28
  79. package/Build/Workers/createPolylineVolumeOutlineGeometry.js +24 -24
  80. package/Build/Workers/createRectangleGeometry.js +24 -24
  81. package/Build/Workers/createRectangleOutlineGeometry.js +17 -17
  82. package/Build/Workers/createSimplePolylineGeometry.js +20 -20
  83. package/Build/Workers/createSphereGeometry.js +16 -16
  84. package/Build/Workers/createSphereOutlineGeometry.js +15 -15
  85. package/Build/Workers/createTaskProcessorWorker.js +3 -3
  86. package/Build/Workers/createVectorTileClampedPolylines.js +12 -12
  87. package/Build/Workers/createVectorTileGeometries.js +21 -21
  88. package/Build/Workers/createVectorTilePoints.js +11 -11
  89. package/Build/Workers/createVectorTilePolygons.js +19 -19
  90. package/Build/Workers/createVectorTilePolylines.js +12 -12
  91. package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +19 -19
  92. package/Build/Workers/createVerticesFromHeightmap.js +19 -19
  93. package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +16 -16
  94. package/Build/Workers/createWallGeometry.js +21 -21
  95. package/Build/Workers/createWallOutlineGeometry.js +20 -20
  96. package/Build/Workers/decodeDraco.js +10 -10
  97. package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +5 -5
  98. package/Build/Workers/decodeI3S.js +9 -9
  99. package/Build/Workers/gaussianSplatSorter.js +62 -0
  100. package/Build/Workers/gaussianSplatTextureGenerator.js +68 -0
  101. package/Build/Workers/transcodeKTX2.js +78 -7
  102. package/Build/Workers/transferTypedArrayTest.js +1 -1
  103. package/Build/Workers/upsampleQuantizedTerrainMesh.js +19 -19
  104. package/Source/Core/Ion.js +1 -1
  105. package/Source/Core/PixelFormat.js +98 -0
  106. package/Source/Renderer/Context.js +2 -0
  107. package/Source/Renderer/Pass.js +3 -2
  108. package/Source/Renderer/Texture.js +1 -0
  109. package/Source/Renderer/Texture3D.js +568 -0
  110. package/Source/Renderer/VertexArray.js +33 -8
  111. package/Source/Renderer/createUniform.js +3 -0
  112. package/Source/Renderer/createUniformArray.js +1 -0
  113. package/Source/Scene/ArcGisMapService.js +1 -1
  114. package/Source/Scene/Cesium3DTileContentFactory.js +23 -0
  115. package/Source/Scene/Cesium3DTileset.js +197 -2
  116. package/Source/Scene/GaussianSplat3DTileContent.js +504 -0
  117. package/Source/Scene/GaussianSplatPrimitive.js +932 -0
  118. package/Source/Scene/GaussianSplatRenderResources.js +81 -0
  119. package/Source/Scene/GaussianSplatSorter.js +73 -0
  120. package/Source/Scene/GaussianSplatTextureGenerator.js +64 -0
  121. package/Source/Scene/GlobeSurfaceShaderSet.js +4 -5
  122. package/Source/Scene/GltfLoader.js +82 -4
  123. package/Source/Scene/GltfSpzLoader.js +222 -0
  124. package/Source/Scene/GltfVertexBufferLoader.js +98 -3
  125. package/Source/Scene/ImageryLayer.js +19 -4
  126. package/Source/Scene/ImageryLayerCollection.js +3 -2
  127. package/Source/Scene/Model/CartesianRectangle.js +108 -0
  128. package/Source/Scene/Model/ImageryConfiguration.js +25 -0
  129. package/Source/Scene/Model/ImageryCoverage.js +488 -0
  130. package/Source/Scene/Model/ImageryFlags.js +31 -0
  131. package/Source/Scene/Model/ImageryInput.js +60 -0
  132. package/Source/Scene/Model/ImageryPipelineStage.js +1040 -0
  133. package/Source/Scene/Model/MappedPositions.js +84 -0
  134. package/Source/Scene/Model/Model.js +38 -0
  135. package/Source/Scene/Model/ModelImagery.js +403 -0
  136. package/Source/Scene/Model/ModelImageryMapping.js +489 -0
  137. package/Source/Scene/Model/ModelPrimitiveImagery.js +972 -0
  138. package/Source/Scene/Model/ModelReader.js +810 -0
  139. package/Source/Scene/Model/ModelRenderResources.js +13 -0
  140. package/Source/Scene/Model/ModelRuntimePrimitive.js +20 -0
  141. package/Source/Scene/Model/ModelSceneGraph.js +133 -27
  142. package/Source/Scene/Model/ModelUtility.js +2 -0
  143. package/Source/Scene/Model/NodeRenderResources.js +10 -0
  144. package/Source/Scene/ModelComponents.js +10 -0
  145. package/Source/Scene/PrimitiveLoadPlan.js +59 -0
  146. package/Source/Scene/ResourceCache.js +60 -3
  147. package/Source/Scene/ResourceCacheKey.js +39 -1
  148. package/Source/Scene/Scene.js +32 -1
  149. package/Source/Scene/VertexAttributeSemantic.js +30 -0
  150. package/Source/Scene/VoxelPrimitive.js +22 -37
  151. package/Source/Scene/VoxelRenderResources.js +1 -1
  152. package/Source/Scene/processVoxelProperties.js +41 -100
  153. package/Source/Shaders/Builtin/Constants/passGaussianSplats.glsl +9 -0
  154. package/Source/Shaders/Builtin/Constants/passGaussianSplats.js +11 -0
  155. package/Source/Shaders/Builtin/Constants/passOverlay.glsl +1 -1
  156. package/Source/Shaders/Builtin/Constants/passOverlay.js +1 -1
  157. package/Source/Shaders/Builtin/CzmBuiltins.js +2 -0
  158. package/Source/Shaders/Builtin/Functions/windowToEyeCoordinates.glsl +0 -1
  159. package/Source/Shaders/Builtin/Functions/windowToEyeCoordinates.js +0 -1
  160. package/Source/Shaders/GlobeFS.glsl +22 -0
  161. package/Source/Shaders/GlobeFS.js +22 -0
  162. package/Source/Shaders/Model/MaterialStageFS.glsl +4 -0
  163. package/Source/Shaders/Model/MaterialStageFS.js +4 -0
  164. package/Source/Shaders/Model/ModelFS.glsl +3 -1
  165. package/Source/Shaders/Model/ModelFS.js +3 -1
  166. package/Source/Shaders/Model/ModelVS.glsl +5 -1
  167. package/Source/Shaders/Model/ModelVS.js +5 -1
  168. package/Source/Shaders/Model/PointCloudStylingStageVS.glsl +1 -1
  169. package/Source/Shaders/Model/PointCloudStylingStageVS.js +2 -1
  170. package/Source/Shaders/PrimitiveGaussianSplatFS.glsl +18 -0
  171. package/Source/Shaders/PrimitiveGaussianSplatFS.js +20 -0
  172. package/Source/Shaders/PrimitiveGaussianSplatVS.glsl +108 -0
  173. package/Source/Shaders/PrimitiveGaussianSplatVS.js +109 -0
  174. package/Source/Shaders/Voxels/IntersectDepth.glsl +10 -3
  175. package/Source/Shaders/Voxels/IntersectDepth.js +10 -3
  176. package/Source/Shaders/Voxels/Intersection.glsl +1 -3
  177. package/Source/Shaders/Voxels/Intersection.js +1 -3
  178. package/Source/Shaders/Voxels/IntersectionUtils.glsl +1 -0
  179. package/Source/Shaders/Voxels/IntersectionUtils.js +1 -0
  180. package/Source/Shaders/Voxels/VoxelFS.glsl +37 -24
  181. package/Source/Shaders/Voxels/VoxelFS.js +37 -24
  182. package/Source/ThirdParty/Workers/z-worker-pako.js +1 -1
  183. package/Source/ThirdParty/wasm_splats_bg.wasm +0 -0
  184. package/Source/Workers/gaussianSplatSorter.js +34 -0
  185. package/Source/Workers/gaussianSplatTextureGenerator.js +39 -0
  186. package/index.d.ts +66 -2
  187. package/index.js +101 -80
  188. package/package.json +6 -4
@@ -0,0 +1,504 @@
1
+ import defined from "../Core/defined.js";
2
+ import Resource from "../Core/Resource.js";
3
+ import GltfLoader from "./GltfLoader.js";
4
+ import RuntimeError from "../Core/RuntimeError.js";
5
+ import Axis from "./Axis.js";
6
+ import GaussianSplatPrimitive from "./GaussianSplatPrimitive.js";
7
+ import destroyObject from "../Core/destroyObject.js";
8
+
9
+ /**
10
+ * Represents the contents of a glTF or glb using the {@link https://github.com/CesiumGS/glTF/tree/draft-spz-splat-compression/extensions/2.0/Khronos/KHR_spz_gaussian_splats_compression|KHR_spz_gaussian_splats_compression} extension.
11
+ * <p>
12
+ * Implements the {@link Cesium3DTileContent} interface.
13
+ * </p>
14
+ *
15
+ * @alias GaussianSplat3DTileContent
16
+ * @constructor
17
+ * @private
18
+ */
19
+ function GaussianSplat3DTileContent(loader, tileset, tile, resource) {
20
+ this._tileset = tileset;
21
+ this._tile = tile;
22
+ this._resource = resource;
23
+ this._loader = loader;
24
+
25
+ if (!defined(this._tileset.gaussianSplatPrimitive)) {
26
+ this._tileset.gaussianSplatPrimitive = new GaussianSplatPrimitive({
27
+ tileset: this._tileset,
28
+ });
29
+ }
30
+
31
+ /**
32
+ * glTF primitive data that contains the Gaussian splat data needed for rendering.
33
+ * @type {undefined|Primitive}
34
+ * @private
35
+ */
36
+ this.splatPrimitive = undefined;
37
+
38
+ /**
39
+ * Transform matrix to turn model coordinates into world coordinates.
40
+ * @type {undefined|Matrix4}
41
+ * @private
42
+ */
43
+ this.worldTransform = undefined;
44
+
45
+ /**
46
+ * Gets or sets if any feature's property changed. Used to
47
+ * optimized applying a style when a feature's property changed.
48
+ * <p>
49
+ * This is used to implement the <code>Cesium3DTileContent</code> interface, but is
50
+ * not part of the public Cesium API.
51
+ * </p>
52
+ *
53
+ * @type {boolean}
54
+ *
55
+ * @private
56
+ */
57
+ this.featurePropertiesDirty = false;
58
+
59
+ this._metadata = undefined;
60
+ this._group = undefined;
61
+ this._ready = false;
62
+ /**
63
+ * Indicates whether or not the local coordinates of the tile have been transformed
64
+ * @type {boolean}
65
+ * @private
66
+ */
67
+ this._transformed = false;
68
+ }
69
+
70
+ Object.defineProperties(GaussianSplat3DTileContent.prototype, {
71
+ /**
72
+ * Gets the number of features in the tile. Currently this is always zero.
73
+ *
74
+ * @memberof GaussianSplat3DTileContent.prototype
75
+ *
76
+ * @type {number}
77
+ * @readonly
78
+ */
79
+ featuresLength: {
80
+ get: function () {
81
+ return 0;
82
+ },
83
+ },
84
+
85
+ /**
86
+ * Equal to the number of Gaussian splats in the tile. Each splat is represented by a median point and a set of attributes, so we can
87
+ * treat this as the number of points in the tile.
88
+ *
89
+ * @memberof GaussianSplat3DTileContent.prototype
90
+ *
91
+ * @type {number}
92
+ * @readonly
93
+ */
94
+ pointsLength: {
95
+ get: function () {
96
+ return this.splatPrimitive.attributes[0].count;
97
+ },
98
+ },
99
+ /**
100
+ * Gets the number of triangles in the tile. Currently this is always zero because Gaussian splats are not represented as triangles in the tile content.
101
+ * <p>
102
+ * @memberof GaussianSplat3DTileContent.prototype
103
+ *
104
+ * @type {number}
105
+ * @readonly
106
+ */
107
+ trianglesLength: {
108
+ get: function () {
109
+ return 0;
110
+ },
111
+ },
112
+ /**
113
+ * The number of bytes used by the geometry attributes of this content.
114
+ * <p>
115
+ * @memberof GaussianSplat3DTileContent.prototype
116
+ * @type {number}
117
+ * @readonly
118
+ */
119
+ geometryByteLength: {
120
+ get: function () {
121
+ return this.splatPrimitive.attributes.reduce((totalLength, attribute) => {
122
+ return totalLength + attribute.byteLength;
123
+ }, 0);
124
+ },
125
+ },
126
+ /**
127
+ * The number of bytes used by the textures of this content.
128
+ * <p>
129
+ * @memberof GaussianSplat3DTileContent.prototype
130
+ * @type {number}
131
+ * @readonly
132
+ */
133
+ texturesByteLength: {
134
+ get: function () {
135
+ const texture = this._tileset.gaussianSplatPrimitive.gaussianSplatTexture;
136
+ const selectedTileLength =
137
+ this._tileset.gaussianSplatPrimitive.selectedTileLength;
138
+ if (!defined(texture) || selectedTileLength === 0) {
139
+ return 0;
140
+ }
141
+ return texture.sizeInBytes / selectedTileLength;
142
+ },
143
+ },
144
+ /**
145
+ * Gets the amount of memory used by the batch table textures and any binary
146
+ * metadata properties not accounted for in geometryByteLength or
147
+ * texturesByteLength
148
+ * <p>
149
+ * @memberof GaussianSplat3DTileContent.prototype
150
+ *
151
+ * @type {number}
152
+ * @readonly
153
+ */
154
+ batchTableByteLength: {
155
+ // eslint-disable-next-line getter-return
156
+ get: function () {
157
+ return 0;
158
+ },
159
+ },
160
+ /**
161
+ * Gets the array of {@link Cesium3DTileContent} objects for contents that contain other contents, such as composite tiles. The inner contents may in turn have inner contents, such as a composite tile that contains a composite tile.
162
+ *
163
+ * @see {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/TileFormats/Composite|Composite specification}
164
+ *
165
+ * @memberof GaussianSplat3DTileContent.prototype
166
+ *
167
+ * @type {Array}
168
+ * @readonly
169
+ */
170
+ innerContents: {
171
+ get: function () {
172
+ return undefined;
173
+ },
174
+ },
175
+
176
+ /**
177
+ * Returns true when the tile's content is ready to render; otherwise false
178
+ *
179
+ * @memberof GaussianSplat3DTileContent.prototype
180
+ *
181
+ * @type {boolean}
182
+ * @readonly
183
+ */
184
+ ready: {
185
+ get: function () {
186
+ return this._ready;
187
+ },
188
+ },
189
+
190
+ /**
191
+ * Returns true when the tile's content is transformed to world coordinates; otherwise false
192
+ * <p>
193
+ * @memberof GaussianSplat3DTileContent.prototype
194
+ * @type {boolean}
195
+ * @readonly
196
+ */
197
+ transformed: {
198
+ get: function () {
199
+ return this._transformed;
200
+ },
201
+ },
202
+
203
+ /**
204
+ * The tileset that this content belongs to.
205
+ * <p>
206
+ * @memberof GaussianSplat3DTileContent.prototype
207
+ * @type {Cesium3DTileset}
208
+ * @readonly
209
+ */
210
+ tileset: {
211
+ get: function () {
212
+ return this._tileset;
213
+ },
214
+ },
215
+ /**
216
+ * The tile that this content belongs to.
217
+ * <p>
218
+ * @memberof GaussianSplat3DTileContent.prototype
219
+ * @type {Cesium3DTile}
220
+ * @readonly
221
+ */
222
+ tile: {
223
+ get: function () {
224
+ return this._tile;
225
+ },
226
+ },
227
+ /**
228
+ * The resource that this content was loaded from.
229
+ * <p>
230
+ * @memberof GaussianSplat3DTileContent.prototype
231
+ * @type {Resource}
232
+ * @readonly
233
+ */
234
+ url: {
235
+ get: function () {
236
+ return this._resource.getUrlComponent(true);
237
+ },
238
+ },
239
+ /**
240
+ * Gets the batch table for this content.
241
+ * <p>
242
+ * This is used to implement the <code>Cesium3DTileContent</code> interface, but is
243
+ * not part of the public Cesium API.
244
+ * </p>
245
+ *
246
+ * @type {Cesium3DTileBatchTable}
247
+ * @readonly
248
+ *
249
+ * @private
250
+ */
251
+ batchTable: {
252
+ get: function () {
253
+ return undefined;
254
+ },
255
+ },
256
+ /**
257
+ * Gets the metadata for this content, whether it is available explicitly or via
258
+ * implicit tiling. If there is no metadata, this property should be undefined.
259
+ * <p>
260
+ * This is used to implement the <code>Cesium3DTileContent</code> interface, but is
261
+ * not part of the public Cesium API.
262
+ * </p>
263
+ *
264
+ * @type {ImplicitMetadataView|undefined}
265
+ *
266
+ * @private
267
+ * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.
268
+ */
269
+ metadata: {
270
+ get: function () {
271
+ return this._metadata;
272
+ },
273
+ set: function (value) {
274
+ this._metadata = value;
275
+ },
276
+ },
277
+ /**
278
+ * Gets the group for this content if the content has metadata (3D Tiles 1.1) or
279
+ * if it uses the <code>3DTILES_metadata</code> extension. If neither are present,
280
+ * this property should be undefined.
281
+ * <p>
282
+ * This is used to implement the <code>Cesium3DTileContent</code> interface, but is
283
+ * not part of the public Cesium API.
284
+ * </p>
285
+ *
286
+ * @type {Cesium3DTileContentGroup|undefined}
287
+ *
288
+ * @private
289
+ * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.
290
+ */
291
+ group: {
292
+ get: function () {
293
+ return this._group;
294
+ },
295
+ set: function (value) {
296
+ this._group = value;
297
+ },
298
+ },
299
+ });
300
+
301
+ /**
302
+ * Creates a new instance of {@link GaussianSplat3DTileContent} from a glTF or glb resource.
303
+ *
304
+ * @param {Cesium3DTileset} tileset - The tileset that this content belongs to.
305
+ * @param {Cesium3DTile} tile - The tile that this content belongs to.
306
+ * @param {Resource|string} resource - The resource or URL of the glTF or glb file.
307
+ * @param {object|Uint8Array} gltf - The glTF JSON object or a Uint8Array containing the glb binary data.
308
+ * @returns {GaussianSplat3DTileContent} A new GaussianSplat3DTileContent instance.
309
+ * @throws {RuntimeError} If the glTF or glb fails to load.
310
+ * @private
311
+ */
312
+ GaussianSplat3DTileContent.fromGltf = async function (
313
+ tileset,
314
+ tile,
315
+ resource,
316
+ gltf,
317
+ ) {
318
+ const basePath = resource;
319
+ const baseResource = Resource.createIfNeeded(basePath);
320
+
321
+ const loaderOptions = {
322
+ releaseGltfJson: false,
323
+ upAxis: Axis.Y,
324
+ forwardAxis: Axis.Z,
325
+ };
326
+
327
+ if (defined(gltf.asset)) {
328
+ loaderOptions.gltfJson = gltf;
329
+ loaderOptions.baseResource = baseResource;
330
+ loaderOptions.gltfResource = baseResource;
331
+ } else if (gltf instanceof Uint8Array) {
332
+ loaderOptions.typedArray = gltf;
333
+ loaderOptions.baseResource = baseResource;
334
+ loaderOptions.gltfResource = baseResource;
335
+ } else {
336
+ loaderOptions.gltfResource = Resource.createIfNeeded(gltf);
337
+ }
338
+
339
+ const loader = new GltfLoader(loaderOptions);
340
+
341
+ try {
342
+ await loader.load();
343
+ } catch (error) {
344
+ loader.destroy();
345
+ throw new RuntimeError(`Failed to load glTF: ${error.message}`);
346
+ }
347
+
348
+ return new GaussianSplat3DTileContent(loader, tileset, tile, resource);
349
+ };
350
+
351
+ /**
352
+ * Updates the content of the tile and prepares it for rendering.
353
+ * @param {Cesium3DTileset}
354
+ * @param {FrameState} frameState - The current frame state.
355
+ * @private
356
+ */
357
+ GaussianSplat3DTileContent.prototype.update = function (primitive, frameState) {
358
+ const loader = this._loader;
359
+
360
+ if (this._ready) {
361
+ if (
362
+ !this._transformed &&
363
+ this._tile !== primitive.root &&
364
+ primitive.root.content.ready
365
+ ) {
366
+ GaussianSplatPrimitive.transformTile(this._tile);
367
+ this._transformed = true;
368
+ }
369
+
370
+ return;
371
+ }
372
+
373
+ frameState.afterRender.push(() => true);
374
+
375
+ if (!defined(loader)) {
376
+ this._ready = true;
377
+ return;
378
+ }
379
+
380
+ if (this._resourcesLoaded) {
381
+ this.splatPrimitive = loader.components.scene.nodes[0].primitives[0];
382
+ this.worldTransform = loader.components.scene.nodes[0].matrix;
383
+ this._ready = true;
384
+
385
+ return;
386
+ }
387
+
388
+ this._resourcesLoaded = loader.process(frameState);
389
+ };
390
+ /**
391
+ * Returns whether the feature has this property.
392
+ *
393
+ * @param {number} batchId The batchId for the feature.
394
+ * @param {string} name The case-sensitive name of the property.
395
+ * @returns {boolean} <code>true</code> if the feature has this property; otherwise, <code>false</code>.
396
+ */
397
+ GaussianSplat3DTileContent.prototype.hasProperty = function (batchId, name) {
398
+ return false;
399
+ };
400
+
401
+ /**
402
+ * Returns the {@link Cesium3DTileFeature} object for the feature with the
403
+ * given <code>batchId</code>. This object is used to get and modify the
404
+ * feature's properties.
405
+ * <p>
406
+ * Features in a tile are ordered by <code>batchId</code>, an index used to retrieve their metadata from the batch table.
407
+ * </p>
408
+ *
409
+ * @see {@link https://github.com/CesiumGS/3d-tiles/tree/main/specification/TileFormats/BatchTable}.
410
+ *
411
+ * @param {number} batchId The batchId for the feature.
412
+ * @returns {Cesium3DTileFeature} The corresponding {@link Cesium3DTileFeature} object.
413
+ *
414
+ * @exception {DeveloperError} batchId must be between zero and {@link Cesium3DTileContent#featuresLength} - 1.
415
+ */
416
+ GaussianSplat3DTileContent.prototype.getFeature = function (batchId) {
417
+ return undefined;
418
+ };
419
+ /**
420
+ * Called when {@link Cesium3DTileset#debugColorizeTiles} changes.
421
+ * <p>
422
+ * This is used to implement the <code>Cesium3DTileContent</code> interface, but is
423
+ * not part of the public Cesium API.
424
+ * </p>
425
+ *
426
+ * @param {boolean} enabled Whether to enable or disable debug settings.
427
+ * @returns {Cesium3DTileFeature} The corresponding {@link Cesium3DTileFeature} object.
428
+
429
+ * @private
430
+ */
431
+ GaussianSplat3DTileContent.prototype.applyDebugSettings = function (
432
+ enabled,
433
+ color,
434
+ ) {};
435
+ /**
436
+ * Apply a style to the content
437
+ * <p>
438
+ * This is used to implement the <code>Cesium3DTileContent</code> interface, but is
439
+ * not part of the public Cesium API.
440
+ * </p>
441
+ *
442
+ * @param {Cesium3DTileStyle} style The style.
443
+ *
444
+ * @private
445
+ */
446
+ GaussianSplat3DTileContent.prototype.applyStyle = function (style) {};
447
+ /**
448
+ * Find an intersection between a ray and the tile content surface that was rendered. The ray must be given in world coordinates.
449
+ *
450
+ * @param {Ray} ray The ray to test for intersection.
451
+ * @param {FrameState} frameState The frame state.
452
+ * @param {Cartesian3|undefined} [result] The intersection or <code>undefined</code> if none was found.
453
+ * @returns {Cartesian3|undefined} The intersection or <code>undefined</code> if none was found.
454
+ *
455
+ * @private
456
+ */
457
+ GaussianSplat3DTileContent.prototype.pick = function (ray, frameState, result) {
458
+ return undefined;
459
+ };
460
+ /**
461
+ * Returns true if this object was destroyed; otherwise, false.
462
+ * <br /><br />
463
+ * If this object was destroyed, it should not be used; calling any function other than
464
+ * <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
465
+ * <p>
466
+ * This is used to implement the <code>Cesium3DTileContent</code> interface, but is
467
+ * not part of the public Cesium API.
468
+ * </p>
469
+ *
470
+ * @returns {boolean} <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
471
+ *
472
+ * @see Cesium3DTileContent#destroy
473
+ *
474
+ * @private
475
+ */
476
+ GaussianSplat3DTileContent.prototype.isDestroyed = function () {
477
+ return this.isDestroyed;
478
+ };
479
+
480
+ /**
481
+ * Frees the resources used by this object.
482
+ * @private
483
+ */
484
+ GaussianSplat3DTileContent.prototype.destroy = function () {
485
+ this.splatPrimitive = undefined;
486
+ this._tileset.gaussianSplatPrimitive.destroy();
487
+ this._tileset.gaussianSplatPrimitive = undefined;
488
+ this._tile = undefined;
489
+ this._tileset = undefined;
490
+ this._resource = undefined;
491
+ this._ready = false;
492
+ this._group = undefined;
493
+ this._metadata = undefined;
494
+ this._resourcesLoaded = false;
495
+
496
+ if (defined(this._loader)) {
497
+ this._loader.destroy();
498
+ this._loader = undefined;
499
+ }
500
+
501
+ return destroyObject(this);
502
+ };
503
+
504
+ export default GaussianSplat3DTileContent;