@loaders.gl/gltf 4.0.0-alpha.5 → 4.0.0-alpha.7

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 (315) hide show
  1. package/dist/bundle.js +2 -2
  2. package/dist/dist.min.js +3545 -2445
  3. package/dist/es5/bundle.js +6 -0
  4. package/dist/es5/bundle.js.map +1 -0
  5. package/dist/es5/glb-loader.js +56 -0
  6. package/dist/es5/glb-loader.js.map +1 -0
  7. package/dist/es5/glb-writer.js +34 -0
  8. package/dist/es5/glb-writer.js.map +1 -0
  9. package/dist/es5/gltf-loader.js +81 -0
  10. package/dist/es5/gltf-loader.js.map +1 -0
  11. package/dist/es5/gltf-writer.js +35 -0
  12. package/dist/es5/gltf-writer.js.map +1 -0
  13. package/dist/es5/index.js +55 -0
  14. package/dist/es5/index.js.map +1 -0
  15. package/dist/es5/lib/api/gltf-extensions.js +109 -0
  16. package/dist/es5/lib/api/gltf-extensions.js.map +1 -0
  17. package/dist/es5/lib/api/gltf-scenegraph.js +595 -0
  18. package/dist/es5/lib/api/gltf-scenegraph.js.map +1 -0
  19. package/dist/es5/lib/api/normalize-gltf-v1.js +331 -0
  20. package/dist/es5/lib/api/normalize-gltf-v1.js.map +1 -0
  21. package/dist/es5/lib/api/post-process-gltf.js +470 -0
  22. package/dist/es5/lib/api/post-process-gltf.js.map +1 -0
  23. package/dist/es5/lib/encoders/encode-glb.js +61 -0
  24. package/dist/es5/lib/encoders/encode-glb.js.map +1 -0
  25. package/dist/es5/lib/encoders/encode-gltf.js +20 -0
  26. package/dist/es5/lib/encoders/encode-gltf.js.map +1 -0
  27. package/dist/es5/lib/extensions/EXT_meshopt_compression.js +94 -0
  28. package/dist/es5/lib/extensions/EXT_meshopt_compression.js.map +1 -0
  29. package/dist/es5/lib/extensions/EXT_texture_webp.js +43 -0
  30. package/dist/es5/lib/extensions/EXT_texture_webp.js.map +1 -0
  31. package/dist/es5/lib/extensions/KHR_binary_gltf.js +39 -0
  32. package/dist/es5/lib/extensions/KHR_binary_gltf.js.map +1 -0
  33. package/dist/es5/lib/extensions/KHR_draco_mesh_compression.js +247 -0
  34. package/dist/es5/lib/extensions/KHR_draco_mesh_compression.js.map +1 -0
  35. package/dist/es5/lib/extensions/KHR_texture_basisu.js +36 -0
  36. package/dist/es5/lib/extensions/KHR_texture_basisu.js.map +1 -0
  37. package/dist/es5/lib/extensions/KHR_texture_transform.js +230 -0
  38. package/dist/es5/lib/extensions/KHR_texture_transform.js.map +1 -0
  39. package/dist/es5/lib/extensions/deprecated/EXT_feature_metadata.js +103 -0
  40. package/dist/es5/lib/extensions/deprecated/EXT_feature_metadata.js.map +1 -0
  41. package/dist/es5/lib/extensions/deprecated/KHR_lights_punctual.js +99 -0
  42. package/dist/es5/lib/extensions/deprecated/KHR_lights_punctual.js.map +1 -0
  43. package/dist/es5/lib/extensions/deprecated/KHR_materials_unlit.js +76 -0
  44. package/dist/es5/lib/extensions/deprecated/KHR_materials_unlit.js.map +1 -0
  45. package/dist/es5/lib/extensions/deprecated/KHR_techniques_webgl.js +113 -0
  46. package/dist/es5/lib/extensions/deprecated/KHR_techniques_webgl.js.map +1 -0
  47. package/dist/es5/lib/gltf-utils/get-typed-array.js +23 -0
  48. package/dist/es5/lib/gltf-utils/get-typed-array.js.map +1 -0
  49. package/dist/es5/lib/gltf-utils/gltf-attribute-utils.js +68 -0
  50. package/dist/es5/lib/gltf-utils/gltf-attribute-utils.js.map +1 -0
  51. package/dist/es5/lib/gltf-utils/gltf-constants.js +48 -0
  52. package/dist/es5/lib/gltf-utils/gltf-constants.js.map +1 -0
  53. package/dist/es5/lib/gltf-utils/gltf-utils.js +86 -0
  54. package/dist/es5/lib/gltf-utils/gltf-utils.js.map +1 -0
  55. package/dist/es5/lib/gltf-utils/resolve-url.js +18 -0
  56. package/dist/es5/lib/gltf-utils/resolve-url.js.map +1 -0
  57. package/dist/es5/lib/parsers/parse-glb.js +120 -0
  58. package/dist/es5/lib/parsers/parse-glb.js.map +1 -0
  59. package/dist/es5/lib/parsers/parse-gltf.js +283 -0
  60. package/dist/es5/lib/parsers/parse-gltf.js.map +1 -0
  61. package/dist/es5/lib/types/glb-types.js +2 -0
  62. package/dist/es5/lib/types/glb-types.js.map +1 -0
  63. package/dist/es5/lib/types/gltf-json-schema.js +2 -0
  64. package/dist/es5/lib/types/gltf-json-schema.js.map +1 -0
  65. package/dist/es5/lib/types/gltf-postprocessed-schema.js +2 -0
  66. package/dist/es5/lib/types/gltf-postprocessed-schema.js.map +1 -0
  67. package/dist/es5/lib/types/gltf-types.js +2 -0
  68. package/dist/es5/lib/types/gltf-types.js.map +1 -0
  69. package/dist/es5/lib/utils/assert.js +12 -0
  70. package/dist/es5/lib/utils/assert.js.map +1 -0
  71. package/dist/es5/lib/utils/version.js +9 -0
  72. package/dist/es5/lib/utils/version.js.map +1 -0
  73. package/dist/es5/meshopt/meshopt-decoder.js +215 -0
  74. package/dist/es5/meshopt/meshopt-decoder.js.map +1 -0
  75. package/dist/es5/webp/webp.js +83 -0
  76. package/dist/es5/webp/webp.js.map +1 -0
  77. package/dist/esm/bundle.js +4 -0
  78. package/dist/esm/bundle.js.map +1 -0
  79. package/dist/esm/glb-loader.js +31 -0
  80. package/dist/esm/glb-loader.js.map +1 -0
  81. package/dist/esm/glb-writer.js +27 -0
  82. package/dist/esm/glb-writer.js.map +1 -0
  83. package/dist/esm/gltf-loader.js +51 -0
  84. package/dist/esm/gltf-loader.js.map +1 -0
  85. package/dist/esm/gltf-writer.js +28 -0
  86. package/dist/esm/gltf-writer.js.map +1 -0
  87. package/dist/esm/index.js +8 -0
  88. package/dist/esm/index.js.map +1 -0
  89. package/dist/esm/lib/api/gltf-extensions.js +35 -0
  90. package/dist/esm/lib/api/gltf-extensions.js.map +1 -0
  91. package/dist/esm/lib/api/gltf-scenegraph.js +452 -0
  92. package/dist/esm/lib/api/gltf-scenegraph.js.map +1 -0
  93. package/dist/esm/lib/api/normalize-gltf-v1.js +204 -0
  94. package/dist/esm/lib/api/normalize-gltf-v1.js.map +1 -0
  95. package/dist/esm/lib/api/post-process-gltf.js +396 -0
  96. package/dist/esm/lib/api/post-process-gltf.js.map +1 -0
  97. package/dist/esm/lib/encoders/encode-glb.js +54 -0
  98. package/dist/esm/lib/encoders/encode-glb.js.map +1 -0
  99. package/dist/esm/lib/encoders/encode-gltf.js +14 -0
  100. package/dist/esm/lib/encoders/encode-gltf.js.map +1 -0
  101. package/dist/esm/lib/extensions/EXT_meshopt_compression.js +41 -0
  102. package/dist/esm/lib/extensions/EXT_meshopt_compression.js.map +1 -0
  103. package/dist/esm/lib/extensions/EXT_texture_webp.js +25 -0
  104. package/dist/esm/lib/extensions/EXT_texture_webp.js.map +1 -0
  105. package/dist/esm/lib/extensions/KHR_binary_gltf.js +21 -0
  106. package/dist/esm/lib/extensions/KHR_binary_gltf.js.map +1 -0
  107. package/dist/esm/lib/extensions/KHR_draco_mesh_compression.js +111 -0
  108. package/dist/esm/lib/extensions/KHR_draco_mesh_compression.js.map +1 -0
  109. package/dist/esm/lib/extensions/KHR_texture_basisu.js +18 -0
  110. package/dist/esm/lib/extensions/KHR_texture_basisu.js.map +1 -0
  111. package/dist/esm/lib/extensions/KHR_texture_transform.js +182 -0
  112. package/dist/esm/lib/extensions/KHR_texture_transform.js.map +1 -0
  113. package/dist/esm/lib/extensions/deprecated/EXT_feature_metadata.js +77 -0
  114. package/dist/esm/lib/extensions/deprecated/EXT_feature_metadata.js.map +1 -0
  115. package/dist/esm/lib/extensions/deprecated/KHR_lights_punctual.js +42 -0
  116. package/dist/esm/lib/extensions/deprecated/KHR_lights_punctual.js.map +1 -0
  117. package/dist/esm/lib/extensions/deprecated/KHR_materials_unlit.js +33 -0
  118. package/dist/esm/lib/extensions/deprecated/KHR_materials_unlit.js.map +1 -0
  119. package/dist/esm/lib/extensions/deprecated/KHR_techniques_webgl.js +61 -0
  120. package/dist/esm/lib/extensions/deprecated/KHR_techniques_webgl.js.map +1 -0
  121. package/dist/esm/lib/gltf-utils/get-typed-array.js +16 -0
  122. package/dist/esm/lib/gltf-utils/get-typed-array.js.map +1 -0
  123. package/dist/esm/lib/gltf-utils/gltf-attribute-utils.js +62 -0
  124. package/dist/esm/lib/gltf-utils/gltf-attribute-utils.js.map +1 -0
  125. package/dist/esm/lib/gltf-utils/gltf-constants.js +37 -0
  126. package/dist/esm/lib/gltf-utils/gltf-constants.js.map +1 -0
  127. package/dist/esm/lib/gltf-utils/gltf-utils.js +74 -0
  128. package/dist/esm/lib/gltf-utils/gltf-utils.js.map +1 -0
  129. package/dist/esm/lib/gltf-utils/resolve-url.js +12 -0
  130. package/dist/esm/lib/gltf-utils/resolve-url.js.map +1 -0
  131. package/dist/esm/lib/parsers/parse-glb.js +114 -0
  132. package/dist/esm/lib/parsers/parse-glb.js.map +1 -0
  133. package/dist/esm/lib/parsers/parse-gltf.js +155 -0
  134. package/dist/esm/lib/parsers/parse-gltf.js.map +1 -0
  135. package/dist/esm/lib/types/glb-types.js +2 -0
  136. package/dist/esm/lib/types/glb-types.js.map +1 -0
  137. package/dist/esm/lib/types/gltf-json-schema.js +2 -0
  138. package/dist/esm/lib/types/gltf-json-schema.js.map +1 -0
  139. package/dist/esm/lib/types/gltf-postprocessed-schema.js +2 -0
  140. package/dist/esm/lib/types/gltf-postprocessed-schema.js.map +1 -0
  141. package/dist/esm/lib/types/gltf-types.js +2 -0
  142. package/dist/esm/lib/types/gltf-types.js.map +1 -0
  143. package/dist/esm/lib/utils/assert.js +6 -0
  144. package/dist/esm/lib/utils/assert.js.map +1 -0
  145. package/dist/esm/lib/utils/version.js +2 -0
  146. package/dist/esm/lib/utils/version.js.map +1 -0
  147. package/dist/esm/meshopt/meshopt-decoder.js +91 -0
  148. package/dist/esm/meshopt/meshopt-decoder.js.map +1 -0
  149. package/dist/esm/meshopt/meshopt-encoder.ts.disabled +409 -0
  150. package/dist/esm/webp/webp.js +25 -0
  151. package/dist/esm/webp/webp.js.map +1 -0
  152. package/dist/glb-loader.d.ts +5 -4
  153. package/dist/glb-loader.d.ts.map +1 -1
  154. package/dist/glb-loader.js +30 -28
  155. package/dist/glb-writer.d.ts +7 -16
  156. package/dist/glb-writer.d.ts.map +1 -1
  157. package/dist/glb-writer.js +32 -26
  158. package/dist/gltf-loader.d.ts +7 -6
  159. package/dist/gltf-loader.d.ts.map +1 -1
  160. package/dist/gltf-loader.js +46 -43
  161. package/dist/gltf-writer.d.ts +2 -2
  162. package/dist/gltf-writer.d.ts.map +1 -1
  163. package/dist/gltf-writer.js +29 -26
  164. package/dist/index.d.ts +8 -4
  165. package/dist/index.d.ts.map +1 -1
  166. package/dist/index.js +28 -7
  167. package/dist/lib/api/gltf-extensions.d.ts +7 -2
  168. package/dist/lib/api/gltf-extensions.d.ts.map +1 -1
  169. package/dist/lib/api/gltf-extensions.js +79 -31
  170. package/dist/lib/api/gltf-scenegraph.d.ts +10 -14
  171. package/dist/lib/api/gltf-scenegraph.d.ts.map +1 -1
  172. package/dist/lib/api/gltf-scenegraph.js +577 -513
  173. package/dist/lib/api/normalize-gltf-v1.d.ts.map +1 -1
  174. package/dist/lib/api/normalize-gltf-v1.js +278 -229
  175. package/dist/lib/api/post-process-gltf.d.ts +4 -1
  176. package/dist/lib/api/post-process-gltf.d.ts.map +1 -1
  177. package/dist/lib/api/post-process-gltf.js +385 -374
  178. package/dist/lib/encoders/encode-glb.d.ts +14 -1
  179. package/dist/lib/encoders/encode-glb.d.ts.map +1 -1
  180. package/dist/lib/encoders/encode-glb.js +67 -58
  181. package/dist/lib/encoders/encode-gltf.d.ts +18 -0
  182. package/dist/lib/encoders/encode-gltf.d.ts.map +1 -1
  183. package/dist/lib/encoders/encode-gltf.js +30 -12
  184. package/dist/lib/extensions/EXT_meshopt_compression.d.ts +1 -4
  185. package/dist/lib/extensions/EXT_meshopt_compression.d.ts.map +1 -1
  186. package/dist/lib/extensions/EXT_meshopt_compression.js +35 -50
  187. package/dist/lib/extensions/EXT_texture_webp.d.ts +1 -1
  188. package/dist/lib/extensions/EXT_texture_webp.d.ts.map +1 -1
  189. package/dist/lib/extensions/EXT_texture_webp.js +32 -28
  190. package/dist/lib/extensions/KHR_binary_gltf.d.ts +1 -1
  191. package/dist/lib/extensions/KHR_binary_gltf.d.ts.map +1 -1
  192. package/dist/lib/extensions/KHR_binary_gltf.js +36 -23
  193. package/dist/lib/extensions/KHR_draco_mesh_compression.d.ts +1 -1
  194. package/dist/lib/extensions/KHR_draco_mesh_compression.d.ts.map +1 -1
  195. package/dist/lib/extensions/KHR_draco_mesh_compression.js +123 -111
  196. package/dist/lib/extensions/KHR_texture_basisu.d.ts +1 -1
  197. package/dist/lib/extensions/KHR_texture_basisu.d.ts.map +1 -1
  198. package/dist/lib/extensions/KHR_texture_basisu.js +26 -19
  199. package/dist/lib/extensions/KHR_texture_transform.d.ts +13 -0
  200. package/dist/lib/extensions/KHR_texture_transform.d.ts.map +1 -0
  201. package/dist/lib/extensions/KHR_texture_transform.js +227 -0
  202. package/dist/lib/extensions/deprecated/EXT_feature_metadata.d.ts +6 -0
  203. package/dist/lib/extensions/deprecated/EXT_feature_metadata.d.ts.map +1 -0
  204. package/dist/lib/extensions/deprecated/EXT_feature_metadata.js +115 -0
  205. package/dist/lib/extensions/deprecated/KHR_lights_punctual.d.ts +1 -1
  206. package/dist/lib/extensions/deprecated/KHR_lights_punctual.d.ts.map +1 -1
  207. package/dist/lib/extensions/deprecated/KHR_lights_punctual.js +54 -44
  208. package/dist/lib/extensions/deprecated/KHR_materials_unlit.d.ts +1 -1
  209. package/dist/lib/extensions/deprecated/KHR_materials_unlit.d.ts.map +1 -1
  210. package/dist/lib/extensions/deprecated/KHR_materials_unlit.js +39 -32
  211. package/dist/lib/extensions/deprecated/KHR_techniques_webgl.d.ts +1 -1
  212. package/dist/lib/extensions/deprecated/KHR_techniques_webgl.d.ts.map +1 -1
  213. package/dist/lib/extensions/deprecated/KHR_techniques_webgl.js +73 -62
  214. package/dist/lib/gltf-utils/get-typed-array.js +39 -14
  215. package/dist/lib/gltf-utils/gltf-attribute-utils.d.ts +1 -1
  216. package/dist/lib/gltf-utils/gltf-attribute-utils.d.ts.map +1 -1
  217. package/dist/lib/gltf-utils/gltf-attribute-utils.js +65 -65
  218. package/dist/lib/gltf-utils/gltf-constants.d.ts +17 -0
  219. package/dist/lib/gltf-utils/gltf-constants.d.ts.map +1 -1
  220. package/dist/lib/gltf-utils/gltf-constants.js +38 -32
  221. package/dist/lib/gltf-utils/gltf-utils.d.ts +7 -0
  222. package/dist/lib/gltf-utils/gltf-utils.d.ts.map +1 -1
  223. package/dist/lib/gltf-utils/gltf-utils.js +79 -45
  224. package/dist/lib/gltf-utils/resolve-url.js +17 -15
  225. package/dist/lib/parsers/parse-glb.d.ts +15 -3
  226. package/dist/lib/parsers/parse-glb.d.ts.map +1 -1
  227. package/dist/lib/parsers/parse-glb.js +143 -105
  228. package/dist/lib/parsers/parse-gltf.d.ts +8 -4
  229. package/dist/lib/parsers/parse-gltf.d.ts.map +1 -1
  230. package/dist/lib/parsers/parse-gltf.js +166 -154
  231. package/dist/lib/types/glb-types.d.ts +3 -3
  232. package/dist/lib/types/glb-types.d.ts.map +1 -1
  233. package/dist/lib/types/glb-types.js +2 -2
  234. package/dist/lib/types/gltf-json-schema.d.ts +530 -132
  235. package/dist/lib/types/gltf-json-schema.d.ts.map +1 -1
  236. package/dist/lib/types/gltf-json-schema.js +4 -2
  237. package/dist/lib/types/gltf-postprocessed-schema.d.ts +175 -210
  238. package/dist/lib/types/gltf-postprocessed-schema.d.ts.map +1 -1
  239. package/dist/lib/types/gltf-postprocessed-schema.js +4 -2
  240. package/dist/lib/types/gltf-types.d.ts +22 -7
  241. package/dist/lib/types/gltf-types.d.ts.map +1 -1
  242. package/dist/lib/types/gltf-types.js +3 -2
  243. package/dist/lib/utils/assert.js +11 -5
  244. package/dist/lib/utils/version.js +7 -2
  245. package/dist/meshopt/meshopt-decoder.js +97 -82
  246. package/dist/webp/webp.d.ts +1 -1
  247. package/dist/webp/webp.d.ts.map +1 -1
  248. package/dist/webp/webp.js +32 -23
  249. package/package.json +9 -8
  250. package/src/glb-loader.ts +4 -4
  251. package/src/glb-writer.ts +11 -3
  252. package/src/gltf-loader.ts +12 -8
  253. package/src/gltf-writer.ts +2 -2
  254. package/src/index.ts +34 -6
  255. package/src/lib/api/gltf-extensions.ts +14 -3
  256. package/src/lib/api/gltf-scenegraph.ts +61 -34
  257. package/src/lib/api/normalize-gltf-v1.ts +2 -1
  258. package/src/lib/api/post-process-gltf.ts +275 -150
  259. package/src/lib/encoders/encode-glb.ts +21 -4
  260. package/src/lib/encoders/encode-gltf.ts +19 -10
  261. package/src/lib/extensions/EXT_meshopt_compression.ts +16 -25
  262. package/src/lib/extensions/EXT_texture_webp.ts +5 -4
  263. package/src/lib/extensions/KHR_binary_gltf.ts +3 -3
  264. package/src/lib/extensions/KHR_draco_mesh_compression.ts +8 -8
  265. package/src/lib/extensions/KHR_texture_basisu.ts +4 -3
  266. package/src/lib/extensions/KHR_texture_transform.ts +308 -0
  267. package/src/lib/extensions/deprecated/EXT_feature_metadata.ts +163 -0
  268. package/src/lib/extensions/deprecated/KHR_lights_punctual.ts +2 -2
  269. package/src/lib/extensions/deprecated/KHR_materials_unlit.ts +5 -5
  270. package/src/lib/extensions/deprecated/KHR_techniques_webgl.ts +3 -2
  271. package/src/lib/gltf-utils/gltf-attribute-utils.ts +1 -1
  272. package/src/lib/gltf-utils/gltf-constants.ts +2 -2
  273. package/src/lib/gltf-utils/gltf-utils.ts +31 -0
  274. package/src/lib/parsers/parse-glb.ts +50 -24
  275. package/src/lib/parsers/parse-gltf.ts +32 -17
  276. package/src/lib/types/glb-types.ts +1 -1
  277. package/src/lib/types/gltf-json-schema.ts +582 -126
  278. package/src/lib/types/gltf-postprocessed-schema.ts +289 -212
  279. package/src/lib/types/gltf-types.ts +41 -44
  280. package/dist/bundle.js.map +0 -1
  281. package/dist/glb-loader.js.map +0 -1
  282. package/dist/glb-writer.js.map +0 -1
  283. package/dist/gltf-loader.js.map +0 -1
  284. package/dist/gltf-writer.js.map +0 -1
  285. package/dist/index.js.map +0 -1
  286. package/dist/lib/api/gltf-extensions.js.map +0 -1
  287. package/dist/lib/api/gltf-scenegraph.js.map +0 -1
  288. package/dist/lib/api/normalize-gltf-v1.js.map +0 -1
  289. package/dist/lib/api/post-process-gltf.js.map +0 -1
  290. package/dist/lib/encoders/encode-glb.js.map +0 -1
  291. package/dist/lib/encoders/encode-gltf.js.map +0 -1
  292. package/dist/lib/extensions/EXT_meshopt_compression.js.map +0 -1
  293. package/dist/lib/extensions/EXT_texture_webp.js.map +0 -1
  294. package/dist/lib/extensions/KHR_binary_gltf.js.map +0 -1
  295. package/dist/lib/extensions/KHR_draco_mesh_compression.js.map +0 -1
  296. package/dist/lib/extensions/KHR_texture_basisu.js.map +0 -1
  297. package/dist/lib/extensions/deprecated/KHR_lights_punctual.js.map +0 -1
  298. package/dist/lib/extensions/deprecated/KHR_materials_unlit.js.map +0 -1
  299. package/dist/lib/extensions/deprecated/KHR_techniques_webgl.js.map +0 -1
  300. package/dist/lib/gltf-utils/get-typed-array.js.map +0 -1
  301. package/dist/lib/gltf-utils/gltf-attribute-utils.js.map +0 -1
  302. package/dist/lib/gltf-utils/gltf-constants.js.map +0 -1
  303. package/dist/lib/gltf-utils/gltf-utils.js.map +0 -1
  304. package/dist/lib/gltf-utils/resolve-url.js.map +0 -1
  305. package/dist/lib/parsers/parse-glb.js.map +0 -1
  306. package/dist/lib/parsers/parse-gltf.js.map +0 -1
  307. package/dist/lib/types/glb-types.js.map +0 -1
  308. package/dist/lib/types/gltf-json-schema.js.map +0 -1
  309. package/dist/lib/types/gltf-postprocessed-schema.js.map +0 -1
  310. package/dist/lib/types/gltf-types.js.map +0 -1
  311. package/dist/lib/utils/assert.js.map +0 -1
  312. package/dist/lib/utils/version.js.map +0 -1
  313. package/dist/meshopt/meshopt-decoder.js.map +0 -1
  314. package/dist/webp/webp.js.map +0 -1
  315. /package/dist/{meshopt → es5/meshopt}/meshopt-encoder.ts.disabled +0 -0
@@ -6,7 +6,7 @@ export type GLTFId = number;
6
6
  /**
7
7
  * Indices of those attributes that deviate from their initialization value.
8
8
  */
9
- export interface AccessorSparseIndices {
9
+ export type GLTFAccessorSparseIndices = {
10
10
  /**
11
11
  * The index of the bufferView with sparse indices. Referenced bufferView can't have ARRAY_BUFFER or ELEMENT_ARRAY_BUFFER target.
12
12
  */
@@ -19,15 +19,15 @@ export interface AccessorSparseIndices {
19
19
  * The indices data type.
20
20
  */
21
21
  componentType: 5121 | 5123 | 5125 | number;
22
- extensions?: any;
22
+ extensions?: Record<string, any>;
23
23
  extras?: any;
24
24
  // [k: string]: any;
25
- }
25
+ };
26
26
 
27
27
  /**
28
28
  * Array of size `accessor.sparse.count` times number of components storing the displaced accessor attributes pointed by `accessor.sparse.indices`.
29
29
  */
30
- export interface AccessorSparseValues {
30
+ export type GLTFAccessorSparseValues = {
31
31
  /**
32
32
  * The index of the bufferView with sparse values. Referenced bufferView can't have ARRAY_BUFFER or ELEMENT_ARRAY_BUFFER target.
33
33
  */
@@ -36,15 +36,15 @@ export interface AccessorSparseValues {
36
36
  * The offset relative to the start of the bufferView in bytes. Must be aligned.
37
37
  */
38
38
  byteOffset?: number;
39
- extensions?: any;
39
+ extensions?: Record<string, any>;
40
40
  extras?: any;
41
41
  // [k: string]: any;
42
- }
42
+ };
43
43
 
44
44
  /**
45
45
  * Sparse storage of attributes that deviate from their initialization value.
46
46
  */
47
- export interface AccessorSparse {
47
+ export type GLTFAccessorSparse = {
48
48
  /**
49
49
  * Number of entries stored in the sparse array.
50
50
  */
@@ -52,20 +52,20 @@ export interface AccessorSparse {
52
52
  /**
53
53
  * Index array of size `count` that points to those accessor attributes that deviate from their initialization value. Indices must strictly increase.
54
54
  */
55
- indices: AccessorSparseIndices;
55
+ indices: GLTFAccessorSparseIndices;
56
56
  /**
57
57
  * Array of size `count` times number of components, storing the displaced accessor attributes pointed by `indices`. Substituted values must have the same `componentType` and number of components as the base accessor.
58
58
  */
59
- values: AccessorSparseValues;
60
- extensions?: any;
59
+ values: GLTFAccessorSparseValues;
60
+ extensions?: Record<string, any>;
61
61
  extras?: any;
62
62
  // [k: string]: any;
63
- }
63
+ };
64
64
 
65
65
  /**
66
66
  * A typed view into a bufferView. A bufferView contains raw binary data. An accessor provides a typed view into a bufferView or a subset of a bufferView similar to how WebGL's `vertexAttribPointer()` defines an attribute in a buffer.
67
67
  */
68
- export interface Accessor {
68
+ export type GLTFAccessor = {
69
69
  /**
70
70
  * The index of the bufferView.
71
71
  */
@@ -101,17 +101,17 @@ export interface Accessor {
101
101
  /**
102
102
  * Sparse storage of attributes that deviate from their initialization value.
103
103
  */
104
- sparse?: AccessorSparse;
104
+ sparse?: GLTFAccessorSparse;
105
105
  name?: any;
106
- extensions?: any;
106
+ extensions?: Record<string, any>;
107
107
  extras?: any;
108
108
  // [k: string]: any;
109
- }
109
+ };
110
110
 
111
111
  /**
112
112
  * The index of the node and TRS property that an animation channel targets.
113
113
  */
114
- export interface AnimationChannelTarget {
114
+ export type GLTFAnimationChannelTarget = {
115
115
  /**
116
116
  * The index of the node to target.
117
117
  */
@@ -120,15 +120,15 @@ export interface AnimationChannelTarget {
120
120
  * The name of the node's TRS property to modify, or the "weights" of the Morph Targets it instantiates. For the "translation" property, the values that are provided by the sampler are the translation along the x, y, and z axes. For the "rotation" property, the values are a quaternion in the order (x, y, z, w), where w is the scalar. For the "scale" property, the values are the scaling factors along the x, y, and z axes.
121
121
  */
122
122
  path: 'translation' | 'rotation' | 'scale' | 'weights' | string;
123
- extensions?: any;
123
+ extensions?: Record<string, any>;
124
124
  extras?: any;
125
125
  // [k: string]: any;
126
- }
126
+ };
127
127
 
128
128
  /**
129
129
  * Targets an animation's sampler at a node's property.
130
130
  */
131
- export interface AnimationChannel {
131
+ export type GLTFAnimationChannel = {
132
132
  /**
133
133
  * The index of a sampler in this animation used to compute the value for the target.
134
134
  */
@@ -136,16 +136,16 @@ export interface AnimationChannel {
136
136
  /**
137
137
  * The index of the node and TRS property to target.
138
138
  */
139
- target: AnimationChannelTarget;
140
- extensions?: any;
139
+ target: GLTFAnimationChannelTarget;
140
+ extensions?: Record<string, any>;
141
141
  extras?: any;
142
142
  // [k: string]: any;
143
- }
143
+ };
144
144
 
145
145
  /**
146
146
  * Combines input and output accessors with an interpolation algorithm to define a keyframe graph (but not its target).
147
147
  */
148
- export interface AnimationSampler {
148
+ export type GLTFAnimationSampler = {
149
149
  /**
150
150
  * The index of an accessor containing keyframe input values, e.g., time.
151
151
  */
@@ -158,33 +158,33 @@ export interface AnimationSampler {
158
158
  * The index of an accessor, containing keyframe output values.
159
159
  */
160
160
  output: GLTFId;
161
- extensions?: any;
161
+ extensions?: Record<string, any>;
162
162
  extras?: any;
163
163
  // [k: string]: any;
164
- }
164
+ };
165
165
 
166
166
  /**
167
167
  * A keyframe animation.
168
168
  */
169
- export interface Animation {
169
+ export type GLTFAnimation = {
170
170
  /**
171
171
  * An array of channels, each of which targets an animation's sampler at a node's property. Different channels of the same animation can't have equal targets.
172
172
  */
173
- channels: AnimationChannel[];
173
+ channels: GLTFAnimationChannel[];
174
174
  /**
175
175
  * An array of samplers that combines input and output accessors with an interpolation algorithm to define a keyframe graph (but not its target).
176
176
  */
177
- samplers: AnimationSampler[];
177
+ samplers: GLTFAnimationSampler[];
178
178
  name?: any;
179
- extensions?: any;
179
+ extensions?: Record<string, any>;
180
180
  extras?: any;
181
181
  // [k: string]: any;
182
- }
182
+ };
183
183
 
184
184
  /**
185
185
  * Metadata about the glTF asset.
186
186
  */
187
- export interface Asset {
187
+ export type GLTFAsset = {
188
188
  /**
189
189
  * A copyright message suitable for display to credit the content creator.
190
190
  */
@@ -201,15 +201,15 @@ export interface Asset {
201
201
  * The minimum glTF version that this asset targets.
202
202
  */
203
203
  minVersion?: string;
204
- extensions?: any;
204
+ extensions?: Record<string, any>;
205
205
  extras?: any;
206
206
  // [k: string]: any;
207
- }
207
+ };
208
208
 
209
209
  /**
210
210
  * A buffer points to binary geometry, animation, or skins.
211
211
  */
212
- export interface Buffer {
212
+ export type GLTFBuffer = {
213
213
  /**
214
214
  * The uri of the buffer.
215
215
  */
@@ -219,15 +219,15 @@ export interface Buffer {
219
219
  */
220
220
  byteLength: number;
221
221
  name?: any;
222
- extensions?: any;
222
+ extensions?: Record<string, any>;
223
223
  extras?: any;
224
224
  // [k: string]: any;
225
- }
225
+ };
226
226
 
227
227
  /**
228
228
  * A view into a buffer generally representing a subset of the buffer.
229
229
  */
230
- export interface BufferView {
230
+ export type GLTFBufferView = {
231
231
  /**
232
232
  * The index of the buffer.
233
233
  */
@@ -249,15 +249,15 @@ export interface BufferView {
249
249
  */
250
250
  target?: 34962 | 34963 | number;
251
251
  name?: any;
252
- extensions?: any;
252
+ extensions?: Record<string, any>;
253
253
  extras?: any;
254
254
  // [k: string]: any;
255
- }
255
+ };
256
256
 
257
257
  /**
258
258
  * An orthographic camera containing properties to create an orthographic projection matrix.
259
259
  */
260
- export interface CameraOrthographic {
260
+ export type GLTFCameraOrthographic = {
261
261
  /**
262
262
  * The floating-point horizontal magnification of the view. Must not be zero.
263
263
  */
@@ -274,15 +274,15 @@ export interface CameraOrthographic {
274
274
  * The floating-point distance to the near clipping plane.
275
275
  */
276
276
  znear: number;
277
- extensions?: any;
277
+ extensions?: Record<string, any>;
278
278
  extras?: any;
279
279
  // [k: string]: any;
280
- }
280
+ };
281
281
 
282
282
  /**
283
283
  * A perspective camera containing properties to create a perspective projection matrix.
284
284
  */
285
- export interface CameraPerspective {
285
+ export type GLTFCameraPerspective = {
286
286
  /**
287
287
  * The floating-point aspect ratio of the field of view.
288
288
  */
@@ -299,37 +299,37 @@ export interface CameraPerspective {
299
299
  * The floating-point distance to the near clipping plane.
300
300
  */
301
301
  znear: number;
302
- extensions?: any;
302
+ extensions?: Record<string, any>;
303
303
  extras?: any;
304
304
  // [k: string]: any;
305
- }
305
+ };
306
306
 
307
307
  /**
308
308
  * A camera's projection. A node can reference a camera to apply a transform to place the camera in the scene.
309
309
  */
310
- export interface Camera {
310
+ export type GLTFCamera = {
311
311
  /**
312
312
  * An orthographic camera containing properties to create an orthographic projection matrix.
313
313
  */
314
- orthographic?: CameraOrthographic;
314
+ orthographic?: GLTFCameraOrthographic;
315
315
  /**
316
316
  * A perspective camera containing properties to create a perspective projection matrix.
317
317
  */
318
- perspective?: CameraPerspective;
318
+ perspective?: GLTFCameraPerspective;
319
319
  /**
320
320
  * Specifies if the camera uses a perspective or orthographic projection.
321
321
  */
322
322
  type: 'perspective' | 'orthographic' | string;
323
323
  name?: any;
324
- extensions?: any;
324
+ extensions?: Record<string, any>;
325
325
  extras?: any;
326
326
  // [k: string]: any;
327
- }
327
+ };
328
328
 
329
329
  /**
330
330
  * Image data used to create a texture. Image can be referenced by URI or `bufferView` index. `mimeType` is required in the latter case.
331
331
  */
332
- export interface Image {
332
+ export type GLTFImage = {
333
333
  /**
334
334
  * The uri of the image.
335
335
  */
@@ -343,15 +343,15 @@ export interface Image {
343
343
  */
344
344
  bufferView?: GLTFId;
345
345
  name?: any;
346
- extensions?: any;
346
+ extensions?: Record<string, any>;
347
347
  extras?: any;
348
348
  // [k: string]: any;
349
- }
349
+ };
350
350
 
351
351
  /**
352
352
  * Reference to a texture.
353
353
  */
354
- export interface TextureInfo {
354
+ export type GLTFTextureInfo = {
355
355
  /**
356
356
  * The index of the texture.
357
357
  */
@@ -360,15 +360,15 @@ export interface TextureInfo {
360
360
  * The set index of texture's TEXCOORD attribute used for texture coordinate mapping.
361
361
  */
362
362
  texCoord?: number;
363
- extensions?: any;
363
+ extensions?: Record<string, any>;
364
364
  extras?: any;
365
365
  // [k: string]: any;
366
- }
366
+ };
367
367
 
368
368
  /**
369
369
  * A set of parameter values that are used to define the metallic-roughness material model from Physically-Based Rendering (PBR) methodology.
370
370
  */
371
- export interface MaterialPbrMetallicRoughness {
371
+ export type GLTFMaterialPbrMetallicRoughness = {
372
372
  /**
373
373
  * The material's base color factor.
374
374
  */
@@ -376,7 +376,7 @@ export interface MaterialPbrMetallicRoughness {
376
376
  /**
377
377
  * The base color texture.
378
378
  */
379
- baseColorTexture?: TextureInfo;
379
+ baseColorTexture?: GLTFTextureInfo;
380
380
  /**
381
381
  * The metalness of the material.
382
382
  */
@@ -388,57 +388,57 @@ export interface MaterialPbrMetallicRoughness {
388
388
  /**
389
389
  * The metallic-roughness texture.
390
390
  */
391
- metallicRoughnessTexture?: TextureInfo;
392
- extensions?: any;
391
+ metallicRoughnessTexture?: GLTFTextureInfo;
392
+ extensions?: Record<string, any>;
393
393
  extras?: any;
394
394
  // [k: string]: any;
395
- }
396
- export interface MaterialNormalTextureInfo {
397
- index?: any;
395
+ };
396
+ export type GLTFMaterialNormalTextureInfo = {
397
+ index: any;
398
398
  texCoord?: any;
399
399
  /**
400
400
  * The scalar multiplier applied to each normal vector of the normal texture.
401
401
  */
402
402
  scale?: number;
403
- extensions?: any;
403
+ extensions?: Record<string, any>;
404
404
  extras?: any;
405
405
  // [k: string]: any;
406
- }
407
- export interface MaterialOcclusionTextureInfo {
408
- index?: any;
406
+ };
407
+ export type GLTFMaterialOcclusionTextureInfo = {
408
+ index: any;
409
409
  texCoord?: any;
410
410
  /**
411
411
  * A scalar multiplier controlling the amount of occlusion applied.
412
412
  */
413
413
  strength?: number;
414
- extensions?: any;
414
+ extensions?: Record<string, any>;
415
415
  extras?: any;
416
416
  // [k: string]: any;
417
- }
417
+ };
418
418
 
419
419
  /**
420
420
  * The material appearance of a primitive.
421
421
  */
422
- export interface Material {
422
+ export type GLTFMaterial = {
423
423
  name?: any;
424
- extensions?: any;
424
+ extensions?: Record<string, any>;
425
425
  extras?: any;
426
426
  /**
427
427
  * A set of parameter values that are used to define the metallic-roughness material model from Physically-Based Rendering (PBR) methodology. When not specified, all the default values of `pbrMetallicRoughness` apply.
428
428
  */
429
- pbrMetallicRoughness?: MaterialPbrMetallicRoughness;
429
+ pbrMetallicRoughness?: GLTFMaterialPbrMetallicRoughness;
430
430
  /**
431
431
  * The normal map texture.
432
432
  */
433
- normalTexture?: MaterialNormalTextureInfo;
433
+ normalTexture?: GLTFMaterialNormalTextureInfo;
434
434
  /**
435
435
  * The occlusion map texture.
436
436
  */
437
- occlusionTexture?: MaterialOcclusionTextureInfo;
437
+ occlusionTexture?: GLTFMaterialOcclusionTextureInfo;
438
438
  /**
439
439
  * The emissive map texture.
440
440
  */
441
- emissiveTexture?: TextureInfo;
441
+ emissiveTexture?: GLTFTextureInfo;
442
442
  /**
443
443
  * The emissive color of the material.
444
444
  */
@@ -456,12 +456,12 @@ export interface Material {
456
456
  */
457
457
  doubleSided?: boolean;
458
458
  // [k: string]: any;
459
- }
459
+ };
460
460
 
461
461
  /**
462
462
  * Geometry to be rendered with the given material.
463
463
  */
464
- export interface MeshPrimitive {
464
+ export type GLTFMeshPrimitive = {
465
465
  /**
466
466
  * A dictionary object, where each key corresponds to mesh attribute semantic and each value is the index of the accessor containing attribute's data.
467
467
  */
@@ -486,35 +486,35 @@ export interface MeshPrimitive {
486
486
  targets?: {
487
487
  [k: string]: GLTFId;
488
488
  }[];
489
- extensions?: any;
489
+ extensions?: Record<string, any>;
490
490
  extras?: any;
491
491
  // [k: string]: any;
492
- }
492
+ };
493
493
 
494
494
  /**
495
495
  * A set of primitives to be rendered. A node can contain one mesh. A node's transform places the mesh in the scene.
496
496
  */
497
497
 
498
- export interface Mesh {
498
+ export type GLTFMesh = {
499
499
  id?: string;
500
500
  /**
501
501
  * An array of primitives, each defining geometry to be rendered with a material.
502
502
  */
503
- primitives: MeshPrimitive[];
503
+ primitives: GLTFMeshPrimitive[];
504
504
  /**
505
505
  * Array of weights to be applied to the Morph Targets.
506
506
  */
507
507
  weights?: number[];
508
508
  name?: any;
509
- extensions?: any;
509
+ extensions?: Record<string, any>;
510
510
  extras?: any;
511
511
  // [k: string]: any;
512
- }
512
+ };
513
513
 
514
514
  /**
515
515
  * A node in the node hierarchy. When the node contains `skin`, all `mesh.primitives` must contain `JOINTS_0` and `WEIGHTS_0` attributes. A node can have either a `matrix` or any combination of `translation`/`rotation`/`scale` (TRS) properties. TRS properties are converted to matrices and postmultiplied in the `T * R * S` order to compose the transformation matrix; first the scale is applied to the vertices, then the rotation, and then the translation. If none are provided, the transform is the identity. When a node is targeted for animation (referenced by an animation.channel.target), only TRS properties may be present; `matrix` will not be present.
516
516
  */
517
- export interface Node {
517
+ export type GLTFNode = {
518
518
  /**
519
519
  * The index of the camera referenced by this node.
520
520
  */
@@ -552,15 +552,15 @@ export interface Node {
552
552
  */
553
553
  weights?: number[];
554
554
  name?: any;
555
- extensions?: any;
555
+ extensions?: Record<string, any>;
556
556
  extras?: any;
557
557
  // [k: string]: any;
558
- }
558
+ };
559
559
 
560
560
  /**
561
561
  * Texture sampler properties for filtering and wrapping modes.
562
562
  */
563
- export interface Sampler {
563
+ export type GLTFSampler = {
564
564
  /**
565
565
  * Magnification filter.
566
566
  */
@@ -578,29 +578,30 @@ export interface Sampler {
578
578
  */
579
579
  wrapT?: 33071 | 33648 | 10497 | number;
580
580
  name?: any;
581
- extensions?: any;
581
+ extensions?: Record<string, any>;
582
582
  extras?: any;
583
583
  // [k: string]: any;
584
- }
584
+ };
585
585
 
586
586
  /**
587
587
  * The root nodes of a scene.
588
588
  */
589
- export interface Scene {
589
+ export type GLTFScene = {
590
590
  /**
591
591
  * The indices of each root node.
592
592
  */
593
593
  nodes?: GLTFId[];
594
594
  name?: any;
595
- extensions?: any;
595
+ extensions?: Record<string, any>;
596
596
  extras?: any;
597
597
  // [k: string]: any;
598
- }
598
+ };
599
599
 
600
600
  /**
601
601
  * Joints and matrices defining a skin.
602
602
  */
603
- export interface Skin {
603
+ export type GLTFSkin = {
604
+ id?: string;
604
605
  /**
605
606
  * The index of the accessor containing the floating-point 4x4 inverse-bind matrices. The default is that each matrix is a 4x4 identity matrix, which implies that inverse-bind matrices were pre-applied.
606
607
  */
@@ -609,38 +610,32 @@ export interface Skin {
609
610
  * The index of the node used as a skeleton root. When undefined, joints transforms resolve to scene root.
610
611
  */
611
612
  skeleton?: GLTFId;
612
- /**
613
- * Indices of skeleton nodes, used as joints in this skin.
614
- */
613
+ /** Indices of skeleton nodes, used as joints in this skin. */
615
614
  joints: GLTFId[];
616
615
  name?: any;
617
- extensions?: any;
616
+ extensions?: Record<string, any>;
618
617
  extras?: any;
619
618
  // [k: string]: any;
620
- }
619
+ };
621
620
 
622
621
  /**
623
622
  * A texture and its sampler.
624
623
  */
625
- export interface Texture {
626
- /**
627
- * The index of the sampler used by this texture. When undefined, a sampler with repeat wrapping and auto filtering should be used.
628
- */
624
+ export type GLTFTexture = {
625
+ /** The index of the sampler used by this texture. When undefined, a sampler with repeat wrapping and auto filtering should be used. */
629
626
  sampler?: GLTFId;
630
- /**
631
- * The index of the image used by this texture.
632
- */
627
+ /** The index of the image used by this texture. */
633
628
  source?: GLTFId;
634
629
  name?: any;
635
- extensions?: any;
630
+ extensions?: Record<string, any>;
636
631
  extras?: any;
637
632
  // [k: string]: any;
638
- }
633
+ };
639
634
 
640
635
  /**
641
636
  * The root object for a glTF asset.
642
637
  */
643
- export interface GLTF {
638
+ export type GLTF = {
644
639
  /**
645
640
  * Names of glTF extensions used somewhere in this asset.
646
641
  */
@@ -652,47 +647,47 @@ export interface GLTF {
652
647
  /**
653
648
  * An array of accessors.
654
649
  */
655
- accessors?: Accessor[];
650
+ accessors?: GLTFAccessor[];
656
651
  /**
657
652
  * An array of keyframe animations.
658
653
  */
659
- animations?: Animation[];
654
+ animations?: GLTFAnimation[];
660
655
  /**
661
656
  * Metadata about the glTF asset.
662
657
  */
663
- asset: Asset;
658
+ asset: GLTFAsset;
664
659
  /**
665
660
  * An array of buffers.
666
661
  */
667
- buffers?: Buffer[];
662
+ buffers?: GLTFBuffer[];
668
663
  /**
669
664
  * An array of bufferViews.
670
665
  */
671
- bufferViews?: BufferView[];
666
+ bufferViews?: GLTFBufferView[];
672
667
  /**
673
668
  * An array of cameras.
674
669
  */
675
- cameras?: Camera[];
670
+ cameras?: GLTFCamera[];
676
671
  /**
677
672
  * An array of images.
678
673
  */
679
- images?: Image[];
674
+ images?: GLTFImage[];
680
675
  /**
681
676
  * An array of materials.
682
677
  */
683
- materials?: Material[];
678
+ materials?: GLTFMaterial[];
684
679
  /**
685
680
  * An array of meshes.
686
681
  */
687
- meshes?: Mesh[];
682
+ meshes?: GLTFMesh[];
688
683
  /**
689
684
  * An array of nodes.
690
685
  */
691
- nodes?: Node[];
686
+ nodes?: GLTFNode[];
692
687
  /**
693
688
  * An array of samplers.
694
689
  */
695
- samplers?: Sampler[];
690
+ samplers?: GLTFSampler[];
696
691
  /**
697
692
  * The index of the default scene.
698
693
  */
@@ -700,19 +695,19 @@ export interface GLTF {
700
695
  /**
701
696
  * An array of scenes.
702
697
  */
703
- scenes?: Scene[];
698
+ scenes?: GLTFScene[];
704
699
  /**
705
700
  * An array of skins.
706
701
  */
707
- skins?: Skin[];
702
+ skins?: GLTFSkin[];
708
703
  /**
709
704
  * An array of textures.
710
705
  */
711
- textures?: Texture[];
712
- extensions?: any;
713
- extras?: any;
714
- // [k: string]: any;
715
- }
706
+ textures?: GLTFTexture[];
707
+ extensions?: Record<string, unknown>;
708
+ extras?: unknown;
709
+ [k: string]: unknown;
710
+ };
716
711
 
717
712
  // GLTF Extensions
718
713
  /* eslint-disable camelcase */
@@ -783,3 +778,464 @@ export type GLTF_MSFT_texture_dds = {
783
778
  source: GLTFId;
784
779
  extras?: any;
785
780
  };
781
+
782
+ /**
783
+ * Spec - https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_feature_metadata#gltf-extension-1
784
+ * @todo belom88 complete typings
785
+ */
786
+ export type GLTF_EXT_mesh_features = {
787
+ featureIds: {
788
+ featureCount: number;
789
+ nullFeatureId: number;
790
+ label: string;
791
+ attribute: any;
792
+ texture: any;
793
+ propertyTable: number;
794
+ }[];
795
+ extensions?: any;
796
+ extras?: any;
797
+ [key: string]: any;
798
+ };
799
+
800
+ /**
801
+ * Spec - https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_feature_metadata#gltf-extension-1
802
+ */
803
+ export type GLTF_EXT_feature_metadata = {
804
+ /** An object defining classes and enums. */
805
+ schema?: ExtFeatureMetadataSchema;
806
+ /** A uri to an external schema file. */
807
+ schemaUri?: string;
808
+ /** An object containing statistics about features. */
809
+ statistics?: Statistics;
810
+ /** A dictionary, where each key is a feature table ID and each value is an object defining the feature table. */
811
+ featureTables?: {
812
+ [key: string]: EXT_feature_metadata_feature_table;
813
+ };
814
+ /** A dictionary, where each key is a feature texture ID and each value is an object defining the feature texture. */
815
+ featureTextures?: {
816
+ [key: string]: FeatureTexture;
817
+ };
818
+ extensions?: Record<string, any>;
819
+ extras?: any;
820
+ [key: string]: any;
821
+ };
822
+
823
+ /**
824
+ * Spec - https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_feature_metadata#schema
825
+ */
826
+ type ExtFeatureMetadataSchema = {
827
+ /** The name of the schema. */
828
+ name?: string;
829
+ /** The description of the schema. */
830
+ description?: string;
831
+ /** Application-specific version of the schema. */
832
+ version?: string;
833
+ /** A dictionary, where each key is a class ID and each value is an object defining the class. */
834
+ classes?: {
835
+ [key: string]: EXT_feature_metadata_class_object;
836
+ };
837
+ /** A dictionary, where each key is an enum ID and each value is an object defining the values for the enum. */
838
+ enums?: {
839
+ [key: string]: ExtFeatureMetadataEnum;
840
+ };
841
+ extensions?: Record<string, any>;
842
+ extras?: any;
843
+ [key: string]: any;
844
+ };
845
+
846
+ /**
847
+ * Spec - https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_feature_metadata#class
848
+ */
849
+ export type EXT_feature_metadata_class_object = {
850
+ /** The name of the class, e.g. for display purposes. */
851
+ name?: string;
852
+ /** The description of the class. */
853
+ description?: string;
854
+ /** A dictionary, where each key is a property ID and each value is an object defining the property. */
855
+ properties: {
856
+ [key: string]: ClassProperty;
857
+ };
858
+ extensions?: Record<string, any>;
859
+ extras?: any;
860
+ [key: string]: any;
861
+ };
862
+
863
+ /**
864
+ * https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_feature_metadata#class-property
865
+ */
866
+ export type ClassProperty = {
867
+ /** The name of the property, e.g. for display purposes. */
868
+ name?: string;
869
+ /** The description of the property. */
870
+ description?: string;
871
+ /**
872
+ * The property type. If ENUM is used, then enumType must also be specified.
873
+ * If ARRAY is used, then componentType must also be specified.
874
+ * ARRAY is a fixed-length array when componentCount is defined, and variable-length otherwise.
875
+ */
876
+ type: ClassPropertyType;
877
+ /**
878
+ * An enum ID as declared in the enums dictionary.
879
+ * This value must be specified when type or componentType is ENUM.
880
+ */
881
+ enumType?: string;
882
+ /**
883
+ * When type is ARRAY this indicates the type of each component of the array.
884
+ * If ENUM is used, then enumType must also be specified.
885
+ */
886
+ componentType?:
887
+ | 'INT8'
888
+ | 'UINT8'
889
+ | 'INT16'
890
+ | 'UINT16'
891
+ | 'INT32'
892
+ | 'UINT32'
893
+ | 'INT64'
894
+ | 'UINT64'
895
+ | 'FLOAT32'
896
+ | 'FLOAT64'
897
+ | 'BOOLEAN'
898
+ | 'STRING'
899
+ | 'ENUM';
900
+ /** The number of components per element for ARRAY elements. */
901
+ componentCount?: number;
902
+ /**
903
+ * Specifies whether integer values are normalized.
904
+ * This applies both when type is an integer type, or when type is ARRAY with a componentType that is an integer type.
905
+ * For unsigned integer types, values are normalized between [0.0, 1.0].
906
+ * For signed integer types, values are normalized between [-1.0, 1.0].
907
+ * For all other types, this property is ignored.
908
+ */
909
+ normalized: boolean;
910
+ /**
911
+ * Maximum allowed values for property values.
912
+ * Only applicable for numeric types and fixed-length arrays of numeric types.
913
+ * For numeric types this is a single number.
914
+ * For fixed-length arrays this is an array with componentCount number of elements.
915
+ * The normalized property has no effect on these values: they always correspond to the integer values.
916
+ */
917
+ max?: number | number[];
918
+ /**
919
+ * Minimum allowed values for property values.
920
+ * Only applicable for numeric types and fixed-length arrays of numeric types.
921
+ * For numeric types this is a single number.
922
+ * For fixed-length arrays this is an array with componentCount number of elements.
923
+ * The normalized property has no effect on these values: they always correspond to the integer values.
924
+ */
925
+ min?: number | number[];
926
+
927
+ /**
928
+ * A default value to use when the property value is not defined.
929
+ * If used, optional must be set to true.
930
+ * The type of the default value must match the property definition: For BOOLEAN use true or false.
931
+ * For STRING use a JSON string. For a numeric type use a JSON number.
932
+ * For ENUM use the enum name, not the integer value.
933
+ * For ARRAY use a JSON array containing values matching the componentType.
934
+ */
935
+ default?: boolean | number | string | number[];
936
+ /** If true, this property is optional. */
937
+ optional?: boolean; // default false;
938
+ /**
939
+ * An identifier that describes how this property should be interpreted.
940
+ * The semantic cannot be used by other properties in the class.
941
+ */
942
+ semantic?: string;
943
+ extensions?: Record<string, any>;
944
+ extras?: any;
945
+ [key: string]: any;
946
+ };
947
+
948
+ /**
949
+ * Spec - https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_feature_metadata#classpropertytype
950
+ */
951
+ type ClassPropertyType =
952
+ | 'INT8'
953
+ | 'UINT8'
954
+ | 'INT16'
955
+ | 'UINT16'
956
+ | 'INT32'
957
+ | 'UINT32'
958
+ | 'INT64'
959
+ | 'UINT64'
960
+ | 'FLOAT32'
961
+ | 'FLOAT64'
962
+ | 'BOOLEAN'
963
+ | 'STRING'
964
+ | 'ENUM'
965
+ | 'ARRAY';
966
+
967
+ /**
968
+ * Spec - https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_feature_metadata#enum
969
+ */
970
+ type ExtFeatureMetadataEnum = {
971
+ /** The name of the enum, e.g. for display purposes. */
972
+ name?: string;
973
+ /** The description of the enum. */
974
+ description?: string;
975
+ /** The type of the integer enum value. */
976
+ valueType?: 'INT8' | 'UINT8' | 'INT16' | 'UINT16' | 'INT32' | 'UINT32' | 'INT64' | 'UINT64'; // default: "UINT16"
977
+ /** An array of enum values. Duplicate names or duplicate integer values are not allowed. */
978
+ values: EnumValue[];
979
+ extensions?: Record<string, any>;
980
+ extras?: any;
981
+ [key: string]: any;
982
+ };
983
+
984
+ /**
985
+ * Spec - https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_feature_metadata#enum-value
986
+ */
987
+ type EnumValue = {
988
+ /** The name of the enum value. */
989
+ name: string;
990
+ /** The description of the enum value. */
991
+ description?: string;
992
+ /** The integer enum value. */
993
+ value: number; // default: "UINT16"
994
+ extensions?: Record<string, any>;
995
+ extras?: any;
996
+ [key: string]: any;
997
+ };
998
+
999
+ /**
1000
+ * Spec - https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_feature_metadata#feature-table
1001
+ */
1002
+ export type EXT_feature_metadata_feature_table = {
1003
+ featureTable: any;
1004
+ /** The class that property values conform to. The value must be a class ID declared in the classes dictionary. */
1005
+ class?: string;
1006
+ /** The number of features, as well as the number of elements in each property array. */
1007
+ count: number;
1008
+ /**
1009
+ * A dictionary, where each key corresponds to a property ID in the class properties dictionary
1010
+ * and each value is an object describing where property values are stored.
1011
+ * Optional properties may be excluded from this dictionary.
1012
+ */
1013
+ properties?: {
1014
+ [key: string]: FeatureTableProperty;
1015
+ };
1016
+ extensions?: Record<string, any>;
1017
+ extras?: any;
1018
+ [key: string]: any;
1019
+ };
1020
+
1021
+ /**
1022
+ * Spec - https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_feature_metadata#feature-table-property
1023
+ */
1024
+ export type FeatureTableProperty = {
1025
+ /**
1026
+ * The index of the buffer view containing property values.
1027
+ * The data type of property values is determined by the property definition:
1028
+ * When type is BOOLEAN values are packed into a bitfield.
1029
+ * When type is STRING values are stored as byte sequences and decoded as UTF-8 strings.
1030
+ * When type is a numeric type values are stored as the provided type.
1031
+ * When type is ENUM values are stored as the enum's valueType.
1032
+ * Each enum value in the buffer must match one of the allowed values in the enum definition.
1033
+ * When type is ARRAY elements are packed tightly together and the data type is based on the componentType following the same rules as above.
1034
+ * arrayOffsetBufferView is required for variable-size arrays
1035
+ * and stringOffsetBufferView is required for strings (for variable-length arrays of strings, both are required)
1036
+ * The buffer view byteOffset must be aligned to a multiple of 8 bytes.
1037
+ * If the buffer view's buffer is the GLB-stored BIN chunk the byte offset is measured relative to the beginning of the GLB.
1038
+ * Otherwise it is measured relative to the beginning of the buffer.
1039
+ */
1040
+ bufferView: number;
1041
+ /** The type of values in arrayOffsetBufferView and stringOffsetBufferView. */
1042
+ offsetType?: string; // default: "UINT32"
1043
+ /**
1044
+ * The index of the buffer view containing offsets for variable-length arrays.
1045
+ * The number of offsets is equal to the feature table count plus one.
1046
+ * The offsets represent the start positions of each array, with the last offset representing the position after the last array.
1047
+ * The array length is computed using the difference between the current offset and the subsequent offset.
1048
+ * If componentType is STRING the offsets index into the string offsets array (stored in stringOffsetBufferView),
1049
+ * otherwise they index into the property array (stored in bufferView).
1050
+ * The data type of these offsets is determined by offsetType.
1051
+ * The buffer view byteOffset must be aligned to a multiple of 8 bytes in the same manner as the main bufferView
1052
+ */
1053
+ arrayOffsetBufferView?: number;
1054
+ /**
1055
+ * The index of the buffer view containing offsets for strings.
1056
+ * The number of offsets is equal to the number of string components plus one.
1057
+ * The offsets represent the byte offsets of each string in the main bufferView,
1058
+ * with the last offset representing the byte offset after the last string.
1059
+ * The string byte length is computed using the difference between the current offset and the subsequent offset.
1060
+ * The data type of these offsets is determined by offsetType.
1061
+ * The buffer view byteOffset must be aligned to a multiple of 8 bytes in the same manner as the main bufferView.
1062
+ */
1063
+ stringOffsetBufferView?: number;
1064
+ extensions?: Record<string, any>;
1065
+ extras?: any;
1066
+ [key: string]: any;
1067
+ };
1068
+
1069
+ /**
1070
+ * Spec - https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_feature_metadata#feature-texture
1071
+ */
1072
+ type FeatureTexture = {
1073
+ /** The class this feature texture conforms to. The value must be a class ID declared in the classes dictionary. */
1074
+ class: string;
1075
+ /**
1076
+ * A dictionary, where each key corresponds to a property ID in the class properties dictionary
1077
+ * and each value describes the texture channels containing property values.
1078
+ */
1079
+ properties: {
1080
+ [key: string]: TextureAccessor;
1081
+ };
1082
+ extensions?: Record<string, any>;
1083
+ extras?: any;
1084
+ [key: string]: any;
1085
+ };
1086
+
1087
+ /**
1088
+ * Spec - https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_feature_metadata#texture-accessor
1089
+ */
1090
+ type TextureAccessor = {
1091
+ /** Texture channels containing property values. Channels are labeled by rgba and are swizzled with a string of 1-4 characters. */
1092
+ channels: string;
1093
+ /** The glTF texture and texture coordinates to use. */
1094
+ texture: GLTFTextureInfo;
1095
+ extensions?: Record<string, any>;
1096
+ extras?: any;
1097
+ [key: string]: any;
1098
+ };
1099
+
1100
+ /**
1101
+ * Spec - https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_feature_metadata#statistics-1
1102
+ */
1103
+ type Statistics = {
1104
+ /**
1105
+ * A dictionary, where each key is a class ID declared in the classes dictionary
1106
+ * and each value is an object containing statistics about features that conform to the class.
1107
+ */
1108
+ classes?: {
1109
+ [key: string]: ClassStatistics;
1110
+ };
1111
+ extensions?: Record<string, any>;
1112
+ extras?: any;
1113
+ [key: string]: any;
1114
+ };
1115
+
1116
+ /**
1117
+ * Spec - https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_feature_metadata#class-statistics
1118
+ */
1119
+ type ClassStatistics = {
1120
+ /** The number of features that conform to the class. */
1121
+ count?: number;
1122
+ /**
1123
+ * A dictionary, where each key is a class ID declared in the classes dictionary
1124
+ * and each value is an object containing statistics about property values.
1125
+ */
1126
+ properties?: {
1127
+ [key: string]: StatisticsClassProperty;
1128
+ };
1129
+ extensions?: Record<string, any>;
1130
+ extras?: any;
1131
+ [key: string]: any;
1132
+ };
1133
+
1134
+ /**
1135
+ * Spec - https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_feature_metadata#property-statistics
1136
+ * min, max, mean, median, standardDeviation, variance, sum are
1137
+ * only applicable for numeric types and fixed-length arrays of numeric types.
1138
+ * For numeric types this is a single number.
1139
+ * For fixed-length arrays this is an array with componentCount number of elements.
1140
+ * The normalized property has no effect on these values.
1141
+ */
1142
+ type StatisticsClassProperty = {
1143
+ /** The minimum property value. */
1144
+ min?: number | number[];
1145
+ /** The maximum property value. */
1146
+ max?: number | number[];
1147
+ /** The arithmetic mean of the property values. */
1148
+ mean?: number | number[];
1149
+ /** The median of the property values. */
1150
+ median?: number | number[];
1151
+ /** The standard deviation of the property values. */
1152
+ standardDeviation?: number | number[];
1153
+ /** The variance of the property values. */
1154
+ variance?: number | number[];
1155
+ /** The sum of the property values. */
1156
+ sum?: number | number[];
1157
+ /**
1158
+ * A dictionary, where each key corresponds to an enum name and each value is the number of occurrences of that enum.
1159
+ * Only applicable when type or componentType is ENUM.
1160
+ * For fixed-length arrays, this is an array with componentCount number of elements.
1161
+ */
1162
+ occurrences: {
1163
+ [key: string]: number | number[];
1164
+ };
1165
+ extensions?: Record<string, any>;
1166
+ extras?: any;
1167
+ [key: string]: any;
1168
+ };
1169
+
1170
+ /**
1171
+ * 3DTilesNext EXT_feature_metadata primitive extension
1172
+ * Spec - https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_feature_metadata#primitive-extension
1173
+ */
1174
+ export type GLTF_EXT_feature_metadata_primitive = {
1175
+ /** Feature ids definition in attributes */
1176
+ featureIdAttributes?: GLTF_EXT_feature_metadata_attribute[];
1177
+ /** Feature ids definition in textures */
1178
+ featureIdTextures?: GLTF_EXT_feature_metadata_attribute[];
1179
+ /** An array of IDs of feature textures from the root EXT_feature_metadata object. */
1180
+ featureTextures?: string[];
1181
+ extensions?: Record<string, any>;
1182
+ extras?: any;
1183
+ [key: string]: any;
1184
+ };
1185
+
1186
+ /**
1187
+ * Attribute which described featureIds definition.
1188
+ */
1189
+ export type GLTF_EXT_feature_metadata_attribute = {
1190
+ /** Name of feature table */
1191
+ featureTable: string;
1192
+ /** Described how feature ids are defined */
1193
+ featureIds: ExtFeatureMetadataFeatureIds;
1194
+ extensions?: Record<string, any>;
1195
+ extras?: any;
1196
+ [key: string]: any;
1197
+ };
1198
+
1199
+ /**
1200
+ * Defining featureIds by attributes or implicitly.
1201
+ */
1202
+ type ExtFeatureMetadataFeatureIds = {
1203
+ /** Name of attribute where featureIds are defined */
1204
+ attribute?: string;
1205
+ /** Sets a constant feature ID for each vertex. The default is 0. */
1206
+ constant?: number;
1207
+ /** Sets the rate at which feature IDs increment.
1208
+ * If divisor is zero then constant is used.
1209
+ * If divisor is greater than zero the feature ID increments once per divisor sets of vertices, starting at constant.
1210
+ * The default is 0
1211
+ */
1212
+ divisor?: number;
1213
+ /** gLTF textureInfo object - https://github.com/CesiumGS/glTF/blob/3d-tiles-next/specification/2.0/schema/textureInfo.schema.json */
1214
+ texture?: ExtFeatureMetadataTexture;
1215
+ /** Must be a single channel ("r", "g", "b", or "a") */
1216
+ channels?: 'r' | 'g' | 'b' | 'a';
1217
+ };
1218
+
1219
+ /**
1220
+ * Reference to a texture.
1221
+ */
1222
+ type ExtFeatureMetadataTexture = {
1223
+ /** The set index of texture's TEXCOORD attribute used for texture coordinate mapping.*/
1224
+ texCoord: number;
1225
+ /** The index of the texture. */
1226
+ index: number;
1227
+ };
1228
+
1229
+ export type GLTFObject =
1230
+ | GLTFAccessor
1231
+ | GLTFBuffer
1232
+ | GLTFBufferView
1233
+ | GLTFMeshPrimitive
1234
+ | GLTFMesh
1235
+ | GLTFNode
1236
+ | GLTFMaterial
1237
+ | GLTFSampler
1238
+ | GLTFScene
1239
+ | GLTFSkin
1240
+ | GLTFTexture
1241
+ | GLTFImage;