@babylonjs/loaders 6.9.0 → 6.11.0
Sign up to get free protection for your applications and to get access to all the features.
- package/OBJ/index.js.map +1 -1
- package/OBJ/mtlFileLoader.js.map +1 -1
- package/OBJ/objFileLoader.js.map +1 -1
- package/OBJ/objLoadingOptions.js.map +1 -1
- package/OBJ/solidParser.js.map +1 -1
- package/STL/index.js.map +1 -1
- package/STL/stlFileLoader.js.map +1 -1
- package/glTF/1.0/glTFBinaryExtension.js.map +1 -1
- package/glTF/1.0/glTFLoader.js.map +1 -1
- package/glTF/1.0/glTFLoaderInterfaces.js.map +1 -1
- package/glTF/1.0/glTFLoaderUtils.js.map +1 -1
- package/glTF/1.0/glTFMaterialsCommonExtension.js.map +1 -1
- package/glTF/1.0/index.js.map +1 -1
- package/glTF/2.0/Extensions/EXT_lights_image_based.js.map +1 -1
- package/glTF/2.0/Extensions/EXT_mesh_gpu_instancing.js.map +1 -1
- package/glTF/2.0/Extensions/EXT_meshopt_compression.js.map +1 -1
- package/glTF/2.0/Extensions/EXT_texture_webp.js.map +1 -1
- package/glTF/2.0/Extensions/ExtrasAsMetadata.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_animation_pointer.data.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_animation_pointer.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_draco_mesh_compression.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_lights_punctual.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_materials_anisotropy.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_materials_clearcoat.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_materials_emissive_strength.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_materials_ior.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_materials_iridescence.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_materials_pbrSpecularGlossiness.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_materials_sheen.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_materials_specular.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_materials_translucency.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_materials_transmission.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_materials_unlit.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_materials_variants.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_materials_volume.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_mesh_quantization.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_texture_basisu.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_texture_transform.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_xmp_json_ld.js.map +1 -1
- package/glTF/2.0/Extensions/MSFT_audio_emitter.js.map +1 -1
- package/glTF/2.0/Extensions/MSFT_lod.js.map +1 -1
- package/glTF/2.0/Extensions/MSFT_minecraftMesh.js.map +1 -1
- package/glTF/2.0/Extensions/MSFT_sRGBFactors.js.map +1 -1
- package/glTF/2.0/Extensions/index.js.map +1 -1
- package/glTF/2.0/glTFLoader.js +2 -2
- package/glTF/2.0/glTFLoader.js.map +1 -1
- package/glTF/2.0/glTFLoaderAnimation.js.map +1 -1
- package/glTF/2.0/glTFLoaderExtension.js.map +1 -1
- package/glTF/2.0/glTFLoaderInterfaces.js.map +1 -1
- package/glTF/2.0/index.js.map +1 -1
- package/glTF/glTFFileLoader.js.map +1 -1
- package/glTF/glTFValidation.js.map +1 -1
- package/glTF/index.js.map +1 -1
- package/index.js.map +1 -1
- package/legacy/legacy-glTF.d.ts +2 -2
- package/legacy/legacy-glTF.js.map +1 -1
- package/legacy/legacy-glTF1.d.ts +1 -1
- package/legacy/legacy-glTF1.js.map +1 -1
- package/legacy/legacy-glTF1FileLoader.js.map +1 -1
- package/legacy/legacy-glTF2.d.ts +1 -1
- package/legacy/legacy-glTF2.js.map +1 -1
- package/legacy/legacy-glTF2FileLoader.js.map +1 -1
- package/legacy/legacy-glTFFileLoader.js.map +1 -1
- package/legacy/legacy-objFileLoader.d.ts +1 -1
- package/legacy/legacy-objFileLoader.js.map +1 -1
- package/legacy/legacy-stlFileLoader.d.ts +1 -1
- package/legacy/legacy-stlFileLoader.js.map +1 -1
- package/legacy/legacy.d.ts +1 -1
- package/legacy/legacy.js.map +1 -1
- package/package.json +5 -5
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"glTFLoaderAnimation.js","sourceRoot":"","sources":["../../../../../
|
1
|
+
{"version":3,"file":"glTFLoaderAnimation.js","sourceRoot":"","sources":["../../../../../dev/loaders/src/glTF/2.0/glTFLoaderAnimation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,gDAAkC;AACtD,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,6CAA+B;AAO7D,gBAAgB;AAChB,MAAM,UAAU,UAAU,CAAC,OAAY,EAAE,MAAoB,EAAE,MAAc,EAAE,KAAa;IACxF,OAAO,OAAO,CAAC,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;AACjE,CAAC;AAED,gBAAgB;AAChB,MAAM,UAAU,aAAa,CAAC,OAAY,EAAE,MAAoB,EAAE,MAAc,EAAE,KAAa;IAC3F,OAAO,UAAU,CAAC,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;AACpE,CAAC;AAED,gBAAgB;AAChB,MAAM,UAAU,UAAU,CAAC,MAAa,EAAE,MAAoB,EAAE,MAAc,EAAE,KAAa;IACzF,MAAM,KAAK,GAAG,IAAI,KAAK,CAAS,MAAM,CAAC,gBAAiB,CAAC,CAAC;IAC1D,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACnC,KAAK,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,GAAG,KAAK,CAAC;KACvC;IAED,OAAO,KAAK,CAAC;AACjB,CAAC;AAED,gBAAgB;AAChB,MAA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,KAAK,EAAE,CAAC,IAAI,kCAAkC,CAAC,SAAS,CAAC,qBAAqB,EAAE,SAAS,EAAE,UAAU,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;IAChH,OAAO,EAAE,CAAC,IAAI,2BAA2B,CAAC,SAAS,CAAC,mBAAmB,EAAE,WAAW,EAAE,UAAU,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,gBAAiB,CAAC,CAAC;CAC3I,CAAC","sourcesContent":["import { Animation } from \"core/Animations/animation\";\r\nimport { Quaternion, Vector3 } from \"core/Maths/math.vector\";\r\nimport type { INode } from \"./glTFLoaderInterfaces\";\r\nimport type { IAnimatable } from \"core/Animations/animatable.interface\";\r\n\r\n/** @internal */\r\nexport type GetValueFn = (target: any, source: Float32Array, offset: number, scale: number) => any;\r\n\r\n/** @internal */\r\nexport function getVector3(_target: any, source: Float32Array, offset: number, scale: number): Vector3 {\r\n return Vector3.FromArray(source, offset).scaleInPlace(scale);\r\n}\r\n\r\n/** @internal */\r\nexport function getQuaternion(_target: any, source: Float32Array, offset: number, scale: number): Quaternion {\r\n return Quaternion.FromArray(source, offset).scaleInPlace(scale);\r\n}\r\n\r\n/** @internal */\r\nexport function getWeights(target: INode, source: Float32Array, offset: number, scale: number): Array<number> {\r\n const value = new Array<number>(target._numMorphTargets!);\r\n for (let i = 0; i < value.length; i++) {\r\n value[i] = source[offset++] * scale;\r\n }\r\n\r\n return value;\r\n}\r\n\r\n/** @internal */\r\nexport abstract class AnimationPropertyInfo {\r\n /** @internal */\r\n public constructor(public readonly type: number, public readonly name: string, public readonly getValue: GetValueFn, public readonly getStride: (target: any) => number) {}\r\n\r\n protected _buildAnimation(name: string, fps: number, keys: any[]): Animation {\r\n const babylonAnimation = new Animation(name, this.name, fps, this.type);\r\n babylonAnimation.setKeys(keys);\r\n return babylonAnimation;\r\n }\r\n\r\n /** @internal */\r\n public abstract buildAnimations(target: any, name: string, fps: number, keys: any[], callback: (babylonAnimatable: IAnimatable, babylonAnimation: Animation) => void): void;\r\n}\r\n\r\n/** @internal */\r\nexport class TransformNodeAnimationPropertyInfo extends AnimationPropertyInfo {\r\n /** @internal */\r\n public buildAnimations(target: INode, name: string, fps: number, keys: any[], callback: (babylonAnimatable: IAnimatable, babylonAnimation: Animation) => void): void {\r\n callback(target._babylonTransformNode!, this._buildAnimation(name, fps, keys));\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport class WeightAnimationPropertyInfo extends AnimationPropertyInfo {\r\n public buildAnimations(target: INode, name: string, fps: number, keys: any[], callback: (babylonAnimatable: IAnimatable, babylonAnimation: Animation) => void): void {\r\n if (target._numMorphTargets) {\r\n for (let targetIndex = 0; targetIndex < target._numMorphTargets; targetIndex++) {\r\n const babylonAnimation = new Animation(`${name}_${targetIndex}`, this.name, fps, this.type);\r\n babylonAnimation.setKeys(\r\n keys.map((key) => ({\r\n frame: key.frame,\r\n inTangent: key.inTangent ? key.inTangent[targetIndex] : undefined,\r\n value: key.value[targetIndex],\r\n outTangent: key.outTangent ? key.outTangent[targetIndex] : undefined,\r\n interpolation: key.interpolation,\r\n }))\r\n );\r\n\r\n if (target._primitiveBabylonMeshes) {\r\n for (const babylonMesh of target._primitiveBabylonMeshes) {\r\n if (babylonMesh.morphTargetManager) {\r\n const morphTarget = babylonMesh.morphTargetManager.getTarget(targetIndex);\r\n const babylonAnimationClone = babylonAnimation.clone();\r\n morphTarget.animations.push(babylonAnimationClone);\r\n callback(morphTarget, babylonAnimationClone);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport const nodeAnimationData = {\r\n translation: [new TransformNodeAnimationPropertyInfo(Animation.ANIMATIONTYPE_VECTOR3, \"position\", getVector3, () => 3)],\r\n rotation: [new TransformNodeAnimationPropertyInfo(Animation.ANIMATIONTYPE_QUATERNION, \"rotationQuaternion\", getQuaternion, () => 4)],\r\n scale: [new TransformNodeAnimationPropertyInfo(Animation.ANIMATIONTYPE_VECTOR3, \"scaling\", getVector3, () => 3)],\r\n weights: [new WeightAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, \"influence\", getWeights, (target) => target._numMorphTargets!)],\r\n};\r\n"]}
|
@@ -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 { Animation } from \"core/Animations/animation\";\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 {\r\n IScene,\r\n INode,\r\n IMesh,\r\n ISkin,\r\n ICamera,\r\n IMeshPrimitive,\r\n IMaterial,\r\n ITextureInfo,\r\n IAnimation,\r\n ITexture,\r\n IBufferView,\r\n IBuffer,\r\n IAnimationChannel,\r\n} from \"./glTFLoaderInterfaces\";\r\nimport type { IGLTFLoaderExtension as IGLTFBaseLoaderExtension } from \"../glTFFileLoader\";\r\nimport type { IProperty } from \"babylonjs-gltf2interface\";\r\nimport type { IAnimatable } from \"core/Animations/animatable.interface\";\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 behvaior when loading animation channels.\r\n * @param context The context when loading the asset\r\n * @param animationContext The context of the animation when loading the asset\r\n * @param animation The glTF animation property\r\n * @param channel The glTF animation channel property\r\n * @param onLoad Called for each animation loaded\r\n * @returns A void promise that resolves when the load is complete or null if not handled\r\n */\r\n _loadAnimationChannelAsync?(\r\n context: string,\r\n animationContext: string,\r\n animation: IAnimation,\r\n channel: IAnimationChannel,\r\n onLoad: (babylonAnimatable: IAnimatable, babylonAnimation: Animation) => void\r\n ): Nullable<Promise<void>>;\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"]}
|
1
|
+
{"version":3,"file":"glTFLoaderExtension.js","sourceRoot":"","sources":["../../../../../dev/loaders/src/glTF/2.0/glTFLoaderExtension.ts"],"names":[],"mappings":"","sourcesContent":["import type { Nullable } from \"core/types\";\r\nimport type { Animation } from \"core/Animations/animation\";\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 {\r\n IScene,\r\n INode,\r\n IMesh,\r\n ISkin,\r\n ICamera,\r\n IMeshPrimitive,\r\n IMaterial,\r\n ITextureInfo,\r\n IAnimation,\r\n ITexture,\r\n IBufferView,\r\n IBuffer,\r\n IAnimationChannel,\r\n} from \"./glTFLoaderInterfaces\";\r\nimport type { IGLTFLoaderExtension as IGLTFBaseLoaderExtension } from \"../glTFFileLoader\";\r\nimport type { IProperty } from \"babylonjs-gltf2interface\";\r\nimport type { IAnimatable } from \"core/Animations/animatable.interface\";\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 behvaior when loading animation channels.\r\n * @param context The context when loading the asset\r\n * @param animationContext The context of the animation when loading the asset\r\n * @param animation The glTF animation property\r\n * @param channel The glTF animation channel property\r\n * @param onLoad Called for each animation loaded\r\n * @returns A void promise that resolves when the load is complete or null if not handled\r\n */\r\n _loadAnimationChannelAsync?(\r\n context: string,\r\n animationContext: string,\r\n animation: IAnimation,\r\n channel: IAnimationChannel,\r\n onLoad: (babylonAnimatable: IAnimatable, babylonAnimation: Animation) => void\r\n ): Nullable<Promise<void>>;\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"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"glTFLoaderInterfaces.js","sourceRoot":"","sources":["../../../../../
|
1
|
+
{"version":3,"file":"glTFLoaderInterfaces.js","sourceRoot":"","sources":["../../../../../dev/loaders/src/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 /** @internal */\r\n input: Float32Array;\r\n\r\n /** @internal */\r\n interpolation: GLTF2.AnimationSamplerInterpolation;\r\n\r\n /** @internal */\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 /** @internal */\r\n channels: IAnimationChannel[];\r\n\r\n /** @internal */\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 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 /** @internal */\r\n baseColorTexture?: ITextureInfo;\r\n\r\n /** @internal */\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 /** @internal */\r\n pbrMetallicRoughness?: IMaterialPbrMetallicRoughness;\r\n\r\n /** @internal */\r\n normalTexture?: IMaterialNormalTextureInfo;\r\n\r\n /** @internal */\r\n occlusionTexture?: IMaterialOcclusionTextureInfo;\r\n\r\n /** @internal */\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 /** @internal */\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 /** @internal */\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 /** @internal */\r\n noMipMaps: boolean;\r\n\r\n /** @internal */\r\n samplingMode: number;\r\n\r\n /** @internal */\r\n wrapU: number;\r\n\r\n /** @internal */\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 /** @internal */\r\n accessors?: IAccessor[];\r\n\r\n /** @internal */\r\n animations?: IAnimation[];\r\n\r\n /** @internal */\r\n buffers?: IBuffer[];\r\n\r\n /** @internal */\r\n bufferViews?: IBufferView[];\r\n\r\n /** @internal */\r\n cameras?: ICamera[];\r\n\r\n /** @internal */\r\n images?: IImage[];\r\n\r\n /** @internal */\r\n materials?: IMaterial[];\r\n\r\n /** @internal */\r\n meshes?: IMesh[];\r\n\r\n /** @internal */\r\n nodes?: INode[];\r\n\r\n /** @internal */\r\n samplers?: ISampler[];\r\n\r\n /** @internal */\r\n scenes?: IScene[];\r\n\r\n /** @internal */\r\n skins?: ISkin[];\r\n\r\n /** @internal */\r\n textures?: ITexture[];\r\n}\r\n\r\n/**\r\n * Loader interface with additional members.\r\n */\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nexport interface IKHRLightsPunctual_Light extends GLTF2.IKHRLightsPunctual_Light, IArrayItem {\r\n /** @hidden */\r\n _babylonLight?: Light;\r\n}\r\n"]}
|
package/glTF/2.0/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../dev/loaders/src/glTF/2.0/index.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,cAAc,cAAc,CAAC;AAC7B,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC","sourcesContent":["/* eslint-disable import/no-internal-modules */\r\nexport * from \"./glTFLoader\";\r\nexport * from \"./glTFLoaderExtension\";\r\nexport * from \"./glTFLoaderInterfaces\";\r\nexport * from \"./Extensions/index\";\r\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"glTFFileLoader.js","sourceRoot":"","sources":["../../../../lts/loaders/generated/glTF/glTFFileLoader.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,UAAU,EAAE,2CAA6B;AAClD,OAAO,EAAE,KAAK,EAAE,sCAAwB;AAaxC,OAAO,EAAE,WAAW,EAAE,+CAAiC;AACvD,OAAO,EAAE,cAAc,EAAE,0CAA4B;AAIrD,OAAO,EAAE,MAAM,EAAE,uCAAyB;AAE1C,OAAO,EAAE,UAAU,EAAE,2CAA6B;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,OAAO,EAAE,uBAAuB,EAAE,0CAA4B;AAC9D,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,sCAAwB;AAU3D,SAAS,SAAS,CAAC,WAAwB,EAAE,UAAkB,EAAE,UAAkB;IAC/E,IAAI;QACA,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,UAAU,CAAC,WAAW,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC,CAAC;KAC/E;IAAC,OAAO,CAAC,EAAE;QACR,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;KAC5B;AACL,CAAC;AAED,S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CAAC;IAEO,YAAY,CAAC,OAAe,IAAS,CAAC;IAUtC,+BAA+B,CAAC,WAAmB;QACvD,KAAK,CAAC,uBAAuB,CAAC,WAAW,CAAC,CAAC;IAC/C,CAAC;IAEO,gCAAgC,CAAC,WAAmB,IAAS,CAAC;IAE9D,6BAA6B,CAAC,WAAmB;QACrD,KAAK,CAAC,qBAAqB,CAAC,WAAW,CAAC,CAAC;IAC7C,CAAC;IAEO,8BAA8B,CAAC,WAAmB,IAAS,CAAC;;AAr/BpE,aAAa;AACb,aAAa;AACb,aAAa;AAEb;;;;;GAKG;AACW,iCAAkB,GAAG,IAAI,AAAP,CAAQ;AAExC;;;;GAIG;AACW,qCAAsB,GAAG,KAAK,AAAR,CAAS;AA0T9B,kCAAmB,GAAG,QAAQ,AAAX,CAAY,CAAC,8CAA8C;AA6nBrE,yBAAU,GAAG,kCAAkC,AAArC,CAAsC;AAgD5E,IAAI,WAAW,EAAE;IACb,WAAW,CAAC,cAAc,CAAC,IAAI,cAAc,EAAE,CAAC,CAAC;CACpD","sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\r\n/* eslint-disable @typescript-eslint/naming-convention */\r\nimport type * as GLTF2 from \"babylonjs-gltf2interface\";\r\nimport type { Nullable } from \"core/types\";\r\nimport type { Observer } from \"core/Misc/observable\";\r\nimport { Observable } from \"core/Misc/observable\";\r\nimport { Tools } from \"core/Misc/tools\";\r\nimport type { Camera } from \"core/Cameras/camera\";\r\nimport type { BaseTexture } from \"core/Materials/Textures/baseTexture\";\r\nimport type { Material } from \"core/Materials/material\";\r\nimport type { AbstractMesh } from \"core/Meshes/abstractMesh\";\r\nimport type {\r\n ISceneLoaderPluginFactory,\r\n ISceneLoaderPlugin,\r\n ISceneLoaderPluginAsync,\r\n ISceneLoaderProgressEvent,\r\n ISceneLoaderPluginExtensions,\r\n ISceneLoaderAsyncResult,\r\n} from \"core/Loading/sceneLoader\";\r\nimport { SceneLoader } from \"core/Loading/sceneLoader\";\r\nimport { AssetContainer } from \"core/assetContainer\";\r\nimport type { Scene, IDisposable } from \"core/scene\";\r\nimport type { WebRequest } from \"core/Misc/webRequest\";\r\nimport type { IFileRequest } from \"core/Misc/fileRequest\";\r\nimport { Logger } from \"core/Misc/logger\";\r\nimport type { IDataBuffer } from \"core/Misc/dataReader\";\r\nimport { DataReader } from \"core/Misc/dataReader\";\r\nimport { GLTFValidation } from \"./glTFValidation\";\r\nimport type { LoadFileError } from \"core/Misc/fileTools\";\r\nimport { DecodeBase64UrlToBinary } from \"core/Misc/fileTools\";\r\nimport { RuntimeError, ErrorCodes } from \"core/Misc/error\";\r\nimport type { TransformNode } from \"core/Meshes/transformNode\";\r\nimport type { MorphTargetManager } from \"core/Morph/morphTargetManager\";\r\n\r\ninterface IFileRequestInfo extends IFileRequest {\r\n _lengthComputable?: boolean;\r\n _loaded?: number;\r\n _total?: number;\r\n}\r\n\r\nfunction readAsync(arrayBuffer: ArrayBuffer, byteOffset: number, byteLength: number): Promise<Uint8Array> {\r\n try {\r\n return Promise.resolve(new Uint8Array(arrayBuffer, byteOffset, byteLength));\r\n } catch (e) {\r\n return Promise.reject(e);\r\n }\r\n}\r\n\r\nfunction readViewAsync(arrayBufferView: ArrayBufferView, byteOffset: number, byteLength: number): Promise<Uint8Array> {\r\n try {\r\n if ((arrayBufferView as Uint8Array).byteOffset + byteLength > arrayBufferView.byteLength) {\r\n throw new Error(\"Array length out of bounds.\");\r\n }\r\n\r\n return Promise.resolve(new Uint8Array(arrayBufferView.buffer, (arrayBufferView as Uint8Array).byteOffset + byteOffset, byteLength));\r\n } catch (e) {\r\n return Promise.reject(e);\r\n }\r\n}\r\n\r\n/**\r\n * Mode that determines the coordinate system to use.\r\n */\r\nexport enum GLTFLoaderCoordinateSystemMode {\r\n /**\r\n * Automatically convert the glTF right-handed data to the appropriate system based on the current coordinate system mode of the scene.\r\n */\r\n AUTO,\r\n\r\n /**\r\n * Sets the useRightHandedSystem flag on the scene.\r\n */\r\n FORCE_RIGHT_HANDED,\r\n}\r\n\r\n/**\r\n * Mode that determines what animations will start.\r\n */\r\nexport enum GLTFLoaderAnimationStartMode {\r\n /**\r\n * No animation will start.\r\n */\r\n NONE,\r\n\r\n /**\r\n * The first animation will start.\r\n */\r\n FIRST,\r\n\r\n /**\r\n * All animations will start.\r\n */\r\n ALL,\r\n}\r\n\r\n/**\r\n * Interface that contains the data for the glTF asset.\r\n */\r\nexport interface IGLTFLoaderData {\r\n /**\r\n * The object that represents the glTF JSON.\r\n */\r\n json: Object;\r\n\r\n /**\r\n * The BIN chunk of a binary glTF.\r\n */\r\n bin: Nullable<IDataBuffer>;\r\n}\r\n\r\n/**\r\n * Interface for extending the loader.\r\n */\r\nexport interface IGLTFLoaderExtension {\r\n /**\r\n * The name of this extension.\r\n */\r\n readonly name: string;\r\n\r\n /**\r\n * Defines whether this extension is enabled.\r\n */\r\n enabled: boolean;\r\n\r\n /**\r\n * Defines the order of this extension.\r\n * The loader sorts the extensions using these values when loading.\r\n */\r\n order?: number;\r\n}\r\n\r\n/**\r\n * Loader state.\r\n */\r\nexport enum GLTFLoaderState {\r\n /**\r\n * The asset is loading.\r\n */\r\n LOADING,\r\n\r\n /**\r\n * The asset is ready for rendering.\r\n */\r\n READY,\r\n\r\n /**\r\n * The asset is completely loaded.\r\n */\r\n COMPLETE,\r\n}\r\n\r\n/** @internal */\r\nexport interface IGLTFLoader extends IDisposable {\r\n importMeshAsync: (\r\n meshesNames: any,\r\n scene: Scene,\r\n container: Nullable<AssetContainer>,\r\n data: IGLTFLoaderData,\r\n rootUrl: string,\r\n onProgress?: (event: ISceneLoaderProgressEvent) => void,\r\n fileName?: string\r\n ) => Promise<ISceneLoaderAsyncResult>;\r\n loadAsync: (scene: Scene, data: IGLTFLoaderData, rootUrl: string, onProgress?: (event: ISceneLoaderProgressEvent) => void, fileName?: string) => Promise<void>;\r\n}\r\n\r\n/**\r\n * File loader for loading glTF files into a scene.\r\n */\r\nexport class GLTFFileLoader implements IDisposable, ISceneLoaderPluginAsync, ISceneLoaderPluginFactory {\r\n /** @internal */\r\n public static _CreateGLTF1Loader: (parent: GLTFFileLoader) => IGLTFLoader;\r\n\r\n /** @internal */\r\n public static _CreateGLTF2Loader: (parent: GLTFFileLoader) => IGLTFLoader;\r\n\r\n // --------------\r\n // Common options\r\n // --------------\r\n\r\n /**\r\n * Raised when the asset has been parsed\r\n */\r\n public onParsedObservable = new Observable<IGLTFLoaderData>();\r\n\r\n private _onParsedObserver: Nullable<Observer<IGLTFLoaderData>>;\r\n\r\n /**\r\n * Raised when the asset has been parsed\r\n */\r\n public set onParsed(callback: (loaderData: IGLTFLoaderData) => void) {\r\n if (this._onParsedObserver) {\r\n this.onParsedObservable.remove(this._onParsedObserver);\r\n }\r\n this._onParsedObserver = this.onParsedObservable.add(callback);\r\n }\r\n\r\n // ----------\r\n // V1 options\r\n // ----------\r\n\r\n /**\r\n * 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.\r\n * Textures always loads asynchronously. For example, the success callback can compute the bounding information of the loaded meshes when incremental loading is disabled.\r\n * Defaults to true.\r\n * @internal\r\n */\r\n public static IncrementalLoading = true;\r\n\r\n /**\r\n * Set this property to true in order to work with homogeneous coordinates, available with some converters and exporters.\r\n * Defaults to false. See https://en.wikipedia.org/wiki/Homogeneous_coordinates.\r\n * @internal\r\n */\r\n public static HomogeneousCoordinates = false;\r\n\r\n // ----------\r\n // V2 options\r\n // ----------\r\n\r\n /**\r\n * The coordinate system mode. Defaults to AUTO.\r\n */\r\n public coordinateSystemMode = GLTFLoaderCoordinateSystemMode.AUTO;\r\n\r\n /**\r\n * The animation start mode. Defaults to FIRST.\r\n */\r\n public animationStartMode = GLTFLoaderAnimationStartMode.FIRST;\r\n\r\n /**\r\n * Defines if the loader should compile materials before raising the success callback. Defaults to false.\r\n */\r\n public compileMaterials = false;\r\n\r\n /**\r\n * Defines if the loader should also compile materials with clip planes. Defaults to false.\r\n */\r\n public useClipPlane = false;\r\n\r\n /**\r\n * Defines if the loader should compile shadow generators before raising the success callback. Defaults to false.\r\n */\r\n public compileShadowGenerators = false;\r\n\r\n /**\r\n * Defines if the Alpha blended materials are only applied as coverage.\r\n * If false, (default) The luminance of each pixel will reduce its opacity to simulate the behaviour of most physical materials.\r\n * If true, no extra effects are applied to transparent pixels.\r\n */\r\n public transparencyAsCoverage = false;\r\n\r\n /**\r\n * Defines if the loader should use range requests when load binary glTF files from HTTP.\r\n * Enabling will disable offline support and glTF validator.\r\n * Defaults to false.\r\n */\r\n public useRangeRequests = false;\r\n\r\n /**\r\n * Defines if the loader should create instances when multiple glTF nodes point to the same glTF mesh. Defaults to true.\r\n */\r\n public createInstances = true;\r\n\r\n /**\r\n * 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.\r\n */\r\n public alwaysComputeBoundingBox = false;\r\n\r\n /**\r\n * If true, load all materials defined in the file, even if not used by any mesh. Defaults to false.\r\n */\r\n public loadAllMaterials = false;\r\n\r\n /**\r\n * If true, load only the materials defined in the file. Defaults to false.\r\n */\r\n public loadOnlyMaterials = false;\r\n\r\n /**\r\n * If true, do not load any materials defined in the file. Defaults to false.\r\n */\r\n public skipMaterials = false;\r\n\r\n /**\r\n * 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.\r\n */\r\n public useSRGBBuffers = true;\r\n\r\n /**\r\n * When loading glTF animations, which are defined in seconds, target them to this FPS. Defaults to 60.\r\n */\r\n public targetFps = 60;\r\n\r\n /**\r\n * Defines if the loader should always compute the nearest common ancestor of the skeleton joints instead of using `skin.skeleton`. Defaults to false.\r\n * Set this to true if loading assets with invalid `skin.skeleton` values.\r\n */\r\n public alwaysComputeSkeletonRootNode = false;\r\n\r\n /**\r\n * Function called before loading a url referenced by the asset.\r\n * @param url\r\n */\r\n public preprocessUrlAsync = (url: string) => Promise.resolve(url);\r\n\r\n /**\r\n * Observable raised when the loader creates a mesh after parsing the glTF properties of the mesh.\r\n * 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, ...)\r\n */\r\n public readonly onMeshLoadedObservable = new Observable<AbstractMesh>();\r\n\r\n private _onMeshLoadedObserver: Nullable<Observer<AbstractMesh>>;\r\n\r\n /**\r\n * Callback raised when the loader creates a mesh after parsing the glTF properties of the mesh.\r\n * 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, ...)\r\n */\r\n public set onMeshLoaded(callback: (mesh: AbstractMesh) => void) {\r\n if (this._onMeshLoadedObserver) {\r\n this.onMeshLoadedObservable.remove(this._onMeshLoadedObserver);\r\n }\r\n this._onMeshLoadedObserver = this.onMeshLoadedObservable.add(callback);\r\n }\r\n\r\n /**\r\n * Callback raised when the loader creates a skin after parsing the glTF properties of the skin node.\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/importers/glTF/glTFSkinning#ignoring-the-transform-of-the-skinned-mesh\r\n * @param node - the transform node that corresponds to the original glTF skin node used for animations\r\n * @param skinnedNode - the transform node that is the skinned mesh itself or the parent of the skinned meshes\r\n */\r\n public readonly onSkinLoadedObservable = new Observable<{ node: TransformNode; skinnedNode: TransformNode }>();\r\n\r\n /**\r\n * Observable raised when the loader creates a texture after parsing the glTF properties of the texture.\r\n */\r\n public readonly onTextureLoadedObservable = new Observable<BaseTexture>();\r\n\r\n private _onTextureLoadedObserver: Nullable<Observer<BaseTexture>>;\r\n\r\n /**\r\n * Callback raised when the loader creates a texture after parsing the glTF properties of the texture.\r\n */\r\n public set onTextureLoaded(callback: (texture: BaseTexture) => void) {\r\n if (this._onTextureLoadedObserver) {\r\n this.onTextureLoadedObservable.remove(this._onTextureLoadedObserver);\r\n }\r\n this._onTextureLoadedObserver = this.onTextureLoadedObservable.add(callback);\r\n }\r\n\r\n /**\r\n * Observable raised when the loader creates a material after parsing the glTF properties of the material.\r\n */\r\n public readonly onMaterialLoadedObservable = new Observable<Material>();\r\n\r\n private _onMaterialLoadedObserver: Nullable<Observer<Material>>;\r\n\r\n /**\r\n * Callback raised when the loader creates a material after parsing the glTF properties of the material.\r\n */\r\n public set onMaterialLoaded(callback: (material: Material) => void) {\r\n if (this._onMaterialLoadedObserver) {\r\n this.onMaterialLoadedObservable.remove(this._onMaterialLoadedObserver);\r\n }\r\n this._onMaterialLoadedObserver = this.onMaterialLoadedObservable.add(callback);\r\n }\r\n\r\n /**\r\n * Observable raised when the loader creates a camera after parsing the glTF properties of the camera.\r\n */\r\n public readonly onCameraLoadedObservable = new Observable<Camera>();\r\n\r\n private _onCameraLoadedObserver: Nullable<Observer<Camera>>;\r\n\r\n /**\r\n * Callback raised when the loader creates a camera after parsing the glTF properties of the camera.\r\n */\r\n public set onCameraLoaded(callback: (camera: Camera) => void) {\r\n if (this._onCameraLoadedObserver) {\r\n this.onCameraLoadedObservable.remove(this._onCameraLoadedObserver);\r\n }\r\n this._onCameraLoadedObserver = this.onCameraLoadedObservable.add(callback);\r\n }\r\n\r\n /**\r\n * Observable raised when the asset is completely loaded, immediately before the loader is disposed.\r\n * For assets with LODs, raised when all of the LODs are complete.\r\n * For assets without LODs, raised when the model is complete, immediately after the loader resolves the returned promise.\r\n */\r\n public readonly onCompleteObservable = new Observable<void>();\r\n\r\n private _onCompleteObserver: Nullable<Observer<void>>;\r\n\r\n /**\r\n * Callback raised when the asset is completely loaded, immediately before the loader is disposed.\r\n * For assets with LODs, raised when all of the LODs are complete.\r\n * For assets without LODs, raised when the model is complete, immediately after the loader resolves the returned promise.\r\n */\r\n public set onComplete(callback: () => void) {\r\n if (this._onCompleteObserver) {\r\n this.onCompleteObservable.remove(this._onCompleteObserver);\r\n }\r\n this._onCompleteObserver = this.onCompleteObservable.add(callback);\r\n }\r\n\r\n /**\r\n * Observable raised when an error occurs.\r\n */\r\n public readonly onErrorObservable = new Observable<any>();\r\n\r\n private _onErrorObserver: Nullable<Observer<any>>;\r\n\r\n /**\r\n * Callback raised when an error occurs.\r\n */\r\n public set onError(callback: (reason: any) => void) {\r\n if (this._onErrorObserver) {\r\n this.onErrorObservable.remove(this._onErrorObserver);\r\n }\r\n this._onErrorObserver = this.onErrorObservable.add(callback);\r\n }\r\n\r\n /**\r\n * Observable raised after the loader is disposed.\r\n */\r\n public readonly onDisposeObservable = new Observable<void>();\r\n\r\n private _onDisposeObserver: Nullable<Observer<void>>;\r\n\r\n /**\r\n * Callback raised after the loader is disposed.\r\n */\r\n public set onDispose(callback: () => void) {\r\n if (this._onDisposeObserver) {\r\n this.onDisposeObservable.remove(this._onDisposeObserver);\r\n }\r\n this._onDisposeObserver = this.onDisposeObservable.add(callback);\r\n }\r\n\r\n /**\r\n * Observable raised after a loader extension is created.\r\n * Set additional options for a loader extension in this event.\r\n */\r\n public readonly onExtensionLoadedObservable = new Observable<IGLTFLoaderExtension>();\r\n\r\n private _onExtensionLoadedObserver: Nullable<Observer<IGLTFLoaderExtension>>;\r\n\r\n /**\r\n * Callback raised after a loader extension is created.\r\n */\r\n public set onExtensionLoaded(callback: (extension: IGLTFLoaderExtension) => void) {\r\n if (this._onExtensionLoadedObserver) {\r\n this.onExtensionLoadedObservable.remove(this._onExtensionLoadedObserver);\r\n }\r\n this._onExtensionLoadedObserver = this.onExtensionLoadedObservable.add(callback);\r\n }\r\n\r\n /**\r\n * Defines if the loader logging is enabled.\r\n */\r\n public get loggingEnabled(): boolean {\r\n return this._loggingEnabled;\r\n }\r\n\r\n public set loggingEnabled(value: boolean) {\r\n if (this._loggingEnabled === value) {\r\n return;\r\n }\r\n\r\n this._loggingEnabled = value;\r\n\r\n if (this._loggingEnabled) {\r\n this._log = this._logEnabled;\r\n } else {\r\n this._log = this._logDisabled;\r\n }\r\n }\r\n\r\n /**\r\n * Defines if the loader should capture performance counters.\r\n */\r\n public get capturePerformanceCounters(): boolean {\r\n return this._capturePerformanceCounters;\r\n }\r\n\r\n public set capturePerformanceCounters(value: boolean) {\r\n if (this._capturePerformanceCounters === value) {\r\n return;\r\n }\r\n\r\n this._capturePerformanceCounters = value;\r\n\r\n if (this._capturePerformanceCounters) {\r\n this._startPerformanceCounter = this._startPerformanceCounterEnabled;\r\n this._endPerformanceCounter = this._endPerformanceCounterEnabled;\r\n } else {\r\n this._startPerformanceCounter = this._startPerformanceCounterDisabled;\r\n this._endPerformanceCounter = this._endPerformanceCounterDisabled;\r\n }\r\n }\r\n\r\n /**\r\n * Defines if the loader should validate the asset.\r\n */\r\n public validate = false;\r\n\r\n /**\r\n * Observable raised after validation when validate is set to true. The event data is the result of the validation.\r\n */\r\n public readonly onValidatedObservable = new Observable<GLTF2.IGLTFValidationResults>();\r\n\r\n private _onValidatedObserver: Nullable<Observer<GLTF2.IGLTFValidationResults>>;\r\n\r\n /**\r\n * Callback raised after a loader extension is created.\r\n */\r\n public set onValidated(callback: (results: GLTF2.IGLTFValidationResults) => void) {\r\n if (this._onValidatedObserver) {\r\n this.onValidatedObservable.remove(this._onValidatedObserver);\r\n }\r\n this._onValidatedObserver = this.onValidatedObservable.add(callback);\r\n }\r\n\r\n private _loader: Nullable<IGLTFLoader> = null;\r\n private _state: Nullable<GLTFLoaderState> = null;\r\n private _progressCallback?: (event: ISceneLoaderProgressEvent) => void;\r\n private _requests = new Array<IFileRequestInfo>();\r\n\r\n private static _MagicBase64Encoded = \"Z2xURg\"; // \"glTF\" base64 encoded (without the quotes!)\r\n\r\n /**\r\n * Name of the loader (\"gltf\")\r\n */\r\n public name = \"gltf\";\r\n\r\n /** @internal */\r\n public extensions: ISceneLoaderPluginExtensions = {\r\n \".gltf\": { isBinary: false },\r\n \".glb\": { isBinary: true },\r\n };\r\n\r\n /**\r\n * Disposes the loader, releases resources during load, and cancels any outstanding requests.\r\n */\r\n public dispose(): void {\r\n if (this._loader) {\r\n this._loader.dispose();\r\n this._loader = null;\r\n }\r\n\r\n for (const request of this._requests) {\r\n request.abort();\r\n }\r\n\r\n this._requests.length = 0;\r\n\r\n delete this._progressCallback;\r\n\r\n this.preprocessUrlAsync = (url) => Promise.resolve(url);\r\n\r\n this.onMeshLoadedObservable.clear();\r\n this.onSkinLoadedObservable.clear();\r\n this.onTextureLoadedObservable.clear();\r\n this.onMaterialLoadedObservable.clear();\r\n this.onCameraLoadedObservable.clear();\r\n this.onCompleteObservable.clear();\r\n this.onExtensionLoadedObservable.clear();\r\n\r\n this.onDisposeObservable.notifyObservers(undefined);\r\n this.onDisposeObservable.clear();\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public loadFile(\r\n scene: Scene,\r\n fileOrUrl: File | string | ArrayBufferView,\r\n rootUrl: string,\r\n onSuccess: (data: any, responseURL?: string) => void,\r\n onProgress?: (ev: ISceneLoaderProgressEvent) => void,\r\n useArrayBuffer?: boolean,\r\n onError?: (request?: WebRequest, exception?: LoadFileError) => void,\r\n name?: string\r\n ): Nullable<IFileRequest> {\r\n if (ArrayBuffer.isView(fileOrUrl)) {\r\n this._loadBinary(scene, fileOrUrl as ArrayBufferView, rootUrl, onSuccess, onError, name);\r\n return null;\r\n }\r\n\r\n this._progressCallback = onProgress;\r\n\r\n const fileName = (fileOrUrl as File).name || Tools.GetFilename(fileOrUrl as string);\r\n\r\n if (useArrayBuffer) {\r\n if (this.useRangeRequests) {\r\n if (this.validate) {\r\n Logger.Warn(\"glTF validation is not supported when range requests are enabled\");\r\n }\r\n\r\n const fileRequest: IFileRequest = {\r\n abort: () => {},\r\n onCompleteObservable: new Observable<IFileRequest>(),\r\n };\r\n\r\n const dataBuffer = {\r\n readAsync: (byteOffset: number, byteLength: number) => {\r\n return new Promise<ArrayBufferView>((resolve, reject) => {\r\n this._loadFile(\r\n scene,\r\n fileOrUrl as File | string,\r\n (data) => {\r\n resolve(new Uint8Array(data as ArrayBuffer));\r\n },\r\n true,\r\n (error) => {\r\n reject(error);\r\n },\r\n (webRequest) => {\r\n webRequest.setRequestHeader(\"Range\", `bytes=${byteOffset}-${byteOffset + byteLength - 1}`);\r\n }\r\n );\r\n });\r\n },\r\n byteLength: 0,\r\n };\r\n\r\n this._unpackBinaryAsync(new DataReader(dataBuffer)).then(\r\n (loaderData) => {\r\n fileRequest.onCompleteObservable.notifyObservers(fileRequest);\r\n onSuccess(loaderData);\r\n },\r\n onError ? (error) => onError(undefined, error) : undefined\r\n );\r\n\r\n return fileRequest;\r\n }\r\n\r\n return this._loadFile(\r\n scene,\r\n fileOrUrl as File | string,\r\n (data) => {\r\n this._validate(scene, new Uint8Array(data as ArrayBuffer), rootUrl, fileName);\r\n this._unpackBinaryAsync(\r\n new DataReader({\r\n readAsync: (byteOffset, byteLength) => readAsync(data as ArrayBuffer, byteOffset, byteLength),\r\n byteLength: (data as ArrayBuffer).byteLength,\r\n })\r\n ).then(\r\n (loaderData) => {\r\n onSuccess(loaderData);\r\n },\r\n onError ? (error) => onError(undefined, error) : undefined\r\n );\r\n },\r\n true,\r\n onError\r\n );\r\n }\r\n\r\n return this._loadFile(\r\n scene,\r\n fileOrUrl as File | string,\r\n (data) => {\r\n this._validate(scene, new Uint8Array(data as ArrayBuffer), rootUrl, fileName);\r\n onSuccess({ json: this._parseJson(data as string) });\r\n },\r\n useArrayBuffer,\r\n onError\r\n );\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n _loadBinary(\r\n scene: Scene,\r\n data: ArrayBufferView,\r\n rootUrl: string,\r\n onSuccess: (data: any, responseURL?: string) => void,\r\n onError?: (request?: WebRequest, exception?: LoadFileError) => void,\r\n fileName?: string\r\n ): void {\r\n this._validate(scene, data, rootUrl, fileName);\r\n this._unpackBinaryAsync(\r\n new DataReader({\r\n readAsync: (byteOffset, byteLength) => readViewAsync(data, byteOffset, byteLength),\r\n byteLength: data.byteLength,\r\n })\r\n ).then(\r\n (loaderData) => {\r\n onSuccess(loaderData);\r\n },\r\n onError ? (error) => onError(undefined, error) : undefined\r\n );\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public importMeshAsync(\r\n meshesNames: any,\r\n scene: Scene,\r\n data: any,\r\n rootUrl: string,\r\n onProgress?: (event: ISceneLoaderProgressEvent) => void,\r\n fileName?: string\r\n ): Promise<ISceneLoaderAsyncResult> {\r\n return Promise.resolve().then(() => {\r\n this.onParsedObservable.notifyObservers(data);\r\n this.onParsedObservable.clear();\r\n\r\n this._log(`Loading ${fileName || \"\"}`);\r\n this._loader = this._getLoader(data);\r\n return this._loader.importMeshAsync(meshesNames, scene, null, data, rootUrl, onProgress, fileName);\r\n });\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public loadAsync(scene: Scene, data: any, rootUrl: string, onProgress?: (event: ISceneLoaderProgressEvent) => void, fileName?: string): Promise<void> {\r\n return Promise.resolve().then(() => {\r\n this.onParsedObservable.notifyObservers(data);\r\n this.onParsedObservable.clear();\r\n\r\n this._log(`Loading ${fileName || \"\"}`);\r\n this._loader = this._getLoader(data);\r\n return this._loader.loadAsync(scene, data, rootUrl, onProgress, fileName);\r\n });\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public loadAssetContainerAsync(scene: Scene, data: any, rootUrl: string, onProgress?: (event: ISceneLoaderProgressEvent) => void, fileName?: string): Promise<AssetContainer> {\r\n return Promise.resolve().then(() => {\r\n this.onParsedObservable.notifyObservers(data);\r\n this.onParsedObservable.clear();\r\n\r\n this._log(`Loading ${fileName || \"\"}`);\r\n this._loader = this._getLoader(data);\r\n\r\n // Prepare the asset container.\r\n const container = new AssetContainer(scene);\r\n\r\n // Get materials/textures when loading to add to container\r\n const materials: Array<Material> = [];\r\n this.onMaterialLoadedObservable.add((material) => {\r\n materials.push(material);\r\n });\r\n const textures: Array<BaseTexture> = [];\r\n this.onTextureLoadedObservable.add((texture) => {\r\n textures.push(texture);\r\n });\r\n const cameras: Array<Camera> = [];\r\n this.onCameraLoadedObservable.add((camera) => {\r\n cameras.push(camera);\r\n });\r\n\r\n const morphTargetManagers: Array<MorphTargetManager> = [];\r\n this.onMeshLoadedObservable.add((mesh) => {\r\n if (mesh.morphTargetManager) {\r\n morphTargetManagers.push(mesh.morphTargetManager);\r\n }\r\n });\r\n\r\n return this._loader.importMeshAsync(null, scene, container, data, rootUrl, onProgress, fileName).then((result) => {\r\n Array.prototype.push.apply(container.geometries, result.geometries);\r\n Array.prototype.push.apply(container.meshes, result.meshes);\r\n Array.prototype.push.apply(container.particleSystems, result.particleSystems);\r\n Array.prototype.push.apply(container.skeletons, result.skeletons);\r\n Array.prototype.push.apply(container.animationGroups, result.animationGroups);\r\n Array.prototype.push.apply(container.materials, materials);\r\n Array.prototype.push.apply(container.textures, textures);\r\n Array.prototype.push.apply(container.lights, result.lights);\r\n Array.prototype.push.apply(container.transformNodes, result.transformNodes);\r\n Array.prototype.push.apply(container.cameras, cameras);\r\n Array.prototype.push.apply(container.morphTargetManagers, morphTargetManagers);\r\n return container;\r\n });\r\n });\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public canDirectLoad(data: string): boolean {\r\n return (\r\n (data.indexOf(\"asset\") !== -1 && data.indexOf(\"version\") !== -1) ||\r\n data.startsWith(\"data:base64,\" + GLTFFileLoader._MagicBase64Encoded) || // this is technically incorrect, but will continue to support for backcompat.\r\n data.startsWith(\"data:;base64,\" + GLTFFileLoader._MagicBase64Encoded) ||\r\n data.startsWith(\"data:application/octet-stream;base64,\" + GLTFFileLoader._MagicBase64Encoded) ||\r\n data.startsWith(\"data:model/gltf-binary;base64,\" + GLTFFileLoader._MagicBase64Encoded)\r\n );\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public directLoad(scene: Scene, data: string): Promise<any> {\r\n if (\r\n data.startsWith(\"base64,\" + GLTFFileLoader._MagicBase64Encoded) || // this is technically incorrect, but will continue to support for backcompat.\r\n data.startsWith(\";base64,\" + GLTFFileLoader._MagicBase64Encoded) ||\r\n data.startsWith(\"application/octet-stream;base64,\" + GLTFFileLoader._MagicBase64Encoded) ||\r\n data.startsWith(\"model/gltf-binary;base64,\" + GLTFFileLoader._MagicBase64Encoded)\r\n ) {\r\n const arrayBuffer = DecodeBase64UrlToBinary(data);\r\n\r\n this._validate(scene, new Uint8Array(arrayBuffer));\r\n return this._unpackBinaryAsync(\r\n new DataReader({\r\n readAsync: (byteOffset, byteLength) => readAsync(arrayBuffer, byteOffset, byteLength),\r\n byteLength: arrayBuffer.byteLength,\r\n })\r\n );\r\n }\r\n\r\n this._validate(scene, data);\r\n return Promise.resolve({ json: this._parseJson(data) });\r\n }\r\n\r\n /**\r\n * The callback that allows custom handling of the root url based on the response url.\r\n * @param rootUrl the original root url\r\n * @param responseURL the response url if available\r\n * @returns the new root url\r\n */\r\n public rewriteRootURL?(rootUrl: string, responseURL?: string): string;\r\n\r\n /** @internal */\r\n public createPlugin(): ISceneLoaderPlugin | ISceneLoaderPluginAsync {\r\n return new GLTFFileLoader();\r\n }\r\n\r\n /**\r\n * The loader state or null if the loader is not active.\r\n */\r\n public get loaderState(): Nullable<GLTFLoaderState> {\r\n return this._state;\r\n }\r\n\r\n /**\r\n * Observable raised when the loader state changes.\r\n */\r\n public onLoaderStateChangedObservable = new Observable<Nullable<GLTFLoaderState>>();\r\n\r\n /**\r\n * Returns a promise that resolves when the asset is completely loaded.\r\n * @returns a promise that resolves when the asset is completely loaded.\r\n */\r\n public whenCompleteAsync(): Promise<void> {\r\n return new Promise((resolve, reject) => {\r\n this.onCompleteObservable.addOnce(() => {\r\n resolve();\r\n });\r\n this.onErrorObservable.addOnce((reason) => {\r\n reject(reason);\r\n });\r\n });\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _setState(state: GLTFLoaderState): void {\r\n if (this._state === state) {\r\n return;\r\n }\r\n\r\n this._state = state;\r\n this.onLoaderStateChangedObservable.notifyObservers(this._state);\r\n this._log(GLTFLoaderState[this._state]);\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _loadFile(\r\n scene: Scene,\r\n fileOrUrl: File | string,\r\n onSuccess: (data: string | ArrayBuffer) => void,\r\n useArrayBuffer?: boolean,\r\n onError?: (request?: WebRequest) => void,\r\n onOpened?: (request: WebRequest) => void\r\n ): IFileRequest {\r\n const request = scene._loadFile(\r\n fileOrUrl,\r\n onSuccess,\r\n (event) => {\r\n this._onProgress(event, request);\r\n },\r\n true,\r\n useArrayBuffer,\r\n onError,\r\n onOpened\r\n ) as IFileRequestInfo;\r\n request.onCompleteObservable.add((request) => {\r\n this._requests.splice(this._requests.indexOf(request), 1);\r\n });\r\n this._requests.push(request);\r\n return request;\r\n }\r\n\r\n private _onProgress(event: ProgressEvent, request: IFileRequestInfo): void {\r\n if (!this._progressCallback) {\r\n return;\r\n }\r\n\r\n request._lengthComputable = event.lengthComputable;\r\n request._loaded = event.loaded;\r\n request._total = event.total;\r\n\r\n let lengthComputable = true;\r\n let loaded = 0;\r\n let total = 0;\r\n for (const request of this._requests) {\r\n if (request._lengthComputable === undefined || request._loaded === undefined || request._total === undefined) {\r\n return;\r\n }\r\n\r\n lengthComputable = lengthComputable && request._lengthComputable;\r\n loaded += request._loaded;\r\n total += request._total;\r\n }\r\n\r\n this._progressCallback({\r\n lengthComputable: lengthComputable,\r\n loaded: loaded,\r\n total: lengthComputable ? total : 0,\r\n });\r\n }\r\n\r\n private _validate(scene: Scene, data: string | ArrayBufferView, rootUrl = \"\", fileName = \"\"): void {\r\n if (!this.validate) {\r\n return;\r\n }\r\n\r\n this._startPerformanceCounter(\"Validate JSON\");\r\n GLTFValidation.ValidateAsync(data, rootUrl, fileName, (uri) => {\r\n return this.preprocessUrlAsync(rootUrl + uri).then((url) => scene._loadFileAsync(url, undefined, true, true) as Promise<ArrayBuffer>);\r\n }).then(\r\n (result) => {\r\n this._endPerformanceCounter(\"Validate JSON\");\r\n this.onValidatedObservable.notifyObservers(result);\r\n this.onValidatedObservable.clear();\r\n },\r\n (reason) => {\r\n this._endPerformanceCounter(\"Validate JSON\");\r\n Tools.Warn(`Failed to validate: ${reason.message}`);\r\n this.onValidatedObservable.clear();\r\n }\r\n );\r\n }\r\n\r\n private _getLoader(loaderData: IGLTFLoaderData): IGLTFLoader {\r\n const asset = (<any>loaderData.json).asset || {};\r\n\r\n this._log(`Asset version: ${asset.version}`);\r\n asset.minVersion && this._log(`Asset minimum version: ${asset.minVersion}`);\r\n asset.generator && this._log(`Asset generator: ${asset.generator}`);\r\n\r\n const version = GLTFFileLoader._parseVersion(asset.version);\r\n if (!version) {\r\n throw new Error(\"Invalid version: \" + asset.version);\r\n }\r\n\r\n if (asset.minVersion !== undefined) {\r\n const minVersion = GLTFFileLoader._parseVersion(asset.minVersion);\r\n if (!minVersion) {\r\n throw new Error(\"Invalid minimum version: \" + asset.minVersion);\r\n }\r\n\r\n if (GLTFFileLoader._compareVersion(minVersion, { major: 2, minor: 0 }) > 0) {\r\n throw new Error(\"Incompatible minimum version: \" + asset.minVersion);\r\n }\r\n }\r\n\r\n const createLoaders: { [key: number]: (parent: GLTFFileLoader) => IGLTFLoader } = {\r\n 1: GLTFFileLoader._CreateGLTF1Loader,\r\n 2: GLTFFileLoader._CreateGLTF2Loader,\r\n };\r\n\r\n const createLoader = createLoaders[version.major];\r\n if (!createLoader) {\r\n throw new Error(\"Unsupported version: \" + asset.version);\r\n }\r\n\r\n return createLoader(this);\r\n }\r\n\r\n private _parseJson(json: string): Object {\r\n this._startPerformanceCounter(\"Parse JSON\");\r\n this._log(`JSON length: ${json.length}`);\r\n const parsed = JSON.parse(json);\r\n this._endPerformanceCounter(\"Parse JSON\");\r\n return parsed;\r\n }\r\n\r\n private _unpackBinaryAsync(dataReader: DataReader): Promise<IGLTFLoaderData> {\r\n this._startPerformanceCounter(\"Unpack Binary\");\r\n\r\n // Read magic + version + length + json length + json format\r\n return dataReader.loadAsync(20).then(() => {\r\n const Binary = {\r\n Magic: 0x46546c67,\r\n };\r\n\r\n const magic = dataReader.readUint32();\r\n if (magic !== Binary.Magic) {\r\n throw new RuntimeError(\"Unexpected magic: \" + magic, ErrorCodes.GLTFLoaderUnexpectedMagicError);\r\n }\r\n\r\n const version = dataReader.readUint32();\r\n\r\n if (this.loggingEnabled) {\r\n this._log(`Binary version: ${version}`);\r\n }\r\n\r\n const length = dataReader.readUint32();\r\n if (!this.useRangeRequests && length !== dataReader.buffer.byteLength) {\r\n Logger.Warn(`Length in header does not match actual data length: ${length} != ${dataReader.buffer.byteLength}`);\r\n }\r\n\r\n let unpacked: Promise<IGLTFLoaderData>;\r\n switch (version) {\r\n case 1: {\r\n unpacked = this._unpackBinaryV1Async(dataReader, length);\r\n break;\r\n }\r\n case 2: {\r\n unpacked = this._unpackBinaryV2Async(dataReader, length);\r\n break;\r\n }\r\n default: {\r\n throw new Error(\"Unsupported version: \" + version);\r\n }\r\n }\r\n\r\n this._endPerformanceCounter(\"Unpack Binary\");\r\n\r\n return unpacked;\r\n });\r\n }\r\n\r\n private _unpackBinaryV1Async(dataReader: DataReader, length: number): Promise<IGLTFLoaderData> {\r\n const ContentFormat = {\r\n JSON: 0,\r\n };\r\n\r\n const contentLength = dataReader.readUint32();\r\n const contentFormat = dataReader.readUint32();\r\n\r\n if (contentFormat !== ContentFormat.JSON) {\r\n throw new Error(`Unexpected content format: ${contentFormat}`);\r\n }\r\n\r\n const bodyLength = length - dataReader.byteOffset;\r\n\r\n const data: IGLTFLoaderData = { json: this._parseJson(dataReader.readString(contentLength)), bin: null };\r\n if (bodyLength !== 0) {\r\n const startByteOffset = dataReader.byteOffset;\r\n data.bin = {\r\n readAsync: (byteOffset, byteLength) => dataReader.buffer.readAsync(startByteOffset + byteOffset, byteLength),\r\n byteLength: bodyLength,\r\n };\r\n }\r\n\r\n return Promise.resolve(data);\r\n }\r\n\r\n private _unpackBinaryV2Async(dataReader: DataReader, length: number): Promise<IGLTFLoaderData> {\r\n const ChunkFormat = {\r\n JSON: 0x4e4f534a,\r\n BIN: 0x004e4942,\r\n };\r\n\r\n // Read the JSON chunk header.\r\n const chunkLength = dataReader.readUint32();\r\n const chunkFormat = dataReader.readUint32();\r\n if (chunkFormat !== ChunkFormat.JSON) {\r\n throw new Error(\"First chunk format is not JSON\");\r\n }\r\n\r\n // Bail if there are no other chunks.\r\n if (dataReader.byteOffset + chunkLength === length) {\r\n return dataReader.loadAsync(chunkLength).then(() => {\r\n return { json: this._parseJson(dataReader.readString(chunkLength)), bin: null };\r\n });\r\n }\r\n\r\n // Read the JSON chunk and the length and type of the next chunk.\r\n return dataReader.loadAsync(chunkLength + 8).then(() => {\r\n const data: IGLTFLoaderData = { json: this._parseJson(dataReader.readString(chunkLength)), bin: null };\r\n\r\n const readAsync = (): Promise<IGLTFLoaderData> => {\r\n const chunkLength = dataReader.readUint32();\r\n const chunkFormat = dataReader.readUint32();\r\n\r\n switch (chunkFormat) {\r\n case ChunkFormat.JSON: {\r\n throw new Error(\"Unexpected JSON chunk\");\r\n }\r\n case ChunkFormat.BIN: {\r\n const startByteOffset = dataReader.byteOffset;\r\n data.bin = {\r\n readAsync: (byteOffset, byteLength) => dataReader.buffer.readAsync(startByteOffset + byteOffset, byteLength),\r\n byteLength: chunkLength,\r\n };\r\n dataReader.skipBytes(chunkLength);\r\n break;\r\n }\r\n default: {\r\n // ignore unrecognized chunkFormat\r\n dataReader.skipBytes(chunkLength);\r\n break;\r\n }\r\n }\r\n\r\n if (dataReader.byteOffset !== length) {\r\n return dataReader.loadAsync(8).then(readAsync);\r\n }\r\n\r\n return Promise.resolve(data);\r\n };\r\n\r\n return readAsync();\r\n });\r\n }\r\n\r\n private static _parseVersion(version: string): Nullable<{ major: number; minor: number }> {\r\n if (version === \"1.0\" || version === \"1.0.1\") {\r\n return {\r\n major: 1,\r\n minor: 0,\r\n };\r\n }\r\n\r\n const match = (version + \"\").match(/^(\\d+)\\.(\\d+)/);\r\n if (!match) {\r\n return null;\r\n }\r\n\r\n return {\r\n major: parseInt(match[1]),\r\n minor: parseInt(match[2]),\r\n };\r\n }\r\n\r\n private static _compareVersion(a: { major: number; minor: number }, b: { major: number; minor: number }): number {\r\n if (a.major > b.major) {\r\n return 1;\r\n }\r\n if (a.major < b.major) {\r\n return -1;\r\n }\r\n if (a.minor > b.minor) {\r\n return 1;\r\n }\r\n if (a.minor < b.minor) {\r\n return -1;\r\n }\r\n return 0;\r\n }\r\n\r\n private static readonly _logSpaces = \" \";\r\n private _logIndentLevel = 0;\r\n private _loggingEnabled = false;\r\n\r\n /** @internal */\r\n public _log = this._logDisabled;\r\n\r\n /**\r\n * @internal\r\n */\r\n public _logOpen(message: string): void {\r\n this._log(message);\r\n this._logIndentLevel++;\r\n }\r\n\r\n /** @internal */\r\n public _logClose(): void {\r\n --this._logIndentLevel;\r\n }\r\n\r\n private _logEnabled(message: string): void {\r\n const spaces = GLTFFileLoader._logSpaces.substr(0, this._logIndentLevel * 2);\r\n Logger.Log(`${spaces}${message}`);\r\n }\r\n\r\n private _logDisabled(message: string): void {}\r\n\r\n private _capturePerformanceCounters = false;\r\n\r\n /** @internal */\r\n public _startPerformanceCounter = this._startPerformanceCounterDisabled;\r\n\r\n /** @internal */\r\n public _endPerformanceCounter = this._endPerformanceCounterDisabled;\r\n\r\n private _startPerformanceCounterEnabled(counterName: string): void {\r\n Tools.StartPerformanceCounter(counterName);\r\n }\r\n\r\n private _startPerformanceCounterDisabled(counterName: string): void {}\r\n\r\n private _endPerformanceCounterEnabled(counterName: string): void {\r\n Tools.EndPerformanceCounter(counterName);\r\n }\r\n\r\n private _endPerformanceCounterDisabled(counterName: string): void {}\r\n}\r\n\r\nif (SceneLoader) {\r\n SceneLoader.RegisterPlugin(new GLTFFileLoader());\r\n}\r\n"]}
|
1
|
+
{"version":3,"file":"glTFFileLoader.js","sourceRoot":"","sources":["../../../../dev/loaders/src/glTF/glTFFileLoader.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,UAAU,EAAE,2CAA6B;AAClD,OAAO,EAAE,KAAK,EAAE,sCAAwB;AAaxC,OAAO,EAAE,WAAW,EAAE,+CAAiC;AACvD,OAAO,EAAE,cAAc,EAAE,0CAA4B;AAIrD,OAAO,EAAE,MAAM,EAAE,uCAAyB;AAE1C,OAAO,EAAE,UAAU,EAAE,2CAA6B;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,OAAO,EAAE,uBAAuB,EAAE,0CAA4B;AAC9D,OAAO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Ae,EAAE,CAAC;IAC3B,CAAC;IAED,gBAAgB;IACT,SAAS;QACZ,EAAE,IAAI,CAAC,eAAe,CAAC;IAC3B,CAAC;IAEO,WAAW,CAAC,OAAe;QAC/B,MAAM,MAAM,GAAG,cAAc,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,EAAE,IAAI,CAAC,eAAe,GAAG,CAAC,CAAC,CAAC;QAC7E,MAAM,CAAC,GAAG,CAAC,GAAG,MAAM,GAAG,OAAO,EAAE,CAAC,CAAC;IACtC,CAAC;IAEO,YAAY,CAAC,OAAe,IAAS,CAAC;IAUtC,+BAA+B,CAAC,WAAmB;QACvD,KAAK,CAAC,uBAAuB,CAAC,WAAW,CAAC,CAAC;IAC/C,CAAC;IAEO,gCAAgC,CAAC,WAAmB,IAAS,CAAC;IAE9D,6BAA6B,CAAC,WAAmB;QACrD,KAAK,CAAC,qBAAqB,CAAC,WAAW,CAAC,CAAC;IAC7C,CAAC;IAEO,8BAA8B,CAAC,WAAmB,IAAS,CAAC;;AAr/BpE,aAAa;AACb,aAAa;AACb,aAAa;AAEb;;;;;GAKG;AACW,iCAAkB,GAAG,IAAI,AAAP,CAAQ;AAExC;;;;GAIG;AACW,qCAAsB,GAAG,KAAK,AAAR,CAAS;AA0T9B,kCAAmB,GAAG,QAAQ,AAAX,CAAY,CAAC,8CAA8C;AA6nBrE,yBAAU,GAAG,kCAAkC,AAArC,CAAsC;AAgD5E,IAAI,WAAW,EAAE;IACb,WAAW,CAAC,cAAc,CAAC,IAAI,cAAc,EAAE,CAAC,CAAC;CACpD","sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\r\n/* eslint-disable @typescript-eslint/naming-convention */\r\nimport type * as GLTF2 from \"babylonjs-gltf2interface\";\r\nimport type { Nullable } from \"core/types\";\r\nimport type { Observer } from \"core/Misc/observable\";\r\nimport { Observable } from \"core/Misc/observable\";\r\nimport { Tools } from \"core/Misc/tools\";\r\nimport type { Camera } from \"core/Cameras/camera\";\r\nimport type { BaseTexture } from \"core/Materials/Textures/baseTexture\";\r\nimport type { Material } from \"core/Materials/material\";\r\nimport type { AbstractMesh } from \"core/Meshes/abstractMesh\";\r\nimport type {\r\n ISceneLoaderPluginFactory,\r\n ISceneLoaderPlugin,\r\n ISceneLoaderPluginAsync,\r\n ISceneLoaderProgressEvent,\r\n ISceneLoaderPluginExtensions,\r\n ISceneLoaderAsyncResult,\r\n} from \"core/Loading/sceneLoader\";\r\nimport { SceneLoader } from \"core/Loading/sceneLoader\";\r\nimport { AssetContainer } from \"core/assetContainer\";\r\nimport type { Scene, IDisposable } from \"core/scene\";\r\nimport type { WebRequest } from \"core/Misc/webRequest\";\r\nimport type { IFileRequest } from \"core/Misc/fileRequest\";\r\nimport { Logger } from \"core/Misc/logger\";\r\nimport type { IDataBuffer } from \"core/Misc/dataReader\";\r\nimport { DataReader } from \"core/Misc/dataReader\";\r\nimport { GLTFValidation } from \"./glTFValidation\";\r\nimport type { LoadFileError } from \"core/Misc/fileTools\";\r\nimport { DecodeBase64UrlToBinary } from \"core/Misc/fileTools\";\r\nimport { RuntimeError, ErrorCodes } from \"core/Misc/error\";\r\nimport type { TransformNode } from \"core/Meshes/transformNode\";\r\nimport type { MorphTargetManager } from \"core/Morph/morphTargetManager\";\r\n\r\ninterface IFileRequestInfo extends IFileRequest {\r\n _lengthComputable?: boolean;\r\n _loaded?: number;\r\n _total?: number;\r\n}\r\n\r\nfunction readAsync(arrayBuffer: ArrayBuffer, byteOffset: number, byteLength: number): Promise<Uint8Array> {\r\n try {\r\n return Promise.resolve(new Uint8Array(arrayBuffer, byteOffset, byteLength));\r\n } catch (e) {\r\n return Promise.reject(e);\r\n }\r\n}\r\n\r\nfunction readViewAsync(arrayBufferView: ArrayBufferView, byteOffset: number, byteLength: number): Promise<Uint8Array> {\r\n try {\r\n if ((arrayBufferView as Uint8Array).byteOffset + byteLength > arrayBufferView.byteLength) {\r\n throw new Error(\"Array length out of bounds.\");\r\n }\r\n\r\n return Promise.resolve(new Uint8Array(arrayBufferView.buffer, (arrayBufferView as Uint8Array).byteOffset + byteOffset, byteLength));\r\n } catch (e) {\r\n return Promise.reject(e);\r\n }\r\n}\r\n\r\n/**\r\n * Mode that determines the coordinate system to use.\r\n */\r\nexport enum GLTFLoaderCoordinateSystemMode {\r\n /**\r\n * Automatically convert the glTF right-handed data to the appropriate system based on the current coordinate system mode of the scene.\r\n */\r\n AUTO,\r\n\r\n /**\r\n * Sets the useRightHandedSystem flag on the scene.\r\n */\r\n FORCE_RIGHT_HANDED,\r\n}\r\n\r\n/**\r\n * Mode that determines what animations will start.\r\n */\r\nexport enum GLTFLoaderAnimationStartMode {\r\n /**\r\n * No animation will start.\r\n */\r\n NONE,\r\n\r\n /**\r\n * The first animation will start.\r\n */\r\n FIRST,\r\n\r\n /**\r\n * All animations will start.\r\n */\r\n ALL,\r\n}\r\n\r\n/**\r\n * Interface that contains the data for the glTF asset.\r\n */\r\nexport interface IGLTFLoaderData {\r\n /**\r\n * The object that represents the glTF JSON.\r\n */\r\n json: Object;\r\n\r\n /**\r\n * The BIN chunk of a binary glTF.\r\n */\r\n bin: Nullable<IDataBuffer>;\r\n}\r\n\r\n/**\r\n * Interface for extending the loader.\r\n */\r\nexport interface IGLTFLoaderExtension {\r\n /**\r\n * The name of this extension.\r\n */\r\n readonly name: string;\r\n\r\n /**\r\n * Defines whether this extension is enabled.\r\n */\r\n enabled: boolean;\r\n\r\n /**\r\n * Defines the order of this extension.\r\n * The loader sorts the extensions using these values when loading.\r\n */\r\n order?: number;\r\n}\r\n\r\n/**\r\n * Loader state.\r\n */\r\nexport enum GLTFLoaderState {\r\n /**\r\n * The asset is loading.\r\n */\r\n LOADING,\r\n\r\n /**\r\n * The asset is ready for rendering.\r\n */\r\n READY,\r\n\r\n /**\r\n * The asset is completely loaded.\r\n */\r\n COMPLETE,\r\n}\r\n\r\n/** @internal */\r\nexport interface IGLTFLoader extends IDisposable {\r\n importMeshAsync: (\r\n meshesNames: any,\r\n scene: Scene,\r\n container: Nullable<AssetContainer>,\r\n data: IGLTFLoaderData,\r\n rootUrl: string,\r\n onProgress?: (event: ISceneLoaderProgressEvent) => void,\r\n fileName?: string\r\n ) => Promise<ISceneLoaderAsyncResult>;\r\n loadAsync: (scene: Scene, data: IGLTFLoaderData, rootUrl: string, onProgress?: (event: ISceneLoaderProgressEvent) => void, fileName?: string) => Promise<void>;\r\n}\r\n\r\n/**\r\n * File loader for loading glTF files into a scene.\r\n */\r\nexport class GLTFFileLoader implements IDisposable, ISceneLoaderPluginAsync, ISceneLoaderPluginFactory {\r\n /** @internal */\r\n public static _CreateGLTF1Loader: (parent: GLTFFileLoader) => IGLTFLoader;\r\n\r\n /** @internal */\r\n public static _CreateGLTF2Loader: (parent: GLTFFileLoader) => IGLTFLoader;\r\n\r\n // --------------\r\n // Common options\r\n // --------------\r\n\r\n /**\r\n * Raised when the asset has been parsed\r\n */\r\n public onParsedObservable = new Observable<IGLTFLoaderData>();\r\n\r\n private _onParsedObserver: Nullable<Observer<IGLTFLoaderData>>;\r\n\r\n /**\r\n * Raised when the asset has been parsed\r\n */\r\n public set onParsed(callback: (loaderData: IGLTFLoaderData) => void) {\r\n if (this._onParsedObserver) {\r\n this.onParsedObservable.remove(this._onParsedObserver);\r\n }\r\n this._onParsedObserver = this.onParsedObservable.add(callback);\r\n }\r\n\r\n // ----------\r\n // V1 options\r\n // ----------\r\n\r\n /**\r\n * 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.\r\n * Textures always loads asynchronously. For example, the success callback can compute the bounding information of the loaded meshes when incremental loading is disabled.\r\n * Defaults to true.\r\n * @internal\r\n */\r\n public static IncrementalLoading = true;\r\n\r\n /**\r\n * Set this property to true in order to work with homogeneous coordinates, available with some converters and exporters.\r\n * Defaults to false. See https://en.wikipedia.org/wiki/Homogeneous_coordinates.\r\n * @internal\r\n */\r\n public static HomogeneousCoordinates = false;\r\n\r\n // ----------\r\n // V2 options\r\n // ----------\r\n\r\n /**\r\n * The coordinate system mode. Defaults to AUTO.\r\n */\r\n public coordinateSystemMode = GLTFLoaderCoordinateSystemMode.AUTO;\r\n\r\n /**\r\n * The animation start mode. Defaults to FIRST.\r\n */\r\n public animationStartMode = GLTFLoaderAnimationStartMode.FIRST;\r\n\r\n /**\r\n * Defines if the loader should compile materials before raising the success callback. Defaults to false.\r\n */\r\n public compileMaterials = false;\r\n\r\n /**\r\n * Defines if the loader should also compile materials with clip planes. Defaults to false.\r\n */\r\n public useClipPlane = false;\r\n\r\n /**\r\n * Defines if the loader should compile shadow generators before raising the success callback. Defaults to false.\r\n */\r\n public compileShadowGenerators = false;\r\n\r\n /**\r\n * Defines if the Alpha blended materials are only applied as coverage.\r\n * If false, (default) The luminance of each pixel will reduce its opacity to simulate the behaviour of most physical materials.\r\n * If true, no extra effects are applied to transparent pixels.\r\n */\r\n public transparencyAsCoverage = false;\r\n\r\n /**\r\n * Defines if the loader should use range requests when load binary glTF files from HTTP.\r\n * Enabling will disable offline support and glTF validator.\r\n * Defaults to false.\r\n */\r\n public useRangeRequests = false;\r\n\r\n /**\r\n * Defines if the loader should create instances when multiple glTF nodes point to the same glTF mesh. Defaults to true.\r\n */\r\n public createInstances = true;\r\n\r\n /**\r\n * 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.\r\n */\r\n public alwaysComputeBoundingBox = false;\r\n\r\n /**\r\n * If true, load all materials defined in the file, even if not used by any mesh. Defaults to false.\r\n */\r\n public loadAllMaterials = false;\r\n\r\n /**\r\n * If true, load only the materials defined in the file. Defaults to false.\r\n */\r\n public loadOnlyMaterials = false;\r\n\r\n /**\r\n * If true, do not load any materials defined in the file. Defaults to false.\r\n */\r\n public skipMaterials = false;\r\n\r\n /**\r\n * 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.\r\n */\r\n public useSRGBBuffers = true;\r\n\r\n /**\r\n * When loading glTF animations, which are defined in seconds, target them to this FPS. Defaults to 60.\r\n */\r\n public targetFps = 60;\r\n\r\n /**\r\n * Defines if the loader should always compute the nearest common ancestor of the skeleton joints instead of using `skin.skeleton`. Defaults to false.\r\n * Set this to true if loading assets with invalid `skin.skeleton` values.\r\n */\r\n public alwaysComputeSkeletonRootNode = false;\r\n\r\n /**\r\n * Function called before loading a url referenced by the asset.\r\n * @param url\r\n */\r\n public preprocessUrlAsync = (url: string) => Promise.resolve(url);\r\n\r\n /**\r\n * Observable raised when the loader creates a mesh after parsing the glTF properties of the mesh.\r\n * 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, ...)\r\n */\r\n public readonly onMeshLoadedObservable = new Observable<AbstractMesh>();\r\n\r\n private _onMeshLoadedObserver: Nullable<Observer<AbstractMesh>>;\r\n\r\n /**\r\n * Callback raised when the loader creates a mesh after parsing the glTF properties of the mesh.\r\n * 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, ...)\r\n */\r\n public set onMeshLoaded(callback: (mesh: AbstractMesh) => void) {\r\n if (this._onMeshLoadedObserver) {\r\n this.onMeshLoadedObservable.remove(this._onMeshLoadedObserver);\r\n }\r\n this._onMeshLoadedObserver = this.onMeshLoadedObservable.add(callback);\r\n }\r\n\r\n /**\r\n * Callback raised when the loader creates a skin after parsing the glTF properties of the skin node.\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/importers/glTF/glTFSkinning#ignoring-the-transform-of-the-skinned-mesh\r\n * @param node - the transform node that corresponds to the original glTF skin node used for animations\r\n * @param skinnedNode - the transform node that is the skinned mesh itself or the parent of the skinned meshes\r\n */\r\n public readonly onSkinLoadedObservable = new Observable<{ node: TransformNode; skinnedNode: TransformNode }>();\r\n\r\n /**\r\n * Observable raised when the loader creates a texture after parsing the glTF properties of the texture.\r\n */\r\n public readonly onTextureLoadedObservable = new Observable<BaseTexture>();\r\n\r\n private _onTextureLoadedObserver: Nullable<Observer<BaseTexture>>;\r\n\r\n /**\r\n * Callback raised when the loader creates a texture after parsing the glTF properties of the texture.\r\n */\r\n public set onTextureLoaded(callback: (texture: BaseTexture) => void) {\r\n if (this._onTextureLoadedObserver) {\r\n this.onTextureLoadedObservable.remove(this._onTextureLoadedObserver);\r\n }\r\n this._onTextureLoadedObserver = this.onTextureLoadedObservable.add(callback);\r\n }\r\n\r\n /**\r\n * Observable raised when the loader creates a material after parsing the glTF properties of the material.\r\n */\r\n public readonly onMaterialLoadedObservable = new Observable<Material>();\r\n\r\n private _onMaterialLoadedObserver: Nullable<Observer<Material>>;\r\n\r\n /**\r\n * Callback raised when the loader creates a material after parsing the glTF properties of the material.\r\n */\r\n public set onMaterialLoaded(callback: (material: Material) => void) {\r\n if (this._onMaterialLoadedObserver) {\r\n this.onMaterialLoadedObservable.remove(this._onMaterialLoadedObserver);\r\n }\r\n this._onMaterialLoadedObserver = this.onMaterialLoadedObservable.add(callback);\r\n }\r\n\r\n /**\r\n * Observable raised when the loader creates a camera after parsing the glTF properties of the camera.\r\n */\r\n public readonly onCameraLoadedObservable = new Observable<Camera>();\r\n\r\n private _onCameraLoadedObserver: Nullable<Observer<Camera>>;\r\n\r\n /**\r\n * Callback raised when the loader creates a camera after parsing the glTF properties of the camera.\r\n */\r\n public set onCameraLoaded(callback: (camera: Camera) => void) {\r\n if (this._onCameraLoadedObserver) {\r\n this.onCameraLoadedObservable.remove(this._onCameraLoadedObserver);\r\n }\r\n this._onCameraLoadedObserver = this.onCameraLoadedObservable.add(callback);\r\n }\r\n\r\n /**\r\n * Observable raised when the asset is completely loaded, immediately before the loader is disposed.\r\n * For assets with LODs, raised when all of the LODs are complete.\r\n * For assets without LODs, raised when the model is complete, immediately after the loader resolves the returned promise.\r\n */\r\n public readonly onCompleteObservable = new Observable<void>();\r\n\r\n private _onCompleteObserver: Nullable<Observer<void>>;\r\n\r\n /**\r\n * Callback raised when the asset is completely loaded, immediately before the loader is disposed.\r\n * For assets with LODs, raised when all of the LODs are complete.\r\n * For assets without LODs, raised when the model is complete, immediately after the loader resolves the returned promise.\r\n */\r\n public set onComplete(callback: () => void) {\r\n if (this._onCompleteObserver) {\r\n this.onCompleteObservable.remove(this._onCompleteObserver);\r\n }\r\n this._onCompleteObserver = this.onCompleteObservable.add(callback);\r\n }\r\n\r\n /**\r\n * Observable raised when an error occurs.\r\n */\r\n public readonly onErrorObservable = new Observable<any>();\r\n\r\n private _onErrorObserver: Nullable<Observer<any>>;\r\n\r\n /**\r\n * Callback raised when an error occurs.\r\n */\r\n public set onError(callback: (reason: any) => void) {\r\n if (this._onErrorObserver) {\r\n this.onErrorObservable.remove(this._onErrorObserver);\r\n }\r\n this._onErrorObserver = this.onErrorObservable.add(callback);\r\n }\r\n\r\n /**\r\n * Observable raised after the loader is disposed.\r\n */\r\n public readonly onDisposeObservable = new Observable<void>();\r\n\r\n private _onDisposeObserver: Nullable<Observer<void>>;\r\n\r\n /**\r\n * Callback raised after the loader is disposed.\r\n */\r\n public set onDispose(callback: () => void) {\r\n if (this._onDisposeObserver) {\r\n this.onDisposeObservable.remove(this._onDisposeObserver);\r\n }\r\n this._onDisposeObserver = this.onDisposeObservable.add(callback);\r\n }\r\n\r\n /**\r\n * Observable raised after a loader extension is created.\r\n * Set additional options for a loader extension in this event.\r\n */\r\n public readonly onExtensionLoadedObservable = new Observable<IGLTFLoaderExtension>();\r\n\r\n private _onExtensionLoadedObserver: Nullable<Observer<IGLTFLoaderExtension>>;\r\n\r\n /**\r\n * Callback raised after a loader extension is created.\r\n */\r\n public set onExtensionLoaded(callback: (extension: IGLTFLoaderExtension) => void) {\r\n if (this._onExtensionLoadedObserver) {\r\n this.onExtensionLoadedObservable.remove(this._onExtensionLoadedObserver);\r\n }\r\n this._onExtensionLoadedObserver = this.onExtensionLoadedObservable.add(callback);\r\n }\r\n\r\n /**\r\n * Defines if the loader logging is enabled.\r\n */\r\n public get loggingEnabled(): boolean {\r\n return this._loggingEnabled;\r\n }\r\n\r\n public set loggingEnabled(value: boolean) {\r\n if (this._loggingEnabled === value) {\r\n return;\r\n }\r\n\r\n this._loggingEnabled = value;\r\n\r\n if (this._loggingEnabled) {\r\n this._log = this._logEnabled;\r\n } else {\r\n this._log = this._logDisabled;\r\n }\r\n }\r\n\r\n /**\r\n * Defines if the loader should capture performance counters.\r\n */\r\n public get capturePerformanceCounters(): boolean {\r\n return this._capturePerformanceCounters;\r\n }\r\n\r\n public set capturePerformanceCounters(value: boolean) {\r\n if (this._capturePerformanceCounters === value) {\r\n return;\r\n }\r\n\r\n this._capturePerformanceCounters = value;\r\n\r\n if (this._capturePerformanceCounters) {\r\n this._startPerformanceCounter = this._startPerformanceCounterEnabled;\r\n this._endPerformanceCounter = this._endPerformanceCounterEnabled;\r\n } else {\r\n this._startPerformanceCounter = this._startPerformanceCounterDisabled;\r\n this._endPerformanceCounter = this._endPerformanceCounterDisabled;\r\n }\r\n }\r\n\r\n /**\r\n * Defines if the loader should validate the asset.\r\n */\r\n public validate = false;\r\n\r\n /**\r\n * Observable raised after validation when validate is set to true. The event data is the result of the validation.\r\n */\r\n public readonly onValidatedObservable = new Observable<GLTF2.IGLTFValidationResults>();\r\n\r\n private _onValidatedObserver: Nullable<Observer<GLTF2.IGLTFValidationResults>>;\r\n\r\n /**\r\n * Callback raised after a loader extension is created.\r\n */\r\n public set onValidated(callback: (results: GLTF2.IGLTFValidationResults) => void) {\r\n if (this._onValidatedObserver) {\r\n this.onValidatedObservable.remove(this._onValidatedObserver);\r\n }\r\n this._onValidatedObserver = this.onValidatedObservable.add(callback);\r\n }\r\n\r\n private _loader: Nullable<IGLTFLoader> = null;\r\n private _state: Nullable<GLTFLoaderState> = null;\r\n private _progressCallback?: (event: ISceneLoaderProgressEvent) => void;\r\n private _requests = new Array<IFileRequestInfo>();\r\n\r\n private static _MagicBase64Encoded = \"Z2xURg\"; // \"glTF\" base64 encoded (without the quotes!)\r\n\r\n /**\r\n * Name of the loader (\"gltf\")\r\n */\r\n public name = \"gltf\";\r\n\r\n /** @internal */\r\n public extensions: ISceneLoaderPluginExtensions = {\r\n \".gltf\": { isBinary: false },\r\n \".glb\": { isBinary: true },\r\n };\r\n\r\n /**\r\n * Disposes the loader, releases resources during load, and cancels any outstanding requests.\r\n */\r\n public dispose(): void {\r\n if (this._loader) {\r\n this._loader.dispose();\r\n this._loader = null;\r\n }\r\n\r\n for (const request of this._requests) {\r\n request.abort();\r\n }\r\n\r\n this._requests.length = 0;\r\n\r\n delete this._progressCallback;\r\n\r\n this.preprocessUrlAsync = (url) => Promise.resolve(url);\r\n\r\n this.onMeshLoadedObservable.clear();\r\n this.onSkinLoadedObservable.clear();\r\n this.onTextureLoadedObservable.clear();\r\n this.onMaterialLoadedObservable.clear();\r\n this.onCameraLoadedObservable.clear();\r\n this.onCompleteObservable.clear();\r\n this.onExtensionLoadedObservable.clear();\r\n\r\n this.onDisposeObservable.notifyObservers(undefined);\r\n this.onDisposeObservable.clear();\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public loadFile(\r\n scene: Scene,\r\n fileOrUrl: File | string | ArrayBufferView,\r\n rootUrl: string,\r\n onSuccess: (data: any, responseURL?: string) => void,\r\n onProgress?: (ev: ISceneLoaderProgressEvent) => void,\r\n useArrayBuffer?: boolean,\r\n onError?: (request?: WebRequest, exception?: LoadFileError) => void,\r\n name?: string\r\n ): Nullable<IFileRequest> {\r\n if (ArrayBuffer.isView(fileOrUrl)) {\r\n this._loadBinary(scene, fileOrUrl as ArrayBufferView, rootUrl, onSuccess, onError, name);\r\n return null;\r\n }\r\n\r\n this._progressCallback = onProgress;\r\n\r\n const fileName = (fileOrUrl as File).name || Tools.GetFilename(fileOrUrl as string);\r\n\r\n if (useArrayBuffer) {\r\n if (this.useRangeRequests) {\r\n if (this.validate) {\r\n Logger.Warn(\"glTF validation is not supported when range requests are enabled\");\r\n }\r\n\r\n const fileRequest: IFileRequest = {\r\n abort: () => {},\r\n onCompleteObservable: new Observable<IFileRequest>(),\r\n };\r\n\r\n const dataBuffer = {\r\n readAsync: (byteOffset: number, byteLength: number) => {\r\n return new Promise<ArrayBufferView>((resolve, reject) => {\r\n this._loadFile(\r\n scene,\r\n fileOrUrl as File | string,\r\n (data) => {\r\n resolve(new Uint8Array(data as ArrayBuffer));\r\n },\r\n true,\r\n (error) => {\r\n reject(error);\r\n },\r\n (webRequest) => {\r\n webRequest.setRequestHeader(\"Range\", `bytes=${byteOffset}-${byteOffset + byteLength - 1}`);\r\n }\r\n );\r\n });\r\n },\r\n byteLength: 0,\r\n };\r\n\r\n this._unpackBinaryAsync(new DataReader(dataBuffer)).then(\r\n (loaderData) => {\r\n fileRequest.onCompleteObservable.notifyObservers(fileRequest);\r\n onSuccess(loaderData);\r\n },\r\n onError ? (error) => onError(undefined, error) : undefined\r\n );\r\n\r\n return fileRequest;\r\n }\r\n\r\n return this._loadFile(\r\n scene,\r\n fileOrUrl as File | string,\r\n (data) => {\r\n this._validate(scene, new Uint8Array(data as ArrayBuffer), rootUrl, fileName);\r\n this._unpackBinaryAsync(\r\n new DataReader({\r\n readAsync: (byteOffset, byteLength) => readAsync(data as ArrayBuffer, byteOffset, byteLength),\r\n byteLength: (data as ArrayBuffer).byteLength,\r\n })\r\n ).then(\r\n (loaderData) => {\r\n onSuccess(loaderData);\r\n },\r\n onError ? (error) => onError(undefined, error) : undefined\r\n );\r\n },\r\n true,\r\n onError\r\n );\r\n }\r\n\r\n return this._loadFile(\r\n scene,\r\n fileOrUrl as File | string,\r\n (data) => {\r\n this._validate(scene, new Uint8Array(data as ArrayBuffer), rootUrl, fileName);\r\n onSuccess({ json: this._parseJson(data as string) });\r\n },\r\n useArrayBuffer,\r\n onError\r\n );\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n _loadBinary(\r\n scene: Scene,\r\n data: ArrayBufferView,\r\n rootUrl: string,\r\n onSuccess: (data: any, responseURL?: string) => void,\r\n onError?: (request?: WebRequest, exception?: LoadFileError) => void,\r\n fileName?: string\r\n ): void {\r\n this._validate(scene, data, rootUrl, fileName);\r\n this._unpackBinaryAsync(\r\n new DataReader({\r\n readAsync: (byteOffset, byteLength) => readViewAsync(data, byteOffset, byteLength),\r\n byteLength: data.byteLength,\r\n })\r\n ).then(\r\n (loaderData) => {\r\n onSuccess(loaderData);\r\n },\r\n onError ? (error) => onError(undefined, error) : undefined\r\n );\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public importMeshAsync(\r\n meshesNames: any,\r\n scene: Scene,\r\n data: any,\r\n rootUrl: string,\r\n onProgress?: (event: ISceneLoaderProgressEvent) => void,\r\n fileName?: string\r\n ): Promise<ISceneLoaderAsyncResult> {\r\n return Promise.resolve().then(() => {\r\n this.onParsedObservable.notifyObservers(data);\r\n this.onParsedObservable.clear();\r\n\r\n this._log(`Loading ${fileName || \"\"}`);\r\n this._loader = this._getLoader(data);\r\n return this._loader.importMeshAsync(meshesNames, scene, null, data, rootUrl, onProgress, fileName);\r\n });\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public loadAsync(scene: Scene, data: any, rootUrl: string, onProgress?: (event: ISceneLoaderProgressEvent) => void, fileName?: string): Promise<void> {\r\n return Promise.resolve().then(() => {\r\n this.onParsedObservable.notifyObservers(data);\r\n this.onParsedObservable.clear();\r\n\r\n this._log(`Loading ${fileName || \"\"}`);\r\n this._loader = this._getLoader(data);\r\n return this._loader.loadAsync(scene, data, rootUrl, onProgress, fileName);\r\n });\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public loadAssetContainerAsync(scene: Scene, data: any, rootUrl: string, onProgress?: (event: ISceneLoaderProgressEvent) => void, fileName?: string): Promise<AssetContainer> {\r\n return Promise.resolve().then(() => {\r\n this.onParsedObservable.notifyObservers(data);\r\n this.onParsedObservable.clear();\r\n\r\n this._log(`Loading ${fileName || \"\"}`);\r\n this._loader = this._getLoader(data);\r\n\r\n // Prepare the asset container.\r\n const container = new AssetContainer(scene);\r\n\r\n // Get materials/textures when loading to add to container\r\n const materials: Array<Material> = [];\r\n this.onMaterialLoadedObservable.add((material) => {\r\n materials.push(material);\r\n });\r\n const textures: Array<BaseTexture> = [];\r\n this.onTextureLoadedObservable.add((texture) => {\r\n textures.push(texture);\r\n });\r\n const cameras: Array<Camera> = [];\r\n this.onCameraLoadedObservable.add((camera) => {\r\n cameras.push(camera);\r\n });\r\n\r\n const morphTargetManagers: Array<MorphTargetManager> = [];\r\n this.onMeshLoadedObservable.add((mesh) => {\r\n if (mesh.morphTargetManager) {\r\n morphTargetManagers.push(mesh.morphTargetManager);\r\n }\r\n });\r\n\r\n return this._loader.importMeshAsync(null, scene, container, data, rootUrl, onProgress, fileName).then((result) => {\r\n Array.prototype.push.apply(container.geometries, result.geometries);\r\n Array.prototype.push.apply(container.meshes, result.meshes);\r\n Array.prototype.push.apply(container.particleSystems, result.particleSystems);\r\n Array.prototype.push.apply(container.skeletons, result.skeletons);\r\n Array.prototype.push.apply(container.animationGroups, result.animationGroups);\r\n Array.prototype.push.apply(container.materials, materials);\r\n Array.prototype.push.apply(container.textures, textures);\r\n Array.prototype.push.apply(container.lights, result.lights);\r\n Array.prototype.push.apply(container.transformNodes, result.transformNodes);\r\n Array.prototype.push.apply(container.cameras, cameras);\r\n Array.prototype.push.apply(container.morphTargetManagers, morphTargetManagers);\r\n return container;\r\n });\r\n });\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public canDirectLoad(data: string): boolean {\r\n return (\r\n (data.indexOf(\"asset\") !== -1 && data.indexOf(\"version\") !== -1) ||\r\n data.startsWith(\"data:base64,\" + GLTFFileLoader._MagicBase64Encoded) || // this is technically incorrect, but will continue to support for backcompat.\r\n data.startsWith(\"data:;base64,\" + GLTFFileLoader._MagicBase64Encoded) ||\r\n data.startsWith(\"data:application/octet-stream;base64,\" + GLTFFileLoader._MagicBase64Encoded) ||\r\n data.startsWith(\"data:model/gltf-binary;base64,\" + GLTFFileLoader._MagicBase64Encoded)\r\n );\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public directLoad(scene: Scene, data: string): Promise<any> {\r\n if (\r\n data.startsWith(\"base64,\" + GLTFFileLoader._MagicBase64Encoded) || // this is technically incorrect, but will continue to support for backcompat.\r\n data.startsWith(\";base64,\" + GLTFFileLoader._MagicBase64Encoded) ||\r\n data.startsWith(\"application/octet-stream;base64,\" + GLTFFileLoader._MagicBase64Encoded) ||\r\n data.startsWith(\"model/gltf-binary;base64,\" + GLTFFileLoader._MagicBase64Encoded)\r\n ) {\r\n const arrayBuffer = DecodeBase64UrlToBinary(data);\r\n\r\n this._validate(scene, new Uint8Array(arrayBuffer));\r\n return this._unpackBinaryAsync(\r\n new DataReader({\r\n readAsync: (byteOffset, byteLength) => readAsync(arrayBuffer, byteOffset, byteLength),\r\n byteLength: arrayBuffer.byteLength,\r\n })\r\n );\r\n }\r\n\r\n this._validate(scene, data);\r\n return Promise.resolve({ json: this._parseJson(data) });\r\n }\r\n\r\n /**\r\n * The callback that allows custom handling of the root url based on the response url.\r\n * @param rootUrl the original root url\r\n * @param responseURL the response url if available\r\n * @returns the new root url\r\n */\r\n public rewriteRootURL?(rootUrl: string, responseURL?: string): string;\r\n\r\n /** @internal */\r\n public createPlugin(): ISceneLoaderPlugin | ISceneLoaderPluginAsync {\r\n return new GLTFFileLoader();\r\n }\r\n\r\n /**\r\n * The loader state or null if the loader is not active.\r\n */\r\n public get loaderState(): Nullable<GLTFLoaderState> {\r\n return this._state;\r\n }\r\n\r\n /**\r\n * Observable raised when the loader state changes.\r\n */\r\n public onLoaderStateChangedObservable = new Observable<Nullable<GLTFLoaderState>>();\r\n\r\n /**\r\n * Returns a promise that resolves when the asset is completely loaded.\r\n * @returns a promise that resolves when the asset is completely loaded.\r\n */\r\n public whenCompleteAsync(): Promise<void> {\r\n return new Promise((resolve, reject) => {\r\n this.onCompleteObservable.addOnce(() => {\r\n resolve();\r\n });\r\n this.onErrorObservable.addOnce((reason) => {\r\n reject(reason);\r\n });\r\n });\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _setState(state: GLTFLoaderState): void {\r\n if (this._state === state) {\r\n return;\r\n }\r\n\r\n this._state = state;\r\n this.onLoaderStateChangedObservable.notifyObservers(this._state);\r\n this._log(GLTFLoaderState[this._state]);\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _loadFile(\r\n scene: Scene,\r\n fileOrUrl: File | string,\r\n onSuccess: (data: string | ArrayBuffer) => void,\r\n useArrayBuffer?: boolean,\r\n onError?: (request?: WebRequest) => void,\r\n onOpened?: (request: WebRequest) => void\r\n ): IFileRequest {\r\n const request = scene._loadFile(\r\n fileOrUrl,\r\n onSuccess,\r\n (event) => {\r\n this._onProgress(event, request);\r\n },\r\n true,\r\n useArrayBuffer,\r\n onError,\r\n onOpened\r\n ) as IFileRequestInfo;\r\n request.onCompleteObservable.add((request) => {\r\n this._requests.splice(this._requests.indexOf(request), 1);\r\n });\r\n this._requests.push(request);\r\n return request;\r\n }\r\n\r\n private _onProgress(event: ProgressEvent, request: IFileRequestInfo): void {\r\n if (!this._progressCallback) {\r\n return;\r\n }\r\n\r\n request._lengthComputable = event.lengthComputable;\r\n request._loaded = event.loaded;\r\n request._total = event.total;\r\n\r\n let lengthComputable = true;\r\n let loaded = 0;\r\n let total = 0;\r\n for (const request of this._requests) {\r\n if (request._lengthComputable === undefined || request._loaded === undefined || request._total === undefined) {\r\n return;\r\n }\r\n\r\n lengthComputable = lengthComputable && request._lengthComputable;\r\n loaded += request._loaded;\r\n total += request._total;\r\n }\r\n\r\n this._progressCallback({\r\n lengthComputable: lengthComputable,\r\n loaded: loaded,\r\n total: lengthComputable ? total : 0,\r\n });\r\n }\r\n\r\n private _validate(scene: Scene, data: string | ArrayBufferView, rootUrl = \"\", fileName = \"\"): void {\r\n if (!this.validate) {\r\n return;\r\n }\r\n\r\n this._startPerformanceCounter(\"Validate JSON\");\r\n GLTFValidation.ValidateAsync(data, rootUrl, fileName, (uri) => {\r\n return this.preprocessUrlAsync(rootUrl + uri).then((url) => scene._loadFileAsync(url, undefined, true, true) as Promise<ArrayBuffer>);\r\n }).then(\r\n (result) => {\r\n this._endPerformanceCounter(\"Validate JSON\");\r\n this.onValidatedObservable.notifyObservers(result);\r\n this.onValidatedObservable.clear();\r\n },\r\n (reason) => {\r\n this._endPerformanceCounter(\"Validate JSON\");\r\n Tools.Warn(`Failed to validate: ${reason.message}`);\r\n this.onValidatedObservable.clear();\r\n }\r\n );\r\n }\r\n\r\n private _getLoader(loaderData: IGLTFLoaderData): IGLTFLoader {\r\n const asset = (<any>loaderData.json).asset || {};\r\n\r\n this._log(`Asset version: ${asset.version}`);\r\n asset.minVersion && this._log(`Asset minimum version: ${asset.minVersion}`);\r\n asset.generator && this._log(`Asset generator: ${asset.generator}`);\r\n\r\n const version = GLTFFileLoader._parseVersion(asset.version);\r\n if (!version) {\r\n throw new Error(\"Invalid version: \" + asset.version);\r\n }\r\n\r\n if (asset.minVersion !== undefined) {\r\n const minVersion = GLTFFileLoader._parseVersion(asset.minVersion);\r\n if (!minVersion) {\r\n throw new Error(\"Invalid minimum version: \" + asset.minVersion);\r\n }\r\n\r\n if (GLTFFileLoader._compareVersion(minVersion, { major: 2, minor: 0 }) > 0) {\r\n throw new Error(\"Incompatible minimum version: \" + asset.minVersion);\r\n }\r\n }\r\n\r\n const createLoaders: { [key: number]: (parent: GLTFFileLoader) => IGLTFLoader } = {\r\n 1: GLTFFileLoader._CreateGLTF1Loader,\r\n 2: GLTFFileLoader._CreateGLTF2Loader,\r\n };\r\n\r\n const createLoader = createLoaders[version.major];\r\n if (!createLoader) {\r\n throw new Error(\"Unsupported version: \" + asset.version);\r\n }\r\n\r\n return createLoader(this);\r\n }\r\n\r\n private _parseJson(json: string): Object {\r\n this._startPerformanceCounter(\"Parse JSON\");\r\n this._log(`JSON length: ${json.length}`);\r\n const parsed = JSON.parse(json);\r\n this._endPerformanceCounter(\"Parse JSON\");\r\n return parsed;\r\n }\r\n\r\n private _unpackBinaryAsync(dataReader: DataReader): Promise<IGLTFLoaderData> {\r\n this._startPerformanceCounter(\"Unpack Binary\");\r\n\r\n // Read magic + version + length + json length + json format\r\n return dataReader.loadAsync(20).then(() => {\r\n const Binary = {\r\n Magic: 0x46546c67,\r\n };\r\n\r\n const magic = dataReader.readUint32();\r\n if (magic !== Binary.Magic) {\r\n throw new RuntimeError(\"Unexpected magic: \" + magic, ErrorCodes.GLTFLoaderUnexpectedMagicError);\r\n }\r\n\r\n const version = dataReader.readUint32();\r\n\r\n if (this.loggingEnabled) {\r\n this._log(`Binary version: ${version}`);\r\n }\r\n\r\n const length = dataReader.readUint32();\r\n if (!this.useRangeRequests && length !== dataReader.buffer.byteLength) {\r\n Logger.Warn(`Length in header does not match actual data length: ${length} != ${dataReader.buffer.byteLength}`);\r\n }\r\n\r\n let unpacked: Promise<IGLTFLoaderData>;\r\n switch (version) {\r\n case 1: {\r\n unpacked = this._unpackBinaryV1Async(dataReader, length);\r\n break;\r\n }\r\n case 2: {\r\n unpacked = this._unpackBinaryV2Async(dataReader, length);\r\n break;\r\n }\r\n default: {\r\n throw new Error(\"Unsupported version: \" + version);\r\n }\r\n }\r\n\r\n this._endPerformanceCounter(\"Unpack Binary\");\r\n\r\n return unpacked;\r\n });\r\n }\r\n\r\n private _unpackBinaryV1Async(dataReader: DataReader, length: number): Promise<IGLTFLoaderData> {\r\n const ContentFormat = {\r\n JSON: 0,\r\n };\r\n\r\n const contentLength = dataReader.readUint32();\r\n const contentFormat = dataReader.readUint32();\r\n\r\n if (contentFormat !== ContentFormat.JSON) {\r\n throw new Error(`Unexpected content format: ${contentFormat}`);\r\n }\r\n\r\n const bodyLength = length - dataReader.byteOffset;\r\n\r\n const data: IGLTFLoaderData = { json: this._parseJson(dataReader.readString(contentLength)), bin: null };\r\n if (bodyLength !== 0) {\r\n const startByteOffset = dataReader.byteOffset;\r\n data.bin = {\r\n readAsync: (byteOffset, byteLength) => dataReader.buffer.readAsync(startByteOffset + byteOffset, byteLength),\r\n byteLength: bodyLength,\r\n };\r\n }\r\n\r\n return Promise.resolve(data);\r\n }\r\n\r\n private _unpackBinaryV2Async(dataReader: DataReader, length: number): Promise<IGLTFLoaderData> {\r\n const ChunkFormat = {\r\n JSON: 0x4e4f534a,\r\n BIN: 0x004e4942,\r\n };\r\n\r\n // Read the JSON chunk header.\r\n const chunkLength = dataReader.readUint32();\r\n const chunkFormat = dataReader.readUint32();\r\n if (chunkFormat !== ChunkFormat.JSON) {\r\n throw new Error(\"First chunk format is not JSON\");\r\n }\r\n\r\n // Bail if there are no other chunks.\r\n if (dataReader.byteOffset + chunkLength === length) {\r\n return dataReader.loadAsync(chunkLength).then(() => {\r\n return { json: this._parseJson(dataReader.readString(chunkLength)), bin: null };\r\n });\r\n }\r\n\r\n // Read the JSON chunk and the length and type of the next chunk.\r\n return dataReader.loadAsync(chunkLength + 8).then(() => {\r\n const data: IGLTFLoaderData = { json: this._parseJson(dataReader.readString(chunkLength)), bin: null };\r\n\r\n const readAsync = (): Promise<IGLTFLoaderData> => {\r\n const chunkLength = dataReader.readUint32();\r\n const chunkFormat = dataReader.readUint32();\r\n\r\n switch (chunkFormat) {\r\n case ChunkFormat.JSON: {\r\n throw new Error(\"Unexpected JSON chunk\");\r\n }\r\n case ChunkFormat.BIN: {\r\n const startByteOffset = dataReader.byteOffset;\r\n data.bin = {\r\n readAsync: (byteOffset, byteLength) => dataReader.buffer.readAsync(startByteOffset + byteOffset, byteLength),\r\n byteLength: chunkLength,\r\n };\r\n dataReader.skipBytes(chunkLength);\r\n break;\r\n }\r\n default: {\r\n // ignore unrecognized chunkFormat\r\n dataReader.skipBytes(chunkLength);\r\n break;\r\n }\r\n }\r\n\r\n if (dataReader.byteOffset !== length) {\r\n return dataReader.loadAsync(8).then(readAsync);\r\n }\r\n\r\n return Promise.resolve(data);\r\n };\r\n\r\n return readAsync();\r\n });\r\n }\r\n\r\n private static _parseVersion(version: string): Nullable<{ major: number; minor: number }> {\r\n if (version === \"1.0\" || version === \"1.0.1\") {\r\n return {\r\n major: 1,\r\n minor: 0,\r\n };\r\n }\r\n\r\n const match = (version + \"\").match(/^(\\d+)\\.(\\d+)/);\r\n if (!match) {\r\n return null;\r\n }\r\n\r\n return {\r\n major: parseInt(match[1]),\r\n minor: parseInt(match[2]),\r\n };\r\n }\r\n\r\n private static _compareVersion(a: { major: number; minor: number }, b: { major: number; minor: number }): number {\r\n if (a.major > b.major) {\r\n return 1;\r\n }\r\n if (a.major < b.major) {\r\n return -1;\r\n }\r\n if (a.minor > b.minor) {\r\n return 1;\r\n }\r\n if (a.minor < b.minor) {\r\n return -1;\r\n }\r\n return 0;\r\n }\r\n\r\n private static readonly _logSpaces = \" \";\r\n private _logIndentLevel = 0;\r\n private _loggingEnabled = false;\r\n\r\n /** @internal */\r\n public _log = this._logDisabled;\r\n\r\n /**\r\n * @internal\r\n */\r\n public _logOpen(message: string): void {\r\n this._log(message);\r\n this._logIndentLevel++;\r\n }\r\n\r\n /** @internal */\r\n public _logClose(): void {\r\n --this._logIndentLevel;\r\n }\r\n\r\n private _logEnabled(message: string): void {\r\n const spaces = GLTFFileLoader._logSpaces.substr(0, this._logIndentLevel * 2);\r\n Logger.Log(`${spaces}${message}`);\r\n }\r\n\r\n private _logDisabled(message: string): void {}\r\n\r\n private _capturePerformanceCounters = false;\r\n\r\n /** @internal */\r\n public _startPerformanceCounter = this._startPerformanceCounterDisabled;\r\n\r\n /** @internal */\r\n public _endPerformanceCounter = this._endPerformanceCounterDisabled;\r\n\r\n private _startPerformanceCounterEnabled(counterName: string): void {\r\n Tools.StartPerformanceCounter(counterName);\r\n }\r\n\r\n private _startPerformanceCounterDisabled(counterName: string): void {}\r\n\r\n private _endPerformanceCounterEnabled(counterName: string): void {\r\n Tools.EndPerformanceCounter(counterName);\r\n }\r\n\r\n private _endPerformanceCounterDisabled(counterName: string): void {}\r\n}\r\n\r\nif (SceneLoader) {\r\n SceneLoader.RegisterPlugin(new GLTFFileLoader());\r\n}\r\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"glTFValidation.js","sourceRoot":"","sources":["../../../../lts/loaders/generated/glTF/glTFValidation.ts"],"names":[],"mappings":"A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C;IACxD,GAAG,EAAE,iDAAiD;CACzD,CAAC","sourcesContent":["import type * as GLTF2 from \"babylonjs-gltf2interface\";\r\nimport { Tools } from \"core/Misc/tools\";\r\n\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\ndeclare let GLTFValidator: GLTF2.IGLTFValidator;\r\n\r\n// WorkerGlobalScope\r\ndeclare function importScripts(...urls: string[]): void;\r\ndeclare function postMessage(message: any, transfer?: any[]): void;\r\n\r\nfunction validateAsync(\r\n data: string | ArrayBuffer,\r\n rootUrl: string,\r\n fileName: string,\r\n getExternalResource: (uri: string) => Promise<ArrayBuffer>\r\n): Promise<GLTF2.IGLTFValidationResults> {\r\n const options: GLTF2.IGLTFValidationOptions = {\r\n externalResourceFunction: (uri) => getExternalResource(uri).then((value) => new Uint8Array(value)),\r\n };\r\n\r\n if (fileName) {\r\n options.uri = rootUrl === \"file:\" ? fileName : rootUrl + fileName;\r\n }\r\n\r\n return data instanceof ArrayBuffer ? GLTFValidator.validateBytes(new Uint8Array(data), options) : GLTFValidator.validateString(data, options);\r\n}\r\n\r\n/**\r\n * The worker function that gets converted to a blob url to pass into a worker.\r\n */\r\nfunction workerFunc(): void {\r\n const pendingExternalResources: Array<{ resolve: (data: any) => void; reject: (reason: any) => void }> = [];\r\n\r\n onmessage = (message) => {\r\n const data = message.data;\r\n switch (data.id) {\r\n case \"init\": {\r\n importScripts(data.url);\r\n break;\r\n }\r\n case \"validate\": {\r\n validateAsync(\r\n data.data,\r\n data.rootUrl,\r\n data.fileName,\r\n (uri) =>\r\n new Promise((resolve, reject) => {\r\n const index = pendingExternalResources.length;\r\n pendingExternalResources.push({ resolve, reject });\r\n postMessage({ id: \"getExternalResource\", index: index, uri: uri });\r\n })\r\n ).then(\r\n (value) => {\r\n postMessage({ id: \"validate.resolve\", value: value });\r\n },\r\n (reason) => {\r\n postMessage({ id: \"validate.reject\", reason: reason });\r\n }\r\n );\r\n break;\r\n }\r\n case \"getExternalResource.resolve\": {\r\n pendingExternalResources[data.index].resolve(data.value);\r\n break;\r\n }\r\n case \"getExternalResource.reject\": {\r\n pendingExternalResources[data.index].reject(data.reason);\r\n break;\r\n }\r\n }\r\n };\r\n}\r\n\r\n/**\r\n * Configuration for glTF validation\r\n */\r\nexport interface IGLTFValidationConfiguration {\r\n /**\r\n * The url of the glTF validator.\r\n */\r\n url: string;\r\n}\r\n\r\n/**\r\n * glTF validation\r\n */\r\nexport class GLTFValidation {\r\n /**\r\n * The configuration. Defaults to `{ url: \"https://preview.babylonjs.com/gltf_validator.js\" }`.\r\n */\r\n public static Configuration: IGLTFValidationConfiguration = {\r\n url: \"https://preview.babylonjs.com/gltf_validator.js\",\r\n };\r\n\r\n private static _LoadScriptPromise: Promise<void>;\r\n\r\n /**\r\n * Validate a glTF asset using the glTF-Validator.\r\n * @param data The JSON of a glTF or the array buffer of a binary glTF\r\n * @param rootUrl The root url for the glTF\r\n * @param fileName The file name for the glTF\r\n * @param getExternalResource The callback to get external resources for the glTF validator\r\n * @returns A promise that resolves with the glTF validation results once complete\r\n */\r\n public static ValidateAsync(\r\n data: string | ArrayBufferView,\r\n rootUrl: string,\r\n fileName: string,\r\n getExternalResource: (uri: string) => Promise<ArrayBuffer>\r\n ): Promise<GLTF2.IGLTFValidationResults> {\r\n const dataCopy = ArrayBuffer.isView(data) ? (data as Uint8Array).slice().buffer : (data as string);\r\n\r\n if (typeof Worker === \"function\") {\r\n return new Promise((resolve, reject) => {\r\n const workerContent = `${validateAsync}(${workerFunc})()`;\r\n const workerBlobUrl = URL.createObjectURL(new Blob([workerContent], { type: \"application/javascript\" }));\r\n const worker = new Worker(workerBlobUrl);\r\n\r\n const onError = (error: ErrorEvent) => {\r\n worker.removeEventListener(\"error\", onError);\r\n worker.removeEventListener(\"message\", onMessage);\r\n reject(error);\r\n };\r\n\r\n const onMessage = (message: MessageEvent) => {\r\n const data = message.data;\r\n switch (data.id) {\r\n case \"getExternalResource\": {\r\n getExternalResource(data.uri).then(\r\n (value) => {\r\n worker.postMessage({ id: \"getExternalResource.resolve\", index: data.index, value: value }, [value]);\r\n },\r\n (reason) => {\r\n worker.postMessage({ id: \"getExternalResource.reject\", index: data.index, reason: reason });\r\n }\r\n );\r\n break;\r\n }\r\n case \"validate.resolve\": {\r\n worker.removeEventListener(\"error\", onError);\r\n worker.removeEventListener(\"message\", onMessage);\r\n resolve(data.value);\r\n worker.terminate();\r\n break;\r\n }\r\n case \"validate.reject\": {\r\n worker.removeEventListener(\"error\", onError);\r\n worker.removeEventListener(\"message\", onMessage);\r\n reject(data.reason);\r\n worker.terminate();\r\n }\r\n }\r\n };\r\n\r\n worker.addEventListener(\"error\", onError);\r\n worker.addEventListener(\"message\", onMessage);\r\n\r\n worker.postMessage({ id: \"init\", url: this.Configuration.url });\r\n worker.postMessage({ id: \"validate\", data: dataCopy, rootUrl: rootUrl, fileName: fileName });\r\n });\r\n } else {\r\n if (!this._LoadScriptPromise) {\r\n this._LoadScriptPromise = Tools.LoadScriptAsync(this.Configuration.url);\r\n }\r\n\r\n return this._LoadScriptPromise.then(() => {\r\n return validateAsync(dataCopy, rootUrl, fileName, getExternalResource);\r\n });\r\n }\r\n }\r\n}\r\n"]}
|
1
|
+
{"version":3,"file":"glTFValidation.js","sourceRoot":"","sources":["../../../../dev/loaders/src/glTF/glTFValidation.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,sCAAwB;AASxC,SAAS,aAAa,CAClB,IAA0B,EAC1B,OAAe,EACf,QAAgB,EAChB,mBAA0D;IAE1D,MAAM,OAAO,GAAiC;QAC1C,wBAAwB,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,mBAAmB,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,UAAU,CAAC,KAAK,CAAC,CAAC;KACrG,CAAC;IAEF,IAAI,QAAQ,EAAE;QACV,OAAO,CAAC,GAAG,GAAG,OAAO,KAAK,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,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L,CAAC,CAAC;gBAEF,MAAM,CAAC,gBAAgB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;gBAC1C,MAAM,CAAC,gBAAgB,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;gBAE9C,MAAM,CAAC,WAAW,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,CAAC,aAAa,CAAC,GAAG,EAAE,CAAC,CAAC;gBAChE,MAAM,CAAC,WAAW,CAAC,EAAE,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC,CAAC;YACjG,CAAC,CAAC,CAAC;SACN;aAAM;YACH,IAAI,CAAC,IAAI,CAAC,kBAAkB,EAAE;gBAC1B,IAAI,CAAC,kBAAkB,GAAG,KAAK,CAAC,eAAe,CAAC,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;aAC3E;YAED,OAAO,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,GAAG,EAAE;gBACrC,OAAO,aAAa,CAAC,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,mBAAmB,CAAC,CAAC;YAC3E,CAAC,CAAC,CAAC;SACN;IACL,CAAC;;AAlFD;;GAEG;AACW,4BAAa,GAAiC;IACxD,GAAG,EAAE,iDAAiD;CACzD,CAAC","sourcesContent":["import type * as GLTF2 from \"babylonjs-gltf2interface\";\r\nimport { Tools } from \"core/Misc/tools\";\r\n\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\ndeclare let GLTFValidator: GLTF2.IGLTFValidator;\r\n\r\n// WorkerGlobalScope\r\ndeclare function importScripts(...urls: string[]): void;\r\ndeclare function postMessage(message: any, transfer?: any[]): void;\r\n\r\nfunction validateAsync(\r\n data: string | ArrayBuffer,\r\n rootUrl: string,\r\n fileName: string,\r\n getExternalResource: (uri: string) => Promise<ArrayBuffer>\r\n): Promise<GLTF2.IGLTFValidationResults> {\r\n const options: GLTF2.IGLTFValidationOptions = {\r\n externalResourceFunction: (uri) => getExternalResource(uri).then((value) => new Uint8Array(value)),\r\n };\r\n\r\n if (fileName) {\r\n options.uri = rootUrl === \"file:\" ? fileName : rootUrl + fileName;\r\n }\r\n\r\n return data instanceof ArrayBuffer ? GLTFValidator.validateBytes(new Uint8Array(data), options) : GLTFValidator.validateString(data, options);\r\n}\r\n\r\n/**\r\n * The worker function that gets converted to a blob url to pass into a worker.\r\n */\r\nfunction workerFunc(): void {\r\n const pendingExternalResources: Array<{ resolve: (data: any) => void; reject: (reason: any) => void }> = [];\r\n\r\n onmessage = (message) => {\r\n const data = message.data;\r\n switch (data.id) {\r\n case \"init\": {\r\n importScripts(data.url);\r\n break;\r\n }\r\n case \"validate\": {\r\n validateAsync(\r\n data.data,\r\n data.rootUrl,\r\n data.fileName,\r\n (uri) =>\r\n new Promise((resolve, reject) => {\r\n const index = pendingExternalResources.length;\r\n pendingExternalResources.push({ resolve, reject });\r\n postMessage({ id: \"getExternalResource\", index: index, uri: uri });\r\n })\r\n ).then(\r\n (value) => {\r\n postMessage({ id: \"validate.resolve\", value: value });\r\n },\r\n (reason) => {\r\n postMessage({ id: \"validate.reject\", reason: reason });\r\n }\r\n );\r\n break;\r\n }\r\n case \"getExternalResource.resolve\": {\r\n pendingExternalResources[data.index].resolve(data.value);\r\n break;\r\n }\r\n case \"getExternalResource.reject\": {\r\n pendingExternalResources[data.index].reject(data.reason);\r\n break;\r\n }\r\n }\r\n };\r\n}\r\n\r\n/**\r\n * Configuration for glTF validation\r\n */\r\nexport interface IGLTFValidationConfiguration {\r\n /**\r\n * The url of the glTF validator.\r\n */\r\n url: string;\r\n}\r\n\r\n/**\r\n * glTF validation\r\n */\r\nexport class GLTFValidation {\r\n /**\r\n * The configuration. Defaults to `{ url: \"https://preview.babylonjs.com/gltf_validator.js\" }`.\r\n */\r\n public static Configuration: IGLTFValidationConfiguration = {\r\n url: \"https://preview.babylonjs.com/gltf_validator.js\",\r\n };\r\n\r\n private static _LoadScriptPromise: Promise<void>;\r\n\r\n /**\r\n * Validate a glTF asset using the glTF-Validator.\r\n * @param data The JSON of a glTF or the array buffer of a binary glTF\r\n * @param rootUrl The root url for the glTF\r\n * @param fileName The file name for the glTF\r\n * @param getExternalResource The callback to get external resources for the glTF validator\r\n * @returns A promise that resolves with the glTF validation results once complete\r\n */\r\n public static ValidateAsync(\r\n data: string | ArrayBufferView,\r\n rootUrl: string,\r\n fileName: string,\r\n getExternalResource: (uri: string) => Promise<ArrayBuffer>\r\n ): Promise<GLTF2.IGLTFValidationResults> {\r\n const dataCopy = ArrayBuffer.isView(data) ? (data as Uint8Array).slice().buffer : (data as string);\r\n\r\n if (typeof Worker === \"function\") {\r\n return new Promise((resolve, reject) => {\r\n const workerContent = `${validateAsync}(${workerFunc})()`;\r\n const workerBlobUrl = URL.createObjectURL(new Blob([workerContent], { type: \"application/javascript\" }));\r\n const worker = new Worker(workerBlobUrl);\r\n\r\n const onError = (error: ErrorEvent) => {\r\n worker.removeEventListener(\"error\", onError);\r\n worker.removeEventListener(\"message\", onMessage);\r\n reject(error);\r\n };\r\n\r\n const onMessage = (message: MessageEvent) => {\r\n const data = message.data;\r\n switch (data.id) {\r\n case \"getExternalResource\": {\r\n getExternalResource(data.uri).then(\r\n (value) => {\r\n worker.postMessage({ id: \"getExternalResource.resolve\", index: data.index, value: value }, [value]);\r\n },\r\n (reason) => {\r\n worker.postMessage({ id: \"getExternalResource.reject\", index: data.index, reason: reason });\r\n }\r\n );\r\n break;\r\n }\r\n case \"validate.resolve\": {\r\n worker.removeEventListener(\"error\", onError);\r\n worker.removeEventListener(\"message\", onMessage);\r\n resolve(data.value);\r\n worker.terminate();\r\n break;\r\n }\r\n case \"validate.reject\": {\r\n worker.removeEventListener(\"error\", onError);\r\n worker.removeEventListener(\"message\", onMessage);\r\n reject(data.reason);\r\n worker.terminate();\r\n }\r\n }\r\n };\r\n\r\n worker.addEventListener(\"error\", onError);\r\n worker.addEventListener(\"message\", onMessage);\r\n\r\n worker.postMessage({ id: \"init\", url: this.Configuration.url });\r\n worker.postMessage({ id: \"validate\", data: dataCopy, rootUrl: rootUrl, fileName: fileName });\r\n });\r\n } else {\r\n if (!this._LoadScriptPromise) {\r\n this._LoadScriptPromise = Tools.LoadScriptAsync(this.Configuration.url);\r\n }\r\n\r\n return this._LoadScriptPromise.then(() => {\r\n return validateAsync(dataCopy, rootUrl, fileName, getExternalResource);\r\n });\r\n }\r\n }\r\n}\r\n"]}
|
package/glTF/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../dev/loaders/src/glTF/index.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,OAAO,KAAK,KAAK,MAAM,aAAa,CAAC;AACrC,OAAO,KAAK,KAAK,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC","sourcesContent":["/* eslint-disable import/no-internal-modules */\r\nexport * from \"./glTFFileLoader\";\r\nexport * from \"./glTFValidation\";\r\nimport * as GLTF1 from \"./1.0/index\";\r\nimport * as GLTF2 from \"./2.0/index\";\r\nexport { GLTF1, GLTF2 };\r\n"]}
|
package/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../dev/loaders/src/index.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC","sourcesContent":["/* eslint-disable import/no-internal-modules */\r\nexport * from \"./glTF/index\";\r\nexport * from \"./OBJ/index\";\r\nexport * from \"./STL/index\";\r\n"]}
|
package/legacy/legacy-glTF.d.ts
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
export * from "../glTF/glTFFileLoader";
|
2
|
-
export * from "../glTF/glTFValidation";
|
1
|
+
export * from "../glTF/glTFFileLoader.js";
|
2
|
+
export * from "../glTF/glTFValidation.js";
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"legacy-glTF.js","sourceRoot":"","sources":["../../../../lts/loaders/
|
1
|
+
{"version":3,"file":"legacy-glTF.js","sourceRoot":"","sources":["../../../../lts/loaders/src/legacy/legacy-glTF.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,UAAU,kCAAoC;AAC1D,OAAO,KAAK,UAAU,kCAAoC;AAE1D;;;GAGG;AACH,MAAM,YAAY,GAAG,OAAO,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;AACjH,IAAI,OAAO,YAAY,KAAK,WAAW,EAAE;IAC/B,YAAa,CAAC,OAAO,GAAS,YAAa,CAAC,OAAO,IAAI,EAAE,CAAC;IAChE,KAAK,MAAM,GAAG,IAAI,UAAU,EAAE;QACpB,YAAa,CAAC,OAAO,CAAC,GAAG,CAAC,GAAS,UAAW,CAAC,GAAG,CAAC,CAAC;KAC7D;IACD,KAAK,MAAM,GAAG,IAAI,UAAU,EAAE;QACpB,YAAa,CAAC,OAAO,CAAC,GAAG,CAAC,GAAS,UAAW,CAAC,GAAG,CAAC,CAAC;KAC7D;CACJ;AAED,0CAA4C;AAC5C,0CAA4C","sourcesContent":["import * as FileLoader from \"loaders/glTF/glTFFileLoader\";\r\nimport * as Validation from \"loaders/glTF/glTFValidation\";\r\n\r\n/**\r\n * This is the entry point for the UMD module.\r\n * The entry point for a future ESM package should be index.ts\r\n */\r\nconst globalObject = typeof global !== \"undefined\" ? global : typeof window !== \"undefined\" ? window : undefined;\r\nif (typeof globalObject !== \"undefined\") {\r\n (<any>globalObject).BABYLON = (<any>globalObject).BABYLON || {};\r\n for (const key in FileLoader) {\r\n (<any>globalObject).BABYLON[key] = (<any>FileLoader)[key];\r\n }\r\n for (const key in Validation) {\r\n (<any>globalObject).BABYLON[key] = (<any>Validation)[key];\r\n }\r\n}\r\n\r\nexport * from \"loaders/glTF/glTFFileLoader\";\r\nexport * from \"loaders/glTF/glTFValidation\";\r\n"]}
|
package/legacy/legacy-glTF1.d.ts
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
import * as GLTF1 from "../glTF/1.0/index";
|
1
|
+
import * as GLTF1 from "../glTF/1.0/index.js";
|
2
2
|
export { GLTF1 };
|