@babylonjs/loaders 5.0.0-beta.9 → 5.0.0-rc.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (173) hide show
  1. package/OBJ/index.d.ts +4 -4
  2. package/OBJ/index.js +4 -4
  3. package/OBJ/index.js.map +1 -1
  4. package/OBJ/mtlFileLoader.d.ts +41 -40
  5. package/OBJ/mtlFileLoader.js +232 -221
  6. package/OBJ/mtlFileLoader.js.map +1 -1
  7. package/OBJ/objFileLoader.d.ts +126 -133
  8. package/OBJ/objFileLoader.js +296 -300
  9. package/OBJ/objFileLoader.js.map +1 -1
  10. package/OBJ/objLoadingOptions.d.ts +43 -43
  11. package/OBJ/objLoadingOptions.js +1 -1
  12. package/OBJ/objLoadingOptions.js.map +1 -1
  13. package/OBJ/solidParser.d.ts +154 -153
  14. package/OBJ/solidParser.js +693 -699
  15. package/OBJ/solidParser.js.map +1 -1
  16. package/STL/index.d.ts +1 -1
  17. package/STL/index.js +1 -1
  18. package/STL/index.js.map +1 -1
  19. package/STL/stlFileLoader.d.ts +64 -71
  20. package/STL/stlFileLoader.js +233 -239
  21. package/STL/stlFileLoader.js.map +1 -1
  22. package/glTF/1.0/glTFBinaryExtension.d.ts +13 -13
  23. package/glTF/1.0/glTFBinaryExtension.js +60 -61
  24. package/glTF/1.0/glTFBinaryExtension.js.map +1 -1
  25. package/glTF/1.0/glTFLoader.d.ts +136 -106
  26. package/glTF/1.0/glTFLoader.js +1814 -1696
  27. package/glTF/1.0/glTFLoader.js.map +1 -1
  28. package/glTF/1.0/glTFLoaderInterfaces.d.ts +412 -412
  29. package/glTF/1.0/glTFLoaderInterfaces.js +95 -95
  30. package/glTF/1.0/glTFLoaderInterfaces.js.map +1 -1
  31. package/glTF/1.0/glTFLoaderUtils.d.ts +63 -62
  32. package/glTF/1.0/glTFLoaderUtils.js +250 -232
  33. package/glTF/1.0/glTFLoaderUtils.js.map +1 -1
  34. package/glTF/1.0/glTFMaterialsCommonExtension.d.ts +10 -10
  35. package/glTF/1.0/glTFMaterialsCommonExtension.js +129 -127
  36. package/glTF/1.0/glTFMaterialsCommonExtension.js.map +1 -1
  37. package/glTF/1.0/index.d.ts +5 -5
  38. package/glTF/1.0/index.js +5 -5
  39. package/glTF/1.0/index.js.map +1 -1
  40. package/glTF/2.0/Extensions/EXT_lights_image_based.d.ts +43 -36
  41. package/glTF/2.0/Extensions/EXT_lights_image_based.js +117 -110
  42. package/glTF/2.0/Extensions/EXT_lights_image_based.js.map +1 -1
  43. package/glTF/2.0/Extensions/EXT_mesh_gpu_instancing.d.ts +36 -27
  44. package/glTF/2.0/Extensions/EXT_mesh_gpu_instancing.js +88 -79
  45. package/glTF/2.0/Extensions/EXT_mesh_gpu_instancing.js.map +1 -1
  46. package/glTF/2.0/Extensions/EXT_meshopt_compression.d.ts +34 -27
  47. package/glTF/2.0/Extensions/EXT_meshopt_compression.js +49 -42
  48. package/glTF/2.0/Extensions/EXT_meshopt_compression.js.map +1 -1
  49. package/glTF/2.0/Extensions/EXT_texture_webp.d.ts +29 -21
  50. package/glTF/2.0/Extensions/EXT_texture_webp.js +40 -32
  51. package/glTF/2.0/Extensions/EXT_texture_webp.js.map +1 -1
  52. package/glTF/2.0/Extensions/ExtrasAsMetadata.d.ts +50 -32
  53. package/glTF/2.0/Extensions/ExtrasAsMetadata.js +73 -55
  54. package/glTF/2.0/Extensions/ExtrasAsMetadata.js.map +1 -1
  55. package/glTF/2.0/Extensions/KHR_draco_mesh_compression.d.ts +39 -31
  56. package/glTF/2.0/Extensions/KHR_draco_mesh_compression.js +112 -101
  57. package/glTF/2.0/Extensions/KHR_draco_mesh_compression.js.map +1 -1
  58. package/glTF/2.0/Extensions/KHR_lights_punctual.d.ts +36 -28
  59. package/glTF/2.0/Extensions/KHR_lights_punctual.js +89 -81
  60. package/glTF/2.0/Extensions/KHR_lights_punctual.js.map +1 -1
  61. package/glTF/2.0/Extensions/KHR_materials_clearcoat.d.ts +39 -31
  62. package/glTF/2.0/Extensions/KHR_materials_clearcoat.js +94 -86
  63. package/glTF/2.0/Extensions/KHR_materials_clearcoat.js.map +1 -1
  64. package/glTF/2.0/Extensions/KHR_materials_emissive_strength.d.ts +38 -30
  65. package/glTF/2.0/Extensions/KHR_materials_emissive_strength.js +53 -45
  66. package/glTF/2.0/Extensions/KHR_materials_emissive_strength.js.map +1 -1
  67. package/glTF/2.0/Extensions/KHR_materials_ior.d.ts +42 -34
  68. package/glTF/2.0/Extensions/KHR_materials_ior.js +62 -54
  69. package/glTF/2.0/Extensions/KHR_materials_ior.js.map +1 -1
  70. package/glTF/2.0/Extensions/KHR_materials_pbrSpecularGlossiness.d.ts +38 -30
  71. package/glTF/2.0/Extensions/KHR_materials_pbrSpecularGlossiness.js +80 -72
  72. package/glTF/2.0/Extensions/KHR_materials_pbrSpecularGlossiness.js.map +1 -1
  73. package/glTF/2.0/Extensions/KHR_materials_sheen.d.ts +39 -31
  74. package/glTF/2.0/Extensions/KHR_materials_sheen.js +84 -76
  75. package/glTF/2.0/Extensions/KHR_materials_sheen.js.map +1 -1
  76. package/glTF/2.0/Extensions/KHR_materials_specular.d.ts +38 -30
  77. package/glTF/2.0/Extensions/KHR_materials_specular.js +74 -66
  78. package/glTF/2.0/Extensions/KHR_materials_specular.js.map +1 -1
  79. package/glTF/2.0/Extensions/KHR_materials_translucency.d.ts +39 -31
  80. package/glTF/2.0/Extensions/KHR_materials_translucency.js +83 -76
  81. package/glTF/2.0/Extensions/KHR_materials_translucency.js.map +1 -1
  82. package/glTF/2.0/Extensions/KHR_materials_transmission.d.ts +38 -30
  83. package/glTF/2.0/Extensions/KHR_materials_transmission.js +288 -277
  84. package/glTF/2.0/Extensions/KHR_materials_transmission.js.map +1 -1
  85. package/glTF/2.0/Extensions/KHR_materials_unlit.d.ts +38 -30
  86. package/glTF/2.0/Extensions/KHR_materials_unlit.js +73 -65
  87. package/glTF/2.0/Extensions/KHR_materials_unlit.js.map +1 -1
  88. package/glTF/2.0/Extensions/KHR_materials_variants.d.ts +87 -76
  89. package/glTF/2.0/Extensions/KHR_materials_variants.js +254 -243
  90. package/glTF/2.0/Extensions/KHR_materials_variants.js.map +1 -1
  91. package/glTF/2.0/Extensions/KHR_materials_volume.d.ts +39 -31
  92. package/glTF/2.0/Extensions/KHR_materials_volume.js +85 -78
  93. package/glTF/2.0/Extensions/KHR_materials_volume.js.map +1 -1
  94. package/glTF/2.0/Extensions/KHR_mesh_quantization.d.ts +22 -19
  95. package/glTF/2.0/Extensions/KHR_mesh_quantization.js +23 -21
  96. package/glTF/2.0/Extensions/KHR_mesh_quantization.js.map +1 -1
  97. package/glTF/2.0/Extensions/KHR_texture_basisu.d.ts +29 -21
  98. package/glTF/2.0/Extensions/KHR_texture_basisu.js +40 -32
  99. package/glTF/2.0/Extensions/KHR_texture_basisu.js.map +1 -1
  100. package/glTF/2.0/Extensions/KHR_texture_transform.d.ts +33 -25
  101. package/glTF/2.0/Extensions/KHR_texture_transform.js +61 -53
  102. package/glTF/2.0/Extensions/KHR_texture_transform.js.map +1 -1
  103. package/glTF/2.0/Extensions/KHR_xmp_json_ld.d.ts +32 -29
  104. package/glTF/2.0/Extensions/KHR_xmp_json_ld.js +49 -46
  105. package/glTF/2.0/Extensions/KHR_xmp_json_ld.js.map +1 -1
  106. package/glTF/2.0/Extensions/MSFT_audio_emitter.d.ts +54 -38
  107. package/glTF/2.0/Extensions/MSFT_audio_emitter.js +240 -216
  108. package/glTF/2.0/Extensions/MSFT_audio_emitter.js.map +1 -1
  109. package/glTF/2.0/Extensions/MSFT_lod.d.ts +109 -75
  110. package/glTF/2.0/Extensions/MSFT_lod.js +369 -333
  111. package/glTF/2.0/Extensions/MSFT_lod.js.map +1 -1
  112. package/glTF/2.0/Extensions/MSFT_minecraftMesh.d.ts +14 -14
  113. package/glTF/2.0/Extensions/MSFT_minecraftMesh.js +36 -36
  114. package/glTF/2.0/Extensions/MSFT_minecraftMesh.js.map +1 -1
  115. package/glTF/2.0/Extensions/MSFT_sRGBFactors.d.ts +14 -14
  116. package/glTF/2.0/Extensions/MSFT_sRGBFactors.js +36 -36
  117. package/glTF/2.0/Extensions/MSFT_sRGBFactors.js.map +1 -1
  118. package/glTF/2.0/Extensions/index.d.ts +26 -26
  119. package/glTF/2.0/Extensions/index.js +26 -26
  120. package/glTF/2.0/Extensions/index.js.map +1 -1
  121. package/glTF/2.0/glTFLoader.d.ts +406 -357
  122. package/glTF/2.0/glTFLoader.js +2366 -2249
  123. package/glTF/2.0/glTFLoader.js.map +1 -1
  124. package/glTF/2.0/glTFLoaderExtension.d.ts +152 -152
  125. package/glTF/2.0/glTFLoaderExtension.js +1 -1
  126. package/glTF/2.0/glTFLoaderExtension.js.map +1 -1
  127. package/glTF/2.0/glTFLoaderInterfaces.d.ts +211 -209
  128. package/glTF/2.0/glTFLoaderInterfaces.js +1 -1
  129. package/glTF/2.0/glTFLoaderInterfaces.js.map +1 -1
  130. package/glTF/2.0/index.d.ts +4 -4
  131. package/glTF/2.0/index.js +5 -4
  132. package/glTF/2.0/index.js.map +1 -1
  133. package/glTF/glTFFileLoader.d.ts +433 -368
  134. package/glTF/glTFFileLoader.js +927 -869
  135. package/glTF/glTFFileLoader.js.map +1 -1
  136. package/glTF/glTFValidation.d.ts +29 -29
  137. package/glTF/glTFValidation.js +123 -121
  138. package/glTF/glTFValidation.js.map +1 -1
  139. package/glTF/index.d.ts +5 -5
  140. package/glTF/index.js +6 -5
  141. package/glTF/index.js.map +1 -1
  142. package/index.d.ts +3 -3
  143. package/index.js +4 -3
  144. package/index.js.map +1 -1
  145. package/legacy/legacy-glTF.d.ts +2 -2
  146. package/legacy/legacy-glTF.js +18 -18
  147. package/legacy/legacy-glTF.js.map +1 -1
  148. package/legacy/legacy-glTF1.d.ts +2 -2
  149. package/legacy/legacy-glTF1.js +15 -14
  150. package/legacy/legacy-glTF1.js.map +1 -1
  151. package/legacy/legacy-glTF1FileLoader.d.ts +2 -2
  152. package/legacy/legacy-glTF1FileLoader.js +3 -2
  153. package/legacy/legacy-glTF1FileLoader.js.map +1 -1
  154. package/legacy/legacy-glTF2.d.ts +2 -2
  155. package/legacy/legacy-glTF2.js +33 -32
  156. package/legacy/legacy-glTF2.js.map +1 -1
  157. package/legacy/legacy-glTF2FileLoader.d.ts +2 -2
  158. package/legacy/legacy-glTF2FileLoader.js +3 -2
  159. package/legacy/legacy-glTF2FileLoader.js.map +1 -1
  160. package/legacy/legacy-glTFFileLoader.d.ts +3 -3
  161. package/legacy/legacy-glTFFileLoader.js +4 -3
  162. package/legacy/legacy-glTFFileLoader.js.map +1 -1
  163. package/legacy/legacy-objFileLoader.d.ts +1 -1
  164. package/legacy/legacy-objFileLoader.js +13 -12
  165. package/legacy/legacy-objFileLoader.js.map +1 -1
  166. package/legacy/legacy-stlFileLoader.d.ts +1 -1
  167. package/legacy/legacy-stlFileLoader.js +13 -12
  168. package/legacy/legacy-stlFileLoader.js.map +1 -1
  169. package/legacy/legacy.d.ts +6 -6
  170. package/legacy/legacy.js +8 -6
  171. package/legacy/legacy.js.map +1 -1
  172. package/package.json +23 -198
  173. package/readme.md +2 -2
@@ -1,152 +1,152 @@
1
- import { Nullable } from "@babylonjs/core/types";
2
- import { AnimationGroup } from "@babylonjs/core/Animations/animationGroup";
3
- import { Material } from "@babylonjs/core/Materials/material";
4
- import { Camera } from "@babylonjs/core/Cameras/camera";
5
- import { Geometry } from "@babylonjs/core/Meshes/geometry";
6
- import { TransformNode } from "@babylonjs/core/Meshes/transformNode";
7
- import { BaseTexture } from "@babylonjs/core/Materials/Textures/baseTexture";
8
- import { Mesh } from "@babylonjs/core/Meshes/mesh";
9
- import { AbstractMesh } from "@babylonjs/core/Meshes/abstractMesh";
10
- import { IDisposable } from "@babylonjs/core/scene";
11
- import { IScene, INode, IMesh, ISkin, ICamera, IMeshPrimitive, IMaterial, ITextureInfo, IAnimation, ITexture, IBufferView, IBuffer } from "./glTFLoaderInterfaces";
12
- import { IGLTFLoaderExtension as IGLTFBaseLoaderExtension } from "../glTFFileLoader";
13
- import { IProperty } from 'babylonjs-gltf2interface';
14
- /**
15
- * Interface for a glTF loader extension.
16
- */
17
- export interface IGLTFLoaderExtension extends IGLTFBaseLoaderExtension, IDisposable {
18
- /**
19
- * Called after the loader state changes to LOADING.
20
- */
21
- onLoading?(): void;
22
- /**
23
- * Called after the loader state changes to READY.
24
- */
25
- onReady?(): void;
26
- /**
27
- * Define this method to modify the default behavior when loading scenes.
28
- * @param context The context when loading the asset
29
- * @param scene The glTF scene property
30
- * @returns A promise that resolves when the load is complete or null if not handled
31
- */
32
- loadSceneAsync?(context: string, scene: IScene): Nullable<Promise<void>>;
33
- /**
34
- * Define this method to modify the default behavior when loading nodes.
35
- * @param context The context when loading the asset
36
- * @param node The glTF node property
37
- * @param assign A function called synchronously after parsing the glTF properties
38
- * @returns A promise that resolves with the loaded Babylon transform node when the load is complete or null if not handled
39
- */
40
- loadNodeAsync?(context: string, node: INode, assign: (babylonMesh: TransformNode) => void): Nullable<Promise<TransformNode>>;
41
- /**
42
- * Define this method to modify the default behavior when loading cameras.
43
- * @param context The context when loading the asset
44
- * @param camera The glTF camera property
45
- * @param assign A function called synchronously after parsing the glTF properties
46
- * @returns A promise that resolves with the loaded Babylon camera when the load is complete or null if not handled
47
- */
48
- loadCameraAsync?(context: string, camera: ICamera, assign: (babylonCamera: Camera) => void): Nullable<Promise<Camera>>;
49
- /**
50
- * @hidden
51
- * Define this method to modify the default behavior when loading vertex data for mesh primitives.
52
- * @param context The context when loading the asset
53
- * @param primitive The glTF mesh primitive property
54
- * @returns A promise that resolves with the loaded geometry when the load is complete or null if not handled
55
- */
56
- _loadVertexDataAsync?(context: string, primitive: IMeshPrimitive, babylonMesh: Mesh): Nullable<Promise<Geometry>>;
57
- /**
58
- * @hidden
59
- * Define this method to modify the default behavior when loading data for mesh primitives.
60
- * @param context The context when loading the asset
61
- * @param name The mesh name when loading the asset
62
- * @param node The glTF node when loading the asset
63
- * @param mesh The glTF mesh when loading the asset
64
- * @param primitive The glTF mesh primitive property
65
- * @param assign A function called synchronously after parsing the glTF properties
66
- * @returns A promise that resolves with the loaded mesh when the load is complete or null if not handled
67
- */
68
- _loadMeshPrimitiveAsync?(context: string, name: string, node: INode, mesh: IMesh, primitive: IMeshPrimitive, assign: (babylonMesh: AbstractMesh) => void): Nullable<Promise<AbstractMesh>>;
69
- /**
70
- * @hidden
71
- * Define this method to modify the default behavior when loading materials. Load material creates the material and then loads material properties.
72
- * @param context The context when loading the asset
73
- * @param material The glTF material property
74
- * @param assign A function called synchronously after parsing the glTF properties
75
- * @returns A promise that resolves with the loaded Babylon material when the load is complete or null if not handled
76
- */
77
- _loadMaterialAsync?(context: string, material: IMaterial, babylonMesh: Nullable<Mesh>, babylonDrawMode: number, assign: (babylonMaterial: Material) => void): Nullable<Promise<Material>>;
78
- /**
79
- * Define this method to modify the default behavior when creating materials.
80
- * @param context The context when loading the asset
81
- * @param material The glTF material property
82
- * @param babylonDrawMode The draw mode for the Babylon material
83
- * @returns The Babylon material or null if not handled
84
- */
85
- createMaterial?(context: string, material: IMaterial, babylonDrawMode: number): Nullable<Material>;
86
- /**
87
- * Define this method to modify the default behavior when loading material properties.
88
- * @param context The context when loading the asset
89
- * @param material The glTF material property
90
- * @param babylonMaterial The Babylon material
91
- * @returns A promise that resolves when the load is complete or null if not handled
92
- */
93
- loadMaterialPropertiesAsync?(context: string, material: IMaterial, babylonMaterial: Material): Nullable<Promise<void>>;
94
- /**
95
- * Define this method to modify the default behavior when loading texture infos.
96
- * @param context The context when loading the asset
97
- * @param textureInfo The glTF texture info property
98
- * @param assign A function called synchronously after parsing the glTF properties
99
- * @returns A promise that resolves with the loaded Babylon texture when the load is complete or null if not handled
100
- */
101
- loadTextureInfoAsync?(context: string, textureInfo: ITextureInfo, assign: (babylonTexture: BaseTexture) => void): Nullable<Promise<BaseTexture>>;
102
- /**
103
- * @hidden
104
- * Define this method to modify the default behavior when loading textures.
105
- * @param context The context when loading the asset
106
- * @param texture The glTF texture property
107
- * @param assign A function called synchronously after parsing the glTF properties
108
- * @returns A promise that resolves with the loaded Babylon texture when the load is complete or null if not handled
109
- */
110
- _loadTextureAsync?(context: string, texture: ITexture, assign: (babylonTexture: BaseTexture) => void): Nullable<Promise<BaseTexture>>;
111
- /**
112
- * Define this method to modify the default behavior when loading animations.
113
- * @param context The context when loading the asset
114
- * @param animation The glTF animation property
115
- * @returns A promise that resolves with the loaded Babylon animation group when the load is complete or null if not handled
116
- */
117
- loadAnimationAsync?(context: string, animation: IAnimation): Nullable<Promise<AnimationGroup>>;
118
- /**
119
- * @hidden
120
- * Define this method to modify the default behavior when loading skins.
121
- * @param context The context when loading the asset
122
- * @param node The glTF node property
123
- * @param skin The glTF skin property
124
- * @returns A promise that resolves when the load is complete or null if not handled
125
- */
126
- _loadSkinAsync?(context: string, node: INode, skin: ISkin): Nullable<Promise<void>>;
127
- /**
128
- * @hidden
129
- * Define this method to modify the default behavior when loading uris.
130
- * @param context The context when loading the asset
131
- * @param property The glTF property associated with the uri
132
- * @param uri The uri to load
133
- * @returns A promise that resolves with the loaded data when the load is complete or null if not handled
134
- */
135
- _loadUriAsync?(context: string, property: IProperty, uri: string): Nullable<Promise<ArrayBufferView>>;
136
- /**
137
- * Define this method to modify the default behavior when loading buffer views.
138
- * @param context The context when loading the asset
139
- * @param bufferView The glTF buffer view property
140
- * @returns A promise that resolves with the loaded data when the load is complete or null if not handled
141
- */
142
- loadBufferViewAsync?(context: string, bufferView: IBufferView): Nullable<Promise<ArrayBufferView>>;
143
- /**
144
- * Define this method to modify the default behavior when loading buffers.
145
- * @param context The context when loading the asset
146
- * @param buffer The glTF buffer property
147
- * @param byteOffset The byte offset to load
148
- * @param byteLength The byte length to load
149
- * @returns A promise that resolves with the loaded data when the load is complete or null if not handled
150
- */
151
- loadBufferAsync?(context: string, buffer: IBuffer, byteOffset: number, byteLength: number): Nullable<Promise<ArrayBufferView>>;
152
- }
1
+ import type { Nullable } from "@babylonjs/core/types.js";
2
+ import type { AnimationGroup } from "@babylonjs/core/Animations/animationGroup.js";
3
+ import type { Material } from "@babylonjs/core/Materials/material.js";
4
+ import type { Camera } from "@babylonjs/core/Cameras/camera.js";
5
+ import type { Geometry } from "@babylonjs/core/Meshes/geometry.js";
6
+ import type { TransformNode } from "@babylonjs/core/Meshes/transformNode.js";
7
+ import type { BaseTexture } from "@babylonjs/core/Materials/Textures/baseTexture.js";
8
+ import type { Mesh } from "@babylonjs/core/Meshes/mesh.js";
9
+ import type { AbstractMesh } from "@babylonjs/core/Meshes/abstractMesh.js";
10
+ import type { IDisposable } from "@babylonjs/core/scene.js";
11
+ import type { IScene, INode, IMesh, ISkin, ICamera, IMeshPrimitive, IMaterial, ITextureInfo, IAnimation, ITexture, IBufferView, IBuffer } from "./glTFLoaderInterfaces";
12
+ import type { IGLTFLoaderExtension as IGLTFBaseLoaderExtension } from "../glTFFileLoader";
13
+ import type { IProperty } from "babylonjs-gltf2interface";
14
+ /**
15
+ * Interface for a glTF loader extension.
16
+ */
17
+ export interface IGLTFLoaderExtension extends IGLTFBaseLoaderExtension, IDisposable {
18
+ /**
19
+ * Called after the loader state changes to LOADING.
20
+ */
21
+ onLoading?(): void;
22
+ /**
23
+ * Called after the loader state changes to READY.
24
+ */
25
+ onReady?(): void;
26
+ /**
27
+ * Define this method to modify the default behavior when loading scenes.
28
+ * @param context The context when loading the asset
29
+ * @param scene The glTF scene property
30
+ * @returns A promise that resolves when the load is complete or null if not handled
31
+ */
32
+ loadSceneAsync?(context: string, scene: IScene): Nullable<Promise<void>>;
33
+ /**
34
+ * Define this method to modify the default behavior when loading nodes.
35
+ * @param context The context when loading the asset
36
+ * @param node The glTF node property
37
+ * @param assign A function called synchronously after parsing the glTF properties
38
+ * @returns A promise that resolves with the loaded Babylon transform node when the load is complete or null if not handled
39
+ */
40
+ loadNodeAsync?(context: string, node: INode, assign: (babylonMesh: TransformNode) => void): Nullable<Promise<TransformNode>>;
41
+ /**
42
+ * Define this method to modify the default behavior when loading cameras.
43
+ * @param context The context when loading the asset
44
+ * @param camera The glTF camera property
45
+ * @param assign A function called synchronously after parsing the glTF properties
46
+ * @returns A promise that resolves with the loaded Babylon camera when the load is complete or null if not handled
47
+ */
48
+ loadCameraAsync?(context: string, camera: ICamera, assign: (babylonCamera: Camera) => void): Nullable<Promise<Camera>>;
49
+ /**
50
+ * @hidden
51
+ * Define this method to modify the default behavior when loading vertex data for mesh primitives.
52
+ * @param context The context when loading the asset
53
+ * @param primitive The glTF mesh primitive property
54
+ * @returns A promise that resolves with the loaded geometry when the load is complete or null if not handled
55
+ */
56
+ _loadVertexDataAsync?(context: string, primitive: IMeshPrimitive, babylonMesh: Mesh): Nullable<Promise<Geometry>>;
57
+ /**
58
+ * @hidden
59
+ * Define this method to modify the default behavior when loading data for mesh primitives.
60
+ * @param context The context when loading the asset
61
+ * @param name The mesh name when loading the asset
62
+ * @param node The glTF node when loading the asset
63
+ * @param mesh The glTF mesh when loading the asset
64
+ * @param primitive The glTF mesh primitive property
65
+ * @param assign A function called synchronously after parsing the glTF properties
66
+ * @returns A promise that resolves with the loaded mesh when the load is complete or null if not handled
67
+ */
68
+ _loadMeshPrimitiveAsync?(context: string, name: string, node: INode, mesh: IMesh, primitive: IMeshPrimitive, assign: (babylonMesh: AbstractMesh) => void): Nullable<Promise<AbstractMesh>>;
69
+ /**
70
+ * @hidden
71
+ * Define this method to modify the default behavior when loading materials. Load material creates the material and then loads material properties.
72
+ * @param context The context when loading the asset
73
+ * @param material The glTF material property
74
+ * @param assign A function called synchronously after parsing the glTF properties
75
+ * @returns A promise that resolves with the loaded Babylon material when the load is complete or null if not handled
76
+ */
77
+ _loadMaterialAsync?(context: string, material: IMaterial, babylonMesh: Nullable<Mesh>, babylonDrawMode: number, assign: (babylonMaterial: Material) => void): Nullable<Promise<Material>>;
78
+ /**
79
+ * Define this method to modify the default behavior when creating materials.
80
+ * @param context The context when loading the asset
81
+ * @param material The glTF material property
82
+ * @param babylonDrawMode The draw mode for the Babylon material
83
+ * @returns The Babylon material or null if not handled
84
+ */
85
+ createMaterial?(context: string, material: IMaterial, babylonDrawMode: number): Nullable<Material>;
86
+ /**
87
+ * Define this method to modify the default behavior when loading material properties.
88
+ * @param context The context when loading the asset
89
+ * @param material The glTF material property
90
+ * @param babylonMaterial The Babylon material
91
+ * @returns A promise that resolves when the load is complete or null if not handled
92
+ */
93
+ loadMaterialPropertiesAsync?(context: string, material: IMaterial, babylonMaterial: Material): Nullable<Promise<void>>;
94
+ /**
95
+ * Define this method to modify the default behavior when loading texture infos.
96
+ * @param context The context when loading the asset
97
+ * @param textureInfo The glTF texture info property
98
+ * @param assign A function called synchronously after parsing the glTF properties
99
+ * @returns A promise that resolves with the loaded Babylon texture when the load is complete or null if not handled
100
+ */
101
+ loadTextureInfoAsync?(context: string, textureInfo: ITextureInfo, assign: (babylonTexture: BaseTexture) => void): Nullable<Promise<BaseTexture>>;
102
+ /**
103
+ * @hidden
104
+ * Define this method to modify the default behavior when loading textures.
105
+ * @param context The context when loading the asset
106
+ * @param texture The glTF texture property
107
+ * @param assign A function called synchronously after parsing the glTF properties
108
+ * @returns A promise that resolves with the loaded Babylon texture when the load is complete or null if not handled
109
+ */
110
+ _loadTextureAsync?(context: string, texture: ITexture, assign: (babylonTexture: BaseTexture) => void): Nullable<Promise<BaseTexture>>;
111
+ /**
112
+ * Define this method to modify the default behavior when loading animations.
113
+ * @param context The context when loading the asset
114
+ * @param animation The glTF animation property
115
+ * @returns A promise that resolves with the loaded Babylon animation group when the load is complete or null if not handled
116
+ */
117
+ loadAnimationAsync?(context: string, animation: IAnimation): Nullable<Promise<AnimationGroup>>;
118
+ /**
119
+ * @hidden
120
+ * Define this method to modify the default behavior when loading skins.
121
+ * @param context The context when loading the asset
122
+ * @param node The glTF node property
123
+ * @param skin The glTF skin property
124
+ * @returns A promise that resolves when the load is complete or null if not handled
125
+ */
126
+ _loadSkinAsync?(context: string, node: INode, skin: ISkin): Nullable<Promise<void>>;
127
+ /**
128
+ * @hidden
129
+ * Define this method to modify the default behavior when loading uris.
130
+ * @param context The context when loading the asset
131
+ * @param property The glTF property associated with the uri
132
+ * @param uri The uri to load
133
+ * @returns A promise that resolves with the loaded data when the load is complete or null if not handled
134
+ */
135
+ _loadUriAsync?(context: string, property: IProperty, uri: string): Nullable<Promise<ArrayBufferView>>;
136
+ /**
137
+ * Define this method to modify the default behavior when loading buffer views.
138
+ * @param context The context when loading the asset
139
+ * @param bufferView The glTF buffer view property
140
+ * @returns A promise that resolves with the loaded data when the load is complete or null if not handled
141
+ */
142
+ loadBufferViewAsync?(context: string, bufferView: IBufferView): Nullable<Promise<ArrayBufferView>>;
143
+ /**
144
+ * Define this method to modify the default behavior when loading buffers.
145
+ * @param context The context when loading the asset
146
+ * @param buffer The glTF buffer property
147
+ * @param byteOffset The byte offset to load
148
+ * @param byteLength The byte length to load
149
+ * @returns A promise that resolves with the loaded data when the load is complete or null if not handled
150
+ */
151
+ loadBufferAsync?(context: string, buffer: IBuffer, byteOffset: number, byteLength: number): Nullable<Promise<ArrayBufferView>>;
152
+ }
@@ -1,2 +1,2 @@
1
- export {};
1
+ export {};
2
2
  //# sourceMappingURL=glTFLoaderExtension.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"glTFLoaderExtension.js","sourceRoot":"","sources":["../../../../sourceES6/loaders/src/glTF/2.0/glTFLoaderExtension.ts"],"names":[],"mappings":"","sourcesContent":["import { Nullable } from \"@babylonjs/core/types\";\r\nimport { AnimationGroup } from \"@babylonjs/core/Animations/animationGroup\";\r\nimport { Material } from \"@babylonjs/core/Materials/material\";\r\nimport { Camera } from \"@babylonjs/core/Cameras/camera\";\r\nimport { Geometry } from \"@babylonjs/core/Meshes/geometry\";\r\nimport { TransformNode } from \"@babylonjs/core/Meshes/transformNode\";\r\nimport { BaseTexture } from \"@babylonjs/core/Materials/Textures/baseTexture\";\r\nimport { Mesh } from \"@babylonjs/core/Meshes/mesh\";\r\nimport { AbstractMesh } from \"@babylonjs/core/Meshes/abstractMesh\";\r\nimport { IDisposable } from \"@babylonjs/core/scene\";\r\nimport { IScene, INode, IMesh, ISkin, ICamera, IMeshPrimitive, IMaterial, ITextureInfo, IAnimation, ITexture, IBufferView, IBuffer } from \"./glTFLoaderInterfaces\";\r\nimport { IGLTFLoaderExtension as IGLTFBaseLoaderExtension } from \"../glTFFileLoader\";\r\nimport { IProperty } from 'babylonjs-gltf2interface';\r\n\r\n/**\r\n * Interface for a glTF loader extension.\r\n */\r\nexport interface IGLTFLoaderExtension extends IGLTFBaseLoaderExtension, IDisposable {\r\n /**\r\n * Called after the loader state changes to LOADING.\r\n */\r\n onLoading?(): void;\r\n\r\n /**\r\n * Called after the loader state changes to READY.\r\n */\r\n onReady?(): void;\r\n\r\n /**\r\n * Define this method to modify the default behavior when loading scenes.\r\n * @param context The context when loading the asset\r\n * @param scene The glTF scene property\r\n * @returns A promise that resolves when the load is complete or null if not handled\r\n */\r\n loadSceneAsync?(context: string, scene: IScene): Nullable<Promise<void>>;\r\n\r\n /**\r\n * Define this method to modify the default behavior when loading nodes.\r\n * @param context The context when loading the asset\r\n * @param node The glTF node property\r\n * @param assign A function called synchronously after parsing the glTF properties\r\n * @returns A promise that resolves with the loaded Babylon transform node when the load is complete or null if not handled\r\n */\r\n loadNodeAsync?(context: string, node: INode, assign: (babylonMesh: TransformNode) => void): Nullable<Promise<TransformNode>>;\r\n\r\n /**\r\n * Define this method to modify the default behavior when loading cameras.\r\n * @param context The context when loading the asset\r\n * @param camera The glTF camera property\r\n * @param assign A function called synchronously after parsing the glTF properties\r\n * @returns A promise that resolves with the loaded Babylon camera when the load is complete or null if not handled\r\n */\r\n loadCameraAsync?(context: string, camera: ICamera, assign: (babylonCamera: Camera) => void): Nullable<Promise<Camera>>;\r\n\r\n /**\r\n * @hidden\r\n * Define this method to modify the default behavior when loading vertex data for mesh primitives.\r\n * @param context The context when loading the asset\r\n * @param primitive The glTF mesh primitive property\r\n * @returns A promise that resolves with the loaded geometry when the load is complete or null if not handled\r\n */\r\n _loadVertexDataAsync?(context: string, primitive: IMeshPrimitive, babylonMesh: Mesh): Nullable<Promise<Geometry>>;\r\n\r\n /**\r\n * @hidden\r\n * Define this method to modify the default behavior when loading data for mesh primitives.\r\n * @param context The context when loading the asset\r\n * @param name The mesh name when loading the asset\r\n * @param node The glTF node when loading the asset\r\n * @param mesh The glTF mesh when loading the asset\r\n * @param primitive The glTF mesh primitive property\r\n * @param assign A function called synchronously after parsing the glTF properties\r\n * @returns A promise that resolves with the loaded mesh when the load is complete or null if not handled\r\n */\r\n _loadMeshPrimitiveAsync?(context: string, name: string, node: INode, mesh: IMesh, primitive: IMeshPrimitive, assign: (babylonMesh: AbstractMesh) => void): Nullable<Promise<AbstractMesh>>;\r\n\r\n /**\r\n * @hidden\r\n * Define this method to modify the default behavior when loading materials. Load material creates the material and then loads material properties.\r\n * @param context The context when loading the asset\r\n * @param material The glTF material property\r\n * @param assign A function called synchronously after parsing the glTF properties\r\n * @returns A promise that resolves with the loaded Babylon material when the load is complete or null if not handled\r\n */\r\n _loadMaterialAsync?(context: string, material: IMaterial, babylonMesh: Nullable<Mesh>, babylonDrawMode: number, assign: (babylonMaterial: Material) => void): Nullable<Promise<Material>>;\r\n\r\n /**\r\n * Define this method to modify the default behavior when creating materials.\r\n * @param context The context when loading the asset\r\n * @param material The glTF material property\r\n * @param babylonDrawMode The draw mode for the Babylon material\r\n * @returns The Babylon material or null if not handled\r\n */\r\n createMaterial?(context: string, material: IMaterial, babylonDrawMode: number): Nullable<Material>;\r\n\r\n /**\r\n * Define this method to modify the default behavior when loading material properties.\r\n * @param context The context when loading the asset\r\n * @param material The glTF material property\r\n * @param babylonMaterial The Babylon material\r\n * @returns A promise that resolves when the load is complete or null if not handled\r\n */\r\n loadMaterialPropertiesAsync?(context: string, material: IMaterial, babylonMaterial: Material): Nullable<Promise<void>>;\r\n\r\n /**\r\n * Define this method to modify the default behavior when loading texture infos.\r\n * @param context The context when loading the asset\r\n * @param textureInfo The glTF texture info property\r\n * @param assign A function called synchronously after parsing the glTF properties\r\n * @returns A promise that resolves with the loaded Babylon texture when the load is complete or null if not handled\r\n */\r\n loadTextureInfoAsync?(context: string, textureInfo: ITextureInfo, assign: (babylonTexture: BaseTexture) => void): Nullable<Promise<BaseTexture>>;\r\n\r\n /**\r\n * @hidden\r\n * Define this method to modify the default behavior when loading textures.\r\n * @param context The context when loading the asset\r\n * @param texture The glTF texture property\r\n * @param assign A function called synchronously after parsing the glTF properties\r\n * @returns A promise that resolves with the loaded Babylon texture when the load is complete or null if not handled\r\n */\r\n _loadTextureAsync?(context: string, texture: ITexture, assign: (babylonTexture: BaseTexture) => void): Nullable<Promise<BaseTexture>>;\r\n\r\n /**\r\n * Define this method to modify the default behavior when loading animations.\r\n * @param context The context when loading the asset\r\n * @param animation The glTF animation property\r\n * @returns A promise that resolves with the loaded Babylon animation group when the load is complete or null if not handled\r\n */\r\n loadAnimationAsync?(context: string, animation: IAnimation): Nullable<Promise<AnimationGroup>>;\r\n\r\n /**\r\n * @hidden\r\n * Define this method to modify the default behavior when loading skins.\r\n * @param context The context when loading the asset\r\n * @param node The glTF node property\r\n * @param skin The glTF skin property\r\n * @returns A promise that resolves when the load is complete or null if not handled\r\n */\r\n _loadSkinAsync?(context: string, node: INode, skin: ISkin): Nullable<Promise<void>>;\r\n\r\n /**\r\n * @hidden\r\n * Define this method to modify the default behavior when loading uris.\r\n * @param context The context when loading the asset\r\n * @param property The glTF property associated with the uri\r\n * @param uri The uri to load\r\n * @returns A promise that resolves with the loaded data when the load is complete or null if not handled\r\n */\r\n _loadUriAsync?(context: string, property: IProperty, uri: string): Nullable<Promise<ArrayBufferView>>;\r\n\r\n /**\r\n * Define this method to modify the default behavior when loading buffer views.\r\n * @param context The context when loading the asset\r\n * @param bufferView The glTF buffer view property\r\n * @returns A promise that resolves with the loaded data when the load is complete or null if not handled\r\n */\r\n loadBufferViewAsync?(context: string, bufferView: IBufferView): Nullable<Promise<ArrayBufferView>>;\r\n\r\n /**\r\n * Define this method to modify the default behavior when loading buffers.\r\n * @param context The context when loading the asset\r\n * @param buffer The glTF buffer property\r\n * @param byteOffset The byte offset to load\r\n * @param byteLength The byte length to load\r\n * @returns A promise that resolves with the loaded data when the load is complete or null if not handled\r\n */\r\n loadBufferAsync?(context: string, buffer: IBuffer, byteOffset: number, byteLength: number): Nullable<Promise<ArrayBufferView>>;\r\n}\r\n"]}
1
+ {"version":3,"file":"glTFLoaderExtension.js","sourceRoot":"","sources":["../../../../../../lts/loaders/generated/glTF/2.0/glTFLoaderExtension.ts"],"names":[],"mappings":"","sourcesContent":["import type { Nullable } from \"core/types\";\r\nimport type { AnimationGroup } from \"core/Animations/animationGroup\";\r\nimport type { Material } from \"core/Materials/material\";\r\nimport type { Camera } from \"core/Cameras/camera\";\r\nimport type { Geometry } from \"core/Meshes/geometry\";\r\nimport type { TransformNode } from \"core/Meshes/transformNode\";\r\nimport type { BaseTexture } from \"core/Materials/Textures/baseTexture\";\r\nimport type { Mesh } from \"core/Meshes/mesh\";\r\nimport type { AbstractMesh } from \"core/Meshes/abstractMesh\";\r\nimport type { IDisposable } from \"core/scene\";\r\nimport type { IScene, INode, IMesh, ISkin, ICamera, IMeshPrimitive, IMaterial, ITextureInfo, IAnimation, ITexture, IBufferView, IBuffer } from \"./glTFLoaderInterfaces\";\r\nimport type { IGLTFLoaderExtension as IGLTFBaseLoaderExtension } from \"../glTFFileLoader\";\r\nimport type { IProperty } from \"babylonjs-gltf2interface\";\r\n\r\n/**\r\n * Interface for a glTF loader extension.\r\n */\r\nexport interface IGLTFLoaderExtension extends IGLTFBaseLoaderExtension, IDisposable {\r\n /**\r\n * Called after the loader state changes to LOADING.\r\n */\r\n onLoading?(): void;\r\n\r\n /**\r\n * Called after the loader state changes to READY.\r\n */\r\n onReady?(): void;\r\n\r\n /**\r\n * Define this method to modify the default behavior when loading scenes.\r\n * @param context The context when loading the asset\r\n * @param scene The glTF scene property\r\n * @returns A promise that resolves when the load is complete or null if not handled\r\n */\r\n loadSceneAsync?(context: string, scene: IScene): Nullable<Promise<void>>;\r\n\r\n /**\r\n * Define this method to modify the default behavior when loading nodes.\r\n * @param context The context when loading the asset\r\n * @param node The glTF node property\r\n * @param assign A function called synchronously after parsing the glTF properties\r\n * @returns A promise that resolves with the loaded Babylon transform node when the load is complete or null if not handled\r\n */\r\n loadNodeAsync?(context: string, node: INode, assign: (babylonMesh: TransformNode) => void): Nullable<Promise<TransformNode>>;\r\n\r\n /**\r\n * Define this method to modify the default behavior when loading cameras.\r\n * @param context The context when loading the asset\r\n * @param camera The glTF camera property\r\n * @param assign A function called synchronously after parsing the glTF properties\r\n * @returns A promise that resolves with the loaded Babylon camera when the load is complete or null if not handled\r\n */\r\n loadCameraAsync?(context: string, camera: ICamera, assign: (babylonCamera: Camera) => void): Nullable<Promise<Camera>>;\r\n\r\n /**\r\n * @hidden\r\n * Define this method to modify the default behavior when loading vertex data for mesh primitives.\r\n * @param context The context when loading the asset\r\n * @param primitive The glTF mesh primitive property\r\n * @returns A promise that resolves with the loaded geometry when the load is complete or null if not handled\r\n */\r\n _loadVertexDataAsync?(context: string, primitive: IMeshPrimitive, babylonMesh: Mesh): Nullable<Promise<Geometry>>;\r\n\r\n /**\r\n * @hidden\r\n * Define this method to modify the default behavior when loading data for mesh primitives.\r\n * @param context The context when loading the asset\r\n * @param name The mesh name when loading the asset\r\n * @param node The glTF node when loading the asset\r\n * @param mesh The glTF mesh when loading the asset\r\n * @param primitive The glTF mesh primitive property\r\n * @param assign A function called synchronously after parsing the glTF properties\r\n * @returns A promise that resolves with the loaded mesh when the load is complete or null if not handled\r\n */\r\n _loadMeshPrimitiveAsync?(\r\n context: string,\r\n name: string,\r\n node: INode,\r\n mesh: IMesh,\r\n primitive: IMeshPrimitive,\r\n assign: (babylonMesh: AbstractMesh) => void\r\n ): Nullable<Promise<AbstractMesh>>;\r\n\r\n /**\r\n * @hidden\r\n * Define this method to modify the default behavior when loading materials. Load material creates the material and then loads material properties.\r\n * @param context The context when loading the asset\r\n * @param material The glTF material property\r\n * @param assign A function called synchronously after parsing the glTF properties\r\n * @returns A promise that resolves with the loaded Babylon material when the load is complete or null if not handled\r\n */\r\n _loadMaterialAsync?(\r\n context: string,\r\n material: IMaterial,\r\n babylonMesh: Nullable<Mesh>,\r\n babylonDrawMode: number,\r\n assign: (babylonMaterial: Material) => void\r\n ): Nullable<Promise<Material>>;\r\n\r\n /**\r\n * Define this method to modify the default behavior when creating materials.\r\n * @param context The context when loading the asset\r\n * @param material The glTF material property\r\n * @param babylonDrawMode The draw mode for the Babylon material\r\n * @returns The Babylon material or null if not handled\r\n */\r\n createMaterial?(context: string, material: IMaterial, babylonDrawMode: number): Nullable<Material>;\r\n\r\n /**\r\n * Define this method to modify the default behavior when loading material properties.\r\n * @param context The context when loading the asset\r\n * @param material The glTF material property\r\n * @param babylonMaterial The Babylon material\r\n * @returns A promise that resolves when the load is complete or null if not handled\r\n */\r\n loadMaterialPropertiesAsync?(context: string, material: IMaterial, babylonMaterial: Material): Nullable<Promise<void>>;\r\n\r\n /**\r\n * Define this method to modify the default behavior when loading texture infos.\r\n * @param context The context when loading the asset\r\n * @param textureInfo The glTF texture info property\r\n * @param assign A function called synchronously after parsing the glTF properties\r\n * @returns A promise that resolves with the loaded Babylon texture when the load is complete or null if not handled\r\n */\r\n loadTextureInfoAsync?(context: string, textureInfo: ITextureInfo, assign: (babylonTexture: BaseTexture) => void): Nullable<Promise<BaseTexture>>;\r\n\r\n /**\r\n * @hidden\r\n * Define this method to modify the default behavior when loading textures.\r\n * @param context The context when loading the asset\r\n * @param texture The glTF texture property\r\n * @param assign A function called synchronously after parsing the glTF properties\r\n * @returns A promise that resolves with the loaded Babylon texture when the load is complete or null if not handled\r\n */\r\n _loadTextureAsync?(context: string, texture: ITexture, assign: (babylonTexture: BaseTexture) => void): Nullable<Promise<BaseTexture>>;\r\n\r\n /**\r\n * Define this method to modify the default behavior when loading animations.\r\n * @param context The context when loading the asset\r\n * @param animation The glTF animation property\r\n * @returns A promise that resolves with the loaded Babylon animation group when the load is complete or null if not handled\r\n */\r\n loadAnimationAsync?(context: string, animation: IAnimation): Nullable<Promise<AnimationGroup>>;\r\n\r\n /**\r\n * @hidden\r\n * Define this method to modify the default behavior when loading skins.\r\n * @param context The context when loading the asset\r\n * @param node The glTF node property\r\n * @param skin The glTF skin property\r\n * @returns A promise that resolves when the load is complete or null if not handled\r\n */\r\n _loadSkinAsync?(context: string, node: INode, skin: ISkin): Nullable<Promise<void>>;\r\n\r\n /**\r\n * @hidden\r\n * Define this method to modify the default behavior when loading uris.\r\n * @param context The context when loading the asset\r\n * @param property The glTF property associated with the uri\r\n * @param uri The uri to load\r\n * @returns A promise that resolves with the loaded data when the load is complete or null if not handled\r\n */\r\n _loadUriAsync?(context: string, property: IProperty, uri: string): Nullable<Promise<ArrayBufferView>>;\r\n\r\n /**\r\n * Define this method to modify the default behavior when loading buffer views.\r\n * @param context The context when loading the asset\r\n * @param bufferView The glTF buffer view property\r\n * @returns A promise that resolves with the loaded data when the load is complete or null if not handled\r\n */\r\n loadBufferViewAsync?(context: string, bufferView: IBufferView): Nullable<Promise<ArrayBufferView>>;\r\n\r\n /**\r\n * Define this method to modify the default behavior when loading buffers.\r\n * @param context The context when loading the asset\r\n * @param buffer The glTF buffer property\r\n * @param byteOffset The byte offset to load\r\n * @param byteLength The byte length to load\r\n * @returns A promise that resolves with the loaded data when the load is complete or null if not handled\r\n */\r\n loadBufferAsync?(context: string, buffer: IBuffer, byteOffset: number, byteLength: number): Nullable<Promise<ArrayBufferView>>;\r\n}\r\n"]}