@babylonjs/loaders 5.0.0-beta.6 → 5.0.0-beta.8-snapshot
Sign up to get free protection for your applications and to get access to all the features.
- package/package.json +20 -198
- package/OBJ/index.d.ts +0 -4
- package/OBJ/index.js +0 -5
- package/OBJ/index.js.map +0 -1
- package/OBJ/mtlFileLoader.d.ts +0 -40
- package/OBJ/mtlFileLoader.js +0 -222
- package/OBJ/mtlFileLoader.js.map +0 -1
- package/OBJ/objFileLoader.d.ts +0 -133
- package/OBJ/objFileLoader.js +0 -301
- package/OBJ/objFileLoader.js.map +0 -1
- package/OBJ/objLoadingOptions.d.ts +0 -43
- package/OBJ/objLoadingOptions.js +0 -2
- package/OBJ/objLoadingOptions.js.map +0 -1
- package/OBJ/solidParser.d.ts +0 -153
- package/OBJ/solidParser.js +0 -700
- package/OBJ/solidParser.js.map +0 -1
- package/STL/index.d.ts +0 -1
- package/STL/index.js +0 -2
- package/STL/index.js.map +0 -1
- package/STL/stlFileLoader.d.ts +0 -71
- package/STL/stlFileLoader.js +0 -240
- package/STL/stlFileLoader.js.map +0 -1
- package/glTF/1.0/glTFBinaryExtension.d.ts +0 -13
- package/glTF/1.0/glTFBinaryExtension.js +0 -62
- package/glTF/1.0/glTFBinaryExtension.js.map +0 -1
- package/glTF/1.0/glTFLoader.d.ts +0 -106
- package/glTF/1.0/glTFLoader.js +0 -1697
- package/glTF/1.0/glTFLoader.js.map +0 -1
- package/glTF/1.0/glTFLoaderInterfaces.d.ts +0 -412
- package/glTF/1.0/glTFLoaderInterfaces.js +0 -96
- package/glTF/1.0/glTFLoaderInterfaces.js.map +0 -1
- package/glTF/1.0/glTFLoaderUtils.d.ts +0 -62
- package/glTF/1.0/glTFLoaderUtils.js +0 -233
- package/glTF/1.0/glTFLoaderUtils.js.map +0 -1
- package/glTF/1.0/glTFMaterialsCommonExtension.d.ts +0 -10
- package/glTF/1.0/glTFMaterialsCommonExtension.js +0 -128
- package/glTF/1.0/glTFMaterialsCommonExtension.js.map +0 -1
- package/glTF/1.0/index.d.ts +0 -5
- package/glTF/1.0/index.js +0 -6
- package/glTF/1.0/index.js.map +0 -1
- package/glTF/2.0/Extensions/EXT_lights_image_based.d.ts +0 -36
- package/glTF/2.0/Extensions/EXT_lights_image_based.js +0 -111
- package/glTF/2.0/Extensions/EXT_lights_image_based.js.map +0 -1
- package/glTF/2.0/Extensions/EXT_mesh_gpu_instancing.d.ts +0 -27
- package/glTF/2.0/Extensions/EXT_mesh_gpu_instancing.js +0 -80
- package/glTF/2.0/Extensions/EXT_mesh_gpu_instancing.js.map +0 -1
- package/glTF/2.0/Extensions/EXT_meshopt_compression.d.ts +0 -27
- package/glTF/2.0/Extensions/EXT_meshopt_compression.js +0 -43
- package/glTF/2.0/Extensions/EXT_meshopt_compression.js.map +0 -1
- package/glTF/2.0/Extensions/EXT_texture_webp.d.ts +0 -21
- package/glTF/2.0/Extensions/EXT_texture_webp.js +0 -33
- package/glTF/2.0/Extensions/EXT_texture_webp.js.map +0 -1
- package/glTF/2.0/Extensions/ExtrasAsMetadata.d.ts +0 -32
- package/glTF/2.0/Extensions/ExtrasAsMetadata.js +0 -56
- package/glTF/2.0/Extensions/ExtrasAsMetadata.js.map +0 -1
- package/glTF/2.0/Extensions/KHR_draco_mesh_compression.d.ts +0 -31
- package/glTF/2.0/Extensions/KHR_draco_mesh_compression.js +0 -102
- package/glTF/2.0/Extensions/KHR_draco_mesh_compression.js.map +0 -1
- package/glTF/2.0/Extensions/KHR_lights_punctual.d.ts +0 -28
- package/glTF/2.0/Extensions/KHR_lights_punctual.js +0 -82
- package/glTF/2.0/Extensions/KHR_lights_punctual.js.map +0 -1
- package/glTF/2.0/Extensions/KHR_materials_clearcoat.d.ts +0 -31
- package/glTF/2.0/Extensions/KHR_materials_clearcoat.js +0 -87
- package/glTF/2.0/Extensions/KHR_materials_clearcoat.js.map +0 -1
- package/glTF/2.0/Extensions/KHR_materials_emissive_strength.d.ts +0 -30
- package/glTF/2.0/Extensions/KHR_materials_emissive_strength.js +0 -46
- package/glTF/2.0/Extensions/KHR_materials_emissive_strength.js.map +0 -1
- package/glTF/2.0/Extensions/KHR_materials_ior.d.ts +0 -34
- package/glTF/2.0/Extensions/KHR_materials_ior.js +0 -55
- package/glTF/2.0/Extensions/KHR_materials_ior.js.map +0 -1
- package/glTF/2.0/Extensions/KHR_materials_pbrSpecularGlossiness.d.ts +0 -30
- package/glTF/2.0/Extensions/KHR_materials_pbrSpecularGlossiness.js +0 -73
- package/glTF/2.0/Extensions/KHR_materials_pbrSpecularGlossiness.js.map +0 -1
- package/glTF/2.0/Extensions/KHR_materials_sheen.d.ts +0 -31
- package/glTF/2.0/Extensions/KHR_materials_sheen.js +0 -77
- package/glTF/2.0/Extensions/KHR_materials_sheen.js.map +0 -1
- package/glTF/2.0/Extensions/KHR_materials_specular.d.ts +0 -30
- package/glTF/2.0/Extensions/KHR_materials_specular.js +0 -67
- package/glTF/2.0/Extensions/KHR_materials_specular.js.map +0 -1
- package/glTF/2.0/Extensions/KHR_materials_translucency.d.ts +0 -31
- package/glTF/2.0/Extensions/KHR_materials_translucency.js +0 -77
- package/glTF/2.0/Extensions/KHR_materials_translucency.js.map +0 -1
- package/glTF/2.0/Extensions/KHR_materials_transmission.d.ts +0 -30
- package/glTF/2.0/Extensions/KHR_materials_transmission.js +0 -278
- package/glTF/2.0/Extensions/KHR_materials_transmission.js.map +0 -1
- package/glTF/2.0/Extensions/KHR_materials_unlit.d.ts +0 -30
- package/glTF/2.0/Extensions/KHR_materials_unlit.js +0 -66
- package/glTF/2.0/Extensions/KHR_materials_unlit.js.map +0 -1
- package/glTF/2.0/Extensions/KHR_materials_variants.d.ts +0 -76
- package/glTF/2.0/Extensions/KHR_materials_variants.js +0 -244
- package/glTF/2.0/Extensions/KHR_materials_variants.js.map +0 -1
- package/glTF/2.0/Extensions/KHR_materials_volume.d.ts +0 -31
- package/glTF/2.0/Extensions/KHR_materials_volume.js +0 -79
- package/glTF/2.0/Extensions/KHR_materials_volume.js.map +0 -1
- package/glTF/2.0/Extensions/KHR_mesh_quantization.d.ts +0 -19
- package/glTF/2.0/Extensions/KHR_mesh_quantization.js +0 -22
- package/glTF/2.0/Extensions/KHR_mesh_quantization.js.map +0 -1
- package/glTF/2.0/Extensions/KHR_texture_basisu.d.ts +0 -21
- package/glTF/2.0/Extensions/KHR_texture_basisu.js +0 -33
- package/glTF/2.0/Extensions/KHR_texture_basisu.js.map +0 -1
- package/glTF/2.0/Extensions/KHR_texture_transform.d.ts +0 -25
- package/glTF/2.0/Extensions/KHR_texture_transform.js +0 -54
- package/glTF/2.0/Extensions/KHR_texture_transform.js.map +0 -1
- package/glTF/2.0/Extensions/KHR_xmp_json_ld.d.ts +0 -29
- package/glTF/2.0/Extensions/KHR_xmp_json_ld.js +0 -47
- package/glTF/2.0/Extensions/KHR_xmp_json_ld.js.map +0 -1
- package/glTF/2.0/Extensions/MSFT_audio_emitter.d.ts +0 -38
- package/glTF/2.0/Extensions/MSFT_audio_emitter.js +0 -217
- package/glTF/2.0/Extensions/MSFT_audio_emitter.js.map +0 -1
- package/glTF/2.0/Extensions/MSFT_lod.d.ts +0 -75
- package/glTF/2.0/Extensions/MSFT_lod.js +0 -334
- package/glTF/2.0/Extensions/MSFT_lod.js.map +0 -1
- package/glTF/2.0/Extensions/MSFT_minecraftMesh.d.ts +0 -14
- package/glTF/2.0/Extensions/MSFT_minecraftMesh.js +0 -37
- package/glTF/2.0/Extensions/MSFT_minecraftMesh.js.map +0 -1
- package/glTF/2.0/Extensions/MSFT_sRGBFactors.d.ts +0 -14
- package/glTF/2.0/Extensions/MSFT_sRGBFactors.js +0 -37
- package/glTF/2.0/Extensions/MSFT_sRGBFactors.js.map +0 -1
- package/glTF/2.0/Extensions/index.d.ts +0 -26
- package/glTF/2.0/Extensions/index.js +0 -27
- package/glTF/2.0/Extensions/index.js.map +0 -1
- package/glTF/2.0/glTFLoader.d.ts +0 -355
- package/glTF/2.0/glTFLoader.js +0 -2184
- package/glTF/2.0/glTFLoader.js.map +0 -1
- package/glTF/2.0/glTFLoaderExtension.d.ts +0 -152
- package/glTF/2.0/glTFLoaderExtension.js +0 -2
- package/glTF/2.0/glTFLoaderExtension.js.map +0 -1
- package/glTF/2.0/glTFLoaderInterfaces.d.ts +0 -212
- package/glTF/2.0/glTFLoaderInterfaces.js +0 -2
- package/glTF/2.0/glTFLoaderInterfaces.js.map +0 -1
- package/glTF/2.0/index.d.ts +0 -4
- package/glTF/2.0/index.js +0 -5
- package/glTF/2.0/index.js.map +0 -1
- package/glTF/glTFFileLoader.d.ts +0 -364
- package/glTF/glTFFileLoader.js +0 -865
- package/glTF/glTFFileLoader.js.map +0 -1
- package/glTF/glTFValidation.d.ts +0 -29
- package/glTF/glTFValidation.js +0 -122
- package/glTF/glTFValidation.js.map +0 -1
- package/glTF/index.d.ts +0 -5
- package/glTF/index.js +0 -6
- package/glTF/index.js.map +0 -1
- package/index.d.ts +0 -3
- package/index.js.map +0 -1
- package/legacy/legacy-glTF.d.ts +0 -2
- package/legacy/legacy-glTF.js +0 -19
- package/legacy/legacy-glTF.js.map +0 -1
- package/legacy/legacy-glTF1.d.ts +0 -2
- package/legacy/legacy-glTF1.js +0 -15
- package/legacy/legacy-glTF1.js.map +0 -1
- package/legacy/legacy-glTF1FileLoader.d.ts +0 -2
- package/legacy/legacy-glTF1FileLoader.js +0 -3
- package/legacy/legacy-glTF1FileLoader.js.map +0 -1
- package/legacy/legacy-glTF2.d.ts +0 -2
- package/legacy/legacy-glTF2.js +0 -33
- package/legacy/legacy-glTF2.js.map +0 -1
- package/legacy/legacy-glTF2FileLoader.d.ts +0 -2
- package/legacy/legacy-glTF2FileLoader.js +0 -3
- package/legacy/legacy-glTF2FileLoader.js.map +0 -1
- package/legacy/legacy-glTFFileLoader.d.ts +0 -3
- package/legacy/legacy-glTFFileLoader.js +0 -4
- package/legacy/legacy-glTFFileLoader.js.map +0 -1
- package/legacy/legacy-objFileLoader.d.ts +0 -1
- package/legacy/legacy-objFileLoader.js +0 -13
- package/legacy/legacy-objFileLoader.js.map +0 -1
- package/legacy/legacy-stlFileLoader.d.ts +0 -1
- package/legacy/legacy-stlFileLoader.js +0 -13
- package/legacy/legacy-stlFileLoader.js.map +0 -1
- package/legacy/legacy.d.ts +0 -6
- package/legacy/legacy.js +0 -7
- package/legacy/legacy.js.map +0 -1
- package/readme.md +0 -24
@@ -1 +0,0 @@
|
|
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,212 +0,0 @@
|
|
1
|
-
import { AnimationGroup } from "@babylonjs/core/Animations/animationGroup";
|
2
|
-
import { Bone } from "@babylonjs/core/Bones/bone";
|
3
|
-
import { Skeleton } from "@babylonjs/core/Bones/skeleton";
|
4
|
-
import { Material } from "@babylonjs/core/Materials/material";
|
5
|
-
import { TransformNode } from "@babylonjs/core/Meshes/transformNode";
|
6
|
-
import { Buffer, VertexBuffer } from "@babylonjs/core/Buffers/buffer";
|
7
|
-
import { AbstractMesh } from "@babylonjs/core/Meshes/abstractMesh";
|
8
|
-
import { Mesh } from "@babylonjs/core/Meshes/mesh";
|
9
|
-
import * as GLTF2 from "babylonjs-gltf2interface";
|
10
|
-
/**
|
11
|
-
* Loader interface with an index field.
|
12
|
-
*/
|
13
|
-
export interface IArrayItem {
|
14
|
-
/**
|
15
|
-
* The index of this item in the array.
|
16
|
-
*/
|
17
|
-
index: number;
|
18
|
-
}
|
19
|
-
/**
|
20
|
-
* Loader interface with additional members.
|
21
|
-
*/
|
22
|
-
export interface IAccessor extends GLTF2.IAccessor, IArrayItem {
|
23
|
-
/** @hidden */
|
24
|
-
_data?: Promise<ArrayBufferView>;
|
25
|
-
/** @hidden */
|
26
|
-
_babylonVertexBuffer?: {
|
27
|
-
[kind: string]: Promise<VertexBuffer>;
|
28
|
-
};
|
29
|
-
}
|
30
|
-
/**
|
31
|
-
* Loader interface with additional members.
|
32
|
-
*/
|
33
|
-
export interface IAnimationChannel extends GLTF2.IAnimationChannel, IArrayItem {
|
34
|
-
}
|
35
|
-
/** @hidden */
|
36
|
-
export interface _IAnimationSamplerData {
|
37
|
-
input: Float32Array;
|
38
|
-
interpolation: GLTF2.AnimationSamplerInterpolation;
|
39
|
-
output: Float32Array;
|
40
|
-
}
|
41
|
-
/**
|
42
|
-
* Loader interface with additional members.
|
43
|
-
*/
|
44
|
-
export interface IAnimationSampler extends GLTF2.IAnimationSampler, IArrayItem {
|
45
|
-
/** @hidden */
|
46
|
-
_data?: Promise<_IAnimationSamplerData>;
|
47
|
-
}
|
48
|
-
/**
|
49
|
-
* Loader interface with additional members.
|
50
|
-
*/
|
51
|
-
export interface IAnimation extends GLTF2.IAnimation, IArrayItem {
|
52
|
-
channels: IAnimationChannel[];
|
53
|
-
samplers: IAnimationSampler[];
|
54
|
-
/** @hidden */
|
55
|
-
_babylonAnimationGroup?: AnimationGroup;
|
56
|
-
}
|
57
|
-
/**
|
58
|
-
* Loader interface with additional members.
|
59
|
-
*/
|
60
|
-
export interface IBuffer extends GLTF2.IBuffer, IArrayItem {
|
61
|
-
/** @hidden */
|
62
|
-
_data?: Promise<ArrayBufferView>;
|
63
|
-
}
|
64
|
-
/**
|
65
|
-
* Loader interface with additional members.
|
66
|
-
*/
|
67
|
-
export interface IBufferView extends GLTF2.IBufferView, IArrayItem {
|
68
|
-
/** @hidden */
|
69
|
-
_data?: Promise<ArrayBufferView>;
|
70
|
-
/** @hidden */
|
71
|
-
_babylonBuffer?: Promise<Buffer>;
|
72
|
-
}
|
73
|
-
/**
|
74
|
-
* Loader interface with additional members.
|
75
|
-
*/
|
76
|
-
export interface ICamera extends GLTF2.ICamera, IArrayItem {
|
77
|
-
}
|
78
|
-
/**
|
79
|
-
* Loader interface with additional members.
|
80
|
-
*/
|
81
|
-
export interface IImage extends GLTF2.IImage, IArrayItem {
|
82
|
-
/** @hidden */
|
83
|
-
_data?: Promise<ArrayBufferView>;
|
84
|
-
}
|
85
|
-
/**
|
86
|
-
* Loader interface with additional members.
|
87
|
-
*/
|
88
|
-
export interface IMaterialNormalTextureInfo extends GLTF2.IMaterialNormalTextureInfo, ITextureInfo {
|
89
|
-
}
|
90
|
-
/**
|
91
|
-
* Loader interface with additional members.
|
92
|
-
*/
|
93
|
-
export interface IMaterialOcclusionTextureInfo extends GLTF2.IMaterialOcclusionTextureInfo, ITextureInfo {
|
94
|
-
}
|
95
|
-
/**
|
96
|
-
* Loader interface with additional members.
|
97
|
-
*/
|
98
|
-
export interface IMaterialPbrMetallicRoughness extends GLTF2.IMaterialPbrMetallicRoughness {
|
99
|
-
baseColorTexture?: ITextureInfo;
|
100
|
-
metallicRoughnessTexture?: ITextureInfo;
|
101
|
-
}
|
102
|
-
/**
|
103
|
-
* Loader interface with additional members.
|
104
|
-
*/
|
105
|
-
export interface IMaterial extends GLTF2.IMaterial, IArrayItem {
|
106
|
-
pbrMetallicRoughness?: IMaterialPbrMetallicRoughness;
|
107
|
-
normalTexture?: IMaterialNormalTextureInfo;
|
108
|
-
occlusionTexture?: IMaterialOcclusionTextureInfo;
|
109
|
-
emissiveTexture?: ITextureInfo;
|
110
|
-
/** @hidden */
|
111
|
-
_data?: {
|
112
|
-
[babylonDrawMode: number]: {
|
113
|
-
babylonMaterial: Material;
|
114
|
-
babylonMeshes: AbstractMesh[];
|
115
|
-
promise: Promise<void>;
|
116
|
-
};
|
117
|
-
};
|
118
|
-
}
|
119
|
-
/**
|
120
|
-
* Loader interface with additional members.
|
121
|
-
*/
|
122
|
-
export interface IMesh extends GLTF2.IMesh, IArrayItem {
|
123
|
-
primitives: IMeshPrimitive[];
|
124
|
-
}
|
125
|
-
/**
|
126
|
-
* Loader interface with additional members.
|
127
|
-
*/
|
128
|
-
export interface IMeshPrimitive extends GLTF2.IMeshPrimitive, IArrayItem {
|
129
|
-
/** @hidden */
|
130
|
-
_instanceData?: {
|
131
|
-
babylonSourceMesh: Mesh;
|
132
|
-
promise: Promise<any>;
|
133
|
-
};
|
134
|
-
}
|
135
|
-
/**
|
136
|
-
* Loader interface with additional members.
|
137
|
-
*/
|
138
|
-
export interface INode extends GLTF2.INode, IArrayItem {
|
139
|
-
/**
|
140
|
-
* The parent glTF node.
|
141
|
-
*/
|
142
|
-
parent?: INode;
|
143
|
-
/** @hidden */
|
144
|
-
_babylonTransformNode?: TransformNode;
|
145
|
-
/** @hidden */
|
146
|
-
_primitiveBabylonMeshes?: AbstractMesh[];
|
147
|
-
/** @hidden */
|
148
|
-
_babylonBones?: Bone[];
|
149
|
-
/** @hidden */
|
150
|
-
_numMorphTargets?: number;
|
151
|
-
}
|
152
|
-
/** @hidden */
|
153
|
-
export interface _ISamplerData {
|
154
|
-
noMipMaps: boolean;
|
155
|
-
samplingMode: number;
|
156
|
-
wrapU: number;
|
157
|
-
wrapV: number;
|
158
|
-
}
|
159
|
-
/**
|
160
|
-
* Loader interface with additional members.
|
161
|
-
*/
|
162
|
-
export interface ISampler extends GLTF2.ISampler, IArrayItem {
|
163
|
-
/** @hidden */
|
164
|
-
_data?: _ISamplerData;
|
165
|
-
}
|
166
|
-
/**
|
167
|
-
* Loader interface with additional members.
|
168
|
-
*/
|
169
|
-
export interface IScene extends GLTF2.IScene, IArrayItem {
|
170
|
-
}
|
171
|
-
/**
|
172
|
-
* Loader interface with additional members.
|
173
|
-
*/
|
174
|
-
export interface ISkin extends GLTF2.ISkin, IArrayItem {
|
175
|
-
/** @hidden */
|
176
|
-
_data?: {
|
177
|
-
babylonSkeleton: Skeleton;
|
178
|
-
promise: Promise<void>;
|
179
|
-
};
|
180
|
-
}
|
181
|
-
/**
|
182
|
-
* Loader interface with additional members.
|
183
|
-
*/
|
184
|
-
export interface ITexture extends GLTF2.ITexture, IArrayItem {
|
185
|
-
/** @hidden */
|
186
|
-
_textureInfo: ITextureInfo;
|
187
|
-
}
|
188
|
-
/**
|
189
|
-
* Loader interface with additional members.
|
190
|
-
*/
|
191
|
-
export interface ITextureInfo extends GLTF2.ITextureInfo {
|
192
|
-
/** false or undefined if the texture holds color data (true if data are roughness, normal, ...) */
|
193
|
-
nonColorData?: boolean;
|
194
|
-
}
|
195
|
-
/**
|
196
|
-
* Loader interface with additional members.
|
197
|
-
*/
|
198
|
-
export interface IGLTF extends GLTF2.IGLTF {
|
199
|
-
accessors?: IAccessor[];
|
200
|
-
animations?: IAnimation[];
|
201
|
-
buffers?: IBuffer[];
|
202
|
-
bufferViews?: IBufferView[];
|
203
|
-
cameras?: ICamera[];
|
204
|
-
images?: IImage[];
|
205
|
-
materials?: IMaterial[];
|
206
|
-
meshes?: IMesh[];
|
207
|
-
nodes?: INode[];
|
208
|
-
samplers?: ISampler[];
|
209
|
-
scenes?: IScene[];
|
210
|
-
skins?: ISkin[];
|
211
|
-
textures?: ITexture[];
|
212
|
-
}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"glTFLoaderInterfaces.js","sourceRoot":"","sources":["../../../../sourceES6/loaders/src/glTF/2.0/glTFLoaderInterfaces.ts"],"names":[],"mappings":"","sourcesContent":["import { AnimationGroup } from \"@babylonjs/core/Animations/animationGroup\";\r\nimport { Bone } from \"@babylonjs/core/Bones/bone\";\r\nimport { Skeleton } from \"@babylonjs/core/Bones/skeleton\";\r\nimport { Material } from \"@babylonjs/core/Materials/material\";\r\nimport { TransformNode } from \"@babylonjs/core/Meshes/transformNode\";\r\nimport { Buffer, VertexBuffer } from \"@babylonjs/core/Buffers/buffer\";\r\nimport { AbstractMesh } from \"@babylonjs/core/Meshes/abstractMesh\";\r\nimport { Mesh } from \"@babylonjs/core/Meshes/mesh\";\r\n\r\nimport * 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 /** @hidden */\r\n _data?: Promise<ArrayBufferView>;\r\n\r\n /** @hidden */\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\r\n/** @hidden */\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 /** @hidden */\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 /** @hidden */\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 /** @hidden */\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 /** @hidden */\r\n _data?: Promise<ArrayBufferView>;\r\n\r\n /** @hidden */\r\n _babylonBuffer?: Promise<Buffer>;\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}\r\n\r\n/**\r\n * Loader interface with additional members.\r\n */\r\nexport interface IImage extends GLTF2.IImage, IArrayItem {\r\n /** @hidden */\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/**\r\n * Loader interface with additional members.\r\n */\r\nexport interface IMaterialOcclusionTextureInfo extends GLTF2.IMaterialOcclusionTextureInfo, ITextureInfo {\r\n}\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 /** @hidden */\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 /** @hidden */\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 /** @hidden */\r\n _babylonTransformNode?: TransformNode;\r\n\r\n /** @hidden */\r\n _primitiveBabylonMeshes?: AbstractMesh[];\r\n\r\n /** @hidden */\r\n _babylonBones?: Bone[];\r\n\r\n /** @hidden */\r\n _numMorphTargets?: number;\r\n}\r\n\r\n/** @hidden */\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 /** @hidden */\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/**\r\n * Loader interface with additional members.\r\n */\r\nexport interface ISkin extends GLTF2.ISkin, IArrayItem {\r\n /** @hidden */\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 /** @hidden */\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/2.0/index.d.ts
DELETED
package/glTF/2.0/index.js
DELETED
package/glTF/2.0/index.js.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../sourceES6/loaders/src/glTF/2.0/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC","sourcesContent":["export * from \"./glTFLoader\";\r\nexport * from \"./glTFLoaderExtension\";\r\nexport * from \"./glTFLoaderInterfaces\";\r\nexport * from \"./Extensions/index\";"]}
|
package/glTF/glTFFileLoader.d.ts
DELETED
@@ -1,364 +0,0 @@
|
|
1
|
-
import * as GLTF2 from "babylonjs-gltf2interface";
|
2
|
-
import { Nullable } from "@babylonjs/core/types";
|
3
|
-
import { Observable } from "@babylonjs/core/Misc/observable";
|
4
|
-
import { Camera } from "@babylonjs/core/Cameras/camera";
|
5
|
-
import { BaseTexture } from "@babylonjs/core/Materials/Textures/baseTexture";
|
6
|
-
import { Material } from "@babylonjs/core/Materials/material";
|
7
|
-
import { AbstractMesh } from "@babylonjs/core/Meshes/abstractMesh";
|
8
|
-
import { ISceneLoaderPluginFactory, ISceneLoaderPlugin, ISceneLoaderPluginAsync, ISceneLoaderProgressEvent, ISceneLoaderPluginExtensions, ISceneLoaderAsyncResult } from "@babylonjs/core/Loading/sceneLoader";
|
9
|
-
import { AssetContainer } from "@babylonjs/core/assetContainer";
|
10
|
-
import { Scene, IDisposable } from "@babylonjs/core/scene";
|
11
|
-
import { WebRequest } from "@babylonjs/core/Misc/webRequest";
|
12
|
-
import { IFileRequest } from "@babylonjs/core/Misc/fileRequest";
|
13
|
-
import { IDataBuffer } from '@babylonjs/core/Misc/dataReader';
|
14
|
-
import { LoadFileError } from '@babylonjs/core/Misc/fileTools';
|
15
|
-
/**
|
16
|
-
* Mode that determines the coordinate system to use.
|
17
|
-
*/
|
18
|
-
export declare enum GLTFLoaderCoordinateSystemMode {
|
19
|
-
/**
|
20
|
-
* Automatically convert the glTF right-handed data to the appropriate system based on the current coordinate system mode of the scene.
|
21
|
-
*/
|
22
|
-
AUTO = 0,
|
23
|
-
/**
|
24
|
-
* Sets the useRightHandedSystem flag on the scene.
|
25
|
-
*/
|
26
|
-
FORCE_RIGHT_HANDED = 1
|
27
|
-
}
|
28
|
-
/**
|
29
|
-
* Mode that determines what animations will start.
|
30
|
-
*/
|
31
|
-
export declare enum GLTFLoaderAnimationStartMode {
|
32
|
-
/**
|
33
|
-
* No animation will start.
|
34
|
-
*/
|
35
|
-
NONE = 0,
|
36
|
-
/**
|
37
|
-
* The first animation will start.
|
38
|
-
*/
|
39
|
-
FIRST = 1,
|
40
|
-
/**
|
41
|
-
* All animations will start.
|
42
|
-
*/
|
43
|
-
ALL = 2
|
44
|
-
}
|
45
|
-
/**
|
46
|
-
* Interface that contains the data for the glTF asset.
|
47
|
-
*/
|
48
|
-
export interface IGLTFLoaderData {
|
49
|
-
/**
|
50
|
-
* The object that represents the glTF JSON.
|
51
|
-
*/
|
52
|
-
json: Object;
|
53
|
-
/**
|
54
|
-
* The BIN chunk of a binary glTF.
|
55
|
-
*/
|
56
|
-
bin: Nullable<IDataBuffer>;
|
57
|
-
}
|
58
|
-
/**
|
59
|
-
* Interface for extending the loader.
|
60
|
-
*/
|
61
|
-
export interface IGLTFLoaderExtension {
|
62
|
-
/**
|
63
|
-
* The name of this extension.
|
64
|
-
*/
|
65
|
-
readonly name: string;
|
66
|
-
/**
|
67
|
-
* Defines whether this extension is enabled.
|
68
|
-
*/
|
69
|
-
enabled: boolean;
|
70
|
-
/**
|
71
|
-
* Defines the order of this extension.
|
72
|
-
* The loader sorts the extensions using these values when loading.
|
73
|
-
*/
|
74
|
-
order?: number;
|
75
|
-
}
|
76
|
-
/**
|
77
|
-
* Loader state.
|
78
|
-
*/
|
79
|
-
export declare enum GLTFLoaderState {
|
80
|
-
/**
|
81
|
-
* The asset is loading.
|
82
|
-
*/
|
83
|
-
LOADING = 0,
|
84
|
-
/**
|
85
|
-
* The asset is ready for rendering.
|
86
|
-
*/
|
87
|
-
READY = 1,
|
88
|
-
/**
|
89
|
-
* The asset is completely loaded.
|
90
|
-
*/
|
91
|
-
COMPLETE = 2
|
92
|
-
}
|
93
|
-
/** @hidden */
|
94
|
-
export interface IGLTFLoader extends IDisposable {
|
95
|
-
importMeshAsync: (meshesNames: any, scene: Scene, container: Nullable<AssetContainer>, data: IGLTFLoaderData, rootUrl: string, onProgress?: (event: ISceneLoaderProgressEvent) => void, fileName?: string) => Promise<ISceneLoaderAsyncResult>;
|
96
|
-
loadAsync: (scene: Scene, data: IGLTFLoaderData, rootUrl: string, onProgress?: (event: ISceneLoaderProgressEvent) => void, fileName?: string) => Promise<void>;
|
97
|
-
}
|
98
|
-
/**
|
99
|
-
* File loader for loading glTF files into a scene.
|
100
|
-
*/
|
101
|
-
export declare class GLTFFileLoader implements IDisposable, ISceneLoaderPluginAsync, ISceneLoaderPluginFactory {
|
102
|
-
/** @hidden */
|
103
|
-
static _CreateGLTF1Loader: (parent: GLTFFileLoader) => IGLTFLoader;
|
104
|
-
/** @hidden */
|
105
|
-
static _CreateGLTF2Loader: (parent: GLTFFileLoader) => IGLTFLoader;
|
106
|
-
/**
|
107
|
-
* Raised when the asset has been parsed
|
108
|
-
*/
|
109
|
-
onParsedObservable: Observable<IGLTFLoaderData>;
|
110
|
-
private _onParsedObserver;
|
111
|
-
/**
|
112
|
-
* Raised when the asset has been parsed
|
113
|
-
*/
|
114
|
-
set onParsed(callback: (loaderData: IGLTFLoaderData) => void);
|
115
|
-
/**
|
116
|
-
* 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.
|
117
|
-
* Textures always loads asynchronously. For example, the success callback can compute the bounding information of the loaded meshes when incremental loading is disabled.
|
118
|
-
* Defaults to true.
|
119
|
-
* @hidden
|
120
|
-
*/
|
121
|
-
static IncrementalLoading: boolean;
|
122
|
-
/**
|
123
|
-
* Set this property to true in order to work with homogeneous coordinates, available with some converters and exporters.
|
124
|
-
* Defaults to false. See https://en.wikipedia.org/wiki/Homogeneous_coordinates.
|
125
|
-
* @hidden
|
126
|
-
*/
|
127
|
-
static HomogeneousCoordinates: boolean;
|
128
|
-
/**
|
129
|
-
* The coordinate system mode. Defaults to AUTO.
|
130
|
-
*/
|
131
|
-
coordinateSystemMode: GLTFLoaderCoordinateSystemMode;
|
132
|
-
/**
|
133
|
-
* The animation start mode. Defaults to FIRST.
|
134
|
-
*/
|
135
|
-
animationStartMode: GLTFLoaderAnimationStartMode;
|
136
|
-
/**
|
137
|
-
* Defines if the loader should compile materials before raising the success callback. Defaults to false.
|
138
|
-
*/
|
139
|
-
compileMaterials: boolean;
|
140
|
-
/**
|
141
|
-
* Defines if the loader should also compile materials with clip planes. Defaults to false.
|
142
|
-
*/
|
143
|
-
useClipPlane: boolean;
|
144
|
-
/**
|
145
|
-
* Defines if the loader should compile shadow generators before raising the success callback. Defaults to false.
|
146
|
-
*/
|
147
|
-
compileShadowGenerators: boolean;
|
148
|
-
/**
|
149
|
-
* Defines if the Alpha blended materials are only applied as coverage.
|
150
|
-
* If false, (default) The luminance of each pixel will reduce its opacity to simulate the behaviour of most physical materials.
|
151
|
-
* If true, no extra effects are applied to transparent pixels.
|
152
|
-
*/
|
153
|
-
transparencyAsCoverage: boolean;
|
154
|
-
/**
|
155
|
-
* Defines if the loader should use range requests when load binary glTF files from HTTP.
|
156
|
-
* Enabling will disable offline support and glTF validator.
|
157
|
-
* Defaults to false.
|
158
|
-
*/
|
159
|
-
useRangeRequests: boolean;
|
160
|
-
/**
|
161
|
-
* Defines if the loader should create instances when multiple glTF nodes point to the same glTF mesh. Defaults to true.
|
162
|
-
*/
|
163
|
-
createInstances: boolean;
|
164
|
-
/**
|
165
|
-
* Defines if the loader should always compute the bounding boxes of meshes and not use the min/max values from the position accessor. Defaults to false.
|
166
|
-
*/
|
167
|
-
alwaysComputeBoundingBox: boolean;
|
168
|
-
/**
|
169
|
-
* If true, load all materials defined in the file, even if not used by any mesh. Defaults to false.
|
170
|
-
*/
|
171
|
-
loadAllMaterials: boolean;
|
172
|
-
/**
|
173
|
-
* If true, load the color (gamma encoded) textures into sRGB buffers (if supported by the GPU), which will yield more accurate results when sampling the texture. Defaults to true.
|
174
|
-
*/
|
175
|
-
useSRGBBuffers: boolean;
|
176
|
-
/**
|
177
|
-
* Function called before loading a url referenced by the asset.
|
178
|
-
*/
|
179
|
-
preprocessUrlAsync: (url: string) => Promise<string>;
|
180
|
-
/**
|
181
|
-
* Observable raised when the loader creates a mesh after parsing the glTF properties of the mesh.
|
182
|
-
* Note that the observable is raised as soon as the mesh object is created, meaning some data may not have been setup yet for this mesh (vertex data, morph targets, material, ...)
|
183
|
-
*/
|
184
|
-
readonly onMeshLoadedObservable: Observable<AbstractMesh>;
|
185
|
-
private _onMeshLoadedObserver;
|
186
|
-
/**
|
187
|
-
* Callback raised when the loader creates a mesh after parsing the glTF properties of the mesh.
|
188
|
-
* Note that the callback is called as soon as the mesh object is created, meaning some data may not have been setup yet for this mesh (vertex data, morph targets, material, ...)
|
189
|
-
*/
|
190
|
-
set onMeshLoaded(callback: (mesh: AbstractMesh) => void);
|
191
|
-
/**
|
192
|
-
* Observable raised when the loader creates a texture after parsing the glTF properties of the texture.
|
193
|
-
*/
|
194
|
-
readonly onTextureLoadedObservable: Observable<BaseTexture>;
|
195
|
-
private _onTextureLoadedObserver;
|
196
|
-
/**
|
197
|
-
* Callback raised when the loader creates a texture after parsing the glTF properties of the texture.
|
198
|
-
*/
|
199
|
-
set onTextureLoaded(callback: (texture: BaseTexture) => void);
|
200
|
-
/**
|
201
|
-
* Observable raised when the loader creates a material after parsing the glTF properties of the material.
|
202
|
-
*/
|
203
|
-
readonly onMaterialLoadedObservable: Observable<Material>;
|
204
|
-
private _onMaterialLoadedObserver;
|
205
|
-
/**
|
206
|
-
* Callback raised when the loader creates a material after parsing the glTF properties of the material.
|
207
|
-
*/
|
208
|
-
set onMaterialLoaded(callback: (material: Material) => void);
|
209
|
-
/**
|
210
|
-
* Observable raised when the loader creates a camera after parsing the glTF properties of the camera.
|
211
|
-
*/
|
212
|
-
readonly onCameraLoadedObservable: Observable<Camera>;
|
213
|
-
private _onCameraLoadedObserver;
|
214
|
-
/**
|
215
|
-
* Callback raised when the loader creates a camera after parsing the glTF properties of the camera.
|
216
|
-
*/
|
217
|
-
set onCameraLoaded(callback: (camera: Camera) => void);
|
218
|
-
/**
|
219
|
-
* Observable raised when the asset is completely loaded, immediately before the loader is disposed.
|
220
|
-
* For assets with LODs, raised when all of the LODs are complete.
|
221
|
-
* For assets without LODs, raised when the model is complete, immediately after the loader resolves the returned promise.
|
222
|
-
*/
|
223
|
-
readonly onCompleteObservable: Observable<void>;
|
224
|
-
private _onCompleteObserver;
|
225
|
-
/**
|
226
|
-
* Callback raised when the asset is completely loaded, immediately before the loader is disposed.
|
227
|
-
* For assets with LODs, raised when all of the LODs are complete.
|
228
|
-
* For assets without LODs, raised when the model is complete, immediately after the loader resolves the returned promise.
|
229
|
-
*/
|
230
|
-
set onComplete(callback: () => void);
|
231
|
-
/**
|
232
|
-
* Observable raised when an error occurs.
|
233
|
-
*/
|
234
|
-
readonly onErrorObservable: Observable<any>;
|
235
|
-
private _onErrorObserver;
|
236
|
-
/**
|
237
|
-
* Callback raised when an error occurs.
|
238
|
-
*/
|
239
|
-
set onError(callback: (reason: any) => void);
|
240
|
-
/**
|
241
|
-
* Observable raised after the loader is disposed.
|
242
|
-
*/
|
243
|
-
readonly onDisposeObservable: Observable<void>;
|
244
|
-
private _onDisposeObserver;
|
245
|
-
/**
|
246
|
-
* Callback raised after the loader is disposed.
|
247
|
-
*/
|
248
|
-
set onDispose(callback: () => void);
|
249
|
-
/**
|
250
|
-
* Observable raised after a loader extension is created.
|
251
|
-
* Set additional options for a loader extension in this event.
|
252
|
-
*/
|
253
|
-
readonly onExtensionLoadedObservable: Observable<IGLTFLoaderExtension>;
|
254
|
-
private _onExtensionLoadedObserver;
|
255
|
-
/**
|
256
|
-
* Callback raised after a loader extension is created.
|
257
|
-
*/
|
258
|
-
set onExtensionLoaded(callback: (extension: IGLTFLoaderExtension) => void);
|
259
|
-
/**
|
260
|
-
* Defines if the loader logging is enabled.
|
261
|
-
*/
|
262
|
-
get loggingEnabled(): boolean;
|
263
|
-
set loggingEnabled(value: boolean);
|
264
|
-
/**
|
265
|
-
* Defines if the loader should capture performance counters.
|
266
|
-
*/
|
267
|
-
get capturePerformanceCounters(): boolean;
|
268
|
-
set capturePerformanceCounters(value: boolean);
|
269
|
-
/**
|
270
|
-
* Defines if the loader should validate the asset.
|
271
|
-
*/
|
272
|
-
validate: boolean;
|
273
|
-
/**
|
274
|
-
* Observable raised after validation when validate is set to true. The event data is the result of the validation.
|
275
|
-
*/
|
276
|
-
readonly onValidatedObservable: Observable<GLTF2.IGLTFValidationResults>;
|
277
|
-
private _onValidatedObserver;
|
278
|
-
/**
|
279
|
-
* Callback raised after a loader extension is created.
|
280
|
-
*/
|
281
|
-
set onValidated(callback: (results: GLTF2.IGLTFValidationResults) => void);
|
282
|
-
private _loader;
|
283
|
-
private _state;
|
284
|
-
private _progressCallback?;
|
285
|
-
private _requests;
|
286
|
-
private static magicBase64Encoded;
|
287
|
-
/**
|
288
|
-
* Name of the loader ("gltf")
|
289
|
-
*/
|
290
|
-
name: string;
|
291
|
-
/** @hidden */
|
292
|
-
extensions: ISceneLoaderPluginExtensions;
|
293
|
-
/**
|
294
|
-
* Disposes the loader, releases resources during load, and cancels any outstanding requests.
|
295
|
-
*/
|
296
|
-
dispose(): void;
|
297
|
-
/** @hidden */
|
298
|
-
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;
|
299
|
-
/** @hidden */
|
300
|
-
importMeshAsync(meshesNames: any, scene: Scene, data: any, rootUrl: string, onProgress?: (event: ISceneLoaderProgressEvent) => void, fileName?: string): Promise<ISceneLoaderAsyncResult>;
|
301
|
-
/** @hidden */
|
302
|
-
loadAsync(scene: Scene, data: any, rootUrl: string, onProgress?: (event: ISceneLoaderProgressEvent) => void, fileName?: string): Promise<void>;
|
303
|
-
/** @hidden */
|
304
|
-
loadAssetContainerAsync(scene: Scene, data: any, rootUrl: string, onProgress?: (event: ISceneLoaderProgressEvent) => void, fileName?: string): Promise<AssetContainer>;
|
305
|
-
/** @hidden */
|
306
|
-
canDirectLoad(data: string): boolean;
|
307
|
-
/** @hidden */
|
308
|
-
directLoad(scene: Scene, data: string): Promise<any>;
|
309
|
-
/**
|
310
|
-
* The callback that allows custom handling of the root url based on the response url.
|
311
|
-
* @param rootUrl the original root url
|
312
|
-
* @param responseURL the response url if available
|
313
|
-
* @returns the new root url
|
314
|
-
*/
|
315
|
-
rewriteRootURL?(rootUrl: string, responseURL?: string): string;
|
316
|
-
/** @hidden */
|
317
|
-
createPlugin(): ISceneLoaderPlugin | ISceneLoaderPluginAsync;
|
318
|
-
/**
|
319
|
-
* The loader state or null if the loader is not active.
|
320
|
-
*/
|
321
|
-
get loaderState(): Nullable<GLTFLoaderState>;
|
322
|
-
/**
|
323
|
-
* Observable raised when the loader state changes.
|
324
|
-
*/
|
325
|
-
onLoaderStateChangedObservable: Observable<Nullable<GLTFLoaderState>>;
|
326
|
-
/**
|
327
|
-
* Returns a promise that resolves when the asset is completely loaded.
|
328
|
-
* @returns a promise that resolves when the asset is completely loaded.
|
329
|
-
*/
|
330
|
-
whenCompleteAsync(): Promise<void>;
|
331
|
-
/** @hidden */
|
332
|
-
_setState(state: GLTFLoaderState): void;
|
333
|
-
/** @hidden */
|
334
|
-
_loadFile(scene: Scene, fileOrUrl: File | string, onSuccess: (data: string | ArrayBuffer) => void, useArrayBuffer?: boolean, onError?: (request?: WebRequest) => void, onOpened?: (request: WebRequest) => void): IFileRequest;
|
335
|
-
private _onProgress;
|
336
|
-
private _validate;
|
337
|
-
private _getLoader;
|
338
|
-
private _parseJson;
|
339
|
-
private _unpackBinaryAsync;
|
340
|
-
private _unpackBinaryV1Async;
|
341
|
-
private _unpackBinaryV2Async;
|
342
|
-
private static _parseVersion;
|
343
|
-
private static _compareVersion;
|
344
|
-
private static readonly _logSpaces;
|
345
|
-
private _logIndentLevel;
|
346
|
-
private _loggingEnabled;
|
347
|
-
/** @hidden */
|
348
|
-
_log: (message: string) => void;
|
349
|
-
/** @hidden */
|
350
|
-
_logOpen(message: string): void;
|
351
|
-
/** @hidden */
|
352
|
-
_logClose(): void;
|
353
|
-
private _logEnabled;
|
354
|
-
private _logDisabled;
|
355
|
-
private _capturePerformanceCounters;
|
356
|
-
/** @hidden */
|
357
|
-
_startPerformanceCounter: (counterName: string) => void;
|
358
|
-
/** @hidden */
|
359
|
-
_endPerformanceCounter: (counterName: string) => void;
|
360
|
-
private _startPerformanceCounterEnabled;
|
361
|
-
private _startPerformanceCounterDisabled;
|
362
|
-
private _endPerformanceCounterEnabled;
|
363
|
-
private _endPerformanceCounterDisabled;
|
364
|
-
}
|