@babylonjs/loaders 5.25.0 → 5.26.1
Sign up to get free protection for your applications and to get access to all the features.
- 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
@@ -1,17 +1,14 @@
|
|
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 {
|
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
|
*/
|
@@ -28,47 +25,31 @@ export declare class KHR_animation_pointer implements IGLTFLoaderExtension {
|
|
28
25
|
/** @internal */
|
29
26
|
dispose(): void;
|
30
27
|
/**
|
31
|
-
*
|
32
|
-
* It is not allowed to animate a glTFid property, as it does change the structure of the glTF in general
|
33
|
-
* It is not allowed to animate a name property in general.
|
34
|
-
* @internal
|
35
|
-
*/
|
36
|
-
accept(property: string): boolean;
|
37
|
-
loadAnimationAsync(context: string, animation: IAnimation): Nullable<Promise<AnimationGroup>>;
|
38
|
-
/**
|
39
|
-
* @internal Loads a glTF animation channel.
|
28
|
+
* Loads a glTF animation channel.
|
40
29
|
* @param context The context when loading the asset
|
41
30
|
* @param animationContext The context of the animation when loading the asset
|
42
31
|
* @param animation The glTF animation property
|
43
32
|
* @param channel The glTF animation channel property
|
44
|
-
* @param
|
45
|
-
* @returns A void promise when the
|
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
|
46
35
|
*/
|
47
|
-
_loadAnimationChannelAsync(context: string, animationContext: string, animation: IAnimation, channel: IAnimationChannel,
|
48
|
-
private _loadAnimationSamplerAsync;
|
36
|
+
_loadAnimationChannelAsync(context: string, animationContext: string, animation: IAnimation, channel: IAnimationChannel, onLoad: (babylonAnimatable: IAnimatable, babylonAnimation: Animation) => void): Nullable<Promise<void>>;
|
49
37
|
/**
|
50
|
-
*
|
51
|
-
*
|
52
|
-
*
|
53
|
-
|
54
|
-
* <animationPointer> := <sep><assetContainer><sep><assetIndex><sep><propertyPath>
|
55
|
-
* <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"
|
56
41
|
* <assetIndex> := <digit> | <name>
|
57
42
|
* <propertyPath> := <extensionPath> | <standardPath>
|
58
|
-
* <extensionPath> := "extensions"
|
59
|
-
* <standardPath> := <name> | <name
|
60
|
-
* <sep>:= "/"
|
43
|
+
* <extensionPath> := "extensions"/<name>/<standardPath>
|
44
|
+
* <standardPath> := <name> | <name>/<standardPath>
|
61
45
|
* <name> := W+
|
62
46
|
* <digit> := D+
|
63
47
|
*
|
64
|
-
*
|
48
|
+
* Examples:
|
65
49
|
* - "/nodes/0/rotation"
|
66
50
|
* - "/materials/2/emissiveFactor"
|
67
51
|
* - "/materials/2/pbrMetallicRoughness/baseColorFactor"
|
68
52
|
* - "/materials/2/extensions/KHR_materials_emissive_strength/emissiveStrength"
|
69
|
-
* @param context
|
70
|
-
* @param pointer
|
71
|
-
* @returns
|
72
53
|
*/
|
73
54
|
private _parseAnimationPointer;
|
74
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;AACtC,CAAC;AAED,SAAS,QAAQ,CAAC,OAAY,EAAE,MAAoB,EAAE,MAAc,EAAE,KAAa;IAC/E,OAAO,MAAM,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC;AAClC,CAAC;AAED,SAAS,aAAa,CAAC,OAAY,EAAE,MAAoB,EAAE,MAAc,EAAE,KAAa;IACpF,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC;AACnC,CAAC;AAED,SAAS,YAAY,CAAC,OAAY,EAAE,MAAoB,EAAE,MAAc,EAAE,KAAa;IACnF,OAAO,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,KAAK,CAAC;AACtC,CAAC;AAED,SAAS,WAAW,CAAC,OAAY,EAAE,MAAoB,EAAE,MAAc,EAAE,KAAa;IAClF,OAAO,MAAM,CAAC,MAAM,CAAC,GAAG,KAAK,GAAG,CAAC,CAAC;AACtC,CAAC;AAED,SAAS,uBAAuB,C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E,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"]}
|