@babylonjs/loaders 5.24.0 → 5.26.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (125) hide show
  1. package/STL/stlFileLoader.d.ts +4 -4
  2. package/STL/stlFileLoader.js +4 -4
  3. package/STL/stlFileLoader.js.map +1 -1
  4. package/glTF/1.0/glTFBinaryExtension.d.ts +1 -1
  5. package/glTF/1.0/glTFBinaryExtension.js +1 -1
  6. package/glTF/1.0/glTFBinaryExtension.js.map +1 -1
  7. package/glTF/1.0/glTFLoader.d.ts +3 -3
  8. package/glTF/1.0/glTFLoader.js +3 -3
  9. package/glTF/1.0/glTFLoader.js.map +1 -1
  10. package/glTF/1.0/glTFLoaderInterfaces.d.ts +45 -45
  11. package/glTF/1.0/glTFLoaderInterfaces.js +8 -8
  12. package/glTF/1.0/glTFLoaderInterfaces.js.map +1 -1
  13. package/glTF/1.0/glTFLoaderUtils.d.ts +1 -1
  14. package/glTF/1.0/glTFLoaderUtils.js +1 -1
  15. package/glTF/1.0/glTFLoaderUtils.js.map +1 -1
  16. package/glTF/1.0/glTFMaterialsCommonExtension.d.ts +1 -1
  17. package/glTF/1.0/glTFMaterialsCommonExtension.js +1 -1
  18. package/glTF/1.0/glTFMaterialsCommonExtension.js.map +1 -1
  19. package/glTF/2.0/Extensions/EXT_lights_image_based.d.ts +5 -8
  20. package/glTF/2.0/Extensions/EXT_lights_image_based.js +4 -7
  21. package/glTF/2.0/Extensions/EXT_lights_image_based.js.map +1 -1
  22. package/glTF/2.0/Extensions/EXT_mesh_gpu_instancing.d.ts +3 -7
  23. package/glTF/2.0/Extensions/EXT_mesh_gpu_instancing.js +3 -7
  24. package/glTF/2.0/Extensions/EXT_mesh_gpu_instancing.js.map +1 -1
  25. package/glTF/2.0/Extensions/EXT_meshopt_compression.d.ts +3 -6
  26. package/glTF/2.0/Extensions/EXT_meshopt_compression.js +3 -6
  27. package/glTF/2.0/Extensions/EXT_meshopt_compression.js.map +1 -1
  28. package/glTF/2.0/Extensions/EXT_texture_webp.d.ts +3 -7
  29. package/glTF/2.0/Extensions/EXT_texture_webp.js +3 -7
  30. package/glTF/2.0/Extensions/EXT_texture_webp.js.map +1 -1
  31. package/glTF/2.0/Extensions/ExtrasAsMetadata.d.ts +5 -15
  32. package/glTF/2.0/Extensions/ExtrasAsMetadata.js +5 -15
  33. package/glTF/2.0/Extensions/ExtrasAsMetadata.js.map +1 -1
  34. package/glTF/2.0/Extensions/KHR_animation_pointer.d.ts +14 -35
  35. package/glTF/2.0/Extensions/KHR_animation_pointer.data.d.ts +133 -0
  36. package/glTF/2.0/Extensions/KHR_animation_pointer.data.js +169 -0
  37. package/glTF/2.0/Extensions/KHR_animation_pointer.data.js.map +1 -0
  38. package/glTF/2.0/Extensions/KHR_animation_pointer.js +56 -208
  39. package/glTF/2.0/Extensions/KHR_animation_pointer.js.map +1 -1
  40. package/glTF/2.0/Extensions/KHR_draco_mesh_compression.d.ts +3 -7
  41. package/glTF/2.0/Extensions/KHR_draco_mesh_compression.js +3 -7
  42. package/glTF/2.0/Extensions/KHR_draco_mesh_compression.js.map +1 -1
  43. package/glTF/2.0/Extensions/KHR_lights_punctual.d.ts +4 -8
  44. package/glTF/2.0/Extensions/KHR_lights_punctual.js +6 -9
  45. package/glTF/2.0/Extensions/KHR_lights_punctual.js.map +1 -1
  46. package/glTF/2.0/Extensions/KHR_materials_clearcoat.d.ts +3 -7
  47. package/glTF/2.0/Extensions/KHR_materials_clearcoat.js +3 -7
  48. package/glTF/2.0/Extensions/KHR_materials_clearcoat.js.map +1 -1
  49. package/glTF/2.0/Extensions/KHR_materials_emissive_strength.d.ts +3 -7
  50. package/glTF/2.0/Extensions/KHR_materials_emissive_strength.js +3 -7
  51. package/glTF/2.0/Extensions/KHR_materials_emissive_strength.js.map +1 -1
  52. package/glTF/2.0/Extensions/KHR_materials_ior.d.ts +3 -7
  53. package/glTF/2.0/Extensions/KHR_materials_ior.js +3 -7
  54. package/glTF/2.0/Extensions/KHR_materials_ior.js.map +1 -1
  55. package/glTF/2.0/Extensions/KHR_materials_iridescence.d.ts +3 -7
  56. package/glTF/2.0/Extensions/KHR_materials_iridescence.js +3 -7
  57. package/glTF/2.0/Extensions/KHR_materials_iridescence.js.map +1 -1
  58. package/glTF/2.0/Extensions/KHR_materials_pbrSpecularGlossiness.d.ts +3 -7
  59. package/glTF/2.0/Extensions/KHR_materials_pbrSpecularGlossiness.js +3 -7
  60. package/glTF/2.0/Extensions/KHR_materials_pbrSpecularGlossiness.js.map +1 -1
  61. package/glTF/2.0/Extensions/KHR_materials_sheen.d.ts +3 -7
  62. package/glTF/2.0/Extensions/KHR_materials_sheen.js +3 -7
  63. package/glTF/2.0/Extensions/KHR_materials_sheen.js.map +1 -1
  64. package/glTF/2.0/Extensions/KHR_materials_specular.d.ts +3 -7
  65. package/glTF/2.0/Extensions/KHR_materials_specular.js +3 -7
  66. package/glTF/2.0/Extensions/KHR_materials_specular.js.map +1 -1
  67. package/glTF/2.0/Extensions/KHR_materials_translucency.d.ts +3 -7
  68. package/glTF/2.0/Extensions/KHR_materials_translucency.js +3 -7
  69. package/glTF/2.0/Extensions/KHR_materials_translucency.js.map +1 -1
  70. package/glTF/2.0/Extensions/KHR_materials_transmission.d.ts +3 -7
  71. package/glTF/2.0/Extensions/KHR_materials_transmission.js +3 -7
  72. package/glTF/2.0/Extensions/KHR_materials_transmission.js.map +1 -1
  73. package/glTF/2.0/Extensions/KHR_materials_unlit.d.ts +3 -7
  74. package/glTF/2.0/Extensions/KHR_materials_unlit.js +3 -7
  75. package/glTF/2.0/Extensions/KHR_materials_unlit.js.map +1 -1
  76. package/glTF/2.0/Extensions/KHR_materials_variants.d.ts +4 -11
  77. package/glTF/2.0/Extensions/KHR_materials_variants.js +4 -11
  78. package/glTF/2.0/Extensions/KHR_materials_variants.js.map +1 -1
  79. package/glTF/2.0/Extensions/KHR_materials_volume.d.ts +3 -7
  80. package/glTF/2.0/Extensions/KHR_materials_volume.js +3 -7
  81. package/glTF/2.0/Extensions/KHR_materials_volume.js.map +1 -1
  82. package/glTF/2.0/Extensions/KHR_mesh_quantization.d.ts +2 -3
  83. package/glTF/2.0/Extensions/KHR_mesh_quantization.js +2 -3
  84. package/glTF/2.0/Extensions/KHR_mesh_quantization.js.map +1 -1
  85. package/glTF/2.0/Extensions/KHR_texture_basisu.d.ts +3 -7
  86. package/glTF/2.0/Extensions/KHR_texture_basisu.js +3 -7
  87. package/glTF/2.0/Extensions/KHR_texture_basisu.js.map +1 -1
  88. package/glTF/2.0/Extensions/KHR_texture_transform.d.ts +3 -7
  89. package/glTF/2.0/Extensions/KHR_texture_transform.js +3 -7
  90. package/glTF/2.0/Extensions/KHR_texture_transform.js.map +1 -1
  91. package/glTF/2.0/Extensions/KHR_xmp_json_ld.d.ts +2 -3
  92. package/glTF/2.0/Extensions/KHR_xmp_json_ld.js +2 -3
  93. package/glTF/2.0/Extensions/KHR_xmp_json_ld.js.map +1 -1
  94. package/glTF/2.0/Extensions/MSFT_audio_emitter.d.ts +6 -14
  95. package/glTF/2.0/Extensions/MSFT_audio_emitter.js +6 -14
  96. package/glTF/2.0/Extensions/MSFT_audio_emitter.js.map +1 -1
  97. package/glTF/2.0/Extensions/MSFT_lod.d.ts +8 -26
  98. package/glTF/2.0/Extensions/MSFT_lod.js +8 -26
  99. package/glTF/2.0/Extensions/MSFT_lod.js.map +1 -1
  100. package/glTF/2.0/Extensions/MSFT_minecraftMesh.d.ts +1 -1
  101. package/glTF/2.0/Extensions/MSFT_minecraftMesh.js +1 -1
  102. package/glTF/2.0/Extensions/MSFT_minecraftMesh.js.map +1 -1
  103. package/glTF/2.0/Extensions/MSFT_sRGBFactors.d.ts +1 -1
  104. package/glTF/2.0/Extensions/MSFT_sRGBFactors.js +1 -1
  105. package/glTF/2.0/Extensions/MSFT_sRGBFactors.js.map +1 -1
  106. package/glTF/2.0/glTFLoader.d.ts +55 -52
  107. package/glTF/2.0/glTFLoader.js +217 -91
  108. package/glTF/2.0/glTFLoader.js.map +1 -1
  109. package/glTF/2.0/glTFLoaderAnimation.d.ts +29 -0
  110. package/glTF/2.0/glTFLoaderAnimation.js +66 -0
  111. package/glTF/2.0/glTFLoaderAnimation.js.map +1 -0
  112. package/glTF/2.0/glTFLoaderExtension.d.ts +20 -7
  113. package/glTF/2.0/glTFLoaderExtension.js.map +1 -1
  114. package/glTF/2.0/glTFLoaderInterfaces.d.ts +58 -31
  115. package/glTF/2.0/glTFLoaderInterfaces.js.map +1 -1
  116. package/glTF/glTFFileLoader.d.ts +20 -53
  117. package/glTF/glTFFileLoader.js +17 -50
  118. package/glTF/glTFFileLoader.js.map +1 -1
  119. package/package.json +3 -3
  120. package/glTF/2.0/Extensions/KHR_animation_pointer.map.d.ts +0 -15
  121. package/glTF/2.0/Extensions/KHR_animation_pointer.map.js +0 -454
  122. package/glTF/2.0/Extensions/KHR_animation_pointer.map.js.map +0 -1
  123. package/glTF/2.0/glTFUtilities.d.ts +0 -7
  124. package/glTF/2.0/glTFUtilities.js +0 -23
  125. package/glTF/2.0/glTFUtilities.js.map +0 -1
@@ -1,76 +1,55 @@
1
1
  import type { IGLTFLoaderExtension } from "../glTFLoaderExtension";
2
2
  import { GLTFLoader } from "../glTFLoader";
3
3
  import type { Nullable } from "@babylonjs/core/types.js";
4
- import { AnimationGroup } from "@babylonjs/core/Animations/animationGroup.js";
4
+ import type { Animation } from "@babylonjs/core/Animations/animation.js";
5
5
  import type { IAnimatable } from "@babylonjs/core/Animations/animatable.interface.js";
6
6
  import type { IAnimation, IAnimationChannel } from "../glTFLoaderInterfaces";
7
7
  /**
8
8
  * [Specification PR](https://github.com/KhronosGroup/glTF/pull/2147)
9
+ * !!! Experimental Extension Subject to Changes !!!
9
10
  */
10
11
  export declare class KHR_animation_pointer implements IGLTFLoaderExtension {
11
- /**
12
- * used to gently ignore invalid pointer. If false, invalid pointer will throw exception.
13
- */
14
- ignoreInvalidPointer: boolean;
15
12
  /**
16
13
  * The name of this extension.
17
14
  */
18
15
  readonly name = "KHR_animation_pointer";
19
16
  private _loader;
20
17
  /**
21
- * @param loader
22
- * @hidden
18
+ * @internal
23
19
  */
24
20
  constructor(loader: GLTFLoader);
25
21
  /**
26
22
  * Defines whether this extension is enabled.
27
23
  */
28
24
  get enabled(): boolean;
29
- /** @hidden */
25
+ /** @internal */
30
26
  dispose(): void;
31
27
  /**
32
- * according to specification,
33
- * It is not allowed to animate a glTFid property, as it does change the structure of the glTF in general
34
- * It is not allowed to animate a name property in general.
35
- * @param property
36
- * @hidden
37
- */
38
- accept(property: string): boolean;
39
- loadAnimationAsync(context: string, animation: IAnimation): Nullable<Promise<AnimationGroup>>;
40
- /**
41
- * @hidden Loads a glTF animation channel.
28
+ * Loads a glTF animation channel.
42
29
  * @param context The context when loading the asset
43
30
  * @param animationContext The context of the animation when loading the asset
44
31
  * @param animation The glTF animation property
45
32
  * @param channel The glTF animation channel property
46
- * @param animationTargetOverride The babylon animation channel target override property. My be null.
47
- * @returns A void promise when the channel load is complete
33
+ * @param onLoad Called for each animation loaded
34
+ * @returns A void promise that resolves when the load is complete or null if not handled
48
35
  */
49
- _loadAnimationChannelAsync(context: string, animationContext: string, animation: IAnimation, channel: IAnimationChannel, animationTargetOverride?: Nullable<IAnimatable>): Promise<void>;
50
- private _loadAnimationSamplerAsync;
36
+ _loadAnimationChannelAsync(context: string, animationContext: string, animation: IAnimation, channel: IAnimationChannel, onLoad: (babylonAnimatable: IAnimatable, babylonAnimation: Animation) => void): Nullable<Promise<void>>;
51
37
  /**
52
- * parsing animation pointer is the core of animation channel.
53
- * Animation pointer is a Json pointer, which mean it locate an item into the json hierarchy.
54
- * Consequentely the pointer has the following BNF
55
-
56
- * <animationPointer> := <sep><assetContainer><sep><assetIndex><sep><propertyPath>
57
- * <assetContainer> := "nodes" | "materials" | "meshes" | "cameras" | "extensions"
38
+ * The pointer string is represented by a [JSON pointer](https://datatracker.ietf.org/doc/html/rfc6901).
39
+ * <animationPointer> := /<rootNode>/<assetIndex>/<propertyPath>
40
+ * <rootNode> := "nodes" | "materials" | "meshes" | "cameras" | "extensions"
58
41
  * <assetIndex> := <digit> | <name>
59
42
  * <propertyPath> := <extensionPath> | <standardPath>
60
- * <extensionPath> := "extensions"<sep><name><sep><standardPath>
61
- * <standardPath> := <name> | <name><sep><standardPath>
62
- * <sep>:= "/"
43
+ * <extensionPath> := "extensions"/<name>/<standardPath>
44
+ * <standardPath> := <name> | <name>/<standardPath>
63
45
  * <name> := W+
64
46
  * <digit> := D+
65
47
  *
66
- * examples of pointer are
48
+ * Examples:
67
49
  * - "/nodes/0/rotation"
68
50
  * - "/materials/2/emissiveFactor"
69
51
  * - "/materials/2/pbrMetallicRoughness/baseColorFactor"
70
52
  * - "/materials/2/extensions/KHR_materials_emissive_strength/emissiveStrength"
71
- * @param context
72
- * @param pointer
73
- * @returns
74
53
  */
75
54
  private _parseAnimationPointer;
76
55
  }
@@ -0,0 +1,133 @@
1
+ import { Animation } from "@babylonjs/core/Animations/animation.js";
2
+ import type { ICamera, IKHRLightsPunctual_Light, IMaterial } from "../glTFLoaderInterfaces";
3
+ import type { IAnimatable } from "@babylonjs/core/Animations/animatable.interface.js";
4
+ import { AnimationPropertyInfo } from "../glTFLoaderAnimation";
5
+ declare class CameraAnimationPropertyInfo extends AnimationPropertyInfo {
6
+ buildAnimations(target: ICamera, name: string, fps: number, keys: any[], callback: (babylonAnimatable: IAnimatable, babylonAnimation: Animation) => void): void;
7
+ }
8
+ declare class MaterialAnimationPropertyInfo extends AnimationPropertyInfo {
9
+ buildAnimations(target: IMaterial, name: string, fps: number, keys: any[], callback: (babylonAnimatable: IAnimatable, babylonAnimation: Animation) => void): void;
10
+ }
11
+ declare class LightAnimationPropertyInfo extends AnimationPropertyInfo {
12
+ buildAnimations(target: IKHRLightsPunctual_Light, name: string, fps: number, keys: any[], callback: (babylonAnimatable: IAnimatable, babylonAnimation: Animation) => void): void;
13
+ }
14
+ export declare const animationPointerTree: {
15
+ nodes: {
16
+ __array__: {
17
+ translation: import("../glTFLoaderAnimation").TransformNodeAnimationPropertyInfo[];
18
+ rotation: import("../glTFLoaderAnimation").TransformNodeAnimationPropertyInfo[];
19
+ scale: import("../glTFLoaderAnimation").TransformNodeAnimationPropertyInfo[];
20
+ weights: import("../glTFLoaderAnimation").WeightAnimationPropertyInfo[];
21
+ __target__: boolean;
22
+ };
23
+ };
24
+ materials: {
25
+ __array__: {
26
+ __target__: boolean;
27
+ pbrMetallicRoughness: {
28
+ baseColorFactor: MaterialAnimationPropertyInfo[];
29
+ metallicFactor: MaterialAnimationPropertyInfo[];
30
+ roughnessFactor: MaterialAnimationPropertyInfo[];
31
+ baseColorTexture: {
32
+ extensions: {
33
+ KHR_texture_transform: {
34
+ scale: MaterialAnimationPropertyInfo[];
35
+ offset: MaterialAnimationPropertyInfo[];
36
+ rotation: MaterialAnimationPropertyInfo[];
37
+ };
38
+ };
39
+ };
40
+ };
41
+ emissiveFactor: MaterialAnimationPropertyInfo[];
42
+ normalTexture: {
43
+ scale: MaterialAnimationPropertyInfo[];
44
+ };
45
+ occlusionTexture: {
46
+ strength: MaterialAnimationPropertyInfo[];
47
+ extensions: {
48
+ KHR_texture_transform: {
49
+ scale: MaterialAnimationPropertyInfo[];
50
+ offset: MaterialAnimationPropertyInfo[];
51
+ rotation: MaterialAnimationPropertyInfo[];
52
+ };
53
+ };
54
+ };
55
+ emissiveTexture: {
56
+ extensions: {
57
+ KHR_texture_transform: {
58
+ scale: MaterialAnimationPropertyInfo[];
59
+ offset: MaterialAnimationPropertyInfo[];
60
+ rotation: MaterialAnimationPropertyInfo[];
61
+ };
62
+ };
63
+ };
64
+ extensions: {
65
+ KHR_materials_ior: {
66
+ ior: MaterialAnimationPropertyInfo[];
67
+ };
68
+ KHR_materials_clearcoat: {
69
+ clearcoatFactor: MaterialAnimationPropertyInfo[];
70
+ clearcoatRoughnessFactor: MaterialAnimationPropertyInfo[];
71
+ };
72
+ KHR_materials_sheen: {
73
+ sheenColorFactor: MaterialAnimationPropertyInfo[];
74
+ sheenRoughnessFactor: MaterialAnimationPropertyInfo[];
75
+ };
76
+ KHR_materials_specular: {
77
+ specularFactor: MaterialAnimationPropertyInfo[];
78
+ specularColorFactor: MaterialAnimationPropertyInfo[];
79
+ };
80
+ KHR_materials_emissive_strength: {
81
+ emissiveStrength: MaterialAnimationPropertyInfo[];
82
+ };
83
+ KHR_materials_transmission: {
84
+ transmissionFactor: MaterialAnimationPropertyInfo[];
85
+ };
86
+ KHR_materials_volume: {
87
+ attenuationColor: MaterialAnimationPropertyInfo[];
88
+ attenuationDistance: MaterialAnimationPropertyInfo[];
89
+ thicknessFactor: MaterialAnimationPropertyInfo[];
90
+ };
91
+ KHR_materials_iridescence: {
92
+ iridescenceFactor: MaterialAnimationPropertyInfo[];
93
+ iridescenceIor: MaterialAnimationPropertyInfo[];
94
+ iridescenceThicknessMinimum: MaterialAnimationPropertyInfo[];
95
+ iridescenceThicknessMaximum: MaterialAnimationPropertyInfo[];
96
+ };
97
+ };
98
+ };
99
+ };
100
+ cameras: {
101
+ __array__: {
102
+ __target__: boolean;
103
+ orthographic: {
104
+ xmag: CameraAnimationPropertyInfo[];
105
+ ymag: CameraAnimationPropertyInfo[];
106
+ zfar: CameraAnimationPropertyInfo[];
107
+ znear: CameraAnimationPropertyInfo[];
108
+ };
109
+ perspective: {
110
+ yfov: CameraAnimationPropertyInfo[];
111
+ zfar: CameraAnimationPropertyInfo[];
112
+ znear: CameraAnimationPropertyInfo[];
113
+ };
114
+ };
115
+ };
116
+ extensions: {
117
+ KHR_lights_punctual: {
118
+ lights: {
119
+ __array__: {
120
+ __target__: boolean;
121
+ color: LightAnimationPropertyInfo[];
122
+ intensity: LightAnimationPropertyInfo[];
123
+ range: LightAnimationPropertyInfo[];
124
+ spot: {
125
+ innerConeAngle: LightAnimationPropertyInfo[];
126
+ outerConeAngle: LightAnimationPropertyInfo[];
127
+ };
128
+ };
129
+ };
130
+ };
131
+ };
132
+ };
133
+ export {};
@@ -0,0 +1,169 @@
1
+ import { Animation } from "@babylonjs/core/Animations/animation.js";
2
+ import { AnimationPropertyInfo, nodeAnimationData } from "../glTFLoaderAnimation.js";
3
+ import { Color3 } from "@babylonjs/core/Maths/math.color.js";
4
+ function getColor3(_target, source, offset, scale) {
5
+ return Color3.FromArray(source, offset).scale(scale);
6
+ }
7
+ function getAlpha(_target, source, offset, scale) {
8
+ return source[offset + 3] * scale;
9
+ }
10
+ function getFloat(_target, source, offset, scale) {
11
+ return source[offset] * scale;
12
+ }
13
+ function getMinusFloat(_target, source, offset, scale) {
14
+ return -source[offset] * scale;
15
+ }
16
+ function getNextFloat(_target, source, offset, scale) {
17
+ return source[offset + 1] * scale;
18
+ }
19
+ function getFloatBy2(_target, source, offset, scale) {
20
+ return source[offset] * scale * 2;
21
+ }
22
+ function getTextureTransformTree(textureName) {
23
+ return {
24
+ scale: [
25
+ new MaterialAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, `${textureName}.uScale`, getFloat, () => 2),
26
+ new MaterialAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, `${textureName}.vScale`, getNextFloat, () => 2),
27
+ ],
28
+ offset: [
29
+ new MaterialAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, `${textureName}.uOffset`, getFloat, () => 2),
30
+ new MaterialAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, `${textureName}.vOffset`, getNextFloat, () => 2),
31
+ ],
32
+ rotation: [new MaterialAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, `${textureName}.wAng`, getMinusFloat, () => 1)],
33
+ };
34
+ }
35
+ class CameraAnimationPropertyInfo extends AnimationPropertyInfo {
36
+ buildAnimations(target, name, fps, keys, callback) {
37
+ callback(target._babylonCamera, this._buildAnimation(name, fps, keys));
38
+ }
39
+ }
40
+ class MaterialAnimationPropertyInfo extends AnimationPropertyInfo {
41
+ buildAnimations(target, name, fps, keys, callback) {
42
+ for (const fillMode in target._data) {
43
+ callback(target._data[fillMode].babylonMaterial, this._buildAnimation(name, fps, keys));
44
+ }
45
+ }
46
+ }
47
+ class LightAnimationPropertyInfo extends AnimationPropertyInfo {
48
+ buildAnimations(target, name, fps, keys, callback) {
49
+ callback(target._babylonLight, this._buildAnimation(name, fps, keys));
50
+ }
51
+ }
52
+ const nodesTree = {
53
+ __array__: {
54
+ __target__: true,
55
+ ...nodeAnimationData,
56
+ },
57
+ };
58
+ const camerasTree = {
59
+ __array__: {
60
+ __target__: true,
61
+ orthographic: {
62
+ xmag: [
63
+ new CameraAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, "orthoLeft", getMinusFloat, () => 1),
64
+ new CameraAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, "orthoRight", getNextFloat, () => 1),
65
+ ],
66
+ ymag: [
67
+ new CameraAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, "orthoBottom", getMinusFloat, () => 1),
68
+ new CameraAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, "orthoTop", getNextFloat, () => 1),
69
+ ],
70
+ zfar: [new CameraAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, "maxZ", getFloat, () => 1)],
71
+ znear: [new CameraAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, "minZ", getFloat, () => 1)],
72
+ },
73
+ perspective: {
74
+ yfov: [new CameraAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, "fov", getFloat, () => 1)],
75
+ zfar: [new CameraAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, "maxZ", getFloat, () => 1)],
76
+ znear: [new CameraAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, "minZ", getFloat, () => 1)],
77
+ },
78
+ },
79
+ };
80
+ const materialsTree = {
81
+ __array__: {
82
+ __target__: true,
83
+ pbrMetallicRoughness: {
84
+ baseColorFactor: [
85
+ new MaterialAnimationPropertyInfo(Animation.ANIMATIONTYPE_COLOR3, "albedoColor", getColor3, () => 4),
86
+ new MaterialAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, "alpha", getAlpha, () => 4),
87
+ ],
88
+ metallicFactor: [new MaterialAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, "metallic", getFloat, () => 1)],
89
+ roughnessFactor: [new MaterialAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, "roughness", getFloat, () => 1)],
90
+ baseColorTexture: {
91
+ extensions: {
92
+ KHR_texture_transform: getTextureTransformTree("albedoTexture"),
93
+ },
94
+ },
95
+ },
96
+ emissiveFactor: [new MaterialAnimationPropertyInfo(Animation.ANIMATIONTYPE_COLOR3, "emissiveColor", getColor3, () => 3)],
97
+ normalTexture: {
98
+ scale: [new MaterialAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, "bumpTexture.level", getFloat, () => 1)],
99
+ },
100
+ occlusionTexture: {
101
+ strength: [new MaterialAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, "ambientTextureStrength", getFloat, () => 1)],
102
+ extensions: {
103
+ KHR_texture_transform: getTextureTransformTree("ambientTexture"),
104
+ },
105
+ },
106
+ emissiveTexture: {
107
+ extensions: {
108
+ KHR_texture_transform: getTextureTransformTree("emissiveTexture"),
109
+ },
110
+ },
111
+ extensions: {
112
+ KHR_materials_ior: {
113
+ ior: [new MaterialAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, "indexOfRefraction", getFloat, () => 1)],
114
+ },
115
+ KHR_materials_clearcoat: {
116
+ clearcoatFactor: [new MaterialAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, "clearCoat.intensity", getFloat, () => 1)],
117
+ clearcoatRoughnessFactor: [new MaterialAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, "clearCoat.roughness", getFloat, () => 1)],
118
+ },
119
+ KHR_materials_sheen: {
120
+ sheenColorFactor: [new MaterialAnimationPropertyInfo(Animation.ANIMATIONTYPE_COLOR3, "sheen.color", getColor3, () => 3)],
121
+ sheenRoughnessFactor: [new MaterialAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, "sheen.roughness", getFloat, () => 1)],
122
+ },
123
+ KHR_materials_specular: {
124
+ specularFactor: [new MaterialAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, "metallicF0Factor", getFloat, () => 1)],
125
+ specularColorFactor: [new MaterialAnimationPropertyInfo(Animation.ANIMATIONTYPE_COLOR3, "metallicReflectanceColor", getColor3, () => 3)],
126
+ },
127
+ KHR_materials_emissive_strength: {
128
+ emissiveStrength: [new MaterialAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, "emissiveIntensity", getFloat, () => 1)],
129
+ },
130
+ KHR_materials_transmission: {
131
+ transmissionFactor: [new MaterialAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, "subSurface.refractionIntensity", getFloat, () => 1)],
132
+ },
133
+ KHR_materials_volume: {
134
+ attenuationColor: [new MaterialAnimationPropertyInfo(Animation.ANIMATIONTYPE_COLOR3, "subSurface.tintColor", getColor3, () => 3)],
135
+ attenuationDistance: [new MaterialAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, "subSurface.tintColorAtDistance", getFloat, () => 1)],
136
+ thicknessFactor: [new MaterialAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, "subSurface.maximumThickness", getFloat, () => 1)],
137
+ },
138
+ KHR_materials_iridescence: {
139
+ iridescenceFactor: [new MaterialAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, "iridescence.intensity", getFloat, () => 1)],
140
+ iridescenceIor: [new MaterialAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, "iridescence.indexOfRefraction", getFloat, () => 1)],
141
+ iridescenceThicknessMinimum: [new MaterialAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, "iridescence.minimumThickness", getFloat, () => 1)],
142
+ iridescenceThicknessMaximum: [new MaterialAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, "iridescence.maximumThickness", getFloat, () => 1)],
143
+ },
144
+ },
145
+ },
146
+ };
147
+ const extensionsTree = {
148
+ KHR_lights_punctual: {
149
+ lights: {
150
+ __array__: {
151
+ __target__: true,
152
+ color: [new LightAnimationPropertyInfo(Animation.ANIMATIONTYPE_COLOR3, "diffuse", getColor3, () => 3)],
153
+ intensity: [new LightAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, "intensity", getFloat, () => 1)],
154
+ range: [new LightAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, "range", getFloat, () => 1)],
155
+ spot: {
156
+ innerConeAngle: [new LightAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, "innerAngle", getFloatBy2, () => 1)],
157
+ outerConeAngle: [new LightAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, "angle", getFloatBy2, () => 1)],
158
+ },
159
+ },
160
+ },
161
+ },
162
+ };
163
+ export const animationPointerTree = {
164
+ nodes: nodesTree,
165
+ materials: materialsTree,
166
+ cameras: camerasTree,
167
+ extensions: extensionsTree,
168
+ };
169
+ //# sourceMappingURL=KHR_animation_pointer.data.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"KHR_animation_pointer.data.js","sourceRoot":"","sources":["../../../../../../../lts/loaders/generated/glTF/2.0/Extensions/KHR_animation_pointer.data.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,gDAAkC;AAGtD,OAAO,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAClF,OAAO,EAAE,MAAM,EAAE,4CAA8B;AAE/C,SAAS,SAAS,CAAC,OAAY,EAAE,MAAoB,EAAE,MAAc,EAAE,KAAa;IAChF,OAAO,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;AACzD,CAAC;AAED,SAAS,QAAQ,CAAC,OAAY,EAAE,MAAoB,EAAE,MAAc,EAAE,KAAa;IAC/E,OAAO,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,KAAK,CAAC;AAC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I,0BAA0B,CAAC,SAAS,CAAC,oBAAoB,EAAE,SAAS,EAAE,SAAS,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;gBACtG,SAAS,EAAE,CAAC,IAAI,0BAA0B,CAAC,SAAS,CAAC,mBAAmB,EAAE,WAAW,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;gBAC1G,KAAK,EAAE,CAAC,IAAI,0BAA0B,CAAC,SAAS,CAAC,mBAAmB,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;gBAClG,IAAI,EAAE;oBACF,cAAc,EAAE,CAAC,IAAI,0BAA0B,CAAC,SAAS,CAAC,mBAAmB,EAAE,YAAY,EAAE,WAAW,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;oBACnH,cAAc,EAAE,CAAC,IAAI,0BAA0B,CAAC,SAAS,CAAC,mBAAmB,EAAE,OAAO,EAAE,WAAW,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;iBACjH;aACJ;SACJ;KACJ;CACJ,CAAC;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAChC,KAAK,EAAE,SAAS;IAChB,SAAS,EAAE,aAAa;IACxB,OAAO,EAAE,WAAW;IACpB,UAAU,EAAE,cAAc;CAC7B,CAAC","sourcesContent":["import { Animation } from \"core/Animations/animation\";\r\nimport type { ICamera, IKHRLightsPunctual_Light, IMaterial } from \"../glTFLoaderInterfaces\";\r\nimport type { IAnimatable } from \"core/Animations/animatable.interface\";\r\nimport { AnimationPropertyInfo, nodeAnimationData } from \"../glTFLoaderAnimation\";\r\nimport { Color3 } from \"core/Maths/math.color\";\r\n\r\nfunction getColor3(_target: any, source: Float32Array, offset: number, scale: number): Color3 {\r\n return Color3.FromArray(source, offset).scale(scale);\r\n}\r\n\r\nfunction getAlpha(_target: any, source: Float32Array, offset: number, scale: number): number {\r\n return source[offset + 3] * scale;\r\n}\r\n\r\nfunction getFloat(_target: any, source: Float32Array, offset: number, scale: number): number {\r\n return source[offset] * scale;\r\n}\r\n\r\nfunction getMinusFloat(_target: any, source: Float32Array, offset: number, scale: number): number {\r\n return -source[offset] * scale;\r\n}\r\n\r\nfunction getNextFloat(_target: any, source: Float32Array, offset: number, scale: number): number {\r\n return source[offset + 1] * scale;\r\n}\r\n\r\nfunction getFloatBy2(_target: any, source: Float32Array, offset: number, scale: number): number {\r\n return source[offset] * scale * 2;\r\n}\r\n\r\nfunction getTextureTransformTree(textureName: string) {\r\n return {\r\n scale: [\r\n new MaterialAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, `${textureName}.uScale`, getFloat, () => 2),\r\n new MaterialAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, `${textureName}.vScale`, getNextFloat, () => 2),\r\n ],\r\n offset: [\r\n new MaterialAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, `${textureName}.uOffset`, getFloat, () => 2),\r\n new MaterialAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, `${textureName}.vOffset`, getNextFloat, () => 2),\r\n ],\r\n rotation: [new MaterialAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, `${textureName}.wAng`, getMinusFloat, () => 1)],\r\n };\r\n}\r\n\r\nclass CameraAnimationPropertyInfo extends AnimationPropertyInfo {\r\n public buildAnimations(target: ICamera, name: string, fps: number, keys: any[], callback: (babylonAnimatable: IAnimatable, babylonAnimation: Animation) => void): void {\r\n callback(target._babylonCamera!, this._buildAnimation(name, fps, keys));\r\n }\r\n}\r\n\r\nclass MaterialAnimationPropertyInfo extends AnimationPropertyInfo {\r\n public buildAnimations(target: IMaterial, name: string, fps: number, keys: any[], callback: (babylonAnimatable: IAnimatable, babylonAnimation: Animation) => void): void {\r\n for (const fillMode in target._data!) {\r\n callback(target._data![fillMode].babylonMaterial, this._buildAnimation(name, fps, keys));\r\n }\r\n }\r\n}\r\n\r\nclass LightAnimationPropertyInfo extends AnimationPropertyInfo {\r\n public buildAnimations(\r\n target: IKHRLightsPunctual_Light,\r\n name: string,\r\n fps: number,\r\n keys: any[],\r\n callback: (babylonAnimatable: IAnimatable, babylonAnimation: Animation) => void\r\n ): void {\r\n callback(target._babylonLight!, this._buildAnimation(name, fps, keys));\r\n }\r\n}\r\n\r\nconst nodesTree = {\r\n __array__: {\r\n __target__: true,\r\n ...nodeAnimationData,\r\n },\r\n};\r\n\r\nconst camerasTree = {\r\n __array__: {\r\n __target__: true,\r\n orthographic: {\r\n xmag: [\r\n new CameraAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, \"orthoLeft\", getMinusFloat, () => 1),\r\n new CameraAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, \"orthoRight\", getNextFloat, () => 1),\r\n ],\r\n ymag: [\r\n new CameraAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, \"orthoBottom\", getMinusFloat, () => 1),\r\n new CameraAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, \"orthoTop\", getNextFloat, () => 1),\r\n ],\r\n zfar: [new CameraAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, \"maxZ\", getFloat, () => 1)],\r\n znear: [new CameraAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, \"minZ\", getFloat, () => 1)],\r\n },\r\n perspective: {\r\n yfov: [new CameraAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, \"fov\", getFloat, () => 1)],\r\n zfar: [new CameraAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, \"maxZ\", getFloat, () => 1)],\r\n znear: [new CameraAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, \"minZ\", getFloat, () => 1)],\r\n },\r\n },\r\n};\r\n\r\nconst materialsTree = {\r\n __array__: {\r\n __target__: true,\r\n pbrMetallicRoughness: {\r\n baseColorFactor: [\r\n new MaterialAnimationPropertyInfo(Animation.ANIMATIONTYPE_COLOR3, \"albedoColor\", getColor3, () => 4),\r\n new MaterialAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, \"alpha\", getAlpha, () => 4),\r\n ],\r\n metallicFactor: [new MaterialAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, \"metallic\", getFloat, () => 1)],\r\n roughnessFactor: [new MaterialAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, \"roughness\", getFloat, () => 1)],\r\n baseColorTexture: {\r\n extensions: {\r\n KHR_texture_transform: getTextureTransformTree(\"albedoTexture\"),\r\n },\r\n },\r\n },\r\n emissiveFactor: [new MaterialAnimationPropertyInfo(Animation.ANIMATIONTYPE_COLOR3, \"emissiveColor\", getColor3, () => 3)],\r\n normalTexture: {\r\n scale: [new MaterialAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, \"bumpTexture.level\", getFloat, () => 1)],\r\n },\r\n occlusionTexture: {\r\n strength: [new MaterialAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, \"ambientTextureStrength\", getFloat, () => 1)],\r\n extensions: {\r\n KHR_texture_transform: getTextureTransformTree(\"ambientTexture\"),\r\n },\r\n },\r\n emissiveTexture: {\r\n extensions: {\r\n KHR_texture_transform: getTextureTransformTree(\"emissiveTexture\"),\r\n },\r\n },\r\n extensions: {\r\n KHR_materials_ior: {\r\n ior: [new MaterialAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, \"indexOfRefraction\", getFloat, () => 1)],\r\n },\r\n KHR_materials_clearcoat: {\r\n clearcoatFactor: [new MaterialAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, \"clearCoat.intensity\", getFloat, () => 1)],\r\n clearcoatRoughnessFactor: [new MaterialAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, \"clearCoat.roughness\", getFloat, () => 1)],\r\n },\r\n KHR_materials_sheen: {\r\n sheenColorFactor: [new MaterialAnimationPropertyInfo(Animation.ANIMATIONTYPE_COLOR3, \"sheen.color\", getColor3, () => 3)],\r\n sheenRoughnessFactor: [new MaterialAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, \"sheen.roughness\", getFloat, () => 1)],\r\n },\r\n KHR_materials_specular: {\r\n specularFactor: [new MaterialAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, \"metallicF0Factor\", getFloat, () => 1)],\r\n specularColorFactor: [new MaterialAnimationPropertyInfo(Animation.ANIMATIONTYPE_COLOR3, \"metallicReflectanceColor\", getColor3, () => 3)],\r\n },\r\n KHR_materials_emissive_strength: {\r\n emissiveStrength: [new MaterialAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, \"emissiveIntensity\", getFloat, () => 1)],\r\n },\r\n KHR_materials_transmission: {\r\n transmissionFactor: [new MaterialAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, \"subSurface.refractionIntensity\", getFloat, () => 1)],\r\n },\r\n KHR_materials_volume: {\r\n attenuationColor: [new MaterialAnimationPropertyInfo(Animation.ANIMATIONTYPE_COLOR3, \"subSurface.tintColor\", getColor3, () => 3)],\r\n attenuationDistance: [new MaterialAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, \"subSurface.tintColorAtDistance\", getFloat, () => 1)],\r\n thicknessFactor: [new MaterialAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, \"subSurface.maximumThickness\", getFloat, () => 1)],\r\n },\r\n KHR_materials_iridescence: {\r\n iridescenceFactor: [new MaterialAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, \"iridescence.intensity\", getFloat, () => 1)],\r\n iridescenceIor: [new MaterialAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, \"iridescence.indexOfRefraction\", getFloat, () => 1)],\r\n iridescenceThicknessMinimum: [new MaterialAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, \"iridescence.minimumThickness\", getFloat, () => 1)],\r\n iridescenceThicknessMaximum: [new MaterialAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, \"iridescence.maximumThickness\", getFloat, () => 1)],\r\n },\r\n },\r\n },\r\n};\r\n\r\nconst extensionsTree = {\r\n KHR_lights_punctual: {\r\n lights: {\r\n __array__: {\r\n __target__: true,\r\n color: [new LightAnimationPropertyInfo(Animation.ANIMATIONTYPE_COLOR3, \"diffuse\", getColor3, () => 3)],\r\n intensity: [new LightAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, \"intensity\", getFloat, () => 1)],\r\n range: [new LightAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, \"range\", getFloat, () => 1)],\r\n spot: {\r\n innerConeAngle: [new LightAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, \"innerAngle\", getFloatBy2, () => 1)],\r\n outerConeAngle: [new LightAnimationPropertyInfo(Animation.ANIMATIONTYPE_FLOAT, \"angle\", getFloatBy2, () => 1)],\r\n },\r\n },\r\n },\r\n },\r\n};\r\n\r\nexport const animationPointerTree = {\r\n nodes: nodesTree,\r\n materials: materialsTree,\r\n cameras: camerasTree,\r\n extensions: extensionsTree,\r\n};\r\n"]}