@babylonjs/loaders 5.25.0 → 5.26.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/glTF/2.0/Extensions/KHR_animation_pointer.d.ts +12 -31
- package/glTF/2.0/Extensions/KHR_animation_pointer.data.d.ts +133 -0
- package/glTF/2.0/Extensions/KHR_animation_pointer.data.js +169 -0
- package/glTF/2.0/Extensions/KHR_animation_pointer.data.js.map +1 -0
- package/glTF/2.0/Extensions/KHR_animation_pointer.js +54 -204
- package/glTF/2.0/Extensions/KHR_animation_pointer.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_lights_punctual.js +2 -1
- package/glTF/2.0/Extensions/KHR_lights_punctual.js.map +1 -1
- package/glTF/2.0/glTFLoader.d.ts +42 -8
- package/glTF/2.0/glTFLoader.js +204 -47
- package/glTF/2.0/glTFLoader.js.map +1 -1
- package/glTF/2.0/glTFLoaderAnimation.d.ts +29 -0
- package/glTF/2.0/glTFLoaderAnimation.js +66 -0
- package/glTF/2.0/glTFLoaderAnimation.js.map +1 -0
- package/glTF/2.0/glTFLoaderExtension.d.ts +14 -1
- package/glTF/2.0/glTFLoaderExtension.js.map +1 -1
- package/glTF/2.0/glTFLoaderInterfaces.d.ts +38 -11
- package/glTF/2.0/glTFLoaderInterfaces.js.map +1 -1
- package/package.json +3 -3
- package/glTF/2.0/Extensions/KHR_animation_pointer.map.d.ts +0 -15
- package/glTF/2.0/Extensions/KHR_animation_pointer.map.js +0 -454
- package/glTF/2.0/Extensions/KHR_animation_pointer.map.js.map +0 -1
- package/glTF/2.0/glTFUtilities.d.ts +0 -7
- package/glTF/2.0/glTFUtilities.js +0 -23
- package/glTF/2.0/glTFUtilities.js.map +0 -1
@@ -0,0 +1,29 @@
|
|
1
|
+
import { Animation } from "@babylonjs/core/Animations/animation.js";
|
2
|
+
import { Quaternion, Vector3 } from "@babylonjs/core/Maths/math.vector.js";
|
3
|
+
import type { INode } from "./glTFLoaderInterfaces";
|
4
|
+
import type { IAnimatable } from "@babylonjs/core/Animations/animatable.interface.js";
|
5
|
+
export declare type GetValueFn = (target: any, source: Float32Array, offset: number, scale: number) => any;
|
6
|
+
export declare function getVector3(_target: any, source: Float32Array, offset: number, scale: number): Vector3;
|
7
|
+
export declare function getQuaternion(_target: any, source: Float32Array, offset: number, scale: number): Quaternion;
|
8
|
+
export declare function getWeights(target: INode, source: Float32Array, offset: number, scale: number): Array<number>;
|
9
|
+
export declare abstract class AnimationPropertyInfo {
|
10
|
+
readonly type: number;
|
11
|
+
readonly name: string;
|
12
|
+
readonly getValue: GetValueFn;
|
13
|
+
readonly getStride: (target: any) => number;
|
14
|
+
constructor(type: number, name: string, getValue: GetValueFn, getStride: (target: any) => number);
|
15
|
+
protected _buildAnimation(name: string, fps: number, keys: any[]): Animation;
|
16
|
+
abstract buildAnimations(target: any, name: string, fps: number, keys: any[], callback: (babylonAnimatable: IAnimatable, babylonAnimation: Animation) => void): void;
|
17
|
+
}
|
18
|
+
export declare class TransformNodeAnimationPropertyInfo extends AnimationPropertyInfo {
|
19
|
+
buildAnimations(target: INode, name: string, fps: number, keys: any[], callback: (babylonAnimatable: IAnimatable, babylonAnimation: Animation) => void): void;
|
20
|
+
}
|
21
|
+
export declare class WeightAnimationPropertyInfo extends AnimationPropertyInfo {
|
22
|
+
buildAnimations(target: INode, name: string, fps: number, keys: any[], callback: (babylonAnimatable: IAnimatable, babylonAnimation: Animation) => void): void;
|
23
|
+
}
|
24
|
+
export declare const nodeAnimationData: {
|
25
|
+
translation: TransformNodeAnimationPropertyInfo[];
|
26
|
+
rotation: TransformNodeAnimationPropertyInfo[];
|
27
|
+
scale: TransformNodeAnimationPropertyInfo[];
|
28
|
+
weights: WeightAnimationPropertyInfo[];
|
29
|
+
};
|
@@ -0,0 +1,66 @@
|
|
1
|
+
import { Animation } from "@babylonjs/core/Animations/animation.js";
|
2
|
+
import { Quaternion, Vector3 } from "@babylonjs/core/Maths/math.vector.js";
|
3
|
+
export function getVector3(_target, source, offset, scale) {
|
4
|
+
return Vector3.FromArray(source, offset).scaleInPlace(scale);
|
5
|
+
}
|
6
|
+
export function getQuaternion(_target, source, offset, scale) {
|
7
|
+
return Quaternion.FromArray(source, offset).scaleInPlace(scale);
|
8
|
+
}
|
9
|
+
export function getWeights(target, source, offset, scale) {
|
10
|
+
const value = new Array(target._numMorphTargets);
|
11
|
+
for (let i = 0; i < value.length; i++) {
|
12
|
+
value[i] = source[offset++] * scale;
|
13
|
+
}
|
14
|
+
return value;
|
15
|
+
}
|
16
|
+
export class AnimationPropertyInfo {
|
17
|
+
constructor(type, name, getValue, getStride) {
|
18
|
+
this.type = type;
|
19
|
+
this.name = name;
|
20
|
+
this.getValue = getValue;
|
21
|
+
this.getStride = getStride;
|
22
|
+
}
|
23
|
+
_buildAnimation(name, fps, keys) {
|
24
|
+
const babylonAnimation = new Animation(name, this.name, fps, this.type);
|
25
|
+
babylonAnimation.setKeys(keys);
|
26
|
+
return babylonAnimation;
|
27
|
+
}
|
28
|
+
}
|
29
|
+
export class TransformNodeAnimationPropertyInfo extends AnimationPropertyInfo {
|
30
|
+
buildAnimations(target, name, fps, keys, callback) {
|
31
|
+
callback(target._babylonTransformNode, this._buildAnimation(name, fps, keys));
|
32
|
+
}
|
33
|
+
}
|
34
|
+
export class WeightAnimationPropertyInfo extends AnimationPropertyInfo {
|
35
|
+
buildAnimations(target, name, fps, keys, callback) {
|
36
|
+
if (target._numMorphTargets) {
|
37
|
+
for (let targetIndex = 0; targetIndex < target._numMorphTargets; targetIndex++) {
|
38
|
+
const babylonAnimation = new Animation(`${name}_${targetIndex}`, this.name, fps, this.type);
|
39
|
+
babylonAnimation.setKeys(keys.map((key) => ({
|
40
|
+
frame: key.frame,
|
41
|
+
inTangent: key.inTangent ? key.inTangent[targetIndex] : undefined,
|
42
|
+
value: key.value[targetIndex],
|
43
|
+
outTangent: key.outTangent ? key.outTangent[targetIndex] : undefined,
|
44
|
+
interpolation: key.interpolation,
|
45
|
+
})));
|
46
|
+
if (target._primitiveBabylonMeshes) {
|
47
|
+
for (const babylonMesh of target._primitiveBabylonMeshes) {
|
48
|
+
if (babylonMesh.morphTargetManager) {
|
49
|
+
const morphTarget = babylonMesh.morphTargetManager.getTarget(targetIndex);
|
50
|
+
const babylonAnimationClone = babylonAnimation.clone();
|
51
|
+
morphTarget.animations.push(babylonAnimationClone);
|
52
|
+
callback(morphTarget, babylonAnimationClone);
|
53
|
+
}
|
54
|
+
}
|
55
|
+
}
|
56
|
+
}
|
57
|
+
}
|
58
|
+
}
|
59
|
+
}
|
60
|
+
export const nodeAnimationData = {
|
61
|
+
translation: [new TransformNodeAnimationPropertyInfo(Animation.ANIMATIONTYPE_VECTOR3, "position", getVector3, () => 3)],
|
62
|
+
rotation: [new TransformNodeAnimationPropertyInfo(Animation.ANIMATIONTYPE_QUATERNION, "rotationQuaternion", getQuaternion, () => 4)],
|
63
|
+
scale: [new TransformNodeAnimationPropertyInfo(Animation.ANIMATIONTYPE_VECTOR3, "scaling", getVector3, () => 3)],
|
64
|
+
weights: [new WeightAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, "influence", getWeights, (target) => target._numMorphTargets)],
|
65
|
+
};
|
66
|
+
//# sourceMappingURL=glTFLoaderAnimation.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"glTFLoaderAnimation.js","sourceRoot":"","sources":["../../../../../../lts/loaders/generated/glTF/2.0/glTFLoaderAnimation.ts"],"names":[],"mappings":"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","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\nexport type GetValueFn = (target: any, source: Float32Array, offset: number, scale: number) => any;\r\n\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\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\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\nexport abstract class AnimationPropertyInfo {\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 public abstract buildAnimations(target: any, name: string, fps: number, keys: any[], callback: (babylonAnimatable: IAnimatable, babylonAnimation: Animation) => void): void;\r\n}\r\n\r\nexport class TransformNodeAnimationPropertyInfo extends AnimationPropertyInfo {\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\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\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,4 +1,5 @@
|
|
1
1
|
import type { Nullable } from "@babylonjs/core/types.js";
|
2
|
+
import type { Animation } from "@babylonjs/core/Animations/animation.js";
|
2
3
|
import type { AnimationGroup } from "@babylonjs/core/Animations/animationGroup.js";
|
3
4
|
import type { Material } from "@babylonjs/core/Materials/material.js";
|
4
5
|
import type { Camera } from "@babylonjs/core/Cameras/camera.js";
|
@@ -8,9 +9,10 @@ import type { BaseTexture } from "@babylonjs/core/Materials/Textures/baseTexture
|
|
8
9
|
import type { Mesh } from "@babylonjs/core/Meshes/mesh.js";
|
9
10
|
import type { AbstractMesh } from "@babylonjs/core/Meshes/abstractMesh.js";
|
10
11
|
import type { IDisposable } from "@babylonjs/core/scene.js";
|
11
|
-
import type { IScene, INode, IMesh, ISkin, ICamera, IMeshPrimitive, IMaterial, ITextureInfo, IAnimation, ITexture, IBufferView, IBuffer } from "./glTFLoaderInterfaces";
|
12
|
+
import type { IScene, INode, IMesh, ISkin, ICamera, IMeshPrimitive, IMaterial, ITextureInfo, IAnimation, ITexture, IBufferView, IBuffer, IAnimationChannel } from "./glTFLoaderInterfaces";
|
12
13
|
import type { IGLTFLoaderExtension as IGLTFBaseLoaderExtension } from "../glTFFileLoader";
|
13
14
|
import type { IProperty } from "babylonjs-gltf2interface";
|
15
|
+
import type { IAnimatable } from "@babylonjs/core/Animations/animatable.interface.js";
|
14
16
|
/**
|
15
17
|
* Interface for a glTF loader extension.
|
16
18
|
*/
|
@@ -115,6 +117,17 @@ export interface IGLTFLoaderExtension extends IGLTFBaseLoaderExtension, IDisposa
|
|
115
117
|
* @returns A promise that resolves with the loaded Babylon animation group when the load is complete or null if not handled
|
116
118
|
*/
|
117
119
|
loadAnimationAsync?(context: string, animation: IAnimation): Nullable<Promise<AnimationGroup>>;
|
120
|
+
/**
|
121
|
+
* @internal
|
122
|
+
* Define this method to modify the default behvaior when loading animation channels.
|
123
|
+
* @param context The context when loading the asset
|
124
|
+
* @param animationContext The context of the animation when loading the asset
|
125
|
+
* @param animation The glTF animation property
|
126
|
+
* @param channel The glTF animation channel property
|
127
|
+
* @param onLoad Called for each animation loaded
|
128
|
+
* @returns A void promise that resolves when the load is complete or null if not handled
|
129
|
+
*/
|
130
|
+
_loadAnimationChannelAsync?(context: string, animationContext: string, animation: IAnimation, channel: IAnimationChannel, onLoad: (babylonAnimatable: IAnimatable, babylonAnimation: Animation) => void): Nullable<Promise<void>>;
|
118
131
|
/**
|
119
132
|
* @internal
|
120
133
|
* Define this method to modify the default behavior when loading skins.
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"glTFLoaderExtension.js","sourceRoot":"","sources":["../../../../../../lts/loaders/generated/glTF/2.0/glTFLoaderExtension.ts"],"names":[],"mappings":"","sourcesContent":["import type { Nullable } from \"core/types\";\r\nimport type { AnimationGroup } from \"core/Animations/animationGroup\";\r\nimport type { Material } from \"core/Materials/material\";\r\nimport type { Camera } from \"core/Cameras/camera\";\r\nimport type { Geometry } from \"core/Meshes/geometry\";\r\nimport type { TransformNode } from \"core/Meshes/transformNode\";\r\nimport type { BaseTexture } from \"core/Materials/Textures/baseTexture\";\r\nimport type { Mesh } from \"core/Meshes/mesh\";\r\nimport type { AbstractMesh } from \"core/Meshes/abstractMesh\";\r\nimport type { IDisposable } from \"core/scene\";\r\nimport type { IScene, INode, IMesh, ISkin, ICamera, IMeshPrimitive, IMaterial, ITextureInfo, IAnimation, ITexture, IBufferView, IBuffer } from \"./glTFLoaderInterfaces\";\r\nimport type { IGLTFLoaderExtension as IGLTFBaseLoaderExtension } from \"../glTFFileLoader\";\r\nimport type { IProperty } from \"babylonjs-gltf2interface\";\r\n\r\n/**\r\n * Interface for a glTF loader extension.\r\n */\r\nexport interface IGLTFLoaderExtension extends IGLTFBaseLoaderExtension, IDisposable {\r\n /**\r\n * Called after the loader state changes to LOADING.\r\n */\r\n onLoading?(): void;\r\n\r\n /**\r\n * Called after the loader state changes to READY.\r\n */\r\n onReady?(): void;\r\n\r\n /**\r\n * Define this method to modify the default behavior when loading scenes.\r\n * @param context The context when loading the asset\r\n * @param scene The glTF scene property\r\n * @returns A promise that resolves when the load is complete or null if not handled\r\n */\r\n loadSceneAsync?(context: string, scene: IScene): Nullable<Promise<void>>;\r\n\r\n /**\r\n * Define this method to modify the default behavior when loading nodes.\r\n * @param context The context when loading the asset\r\n * @param node The glTF node property\r\n * @param assign A function called synchronously after parsing the glTF properties\r\n * @returns A promise that resolves with the loaded Babylon transform node when the load is complete or null if not handled\r\n */\r\n loadNodeAsync?(context: string, node: INode, assign: (babylonMesh: TransformNode) => void): Nullable<Promise<TransformNode>>;\r\n\r\n /**\r\n * Define this method to modify the default behavior when loading cameras.\r\n * @param context The context when loading the asset\r\n * @param camera The glTF camera property\r\n * @param assign A function called synchronously after parsing the glTF properties\r\n * @returns A promise that resolves with the loaded Babylon camera when the load is complete or null if not handled\r\n */\r\n loadCameraAsync?(context: string, camera: ICamera, assign: (babylonCamera: Camera) => void): Nullable<Promise<Camera>>;\r\n\r\n /**\r\n * @internal\r\n * Define this method to modify the default behavior when loading vertex data for mesh primitives.\r\n * @param context The context when loading the asset\r\n * @param primitive The glTF mesh primitive property\r\n * @returns A promise that resolves with the loaded geometry when the load is complete or null if not handled\r\n */\r\n _loadVertexDataAsync?(context: string, primitive: IMeshPrimitive, babylonMesh: Mesh): Nullable<Promise<Geometry>>;\r\n\r\n /**\r\n * @internal\r\n * Define this method to modify the default behavior when loading data for mesh primitives.\r\n * @param context The context when loading the asset\r\n * @param name The mesh name when loading the asset\r\n * @param node The glTF node when loading the asset\r\n * @param mesh The glTF mesh when loading the asset\r\n * @param primitive The glTF mesh primitive property\r\n * @param assign A function called synchronously after parsing the glTF properties\r\n * @returns A promise that resolves with the loaded mesh when the load is complete or null if not handled\r\n */\r\n _loadMeshPrimitiveAsync?(\r\n context: string,\r\n name: string,\r\n node: INode,\r\n mesh: IMesh,\r\n primitive: IMeshPrimitive,\r\n assign: (babylonMesh: AbstractMesh) => void\r\n ): Nullable<Promise<AbstractMesh>>;\r\n\r\n /**\r\n * @internal\r\n * Define this method to modify the default behavior when loading materials. Load material creates the material and then loads material properties.\r\n * @param context The context when loading the asset\r\n * @param material The glTF material property\r\n * @param assign A function called synchronously after parsing the glTF properties\r\n * @returns A promise that resolves with the loaded Babylon material when the load is complete or null if not handled\r\n */\r\n _loadMaterialAsync?(\r\n context: string,\r\n material: IMaterial,\r\n babylonMesh: Nullable<Mesh>,\r\n babylonDrawMode: number,\r\n assign: (babylonMaterial: Material) => void\r\n ): Nullable<Promise<Material>>;\r\n\r\n /**\r\n * Define this method to modify the default behavior when creating materials.\r\n * @param context The context when loading the asset\r\n * @param material The glTF material property\r\n * @param babylonDrawMode The draw mode for the Babylon material\r\n * @returns The Babylon material or null if not handled\r\n */\r\n createMaterial?(context: string, material: IMaterial, babylonDrawMode: number): Nullable<Material>;\r\n\r\n /**\r\n * Define this method to modify the default behavior when loading material properties.\r\n * @param context The context when loading the asset\r\n * @param material The glTF material property\r\n * @param babylonMaterial The Babylon material\r\n * @returns A promise that resolves when the load is complete or null if not handled\r\n */\r\n loadMaterialPropertiesAsync?(context: string, material: IMaterial, babylonMaterial: Material): Nullable<Promise<void>>;\r\n\r\n /**\r\n * Define this method to modify the default behavior when loading texture infos.\r\n * @param context The context when loading the asset\r\n * @param textureInfo The glTF texture info property\r\n * @param assign A function called synchronously after parsing the glTF properties\r\n * @returns A promise that resolves with the loaded Babylon texture when the load is complete or null if not handled\r\n */\r\n loadTextureInfoAsync?(context: string, textureInfo: ITextureInfo, assign: (babylonTexture: BaseTexture) => void): Nullable<Promise<BaseTexture>>;\r\n\r\n /**\r\n * @internal\r\n * Define this method to modify the default behavior when loading textures.\r\n * @param context The context when loading the asset\r\n * @param texture The glTF texture property\r\n * @param assign A function called synchronously after parsing the glTF properties\r\n * @returns A promise that resolves with the loaded Babylon texture when the load is complete or null if not handled\r\n */\r\n _loadTextureAsync?(context: string, texture: ITexture, assign: (babylonTexture: BaseTexture) => void): Nullable<Promise<BaseTexture>>;\r\n\r\n /**\r\n * Define this method to modify the default behavior when loading animations.\r\n * @param context The context when loading the asset\r\n * @param animation The glTF animation property\r\n * @returns A promise that resolves with the loaded Babylon animation group when the load is complete or null if not handled\r\n */\r\n loadAnimationAsync?(context: string, animation: IAnimation): Nullable<Promise<AnimationGroup>>;\r\n\r\n /**\r\n * @internal\r\n * Define this method to modify the default behavior when loading skins.\r\n * @param context The context when loading the asset\r\n * @param node The glTF node property\r\n * @param skin The glTF skin property\r\n * @returns A promise that resolves when the load is complete or null if not handled\r\n */\r\n _loadSkinAsync?(context: string, node: INode, skin: ISkin): Nullable<Promise<void>>;\r\n\r\n /**\r\n * @internal\r\n * Define this method to modify the default behavior when loading uris.\r\n * @param context The context when loading the asset\r\n * @param property The glTF property associated with the uri\r\n * @param uri The uri to load\r\n * @returns A promise that resolves with the loaded data when the load is complete or null if not handled\r\n */\r\n _loadUriAsync?(context: string, property: IProperty, uri: string): Nullable<Promise<ArrayBufferView>>;\r\n\r\n /**\r\n * Define this method to modify the default behavior when loading buffer views.\r\n * @param context The context when loading the asset\r\n * @param bufferView The glTF buffer view property\r\n * @returns A promise that resolves with the loaded data when the load is complete or null if not handled\r\n */\r\n loadBufferViewAsync?(context: string, bufferView: IBufferView): Nullable<Promise<ArrayBufferView>>;\r\n\r\n /**\r\n * Define this method to modify the default behavior when loading buffers.\r\n * @param context The context when loading the asset\r\n * @param buffer The glTF buffer property\r\n * @param byteOffset The byte offset to load\r\n * @param byteLength The byte length to load\r\n * @returns A promise that resolves with the loaded data when the load is complete or null if not handled\r\n */\r\n loadBufferAsync?(context: string, buffer: IBuffer, byteOffset: number, byteLength: number): Nullable<Promise<ArrayBufferView>>;\r\n}\r\n"]}
|
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"]}
|
@@ -35,8 +35,11 @@ export interface IAnimationChannel extends GLTF2.IAnimationChannel, IArrayItem {
|
|
35
35
|
}
|
36
36
|
/** @internal */
|
37
37
|
export interface _IAnimationSamplerData {
|
38
|
+
/** @internal */
|
38
39
|
input: Float32Array;
|
40
|
+
/** @internal */
|
39
41
|
interpolation: GLTF2.AnimationSamplerInterpolation;
|
42
|
+
/** @internal */
|
40
43
|
output: Float32Array;
|
41
44
|
}
|
42
45
|
/**
|
@@ -50,7 +53,9 @@ export interface IAnimationSampler extends GLTF2.IAnimationSampler, IArrayItem {
|
|
50
53
|
* Loader interface with additional members.
|
51
54
|
*/
|
52
55
|
export interface IAnimation extends GLTF2.IAnimation, IArrayItem {
|
56
|
+
/** @internal */
|
53
57
|
channels: IAnimationChannel[];
|
58
|
+
/** @internal */
|
54
59
|
samplers: IAnimationSampler[];
|
55
60
|
/** @internal */
|
56
61
|
_babylonAnimationGroup?: AnimationGroup;
|
@@ -71,19 +76,12 @@ export interface IBufferView extends GLTF2.IBufferView, IArrayItem {
|
|
71
76
|
/** @internal */
|
72
77
|
_babylonBuffer?: Promise<Buffer>;
|
73
78
|
}
|
74
|
-
/**
|
75
|
-
* Loader interface with additional members.
|
76
|
-
*/
|
77
|
-
export interface IKHRLight extends GLTF2.IKHRLightsPunctual_Light {
|
78
|
-
/** @internal */
|
79
|
-
_babylonLight: Light;
|
80
|
-
}
|
81
79
|
/**
|
82
80
|
* Loader interface with additional members.
|
83
81
|
*/
|
84
82
|
export interface ICamera extends GLTF2.ICamera, IArrayItem {
|
85
83
|
/** @internal */
|
86
|
-
_babylonCamera
|
84
|
+
_babylonCamera?: Camera;
|
87
85
|
}
|
88
86
|
/**
|
89
87
|
* Loader interface with additional members.
|
@@ -106,16 +104,22 @@ export interface IMaterialOcclusionTextureInfo extends GLTF2.IMaterialOcclusionT
|
|
106
104
|
* Loader interface with additional members.
|
107
105
|
*/
|
108
106
|
export interface IMaterialPbrMetallicRoughness extends GLTF2.IMaterialPbrMetallicRoughness {
|
107
|
+
/** @internal */
|
109
108
|
baseColorTexture?: ITextureInfo;
|
109
|
+
/** @internal */
|
110
110
|
metallicRoughnessTexture?: ITextureInfo;
|
111
111
|
}
|
112
112
|
/**
|
113
113
|
* Loader interface with additional members.
|
114
114
|
*/
|
115
115
|
export interface IMaterial extends GLTF2.IMaterial, IArrayItem {
|
116
|
+
/** @internal */
|
116
117
|
pbrMetallicRoughness?: IMaterialPbrMetallicRoughness;
|
118
|
+
/** @internal */
|
117
119
|
normalTexture?: IMaterialNormalTextureInfo;
|
120
|
+
/** @internal */
|
118
121
|
occlusionTexture?: IMaterialOcclusionTextureInfo;
|
122
|
+
/** @internal */
|
119
123
|
emissiveTexture?: ITextureInfo;
|
120
124
|
/** @internal */
|
121
125
|
_data?: {
|
@@ -130,6 +134,7 @@ export interface IMaterial extends GLTF2.IMaterial, IArrayItem {
|
|
130
134
|
* Loader interface with additional members.
|
131
135
|
*/
|
132
136
|
export interface IMesh extends GLTF2.IMesh, IArrayItem {
|
137
|
+
/** @internal */
|
133
138
|
primitives: IMeshPrimitive[];
|
134
139
|
}
|
135
140
|
/**
|
@@ -146,9 +151,7 @@ export interface IMeshPrimitive extends GLTF2.IMeshPrimitive, IArrayItem {
|
|
146
151
|
* Loader interface with additional members.
|
147
152
|
*/
|
148
153
|
export interface INode extends GLTF2.INode, IArrayItem {
|
149
|
-
/**
|
150
|
-
* The parent glTF node.
|
151
|
-
*/
|
154
|
+
/** @internal */
|
152
155
|
parent?: INode;
|
153
156
|
/** @internal */
|
154
157
|
_babylonTransformNode?: TransformNode;
|
@@ -161,9 +164,13 @@ export interface INode extends GLTF2.INode, IArrayItem {
|
|
161
164
|
}
|
162
165
|
/** @internal */
|
163
166
|
export interface _ISamplerData {
|
167
|
+
/** @internal */
|
164
168
|
noMipMaps: boolean;
|
169
|
+
/** @internal */
|
165
170
|
samplingMode: number;
|
171
|
+
/** @internal */
|
166
172
|
wrapU: number;
|
173
|
+
/** @internal */
|
167
174
|
wrapV: number;
|
168
175
|
}
|
169
176
|
/**
|
@@ -206,17 +213,37 @@ export interface ITextureInfo extends GLTF2.ITextureInfo {
|
|
206
213
|
* Loader interface with additional members.
|
207
214
|
*/
|
208
215
|
export interface IGLTF extends GLTF2.IGLTF {
|
216
|
+
/** @internal */
|
209
217
|
accessors?: IAccessor[];
|
218
|
+
/** @internal */
|
210
219
|
animations?: IAnimation[];
|
220
|
+
/** @internal */
|
211
221
|
buffers?: IBuffer[];
|
222
|
+
/** @internal */
|
212
223
|
bufferViews?: IBufferView[];
|
224
|
+
/** @internal */
|
213
225
|
cameras?: ICamera[];
|
226
|
+
/** @internal */
|
214
227
|
images?: IImage[];
|
228
|
+
/** @internal */
|
215
229
|
materials?: IMaterial[];
|
230
|
+
/** @internal */
|
216
231
|
meshes?: IMesh[];
|
232
|
+
/** @internal */
|
217
233
|
nodes?: INode[];
|
234
|
+
/** @internal */
|
218
235
|
samplers?: ISampler[];
|
236
|
+
/** @internal */
|
219
237
|
scenes?: IScene[];
|
238
|
+
/** @internal */
|
220
239
|
skins?: ISkin[];
|
240
|
+
/** @internal */
|
221
241
|
textures?: ITexture[];
|
222
242
|
}
|
243
|
+
/**
|
244
|
+
* Loader interface with additional members.
|
245
|
+
*/
|
246
|
+
export interface IKHRLightsPunctual_Light extends GLTF2.IKHRLightsPunctual_Light, IArrayItem {
|
247
|
+
/** @hidden */
|
248
|
+
_babylonLight?: Light;
|
249
|
+
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"glTFLoaderInterfaces.js","sourceRoot":"","sources":["../../../../../../lts/loaders/generated/glTF/2.0/glTFLoaderInterfaces.ts"],"names":[],"mappings":"","sourcesContent":["import type { AnimationGroup } from \"core/Animations/animationGroup\";\r\nimport type { Skeleton } from \"core/Bones/skeleton\";\r\nimport type { Material } from \"core/Materials/material\";\r\nimport type { TransformNode } from \"core/Meshes/transformNode\";\r\nimport type { Buffer, VertexBuffer } from \"core/Buffers/buffer\";\r\nimport type { AbstractMesh } from \"core/Meshes/abstractMesh\";\r\nimport type { Mesh } from \"core/Meshes/mesh\";\r\nimport type { Camera } from \"core/Cameras/camera\";\r\nimport type { Light } from \"core/Lights/light\";\r\n\r\nimport type * as GLTF2 from \"babylonjs-gltf2interface\";\r\n\r\n/**\r\n * Loader interface with an index field.\r\n */\r\nexport interface IArrayItem {\r\n /**\r\n * The index of this item in the array.\r\n */\r\n index: number;\r\n}\r\n\r\n/**\r\n * Loader interface with additional members.\r\n */\r\nexport interface IAccessor extends GLTF2.IAccessor, IArrayItem {\r\n /** @internal */\r\n _data?: Promise<ArrayBufferView>;\r\n\r\n /** @internal */\r\n _babylonVertexBuffer?: { [kind: string]: Promise<VertexBuffer> };\r\n}\r\n\r\n/**\r\n * Loader interface with additional members.\r\n */\r\nexport interface IAnimationChannel extends GLTF2.IAnimationChannel, IArrayItem {}\r\n\r\n/** @internal */\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nexport interface _IAnimationSamplerData {\r\n input: Float32Array;\r\n interpolation: GLTF2.AnimationSamplerInterpolation;\r\n output: Float32Array;\r\n}\r\n\r\n/**\r\n * Loader interface with additional members.\r\n */\r\nexport interface IAnimationSampler extends GLTF2.IAnimationSampler, IArrayItem {\r\n /** @internal */\r\n _data?: Promise<_IAnimationSamplerData>;\r\n}\r\n\r\n/**\r\n * Loader interface with additional members.\r\n */\r\nexport interface IAnimation extends GLTF2.IAnimation, IArrayItem {\r\n channels: IAnimationChannel[];\r\n samplers: IAnimationSampler[];\r\n\r\n /** @internal */\r\n _babylonAnimationGroup?: AnimationGroup;\r\n}\r\n\r\n/**\r\n * Loader interface with additional members.\r\n */\r\nexport interface IBuffer extends GLTF2.IBuffer, IArrayItem {\r\n /** @internal */\r\n _data?: Promise<ArrayBufferView>;\r\n}\r\n\r\n/**\r\n * Loader interface with additional members.\r\n */\r\nexport interface IBufferView extends GLTF2.IBufferView, IArrayItem {\r\n /** @internal */\r\n _data?: Promise<ArrayBufferView>;\r\n\r\n /** @internal */\r\n _babylonBuffer?: Promise<Buffer>;\r\n}\r\n\r\n/**\r\n * Loader interface with additional members.\r\n */\r\nexport interface
|
1
|
+
{"version":3,"file":"glTFLoaderInterfaces.js","sourceRoot":"","sources":["../../../../../../lts/loaders/generated/glTF/2.0/glTFLoaderInterfaces.ts"],"names":[],"mappings":"","sourcesContent":["import type { AnimationGroup } from \"core/Animations/animationGroup\";\r\nimport type { Skeleton } from \"core/Bones/skeleton\";\r\nimport type { Material } from \"core/Materials/material\";\r\nimport type { TransformNode } from \"core/Meshes/transformNode\";\r\nimport type { Buffer, VertexBuffer } from \"core/Buffers/buffer\";\r\nimport type { AbstractMesh } from \"core/Meshes/abstractMesh\";\r\nimport type { Mesh } from \"core/Meshes/mesh\";\r\nimport type { Camera } from \"core/Cameras/camera\";\r\nimport type { Light } from \"core/Lights/light\";\r\n\r\nimport type * as GLTF2 from \"babylonjs-gltf2interface\";\r\n\r\n/**\r\n * Loader interface with an index field.\r\n */\r\nexport interface IArrayItem {\r\n /**\r\n * The index of this item in the array.\r\n */\r\n index: number;\r\n}\r\n\r\n/**\r\n * Loader interface with additional members.\r\n */\r\nexport interface IAccessor extends GLTF2.IAccessor, IArrayItem {\r\n /** @internal */\r\n _data?: Promise<ArrayBufferView>;\r\n\r\n /** @internal */\r\n _babylonVertexBuffer?: { [kind: string]: Promise<VertexBuffer> };\r\n}\r\n\r\n/**\r\n * Loader interface with additional members.\r\n */\r\nexport interface IAnimationChannel extends GLTF2.IAnimationChannel, IArrayItem {}\r\n\r\n/** @internal */\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nexport interface _IAnimationSamplerData {\r\n /** @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/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@babylonjs/loaders",
|
3
|
-
"version": "5.
|
3
|
+
"version": "5.26.1",
|
4
4
|
"main": "index.js",
|
5
5
|
"module": "index.js",
|
6
6
|
"types": "index.d.ts",
|
@@ -19,10 +19,10 @@
|
|
19
19
|
"prepublishOnly": "build-tools -c prepare-es6-build"
|
20
20
|
},
|
21
21
|
"devDependencies": {
|
22
|
-
"@babylonjs/core": "^5.
|
22
|
+
"@babylonjs/core": "^5.26.1",
|
23
23
|
"@dev/build-tools": "^1.0.0",
|
24
24
|
"@lts/loaders": "^1.0.0",
|
25
|
-
"babylonjs-gltf2interface": "^5.
|
25
|
+
"babylonjs-gltf2interface": "^5.26.1",
|
26
26
|
"rimraf": "^3.0.2",
|
27
27
|
"typescript": "^4.4.4"
|
28
28
|
},
|
@@ -1,15 +0,0 @@
|
|
1
|
-
import type { AnimationGroup } from "@babylonjs/core/Animations/animationGroup.js";
|
2
|
-
import type { IGLTF } from "../glTFLoaderInterfaces";
|
3
|
-
import type { IAnimatable } from "@babylonjs/core/Animations/animatable.interface.js";
|
4
|
-
import type { Nullable } from "@babylonjs/core/types.js";
|
5
|
-
export declare type GetGltfNodeTargetFn = (source: IGLTF, indices: string) => any;
|
6
|
-
declare type GetValueFn = (target: any, source: Float32Array, offset: number, scale?: number) => any;
|
7
|
-
export interface IAnimationPointerPropertyInfos {
|
8
|
-
type: number;
|
9
|
-
name: string;
|
10
|
-
get: GetValueFn;
|
11
|
-
isValid(target: any): boolean;
|
12
|
-
buildAnimations(target: any, fps: number, keys: any[], group: AnimationGroup, animationTargetOverride: Nullable<IAnimatable>, params?: any): void;
|
13
|
-
}
|
14
|
-
export declare const CoreAnimationPointerMap: any;
|
15
|
-
export {};
|