@cesium/engine 23.0.0 → 24.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 (226) hide show
  1. package/Build/Workers/{chunk-QTOHIXGF.js → chunk-2N4KDHS3.js} +10 -10
  2. package/Build/Workers/{chunk-SQTRWKO2.js → chunk-44EMEGKW.js} +5 -5
  3. package/Build/Workers/{chunk-OHBM4YG4.js → chunk-4TIG36AW.js} +12 -12
  4. package/Build/Workers/{chunk-BNBD2YZK.js → chunk-5A2SW66E.js} +16 -16
  5. package/Build/Workers/{chunk-52K3GJKG.js → chunk-5GXYJQ2K.js} +3 -3
  6. package/Build/Workers/{chunk-NQCAZU7S.js → chunk-63SIWPLS.js} +13 -13
  7. package/Build/Workers/{chunk-UEEGWJJP.js → chunk-6MPGQEHA.js} +2 -2
  8. package/Build/Workers/{chunk-PQVNT5CJ.js → chunk-6RMS4S72.js} +6 -6
  9. package/Build/Workers/{chunk-HYTFXWMY.js → chunk-6WLHJFD3.js} +7 -7
  10. package/Build/Workers/{chunk-DT5SJBKA.js → chunk-72VYSVEW.js} +9 -9
  11. package/Build/Workers/{chunk-JUGY5AZN.js → chunk-7MDYBRYJ.js} +4 -4
  12. package/Build/Workers/{chunk-6SLGTBB2.js → chunk-7O5XJTVE.js} +5 -5
  13. package/Build/Workers/{chunk-4UNQX2MP.js → chunk-7QRFIKWQ.js} +2 -2
  14. package/Build/Workers/{chunk-GN5NEUDT.js → chunk-7TYLCBGK.js} +8 -8
  15. package/Build/Workers/{chunk-SGKTBHFQ.js → chunk-7X322WP2.js} +13 -13
  16. package/Build/Workers/{chunk-T43FXHNC.js → chunk-A47HVBC5.js} +7 -7
  17. package/Build/Workers/{chunk-FSDVXW7M.js → chunk-AF3MU2RL.js} +5 -5
  18. package/Build/Workers/{chunk-3B65YFXC.js → chunk-AJLTU6PF.js} +1 -1
  19. package/Build/Workers/{chunk-OQ3EAJNW.js → chunk-AMIHNSST.js} +2 -2
  20. package/Build/Workers/{chunk-N4AWE7TZ.js → chunk-B6SCUUFP.js} +10 -10
  21. package/Build/Workers/{chunk-OMXN7YF4.js → chunk-BJD6QGXZ.js} +12 -12
  22. package/Build/Workers/{chunk-APDKMX7W.js → chunk-C6P4IG5P.js} +6 -6
  23. package/Build/Workers/{chunk-QA24Q62E.js → chunk-D4EJ2NXG.js} +17 -17
  24. package/Build/Workers/{chunk-HYLEKKO5.js → chunk-DHKPFLSJ.js} +1 -1
  25. package/Build/Workers/{chunk-MQJG522T.js → chunk-DVB56LG7.js} +6 -6
  26. package/Build/Workers/{chunk-Y5AJSEEN.js → chunk-EDXL4W76.js} +2 -2
  27. package/Build/Workers/{chunk-QQX7S5QT.js → chunk-EV3VGO6Y.js} +17 -17
  28. package/Build/Workers/{chunk-IFA7VHHP.js → chunk-GOQBUCXH.js} +10 -10
  29. package/Build/Workers/{chunk-5A7YSAXT.js → chunk-GQUNK2XC.js} +14 -14
  30. package/Build/Workers/{chunk-36LBFITA.js → chunk-HKUES6UG.js} +12 -12
  31. package/Build/Workers/{chunk-OC6X22PG.js → chunk-HRHRYFHS.js} +9 -9
  32. package/Build/Workers/{chunk-L7RDJ4V7.js → chunk-HXJMS2ZI.js} +1 -1
  33. package/Build/Workers/{chunk-NAYRNPEP.js → chunk-ILMFADZA.js} +4 -4
  34. package/Build/Workers/{chunk-AA33B6PU.js → chunk-ISY4EZCA.js} +4 -4
  35. package/Build/Workers/{chunk-7KRN6JPQ.js → chunk-J6AW5YHS.js} +14 -14
  36. package/Build/Workers/{chunk-OQBPOKPZ.js → chunk-JCI63T3K.js} +6 -6
  37. package/Build/Workers/{chunk-2WI4HGJU.js → chunk-KLPGTXS3.js} +6 -6
  38. package/Build/Workers/{chunk-5R7SBUTW.js → chunk-LIB2H534.js} +10 -10
  39. package/Build/Workers/{chunk-IYVDOB5V.js → chunk-LXMCPFFS.js} +4 -4
  40. package/Build/Workers/{chunk-NUYLNQKV.js → chunk-MKM27KGV.js} +2 -2
  41. package/Build/Workers/{chunk-R7M4XNPP.js → chunk-N65BAKSH.js} +8 -8
  42. package/Build/Workers/{chunk-4LGFX2P5.js → chunk-NKT5K3K3.js} +11 -11
  43. package/Build/Workers/{chunk-NNHU33JK.js → chunk-NPF7SSHZ.js} +7 -7
  44. package/Build/Workers/{chunk-LDQWNMEC.js → chunk-PVV64VFW.js} +1 -1
  45. package/Build/Workers/{chunk-WKXDCVBO.js → chunk-Q3C6VQH6.js} +4 -4
  46. package/Build/Workers/{chunk-ARCFIOKA.js → chunk-RQNJD3O4.js} +12 -12
  47. package/Build/Workers/{chunk-G3YT7M7A.js → chunk-UIGVOKKI.js} +1 -1
  48. package/Build/Workers/{chunk-ZIW5FCIW.js → chunk-UQU4RXLT.js} +27 -19
  49. package/Build/Workers/{chunk-MT5M7RLZ.js → chunk-VLDEUTOP.js} +2 -2
  50. package/Build/Workers/{chunk-5JP5FG7U.js → chunk-VMVOUQ5J.js} +7 -7
  51. package/Build/Workers/{chunk-2GL2EUEE.js → chunk-XJRBB253.js} +11 -11
  52. package/Build/Workers/{chunk-ESD4IEOU.js → chunk-XY6HMDGI.js} +5 -5
  53. package/Build/Workers/{chunk-56OHFSLH.js → chunk-Y7HNNPNK.js} +10 -10
  54. package/Build/Workers/{chunk-6FVFM2KB.js → chunk-YAOZMOFL.js} +5 -5
  55. package/Build/Workers/{chunk-AP6XWET5.js → chunk-YJZGW74L.js} +8 -8
  56. package/Build/Workers/{chunk-KPYU6YZG.js → chunk-YQFTYQMZ.js} +1 -1
  57. package/Build/Workers/{chunk-5VKZVPO5.js → chunk-ZBZRTRJB.js} +10 -10
  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 +25 -25
  100. package/Build/Workers/createWallOutlineGeometry.js +24 -24
  101. package/Build/Workers/decodeDraco.js +10 -10
  102. package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +5 -5
  103. package/Build/Workers/decodeI3S.js +12 -12
  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/BoundingSphere.js +1 -1
  112. package/Source/Core/Cartesian2.js +7 -5
  113. package/Source/Core/Cartesian3.js +8 -6
  114. package/Source/Core/Cartesian4.js +8 -6
  115. package/Source/Core/Color.js +5 -3
  116. package/Source/Core/DeveloperError.js +2 -1
  117. package/Source/Core/ITwinPlatform.js +1 -0
  118. package/Source/Core/Ion.js +1 -1
  119. package/Source/Core/S2Cell.js +2 -2
  120. package/Source/Core/TerrainMesh.js +10 -1
  121. package/Source/Core/TerrainPicker.js +1 -0
  122. package/Source/Core/WallGeometry.js +1 -1
  123. package/Source/Core/WallOutlineGeometry.js +1 -1
  124. package/Source/Core/assert.js +27 -0
  125. package/Source/Core/globalTypes.js +4 -0
  126. package/Source/DataSources/CzmlDataSource.js +9 -0
  127. package/Source/DataSources/PathGraphics.js +13 -0
  128. package/Source/DataSources/PathVisualizer.js +330 -18
  129. package/Source/DataSources/StaticGeometryColorBatch.js +7 -2
  130. package/Source/DataSources/StaticGeometryPerMaterialBatch.js +7 -2
  131. package/Source/DataSources/StaticGroundGeometryPerMaterialBatch.js +3 -1
  132. package/Source/DataSources/StaticGroundPolylinePerMaterialBatch.js +3 -1
  133. package/Source/Renderer/Context.js +1 -1
  134. package/Source/Renderer/RenderState.js +2 -2
  135. package/Source/Renderer/VertexArray.js +80 -0
  136. package/Source/Scene/ArcGisMapService.js +1 -1
  137. package/Source/Scene/BillboardCollection.js +65 -364
  138. package/Source/Scene/BufferPoint.js +148 -0
  139. package/Source/Scene/BufferPointCollection.js +135 -0
  140. package/Source/Scene/BufferPointMaterial.js +95 -0
  141. package/Source/Scene/BufferPolygon.js +516 -0
  142. package/Source/Scene/BufferPolygonCollection.js +368 -0
  143. package/Source/Scene/BufferPolygonMaterial.js +41 -0
  144. package/Source/Scene/BufferPolyline.js +185 -0
  145. package/Source/Scene/BufferPolylineCollection.js +136 -0
  146. package/Source/Scene/BufferPolylineMaterial.js +93 -0
  147. package/Source/Scene/BufferPrimitive.js +347 -0
  148. package/Source/Scene/BufferPrimitiveCollection.js +702 -0
  149. package/Source/Scene/BufferPrimitiveMaterial.js +140 -0
  150. package/Source/Scene/Cesium3DTileContent.js +5 -1
  151. package/Source/Scene/Cesium3DTileContentFactory.js +9 -0
  152. package/Source/Scene/Cesium3DTileStyle.js +22 -0
  153. package/Source/Scene/Cesium3DTileset.js +1 -0
  154. package/Source/Scene/ClippingPolygonCollection.js +270 -101
  155. package/Source/Scene/CubeMapPanorama.js +4 -4
  156. package/Source/Scene/GaussianSplat3DTileContent.js +40 -46
  157. package/Source/Scene/GaussianSplatPrimitive.js +413 -70
  158. package/Source/Scene/GetFeatureInfoFormat.js +3 -3
  159. package/Source/Scene/GltfLoader.js +227 -34
  160. package/Source/Scene/GltfSpzLoader.js +109 -0
  161. package/Source/Scene/ITwinData.js +1 -0
  162. package/Source/Scene/Label.js +32 -0
  163. package/Source/Scene/LabelCollection.js +14 -13
  164. package/Source/Scene/Material.js +2 -0
  165. package/Source/Scene/Megatexture.js +1 -0
  166. package/Source/Scene/MetadataClassProperty.js +24 -10
  167. package/Source/Scene/MetadataComponentType.js +115 -23
  168. package/Source/Scene/Model/CustomShaderPipelineStage.js +3 -1
  169. package/Source/Scene/Model/EdgeVisibilityPipelineStage.js +761 -263
  170. package/Source/Scene/Model/MaterialPipelineStage.js +147 -0
  171. package/Source/Scene/Model/MetadataPipelineStage.js +3 -3
  172. package/Source/Scene/Model/ModelDrawCommand.js +6 -0
  173. package/Source/Scene/Model/ModelReader.js +1 -1
  174. package/Source/Scene/Model/ModelUtility.js +3 -1
  175. package/Source/Scene/Model/createVectorTileBuffersFromModelComponents.js +330 -0
  176. package/Source/Scene/ModelComponents.js +1632 -1542
  177. package/Source/Scene/PickedMetadataInfo.js +1 -0
  178. package/Source/Scene/ScreenSpaceCameraController.js +13 -0
  179. package/Source/Scene/SkyBox.js +17 -8
  180. package/Source/Scene/TileBoundingRegion.js +1 -1
  181. package/Source/Scene/TileBoundingS2Cell.js +1 -1
  182. package/Source/Scene/TileBoundingSphere.js +1 -1
  183. package/Source/Scene/TweenCollection.js +7 -0
  184. package/Source/Scene/VectorGltf3DTileContent.js +382 -0
  185. package/Source/Scene/VertexAttributeSemantic.js +14 -0
  186. package/Source/Scene/WebMapServiceImageryProvider.js +2 -2
  187. package/Source/Scene/WebMapTileServiceImageryProvider.js +366 -131
  188. package/Source/Scene/parseStructuralMetadata.js +97 -37
  189. package/Source/Scene/renderBufferPointCollection.js +334 -0
  190. package/Source/Scene/renderBufferPolygonCollection.js +386 -0
  191. package/Source/Scene/renderBufferPolylineCollection.js +529 -0
  192. package/Source/Shaders/BillboardCollectionFS.glsl +2 -77
  193. package/Source/Shaders/BillboardCollectionFS.js +2 -77
  194. package/Source/Shaders/BillboardCollectionVS.glsl +2 -60
  195. package/Source/Shaders/BillboardCollectionVS.js +2 -60
  196. package/Source/Shaders/BufferPointMaterialFS.glsl +27 -0
  197. package/Source/Shaders/BufferPointMaterialFS.js +29 -0
  198. package/Source/Shaders/BufferPointMaterialVS.glsl +48 -0
  199. package/Source/Shaders/BufferPointMaterialVS.js +50 -0
  200. package/Source/Shaders/BufferPolygonMaterialFS.glsl +13 -0
  201. package/Source/Shaders/BufferPolygonMaterialFS.js +15 -0
  202. package/Source/Shaders/BufferPolygonMaterialVS.glsl +30 -0
  203. package/Source/Shaders/BufferPolygonMaterialVS.js +32 -0
  204. package/Source/Shaders/BufferPolylineMaterialFS.glsl +13 -0
  205. package/Source/Shaders/BufferPolylineMaterialFS.js +15 -0
  206. package/Source/Shaders/BufferPolylineMaterialVS.glsl +49 -0
  207. package/Source/Shaders/BufferPolylineMaterialVS.js +51 -0
  208. package/Source/Shaders/Model/EdgeVisibilityStageFS.glsl +34 -48
  209. package/Source/Shaders/Model/EdgeVisibilityStageFS.js +34 -49
  210. package/Source/Shaders/Model/EdgeVisibilityStageVS.glsl +98 -0
  211. package/Source/Shaders/Model/EdgeVisibilityStageVS.js +100 -0
  212. package/Source/Shaders/Model/ModelFS.glsl +15 -0
  213. package/Source/Shaders/Model/ModelFS.js +15 -0
  214. package/Source/Shaders/Model/ModelVS.glsl +8 -0
  215. package/Source/Shaders/Model/ModelVS.js +8 -0
  216. package/Source/Shaders/PolygonSignedDistanceFS.glsl +64 -33
  217. package/Source/Shaders/PolygonSignedDistanceFS.js +64 -33
  218. package/Source/Shaders/PrimitiveGaussianSplatVS.glsl +9 -2
  219. package/Source/Shaders/PrimitiveGaussianSplatVS.js +9 -2
  220. package/Source/Shaders/Voxels/VoxelFS.glsl +1 -1
  221. package/Source/Shaders/Voxels/VoxelFS.js +1 -1
  222. package/Source/Workers/decodeDraco.js +3 -0
  223. package/Source/Workers/decodeI3S.js +5 -2
  224. package/index.d.ts +1007 -111
  225. package/index.js +368 -343
  226. package/package.json +2 -2
@@ -1,1645 +1,1733 @@
1
+ // @ts-check
2
+
1
3
  import AlphaMode from "./AlphaMode.js";
2
4
  import Cartesian3 from "../Core/Cartesian3.js";
3
5
  import Cartesian4 from "../Core/Cartesian4.js";
4
6
  import Matrix3 from "../Core/Matrix3.js";
5
7
  import Matrix4 from "../Core/Matrix4.js";
6
8
 
9
+ /** @import { TypedArray } from "../Core/globalTypes.js"; */
10
+ /** @import ArticulationStageType from "../Core/ArticulationStageType.js"; */
11
+ /** @import AttributeType from "./AttributeType.js"; */
12
+ /** @import Axis from "./Axis.js"; */
13
+ /** @import Cartesian2 from "../Core/Cartesian2.js"; */
14
+ /** @import ComponentDatatype from "../Core/ComponentDatatype.js"; */
15
+ /** @import Credit from "../Core/Credit.js"; */
16
+ /** @import IndexDatatype from "../Core/IndexDatatype.js"; */
17
+ /** @import InstanceAttributeSemantic from "./InstanceAttributeSemantic.js"; */
18
+ /** @import InterpolationType from "../Core/InterpolationType.js"; */
19
+ /** @import Matrix2 from "../Core/Matrix2.js"; */
20
+ /** @import ModelPrimitiveImagery from "./Model/ModelPrimitiveImagery.js"; */
21
+ /** @import PrimitiveType from "../Core/PrimitiveType.js"; */
22
+ /** @import Quaternion from "../Core/Quaternion.js"; */
23
+ /** @import StructuralMetadata from "./StructuralMetadata.js"; */
24
+ /** @import Texture from "../Renderer/Texture.js"; */
25
+ /** @import VertexAttributeSemantic from "./VertexAttributeSemantic.js"; */
26
+ /** @import Buffer from "../Renderer/Buffer.js"; */
27
+
7
28
  /**
8
29
  * Components for building models.
9
30
  *
10
31
  * @namespace ModelComponents
11
32
  *
12
- * @private
33
+ * @ignore
13
34
  */
14
35
  const ModelComponents = {};
15
36
 
16
37
  /**
17
38
  * Information about the quantized attribute.
18
39
  *
19
- * @alias ModelComponents.Quantization
20
- * @constructor
21
- *
22
- * @private
23
- */
24
- function Quantization() {
25
- /**
26
- * Whether the quantized attribute is oct-encoded.
27
- *
28
- * @type {boolean}
29
- * @private
30
- */
31
- this.octEncoded = false;
32
-
33
- /**
34
- * Whether the oct-encoded values are stored as ZXY instead of XYZ. This is true when decoding from Draco.
35
- *
36
- * @type {boolean}
37
- * @private
38
- */
39
- this.octEncodedZXY = false;
40
-
41
- /**
42
- * The range used to convert buffer values to normalized values [0.0, 1.0]
43
- * This is typically computed as (1 << quantizationBits) - 1.
44
- * For oct-encoded values this value is a single Number.
45
- *
46
- * @type {number|Cartesian2|Cartesian3|Cartesian4|Matrix2|Matrix3|Matrix4}
47
- * @private
48
- */
49
- this.normalizationRange = undefined;
50
-
51
- /**
52
- * The bottom-left corner of the quantization volume. Not applicable for oct encoded attributes.
53
- * The type should match the attribute type - e.g. if the attribute type
54
- * is AttributeType.VEC4 the offset should be a Cartesian4.
55
- *
56
- * @type {number|Cartesian2|Cartesian3|Cartesian4|Matrix2|Matrix3|Matrix4}
57
- * @private
58
- */
59
- this.quantizedVolumeOffset = undefined;
60
-
61
- /**
62
- * The dimensions of the quantization volume. Not applicable for oct encoded attributes.
63
- * The type should match the attribute type - e.g. if the attribute type
64
- * is AttributeType.VEC4 the dimensions should be a Cartesian4.
65
- *
66
- * @type {number|Cartesian2|Cartesian3|Cartesian4|Matrix2|Matrix3|Matrix4}
67
- * @private
68
- */
69
- this.quantizedVolumeDimensions = undefined;
70
-
71
- /**
72
- * The step size of the quantization volume, equal to
73
- * quantizedVolumeDimensions / normalizationRange (component-wise).
74
- * Not applicable for oct encoded attributes.
75
- * The type should match the attribute type - e.g. if the attribute type
76
- * is AttributeType.VEC4 the dimensions should be a Cartesian4.
77
- *
78
- * @type {number|Cartesian2|Cartesian3|Cartesian4|Matrix2|Matrix3|Matrix4}
79
- * @private
80
- */
81
- this.quantizedVolumeStepSize = undefined;
82
-
83
- /**
84
- * The component data type of the quantized attribute, e.g. ComponentDatatype.UNSIGNED_SHORT.
85
- *
86
- * <p>
87
- * The following component datatypes are not supported:
88
- * <ul>
89
- * <li>ComponentDatatype.INT</li>
90
- * <li>ComponentDatatype.UNSIGNED_INT</li>
91
- * <li>ComponentDatatype.DOUBLE</li>
92
- * </ul>
93
- * </p>
94
- *
95
- * @type {ComponentDatatype}
96
- * @private
97
- */
98
- this.componentDatatype = undefined;
99
-
100
- /**
101
- * The type of the quantized attribute, e.g. AttributeType.VEC2 for oct-encoded normals.
102
- *
103
- * @type {AttributeType}
104
- * @private
105
- */
106
- this.type = undefined;
107
- }
108
-
109
- /**
110
- * A per-vertex or per-instance attribute.
111
- *
112
- * @alias ModelComponents.Attribute
113
- * @constructor
114
- *
115
- * @private
116
- */
117
- function Attribute() {
118
- /**
119
- * The attribute name. Must be unique within the attributes array.
120
- *
121
- * @type {string}
122
- * @private
123
- */
124
- this.name = undefined;
125
-
126
- /**
127
- * The attribute semantic. The combination of semantic and setIndex must be
128
- * unique within the attributes array.
129
- *
130
- * @type {VertexAttributeSemantic|InstanceAttributeSemantic}
131
- * @private
132
- */
133
- this.semantic = undefined;
134
-
135
- /**
136
- * The set index of the attribute. Only applicable when the attribute has one
137
- * of the following semantics:
138
- *
139
- * <ul>
140
- * <li>{@link VertexAttributeSemantic.TEXCOORD}</li>
141
- * <li>{@link VertexAttributeSemantic.COLOR}</li>
142
- * <li>{@link VertexAttributeSemantic.JOINTS}</li>
143
- * <li>{@link VertexAttributeSemantic.WEIGHTS}</li>
144
- * <li>{@link VertexAttributeSemantic.FEATURE_ID}</li>
145
- * <li>{@link InstanceAttributeSemantic.FEATURE_ID}</li>
146
- * </ul>
147
- */
148
- this.setIndex = undefined;
149
-
150
- /**
151
- * The component data type of the attribute.
152
- * <p>
153
- * When the data is quantized the componentDatatype should match the
154
- * dequantized data, which is typically ComponentDatatype.FLOAT.
155
- * </p>
156
- * <p>
157
- * The following component datatypes are not supported:
158
- * <ul>
159
- * <li>ComponentDatatype.INT</li>
160
- * <li>ComponentDatatype.UNSIGNED_INT</li>
161
- * <li>ComponentDatatype.DOUBLE</li>
162
- * </ul>
163
- * </p>
164
- *
165
- * @type {ComponentDatatype}
166
- * @private
167
- */
168
- this.componentDatatype = undefined;
169
-
170
- /**
171
- * The type of the attribute.
172
- * <p>
173
- * When the data is oct-encoded the type should match the decoded data, which
174
- * is typically AttributeType.VEC3.
175
- * </p>
176
- *
177
- * @type {AttributeType}
178
- * @private
179
- */
180
- this.type = undefined;
181
-
182
- /**
183
- * Whether the attribute is normalized.
184
- *
185
- * @type {boolean}
186
- * @default false
187
- * @private
188
- */
189
- this.normalized = false;
190
-
191
- /**
192
- * The number of elements.
193
- *
194
- * @type {number}
195
- * @private
196
- */
197
- this.count = undefined;
198
-
199
- /**
200
- * Minimum value of each component in the attribute.
201
- * <p>
202
- * When the data is quantized the min should match the dequantized data.
203
- * The normalized property has no effect on these values.
204
- * </p>
205
- * <p>
206
- * Must be defined for POSITION attributes.
207
- * </p>
208
- *
209
- * @type {number|Cartesian2|Cartesian3|Cartesian4|Matrix2|Matrix3|Matrix4}
210
- * @private
211
- */
212
- this.min = undefined;
213
-
214
- /**
215
- * Maximum value of each component in the attribute.
216
- * <p>
217
- * When the data is quantized the max should match the dequantized data.
218
- * The normalized property has no effect on these values.
219
- * </p>
220
- * <p>
221
- * Must be defined for POSITION attributes.
222
- * </p>
223
- *
224
- * @type {number|Cartesian2|Cartesian3|Cartesian4|Matrix2|Matrix3|Matrix4}
225
- * @private
226
- */
227
- this.max = undefined;
228
-
229
- /**
230
- * A constant value used for all elements when typed array and buffer are undefined.
231
- *
232
- * @type {number|Cartesian2|Cartesian3|Cartesian4|Matrix2|Matrix3|Matrix4}
233
- * @private
234
- */
235
- this.constant = undefined;
236
-
237
- /**
238
- * Information about the quantized attribute.
239
- *
240
- * @type {ModelComponents.Quantization}
241
- * @private
242
- */
243
- this.quantization = undefined;
244
-
245
- /**
246
- * A typed array containing tightly-packed attribute values, as they appear
247
- * in the model file.
248
- *
249
- * @type {Uint8Array|Int8Array|Uint16Array|Int16Array|Uint32Array|Int32Array|Float32Array}
250
- * @private
251
- */
252
- this.typedArray = undefined;
253
-
254
- /**
255
- * A vertex buffer. Attribute values are accessed using byteOffset and byteStride.
256
- *
257
- * @type {Buffer}
258
- * @private
259
- */
260
- this.buffer = undefined;
261
-
262
- /**
263
- * The byte offset of elements in the buffer.
264
- *
265
- * @type {number}
266
- * @default 0
267
- * @private
268
- */
269
- this.byteOffset = 0;
270
-
271
- /**
272
- * The byte stride of elements in the buffer. When undefined the elements are tightly packed.
273
- *
274
- * @type {number}
275
- * @private
276
- */
277
- this.byteStride = undefined;
278
- }
279
-
280
- /**
281
- * Indices used to select vertices for rendering.
282
- *
283
- * @alias ModelComponents.Indices
284
- * @constructor
285
- *
286
- * @private
287
- */
288
- function Indices() {
289
- /**
290
- * The index data type of the attribute, e.g. IndexDatatype.UNSIGNED_SHORT.
291
- *
292
- * @type {IndexDatatype}
293
- * @private
294
- */
295
- this.indexDatatype = undefined;
296
-
297
- /**
298
- * The number of indices.
299
- *
300
- * @type {number}
301
- * @private
302
- */
303
- this.count = undefined;
304
-
305
- /**
306
- * An index buffer containing indices.
307
- *
308
- * @type {Buffer}
309
- * @private
310
- */
311
- this.buffer = undefined;
312
-
313
- /**
314
- * A typed array containing indices.
315
- *
316
- * @type {Uint8Array|Uint16Array|Uint32Array}
317
- * @private
318
- */
319
- this.typedArray = undefined;
320
- }
321
-
322
- /**
323
- * Maps per-vertex or per-instance feature IDs to a property table. Feature
324
- * IDs are stored in an accessor.
325
- *
326
- * @alias ModelComponents.FeatureIdAttribute
327
- * @constructor
328
- *
329
- * @private
330
- */
331
- function FeatureIdAttribute() {
332
- /**
333
- * How many unique features are defined in this set of feature IDs
334
- *
335
- * @type {number}
336
- * @private
337
- */
338
- this.featureCount = undefined;
339
-
340
- /**
341
- * This value indicates that no feature is indicated with this vertex
342
- *
343
- * @type {number}
344
- * @private
345
- */
346
- this.nullFeatureId = undefined;
347
-
348
- /**
349
- * The ID of the property table that feature IDs index into. If undefined,
350
- * feature IDs are used for classification, but no metadata is associated.
351
- *
352
- *
353
- * @type {number}
354
- * @private
355
- */
356
- this.propertyTableId = undefined;
357
-
358
- /**
359
- * The set index of feature ID attribute containing feature IDs.
360
- *
361
- * @type {number}
362
- * @private
363
- */
364
- this.setIndex = undefined;
365
-
366
- /**
367
- * The label to identify this set of feature IDs. This is used in picking,
368
- * styling and shaders.
369
- *
370
- * @type {string}
371
- * @private
372
- */
373
- this.label = undefined;
374
-
375
- /**
376
- * Label to identify this set of feature IDs by its position in the array.
377
- * This will always be either "featureId_N" for primitives or
378
- * "instanceFeatureId_N" for instances.
379
- *
380
- * @type {string}
381
- * @private
382
- */
383
- this.positionalLabel = undefined;
384
- }
385
-
386
- /**
387
- * Defines a range of implicitly-defined feature IDs, one for each vertex or
388
- * instance. Such feature IDs may optionally be associated with a property table
389
- * storing metadata
390
- *
391
- * @alias ModelComponents.FeatureIdImplicitRange
392
- * @constructor
393
- *
394
- * @private
395
- */
396
- function FeatureIdImplicitRange() {
397
- /**
398
- * How many unique features are defined in this set of feature IDs
399
- *
400
- * @type {number}
401
- * @private
402
- */
403
- this.featureCount = undefined;
404
-
405
- /**
406
- * This value indicates that no feature is indicated with this vertex
407
- *
408
- * @type {number}
409
- * @private
410
- */
411
- this.nullFeatureId = undefined;
412
-
413
- /**
414
- * The ID of the property table that feature IDs index into. If undefined,
415
- * feature IDs are used for classification, but no metadata is associated.
416
- *
417
- * @type {number}
418
- * @private
419
- */
420
- this.propertyTableId = undefined;
421
-
422
- /**
423
- * The first feature ID to use when setIndex is undefined
424
- *
425
- * @type {number}
426
- * @default 0
427
- * @private
428
- */
429
- this.offset = 0;
430
-
431
- /**
432
- * Number of times each feature ID is repeated before being incremented.
433
- *
434
- * @type {number}
435
- * @private
436
- */
437
- this.repeat = undefined;
438
-
439
- /**
440
- * The label to identify this set of feature IDs. This is used in picking,
441
- * styling and shaders.
442
- *
443
- * @type {string}
444
- * @private
445
- */
446
- this.label = undefined;
447
-
448
- /**
449
- * Label to identify this set of feature IDs by its position in the array.
450
- * This will always be either "featureId_N" for primitives or
451
- * "instanceFeatureId_N" for instances.
452
- *
453
- * @type {string}
454
- * @private
455
- */
456
- this.positionalLabel = undefined;
457
- }
458
-
459
- /**
460
- * A texture that contains per-texel feature IDs that index into a property table.
461
- *
462
- * @alias ModelComponents.FeatureIdTexture
463
- * @constructor
464
- *
465
- * @private
466
- */
467
- function FeatureIdTexture() {
468
- /**
469
- * How many unique features are defined in this set of feature IDs
470
- *
471
- * @type {number}
472
- * @private
473
- */
474
- this.featureCount = undefined;
475
-
476
- /**
477
- * This value indicates that no feature is indicated with this texel
478
- *
479
- * @type {number}
480
- * @private
481
- */
482
- this.nullFeatureId = undefined;
483
-
484
- /**
485
- * The ID of the property table that feature IDs index into. If undefined,
486
- * feature IDs are used for classification, but no metadata is associated.
487
- *
488
- * @type {string}
489
- * @private
490
- */
491
- this.propertyTableId = undefined;
492
-
493
- /**
494
- * The texture reader containing feature IDs.
495
- *
496
- * @type {ModelComponents.TextureReader}
497
- * @private
498
- */
499
- this.textureReader = undefined;
500
-
501
- /**
502
- * The label to identify this set of feature IDs. This is used in picking,
503
- * styling and shaders.
504
- *
505
- * @type {string}
506
- * @private
507
- */
508
- this.label = undefined;
509
-
510
- /**
511
- * Label to identify this set of feature IDs by its position in the array.
512
- * This will always be either "featureId_N" for primitives or
513
- * "instanceFeatureId_N" for instances.
514
- *
515
- * @type {string}
516
- * @private
517
- */
518
- this.positionalLabel = undefined;
519
- }
520
-
521
- /**
522
- * A morph target where each attribute contains attribute displacement data.
523
- *
524
- * @alias ModelComponents.MorphTarget
525
- * @constructor
526
- *
527
- * @private
528
- */
529
- function MorphTarget() {
530
- /**
531
- * Attributes that are part of the morph target, e.g. positions, normals, and tangents.
532
- *
533
- * @type {ModelComponents.Attribute[]}
534
- * @private
535
- */
536
- this.attributes = [];
537
- }
538
-
539
- /**
540
- * Geometry to be rendered with a material.
541
- *
542
- * @alias ModelComponents.Primitive
543
- * @constructor
544
- *
545
- * @private
40
+ * @ignore
546
41
  */
547
- function Primitive() {
548
- /**
549
- * The vertex attributes, e.g. positions, normals, etc.
550
- *
551
- * @type {ModelComponents.Attribute[]}
552
- * @private
553
- */
554
- this.attributes = [];
555
-
556
- /**
557
- * The morph targets.
558
- *
559
- * @type {ModelComponents.MorphTarget[]}
560
- * @private
561
- */
562
- this.morphTargets = [];
563
-
564
- /**
565
- * The indices.
566
- *
567
- * @type {ModelComponents.Indices}
568
- * @private
569
- */
570
- this.indices = undefined;
571
-
572
- /**
573
- * The material.
574
- *
575
- * @type {ModelComponents.Material}
576
- * @private
577
- */
578
- this.material = undefined;
579
-
580
- /**
581
- * The primitive type, e.g. PrimitiveType.TRIANGLES.
582
- *
583
- * @type {PrimitiveType}
584
- * @private
585
- */
586
- this.primitiveType = undefined;
587
-
588
- /**
589
- * The feature IDs associated with this primitive. Feature ID types may
590
- * be interleaved
591
- *
592
- * @type {Array<ModelComponents.FeatureIdAttribute|ModelComponents.FeatureIdImplicitRange|ModelComponents.FeatureIdTexture>}
593
- * @private
594
- */
595
- this.featureIds = [];
596
-
597
- /**
598
- * The property texture IDs. These indices correspond to the array of
599
- * property textures.
600
- *
601
- * @type {number[]}
602
- * @private
603
- */
604
- this.propertyTextureIds = [];
605
-
606
- /**
607
- * The property attribute IDs. These indices correspond to the array of
608
- * property attributes in the EXT_structural_metadata extension.
609
- *
610
- * @type {number[]}
611
- * @private
612
- */
613
- this.propertyAttributeIds = [];
614
-
615
- /**
616
- * If the CESIUM_primitive_outline glTF extension is used, this property
617
- * stores an additional attribute storing outline coordinates.
618
- *
619
- * @type {Attribute}
620
- * @private
621
- */
622
- this.outlineCoordinates = undefined;
623
-
624
- /**
625
- * If the model is part of a Model3DTileContent of a Cesium3DTileset that
626
- * has 'imageryLayers', then this will represent the information that is
627
- * required for draping the imagery over this primitive.
628
- *
629
- * @type {ModelPrimitiveImagery|undefined}
630
- * @private
631
- */
632
- this.modelPrimitiveImagery = undefined;
633
- }
634
-
635
- /**
636
- * Position and metadata information for instances of a node.
637
- *
638
- * @alias ModelComponents.Instances
639
- * @constructor
640
- *
641
- * @private
642
- */
643
- function Instances() {
644
- /**
645
- * The instance attributes, e.g. translation, rotation, scale, feature id, etc.
646
- *
647
- * @type {ModelComponents.Attribute[]}
648
- * @private
649
- */
650
- this.attributes = [];
651
-
652
- /**
653
- * The feature ID attributes associated with this set of instances.
654
- * Feature ID attribute types may be interleaved.
655
- *
656
- * @type {Array<ModelComponents.FeatureIdAttribute|ModelComponents.FeatureIdImplicitRange>}
657
- * @private
658
- */
659
- this.featureIds = [];
660
-
661
- /**
662
- * Whether the instancing transforms are applied in world space. For glTF models that
663
- * use EXT_mesh_gpu_instancing, the transform is applied in object space. For i3dm files,
664
- * the instance transform is in world space.
665
- *
666
- * @type {boolean}
667
- * @private
668
- */
669
- this.transformInWorldSpace = false;
670
- }
671
-
672
- /**
673
- * Joints and matrices defining a skin.
674
- *
675
- * @alias ModelComponents.Skin
676
- * @constructor
677
- *
678
- * @private
679
- */
680
- function Skin() {
681
- /**
682
- * The index of the skin in the glTF. This is useful for finding the skin
683
- * that applies to a node after the skin is instantiated at runtime.
684
- *
685
- * @type {number}
686
- * @private
687
- */
688
- this.index = undefined;
689
-
690
- /**
691
- * The joints.
692
- *
693
- * @type {ModelComponents.Node[]}
694
- * @private
695
- */
696
- this.joints = [];
697
-
698
- /**
699
- * The inverse bind matrices of the joints.
700
- *
701
- * @type {Matrix4[]}
702
- * @private
703
- */
704
- this.inverseBindMatrices = [];
705
- }
706
-
707
- /**
708
- * A node in the node hierarchy.
709
- *
710
- * @alias ModelComponents.Node
711
- * @constructor
712
- *
713
- * @private
714
- */
715
- function Node() {
716
- /**
717
- * The name of the node.
718
- *
719
- * @type {string}
720
- * @private
721
- */
722
- this.name = undefined;
723
-
724
- /**
725
- * The index of the node in the glTF. This is useful for finding the nodes
726
- * that belong to a skin after they have been instantiated at runtime.
727
- *
728
- * @type {number}
729
- * @private
730
- */
731
- this.index = undefined;
732
-
733
- /**
734
- * The children nodes.
735
- *
736
- * @type {ModelComponents.Node[]}
737
- * @private
738
- */
739
- this.children = [];
740
-
741
- /**
742
- * The mesh primitives.
743
- *
744
- * @type {ModelComponents.Primitive[]}
745
- * @private
746
- */
747
- this.primitives = [];
748
-
749
- /**
750
- * Instances of this node.
751
- *
752
- * @type {ModelComponents.Instances}
753
- * @private
754
- */
755
- this.instances = undefined;
756
-
757
- /**
758
- * The skin.
759
- *
760
- * @type {ModelComponents.Skin}
761
- * @private
762
- */
763
- this.skin = undefined;
764
-
765
- /**
766
- * The local transformation matrix. When matrix is defined translation,
767
- * rotation, and scale must be undefined. When matrix is undefined
768
- * translation, rotation, and scale must all be defined.
769
- *
770
- * @type {Matrix4}
771
- * @private
772
- */
773
- this.matrix = undefined;
774
-
775
- /**
776
- * The local translation.
777
- *
778
- * @type {Cartesian3}
779
- * @private
780
- */
781
- this.translation = undefined;
782
-
783
- /**
784
- * The local rotation.
785
- *
786
- * @type {Quaternion}
787
- * @private
788
- */
789
- this.rotation = undefined;
790
-
791
- /**
792
- * The local scale.
793
- *
794
- * @type {Cartesian3}
795
- * @private
796
- */
797
- this.scale = undefined;
798
-
799
- /**
800
- * An array of weights to be applied to the primitives' morph targets.
801
- * These are supplied by either the node or its mesh.
802
- *
803
- * @type {number[]}
804
- * @private
805
- */
806
- this.morphWeights = [];
807
-
808
- /**
809
- * The name of the articulation affecting this node, as defined by the
810
- * AGI_articulations extension.
811
- *
812
- * @type {string}
813
- * @private
814
- */
815
- this.articulationName = undefined;
816
- }
817
-
818
- /**
819
- * A scene containing nodes.
820
- *
821
- * @alias ModelComponents.Scene
822
- * @constructor
823
- *
824
- * @private
825
- */
826
- function Scene() {
827
- /**
828
- * The nodes belonging to the scene.
829
- *
830
- * @type {ModelComponents.Node[]}
831
- * @private
832
- */
833
- this.nodes = [];
834
- }
835
-
836
- /**
837
- * The property of the node that is targeted by an animation. The values of
838
- * this enum are used to look up the appropriate property on the runtime node.
839
- *
840
- * @alias {ModelComponents.AnimatedPropertyType}
841
- * @enum {string}
842
- *
843
- * @private
844
- */
845
- const AnimatedPropertyType = {
846
- TRANSLATION: "translation",
847
- ROTATION: "rotation",
848
- SCALE: "scale",
849
- WEIGHTS: "weights",
850
- };
851
-
852
- /**
853
- * An animation sampler that describes the sources of animated keyframe data
854
- * and their interpolation.
855
- *
856
- * @alias {ModelComponents.AnimationSampler}
857
- * @constructor
858
- *
859
- * @private
860
- */
861
- function AnimationSampler() {
862
- /**
863
- * The timesteps of the animation.
864
- *
865
- * @type {number[]}
866
- * @private
867
- */
868
- this.input = [];
869
-
870
- /**
871
- * The method used to interpolate between the animation's keyframe data.
872
- *
873
- * @type {InterpolationType}
874
- * @private
875
- */
876
- this.interpolation = undefined;
877
-
878
- /**
879
- * The keyframe data of the animation.
880
- *
881
- * @type {number[]|Cartesian3[]|Quaternion[]}
882
- * @private
883
- */
884
- this.output = [];
885
- }
886
-
887
- /**
888
- * An animation target, which specifies the node and property to animate.
889
- *
890
- * @alias {ModelComponents.AnimationTarget}
891
- * @constructor
892
- *
893
- * @private
894
- */
895
- function AnimationTarget() {
896
- /**
897
- * The node that will be affected by the animation.
898
- *
899
- * @type {ModelComponents.Node}
900
- * @private
901
- */
902
- this.node = undefined;
903
-
904
- /**
905
- * The property of the node to be animated.
906
- *
907
- * @type {ModelComponents.AnimatedPropertyType}
908
- * @private
909
- */
910
- this.path = undefined;
911
- }
912
-
913
- /**
914
- * An animation channel linking an animation sampler and the target it animates.
915
- *
916
- * @alias {ModelComponents.AnimationChannel}
917
- * @constructor
918
- *
919
- * @private
920
- */
921
- function AnimationChannel() {
922
- /**
923
- * The sampler used as the source of the animation data.
924
- *
925
- * @type {ModelComponents.AnimationSampler}
926
- * @private
927
- */
928
- this.sampler = undefined;
929
-
930
- /**
931
- * The target of the animation.
932
- *
933
- * @type {ModelComponents.AnimationTarget}
934
- * @private
935
- */
936
- this.target = undefined;
937
- }
938
-
939
- /**
940
- * An animation in the model.
941
- *
942
- * @alias {ModelComponents.Animation}
943
- * @constructor
944
- *
945
- * @private
946
- */
947
- function Animation() {
948
- /**
949
- * The name of the animation.
950
- *
951
- * @type {string}
952
- * @private
953
- */
954
- this.name = undefined;
955
-
956
- /**
957
- * The samplers used in this animation.
958
- *
959
- * @type {ModelComponents.AnimationSampler[]}
960
- * @private
961
- */
962
- this.samplers = [];
963
-
964
- /**
965
- * The channels used in this animation.
966
- *
967
- * @type {ModelComponents.AnimationChannel[]}
968
- * @private
969
- */
970
- this.channels = [];
971
- }
972
-
973
- /**
974
- * An articulation stage belonging to an articulation from the
975
- * AGI_articulations extension.
976
- *
977
- * @alias {ModelComponents.ArticulationStage}
978
- * @constructor
979
- *
980
- * @private
981
- */
982
- function ArticulationStage() {
983
- /**
984
- * The name of the articulation stage.
985
- *
986
- * @type {string}
987
- * @private
988
- */
989
- this.name = undefined;
990
-
991
- /**
992
- * The type of the articulation stage, defined by the type of motion it modifies.
993
- *
994
- * @type {ArticulationStageType}
995
- * @private
996
- */
997
- this.type = undefined;
998
-
999
- /**
1000
- * The minimum value for the range of motion of this articulation stage.
1001
- *
1002
- * @type {number}
1003
- * @private
1004
- */
1005
- this.minimumValue = undefined;
1006
-
1007
- /**
1008
- * The maximum value for the range of motion of this articulation stage.
1009
- *
1010
- * @type {number}
1011
- * @private
1012
- */
1013
- this.maximumValue = undefined;
1014
-
1015
- /**
1016
- * The initial value for this articulation stage.
1017
- *
1018
- * @type {number}
1019
- * @private
1020
- */
1021
- this.initialValue = undefined;
1022
- }
1023
-
1024
- /**
1025
- * An articulation for the model, as defined by the AGI_articulations extension.
1026
- *
1027
- * @alias {ModelComponents.Articulation}
1028
- * @constructor
1029
- *
1030
- * @private
1031
- */
1032
- function Articulation() {
1033
- /**
1034
- * The name of the articulation.
1035
- *
1036
- * @type {string}
1037
- * @private
1038
- */
1039
- this.name = undefined;
1040
-
1041
- /**
1042
- * The stages belonging to this articulation. The stages are applied to
1043
- * the model in order of appearance.
1044
- *
1045
- * @type {ModelComponents.ArticulationStage[]}
1046
- * @private
1047
- */
1048
- this.stages = [];
1049
- }
1050
-
1051
- /**
1052
- * The asset of the model.
1053
- *
1054
- * @alias {ModelComponents.Asset}
1055
- * @constructor
1056
- *
1057
- * @private
1058
- */
1059
- function Asset() {
1060
- /**
1061
- * The credits of the model.
1062
- *
1063
- * @type {Credit[]}
1064
- * @private
1065
- */
1066
- this.credits = [];
1067
- }
1068
-
1069
- /**
1070
- * The components that make up a model.
1071
- *
1072
- * @alias ModelComponents.Components
1073
- * @constructor
1074
- *
1075
- * @private
1076
- */
1077
- function Components() {
1078
- /**
1079
- * The asset of the model.
1080
- *
1081
- * @type {ModelComponents.Asset}
1082
- * @private
1083
- */
1084
- this.asset = new Asset();
1085
-
1086
- /**
1087
- * The default scene.
1088
- *
1089
- * @type {ModelComponents.Scene}
1090
- * @private
1091
- */
1092
- this.scene = undefined;
1093
-
1094
- /**
1095
- * All nodes in the model.
1096
- *
1097
- * @type {ModelComponents.Node[]}
1098
- */
1099
- this.nodes = [];
1100
-
1101
- /**
1102
- * All skins in the model.
1103
- *
1104
- * @type {ModelComponents.Skin[]}
1105
- */
1106
- this.skins = [];
1107
-
1108
- /**
1109
- * All animations in the model.
1110
- *
1111
- * @type {ModelComponents.Animation[]}
1112
- */
1113
- this.animations = [];
1114
-
1115
- /**
1116
- * All articulations in the model as defined by the AGI_articulations extension.
1117
- *
1118
- * @type {ModelComponents.Articulation[]}
1119
- */
1120
- this.articulations = [];
1121
-
1122
- /**
1123
- * Structural metadata containing the schema, property tables, property
1124
- * textures and property mappings
1125
- *
1126
- * @type {StructuralMetadata}
1127
- * @private
1128
- */
1129
- this.structuralMetadata = undefined;
1130
-
1131
- /**
1132
- * The model's up axis.
1133
- *
1134
- * @type {Axis}
1135
- * @private
1136
- */
1137
- this.upAxis = undefined;
1138
-
1139
- /**
1140
- * The model's forward axis.
1141
- *
1142
- * @type {Axis}
1143
- * @private
1144
- */
1145
- this.forwardAxis = undefined;
1146
-
1147
- /**
1148
- * A world-space transform to apply to the primitives.
1149
- *
1150
- * @type {Matrix4}
1151
- * @private
1152
- */
1153
- this.transform = Matrix4.clone(Matrix4.IDENTITY);
1154
-
1155
- /**
1156
- * A mapping from extension names like `"EXT_example_extension"` to
1157
- * the object that was created from the extension input
1158
- *
1159
- * @type {object}
1160
- * @private
1161
- */
1162
- this.extensions = {};
1163
- }
1164
-
1165
- /**
1166
- * Information about a GPU texture, including the texture itself
1167
- *
1168
- * @alias ModelComponents.TextureReader
1169
- * @constructor
1170
- *
1171
- * @private
1172
- */
1173
- function TextureReader() {
1174
- /**
1175
- * The underlying GPU texture. The {@link Texture} contains the sampler.
1176
- *
1177
- * @type {Texture}
1178
- * @private
1179
- */
1180
- this.texture = undefined;
1181
-
1182
- /**
1183
- * The index of the texture in the glTF. This is useful for determining
1184
- * when textures are shared to avoid attaching a texture in multiple uniform
1185
- * slots in the shader.
1186
- *
1187
- * @type {number}
1188
- * @private
1189
- */
1190
- this.index = undefined;
1191
-
1192
- /**
1193
- * The texture coordinate set.
1194
- *
1195
- * @type {number}
1196
- * @default 0
1197
- * @private
1198
- */
1199
- this.texCoord = 0;
1200
-
1201
- /**
1202
- * Transformation matrix to apply to texture coordinates.
1203
- *
1204
- * @type {Matrix3}
1205
- * @default Matrix3.IDENTITY
1206
- */
1207
- this.transform = Matrix3.clone(Matrix3.IDENTITY);
1208
-
1209
- /**
1210
- * Scale to apply to texture values.
1211
- *
1212
- * @type {number}
1213
- * @default 1.0
1214
- * @private
1215
- */
1216
- this.scale = 1.0;
1217
-
1218
- /**
1219
- * The texture channels to read from. When undefined all channels are read.
1220
- *
1221
- * @type {string}
1222
- */
1223
- this.channels = undefined;
42
+ export class Quantization {
43
+ constructor() {
44
+ /**
45
+ * Whether the quantized attribute is oct-encoded.
46
+ *
47
+ * @type {boolean}
48
+ * @ignore
49
+ */
50
+ this.octEncoded = false;
51
+
52
+ /**
53
+ * Whether the oct-encoded values are stored as ZXY instead of XYZ. This is true when decoding from Draco.
54
+ *
55
+ * @type {boolean}
56
+ * @ignore
57
+ */
58
+ this.octEncodedZXY = false;
59
+
60
+ /**
61
+ * The range used to convert buffer values to normalized values [0.0, 1.0]
62
+ * This is typically computed as (1 << quantizationBits) - 1.
63
+ * For oct-encoded values this value is a single Number.
64
+ *
65
+ * @type {number|Cartesian2|Cartesian3|Cartesian4|Matrix2|Matrix3|Matrix4}
66
+ * @ignore
67
+ */
68
+ this.normalizationRange = undefined;
69
+
70
+ /**
71
+ * The bottom-left corner of the quantization volume. Not applicable for oct encoded attributes.
72
+ * The type should match the attribute type - e.g. if the attribute type
73
+ * is AttributeType.VEC4 the offset should be a Cartesian4.
74
+ *
75
+ * @type {number|Cartesian2|Cartesian3|Cartesian4|Matrix2|Matrix3|Matrix4}
76
+ * @ignore
77
+ */
78
+ this.quantizedVolumeOffset = undefined;
79
+
80
+ /**
81
+ * The dimensions of the quantization volume. Not applicable for oct encoded attributes.
82
+ * The type should match the attribute type - e.g. if the attribute type
83
+ * is AttributeType.VEC4 the dimensions should be a Cartesian4.
84
+ *
85
+ * @type {number|Cartesian2|Cartesian3|Cartesian4|Matrix2|Matrix3|Matrix4}
86
+ * @ignore
87
+ */
88
+ this.quantizedVolumeDimensions = undefined;
89
+
90
+ /**
91
+ * The step size of the quantization volume, equal to
92
+ * quantizedVolumeDimensions / normalizationRange (component-wise).
93
+ * Not applicable for oct encoded attributes.
94
+ * The type should match the attribute type - e.g. if the attribute type
95
+ * is AttributeType.VEC4 the dimensions should be a Cartesian4.
96
+ *
97
+ * @type {number|Cartesian2|Cartesian3|Cartesian4|Matrix2|Matrix3|Matrix4}
98
+ * @ignore
99
+ */
100
+ this.quantizedVolumeStepSize = undefined;
101
+
102
+ /**
103
+ * The component data type of the quantized attribute, e.g. ComponentDatatype.UNSIGNED_SHORT.
104
+ *
105
+ * <p>
106
+ * The following component datatypes are not supported:
107
+ * <ul>
108
+ * <li>ComponentDatatype.INT</li>
109
+ * <li>ComponentDatatype.UNSIGNED_INT</li>
110
+ * <li>ComponentDatatype.DOUBLE</li>
111
+ * </ul>
112
+ * </p>
113
+ *
114
+ * @type {ComponentDatatype}
115
+ * @ignore
116
+ */
117
+ this.componentDatatype = undefined;
118
+
119
+ /**
120
+ * The type of the quantized attribute, e.g. AttributeType.VEC2 for oct-encoded normals.
121
+ *
122
+ * @type {AttributeType}
123
+ * @ignore
124
+ */
125
+ this.type = undefined;
126
+ }
1224
127
  }
1225
128
 
1226
129
  /**
1227
- * Material properties for the PBR metallic roughness shading model.
1228
- *
1229
- * @alias ModelComponents.MetallicRoughness
1230
- * @constructor
130
+ * A per-vertex or per-instance attribute.
1231
131
  *
1232
- * @private
132
+ * @ignore
1233
133
  */
1234
- function MetallicRoughness() {
1235
- /**
1236
- * The base color texture reader.
1237
- *
1238
- * @type {ModelComponents.TextureReader}
1239
- * @private
1240
- */
1241
- this.baseColorTexture = undefined;
1242
-
1243
- /**
1244
- * The metallic roughness texture reader.
1245
- *
1246
- * @type {ModelComponents.TextureReader}
1247
- * @private
1248
- */
1249
- this.metallicRoughnessTexture = undefined;
1250
-
1251
- /**
1252
- * The base color factor.
1253
- *
1254
- * @type {Cartesian4}
1255
- * @default new Cartesian4(1.0, 1.0, 1.0, 1.0)
1256
- * @private
1257
- */
1258
- this.baseColorFactor = Cartesian4.clone(
1259
- MetallicRoughness.DEFAULT_BASE_COLOR_FACTOR,
1260
- );
1261
-
1262
- /**
1263
- * The metallic factor.
1264
- *
1265
- * @type {number}
1266
- * @default 1.0
1267
- * @private
1268
- */
1269
- this.metallicFactor = MetallicRoughness.DEFAULT_METALLIC_FACTOR;
1270
-
1271
- /**
1272
- * The roughness factor.
1273
- *
1274
- * @type {number}
1275
- * @default 1.0
1276
- * @private
1277
- */
1278
- this.roughnessFactor = MetallicRoughness.DEFAULT_ROUGHNESS_FACTOR;
134
+ export class Attribute {
135
+ constructor() {
136
+ /**
137
+ * The attribute name. Must be unique within the attributes array.
138
+ *
139
+ * @type {string}
140
+ * @ignore
141
+ */
142
+ this.name = undefined;
143
+
144
+ /**
145
+ * The attribute semantic. The combination of semantic and setIndex must be
146
+ * unique within the attributes array.
147
+ *
148
+ * @type {VertexAttributeSemantic|InstanceAttributeSemantic}
149
+ * @ignore
150
+ */
151
+ this.semantic = undefined;
152
+
153
+ /**
154
+ * The set index of the attribute. Only applicable when the attribute has one
155
+ * of the following semantics:
156
+ *
157
+ * <ul>
158
+ * <li>{@link VertexAttributeSemantic.TEXCOORD}</li>
159
+ * <li>{@link VertexAttributeSemantic.COLOR}</li>
160
+ * <li>{@link VertexAttributeSemantic.JOINTS}</li>
161
+ * <li>{@link VertexAttributeSemantic.WEIGHTS}</li>
162
+ * <li>{@link VertexAttributeSemantic.FEATURE_ID}</li>
163
+ * <li>{@link InstanceAttributeSemantic.FEATURE_ID}</li>
164
+ * </ul>
165
+ */
166
+ this.setIndex = undefined;
167
+
168
+ /**
169
+ * The component data type of the attribute.
170
+ * <p>
171
+ * When the data is quantized the componentDatatype should match the
172
+ * dequantized data, which is typically ComponentDatatype.FLOAT.
173
+ * </p>
174
+ * <p>
175
+ * The following component datatypes are not supported:
176
+ * <ul>
177
+ * <li>ComponentDatatype.INT</li>
178
+ * <li>ComponentDatatype.UNSIGNED_INT</li>
179
+ * <li>ComponentDatatype.DOUBLE</li>
180
+ * </ul>
181
+ * </p>
182
+ *
183
+ * @type {ComponentDatatype}
184
+ * @ignore
185
+ */
186
+ this.componentDatatype = undefined;
187
+
188
+ /**
189
+ * The type of the attribute.
190
+ * <p>
191
+ * When the data is oct-encoded the type should match the decoded data, which
192
+ * is typically AttributeType.VEC3.
193
+ * </p>
194
+ *
195
+ * @type {AttributeType}
196
+ * @ignore
197
+ */
198
+ this.type = undefined;
199
+
200
+ /**
201
+ * Whether the attribute is normalized.
202
+ *
203
+ * @type {boolean}
204
+ * @default false
205
+ * @ignore
206
+ */
207
+ this.normalized = false;
208
+
209
+ /**
210
+ * The number of elements.
211
+ *
212
+ * @type {number}
213
+ * @ignore
214
+ */
215
+ this.count = undefined;
216
+
217
+ /**
218
+ * Minimum value of each component in the attribute.
219
+ * <p>
220
+ * When the data is quantized the min should match the dequantized data.
221
+ * The normalized property has no effect on these values.
222
+ * </p>
223
+ * <p>
224
+ * Must be defined for POSITION attributes.
225
+ * </p>
226
+ *
227
+ * @type {number|Cartesian2|Cartesian3|Cartesian4|Matrix2|Matrix3|Matrix4}
228
+ * @ignore
229
+ */
230
+ this.min = undefined;
231
+
232
+ /**
233
+ * Maximum value of each component in the attribute.
234
+ * <p>
235
+ * When the data is quantized the max should match the dequantized data.
236
+ * The normalized property has no effect on these values.
237
+ * </p>
238
+ * <p>
239
+ * Must be defined for POSITION attributes.
240
+ * </p>
241
+ *
242
+ * @type {number|Cartesian2|Cartesian3|Cartesian4|Matrix2|Matrix3|Matrix4}
243
+ * @ignore
244
+ */
245
+ this.max = undefined;
246
+
247
+ /**
248
+ * A constant value used for all elements when typed array and buffer are undefined.
249
+ *
250
+ * @type {number|Cartesian2|Cartesian3|Cartesian4|Matrix2|Matrix3|Matrix4}
251
+ * @ignore
252
+ */
253
+ this.constant = undefined;
254
+
255
+ /**
256
+ * Information about the quantized attribute.
257
+ *
258
+ * @type {Quantization}
259
+ * @ignore
260
+ */
261
+ this.quantization = undefined;
262
+
263
+ /**
264
+ * A typed array containing tightly-packed attribute values, as they appear
265
+ * in the model file.
266
+ *
267
+ * @type {Uint8Array|Int8Array|Uint16Array|Int16Array|Uint32Array|Int32Array|Float32Array}
268
+ * @ignore
269
+ */
270
+ this.typedArray = undefined;
271
+
272
+ /**
273
+ * A vertex buffer. Attribute values are accessed using byteOffset and byteStride.
274
+ *
275
+ * @type {Buffer}
276
+ * @ignore
277
+ */
278
+ this.buffer = undefined;
279
+
280
+ /**
281
+ * The byte offset of elements in the buffer.
282
+ *
283
+ * @type {number}
284
+ * @default 0
285
+ * @ignore
286
+ */
287
+ this.byteOffset = 0;
288
+
289
+ /**
290
+ * The byte stride of elements in the buffer. When undefined the elements are tightly packed.
291
+ *
292
+ * @type {number}
293
+ * @ignore
294
+ */
295
+ this.byteStride = undefined;
296
+ }
1279
297
  }
1280
298
 
1281
299
  /**
1282
- * @private
300
+ * Indices used to select vertices for rendering.
301
+ *
302
+ * @ignore
1283
303
  */
1284
- MetallicRoughness.DEFAULT_BASE_COLOR_FACTOR = Cartesian4.ONE;
304
+ export class Indices {
305
+ constructor() {
306
+ /**
307
+ * The index data type of the attribute, e.g. IndexDatatype.UNSIGNED_SHORT.
308
+ *
309
+ * @type {IndexDatatype}
310
+ * @ignore
311
+ */
312
+ this.indexDatatype = undefined;
313
+
314
+ /**
315
+ * The number of indices.
316
+ *
317
+ * @type {number}
318
+ * @ignore
319
+ */
320
+ this.count = undefined;
321
+
322
+ /**
323
+ * An index buffer containing indices.
324
+ *
325
+ * @type {Buffer}
326
+ * @ignore
327
+ */
328
+ this.buffer = undefined;
329
+
330
+ /**
331
+ * A typed array containing indices.
332
+ *
333
+ * @type {Uint8Array|Uint16Array|Uint32Array}
334
+ * @ignore
335
+ */
336
+ this.typedArray = undefined;
337
+ }
338
+ }
1285
339
 
1286
340
  /**
1287
- * @private
341
+ * Maps per-vertex or per-instance feature IDs to a property table. Feature
342
+ * IDs are stored in an accessor.
343
+ *
344
+ * @ignore
1288
345
  */
1289
- MetallicRoughness.DEFAULT_METALLIC_FACTOR = 1.0;
346
+ export class FeatureIdAttribute {
347
+ constructor() {
348
+ /**
349
+ * How many unique features are defined in this set of feature IDs
350
+ *
351
+ * @type {number}
352
+ * @ignore
353
+ */
354
+ this.featureCount = undefined;
355
+
356
+ /**
357
+ * This value indicates that no feature is indicated with this vertex
358
+ *
359
+ * @type {number}
360
+ * @ignore
361
+ */
362
+ this.nullFeatureId = undefined;
363
+
364
+ /**
365
+ * The ID of the property table that feature IDs index into. If undefined,
366
+ * feature IDs are used for classification, but no metadata is associated.
367
+ *
368
+ *
369
+ * @type {number}
370
+ * @ignore
371
+ */
372
+ this.propertyTableId = undefined;
373
+
374
+ /**
375
+ * The set index of feature ID attribute containing feature IDs.
376
+ *
377
+ * @type {number}
378
+ * @ignore
379
+ */
380
+ this.setIndex = undefined;
381
+
382
+ /**
383
+ * The label to identify this set of feature IDs. This is used in picking,
384
+ * styling and shaders.
385
+ *
386
+ * @type {string}
387
+ * @ignore
388
+ */
389
+ this.label = undefined;
390
+
391
+ /**
392
+ * Label to identify this set of feature IDs by its position in the array.
393
+ * This will always be either "featureId_N" for primitives or
394
+ * "instanceFeatureId_N" for instances.
395
+ *
396
+ * @type {string}
397
+ * @ignore
398
+ */
399
+ this.positionalLabel = undefined;
400
+ }
401
+ }
1290
402
 
1291
403
  /**
1292
- * @private
404
+ * Defines a range of implicitly-defined feature IDs, one for each vertex or
405
+ * instance. Such feature IDs may optionally be associated with a property table
406
+ * storing metadata
407
+ *
408
+ * @ignore
1293
409
  */
1294
- MetallicRoughness.DEFAULT_ROUGHNESS_FACTOR = 1.0;
410
+ export class FeatureIdImplicitRange {
411
+ constructor() {
412
+ /**
413
+ * How many unique features are defined in this set of feature IDs
414
+ *
415
+ * @type {number}
416
+ * @ignore
417
+ */
418
+ this.featureCount = undefined;
419
+
420
+ /**
421
+ * This value indicates that no feature is indicated with this vertex
422
+ *
423
+ * @type {number}
424
+ * @ignore
425
+ */
426
+ this.nullFeatureId = undefined;
427
+
428
+ /**
429
+ * The ID of the property table that feature IDs index into. If undefined,
430
+ * feature IDs are used for classification, but no metadata is associated.
431
+ *
432
+ * @type {number}
433
+ * @ignore
434
+ */
435
+ this.propertyTableId = undefined;
436
+
437
+ /**
438
+ * The first feature ID to use when setIndex is undefined
439
+ *
440
+ * @type {number}
441
+ * @default 0
442
+ * @ignore
443
+ */
444
+ this.offset = 0;
445
+
446
+ /**
447
+ * Number of times each feature ID is repeated before being incremented.
448
+ *
449
+ * @type {number}
450
+ * @ignore
451
+ */
452
+ this.repeat = undefined;
453
+
454
+ /**
455
+ * The label to identify this set of feature IDs. This is used in picking,
456
+ * styling and shaders.
457
+ *
458
+ * @type {string}
459
+ * @ignore
460
+ */
461
+ this.label = undefined;
462
+
463
+ /**
464
+ * Label to identify this set of feature IDs by its position in the array.
465
+ * This will always be either "featureId_N" for primitives or
466
+ * "instanceFeatureId_N" for instances.
467
+ *
468
+ * @type {string}
469
+ * @ignore
470
+ */
471
+ this.positionalLabel = undefined;
472
+ }
473
+ }
1295
474
 
1296
475
  /**
1297
- * Material properties for the PBR specular glossiness shading model.
1298
- *
1299
- * @alias ModelComponents.SpecularGlossiness
1300
- * @constructor
476
+ * A texture that contains per-texel feature IDs that index into a property table.
1301
477
  *
1302
- * @private
478
+ * @ignore
1303
479
  */
1304
- function SpecularGlossiness() {
1305
- /**
1306
- * The diffuse texture reader.
1307
- *
1308
- * @type {ModelComponents.TextureReader}
1309
- * @private
1310
- */
1311
- this.diffuseTexture = undefined;
1312
-
1313
- /**
1314
- * The specular glossiness texture reader.
1315
- *
1316
- * @type {ModelComponents.TextureReader}
1317
- * @private
1318
- */
1319
- this.specularGlossinessTexture = undefined;
1320
-
1321
- /**
1322
- * The diffuse factor.
1323
- *
1324
- * @type {Cartesian4}
1325
- * @default new Cartesian4(1.0, 1.0, 1.0, 1.0)
1326
- * @private
1327
- */
1328
- this.diffuseFactor = Cartesian4.clone(
1329
- SpecularGlossiness.DEFAULT_DIFFUSE_FACTOR,
1330
- );
1331
-
1332
- /**
1333
- * The specular factor.
1334
- *
1335
- * @type {Cartesian3}
1336
- * @default new Cartesian3(1.0, 1.0, 1.0)
1337
- * @private
1338
- */
1339
- this.specularFactor = Cartesian3.clone(
1340
- SpecularGlossiness.DEFAULT_SPECULAR_FACTOR,
1341
- );
1342
-
1343
- /**
1344
- * The glossiness factor.
1345
- *
1346
- * @type {number}
1347
- * @default 1.0
1348
- * @private
1349
- */
1350
- this.glossinessFactor = SpecularGlossiness.DEFAULT_GLOSSINESS_FACTOR;
480
+ export class FeatureIdTexture {
481
+ constructor() {
482
+ /**
483
+ * How many unique features are defined in this set of feature IDs
484
+ *
485
+ * @type {number}
486
+ * @ignore
487
+ */
488
+ this.featureCount = undefined;
489
+
490
+ /**
491
+ * This value indicates that no feature is indicated with this texel
492
+ *
493
+ * @type {number}
494
+ * @ignore
495
+ */
496
+ this.nullFeatureId = undefined;
497
+
498
+ /**
499
+ * The ID of the property table that feature IDs index into. If undefined,
500
+ * feature IDs are used for classification, but no metadata is associated.
501
+ *
502
+ * @type {string}
503
+ * @ignore
504
+ */
505
+ this.propertyTableId = undefined;
506
+
507
+ /**
508
+ * The texture reader containing feature IDs.
509
+ *
510
+ * @type {TextureReader}
511
+ * @ignore
512
+ */
513
+ this.textureReader = undefined;
514
+
515
+ /**
516
+ * The label to identify this set of feature IDs. This is used in picking,
517
+ * styling and shaders.
518
+ *
519
+ * @type {string}
520
+ * @ignore
521
+ */
522
+ this.label = undefined;
523
+
524
+ /**
525
+ * Label to identify this set of feature IDs by its position in the array.
526
+ * This will always be either "featureId_N" for primitives or
527
+ * "instanceFeatureId_N" for instances.
528
+ *
529
+ * @type {string}
530
+ * @ignore
531
+ */
532
+ this.positionalLabel = undefined;
533
+ }
1351
534
  }
1352
535
 
1353
536
  /**
1354
- * @private
537
+ * A morph target where each attribute contains attribute displacement data.
538
+ *
539
+ * @ignore
1355
540
  */
1356
- SpecularGlossiness.DEFAULT_DIFFUSE_FACTOR = Cartesian4.ONE;
541
+ export class MorphTarget {
542
+ constructor() {
543
+ /**
544
+ * Attributes that are part of the morph target, e.g. positions, normals, and tangents.
545
+ *
546
+ * @type {Attribute[]}
547
+ * @ignore
548
+ */
549
+ this.attributes = [];
550
+ }
551
+ }
1357
552
 
1358
553
  /**
1359
- * @private
554
+ * Geometry to be rendered with a material.
555
+ *
556
+ * @ignore
1360
557
  */
1361
- SpecularGlossiness.DEFAULT_SPECULAR_FACTOR = Cartesian3.ONE;
558
+ export class Primitive {
559
+ constructor() {
560
+ /**
561
+ * The vertex attributes, e.g. positions, normals, etc.
562
+ *
563
+ * @type {Attribute[]}
564
+ * @ignore
565
+ */
566
+ this.attributes = [];
567
+
568
+ /**
569
+ * The morph targets.
570
+ *
571
+ * @type {MorphTarget[]}
572
+ * @ignore
573
+ */
574
+ this.morphTargets = [];
575
+
576
+ /**
577
+ * The indices.
578
+ *
579
+ * @type {Indices}
580
+ * @ignore
581
+ */
582
+ this.indices = undefined;
583
+
584
+ /**
585
+ * The material.
586
+ *
587
+ * @type {Material}
588
+ * @ignore
589
+ */
590
+ this.material = undefined;
591
+
592
+ /**
593
+ * The primitive type, e.g. PrimitiveType.TRIANGLES.
594
+ *
595
+ * @type {PrimitiveType}
596
+ * @ignore
597
+ */
598
+ this.primitiveType = undefined;
599
+
600
+ /**
601
+ * The CESIUM_mesh_vector extension data for this primitive.
602
+ *
603
+ * @type {Vector}
604
+ * @ignore
605
+ */
606
+ this.vector = undefined;
607
+
608
+ /**
609
+ * The feature IDs associated with this primitive. Feature ID types may
610
+ * be interleaved
611
+ *
612
+ * @type {Array<FeatureIdAttribute|FeatureIdImplicitRange|FeatureIdTexture>}
613
+ * @ignore
614
+ */
615
+ this.featureIds = [];
616
+
617
+ /**
618
+ * The property texture IDs. These indices correspond to the array of
619
+ * property textures.
620
+ *
621
+ * @type {number[]}
622
+ * @ignore
623
+ */
624
+ this.propertyTextureIds = [];
625
+
626
+ /**
627
+ * The property attribute IDs. These indices correspond to the array of
628
+ * property attributes in the EXT_structural_metadata extension.
629
+ *
630
+ * @type {number[]}
631
+ * @ignore
632
+ */
633
+ this.propertyAttributeIds = [];
634
+
635
+ /**
636
+ * If the CESIUM_primitive_outline glTF extension is used, this property
637
+ * stores an additional attribute storing outline coordinates.
638
+ *
639
+ * @type {Attribute}
640
+ * @ignore
641
+ */
642
+ this.outlineCoordinates = undefined;
643
+
644
+ /**
645
+ * If the model is part of a Model3DTileContent of a Cesium3DTileset that
646
+ * has 'imageryLayers', then this will represent the information that is
647
+ * required for draping the imagery over this primitive.
648
+ *
649
+ * @type {ModelPrimitiveImagery|undefined}
650
+ * @ignore
651
+ */
652
+ this.modelPrimitiveImagery = undefined;
653
+
654
+ /**
655
+ * Data loaded from the EXT_mesh_primitive_edge_visibility extension.
656
+ *
657
+ * @type {Object}
658
+ * @ignore
659
+ */
660
+ this.edgeVisibility = undefined;
661
+ }
662
+ }
1362
663
 
1363
664
  /**
1364
- * @private
665
+ * Position and metadata information for instances of a node.
666
+ *
667
+ * @ignore
1365
668
  */
1366
- SpecularGlossiness.DEFAULT_GLOSSINESS_FACTOR = 1.0;
1367
-
1368
- function Specular() {
1369
- /**
1370
- * The specular factor.
1371
- *
1372
- * @type {number}
1373
- * @default 1.0
1374
- * @private
1375
- */
1376
- this.specularFactor = Specular.DEFAULT_SPECULAR_FACTOR;
1377
-
1378
- /**
1379
- * The specular texture reader.
1380
- *
1381
- * @type {ModelComponents.TextureReader}
1382
- * @private
1383
- */
1384
- this.specularTexture = undefined;
1385
-
1386
- /**
1387
- * The specular color factor.
1388
- *
1389
- * @type {Cartesian3}
1390
- * @default new Cartesian3(1.0, 1.0, 1.0)
1391
- * @private
1392
- */
1393
- this.specularColorFactor = Cartesian3.clone(
1394
- Specular.DEFAULT_SPECULAR_COLOR_FACTOR,
1395
- );
1396
-
1397
- /**
1398
- * The specular color texture reader.
1399
- *
1400
- * @type {ModelComponents.TextureReader}
1401
- * @private
1402
- */
1403
- this.specularColorTexture = undefined;
669
+ export class Instances {
670
+ constructor() {
671
+ /**
672
+ * The instance attributes, e.g. translation, rotation, scale, feature id, etc.
673
+ *
674
+ * @type {Attribute[]}
675
+ * @ignore
676
+ */
677
+ this.attributes = [];
678
+
679
+ /**
680
+ * The feature ID attributes associated with this set of instances.
681
+ * Feature ID attribute types may be interleaved.
682
+ *
683
+ * @type {Array<ModelComponents.FeatureIdAttribute|ModelComponents.FeatureIdImplicitRange>}
684
+ * @ignore
685
+ */
686
+ this.featureIds = [];
687
+
688
+ /**
689
+ * Whether the instancing transforms are applied in world space. For glTF models that
690
+ * use EXT_mesh_gpu_instancing, the transform is applied in object space. For i3dm files,
691
+ * the instance transform is in world space.
692
+ *
693
+ * @type {boolean}
694
+ * @ignore
695
+ */
696
+ this.transformInWorldSpace = false;
697
+ }
1404
698
  }
1405
699
 
1406
700
  /**
1407
- * @private
701
+ * Joints and matrices defining a skin.
702
+ *
703
+ * @ignore
1408
704
  */
1409
- Specular.DEFAULT_SPECULAR_FACTOR = 1.0;
705
+ export class Skin {
706
+ constructor() {
707
+ /**
708
+ * The index of the skin in the glTF. This is useful for finding the skin
709
+ * that applies to a node after the skin is instantiated at runtime.
710
+ *
711
+ * @type {number}
712
+ * @ignore
713
+ */
714
+ this.index = undefined;
715
+
716
+ /**
717
+ * The joints.
718
+ *
719
+ * @type {Node[]}
720
+ * @ignore
721
+ */
722
+ this.joints = [];
723
+
724
+ /**
725
+ * The inverse bind matrices of the joints.
726
+ *
727
+ * @type {Matrix4[]}
728
+ * @ignore
729
+ */
730
+ this.inverseBindMatrices = [];
731
+ }
732
+ }
1410
733
 
1411
734
  /**
1412
- * @private
735
+ * A node in the node hierarchy.
736
+ *
737
+ * @ignore
1413
738
  */
1414
- Specular.DEFAULT_SPECULAR_COLOR_FACTOR = Cartesian3.ONE;
1415
-
1416
- function Anisotropy() {
1417
- /**
1418
- * The anisotropy strength.
1419
- *
1420
- * @type {number}
1421
- * @default 0.0
1422
- * @private
1423
- */
1424
- this.anisotropyStrength = Anisotropy.DEFAULT_ANISOTROPY_STRENGTH;
1425
-
1426
- /**
1427
- * The rotation of the anisotropy in tangent, bitangent space,
1428
- * measured in radians counter-clockwise from the tangent.
1429
- *
1430
- * @type {number}
1431
- * @default 0.0
1432
- * @private
1433
- */
1434
- this.anisotropyRotation = Anisotropy.DEFAULT_ANISOTROPY_ROTATION;
739
+ export class Node {
740
+ constructor() {
741
+ /**
742
+ * The name of the node.
743
+ *
744
+ * @type {string}
745
+ * @ignore
746
+ */
747
+ this.name = undefined;
748
+
749
+ /**
750
+ * The index of the node in the glTF. This is useful for finding the nodes
751
+ * that belong to a skin after they have been instantiated at runtime.
752
+ *
753
+ * @type {number}
754
+ * @ignore
755
+ */
756
+ this.index = undefined;
757
+
758
+ /**
759
+ * The children nodes.
760
+ *
761
+ * @type {Node[]}
762
+ * @ignore
763
+ */
764
+ this.children = [];
765
+
766
+ /**
767
+ * The mesh primitives.
768
+ *
769
+ * @type {Primitive[]}
770
+ * @ignore
771
+ */
772
+ this.primitives = [];
773
+
774
+ /**
775
+ * Instances of this node.
776
+ *
777
+ * @type {Instances}
778
+ * @ignore
779
+ */
780
+ this.instances = undefined;
781
+
782
+ /**
783
+ * The skin.
784
+ *
785
+ * @type {Skin}
786
+ * @ignore
787
+ */
788
+ this.skin = undefined;
789
+
790
+ /**
791
+ * The local transformation matrix. When matrix is defined translation,
792
+ * rotation, and scale must be undefined. When matrix is undefined
793
+ * translation, rotation, and scale must all be defined.
794
+ *
795
+ * @type {Matrix4}
796
+ * @ignore
797
+ */
798
+ this.matrix = undefined;
799
+
800
+ /**
801
+ * The local translation.
802
+ *
803
+ * @type {Cartesian3}
804
+ * @ignore
805
+ */
806
+ this.translation = undefined;
807
+
808
+ /**
809
+ * The local rotation.
810
+ *
811
+ * @type {Quaternion}
812
+ * @ignore
813
+ */
814
+ this.rotation = undefined;
815
+
816
+ /**
817
+ * The local scale.
818
+ *
819
+ * @type {Cartesian3}
820
+ * @ignore
821
+ */
822
+ this.scale = undefined;
823
+
824
+ /**
825
+ * An array of weights to be applied to the primitives' morph targets.
826
+ * These are supplied by either the node or its mesh.
827
+ *
828
+ * @type {number[]}
829
+ * @ignore
830
+ */
831
+ this.morphWeights = [];
832
+
833
+ /**
834
+ * The name of the articulation affecting this node, as defined by the
835
+ * AGI_articulations extension.
836
+ *
837
+ * @type {string}
838
+ * @ignore
839
+ */
840
+ this.articulationName = undefined;
841
+
842
+ /**
843
+ * The CESIUM_mesh_vector extension data for this node.
844
+ *
845
+ * @type {object}
846
+ * @ignore
847
+ */
848
+ this.meshVector = undefined;
849
+ }
850
+ }
1435
851
 
1436
- /**
1437
- * The anisotropy texture reader.
1438
- *
1439
- * @type {ModelComponents.TextureReader}
1440
- * @private
1441
- */
1442
- this.anisotropyTexture = undefined;
852
+ /**
853
+ * A scene containing nodes.
854
+ *
855
+ * @ignore
856
+ */
857
+ export class Scene {
858
+ constructor() {
859
+ /**
860
+ * The nodes belonging to the scene.
861
+ *
862
+ * @type {Node[]}
863
+ * @ignore
864
+ */
865
+ this.nodes = [];
866
+ }
1443
867
  }
1444
868
 
1445
869
  /**
1446
- * @private
870
+ * The property of the node that is targeted by an animation. The values of
871
+ * this enum are used to look up the appropriate property on the runtime node.
872
+ *
873
+ * @enum {string}
874
+ *
875
+ * @ignore
1447
876
  */
1448
- Anisotropy.DEFAULT_ANISOTROPY_STRENGTH = 0.0;
877
+ export const AnimatedPropertyType = {
878
+ TRANSLATION: "translation",
879
+ ROTATION: "rotation",
880
+ SCALE: "scale",
881
+ WEIGHTS: "weights",
882
+ };
1449
883
 
1450
884
  /**
1451
- * @private
885
+ * An animation sampler that describes the sources of animated keyframe data
886
+ * and their interpolation.
887
+ *
888
+ * @ignore
1452
889
  */
1453
- Anisotropy.DEFAULT_ANISOTROPY_ROTATION = 0.0;
890
+ export class AnimationSampler {
891
+ constructor() {
892
+ /**
893
+ * The timesteps of the animation.
894
+ *
895
+ * @type {number[]}
896
+ * @ignore
897
+ */
898
+ this.input = [];
899
+
900
+ /**
901
+ * The method used to interpolate between the animation's keyframe data.
902
+ *
903
+ * @type {InterpolationType}
904
+ * @ignore
905
+ */
906
+ this.interpolation = undefined;
907
+
908
+ /**
909
+ * The keyframe data of the animation.
910
+ *
911
+ * @type {number[]|Cartesian3[]|Quaternion[]}
912
+ * @ignore
913
+ */
914
+ this.output = [];
915
+ }
916
+ }
1454
917
 
1455
- function Clearcoat() {
1456
- /**
1457
- * The clearcoat layer intensity.
1458
- *
1459
- * @type {number}
1460
- * @default 0.0
1461
- * @private
1462
- */
1463
- this.clearcoatFactor = Clearcoat.DEFAULT_CLEARCOAT_FACTOR;
918
+ /**
919
+ * An animation target, which specifies the node and property to animate.
920
+ *
921
+ * @ignore
922
+ */
923
+ export class AnimationTarget {
924
+ constructor() {
925
+ /**
926
+ * The node that will be affected by the animation.
927
+ *
928
+ * @type {Node}
929
+ * @ignore
930
+ */
931
+ this.node = undefined;
932
+
933
+ /**
934
+ * The property of the node to be animated.
935
+ *
936
+ * @type {AnimatedPropertyType}
937
+ * @ignore
938
+ */
939
+ this.path = undefined;
940
+ }
941
+ }
1464
942
 
1465
- /**
1466
- * The clearcoat layer intensity texture reader.
1467
- *
1468
- * @type {ModelComponents.TextureReader}
1469
- * @private
1470
- */
1471
- this.clearcoatTexture = undefined;
943
+ /**
944
+ * An animation channel linking an animation sampler and the target it animates.
945
+ *
946
+ * @ignore
947
+ */
948
+ export class AnimationChannel {
949
+ constructor() {
950
+ /**
951
+ * The sampler used as the source of the animation data.
952
+ *
953
+ * @type {AnimationSampler}
954
+ * @ignore
955
+ */
956
+ this.sampler = undefined;
957
+
958
+ /**
959
+ * The target of the animation.
960
+ *
961
+ * @type {AnimationTarget}
962
+ * @ignore
963
+ */
964
+ this.target = undefined;
965
+ }
966
+ }
1472
967
 
1473
- /**
1474
- * The clearcoat layer roughness.
1475
- *
1476
- * @type {number}
1477
- * @default 0.0
1478
- * @private
1479
- */
1480
- this.clearcoatRoughnessFactor = Clearcoat.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR;
968
+ /**
969
+ * An animation in the model.
970
+ *
971
+ * @ignore
972
+ */
973
+ export class Animation {
974
+ constructor() {
975
+ /**
976
+ * The name of the animation.
977
+ *
978
+ * @type {string}
979
+ * @ignore
980
+ */
981
+ this.name = undefined;
982
+
983
+ /**
984
+ * The samplers used in this animation.
985
+ *
986
+ * @type {AnimationSampler[]}
987
+ * @ignore
988
+ */
989
+ this.samplers = [];
990
+
991
+ /**
992
+ * The channels used in this animation.
993
+ *
994
+ * @type {AnimationChannel[]}
995
+ * @ignore
996
+ */
997
+ this.channels = [];
998
+ }
999
+ }
1481
1000
 
1482
- /**
1483
- * The clearcoat layer roughness texture.
1484
- *
1485
- * @type {ModelComponents.TextureReader}
1486
- * @private
1487
- */
1488
- this.clearcoatRoughnessTexture = undefined;
1001
+ /**
1002
+ * An articulation stage belonging to an articulation from the
1003
+ * AGI_articulations extension.
1004
+ *
1005
+ * @ignore
1006
+ */
1007
+ export class ArticulationStage {
1008
+ constructor() {
1009
+ /**
1010
+ * The name of the articulation stage.
1011
+ *
1012
+ * @type {string}
1013
+ * @ignore
1014
+ */
1015
+ this.name = undefined;
1016
+
1017
+ /**
1018
+ * The type of the articulation stage, defined by the type of motion it modifies.
1019
+ *
1020
+ * @type {ArticulationStageType}
1021
+ * @ignore
1022
+ */
1023
+ this.type = undefined;
1024
+
1025
+ /**
1026
+ * The minimum value for the range of motion of this articulation stage.
1027
+ *
1028
+ * @type {number}
1029
+ * @ignore
1030
+ */
1031
+ this.minimumValue = undefined;
1032
+
1033
+ /**
1034
+ * The maximum value for the range of motion of this articulation stage.
1035
+ *
1036
+ * @type {number}
1037
+ * @ignore
1038
+ */
1039
+ this.maximumValue = undefined;
1040
+
1041
+ /**
1042
+ * The initial value for this articulation stage.
1043
+ *
1044
+ * @type {number}
1045
+ * @ignore
1046
+ */
1047
+ this.initialValue = undefined;
1048
+ }
1049
+ }
1489
1050
 
1490
- /**
1491
- * The clearcoat normal map texture.
1492
- *
1493
- * @type {ModelComponents.TextureReader}
1494
- * @private
1495
- */
1496
- this.clearcoatNormalTexture = undefined;
1051
+ /**
1052
+ * An articulation for the model, as defined by the AGI_articulations extension.
1053
+ *
1054
+ * @ignore
1055
+ */
1056
+ export class Articulation {
1057
+ constructor() {
1058
+ /**
1059
+ * The name of the articulation.
1060
+ *
1061
+ * @type {string}
1062
+ * @ignore
1063
+ */
1064
+ this.name = undefined;
1065
+
1066
+ /**
1067
+ * The stages belonging to this articulation. The stages are applied to
1068
+ * the model in order of appearance.
1069
+ *
1070
+ * @type {ArticulationStage[]}
1071
+ * @ignore
1072
+ */
1073
+ this.stages = [];
1074
+ }
1497
1075
  }
1498
1076
 
1499
1077
  /**
1500
- * @private
1078
+ * The asset of the model.
1079
+ *
1080
+ * @ignore
1501
1081
  */
1502
- Clearcoat.DEFAULT_CLEARCOAT_FACTOR = 0.0;
1082
+ export class Asset {
1083
+ constructor() {
1084
+ /**
1085
+ * The credits of the model.
1086
+ *
1087
+ * @type {Credit[]}
1088
+ * @ignore
1089
+ */
1090
+ this.credits = [];
1091
+ }
1092
+ }
1503
1093
 
1504
1094
  /**
1505
- * @private
1095
+ * The components that make up a model.
1096
+ *
1097
+ * @ignore
1506
1098
  */
1507
- Clearcoat.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR = 0.0;
1099
+ export class Components {
1100
+ constructor() {
1101
+ /**
1102
+ * The asset of the model.
1103
+ *
1104
+ * @type {Asset}
1105
+ * @ignore
1106
+ */
1107
+ this.asset = new Asset();
1108
+
1109
+ /**
1110
+ * The default scene.
1111
+ *
1112
+ * @type {Scene}
1113
+ * @ignore
1114
+ */
1115
+ this.scene = undefined;
1116
+
1117
+ /**
1118
+ * All nodes in the model.
1119
+ *
1120
+ * @type {Node[]}
1121
+ */
1122
+ this.nodes = [];
1123
+
1124
+ /**
1125
+ * All skins in the model.
1126
+ *
1127
+ * @type {Skin[]}
1128
+ */
1129
+ this.skins = [];
1130
+
1131
+ /**
1132
+ * All animations in the model.
1133
+ *
1134
+ * @type {Animation[]}
1135
+ */
1136
+ this.animations = [];
1137
+
1138
+ /**
1139
+ * All articulations in the model as defined by the AGI_articulations extension.
1140
+ *
1141
+ * @type {Articulation[]}
1142
+ */
1143
+ this.articulations = [];
1144
+
1145
+ /**
1146
+ * Structural metadata containing the schema, property tables, property
1147
+ * textures and property mappings
1148
+ *
1149
+ * @type {StructuralMetadata}
1150
+ * @ignore
1151
+ */
1152
+ this.structuralMetadata = undefined;
1153
+
1154
+ /**
1155
+ * The model's up axis.
1156
+ *
1157
+ * @type {Axis}
1158
+ * @ignore
1159
+ */
1160
+ this.upAxis = undefined;
1161
+
1162
+ /**
1163
+ * The model's forward axis.
1164
+ *
1165
+ * @type {Axis}
1166
+ * @ignore
1167
+ */
1168
+ this.forwardAxis = undefined;
1169
+
1170
+ /**
1171
+ * A world-space transform to apply to the primitives.
1172
+ *
1173
+ * @type {Matrix4}
1174
+ * @ignore
1175
+ */
1176
+ this.transform = Matrix4.clone(Matrix4.IDENTITY);
1177
+
1178
+ /**
1179
+ * A mapping from extension names like `"EXT_example_extension"` to
1180
+ * the object that was created from the extension input
1181
+ *
1182
+ * @type {object}
1183
+ * @ignore
1184
+ */
1185
+ this.extensions = {};
1186
+ }
1187
+ }
1508
1188
 
1509
1189
  /**
1510
- * The material appearance of a primitive.
1190
+ * Information about a GPU texture, including the texture itself
1511
1191
  *
1512
- * @alias ModelComponents.Material
1513
- * @constructor
1192
+ * @ignore
1193
+ */
1194
+ export class TextureReader {
1195
+ constructor() {
1196
+ /**
1197
+ * The underlying GPU texture. The {@link Texture} contains the sampler.
1198
+ *
1199
+ * @type {Texture}
1200
+ * @ignore
1201
+ */
1202
+ this.texture = undefined;
1203
+
1204
+ /**
1205
+ * The index of the texture in the glTF. This is useful for determining
1206
+ * when textures are shared to avoid attaching a texture in multiple uniform
1207
+ * slots in the shader.
1208
+ *
1209
+ * @type {number}
1210
+ * @ignore
1211
+ */
1212
+ this.index = undefined;
1213
+
1214
+ /**
1215
+ * The texture coordinate set.
1216
+ *
1217
+ * @type {number}
1218
+ * @default 0
1219
+ * @ignore
1220
+ */
1221
+ this.texCoord = 0;
1222
+
1223
+ /**
1224
+ * Transformation matrix to apply to texture coordinates.
1225
+ *
1226
+ * @type {Matrix3}
1227
+ * @default Matrix3.IDENTITY
1228
+ */
1229
+ this.transform = Matrix3.clone(Matrix3.IDENTITY);
1230
+
1231
+ /**
1232
+ * Scale to apply to texture values.
1233
+ *
1234
+ * @type {number}
1235
+ * @default 1.0
1236
+ * @ignore
1237
+ */
1238
+ this.scale = 1.0;
1239
+
1240
+ /**
1241
+ * The texture channels to read from. When undefined all channels are read.
1242
+ *
1243
+ * @type {string}
1244
+ */
1245
+ this.channels = undefined;
1246
+ }
1247
+ }
1248
+
1249
+ /**
1250
+ * Material properties for the PBR metallic roughness shading model.
1514
1251
  *
1515
- * @private
1252
+ * @ignore
1516
1253
  */
1517
- function Material() {
1518
- /**
1519
- * Material properties for the PBR metallic roughness shading model.
1520
- *
1521
- * @type {ModelComponents.MetallicRoughness}
1522
- * @private
1523
- */
1524
- this.metallicRoughness = new MetallicRoughness();
1254
+ export class MetallicRoughness {
1255
+ /**
1256
+ * @ignore
1257
+ */
1258
+ static DEFAULT_BASE_COLOR_FACTOR = Cartesian4.ONE;
1259
+
1260
+ /**
1261
+ * @ignore
1262
+ */
1263
+ static DEFAULT_METALLIC_FACTOR = 1.0;
1264
+
1265
+ /**
1266
+ * @ignore
1267
+ */
1268
+ static DEFAULT_ROUGHNESS_FACTOR = 1.0;
1269
+
1270
+ constructor() {
1271
+ /**
1272
+ * The base color texture reader.
1273
+ *
1274
+ * @type {TextureReader}
1275
+ * @ignore
1276
+ */
1277
+ this.baseColorTexture = undefined;
1278
+
1279
+ /**
1280
+ * The metallic roughness texture reader.
1281
+ *
1282
+ * @type {TextureReader}
1283
+ * @ignore
1284
+ */
1285
+ this.metallicRoughnessTexture = undefined;
1286
+
1287
+ /**
1288
+ * The base color factor.
1289
+ *
1290
+ * @type {Cartesian4}
1291
+ * @default new Cartesian4(1.0, 1.0, 1.0, 1.0)
1292
+ * @ignore
1293
+ */
1294
+ this.baseColorFactor = Cartesian4.clone(
1295
+ MetallicRoughness.DEFAULT_BASE_COLOR_FACTOR,
1296
+ );
1297
+
1298
+ /**
1299
+ * The metallic factor.
1300
+ *
1301
+ * @type {number}
1302
+ * @default 1.0
1303
+ * @ignore
1304
+ */
1305
+ this.metallicFactor = MetallicRoughness.DEFAULT_METALLIC_FACTOR;
1306
+
1307
+ /**
1308
+ * The roughness factor.
1309
+ *
1310
+ * @type {number}
1311
+ * @default 1.0
1312
+ * @ignore
1313
+ */
1314
+ this.roughnessFactor = MetallicRoughness.DEFAULT_ROUGHNESS_FACTOR;
1315
+ }
1316
+ }
1525
1317
 
1526
- /**
1527
- * Material properties for the PBR specular glossiness shading model.
1528
- *
1529
- * @type {ModelComponents.SpecularGlossiness}
1530
- * @private
1531
- */
1532
- this.specularGlossiness = undefined;
1318
+ /**
1319
+ * Material properties for the PBR specular glossiness shading model.
1320
+ *
1321
+ * @ignore
1322
+ */
1323
+ export class SpecularGlossiness {
1324
+ /**
1325
+ * @ignore
1326
+ */
1327
+ static DEFAULT_DIFFUSE_FACTOR = Cartesian4.ONE;
1328
+
1329
+ /**
1330
+ * @ignore
1331
+ */
1332
+ static DEFAULT_SPECULAR_FACTOR = Cartesian3.ONE;
1333
+
1334
+ /**
1335
+ * @ignore
1336
+ */
1337
+ static DEFAULT_GLOSSINESS_FACTOR = 1.0;
1338
+
1339
+ constructor() {
1340
+ /**
1341
+ * The diffuse texture reader.
1342
+ *
1343
+ * @type {TextureReader}
1344
+ * @ignore
1345
+ */
1346
+ this.diffuseTexture = undefined;
1347
+
1348
+ /**
1349
+ * The specular glossiness texture reader.
1350
+ *
1351
+ * @type {TextureReader}
1352
+ * @ignore
1353
+ */
1354
+ this.specularGlossinessTexture = undefined;
1355
+
1356
+ /**
1357
+ * The diffuse factor.
1358
+ *
1359
+ * @type {Cartesian4}
1360
+ * @default new Cartesian4(1.0, 1.0, 1.0, 1.0)
1361
+ * @ignore
1362
+ */
1363
+ this.diffuseFactor = Cartesian4.clone(
1364
+ SpecularGlossiness.DEFAULT_DIFFUSE_FACTOR,
1365
+ );
1366
+
1367
+ /**
1368
+ * The specular factor.
1369
+ *
1370
+ * @type {Cartesian3}
1371
+ * @default new Cartesian3(1.0, 1.0, 1.0)
1372
+ * @ignore
1373
+ */
1374
+ this.specularFactor = Cartesian3.clone(
1375
+ SpecularGlossiness.DEFAULT_SPECULAR_FACTOR,
1376
+ );
1377
+
1378
+ /**
1379
+ * The glossiness factor.
1380
+ *
1381
+ * @type {number}
1382
+ * @default 1.0
1383
+ * @ignore
1384
+ */
1385
+ this.glossinessFactor = SpecularGlossiness.DEFAULT_GLOSSINESS_FACTOR;
1386
+ }
1387
+ }
1533
1388
 
1534
- /**
1535
- * Material properties for the PBR specular shading model.
1536
- *
1537
- * @type {ModelComponents.Specular}
1538
- * @private
1539
- */
1540
- this.specular = undefined;
1389
+ export class Specular {
1390
+ /**
1391
+ * @ignore
1392
+ */
1393
+ static DEFAULT_SPECULAR_FACTOR = 1.0;
1394
+
1395
+ /**
1396
+ * @ignore
1397
+ */
1398
+ static DEFAULT_SPECULAR_COLOR_FACTOR = Cartesian3.ONE;
1399
+
1400
+ constructor() {
1401
+ /**
1402
+ * The specular factor.
1403
+ *
1404
+ * @type {number}
1405
+ * @default 1.0
1406
+ * @ignore
1407
+ */
1408
+ this.specularFactor = Specular.DEFAULT_SPECULAR_FACTOR;
1409
+
1410
+ /**
1411
+ * The specular texture reader.
1412
+ *
1413
+ * @type {TextureReader}
1414
+ * @ignore
1415
+ */
1416
+ this.specularTexture = undefined;
1417
+
1418
+ /**
1419
+ * The specular color factor.
1420
+ *
1421
+ * @type {Cartesian3}
1422
+ * @default new Cartesian3(1.0, 1.0, 1.0)
1423
+ * @ignore
1424
+ */
1425
+ this.specularColorFactor = Cartesian3.clone(
1426
+ Specular.DEFAULT_SPECULAR_COLOR_FACTOR,
1427
+ );
1428
+
1429
+ /**
1430
+ * The specular color texture reader.
1431
+ *
1432
+ * @type {TextureReader}
1433
+ * @ignore
1434
+ */
1435
+ this.specularColorTexture = undefined;
1436
+ }
1437
+ }
1541
1438
 
1542
- /**
1543
- * Material properties for the PBR anisotropy shading model.
1544
- *
1545
- * @type {ModelComponents.Anisotropy}
1546
- * @private
1547
- */
1548
- this.anisotropy = undefined;
1439
+ export class Anisotropy {
1440
+ /**
1441
+ * @ignore
1442
+ */
1443
+ static DEFAULT_ANISOTROPY_STRENGTH = 0.0;
1444
+
1445
+ /**
1446
+ * @ignore
1447
+ */
1448
+ static DEFAULT_ANISOTROPY_ROTATION = 0.0;
1449
+
1450
+ constructor() {
1451
+ /**
1452
+ * The anisotropy strength.
1453
+ *
1454
+ * @type {number}
1455
+ * @default 0.0
1456
+ * @ignore
1457
+ */
1458
+ this.anisotropyStrength = Anisotropy.DEFAULT_ANISOTROPY_STRENGTH;
1459
+
1460
+ /**
1461
+ * The rotation of the anisotropy in tangent, bitangent space,
1462
+ * measured in radians counter-clockwise from the tangent.
1463
+ *
1464
+ * @type {number}
1465
+ * @default 0.0
1466
+ * @ignore
1467
+ */
1468
+ this.anisotropyRotation = Anisotropy.DEFAULT_ANISOTROPY_ROTATION;
1469
+
1470
+ /**
1471
+ * The anisotropy texture reader.
1472
+ *
1473
+ * @type {TextureReader}
1474
+ * @ignore
1475
+ */
1476
+ this.anisotropyTexture = undefined;
1477
+ }
1478
+ }
1549
1479
 
1550
- /**
1551
- * Material properties for the PBR clearcoat shading model.
1552
- *
1553
- * @type {ModelComponents.Clearcoat}
1554
- * @private
1555
- */
1556
- this.clearcoat = undefined;
1480
+ export class Clearcoat {
1481
+ /**
1482
+ * @ignore
1483
+ */
1484
+ static DEFAULT_CLEARCOAT_FACTOR = 0.0;
1485
+
1486
+ /**
1487
+ * @ignore
1488
+ */
1489
+ static DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR = 0.0;
1490
+
1491
+ constructor() {
1492
+ /**
1493
+ * The clearcoat layer intensity.
1494
+ *
1495
+ * @type {number}
1496
+ * @default 0.0
1497
+ * @ignore
1498
+ */
1499
+ this.clearcoatFactor = Clearcoat.DEFAULT_CLEARCOAT_FACTOR;
1500
+
1501
+ /**
1502
+ * The clearcoat layer intensity texture reader.
1503
+ *
1504
+ * @type {TextureReader}
1505
+ * @ignore
1506
+ */
1507
+ this.clearcoatTexture = undefined;
1508
+
1509
+ /**
1510
+ * The clearcoat layer roughness.
1511
+ *
1512
+ * @type {number}
1513
+ * @default 0.0
1514
+ * @ignore
1515
+ */
1516
+ this.clearcoatRoughnessFactor =
1517
+ Clearcoat.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR;
1518
+
1519
+ /**
1520
+ * The clearcoat layer roughness texture.
1521
+ *
1522
+ * @type {TextureReader}
1523
+ * @ignore
1524
+ */
1525
+ this.clearcoatRoughnessTexture = undefined;
1526
+
1527
+ /**
1528
+ * The clearcoat normal map texture.
1529
+ *
1530
+ * @type {TextureReader}
1531
+ * @ignore
1532
+ */
1533
+ this.clearcoatNormalTexture = undefined;
1534
+ }
1535
+ }
1557
1536
 
1537
+ /**
1538
+ * Material properties for the BENTLEY_materials_line_style extension.
1539
+ *
1540
+ * @alias ModelComponents.LineStyle
1541
+ * @constructor
1542
+ *
1543
+ * @private
1544
+ */
1545
+ export class LineStyle {
1558
1546
  /**
1559
- * The emissive texture reader.
1547
+ * The line width in pixels for LINES primitives.
1560
1548
  *
1561
- * @type {ModelComponents.TextureReader}
1562
- * @private
1549
+ * @type {number|undefined}
1550
+ * @default undefined
1563
1551
  */
1564
- this.emissiveTexture = undefined;
1552
+ width = undefined;
1565
1553
 
1566
1554
  /**
1567
- * The normal texture reader.
1555
+ * The line dash pattern for LINES primitives. Encoded as a 16-bit unsigned
1556
+ * integer where each bit represents a pixel (1=on, 0=off).
1568
1557
  *
1569
- * @type {ModelComponents.TextureReader}
1570
- * @private
1558
+ * @type {number|undefined}
1559
+ * @default undefined
1571
1560
  */
1572
- this.normalTexture = undefined;
1561
+ pattern = undefined;
1562
+ }
1573
1563
 
1574
- /**
1575
- * The occlusion texture reader.
1576
- *
1577
- * @type {ModelComponents.TextureReader}
1578
- * @private
1579
- */
1580
- this.occlusionTexture = undefined;
1564
+ /**
1565
+ * The material appearance of a primitive.
1566
+ *
1567
+ * @ignore
1568
+ */
1569
+ export class Material {
1570
+ /**
1571
+ * @ignore
1572
+ */
1573
+ static DEFAULT_EMISSIVE_FACTOR = Cartesian3.ZERO;
1574
+
1575
+ constructor() {
1576
+ /**
1577
+ * Material properties for the PBR metallic roughness shading model.
1578
+ *
1579
+ * @type {MetallicRoughness}
1580
+ * @ignore
1581
+ */
1582
+ this.metallicRoughness = new MetallicRoughness();
1583
+
1584
+ /**
1585
+ * Material properties for the PBR specular glossiness shading model.
1586
+ *
1587
+ * @type {SpecularGlossiness}
1588
+ * @ignore
1589
+ */
1590
+ this.specularGlossiness = undefined;
1591
+
1592
+ /**
1593
+ * Material properties for the PBR specular shading model.
1594
+ *
1595
+ * @type {Specular}
1596
+ * @ignore
1597
+ */
1598
+ this.specular = undefined;
1599
+
1600
+ /**
1601
+ * Material properties for the PBR anisotropy shading model.
1602
+ *
1603
+ * @type {Anisotropy}
1604
+ * @ignore
1605
+ */
1606
+ this.anisotropy = undefined;
1607
+
1608
+ /**
1609
+ * Material properties for the PBR clearcoat shading model.
1610
+ *
1611
+ * @type {Clearcoat}
1612
+ * @ignore
1613
+ */
1614
+ this.clearcoat = undefined;
1615
+
1616
+ /**
1617
+ * The emissive texture reader.
1618
+ *
1619
+ * @type {TextureReader}
1620
+ * @ignore
1621
+ */
1622
+ this.emissiveTexture = undefined;
1623
+
1624
+ /**
1625
+ * The normal texture reader.
1626
+ *
1627
+ * @type {TextureReader}
1628
+ * @ignore
1629
+ */
1630
+ this.normalTexture = undefined;
1631
+
1632
+ /**
1633
+ * The occlusion texture reader.
1634
+ *
1635
+ * @type {TextureReader}
1636
+ * @ignore
1637
+ */
1638
+ this.occlusionTexture = undefined;
1639
+
1640
+ /**
1641
+ * The emissive factor.
1642
+ *
1643
+ * @type {Cartesian3}
1644
+ * @default Cartesian3.ZERO
1645
+ * @ignore
1646
+ */
1647
+ this.emissiveFactor = Cartesian3.clone(Material.DEFAULT_EMISSIVE_FACTOR);
1648
+
1649
+ /**
1650
+ * The alpha mode.
1651
+ *
1652
+ * @type {AlphaMode}
1653
+ * @default AlphaMode.OPAQUE
1654
+ * @ignore
1655
+ */
1656
+ // @ts-expect-error Requires https://github.com/CesiumGS/cesium/pull/13203.
1657
+ this.alphaMode = AlphaMode.OPAQUE;
1658
+
1659
+ /**
1660
+ * The alpha cutoff value of the material for the MASK alpha mode.
1661
+ *
1662
+ * @type {number}
1663
+ * @default 0.5
1664
+ * @ignore
1665
+ */
1666
+ this.alphaCutoff = 0.5;
1667
+
1668
+ /**
1669
+ * Specifies whether the material is double sided.
1670
+ *
1671
+ * @type {boolean}
1672
+ * @default false
1673
+ * @ignore
1674
+ */
1675
+ this.doubleSided = false;
1676
+
1677
+ /**
1678
+ * Specifies whether the material is unlit.
1679
+ *
1680
+ * @type {boolean}
1681
+ * @default false
1682
+ * @ignore
1683
+ */
1684
+ this.unlit = false;
1685
+
1686
+ /**
1687
+ * The point diameter in pixels for POINTS primitives. This is set by the
1688
+ * BENTLEY_materials_point_style extension.
1689
+ *
1690
+ * @type {number|undefined}
1691
+ * @default undefined
1692
+ * @ignore
1693
+ */
1694
+ this.pointDiameter = undefined;
1695
+
1696
+ /**
1697
+ * Material properties for the BENTLEY_materials_line_style extension.
1698
+ *
1699
+ * @type {LineStyle}
1700
+ * @ignore
1701
+ */
1702
+ this.lineStyle = undefined;
1703
+ }
1704
+ }
1581
1705
 
1582
- /**
1583
- * The emissive factor.
1584
- *
1585
- * @type {Cartesian3}
1586
- * @default Cartesian3.ZERO
1587
- * @private
1588
- */
1589
- this.emissiveFactor = Cartesian3.clone(Material.DEFAULT_EMISSIVE_FACTOR);
1706
+ /**
1707
+ * Vector data in the model, as defined by the CESIUM_mesh_vector extension.
1708
+ *
1709
+ * @ignore
1710
+ */
1711
+ export class Vector {
1712
+ /** @type {true} */
1713
+ vector = true;
1590
1714
 
1591
- /**
1592
- * The alpha mode.
1593
- *
1594
- * @type {AlphaMode}
1595
- * @default AlphaMode.OPAQUE
1596
- * @private
1597
- */
1598
- this.alphaMode = AlphaMode.OPAQUE;
1715
+ /** @type {number} */
1716
+ count = 0;
1599
1717
 
1600
- /**
1601
- * The alpha cutoff value of the material for the MASK alpha mode.
1602
- *
1603
- * @type {number}
1604
- * @default 0.5
1605
- * @private
1606
- */
1607
- this.alphaCutoff = 0.5;
1718
+ /** @type {TypedArray} */
1719
+ polygonAttributeOffsets = undefined;
1608
1720
 
1609
- /**
1610
- * Specifies whether the material is double sided.
1611
- *
1612
- * @type {boolean}
1613
- * @default false
1614
- * @private
1615
- */
1616
- this.doubleSided = false;
1721
+ /** @type {TypedArray} */
1722
+ polygonHoleCounts = undefined;
1617
1723
 
1618
- /**
1619
- * Specifies whether the material is unlit.
1620
- *
1621
- * @type {boolean}
1622
- * @default false
1623
- * @private
1624
- */
1625
- this.unlit = false;
1724
+ /** @type {TypedArray} */
1725
+ polygonHoleOffsets = undefined;
1626
1726
 
1627
- /**
1628
- * The point diameter in pixels for POINTS primitives. This is set by the
1629
- * BENTLEY_materials_point_style extension.
1630
- *
1631
- * @type {number|undefined}
1632
- * @default undefined
1633
- * @private
1634
- */
1635
- this.pointDiameter = undefined;
1727
+ /** @type {TypedArray} */
1728
+ polygonIndicesOffsets = undefined;
1636
1729
  }
1637
1730
 
1638
- /**
1639
- * @private
1640
- */
1641
- Material.DEFAULT_EMISSIVE_FACTOR = Cartesian3.ZERO;
1642
-
1643
1731
  ModelComponents.Quantization = Quantization;
1644
1732
  ModelComponents.Attribute = Attribute;
1645
1733
  ModelComponents.Indices = Indices;
@@ -1667,6 +1755,8 @@ ModelComponents.SpecularGlossiness = SpecularGlossiness;
1667
1755
  ModelComponents.Specular = Specular;
1668
1756
  ModelComponents.Anisotropy = Anisotropy;
1669
1757
  ModelComponents.Clearcoat = Clearcoat;
1758
+ ModelComponents.LineStyle = LineStyle;
1670
1759
  ModelComponents.Material = Material;
1760
+ ModelComponents.Vector = Vector;
1671
1761
 
1672
1762
  export default ModelComponents;