@babylonjs/loaders 5.23.0 → 5.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/OBJ/mtlFileLoader.d.ts +1 -1
- package/OBJ/mtlFileLoader.js +1 -1
- package/OBJ/mtlFileLoader.js.map +1 -1
- package/STL/stlFileLoader.d.ts +4 -4
- package/STL/stlFileLoader.js +4 -4
- package/STL/stlFileLoader.js.map +1 -1
- package/glTF/1.0/glTFBinaryExtension.d.ts +1 -1
- package/glTF/1.0/glTFBinaryExtension.js +1 -1
- package/glTF/1.0/glTFBinaryExtension.js.map +1 -1
- package/glTF/1.0/glTFLoader.d.ts +3 -3
- package/glTF/1.0/glTFLoader.js +3 -3
- package/glTF/1.0/glTFLoader.js.map +1 -1
- package/glTF/1.0/glTFLoaderInterfaces.d.ts +45 -45
- package/glTF/1.0/glTFLoaderInterfaces.js +8 -8
- package/glTF/1.0/glTFLoaderInterfaces.js.map +1 -1
- package/glTF/1.0/glTFLoaderUtils.d.ts +1 -1
- package/glTF/1.0/glTFLoaderUtils.js +1 -1
- package/glTF/1.0/glTFLoaderUtils.js.map +1 -1
- package/glTF/1.0/glTFMaterialsCommonExtension.d.ts +1 -1
- package/glTF/1.0/glTFMaterialsCommonExtension.js +1 -1
- package/glTF/1.0/glTFMaterialsCommonExtension.js.map +1 -1
- package/glTF/2.0/Extensions/EXT_lights_image_based.d.ts +5 -8
- package/glTF/2.0/Extensions/EXT_lights_image_based.js +4 -7
- package/glTF/2.0/Extensions/EXT_lights_image_based.js.map +1 -1
- package/glTF/2.0/Extensions/EXT_mesh_gpu_instancing.d.ts +3 -7
- package/glTF/2.0/Extensions/EXT_mesh_gpu_instancing.js +3 -7
- package/glTF/2.0/Extensions/EXT_mesh_gpu_instancing.js.map +1 -1
- package/glTF/2.0/Extensions/EXT_meshopt_compression.d.ts +3 -6
- package/glTF/2.0/Extensions/EXT_meshopt_compression.js +3 -6
- package/glTF/2.0/Extensions/EXT_meshopt_compression.js.map +1 -1
- package/glTF/2.0/Extensions/EXT_texture_webp.d.ts +3 -7
- package/glTF/2.0/Extensions/EXT_texture_webp.js +3 -7
- package/glTF/2.0/Extensions/EXT_texture_webp.js.map +1 -1
- package/glTF/2.0/Extensions/ExtrasAsMetadata.d.ts +5 -15
- package/glTF/2.0/Extensions/ExtrasAsMetadata.js +5 -15
- package/glTF/2.0/Extensions/ExtrasAsMetadata.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_animation_pointer.d.ts +5 -7
- package/glTF/2.0/Extensions/KHR_animation_pointer.js +5 -7
- package/glTF/2.0/Extensions/KHR_animation_pointer.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_draco_mesh_compression.d.ts +3 -7
- package/glTF/2.0/Extensions/KHR_draco_mesh_compression.js +3 -7
- package/glTF/2.0/Extensions/KHR_draco_mesh_compression.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_lights_punctual.d.ts +4 -8
- package/glTF/2.0/Extensions/KHR_lights_punctual.js +4 -8
- package/glTF/2.0/Extensions/KHR_lights_punctual.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_materials_clearcoat.d.ts +3 -7
- package/glTF/2.0/Extensions/KHR_materials_clearcoat.js +3 -7
- package/glTF/2.0/Extensions/KHR_materials_clearcoat.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_materials_emissive_strength.d.ts +3 -7
- package/glTF/2.0/Extensions/KHR_materials_emissive_strength.js +3 -7
- package/glTF/2.0/Extensions/KHR_materials_emissive_strength.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_materials_ior.d.ts +3 -7
- package/glTF/2.0/Extensions/KHR_materials_ior.js +3 -7
- package/glTF/2.0/Extensions/KHR_materials_ior.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_materials_iridescence.d.ts +3 -7
- package/glTF/2.0/Extensions/KHR_materials_iridescence.js +3 -7
- package/glTF/2.0/Extensions/KHR_materials_iridescence.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_materials_pbrSpecularGlossiness.d.ts +3 -7
- package/glTF/2.0/Extensions/KHR_materials_pbrSpecularGlossiness.js +3 -7
- package/glTF/2.0/Extensions/KHR_materials_pbrSpecularGlossiness.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_materials_sheen.d.ts +3 -7
- package/glTF/2.0/Extensions/KHR_materials_sheen.js +3 -7
- package/glTF/2.0/Extensions/KHR_materials_sheen.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_materials_specular.d.ts +3 -7
- package/glTF/2.0/Extensions/KHR_materials_specular.js +3 -7
- package/glTF/2.0/Extensions/KHR_materials_specular.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_materials_translucency.d.ts +3 -7
- package/glTF/2.0/Extensions/KHR_materials_translucency.js +3 -7
- package/glTF/2.0/Extensions/KHR_materials_translucency.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_materials_transmission.d.ts +3 -7
- package/glTF/2.0/Extensions/KHR_materials_transmission.js +3 -7
- package/glTF/2.0/Extensions/KHR_materials_transmission.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_materials_unlit.d.ts +3 -7
- package/glTF/2.0/Extensions/KHR_materials_unlit.js +3 -7
- package/glTF/2.0/Extensions/KHR_materials_unlit.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_materials_variants.d.ts +4 -11
- package/glTF/2.0/Extensions/KHR_materials_variants.js +4 -11
- package/glTF/2.0/Extensions/KHR_materials_variants.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_materials_volume.d.ts +3 -7
- package/glTF/2.0/Extensions/KHR_materials_volume.js +3 -7
- package/glTF/2.0/Extensions/KHR_materials_volume.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_mesh_quantization.d.ts +2 -3
- package/glTF/2.0/Extensions/KHR_mesh_quantization.js +2 -3
- package/glTF/2.0/Extensions/KHR_mesh_quantization.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_texture_basisu.d.ts +3 -7
- package/glTF/2.0/Extensions/KHR_texture_basisu.js +3 -7
- package/glTF/2.0/Extensions/KHR_texture_basisu.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_texture_transform.d.ts +3 -7
- package/glTF/2.0/Extensions/KHR_texture_transform.js +3 -7
- package/glTF/2.0/Extensions/KHR_texture_transform.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_xmp_json_ld.d.ts +2 -3
- package/glTF/2.0/Extensions/KHR_xmp_json_ld.js +2 -3
- package/glTF/2.0/Extensions/KHR_xmp_json_ld.js.map +1 -1
- package/glTF/2.0/Extensions/MSFT_audio_emitter.d.ts +6 -14
- package/glTF/2.0/Extensions/MSFT_audio_emitter.js +6 -14
- package/glTF/2.0/Extensions/MSFT_audio_emitter.js.map +1 -1
- package/glTF/2.0/Extensions/MSFT_lod.d.ts +8 -26
- package/glTF/2.0/Extensions/MSFT_lod.js +8 -26
- package/glTF/2.0/Extensions/MSFT_lod.js.map +1 -1
- package/glTF/2.0/Extensions/MSFT_minecraftMesh.d.ts +1 -1
- package/glTF/2.0/Extensions/MSFT_minecraftMesh.js +1 -1
- package/glTF/2.0/Extensions/MSFT_minecraftMesh.js.map +1 -1
- package/glTF/2.0/Extensions/MSFT_sRGBFactors.d.ts +1 -1
- package/glTF/2.0/Extensions/MSFT_sRGBFactors.js +1 -1
- package/glTF/2.0/Extensions/MSFT_sRGBFactors.js.map +1 -1
- package/glTF/2.0/glTFLoader.d.ts +14 -45
- package/glTF/2.0/glTFLoader.js +14 -45
- package/glTF/2.0/glTFLoader.js.map +1 -1
- package/glTF/2.0/glTFLoaderExtension.d.ts +6 -6
- package/glTF/2.0/glTFLoaderExtension.js.map +1 -1
- package/glTF/2.0/glTFLoaderInterfaces.d.ts +21 -21
- package/glTF/2.0/glTFLoaderInterfaces.js.map +1 -1
- package/glTF/glTFFileLoader.d.ts +20 -53
- package/glTF/glTFFileLoader.js +17 -50
- package/glTF/glTFFileLoader.js.map +1 -1
- package/package.json +3 -3
|
@@ -47,7 +47,7 @@ export interface IGLTFLoaderExtension extends IGLTFBaseLoaderExtension, IDisposa
|
|
|
47
47
|
*/
|
|
48
48
|
loadCameraAsync?(context: string, camera: ICamera, assign: (babylonCamera: Camera) => void): Nullable<Promise<Camera>>;
|
|
49
49
|
/**
|
|
50
|
-
* @
|
|
50
|
+
* @internal
|
|
51
51
|
* Define this method to modify the default behavior when loading vertex data for mesh primitives.
|
|
52
52
|
* @param context The context when loading the asset
|
|
53
53
|
* @param primitive The glTF mesh primitive property
|
|
@@ -55,7 +55,7 @@ export interface IGLTFLoaderExtension extends IGLTFBaseLoaderExtension, IDisposa
|
|
|
55
55
|
*/
|
|
56
56
|
_loadVertexDataAsync?(context: string, primitive: IMeshPrimitive, babylonMesh: Mesh): Nullable<Promise<Geometry>>;
|
|
57
57
|
/**
|
|
58
|
-
* @
|
|
58
|
+
* @internal
|
|
59
59
|
* Define this method to modify the default behavior when loading data for mesh primitives.
|
|
60
60
|
* @param context The context when loading the asset
|
|
61
61
|
* @param name The mesh name when loading the asset
|
|
@@ -67,7 +67,7 @@ export interface IGLTFLoaderExtension extends IGLTFBaseLoaderExtension, IDisposa
|
|
|
67
67
|
*/
|
|
68
68
|
_loadMeshPrimitiveAsync?(context: string, name: string, node: INode, mesh: IMesh, primitive: IMeshPrimitive, assign: (babylonMesh: AbstractMesh) => void): Nullable<Promise<AbstractMesh>>;
|
|
69
69
|
/**
|
|
70
|
-
* @
|
|
70
|
+
* @internal
|
|
71
71
|
* Define this method to modify the default behavior when loading materials. Load material creates the material and then loads material properties.
|
|
72
72
|
* @param context The context when loading the asset
|
|
73
73
|
* @param material The glTF material property
|
|
@@ -100,7 +100,7 @@ export interface IGLTFLoaderExtension extends IGLTFBaseLoaderExtension, IDisposa
|
|
|
100
100
|
*/
|
|
101
101
|
loadTextureInfoAsync?(context: string, textureInfo: ITextureInfo, assign: (babylonTexture: BaseTexture) => void): Nullable<Promise<BaseTexture>>;
|
|
102
102
|
/**
|
|
103
|
-
* @
|
|
103
|
+
* @internal
|
|
104
104
|
* Define this method to modify the default behavior when loading textures.
|
|
105
105
|
* @param context The context when loading the asset
|
|
106
106
|
* @param texture The glTF texture property
|
|
@@ -116,7 +116,7 @@ export interface IGLTFLoaderExtension extends IGLTFBaseLoaderExtension, IDisposa
|
|
|
116
116
|
*/
|
|
117
117
|
loadAnimationAsync?(context: string, animation: IAnimation): Nullable<Promise<AnimationGroup>>;
|
|
118
118
|
/**
|
|
119
|
-
* @
|
|
119
|
+
* @internal
|
|
120
120
|
* Define this method to modify the default behavior when loading skins.
|
|
121
121
|
* @param context The context when loading the asset
|
|
122
122
|
* @param node The glTF node property
|
|
@@ -125,7 +125,7 @@ export interface IGLTFLoaderExtension extends IGLTFBaseLoaderExtension, IDisposa
|
|
|
125
125
|
*/
|
|
126
126
|
_loadSkinAsync?(context: string, node: INode, skin: ISkin): Nullable<Promise<void>>;
|
|
127
127
|
/**
|
|
128
|
-
* @
|
|
128
|
+
* @internal
|
|
129
129
|
* Define this method to modify the default behavior when loading uris.
|
|
130
130
|
* @param context The context when loading the asset
|
|
131
131
|
* @param property The glTF property associated with the uri
|
|
@@ -1 +1 @@
|
|
|
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 * @
|
|
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 * @internal\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 * @internal\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 * @internal\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 * @internal\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 * @internal\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 * @internal\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"]}
|
|
@@ -21,9 +21,9 @@ export interface IArrayItem {
|
|
|
21
21
|
* Loader interface with additional members.
|
|
22
22
|
*/
|
|
23
23
|
export interface IAccessor extends GLTF2.IAccessor, IArrayItem {
|
|
24
|
-
/** @
|
|
24
|
+
/** @internal */
|
|
25
25
|
_data?: Promise<ArrayBufferView>;
|
|
26
|
-
/** @
|
|
26
|
+
/** @internal */
|
|
27
27
|
_babylonVertexBuffer?: {
|
|
28
28
|
[kind: string]: Promise<VertexBuffer>;
|
|
29
29
|
};
|
|
@@ -33,7 +33,7 @@ export interface IAccessor extends GLTF2.IAccessor, IArrayItem {
|
|
|
33
33
|
*/
|
|
34
34
|
export interface IAnimationChannel extends GLTF2.IAnimationChannel, IArrayItem {
|
|
35
35
|
}
|
|
36
|
-
/** @
|
|
36
|
+
/** @internal */
|
|
37
37
|
export interface _IAnimationSamplerData {
|
|
38
38
|
input: Float32Array;
|
|
39
39
|
interpolation: GLTF2.AnimationSamplerInterpolation;
|
|
@@ -43,7 +43,7 @@ export interface _IAnimationSamplerData {
|
|
|
43
43
|
* Loader interface with additional members.
|
|
44
44
|
*/
|
|
45
45
|
export interface IAnimationSampler extends GLTF2.IAnimationSampler, IArrayItem {
|
|
46
|
-
/** @
|
|
46
|
+
/** @internal */
|
|
47
47
|
_data?: Promise<_IAnimationSamplerData>;
|
|
48
48
|
}
|
|
49
49
|
/**
|
|
@@ -52,44 +52,44 @@ export interface IAnimationSampler extends GLTF2.IAnimationSampler, IArrayItem {
|
|
|
52
52
|
export interface IAnimation extends GLTF2.IAnimation, IArrayItem {
|
|
53
53
|
channels: IAnimationChannel[];
|
|
54
54
|
samplers: IAnimationSampler[];
|
|
55
|
-
/** @
|
|
55
|
+
/** @internal */
|
|
56
56
|
_babylonAnimationGroup?: AnimationGroup;
|
|
57
57
|
}
|
|
58
58
|
/**
|
|
59
59
|
* Loader interface with additional members.
|
|
60
60
|
*/
|
|
61
61
|
export interface IBuffer extends GLTF2.IBuffer, IArrayItem {
|
|
62
|
-
/** @
|
|
62
|
+
/** @internal */
|
|
63
63
|
_data?: Promise<ArrayBufferView>;
|
|
64
64
|
}
|
|
65
65
|
/**
|
|
66
66
|
* Loader interface with additional members.
|
|
67
67
|
*/
|
|
68
68
|
export interface IBufferView extends GLTF2.IBufferView, IArrayItem {
|
|
69
|
-
/** @
|
|
69
|
+
/** @internal */
|
|
70
70
|
_data?: Promise<ArrayBufferView>;
|
|
71
|
-
/** @
|
|
71
|
+
/** @internal */
|
|
72
72
|
_babylonBuffer?: Promise<Buffer>;
|
|
73
73
|
}
|
|
74
74
|
/**
|
|
75
75
|
* Loader interface with additional members.
|
|
76
76
|
*/
|
|
77
77
|
export interface IKHRLight extends GLTF2.IKHRLightsPunctual_Light {
|
|
78
|
-
/** @
|
|
78
|
+
/** @internal */
|
|
79
79
|
_babylonLight: Light;
|
|
80
80
|
}
|
|
81
81
|
/**
|
|
82
82
|
* Loader interface with additional members.
|
|
83
83
|
*/
|
|
84
84
|
export interface ICamera extends GLTF2.ICamera, IArrayItem {
|
|
85
|
-
/** @
|
|
85
|
+
/** @internal */
|
|
86
86
|
_babylonCamera: Camera;
|
|
87
87
|
}
|
|
88
88
|
/**
|
|
89
89
|
* Loader interface with additional members.
|
|
90
90
|
*/
|
|
91
91
|
export interface IImage extends GLTF2.IImage, IArrayItem {
|
|
92
|
-
/** @
|
|
92
|
+
/** @internal */
|
|
93
93
|
_data?: Promise<ArrayBufferView>;
|
|
94
94
|
}
|
|
95
95
|
/**
|
|
@@ -117,7 +117,7 @@ export interface IMaterial extends GLTF2.IMaterial, IArrayItem {
|
|
|
117
117
|
normalTexture?: IMaterialNormalTextureInfo;
|
|
118
118
|
occlusionTexture?: IMaterialOcclusionTextureInfo;
|
|
119
119
|
emissiveTexture?: ITextureInfo;
|
|
120
|
-
/** @
|
|
120
|
+
/** @internal */
|
|
121
121
|
_data?: {
|
|
122
122
|
[babylonDrawMode: number]: {
|
|
123
123
|
babylonMaterial: Material;
|
|
@@ -136,7 +136,7 @@ export interface IMesh extends GLTF2.IMesh, IArrayItem {
|
|
|
136
136
|
* Loader interface with additional members.
|
|
137
137
|
*/
|
|
138
138
|
export interface IMeshPrimitive extends GLTF2.IMeshPrimitive, IArrayItem {
|
|
139
|
-
/** @
|
|
139
|
+
/** @internal */
|
|
140
140
|
_instanceData?: {
|
|
141
141
|
babylonSourceMesh: Mesh;
|
|
142
142
|
promise: Promise<any>;
|
|
@@ -150,16 +150,16 @@ export interface INode extends GLTF2.INode, IArrayItem {
|
|
|
150
150
|
* The parent glTF node.
|
|
151
151
|
*/
|
|
152
152
|
parent?: INode;
|
|
153
|
-
/** @
|
|
153
|
+
/** @internal */
|
|
154
154
|
_babylonTransformNode?: TransformNode;
|
|
155
|
-
/** @
|
|
155
|
+
/** @internal */
|
|
156
156
|
_babylonTransformNodeForSkin?: TransformNode;
|
|
157
|
-
/** @
|
|
157
|
+
/** @internal */
|
|
158
158
|
_primitiveBabylonMeshes?: AbstractMesh[];
|
|
159
|
-
/** @
|
|
159
|
+
/** @internal */
|
|
160
160
|
_numMorphTargets?: number;
|
|
161
161
|
}
|
|
162
|
-
/** @
|
|
162
|
+
/** @internal */
|
|
163
163
|
export interface _ISamplerData {
|
|
164
164
|
noMipMaps: boolean;
|
|
165
165
|
samplingMode: number;
|
|
@@ -170,7 +170,7 @@ export interface _ISamplerData {
|
|
|
170
170
|
* Loader interface with additional members.
|
|
171
171
|
*/
|
|
172
172
|
export interface ISampler extends GLTF2.ISampler, IArrayItem {
|
|
173
|
-
/** @
|
|
173
|
+
/** @internal */
|
|
174
174
|
_data?: _ISamplerData;
|
|
175
175
|
}
|
|
176
176
|
/**
|
|
@@ -182,7 +182,7 @@ export interface IScene extends GLTF2.IScene, IArrayItem {
|
|
|
182
182
|
* Loader interface with additional members.
|
|
183
183
|
*/
|
|
184
184
|
export interface ISkin extends GLTF2.ISkin, IArrayItem {
|
|
185
|
-
/** @
|
|
185
|
+
/** @internal */
|
|
186
186
|
_data?: {
|
|
187
187
|
babylonSkeleton: Skeleton;
|
|
188
188
|
promise: Promise<void>;
|
|
@@ -192,7 +192,7 @@ export interface ISkin extends GLTF2.ISkin, IArrayItem {
|
|
|
192
192
|
* Loader interface with additional members.
|
|
193
193
|
*/
|
|
194
194
|
export interface ITexture extends GLTF2.ITexture, IArrayItem {
|
|
195
|
-
/** @
|
|
195
|
+
/** @internal */
|
|
196
196
|
_textureInfo: ITextureInfo;
|
|
197
197
|
}
|
|
198
198
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"glTFLoaderInterfaces.js","sourceRoot":"","sources":["../../../../../../lts/loaders/generated/glTF/2.0/glTFLoaderInterfaces.ts"],"names":[],"mappings":"","sourcesContent":["import type { AnimationGroup } from \"core/Animations/animationGroup\";\r\nimport type { Skeleton } from \"core/Bones/skeleton\";\r\nimport type { Material } from \"core/Materials/material\";\r\nimport type { TransformNode } from \"core/Meshes/transformNode\";\r\nimport type { Buffer, VertexBuffer } from \"core/Buffers/buffer\";\r\nimport type { AbstractMesh } from \"core/Meshes/abstractMesh\";\r\nimport type { Mesh } from \"core/Meshes/mesh\";\r\nimport type { Camera } from \"core/Cameras/camera\";\r\nimport type { Light } from \"core/Lights/light\";\r\n\r\nimport type * as GLTF2 from \"babylonjs-gltf2interface\";\r\n\r\n/**\r\n * Loader interface with an index field.\r\n */\r\nexport interface IArrayItem {\r\n /**\r\n * The index of this item in the array.\r\n */\r\n index: number;\r\n}\r\n\r\n/**\r\n * Loader interface with additional members.\r\n */\r\nexport interface IAccessor extends GLTF2.IAccessor, IArrayItem {\r\n /** @
|
|
1
|
+
{"version":3,"file":"glTFLoaderInterfaces.js","sourceRoot":"","sources":["../../../../../../lts/loaders/generated/glTF/2.0/glTFLoaderInterfaces.ts"],"names":[],"mappings":"","sourcesContent":["import type { AnimationGroup } from \"core/Animations/animationGroup\";\r\nimport type { Skeleton } from \"core/Bones/skeleton\";\r\nimport type { Material } from \"core/Materials/material\";\r\nimport type { TransformNode } from \"core/Meshes/transformNode\";\r\nimport type { Buffer, VertexBuffer } from \"core/Buffers/buffer\";\r\nimport type { AbstractMesh } from \"core/Meshes/abstractMesh\";\r\nimport type { Mesh } from \"core/Meshes/mesh\";\r\nimport type { Camera } from \"core/Cameras/camera\";\r\nimport type { Light } from \"core/Lights/light\";\r\n\r\nimport type * as GLTF2 from \"babylonjs-gltf2interface\";\r\n\r\n/**\r\n * Loader interface with an index field.\r\n */\r\nexport interface IArrayItem {\r\n /**\r\n * The index of this item in the array.\r\n */\r\n index: number;\r\n}\r\n\r\n/**\r\n * Loader interface with additional members.\r\n */\r\nexport interface IAccessor extends GLTF2.IAccessor, IArrayItem {\r\n /** @internal */\r\n _data?: Promise<ArrayBufferView>;\r\n\r\n /** @internal */\r\n _babylonVertexBuffer?: { [kind: string]: Promise<VertexBuffer> };\r\n}\r\n\r\n/**\r\n * Loader interface with additional members.\r\n */\r\nexport interface IAnimationChannel extends GLTF2.IAnimationChannel, IArrayItem {}\r\n\r\n/** @internal */\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nexport interface _IAnimationSamplerData {\r\n input: Float32Array;\r\n interpolation: GLTF2.AnimationSamplerInterpolation;\r\n output: Float32Array;\r\n}\r\n\r\n/**\r\n * Loader interface with additional members.\r\n */\r\nexport interface IAnimationSampler extends GLTF2.IAnimationSampler, IArrayItem {\r\n /** @internal */\r\n _data?: Promise<_IAnimationSamplerData>;\r\n}\r\n\r\n/**\r\n * Loader interface with additional members.\r\n */\r\nexport interface IAnimation extends GLTF2.IAnimation, IArrayItem {\r\n channels: IAnimationChannel[];\r\n samplers: IAnimationSampler[];\r\n\r\n /** @internal */\r\n _babylonAnimationGroup?: AnimationGroup;\r\n}\r\n\r\n/**\r\n * Loader interface with additional members.\r\n */\r\nexport interface IBuffer extends GLTF2.IBuffer, IArrayItem {\r\n /** @internal */\r\n _data?: Promise<ArrayBufferView>;\r\n}\r\n\r\n/**\r\n * Loader interface with additional members.\r\n */\r\nexport interface IBufferView extends GLTF2.IBufferView, IArrayItem {\r\n /** @internal */\r\n _data?: Promise<ArrayBufferView>;\r\n\r\n /** @internal */\r\n _babylonBuffer?: Promise<Buffer>;\r\n}\r\n\r\n/**\r\n * Loader interface with additional members.\r\n */\r\nexport interface IKHRLight extends GLTF2.IKHRLightsPunctual_Light {\r\n /** @internal */\r\n _babylonLight: Light;\r\n}\r\n\r\n/**\r\n * Loader interface with additional members.\r\n */\r\nexport interface ICamera extends GLTF2.ICamera, IArrayItem {\r\n /** @internal */\r\n _babylonCamera: Camera;\r\n}\r\n\r\n/**\r\n * Loader interface with additional members.\r\n */\r\nexport interface IImage extends GLTF2.IImage, IArrayItem {\r\n /** @internal */\r\n _data?: Promise<ArrayBufferView>;\r\n}\r\n\r\n/**\r\n * Loader interface with additional members.\r\n */\r\nexport interface IMaterialNormalTextureInfo extends GLTF2.IMaterialNormalTextureInfo, ITextureInfo {}\r\n\r\n/**\r\n * Loader interface with additional members.\r\n */\r\nexport interface IMaterialOcclusionTextureInfo extends GLTF2.IMaterialOcclusionTextureInfo, ITextureInfo {}\r\n\r\n/**\r\n * Loader interface with additional members.\r\n */\r\nexport interface IMaterialPbrMetallicRoughness extends GLTF2.IMaterialPbrMetallicRoughness {\r\n baseColorTexture?: ITextureInfo;\r\n metallicRoughnessTexture?: ITextureInfo;\r\n}\r\n\r\n/**\r\n * Loader interface with additional members.\r\n */\r\nexport interface IMaterial extends GLTF2.IMaterial, IArrayItem {\r\n pbrMetallicRoughness?: IMaterialPbrMetallicRoughness;\r\n normalTexture?: IMaterialNormalTextureInfo;\r\n occlusionTexture?: IMaterialOcclusionTextureInfo;\r\n emissiveTexture?: ITextureInfo;\r\n\r\n /** @internal */\r\n _data?: {\r\n [babylonDrawMode: number]: {\r\n babylonMaterial: Material;\r\n babylonMeshes: AbstractMesh[];\r\n promise: Promise<void>;\r\n };\r\n };\r\n}\r\n\r\n/**\r\n * Loader interface with additional members.\r\n */\r\nexport interface IMesh extends GLTF2.IMesh, IArrayItem {\r\n primitives: IMeshPrimitive[];\r\n}\r\n\r\n/**\r\n * Loader interface with additional members.\r\n */\r\nexport interface IMeshPrimitive extends GLTF2.IMeshPrimitive, IArrayItem {\r\n /** @internal */\r\n _instanceData?: {\r\n babylonSourceMesh: Mesh;\r\n promise: Promise<any>;\r\n };\r\n}\r\n\r\n/**\r\n * Loader interface with additional members.\r\n */\r\nexport interface INode extends GLTF2.INode, IArrayItem {\r\n /**\r\n * The parent glTF node.\r\n */\r\n parent?: INode;\r\n\r\n /** @internal */\r\n _babylonTransformNode?: TransformNode;\r\n\r\n /** @internal */\r\n _babylonTransformNodeForSkin?: TransformNode;\r\n\r\n /** @internal */\r\n _primitiveBabylonMeshes?: AbstractMesh[];\r\n\r\n /** @internal */\r\n _numMorphTargets?: number;\r\n}\r\n\r\n/** @internal */\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nexport interface _ISamplerData {\r\n noMipMaps: boolean;\r\n samplingMode: number;\r\n wrapU: number;\r\n wrapV: number;\r\n}\r\n\r\n/**\r\n * Loader interface with additional members.\r\n */\r\nexport interface ISampler extends GLTF2.ISampler, IArrayItem {\r\n /** @internal */\r\n _data?: _ISamplerData;\r\n}\r\n\r\n/**\r\n * Loader interface with additional members.\r\n */\r\nexport interface IScene extends GLTF2.IScene, IArrayItem {}\r\n\r\n/**\r\n * Loader interface with additional members.\r\n */\r\nexport interface ISkin extends GLTF2.ISkin, IArrayItem {\r\n /** @internal */\r\n _data?: {\r\n babylonSkeleton: Skeleton;\r\n promise: Promise<void>;\r\n };\r\n}\r\n\r\n/**\r\n * Loader interface with additional members.\r\n */\r\nexport interface ITexture extends GLTF2.ITexture, IArrayItem {\r\n /** @internal */\r\n _textureInfo: ITextureInfo;\r\n}\r\n\r\n/**\r\n * Loader interface with additional members.\r\n */\r\nexport interface ITextureInfo extends GLTF2.ITextureInfo {\r\n /** false or undefined if the texture holds color data (true if data are roughness, normal, ...) */\r\n nonColorData?: boolean;\r\n}\r\n\r\n/**\r\n * Loader interface with additional members.\r\n */\r\nexport interface IGLTF extends GLTF2.IGLTF {\r\n accessors?: IAccessor[];\r\n animations?: IAnimation[];\r\n buffers?: IBuffer[];\r\n bufferViews?: IBufferView[];\r\n cameras?: ICamera[];\r\n images?: IImage[];\r\n materials?: IMaterial[];\r\n meshes?: IMesh[];\r\n nodes?: INode[];\r\n samplers?: ISampler[];\r\n scenes?: IScene[];\r\n skins?: ISkin[];\r\n textures?: ITexture[];\r\n}\r\n"]}
|
package/glTF/glTFFileLoader.d.ts
CHANGED
|
@@ -91,7 +91,7 @@ export declare enum GLTFLoaderState {
|
|
|
91
91
|
*/
|
|
92
92
|
COMPLETE = 2
|
|
93
93
|
}
|
|
94
|
-
/** @
|
|
94
|
+
/** @internal */
|
|
95
95
|
export interface IGLTFLoader extends IDisposable {
|
|
96
96
|
importMeshAsync: (meshesNames: any, scene: Scene, container: Nullable<AssetContainer>, data: IGLTFLoaderData, rootUrl: string, onProgress?: (event: ISceneLoaderProgressEvent) => void, fileName?: string) => Promise<ISceneLoaderAsyncResult>;
|
|
97
97
|
loadAsync: (scene: Scene, data: IGLTFLoaderData, rootUrl: string, onProgress?: (event: ISceneLoaderProgressEvent) => void, fileName?: string) => Promise<void>;
|
|
@@ -100,9 +100,9 @@ export interface IGLTFLoader extends IDisposable {
|
|
|
100
100
|
* File loader for loading glTF files into a scene.
|
|
101
101
|
*/
|
|
102
102
|
export declare class GLTFFileLoader implements IDisposable, ISceneLoaderPluginAsync, ISceneLoaderPluginFactory {
|
|
103
|
-
/** @
|
|
103
|
+
/** @internal */
|
|
104
104
|
static _CreateGLTF1Loader: (parent: GLTFFileLoader) => IGLTFLoader;
|
|
105
|
-
/** @
|
|
105
|
+
/** @internal */
|
|
106
106
|
static _CreateGLTF2Loader: (parent: GLTFFileLoader) => IGLTFLoader;
|
|
107
107
|
/**
|
|
108
108
|
* Raised when the asset has been parsed
|
|
@@ -117,13 +117,13 @@ export declare class GLTFFileLoader implements IDisposable, ISceneLoaderPluginAs
|
|
|
117
117
|
* Set this property to false to disable incremental loading which delays the loader from calling the success callback until after loading the meshes and shaders.
|
|
118
118
|
* Textures always loads asynchronously. For example, the success callback can compute the bounding information of the loaded meshes when incremental loading is disabled.
|
|
119
119
|
* Defaults to true.
|
|
120
|
-
* @
|
|
120
|
+
* @internal
|
|
121
121
|
*/
|
|
122
122
|
static IncrementalLoading: boolean;
|
|
123
123
|
/**
|
|
124
124
|
* Set this property to true in order to work with homogeneous coordinates, available with some converters and exporters.
|
|
125
125
|
* Defaults to false. See https://en.wikipedia.org/wiki/Homogeneous_coordinates.
|
|
126
|
-
* @
|
|
126
|
+
* @internal
|
|
127
127
|
*/
|
|
128
128
|
static HomogeneousCoordinates: boolean;
|
|
129
129
|
/**
|
|
@@ -317,59 +317,34 @@ export declare class GLTFFileLoader implements IDisposable, ISceneLoaderPluginAs
|
|
|
317
317
|
* Name of the loader ("gltf")
|
|
318
318
|
*/
|
|
319
319
|
name: string;
|
|
320
|
-
/** @
|
|
320
|
+
/** @internal */
|
|
321
321
|
extensions: ISceneLoaderPluginExtensions;
|
|
322
322
|
/**
|
|
323
323
|
* Disposes the loader, releases resources during load, and cancels any outstanding requests.
|
|
324
324
|
*/
|
|
325
325
|
dispose(): void;
|
|
326
326
|
/**
|
|
327
|
-
* @
|
|
328
|
-
* @param fileOrUrl
|
|
329
|
-
* @param onSuccess
|
|
330
|
-
* @param onProgress
|
|
331
|
-
* @param useArrayBuffer
|
|
332
|
-
* @param onError
|
|
333
|
-
* @hidden
|
|
327
|
+
* @internal
|
|
334
328
|
*/
|
|
335
329
|
loadFile(scene: Scene, fileOrUrl: File | string, onSuccess: (data: any, responseURL?: string) => void, onProgress?: (ev: ISceneLoaderProgressEvent) => void, useArrayBuffer?: boolean, onError?: (request?: WebRequest, exception?: LoadFileError) => void): IFileRequest;
|
|
336
330
|
/**
|
|
337
|
-
* @
|
|
338
|
-
* @param scene
|
|
339
|
-
* @param data
|
|
340
|
-
* @param rootUrl
|
|
341
|
-
* @param onProgress
|
|
342
|
-
* @param fileName
|
|
343
|
-
* @hidden
|
|
331
|
+
* @internal
|
|
344
332
|
*/
|
|
345
333
|
importMeshAsync(meshesNames: any, scene: Scene, data: any, rootUrl: string, onProgress?: (event: ISceneLoaderProgressEvent) => void, fileName?: string): Promise<ISceneLoaderAsyncResult>;
|
|
346
334
|
/**
|
|
347
|
-
* @
|
|
348
|
-
* @param data
|
|
349
|
-
* @param rootUrl
|
|
350
|
-
* @param onProgress
|
|
351
|
-
* @param fileName
|
|
352
|
-
* @hidden
|
|
335
|
+
* @internal
|
|
353
336
|
*/
|
|
354
337
|
loadAsync(scene: Scene, data: any, rootUrl: string, onProgress?: (event: ISceneLoaderProgressEvent) => void, fileName?: string): Promise<void>;
|
|
355
338
|
/**
|
|
356
|
-
* @
|
|
357
|
-
* @param data
|
|
358
|
-
* @param rootUrl
|
|
359
|
-
* @param onProgress
|
|
360
|
-
* @param fileName
|
|
361
|
-
* @hidden
|
|
339
|
+
* @internal
|
|
362
340
|
*/
|
|
363
341
|
loadAssetContainerAsync(scene: Scene, data: any, rootUrl: string, onProgress?: (event: ISceneLoaderProgressEvent) => void, fileName?: string): Promise<AssetContainer>;
|
|
364
342
|
/**
|
|
365
|
-
* @
|
|
366
|
-
* @hidden
|
|
343
|
+
* @internal
|
|
367
344
|
*/
|
|
368
345
|
canDirectLoad(data: string): boolean;
|
|
369
346
|
/**
|
|
370
|
-
* @
|
|
371
|
-
* @param data
|
|
372
|
-
* @hidden
|
|
347
|
+
* @internal
|
|
373
348
|
*/
|
|
374
349
|
directLoad(scene: Scene, data: string): Promise<any>;
|
|
375
350
|
/**
|
|
@@ -379,7 +354,7 @@ export declare class GLTFFileLoader implements IDisposable, ISceneLoaderPluginAs
|
|
|
379
354
|
* @returns the new root url
|
|
380
355
|
*/
|
|
381
356
|
rewriteRootURL?(rootUrl: string, responseURL?: string): string;
|
|
382
|
-
/** @
|
|
357
|
+
/** @internal */
|
|
383
358
|
createPlugin(): ISceneLoaderPlugin | ISceneLoaderPluginAsync;
|
|
384
359
|
/**
|
|
385
360
|
* The loader state or null if the loader is not active.
|
|
@@ -395,18 +370,11 @@ export declare class GLTFFileLoader implements IDisposable, ISceneLoaderPluginAs
|
|
|
395
370
|
*/
|
|
396
371
|
whenCompleteAsync(): Promise<void>;
|
|
397
372
|
/**
|
|
398
|
-
* @
|
|
399
|
-
* @hidden
|
|
373
|
+
* @internal
|
|
400
374
|
*/
|
|
401
375
|
_setState(state: GLTFLoaderState): void;
|
|
402
376
|
/**
|
|
403
|
-
* @
|
|
404
|
-
* @param fileOrUrl
|
|
405
|
-
* @param onSuccess
|
|
406
|
-
* @param useArrayBuffer
|
|
407
|
-
* @param onError
|
|
408
|
-
* @param onOpened
|
|
409
|
-
* @hidden
|
|
377
|
+
* @internal
|
|
410
378
|
*/
|
|
411
379
|
_loadFile(scene: Scene, fileOrUrl: File | string, onSuccess: (data: string | ArrayBuffer) => void, useArrayBuffer?: boolean, onError?: (request?: WebRequest) => void, onOpened?: (request: WebRequest) => void): IFileRequest;
|
|
412
380
|
private _onProgress;
|
|
@@ -421,21 +389,20 @@ export declare class GLTFFileLoader implements IDisposable, ISceneLoaderPluginAs
|
|
|
421
389
|
private static readonly _logSpaces;
|
|
422
390
|
private _logIndentLevel;
|
|
423
391
|
private _loggingEnabled;
|
|
424
|
-
/** @
|
|
392
|
+
/** @internal */
|
|
425
393
|
_log: (message: string) => void;
|
|
426
394
|
/**
|
|
427
|
-
* @
|
|
428
|
-
* @hidden
|
|
395
|
+
* @internal
|
|
429
396
|
*/
|
|
430
397
|
_logOpen(message: string): void;
|
|
431
|
-
/** @
|
|
398
|
+
/** @internal */
|
|
432
399
|
_logClose(): void;
|
|
433
400
|
private _logEnabled;
|
|
434
401
|
private _logDisabled;
|
|
435
402
|
private _capturePerformanceCounters;
|
|
436
|
-
/** @
|
|
403
|
+
/** @internal */
|
|
437
404
|
_startPerformanceCounter: (counterName: string) => void;
|
|
438
|
-
/** @
|
|
405
|
+
/** @internal */
|
|
439
406
|
_endPerformanceCounter: (counterName: string) => void;
|
|
440
407
|
private _startPerformanceCounterEnabled;
|
|
441
408
|
private _startPerformanceCounterDisabled;
|
package/glTF/glTFFileLoader.js
CHANGED
|
@@ -208,7 +208,7 @@ export class GLTFFileLoader {
|
|
|
208
208
|
* Name of the loader ("gltf")
|
|
209
209
|
*/
|
|
210
210
|
this.name = "gltf";
|
|
211
|
-
/** @
|
|
211
|
+
/** @internal */
|
|
212
212
|
this.extensions = {
|
|
213
213
|
".gltf": { isBinary: false },
|
|
214
214
|
".glb": { isBinary: true },
|
|
@@ -219,12 +219,12 @@ export class GLTFFileLoader {
|
|
|
219
219
|
this.onLoaderStateChangedObservable = new Observable();
|
|
220
220
|
this._logIndentLevel = 0;
|
|
221
221
|
this._loggingEnabled = false;
|
|
222
|
-
/** @
|
|
222
|
+
/** @internal */
|
|
223
223
|
this._log = this._logDisabled;
|
|
224
224
|
this._capturePerformanceCounters = false;
|
|
225
|
-
/** @
|
|
225
|
+
/** @internal */
|
|
226
226
|
this._startPerformanceCounter = this._startPerformanceCounterDisabled;
|
|
227
|
-
/** @
|
|
227
|
+
/** @internal */
|
|
228
228
|
this._endPerformanceCounter = this._endPerformanceCounterDisabled;
|
|
229
229
|
}
|
|
230
230
|
/**
|
|
@@ -383,13 +383,7 @@ export class GLTFFileLoader {
|
|
|
383
383
|
this.onDisposeObservable.clear();
|
|
384
384
|
}
|
|
385
385
|
/**
|
|
386
|
-
* @
|
|
387
|
-
* @param fileOrUrl
|
|
388
|
-
* @param onSuccess
|
|
389
|
-
* @param onProgress
|
|
390
|
-
* @param useArrayBuffer
|
|
391
|
-
* @param onError
|
|
392
|
-
* @hidden
|
|
386
|
+
* @internal
|
|
393
387
|
*/
|
|
394
388
|
loadFile(scene, fileOrUrl, onSuccess, onProgress, useArrayBuffer, onError) {
|
|
395
389
|
this._progressCallback = onProgress;
|
|
@@ -440,13 +434,7 @@ export class GLTFFileLoader {
|
|
|
440
434
|
}, useArrayBuffer, onError);
|
|
441
435
|
}
|
|
442
436
|
/**
|
|
443
|
-
* @
|
|
444
|
-
* @param scene
|
|
445
|
-
* @param data
|
|
446
|
-
* @param rootUrl
|
|
447
|
-
* @param onProgress
|
|
448
|
-
* @param fileName
|
|
449
|
-
* @hidden
|
|
437
|
+
* @internal
|
|
450
438
|
*/
|
|
451
439
|
importMeshAsync(meshesNames, scene, data, rootUrl, onProgress, fileName) {
|
|
452
440
|
return Promise.resolve().then(() => {
|
|
@@ -458,12 +446,7 @@ export class GLTFFileLoader {
|
|
|
458
446
|
});
|
|
459
447
|
}
|
|
460
448
|
/**
|
|
461
|
-
* @
|
|
462
|
-
* @param data
|
|
463
|
-
* @param rootUrl
|
|
464
|
-
* @param onProgress
|
|
465
|
-
* @param fileName
|
|
466
|
-
* @hidden
|
|
449
|
+
* @internal
|
|
467
450
|
*/
|
|
468
451
|
loadAsync(scene, data, rootUrl, onProgress, fileName) {
|
|
469
452
|
return Promise.resolve().then(() => {
|
|
@@ -475,12 +458,7 @@ export class GLTFFileLoader {
|
|
|
475
458
|
});
|
|
476
459
|
}
|
|
477
460
|
/**
|
|
478
|
-
* @
|
|
479
|
-
* @param data
|
|
480
|
-
* @param rootUrl
|
|
481
|
-
* @param onProgress
|
|
482
|
-
* @param fileName
|
|
483
|
-
* @hidden
|
|
461
|
+
* @internal
|
|
484
462
|
*/
|
|
485
463
|
loadAssetContainerAsync(scene, data, rootUrl, onProgress, fileName) {
|
|
486
464
|
return Promise.resolve().then(() => {
|
|
@@ -519,8 +497,7 @@ export class GLTFFileLoader {
|
|
|
519
497
|
});
|
|
520
498
|
}
|
|
521
499
|
/**
|
|
522
|
-
* @
|
|
523
|
-
* @hidden
|
|
500
|
+
* @internal
|
|
524
501
|
*/
|
|
525
502
|
canDirectLoad(data) {
|
|
526
503
|
return ((data.indexOf("asset") !== -1 && data.indexOf("version") !== -1) ||
|
|
@@ -530,9 +507,7 @@ export class GLTFFileLoader {
|
|
|
530
507
|
data.startsWith("data:model/gltf-binary;base64," + GLTFFileLoader._MagicBase64Encoded));
|
|
531
508
|
}
|
|
532
509
|
/**
|
|
533
|
-
* @
|
|
534
|
-
* @param data
|
|
535
|
-
* @hidden
|
|
510
|
+
* @internal
|
|
536
511
|
*/
|
|
537
512
|
directLoad(scene, data) {
|
|
538
513
|
if (data.startsWith("base64," + GLTFFileLoader._MagicBase64Encoded) || // this is technically incorrect, but will continue to support for backcompat.
|
|
@@ -549,7 +524,7 @@ export class GLTFFileLoader {
|
|
|
549
524
|
this._validate(scene, data);
|
|
550
525
|
return Promise.resolve({ json: this._parseJson(data) });
|
|
551
526
|
}
|
|
552
|
-
/** @
|
|
527
|
+
/** @internal */
|
|
553
528
|
createPlugin() {
|
|
554
529
|
return new GLTFFileLoader();
|
|
555
530
|
}
|
|
@@ -574,8 +549,7 @@ export class GLTFFileLoader {
|
|
|
574
549
|
});
|
|
575
550
|
}
|
|
576
551
|
/**
|
|
577
|
-
* @
|
|
578
|
-
* @hidden
|
|
552
|
+
* @internal
|
|
579
553
|
*/
|
|
580
554
|
_setState(state) {
|
|
581
555
|
if (this._state === state) {
|
|
@@ -586,13 +560,7 @@ export class GLTFFileLoader {
|
|
|
586
560
|
this._log(GLTFLoaderState[this._state]);
|
|
587
561
|
}
|
|
588
562
|
/**
|
|
589
|
-
* @
|
|
590
|
-
* @param fileOrUrl
|
|
591
|
-
* @param onSuccess
|
|
592
|
-
* @param useArrayBuffer
|
|
593
|
-
* @param onError
|
|
594
|
-
* @param onOpened
|
|
595
|
-
* @hidden
|
|
563
|
+
* @internal
|
|
596
564
|
*/
|
|
597
565
|
_loadFile(scene, fileOrUrl, onSuccess, useArrayBuffer, onError, onOpened) {
|
|
598
566
|
const request = scene._loadFile(fileOrUrl, onSuccess, (event) => {
|
|
@@ -819,14 +787,13 @@ export class GLTFFileLoader {
|
|
|
819
787
|
return 0;
|
|
820
788
|
}
|
|
821
789
|
/**
|
|
822
|
-
* @
|
|
823
|
-
* @hidden
|
|
790
|
+
* @internal
|
|
824
791
|
*/
|
|
825
792
|
_logOpen(message) {
|
|
826
793
|
this._log(message);
|
|
827
794
|
this._logIndentLevel++;
|
|
828
795
|
}
|
|
829
|
-
/** @
|
|
796
|
+
/** @internal */
|
|
830
797
|
_logClose() {
|
|
831
798
|
--this._logIndentLevel;
|
|
832
799
|
}
|
|
@@ -851,13 +818,13 @@ export class GLTFFileLoader {
|
|
|
851
818
|
* Set this property to false to disable incremental loading which delays the loader from calling the success callback until after loading the meshes and shaders.
|
|
852
819
|
* Textures always loads asynchronously. For example, the success callback can compute the bounding information of the loaded meshes when incremental loading is disabled.
|
|
853
820
|
* Defaults to true.
|
|
854
|
-
* @
|
|
821
|
+
* @internal
|
|
855
822
|
*/
|
|
856
823
|
GLTFFileLoader.IncrementalLoading = true;
|
|
857
824
|
/**
|
|
858
825
|
* Set this property to true in order to work with homogeneous coordinates, available with some converters and exporters.
|
|
859
826
|
* Defaults to false. See https://en.wikipedia.org/wiki/Homogeneous_coordinates.
|
|
860
|
-
* @
|
|
827
|
+
* @internal
|
|
861
828
|
*/
|
|
862
829
|
GLTFFileLoader.HomogeneousCoordinates = false;
|
|
863
830
|
GLTFFileLoader._MagicBase64Encoded = "Z2xURg"; // "glTF" base64 encoded (without the quotes!)
|