@onerjs/loaders 8.23.1

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 (280) hide show
  1. package/OBJ/index.d.ts +4 -0
  2. package/OBJ/index.js +5 -0
  3. package/OBJ/index.js.map +1 -0
  4. package/OBJ/mtlFileLoader.d.ts +41 -0
  5. package/OBJ/mtlFileLoader.js +231 -0
  6. package/OBJ/mtlFileLoader.js.map +1 -0
  7. package/OBJ/objFileLoader.d.ts +136 -0
  8. package/OBJ/objFileLoader.js +318 -0
  9. package/OBJ/objFileLoader.js.map +1 -0
  10. package/OBJ/objFileLoader.metadata.d.ts +4 -0
  11. package/OBJ/objFileLoader.metadata.js +5 -0
  12. package/OBJ/objFileLoader.metadata.js.map +1 -0
  13. package/OBJ/objLoadingOptions.d.ts +47 -0
  14. package/OBJ/objLoadingOptions.js +2 -0
  15. package/OBJ/objLoadingOptions.js.map +1 -0
  16. package/OBJ/solidParser.d.ts +174 -0
  17. package/OBJ/solidParser.js +862 -0
  18. package/OBJ/solidParser.js.map +1 -0
  19. package/SPLAT/index.d.ts +2 -0
  20. package/SPLAT/index.js +4 -0
  21. package/SPLAT/index.js.map +1 -0
  22. package/SPLAT/splatFileLoader.d.ts +88 -0
  23. package/SPLAT/splatFileLoader.js +562 -0
  24. package/SPLAT/splatFileLoader.js.map +1 -0
  25. package/SPLAT/splatFileLoader.metadata.d.ts +14 -0
  26. package/SPLAT/splatFileLoader.metadata.js +12 -0
  27. package/SPLAT/splatFileLoader.metadata.js.map +1 -0
  28. package/SPLAT/splatLoadingOptions.d.ts +13 -0
  29. package/SPLAT/splatLoadingOptions.js +2 -0
  30. package/SPLAT/splatLoadingOptions.js.map +1 -0
  31. package/STL/index.d.ts +1 -0
  32. package/STL/index.js +2 -0
  33. package/STL/index.js.map +1 -0
  34. package/STL/stlFileLoader.d.ts +78 -0
  35. package/STL/stlFileLoader.js +239 -0
  36. package/STL/stlFileLoader.js.map +1 -0
  37. package/STL/stlFileLoader.metadata.d.ts +8 -0
  38. package/STL/stlFileLoader.metadata.js +8 -0
  39. package/STL/stlFileLoader.metadata.js.map +1 -0
  40. package/bvh/bvhFileLoader.d.ts +69 -0
  41. package/bvh/bvhFileLoader.js +133 -0
  42. package/bvh/bvhFileLoader.js.map +1 -0
  43. package/bvh/bvhFileLoader.metadata.d.ts +8 -0
  44. package/bvh/bvhFileLoader.metadata.js +8 -0
  45. package/bvh/bvhFileLoader.metadata.js.map +1 -0
  46. package/bvh/bvhLoader.d.ts +14 -0
  47. package/bvh/bvhLoader.js +329 -0
  48. package/bvh/bvhLoader.js.map +1 -0
  49. package/bvh/bvhLoadingOptions.d.ts +9 -0
  50. package/bvh/bvhLoadingOptions.js +2 -0
  51. package/bvh/bvhLoadingOptions.js.map +1 -0
  52. package/bvh/index.d.ts +2 -0
  53. package/bvh/index.js +4 -0
  54. package/bvh/index.js.map +1 -0
  55. package/bvh/license.md +21 -0
  56. package/dynamic.d.ts +5 -0
  57. package/dynamic.js +57 -0
  58. package/dynamic.js.map +1 -0
  59. package/glTF/1.0/glTFBinaryExtension.d.ts +16 -0
  60. package/glTF/1.0/glTFBinaryExtension.js +65 -0
  61. package/glTF/1.0/glTFBinaryExtension.js.map +1 -0
  62. package/glTF/1.0/glTFLoader.d.ts +144 -0
  63. package/glTF/1.0/glTFLoader.js +1841 -0
  64. package/glTF/1.0/glTFLoader.js.map +1 -0
  65. package/glTF/1.0/glTFLoaderInterfaces.d.ts +412 -0
  66. package/glTF/1.0/glTFLoaderInterfaces.js +96 -0
  67. package/glTF/1.0/glTFLoaderInterfaces.js.map +1 -0
  68. package/glTF/1.0/glTFLoaderUtils.d.ts +71 -0
  69. package/glTF/1.0/glTFLoaderUtils.js +255 -0
  70. package/glTF/1.0/glTFLoaderUtils.js.map +1 -0
  71. package/glTF/1.0/glTFMaterialsCommonExtension.d.ts +13 -0
  72. package/glTF/1.0/glTFMaterialsCommonExtension.js +131 -0
  73. package/glTF/1.0/glTFMaterialsCommonExtension.js.map +1 -0
  74. package/glTF/1.0/index.d.ts +5 -0
  75. package/glTF/1.0/index.js +6 -0
  76. package/glTF/1.0/index.js.map +1 -0
  77. package/glTF/2.0/Extensions/EXT_lights_ies.d.ts +41 -0
  78. package/glTF/2.0/Extensions/EXT_lights_ies.js +84 -0
  79. package/glTF/2.0/Extensions/EXT_lights_ies.js.map +1 -0
  80. package/glTF/2.0/Extensions/EXT_lights_image_based.d.ts +48 -0
  81. package/glTF/2.0/Extensions/EXT_lights_image_based.js +116 -0
  82. package/glTF/2.0/Extensions/EXT_lights_image_based.js.map +1 -0
  83. package/glTF/2.0/Extensions/EXT_materials_diffuse_roughness.d.ts +43 -0
  84. package/glTF/2.0/Extensions/EXT_materials_diffuse_roughness.js +69 -0
  85. package/glTF/2.0/Extensions/EXT_materials_diffuse_roughness.js.map +1 -0
  86. package/glTF/2.0/Extensions/EXT_mesh_gpu_instancing.d.ts +39 -0
  87. package/glTF/2.0/Extensions/EXT_mesh_gpu_instancing.js +82 -0
  88. package/glTF/2.0/Extensions/EXT_mesh_gpu_instancing.js.map +1 -0
  89. package/glTF/2.0/Extensions/EXT_meshopt_compression.d.ts +39 -0
  90. package/glTF/2.0/Extensions/EXT_meshopt_compression.js +51 -0
  91. package/glTF/2.0/Extensions/EXT_meshopt_compression.js.map +1 -0
  92. package/glTF/2.0/Extensions/EXT_texture_avif.d.ts +34 -0
  93. package/glTF/2.0/Extensions/EXT_texture_avif.js +39 -0
  94. package/glTF/2.0/Extensions/EXT_texture_avif.js.map +1 -0
  95. package/glTF/2.0/Extensions/EXT_texture_webp.d.ts +33 -0
  96. package/glTF/2.0/Extensions/EXT_texture_webp.js +38 -0
  97. package/glTF/2.0/Extensions/EXT_texture_webp.js.map +1 -0
  98. package/glTF/2.0/Extensions/ExtrasAsMetadata.d.ts +48 -0
  99. package/glTF/2.0/Extensions/ExtrasAsMetadata.js +63 -0
  100. package/glTF/2.0/Extensions/ExtrasAsMetadata.js.map +1 -0
  101. package/glTF/2.0/Extensions/KHR_animation_pointer.d.ts +47 -0
  102. package/glTF/2.0/Extensions/KHR_animation_pointer.data.d.ts +1 -0
  103. package/glTF/2.0/Extensions/KHR_animation_pointer.data.js +239 -0
  104. package/glTF/2.0/Extensions/KHR_animation_pointer.data.js.map +1 -0
  105. package/glTF/2.0/Extensions/KHR_animation_pointer.js +78 -0
  106. package/glTF/2.0/Extensions/KHR_animation_pointer.js.map +1 -0
  107. package/glTF/2.0/Extensions/KHR_draco_mesh_compression.d.ts +47 -0
  108. package/glTF/2.0/Extensions/KHR_draco_mesh_compression.js +93 -0
  109. package/glTF/2.0/Extensions/KHR_draco_mesh_compression.js.map +1 -0
  110. package/glTF/2.0/Extensions/KHR_interactivity/declarationMapper.d.ts +352 -0
  111. package/glTF/2.0/Extensions/KHR_interactivity/declarationMapper.js +1700 -0
  112. package/glTF/2.0/Extensions/KHR_interactivity/declarationMapper.js.map +1 -0
  113. package/glTF/2.0/Extensions/KHR_interactivity/flowGraphGLTFDataProvider.d.ts +33 -0
  114. package/glTF/2.0/Extensions/KHR_interactivity/flowGraphGLTFDataProvider.js +20 -0
  115. package/glTF/2.0/Extensions/KHR_interactivity/flowGraphGLTFDataProvider.js.map +1 -0
  116. package/glTF/2.0/Extensions/KHR_interactivity/index.d.ts +3 -0
  117. package/glTF/2.0/Extensions/KHR_interactivity/index.js +4 -0
  118. package/glTF/2.0/Extensions/KHR_interactivity/index.js.map +1 -0
  119. package/glTF/2.0/Extensions/KHR_interactivity/interactivityGraphParser.d.ts +70 -0
  120. package/glTF/2.0/Extensions/KHR_interactivity/interactivityGraphParser.js +450 -0
  121. package/glTF/2.0/Extensions/KHR_interactivity/interactivityGraphParser.js.map +1 -0
  122. package/glTF/2.0/Extensions/KHR_interactivity.d.ts +38 -0
  123. package/glTF/2.0/Extensions/KHR_interactivity.js +151 -0
  124. package/glTF/2.0/Extensions/KHR_interactivity.js.map +1 -0
  125. package/glTF/2.0/Extensions/KHR_lights_punctual.d.ts +41 -0
  126. package/glTF/2.0/Extensions/KHR_lights_punctual.js +92 -0
  127. package/glTF/2.0/Extensions/KHR_lights_punctual.js.map +1 -0
  128. package/glTF/2.0/Extensions/KHR_materials_anisotropy.d.ts +42 -0
  129. package/glTF/2.0/Extensions/KHR_materials_anisotropy.js +61 -0
  130. package/glTF/2.0/Extensions/KHR_materials_anisotropy.js.map +1 -0
  131. package/glTF/2.0/Extensions/KHR_materials_clearcoat.d.ts +43 -0
  132. package/glTF/2.0/Extensions/KHR_materials_clearcoat.js +94 -0
  133. package/glTF/2.0/Extensions/KHR_materials_clearcoat.js.map +1 -0
  134. package/glTF/2.0/Extensions/KHR_materials_diffuse_transmission.d.ts +43 -0
  135. package/glTF/2.0/Extensions/KHR_materials_diffuse_transmission.js +95 -0
  136. package/glTF/2.0/Extensions/KHR_materials_diffuse_transmission.js.map +1 -0
  137. package/glTF/2.0/Extensions/KHR_materials_dispersion.d.ts +43 -0
  138. package/glTF/2.0/Extensions/KHR_materials_dispersion.js +60 -0
  139. package/glTF/2.0/Extensions/KHR_materials_dispersion.js.map +1 -0
  140. package/glTF/2.0/Extensions/KHR_materials_emissive_strength.d.ts +42 -0
  141. package/glTF/2.0/Extensions/KHR_materials_emissive_strength.js +52 -0
  142. package/glTF/2.0/Extensions/KHR_materials_emissive_strength.js.map +1 -0
  143. package/glTF/2.0/Extensions/KHR_materials_ior.d.ts +46 -0
  144. package/glTF/2.0/Extensions/KHR_materials_ior.js +62 -0
  145. package/glTF/2.0/Extensions/KHR_materials_ior.js.map +1 -0
  146. package/glTF/2.0/Extensions/KHR_materials_iridescence.d.ts +42 -0
  147. package/glTF/2.0/Extensions/KHR_materials_iridescence.js +71 -0
  148. package/glTF/2.0/Extensions/KHR_materials_iridescence.js.map +1 -0
  149. package/glTF/2.0/Extensions/KHR_materials_pbrSpecularGlossiness.d.ts +42 -0
  150. package/glTF/2.0/Extensions/KHR_materials_pbrSpecularGlossiness.js +81 -0
  151. package/glTF/2.0/Extensions/KHR_materials_pbrSpecularGlossiness.js.map +1 -0
  152. package/glTF/2.0/Extensions/KHR_materials_sheen.d.ts +43 -0
  153. package/glTF/2.0/Extensions/KHR_materials_sheen.js +85 -0
  154. package/glTF/2.0/Extensions/KHR_materials_sheen.js.map +1 -0
  155. package/glTF/2.0/Extensions/KHR_materials_specular.d.ts +42 -0
  156. package/glTF/2.0/Extensions/KHR_materials_specular.js +85 -0
  157. package/glTF/2.0/Extensions/KHR_materials_specular.js.map +1 -0
  158. package/glTF/2.0/Extensions/KHR_materials_transmission.d.ts +42 -0
  159. package/glTF/2.0/Extensions/KHR_materials_transmission.js +306 -0
  160. package/glTF/2.0/Extensions/KHR_materials_transmission.js.map +1 -0
  161. package/glTF/2.0/Extensions/KHR_materials_unlit.d.ts +42 -0
  162. package/glTF/2.0/Extensions/KHR_materials_unlit.js +73 -0
  163. package/glTF/2.0/Extensions/KHR_materials_unlit.js.map +1 -0
  164. package/glTF/2.0/Extensions/KHR_materials_variants.d.ts +112 -0
  165. package/glTF/2.0/Extensions/KHR_materials_variants.js +263 -0
  166. package/glTF/2.0/Extensions/KHR_materials_variants.js.map +1 -0
  167. package/glTF/2.0/Extensions/KHR_materials_volume.d.ts +43 -0
  168. package/glTF/2.0/Extensions/KHR_materials_volume.js +86 -0
  169. package/glTF/2.0/Extensions/KHR_materials_volume.js.map +1 -0
  170. package/glTF/2.0/Extensions/KHR_mesh_quantization.d.ts +29 -0
  171. package/glTF/2.0/Extensions/KHR_mesh_quantization.js +23 -0
  172. package/glTF/2.0/Extensions/KHR_mesh_quantization.js.map +1 -0
  173. package/glTF/2.0/Extensions/KHR_node_hoverability.d.ts +31 -0
  174. package/glTF/2.0/Extensions/KHR_node_hoverability.js +190 -0
  175. package/glTF/2.0/Extensions/KHR_node_hoverability.js.map +1 -0
  176. package/glTF/2.0/Extensions/KHR_node_selectability.d.ts +30 -0
  177. package/glTF/2.0/Extensions/KHR_node_selectability.js +124 -0
  178. package/glTF/2.0/Extensions/KHR_node_selectability.js.map +1 -0
  179. package/glTF/2.0/Extensions/KHR_node_visibility.d.ts +30 -0
  180. package/glTF/2.0/Extensions/KHR_node_visibility.js +69 -0
  181. package/glTF/2.0/Extensions/KHR_node_visibility.js.map +1 -0
  182. package/glTF/2.0/Extensions/KHR_texture_basisu.d.ts +33 -0
  183. package/glTF/2.0/Extensions/KHR_texture_basisu.js +38 -0
  184. package/glTF/2.0/Extensions/KHR_texture_basisu.js.map +1 -0
  185. package/glTF/2.0/Extensions/KHR_texture_transform.d.ts +37 -0
  186. package/glTF/2.0/Extensions/KHR_texture_transform.js +59 -0
  187. package/glTF/2.0/Extensions/KHR_texture_transform.js.map +1 -0
  188. package/glTF/2.0/Extensions/KHR_xmp_json_ld.d.ts +39 -0
  189. package/glTF/2.0/Extensions/KHR_xmp_json_ld.js +48 -0
  190. package/glTF/2.0/Extensions/KHR_xmp_json_ld.js.map +1 -0
  191. package/glTF/2.0/Extensions/MSFT_audio_emitter.d.ts +56 -0
  192. package/glTF/2.0/Extensions/MSFT_audio_emitter.js +227 -0
  193. package/glTF/2.0/Extensions/MSFT_audio_emitter.js.map +1 -0
  194. package/glTF/2.0/Extensions/MSFT_lod.d.ts +104 -0
  195. package/glTF/2.0/Extensions/MSFT_lod.js +338 -0
  196. package/glTF/2.0/Extensions/MSFT_lod.js.map +1 -0
  197. package/glTF/2.0/Extensions/MSFT_minecraftMesh.d.ts +27 -0
  198. package/glTF/2.0/Extensions/MSFT_minecraftMesh.js +41 -0
  199. package/glTF/2.0/Extensions/MSFT_minecraftMesh.js.map +1 -0
  200. package/glTF/2.0/Extensions/MSFT_sRGBFactors.d.ts +27 -0
  201. package/glTF/2.0/Extensions/MSFT_sRGBFactors.js +42 -0
  202. package/glTF/2.0/Extensions/MSFT_sRGBFactors.js.map +1 -0
  203. package/glTF/2.0/Extensions/dynamic.d.ts +4 -0
  204. package/glTF/2.0/Extensions/dynamic.js +156 -0
  205. package/glTF/2.0/Extensions/dynamic.js.map +1 -0
  206. package/glTF/2.0/Extensions/gltfPathToObjectConverter.d.ts +45 -0
  207. package/glTF/2.0/Extensions/gltfPathToObjectConverter.js +101 -0
  208. package/glTF/2.0/Extensions/gltfPathToObjectConverter.js.map +1 -0
  209. package/glTF/2.0/Extensions/index.d.ts +39 -0
  210. package/glTF/2.0/Extensions/index.js +41 -0
  211. package/glTF/2.0/Extensions/index.js.map +1 -0
  212. package/glTF/2.0/Extensions/objectModelMapping.d.ts +289 -0
  213. package/glTF/2.0/Extensions/objectModelMapping.js +828 -0
  214. package/glTF/2.0/Extensions/objectModelMapping.js.map +1 -0
  215. package/glTF/2.0/glTFLoader.d.ts +429 -0
  216. package/glTF/2.0/glTFLoader.js +2408 -0
  217. package/glTF/2.0/glTFLoader.js.map +1 -0
  218. package/glTF/2.0/glTFLoaderAnimation.d.ts +42 -0
  219. package/glTF/2.0/glTFLoaderAnimation.js +80 -0
  220. package/glTF/2.0/glTFLoaderAnimation.js.map +1 -0
  221. package/glTF/2.0/glTFLoaderExtension.d.ts +165 -0
  222. package/glTF/2.0/glTFLoaderExtension.js +2 -0
  223. package/glTF/2.0/glTFLoaderExtension.js.map +1 -0
  224. package/glTF/2.0/glTFLoaderExtensionRegistry.d.ts +25 -0
  225. package/glTF/2.0/glTFLoaderExtensionRegistry.js +33 -0
  226. package/glTF/2.0/glTFLoaderExtensionRegistry.js.map +1 -0
  227. package/glTF/2.0/glTFLoaderInterfaces.d.ts +257 -0
  228. package/glTF/2.0/glTFLoaderInterfaces.js +2 -0
  229. package/glTF/2.0/glTFLoaderInterfaces.js.map +1 -0
  230. package/glTF/2.0/index.d.ts +6 -0
  231. package/glTF/2.0/index.js +8 -0
  232. package/glTF/2.0/index.js.map +1 -0
  233. package/glTF/glTFFileLoader.d.ts +516 -0
  234. package/glTF/glTFFileLoader.js +968 -0
  235. package/glTF/glTFFileLoader.js.map +1 -0
  236. package/glTF/glTFFileLoader.metadata.d.ts +15 -0
  237. package/glTF/glTFFileLoader.metadata.js +18 -0
  238. package/glTF/glTFFileLoader.metadata.js.map +1 -0
  239. package/glTF/glTFValidation.d.ts +29 -0
  240. package/glTF/glTFValidation.js +126 -0
  241. package/glTF/glTFValidation.js.map +1 -0
  242. package/glTF/index.d.ts +5 -0
  243. package/glTF/index.js +7 -0
  244. package/glTF/index.js.map +1 -0
  245. package/index.d.ts +5 -0
  246. package/index.js +7 -0
  247. package/index.js.map +1 -0
  248. package/legacy/legacy-bvhFileLoader.d.ts +1 -0
  249. package/legacy/legacy-bvhFileLoader.js +16 -0
  250. package/legacy/legacy-bvhFileLoader.js.map +1 -0
  251. package/legacy/legacy-glTF.d.ts +2 -0
  252. package/legacy/legacy-glTF.js +19 -0
  253. package/legacy/legacy-glTF.js.map +1 -0
  254. package/legacy/legacy-glTF1.d.ts +2 -0
  255. package/legacy/legacy-glTF1.js +16 -0
  256. package/legacy/legacy-glTF1.js.map +1 -0
  257. package/legacy/legacy-glTF1FileLoader.d.ts +2 -0
  258. package/legacy/legacy-glTF1FileLoader.js +4 -0
  259. package/legacy/legacy-glTF1FileLoader.js.map +1 -0
  260. package/legacy/legacy-glTF2.d.ts +2 -0
  261. package/legacy/legacy-glTF2.js +35 -0
  262. package/legacy/legacy-glTF2.js.map +1 -0
  263. package/legacy/legacy-glTF2FileLoader.d.ts +2 -0
  264. package/legacy/legacy-glTF2FileLoader.js +4 -0
  265. package/legacy/legacy-glTF2FileLoader.js.map +1 -0
  266. package/legacy/legacy-glTFFileLoader.d.ts +3 -0
  267. package/legacy/legacy-glTFFileLoader.js +5 -0
  268. package/legacy/legacy-glTFFileLoader.js.map +1 -0
  269. package/legacy/legacy-objFileLoader.d.ts +1 -0
  270. package/legacy/legacy-objFileLoader.js +16 -0
  271. package/legacy/legacy-objFileLoader.js.map +1 -0
  272. package/legacy/legacy-stlFileLoader.d.ts +1 -0
  273. package/legacy/legacy-stlFileLoader.js +16 -0
  274. package/legacy/legacy-stlFileLoader.js.map +1 -0
  275. package/legacy/legacy.d.ts +7 -0
  276. package/legacy/legacy.js +10 -0
  277. package/legacy/legacy.js.map +1 -0
  278. package/license.md +71 -0
  279. package/package.json +49 -0
  280. package/readme.md +23 -0
@@ -0,0 +1,352 @@
1
+ import type { IKHRInteractivity_Declaration, IKHRInteractivity_Graph, IKHRInteractivity_Node } from "babylonjs-gltf2interface";
2
+ import { FlowGraphBlockNames } from "@babylonjs/core/FlowGraph/Blocks/flowGraphBlockNames.js";
3
+ import type { ISerializedFlowGraphBlock, ISerializedFlowGraphContext } from "@babylonjs/core/FlowGraph/typeDefinitions.js";
4
+ import type { InteractivityGraphToFlowGraphParser } from "./interactivityGraphParser.js";
5
+ import type { IGLTF } from "../../glTFLoaderInterfaces.js";
6
+ interface IGLTFToFlowGraphMappingObject<I = any, O = any> {
7
+ /**
8
+ * The name of the property in the FlowGraph block.
9
+ */
10
+ name: string;
11
+ /**
12
+ * The type of the property in the glTF specs.
13
+ * If not provided will be inferred.
14
+ */
15
+ gltfType?: string;
16
+ /**
17
+ * The type of the property in the FlowGraph block.
18
+ * If not defined it equals the glTF type.
19
+ */
20
+ flowGraphType?: string;
21
+ /**
22
+ * A function that transforms the data from the glTF to the FlowGraph block.
23
+ */
24
+ dataTransformer?: (data: I[], parser: InteractivityGraphToFlowGraphParser) => O[];
25
+ /**
26
+ * If the property is in the options passed to the constructor of the block.
27
+ */
28
+ inOptions?: boolean;
29
+ /**
30
+ * If the property is a pointer to a value.
31
+ * This will add an extra JsonPointerParser block to the graph.
32
+ */
33
+ isPointer?: boolean;
34
+ /**
35
+ * If the property is an index to a value.
36
+ * if defined this will be the name of the array to find the object in.
37
+ */
38
+ isVariable?: boolean;
39
+ /**
40
+ * the name of the class type this value will be mapped to.
41
+ * This is used if we generate more than one block for a single glTF node.
42
+ * Defaults to the first block in the mapping.
43
+ */
44
+ toBlock?: FlowGraphBlockNames;
45
+ /**
46
+ * Used in configuration values. If defined, this will be the default value, if no value is provided.
47
+ */
48
+ defaultValue?: O;
49
+ }
50
+ export interface IGLTFToFlowGraphMapping {
51
+ /**
52
+ * The type of the FlowGraph block(s).
53
+ * Typically will be a single element in an array.
54
+ * When adding blocks defined in this module use the KHR_interactivity prefix.
55
+ */
56
+ blocks: (FlowGraphBlockNames | string)[];
57
+ /**
58
+ * The inputs of the glTF node mapped to the FlowGraph block.
59
+ */
60
+ inputs?: {
61
+ /**
62
+ * The value inputs of the glTF node mapped to the FlowGraph block.
63
+ */
64
+ values?: {
65
+ [originName: string]: IGLTFToFlowGraphMappingObject;
66
+ };
67
+ /**
68
+ * The flow inputs of the glTF node mapped to the FlowGraph block.
69
+ */
70
+ flows?: {
71
+ [originName: string]: IGLTFToFlowGraphMappingObject;
72
+ };
73
+ };
74
+ /**
75
+ * The outputs of the glTF node mapped to the FlowGraph block.
76
+ */
77
+ outputs?: {
78
+ /**
79
+ * The value outputs of the glTF node mapped to the FlowGraph block.
80
+ */
81
+ values?: {
82
+ [originName: string]: IGLTFToFlowGraphMappingObject;
83
+ };
84
+ /**
85
+ * The flow outputs of the glTF node mapped to the FlowGraph block.
86
+ */
87
+ flows?: {
88
+ [originName: string]: IGLTFToFlowGraphMappingObject;
89
+ };
90
+ };
91
+ /**
92
+ * The configuration of the glTF node mapped to the FlowGraph block.
93
+ * This information is usually passed to the constructor of the block.
94
+ */
95
+ configuration?: {
96
+ [originName: string]: IGLTFToFlowGraphMappingObject;
97
+ };
98
+ /**
99
+ * If we generate more than one block for a single glTF node, this mapping will be used to map
100
+ * between the flowGraph classes.
101
+ */
102
+ typeToTypeMapping?: {
103
+ [originName: string]: IGLTFToFlowGraphMappingObject;
104
+ };
105
+ /**
106
+ * The connections between two or more blocks.
107
+ * This is used to connect the blocks in the graph
108
+ */
109
+ interBlockConnectors?: {
110
+ /**
111
+ * The name of the input connection in the first block.
112
+ */
113
+ input: string;
114
+ /**
115
+ * The name of the output connection in the second block.
116
+ */
117
+ output: string;
118
+ /**
119
+ * The index of the block in the array of blocks that corresponds to the input.
120
+ */
121
+ inputBlockIndex: number;
122
+ /**
123
+ * The index of the block in the array of blocks that corresponds to the output.
124
+ */
125
+ outputBlockIndex: number;
126
+ /**
127
+ * If the connection is a variable connection or a flow connection.
128
+ */
129
+ isVariable?: boolean;
130
+ }[];
131
+ /**
132
+ * This optional function will allow to validate the node, according to the glTF specs.
133
+ * For example, if a node has a configuration object, it must be present and correct.
134
+ * This is a basic node-based validation.
135
+ * This function is expected to return false and log the error if the node is not valid.
136
+ * Note that this function can also modify the node, if needed.
137
+ *
138
+ * @param gltfBlock the glTF node to validate
139
+ * @param glTFObject the glTF object
140
+ * @returns true if validated, false if not.
141
+ */
142
+ validation?: (gltfBlock: IKHRInteractivity_Node, interactivityGraph: IKHRInteractivity_Graph, glTFObject?: IGLTF) => {
143
+ valid: boolean;
144
+ error?: string;
145
+ };
146
+ /**
147
+ * This is used if we need extra information for the constructor/options that is not provided directly by the glTF node.
148
+ * This function can return more than one node, if extra nodes are needed for this block to function correctly.
149
+ * Returning more than one block will usually happen when a json pointer was provided.
150
+ *
151
+ * @param gltfBlock the glTF node
152
+ * @param mapping the mapping object
153
+ * @param arrays the arrays of the interactivity object
154
+ * @param serializedObjects the serialized object
155
+ * @returns an array of serialized nodes that will be added to the graph.
156
+ */
157
+ extraProcessor?: (gltfBlock: IKHRInteractivity_Node, declaration: IKHRInteractivity_Declaration, mapping: IGLTFToFlowGraphMapping, parser: InteractivityGraphToFlowGraphParser, serializedObjects: ISerializedFlowGraphBlock[], context: ISerializedFlowGraphContext, globalGLTF?: IGLTF) => ISerializedFlowGraphBlock[];
158
+ }
159
+ export declare function getMappingForFullOperationName(fullOperationName: string): IGLTFToFlowGraphMapping | undefined;
160
+ export declare function getMappingForDeclaration(declaration: IKHRInteractivity_Declaration, returnNoOpIfNotAvailable?: boolean): IGLTFToFlowGraphMapping | undefined;
161
+ /**
162
+ * This function will add new mapping to glTF interactivity.
163
+ * Other extensions can define new types of blocks, this is the way to let interactivity know how to parse them.
164
+ * @param key the type of node, i.e. "variable/get"
165
+ * @param extension the extension of the interactivity operation, i.e. "KHR_selectability"
166
+ * @param mapping The mapping object. See documentation or examples below.
167
+ */
168
+ export declare function addNewInteractivityFlowGraphMapping(key: string, extension: string, mapping: IGLTFToFlowGraphMapping): void;
169
+ export declare function getAllSupportedNativeNodeTypes(): string[];
170
+ export {};
171
+ /**
172
+ *
173
+ * These are the nodes from the specs:
174
+
175
+ ### Math Nodes
176
+ 1. **Constants**
177
+ - E (`math/E`) FlowGraphBlockNames.E
178
+ - Pi (`math/Pi`) FlowGraphBlockNames.PI
179
+ - Infinity (`math/Inf`) FlowGraphBlockNames.Inf
180
+ - Not a Number (`math/NaN`) FlowGraphBlockNames.NaN
181
+ 2. **Arithmetic Nodes**
182
+ - Absolute Value (`math/abs`) FlowGraphBlockNames.Abs
183
+ - Sign (`math/sign`) FlowGraphBlockNames.Sign
184
+ - Truncate (`math/trunc`) FlowGraphBlockNames.Trunc
185
+ - Floor (`math/floor`) FlowGraphBlockNames.Floor
186
+ - Ceil (`math/ceil`) FlowGraphBlockNames.Ceil
187
+ - Round (`math/round`) FlowGraphBlockNames.Round
188
+ - Fraction (`math/fract`) FlowGraphBlockNames.Fract
189
+ - Negation (`math/neg`) FlowGraphBlockNames.Negation
190
+ - Addition (`math/add`) FlowGraphBlockNames.Add
191
+ - Subtraction (`math/sub`) FlowGraphBlockNames.Subtract
192
+ - Multiplication (`math/mul`) FlowGraphBlockNames.Multiply
193
+ - Division (`math/div`) FlowGraphBlockNames.Divide
194
+ - Remainder (`math/rem`) FlowGraphBlockNames.Modulo
195
+ - Minimum (`math/min`) FlowGraphBlockNames.Min
196
+ - Maximum (`math/max`) FlowGraphBlockNames.Max
197
+ - Clamp (`math/clamp`) FlowGraphBlockNames.Clamp
198
+ - Saturate (`math/saturate`) FlowGraphBlockNames.Saturate
199
+ - Interpolate (`math/mix`) FlowGraphBlockNames.MathInterpolation
200
+ 3. **Comparison Nodes**
201
+ - Equality (`math/eq`) FlowGraphBlockNames.Equality
202
+ - Less Than (`math/lt`) FlowGraphBlockNames.LessThan
203
+ - Less Than Or Equal To (`math/le`) FlowGraphBlockNames.LessThanOrEqual
204
+ - Greater Than (`math/gt`) FlowGraphBlockNames.GreaterThan
205
+ - Greater Than Or Equal To (`math/ge`) FlowGraphBlockNames.GreaterThanOrEqual
206
+ 4. **Special Nodes**
207
+ - Is Not a Number (`math/isNaN`) FlowGraphBlockNames.IsNaN
208
+ - Is Infinity (`math/isInf`) FlowGraphBlockNames.IsInfinity
209
+ - Select (`math/select`) FlowGraphBlockNames.Conditional
210
+ - Switch (`math/switch`) FlowGraphBlockNames.DataSwitch
211
+ - Random (`math/random`) FlowGraphBlockNames.Random
212
+ 5. **Angle and Trigonometry Nodes**
213
+ - Degrees-To-Radians (`math/rad`) FlowGraphBlockNames.DegToRad
214
+ - Radians-To-Degrees (`math/deg`) FlowGraphBlockNames.RadToDeg
215
+ - Sine (`math/sin`) FlowGraphBlockNames.Sin
216
+ - Cosine (`math/cos`) FlowGraphBlockNames.Cos
217
+ - Tangent (`math/tan`) FlowGraphBlockNames.Tan
218
+ - Arcsine (`math/asin`) FlowGraphBlockNames.Asin
219
+ - Arccosine (`math/acos`) FlowGraphBlockNames.Acos
220
+ - Arctangent (`math/atan`) FlowGraphBlockNames.Atan
221
+ - Arctangent 2 (`math/atan2`) FlowGraphBlockNames.Atan2
222
+ 6. **Hyperbolic Nodes**
223
+ - Hyperbolic Sine (`math/sinh`) FlowGraphBlockNames.Sinh
224
+ - Hyperbolic Cosine (`math/cosh`) FlowGraphBlockNames.Cosh
225
+ - Hyperbolic Tangent (`math/tanh`) FlowGraphBlockNames.Tanh
226
+ - Inverse Hyperbolic Sine (`math/asinh`) FlowGraphBlockNames.Asinh
227
+ - Inverse Hyperbolic Cosine (`math/acosh`) FlowGraphBlockNames.Acosh
228
+ - Inverse Hyperbolic Tangent (`math/atanh`) FlowGraphBlockNames.Atanh
229
+ 7. **Exponential Nodes**
230
+ - Exponent (`math/exp`) FlowGraphBlockNames.Exponential
231
+ - Natural Logarithm (`math/log`) FlowGraphBlockNames.Log
232
+ - Base-2 Logarithm (`math/log2`) FlowGraphBlockNames.Log2
233
+ - Base-10 Logarithm (`math/log10`) FlowGraphBlockNames.Log10
234
+ - Square Root (`math/sqrt`) FlowGraphBlockNames.SquareRoot
235
+ - Cube Root (`math/cbrt`) FlowGraphBlockNames.CubeRoot
236
+ - Power (`math/pow`) FlowGraphBlockNames.Power
237
+ 8. **Vector Nodes**
238
+ - Length (`math/length`) FlowGraphBlockNames.Length
239
+ - Normalize (`math/normalize`) FlowGraphBlockNames.Normalize
240
+ - Dot Product (`math/dot`) FlowGraphBlockNames.Dot
241
+ - Cross Product (`math/cross`) FlowGraphBlockNames.Cross
242
+ - Rotate 2D (`math/rotate2D`) FlowGraphBlockNames.Rotate2D
243
+ - Rotate 3D (`math/rotate3D`) FlowGraphBlockNames.Rotate3D
244
+ - Transform (`math/transform`) FlowGraphBlockNames.TransformVector
245
+ 9. **Matrix Nodes**
246
+ - Transpose (`math/transpose`) FlowGraphBlockNames.Transpose
247
+ - Determinant (`math/determinant`) FlowGraphBlockNames.Determinant
248
+ - Inverse (`math/inverse`) FlowGraphBlockNames.InvertMatrix
249
+ - Multiplication (`math/matMul`) FlowGraphBlockNames.MatrixMultiplication
250
+ - Compose (`math/matCompose`) FlowGraphBlockNames.MatrixCompose
251
+ - Decompose (`math/matDecompose`) FlowGraphBlockNames.MatrixDecompose
252
+ 10. **Quaternion Nodes**
253
+ - Conjugate (`math/quatConjugate`) FlowGraphBlockNames.Conjugate
254
+ - Multiplication (`math/quatMul`) FlowGraphBlockNames.Multiply
255
+ - Angle Between Quaternions (`math/quatAngleBetween`) FlowGraphBlockNames.AngleBetween
256
+ - Quaternion From Axis Angle (`math/quatFromAxisAngle`) FlowGraphBlockNames.QuaternionFromAxisAngle
257
+ - Quaternion To Axis Angle (`math/quatToAxisAngle`) FlowGraphBlockNames.QuaternionToAxisAngle
258
+ - Quaternion From Two Directional Vectors (`math/quatFromDirections`) FlowGraphBlockNames.QuaternionFromDirections
259
+ 11. **Swizzle Nodes**
260
+ - Combine (`math/combine2`, `math/combine3`, `math/combine4`, `math/combine2x2`, `math/combine3x3`, `math/combine4x4`)
261
+ FlowGraphBlockNames.CombineVector2, FlowGraphBlockNames.CombineVector3, FlowGraphBlockNames.CombineVector4
262
+ FlowGraphBlockNames.CombineMatrix2D, FlowGraphBlockNames.CombineMatrix3D, FlowGraphBlockNames.CombineMatrix
263
+ - Extract (`math/extract2`, `math/extract3`, `math/extract4`, `math/extract2x2`, `math/extract3x3`, `math/extract4x4`)
264
+ FlowGraphBlockNames.ExtractVector2, FlowGraphBlockNames.ExtractVector3, FlowGraphBlockNames.ExtractVector4
265
+ FlowGraphBlockNames.ExtractMatrix2D, FlowGraphBlockNames.ExtractMatrix3D, FlowGraphBlockNames.ExtractMatrix
266
+ 12. **Integer Arithmetic Nodes**
267
+ - Absolute Value (`math/abs`) FlowGraphBlockNames.Abs
268
+ - Sign (`math/sign`) FlowGraphBlockNames.Sign
269
+ - Negation (`math/neg`) FlowGraphBlockNames.Negation
270
+ - Addition (`math/add`) FlowGraphBlockNames.Add
271
+ - Subtraction (`math/sub`) FlowGraphBlockNames.Subtract
272
+ - Multiplication (`math/mul`) FlowGraphBlockNames.Multiply
273
+ - Division (`math/div`) FlowGraphBlockNames.Divide
274
+ - Remainder (`math/rem`) FlowGraphBlockNames.Modulo
275
+ - Minimum (`math/min`) FlowGraphBlockNames.Min
276
+ - Maximum (`math/max`) FlowGraphBlockNames.Max
277
+ - Clamp (`math/clamp`) FlowGraphBlockNames.Clamp
278
+ 13. **Integer Comparison Nodes**
279
+ - Equality (`math/eq`) FlowGraphBlockNames.Equality
280
+ - Less Than (`math/lt`) FlowGraphBlockNames.LessThan
281
+ - Less Than Or Equal To (`math/le`) FlowGraphBlockNames.LessThanOrEqual
282
+ - Greater Than (`math/gt`) FlowGraphBlockNames.GreaterThan
283
+ - Greater Than Or Equal To (`math/ge`) FlowGraphBlockNames.GreaterThanOrEqual
284
+ 14. **Integer Bitwise Nodes**
285
+ - Bitwise NOT (`math/not`) FlowGraphBlockNames.BitwiseNot
286
+ - Bitwise AND (`math/and`) FlowGraphBlockNames.BitwiseAnd
287
+ - Bitwise OR (`math/or`) FlowGraphBlockNames.BitwiseOr
288
+ - Bitwise XOR (`math/xor`) FlowGraphBlockNames.BitwiseXor
289
+ - Right Shift (`math/asr`) FlowGraphBlockNames.BitwiseRightShift
290
+ - Left Shift (`math/lsl`) FlowGraphBlockNames.BitwiseLeftShift
291
+ - Count Leading Zeros (`math/clz`) FlowGraphBlockNames.LeadingZeros
292
+ - Count Trailing Zeros (`math/ctz`) FlowGraphBlockNames.TrailingZeros
293
+ - Count One Bits (`math/popcnt`) FlowGraphBlockNames.OneBitsCounter
294
+ 15. **Boolean Arithmetic Nodes**
295
+ - Equality (`math/eq`) FlowGraphBlockNames.Equality
296
+ - Boolean NOT (`math/not`) FlowGraphBlockNames.BitwiseNot
297
+ - Boolean AND (`math/and`) FlowGraphBlockNames.BitwiseAnd
298
+ - Boolean OR (`math/or`) FlowGraphBlockNames.BitwiseOr
299
+ - Boolean XOR (`math/xor`) FlowGraphBlockNames.BitwiseXor
300
+
301
+ ### Type Conversion Nodes
302
+ 1. **Boolean Conversion Nodes**
303
+ - Boolean to Integer (`type/boolToInt`) FlowGraphBlockNames.BooleanToInt
304
+ - Boolean to Float (`type/boolToFloat`) FlowGraphBlockNames.BooleanToFloat
305
+ 2. **Integer Conversion Nodes**
306
+ - Integer to Boolean (`type/intToBool`) FlowGraphBlockNames.IntToBoolean
307
+ - Integer to Float (`type/intToFloat`) FlowGraphBlockNames.IntToFloat
308
+ 3. **Float Conversion Nodes**
309
+ - Float to Boolean (`type/floatToBool`) FlowGraphBlockNames.FloatToBoolean
310
+ - Float to Integer (`type/floatToInt`) FlowGraphBlockNames.FloatToInt
311
+
312
+ ### Control Flow Nodes
313
+ 1. **Sync Nodes**
314
+ - Sequence (`flow/sequence`) FlowGraphBlockNames.Sequence
315
+ - Branch (`flow/branch`) FlowGraphBlockNames.Branch
316
+ - Switch (`flow/switch`) FlowGraphBlockNames.Switch
317
+ - While Loop (`flow/while`) FlowGraphBlockNames.WhileLoop
318
+ - For Loop (`flow/for`) FlowGraphBlockNames.ForLoop
319
+ - Do N (`flow/doN`) FlowGraphBlockNames.DoN
320
+ - Multi Gate (`flow/multiGate`) FlowGraphBlockNames.MultiGate
321
+ - Wait All (`flow/waitAll`) FlowGraphBlockNames.WaitAll
322
+ - Throttle (`flow/throttle`) FlowGraphBlockNames.Throttle
323
+ 2. **Delay Nodes**
324
+ - Set Delay (`flow/setDelay`) FlowGraphBlockNames.SetDelay
325
+ - Cancel Delay (`flow/cancelDelay`) FlowGraphBlockNames.CancelDelay
326
+
327
+ ### State Manipulation Nodes
328
+ 1. **Custom Variable Access**
329
+ - Variable Get (`variable/get`) FlowGraphBlockNames.GetVariable
330
+ - Variable Set (`variable/set`) FlowGraphBlockNames.SetVariable
331
+ - Variable Interpolate (`variable/interpolate`)
332
+ 2. **Object Model Access** // TODO fully test this!!!
333
+ - JSON Pointer Template Parsing (`pointer/get`) [FlowGraphBlockNames.GetProperty, FlowGraphBlockNames.JsonPointerParser]
334
+ - Effective JSON Pointer Generation (`pointer/set`) [FlowGraphBlockNames.SetProperty, FlowGraphBlockNames.JsonPointerParser]
335
+ - Pointer Get (`pointer/get`) [FlowGraphBlockNames.GetProperty, FlowGraphBlockNames.JsonPointerParser]
336
+ - Pointer Set (`pointer/set`) [FlowGraphBlockNames.SetProperty, FlowGraphBlockNames.JsonPointerParser]
337
+ - Pointer Interpolate (`pointer/interpolate`) [FlowGraphBlockNames.ValueInterpolation, FlowGraphBlockNames.JsonPointerParser, FlowGraphBlockNames.PlayAnimation, FlowGraphBlockNames.Easing]
338
+
339
+ ### Animation Control Nodes
340
+ 1. **Animation Play** (`animation/start`) FlowGraphBlockNames.PlayAnimation
341
+ 2. **Animation Stop** (`animation/stop`) FlowGraphBlockNames.StopAnimation
342
+ 3. **Animation Stop At** (`animation/stopAt`) FlowGraphBlockNames.StopAnimation
343
+
344
+ ### Event Nodes
345
+ 1. **Lifecycle Event Nodes**
346
+ - On Start (`event/onStart`) FlowGraphBlockNames.SceneReadyEvent
347
+ - On Tick (`event/onTick`) FlowGraphBlockNames.SceneTickEvent
348
+ 2. **Custom Event Nodes**
349
+ - Receive (`event/receive`) FlowGraphBlockNames.ReceiveCustomEvent
350
+ - Send (`event/send`) FlowGraphBlockNames.SendCustomEvent
351
+
352
+ */