@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.
- package/STL/stlFileLoader.d.ts +4 -4
- package/STL/stlFileLoader.js +4 -4
- package/STL/stlFileLoader.js.map +1 -1
- package/glTF/1.0/glTFBinaryExtension.d.ts +1 -1
- package/glTF/1.0/glTFBinaryExtension.js +1 -1
- package/glTF/1.0/glTFBinaryExtension.js.map +1 -1
- package/glTF/1.0/glTFLoader.d.ts +3 -3
- package/glTF/1.0/glTFLoader.js +3 -3
- package/glTF/1.0/glTFLoader.js.map +1 -1
- package/glTF/1.0/glTFLoaderInterfaces.d.ts +45 -45
- package/glTF/1.0/glTFLoaderInterfaces.js +8 -8
- package/glTF/1.0/glTFLoaderInterfaces.js.map +1 -1
- package/glTF/1.0/glTFLoaderUtils.d.ts +1 -1
- package/glTF/1.0/glTFLoaderUtils.js +1 -1
- package/glTF/1.0/glTFLoaderUtils.js.map +1 -1
- package/glTF/1.0/glTFMaterialsCommonExtension.d.ts +1 -1
- package/glTF/1.0/glTFMaterialsCommonExtension.js +1 -1
- package/glTF/1.0/glTFMaterialsCommonExtension.js.map +1 -1
- package/glTF/2.0/Extensions/EXT_lights_image_based.d.ts +5 -8
- package/glTF/2.0/Extensions/EXT_lights_image_based.js +4 -7
- package/glTF/2.0/Extensions/EXT_lights_image_based.js.map +1 -1
- package/glTF/2.0/Extensions/EXT_mesh_gpu_instancing.d.ts +3 -7
- package/glTF/2.0/Extensions/EXT_mesh_gpu_instancing.js +3 -7
- package/glTF/2.0/Extensions/EXT_mesh_gpu_instancing.js.map +1 -1
- package/glTF/2.0/Extensions/EXT_meshopt_compression.d.ts +3 -6
- package/glTF/2.0/Extensions/EXT_meshopt_compression.js +3 -6
- package/glTF/2.0/Extensions/EXT_meshopt_compression.js.map +1 -1
- package/glTF/2.0/Extensions/EXT_texture_webp.d.ts +3 -7
- package/glTF/2.0/Extensions/EXT_texture_webp.js +3 -7
- package/glTF/2.0/Extensions/EXT_texture_webp.js.map +1 -1
- package/glTF/2.0/Extensions/ExtrasAsMetadata.d.ts +5 -15
- package/glTF/2.0/Extensions/ExtrasAsMetadata.js +5 -15
- package/glTF/2.0/Extensions/ExtrasAsMetadata.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_animation_pointer.d.ts +14 -35
- 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 +56 -208
- package/glTF/2.0/Extensions/KHR_animation_pointer.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_draco_mesh_compression.d.ts +3 -7
- package/glTF/2.0/Extensions/KHR_draco_mesh_compression.js +3 -7
- package/glTF/2.0/Extensions/KHR_draco_mesh_compression.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_lights_punctual.d.ts +4 -8
- package/glTF/2.0/Extensions/KHR_lights_punctual.js +6 -9
- package/glTF/2.0/Extensions/KHR_lights_punctual.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_materials_clearcoat.d.ts +3 -7
- package/glTF/2.0/Extensions/KHR_materials_clearcoat.js +3 -7
- package/glTF/2.0/Extensions/KHR_materials_clearcoat.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_materials_emissive_strength.d.ts +3 -7
- package/glTF/2.0/Extensions/KHR_materials_emissive_strength.js +3 -7
- package/glTF/2.0/Extensions/KHR_materials_emissive_strength.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_materials_ior.d.ts +3 -7
- package/glTF/2.0/Extensions/KHR_materials_ior.js +3 -7
- package/glTF/2.0/Extensions/KHR_materials_ior.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_materials_iridescence.d.ts +3 -7
- package/glTF/2.0/Extensions/KHR_materials_iridescence.js +3 -7
- package/glTF/2.0/Extensions/KHR_materials_iridescence.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_materials_pbrSpecularGlossiness.d.ts +3 -7
- package/glTF/2.0/Extensions/KHR_materials_pbrSpecularGlossiness.js +3 -7
- package/glTF/2.0/Extensions/KHR_materials_pbrSpecularGlossiness.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_materials_sheen.d.ts +3 -7
- package/glTF/2.0/Extensions/KHR_materials_sheen.js +3 -7
- package/glTF/2.0/Extensions/KHR_materials_sheen.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_materials_specular.d.ts +3 -7
- package/glTF/2.0/Extensions/KHR_materials_specular.js +3 -7
- package/glTF/2.0/Extensions/KHR_materials_specular.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_materials_translucency.d.ts +3 -7
- package/glTF/2.0/Extensions/KHR_materials_translucency.js +3 -7
- package/glTF/2.0/Extensions/KHR_materials_translucency.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_materials_transmission.d.ts +3 -7
- package/glTF/2.0/Extensions/KHR_materials_transmission.js +3 -7
- package/glTF/2.0/Extensions/KHR_materials_transmission.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_materials_unlit.d.ts +3 -7
- package/glTF/2.0/Extensions/KHR_materials_unlit.js +3 -7
- package/glTF/2.0/Extensions/KHR_materials_unlit.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_materials_variants.d.ts +4 -11
- package/glTF/2.0/Extensions/KHR_materials_variants.js +4 -11
- package/glTF/2.0/Extensions/KHR_materials_variants.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_materials_volume.d.ts +3 -7
- package/glTF/2.0/Extensions/KHR_materials_volume.js +3 -7
- package/glTF/2.0/Extensions/KHR_materials_volume.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_mesh_quantization.d.ts +2 -3
- package/glTF/2.0/Extensions/KHR_mesh_quantization.js +2 -3
- package/glTF/2.0/Extensions/KHR_mesh_quantization.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_texture_basisu.d.ts +3 -7
- package/glTF/2.0/Extensions/KHR_texture_basisu.js +3 -7
- package/glTF/2.0/Extensions/KHR_texture_basisu.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_texture_transform.d.ts +3 -7
- package/glTF/2.0/Extensions/KHR_texture_transform.js +3 -7
- package/glTF/2.0/Extensions/KHR_texture_transform.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_xmp_json_ld.d.ts +2 -3
- package/glTF/2.0/Extensions/KHR_xmp_json_ld.js +2 -3
- package/glTF/2.0/Extensions/KHR_xmp_json_ld.js.map +1 -1
- package/glTF/2.0/Extensions/MSFT_audio_emitter.d.ts +6 -14
- package/glTF/2.0/Extensions/MSFT_audio_emitter.js +6 -14
- package/glTF/2.0/Extensions/MSFT_audio_emitter.js.map +1 -1
- package/glTF/2.0/Extensions/MSFT_lod.d.ts +8 -26
- package/glTF/2.0/Extensions/MSFT_lod.js +8 -26
- package/glTF/2.0/Extensions/MSFT_lod.js.map +1 -1
- package/glTF/2.0/Extensions/MSFT_minecraftMesh.d.ts +1 -1
- package/glTF/2.0/Extensions/MSFT_minecraftMesh.js +1 -1
- package/glTF/2.0/Extensions/MSFT_minecraftMesh.js.map +1 -1
- package/glTF/2.0/Extensions/MSFT_sRGBFactors.d.ts +1 -1
- package/glTF/2.0/Extensions/MSFT_sRGBFactors.js +1 -1
- package/glTF/2.0/Extensions/MSFT_sRGBFactors.js.map +1 -1
- package/glTF/2.0/glTFLoader.d.ts +55 -52
- package/glTF/2.0/glTFLoader.js +217 -91
- 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 +20 -7
- package/glTF/2.0/glTFLoaderExtension.js.map +1 -1
- package/glTF/2.0/glTFLoaderInterfaces.d.ts +58 -31
- package/glTF/2.0/glTFLoaderInterfaces.js.map +1 -1
- package/glTF/glTFFileLoader.d.ts +20 -53
- package/glTF/glTFFileLoader.js +17 -50
- package/glTF/glTFFileLoader.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
@@ -7,7 +7,7 @@ import type { Scene } from "@babylonjs/core/scene.js";
|
|
7
7
|
import type { Nullable } from "@babylonjs/core/types.js";
|
8
8
|
/**
|
9
9
|
* Enums
|
10
|
-
* @
|
10
|
+
* @internal
|
11
11
|
*/
|
12
12
|
export declare enum EComponentType {
|
13
13
|
BYTE = 5120,
|
@@ -16,12 +16,12 @@ export declare enum EComponentType {
|
|
16
16
|
UNSIGNED_SHORT = 5123,
|
17
17
|
FLOAT = 5126
|
18
18
|
}
|
19
|
-
/** @
|
19
|
+
/** @internal */
|
20
20
|
export declare enum EShaderType {
|
21
21
|
FRAGMENT = 35632,
|
22
22
|
VERTEX = 35633
|
23
23
|
}
|
24
|
-
/** @
|
24
|
+
/** @internal */
|
25
25
|
export declare enum EParameterType {
|
26
26
|
BYTE = 5120,
|
27
27
|
UNSIGNED_BYTE = 5121,
|
@@ -45,13 +45,13 @@ export declare enum EParameterType {
|
|
45
45
|
FLOAT_MAT4 = 35676,
|
46
46
|
SAMPLER_2D = 35678
|
47
47
|
}
|
48
|
-
/** @
|
48
|
+
/** @internal */
|
49
49
|
export declare enum ETextureWrapMode {
|
50
50
|
CLAMP_TO_EDGE = 33071,
|
51
51
|
MIRRORED_REPEAT = 33648,
|
52
52
|
REPEAT = 10497
|
53
53
|
}
|
54
|
-
/** @
|
54
|
+
/** @internal */
|
55
55
|
export declare enum ETextureFilterType {
|
56
56
|
NEAREST = 9728,
|
57
57
|
LINEAR = 9728,
|
@@ -60,7 +60,7 @@ export declare enum ETextureFilterType {
|
|
60
60
|
NEAREST_MIPMAP_LINEAR = 9986,
|
61
61
|
LINEAR_MIPMAP_LINEAR = 9987
|
62
62
|
}
|
63
|
-
/** @
|
63
|
+
/** @internal */
|
64
64
|
export declare enum ETextureFormat {
|
65
65
|
ALPHA = 6406,
|
66
66
|
RGB = 6407,
|
@@ -68,13 +68,13 @@ export declare enum ETextureFormat {
|
|
68
68
|
LUMINANCE = 6409,
|
69
69
|
LUMINANCE_ALPHA = 6410
|
70
70
|
}
|
71
|
-
/** @
|
71
|
+
/** @internal */
|
72
72
|
export declare enum ECullingType {
|
73
73
|
FRONT = 1028,
|
74
74
|
BACK = 1029,
|
75
75
|
FRONT_AND_BACK = 1032
|
76
76
|
}
|
77
|
-
/** @
|
77
|
+
/** @internal */
|
78
78
|
export declare enum EBlendingFunction {
|
79
79
|
ZERO = 0,
|
80
80
|
ONE = 1,
|
@@ -92,18 +92,18 @@ export declare enum EBlendingFunction {
|
|
92
92
|
ONE_MINUS_CONSTANT_ALPHA = 32772,
|
93
93
|
SRC_ALPHA_SATURATE = 776
|
94
94
|
}
|
95
|
-
/** @
|
95
|
+
/** @internal */
|
96
96
|
export interface IGLTFProperty {
|
97
97
|
extensions?: {
|
98
98
|
[key: string]: any;
|
99
99
|
};
|
100
100
|
extras?: Object;
|
101
101
|
}
|
102
|
-
/** @
|
102
|
+
/** @internal */
|
103
103
|
export interface IGLTFChildRootProperty extends IGLTFProperty {
|
104
104
|
name?: string;
|
105
105
|
}
|
106
|
-
/** @
|
106
|
+
/** @internal */
|
107
107
|
export interface IGLTFAccessor extends IGLTFChildRootProperty {
|
108
108
|
bufferView: string;
|
109
109
|
byteOffset: number;
|
@@ -115,7 +115,7 @@ export interface IGLTFAccessor extends IGLTFChildRootProperty {
|
|
115
115
|
min?: number[];
|
116
116
|
name?: string;
|
117
117
|
}
|
118
|
-
/** @
|
118
|
+
/** @internal */
|
119
119
|
export interface IGLTFBufferView extends IGLTFChildRootProperty {
|
120
120
|
buffer: string;
|
121
121
|
byteOffset: number;
|
@@ -123,24 +123,24 @@ export interface IGLTFBufferView extends IGLTFChildRootProperty {
|
|
123
123
|
byteStride: number;
|
124
124
|
target?: number;
|
125
125
|
}
|
126
|
-
/** @
|
126
|
+
/** @internal */
|
127
127
|
export interface IGLTFBuffer extends IGLTFChildRootProperty {
|
128
128
|
uri: string;
|
129
129
|
byteLength?: number;
|
130
130
|
type?: string;
|
131
131
|
}
|
132
|
-
/** @
|
132
|
+
/** @internal */
|
133
133
|
export interface IGLTFShader extends IGLTFChildRootProperty {
|
134
134
|
uri: string;
|
135
135
|
type: EShaderType;
|
136
136
|
}
|
137
|
-
/** @
|
137
|
+
/** @internal */
|
138
138
|
export interface IGLTFProgram extends IGLTFChildRootProperty {
|
139
139
|
attributes: string[];
|
140
140
|
fragmentShader: string;
|
141
141
|
vertexShader: string;
|
142
142
|
}
|
143
|
-
/** @
|
143
|
+
/** @internal */
|
144
144
|
export interface IGLTFTechniqueParameter {
|
145
145
|
type: number;
|
146
146
|
count?: number;
|
@@ -150,13 +150,13 @@ export interface IGLTFTechniqueParameter {
|
|
150
150
|
source?: string;
|
151
151
|
babylonValue?: any;
|
152
152
|
}
|
153
|
-
/** @
|
153
|
+
/** @internal */
|
154
154
|
export interface IGLTFTechniqueCommonProfile {
|
155
155
|
lightingModel: string;
|
156
156
|
texcoordBindings: Object;
|
157
157
|
parameters?: Array<any>;
|
158
158
|
}
|
159
|
-
/** @
|
159
|
+
/** @internal */
|
160
160
|
export interface IGLTFTechniqueStatesFunctions {
|
161
161
|
blendColor?: number[];
|
162
162
|
blendEquationSeparate?: number[];
|
@@ -164,12 +164,12 @@ export interface IGLTFTechniqueStatesFunctions {
|
|
164
164
|
colorMask: boolean[];
|
165
165
|
cullFace: number[];
|
166
166
|
}
|
167
|
-
/** @
|
167
|
+
/** @internal */
|
168
168
|
export interface IGLTFTechniqueStates {
|
169
169
|
enable: number[];
|
170
170
|
functions: IGLTFTechniqueStatesFunctions;
|
171
171
|
}
|
172
|
-
/** @
|
172
|
+
/** @internal */
|
173
173
|
export interface IGLTFTechnique extends IGLTFChildRootProperty {
|
174
174
|
parameters: {
|
175
175
|
[key: string]: IGLTFTechniqueParameter;
|
@@ -183,12 +183,12 @@ export interface IGLTFTechnique extends IGLTFChildRootProperty {
|
|
183
183
|
};
|
184
184
|
states: IGLTFTechniqueStates;
|
185
185
|
}
|
186
|
-
/** @
|
186
|
+
/** @internal */
|
187
187
|
export interface IGLTFMaterial extends IGLTFChildRootProperty {
|
188
188
|
technique?: string;
|
189
189
|
values: string[];
|
190
190
|
}
|
191
|
-
/** @
|
191
|
+
/** @internal */
|
192
192
|
export interface IGLTFMeshPrimitive extends IGLTFProperty {
|
193
193
|
attributes: {
|
194
194
|
[key: string]: string;
|
@@ -197,22 +197,22 @@ export interface IGLTFMeshPrimitive extends IGLTFProperty {
|
|
197
197
|
material: string;
|
198
198
|
mode?: number;
|
199
199
|
}
|
200
|
-
/** @
|
200
|
+
/** @internal */
|
201
201
|
export interface IGLTFMesh extends IGLTFChildRootProperty {
|
202
202
|
primitives: IGLTFMeshPrimitive[];
|
203
203
|
}
|
204
|
-
/** @
|
204
|
+
/** @internal */
|
205
205
|
export interface IGLTFImage extends IGLTFChildRootProperty {
|
206
206
|
uri: string;
|
207
207
|
}
|
208
|
-
/** @
|
208
|
+
/** @internal */
|
209
209
|
export interface IGLTFSampler extends IGLTFChildRootProperty {
|
210
210
|
magFilter?: number;
|
211
211
|
minFilter?: number;
|
212
212
|
wrapS?: number;
|
213
213
|
wrapT?: number;
|
214
214
|
}
|
215
|
-
/** @
|
215
|
+
/** @internal */
|
216
216
|
export interface IGLTFTexture extends IGLTFChildRootProperty {
|
217
217
|
sampler: string;
|
218
218
|
source: string;
|
@@ -222,22 +222,22 @@ export interface IGLTFTexture extends IGLTFChildRootProperty {
|
|
222
222
|
type?: number;
|
223
223
|
babylonTexture?: Texture;
|
224
224
|
}
|
225
|
-
/** @
|
225
|
+
/** @internal */
|
226
226
|
export interface IGLTFAmbienLight {
|
227
227
|
color?: number[];
|
228
228
|
}
|
229
|
-
/** @
|
229
|
+
/** @internal */
|
230
230
|
export interface IGLTFDirectionalLight {
|
231
231
|
color?: number[];
|
232
232
|
}
|
233
|
-
/** @
|
233
|
+
/** @internal */
|
234
234
|
export interface IGLTFPointLight {
|
235
235
|
color?: number[];
|
236
236
|
constantAttenuation?: number;
|
237
237
|
linearAttenuation?: number;
|
238
238
|
quadraticAttenuation?: number;
|
239
239
|
}
|
240
|
-
/** @
|
240
|
+
/** @internal */
|
241
241
|
export interface IGLTFSpotLight {
|
242
242
|
color?: number[];
|
243
243
|
constantAttenuation?: number;
|
@@ -246,45 +246,45 @@ export interface IGLTFSpotLight {
|
|
246
246
|
linearAttenuation?: number;
|
247
247
|
quadraticAttenuation?: number;
|
248
248
|
}
|
249
|
-
/** @
|
249
|
+
/** @internal */
|
250
250
|
export interface IGLTFLight extends IGLTFChildRootProperty {
|
251
251
|
type: string;
|
252
252
|
}
|
253
|
-
/** @
|
253
|
+
/** @internal */
|
254
254
|
export interface IGLTFCameraOrthographic {
|
255
255
|
xmag: number;
|
256
256
|
ymag: number;
|
257
257
|
zfar: number;
|
258
258
|
znear: number;
|
259
259
|
}
|
260
|
-
/** @
|
260
|
+
/** @internal */
|
261
261
|
export interface IGLTFCameraPerspective {
|
262
262
|
aspectRatio: number;
|
263
263
|
yfov: number;
|
264
264
|
zfar: number;
|
265
265
|
znear: number;
|
266
266
|
}
|
267
|
-
/** @
|
267
|
+
/** @internal */
|
268
268
|
export interface IGLTFCamera extends IGLTFChildRootProperty {
|
269
269
|
type: string;
|
270
270
|
}
|
271
|
-
/** @
|
271
|
+
/** @internal */
|
272
272
|
export interface IGLTFAnimationChannelTarget {
|
273
273
|
id: string;
|
274
274
|
path: string;
|
275
275
|
}
|
276
|
-
/** @
|
276
|
+
/** @internal */
|
277
277
|
export interface IGLTFAnimationChannel {
|
278
278
|
sampler: string;
|
279
279
|
target: IGLTFAnimationChannelTarget;
|
280
280
|
}
|
281
|
-
/** @
|
281
|
+
/** @internal */
|
282
282
|
export interface IGLTFAnimationSampler {
|
283
283
|
input: string;
|
284
284
|
output: string;
|
285
285
|
interpolation?: string;
|
286
286
|
}
|
287
|
-
/** @
|
287
|
+
/** @internal */
|
288
288
|
export interface IGLTFAnimation extends IGLTFChildRootProperty {
|
289
289
|
channels?: IGLTFAnimationChannel[];
|
290
290
|
parameters?: {
|
@@ -294,20 +294,20 @@ export interface IGLTFAnimation extends IGLTFChildRootProperty {
|
|
294
294
|
[key: string]: IGLTFAnimationSampler;
|
295
295
|
};
|
296
296
|
}
|
297
|
-
/** @
|
297
|
+
/** @internal */
|
298
298
|
export interface IGLTFNodeInstanceSkin {
|
299
299
|
skeletons: string[];
|
300
300
|
skin: string;
|
301
301
|
meshes: string[];
|
302
302
|
}
|
303
|
-
/** @
|
303
|
+
/** @internal */
|
304
304
|
export interface IGLTFSkins extends IGLTFChildRootProperty {
|
305
305
|
bindShapeMatrix: number[];
|
306
306
|
inverseBindMatrices: string;
|
307
307
|
jointNames: string[];
|
308
308
|
babylonSkeleton?: Skeleton;
|
309
309
|
}
|
310
|
-
/** @
|
310
|
+
/** @internal */
|
311
311
|
export interface IGLTFNode extends IGLTFChildRootProperty {
|
312
312
|
camera?: string;
|
313
313
|
children: string[];
|
@@ -322,11 +322,11 @@ export interface IGLTFNode extends IGLTFChildRootProperty {
|
|
322
322
|
translation?: number[];
|
323
323
|
babylonNode?: Node;
|
324
324
|
}
|
325
|
-
/** @
|
325
|
+
/** @internal */
|
326
326
|
export interface IGLTFScene extends IGLTFChildRootProperty {
|
327
327
|
nodes: string[];
|
328
328
|
}
|
329
|
-
/** @
|
329
|
+
/** @internal */
|
330
330
|
export interface IGLTFRuntime {
|
331
331
|
extensions: {
|
332
332
|
[key: string]: any;
|
@@ -399,13 +399,13 @@ export interface IGLTFRuntime {
|
|
399
399
|
dummyNodes: Node[];
|
400
400
|
assetContainer: Nullable<AssetContainer>;
|
401
401
|
}
|
402
|
-
/** @
|
402
|
+
/** @internal */
|
403
403
|
export interface INodeToRoot {
|
404
404
|
bone: Bone;
|
405
405
|
node: IGLTFNode;
|
406
406
|
id: string;
|
407
407
|
}
|
408
|
-
/** @
|
408
|
+
/** @internal */
|
409
409
|
export interface IJointNode {
|
410
410
|
node: IGLTFNode;
|
411
411
|
id: string;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/**
|
2
2
|
* Enums
|
3
|
-
* @
|
3
|
+
* @internal
|
4
4
|
*/
|
5
5
|
export var EComponentType;
|
6
6
|
(function (EComponentType) {
|
@@ -10,13 +10,13 @@ export var EComponentType;
|
|
10
10
|
EComponentType[EComponentType["UNSIGNED_SHORT"] = 5123] = "UNSIGNED_SHORT";
|
11
11
|
EComponentType[EComponentType["FLOAT"] = 5126] = "FLOAT";
|
12
12
|
})(EComponentType || (EComponentType = {}));
|
13
|
-
/** @
|
13
|
+
/** @internal */
|
14
14
|
export var EShaderType;
|
15
15
|
(function (EShaderType) {
|
16
16
|
EShaderType[EShaderType["FRAGMENT"] = 35632] = "FRAGMENT";
|
17
17
|
EShaderType[EShaderType["VERTEX"] = 35633] = "VERTEX";
|
18
18
|
})(EShaderType || (EShaderType = {}));
|
19
|
-
/** @
|
19
|
+
/** @internal */
|
20
20
|
export var EParameterType;
|
21
21
|
(function (EParameterType) {
|
22
22
|
EParameterType[EParameterType["BYTE"] = 5120] = "BYTE";
|
@@ -41,14 +41,14 @@ export var EParameterType;
|
|
41
41
|
EParameterType[EParameterType["FLOAT_MAT4"] = 35676] = "FLOAT_MAT4";
|
42
42
|
EParameterType[EParameterType["SAMPLER_2D"] = 35678] = "SAMPLER_2D";
|
43
43
|
})(EParameterType || (EParameterType = {}));
|
44
|
-
/** @
|
44
|
+
/** @internal */
|
45
45
|
export var ETextureWrapMode;
|
46
46
|
(function (ETextureWrapMode) {
|
47
47
|
ETextureWrapMode[ETextureWrapMode["CLAMP_TO_EDGE"] = 33071] = "CLAMP_TO_EDGE";
|
48
48
|
ETextureWrapMode[ETextureWrapMode["MIRRORED_REPEAT"] = 33648] = "MIRRORED_REPEAT";
|
49
49
|
ETextureWrapMode[ETextureWrapMode["REPEAT"] = 10497] = "REPEAT";
|
50
50
|
})(ETextureWrapMode || (ETextureWrapMode = {}));
|
51
|
-
/** @
|
51
|
+
/** @internal */
|
52
52
|
export var ETextureFilterType;
|
53
53
|
(function (ETextureFilterType) {
|
54
54
|
ETextureFilterType[ETextureFilterType["NEAREST"] = 9728] = "NEAREST";
|
@@ -58,7 +58,7 @@ export var ETextureFilterType;
|
|
58
58
|
ETextureFilterType[ETextureFilterType["NEAREST_MIPMAP_LINEAR"] = 9986] = "NEAREST_MIPMAP_LINEAR";
|
59
59
|
ETextureFilterType[ETextureFilterType["LINEAR_MIPMAP_LINEAR"] = 9987] = "LINEAR_MIPMAP_LINEAR";
|
60
60
|
})(ETextureFilterType || (ETextureFilterType = {}));
|
61
|
-
/** @
|
61
|
+
/** @internal */
|
62
62
|
export var ETextureFormat;
|
63
63
|
(function (ETextureFormat) {
|
64
64
|
ETextureFormat[ETextureFormat["ALPHA"] = 6406] = "ALPHA";
|
@@ -67,14 +67,14 @@ export var ETextureFormat;
|
|
67
67
|
ETextureFormat[ETextureFormat["LUMINANCE"] = 6409] = "LUMINANCE";
|
68
68
|
ETextureFormat[ETextureFormat["LUMINANCE_ALPHA"] = 6410] = "LUMINANCE_ALPHA";
|
69
69
|
})(ETextureFormat || (ETextureFormat = {}));
|
70
|
-
/** @
|
70
|
+
/** @internal */
|
71
71
|
export var ECullingType;
|
72
72
|
(function (ECullingType) {
|
73
73
|
ECullingType[ECullingType["FRONT"] = 1028] = "FRONT";
|
74
74
|
ECullingType[ECullingType["BACK"] = 1029] = "BACK";
|
75
75
|
ECullingType[ECullingType["FRONT_AND_BACK"] = 1032] = "FRONT_AND_BACK";
|
76
76
|
})(ECullingType || (ECullingType = {}));
|
77
|
-
/** @
|
77
|
+
/** @internal */
|
78
78
|
export var EBlendingFunction;
|
79
79
|
(function (EBlendingFunction) {
|
80
80
|
EBlendingFunction[EBlendingFunction["ZERO"] = 0] = "ZERO";
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"glTFLoaderInterfaces.js","sourceRoot":"","sources":["../../../../../../lts/loaders/generated/glTF/1.0/glTFLoaderInterfaces.ts"],"names":[],"mappings":"AAQA;;;GAGG;AACH,MAAM,CAAN,IAAY,cAMX;AAND,WAAY,cAAc;IACtB,sDAAW,CAAA;IACX,wEAAoB,CAAA;IACpB,wDAAY,CAAA;IACZ,0EAAqB,CAAA;IACrB,wDAAY,CAAA;AAChB,CAAC,EANW,cAAc,KAAd,cAAc,QAMzB;AAED,cAAc;AACd,MAAM,CAAN,IAAY,WAGX;AAHD,WAAY,WAAW;IACnB,yDAAgB,CAAA;IAChB,qDAAc,CAAA;AAClB,CAAC,EAHW,WAAW,KAAX,WAAW,QAGtB;AAED,cAAc;AACd,MAAM,CAAN,IAAY,cAsBX;AAtBD,WAAY,cAAc;IACtB,sDAAW,CAAA;IACX,wEAAoB,CAAA;IACpB,wDAAY,CAAA;IACZ,0EAAqB,CAAA;IACrB,oDAAU,CAAA;IACV,sEAAmB,CAAA;IACnB,wDAAY,CAAA;IACZ,mEAAkB,CAAA;IAClB,mEAAkB,CAAA;IAClB,mEAAkB,CAAA;IAClB,+DAAgB,CAAA;IAChB,+DAAgB,CAAA;IAChB,+DAAgB,CAAA;IAChB,uDAAY,CAAA;IACZ,iEAAiB,CAAA;IACjB,iEAAiB,CAAA;IACjB,iEAAiB,CAAA;IACjB,mEAAkB,CAAA;IAClB,mEAAkB,CAAA;IAClB,mEAAkB,CAAA;IAClB,mEAAkB,CAAA;AACtB,CAAC,EAtBW,cAAc,KAAd,cAAc,QAsBzB;AAED,cAAc;AACd,MAAM,CAAN,IAAY,gBAIX;AAJD,WAAY,gBAAgB;IACxB,6EAAqB,CAAA;IACrB,iFAAuB,CAAA;IACvB,+DAAc,CAAA;AAClB,CAAC,EAJW,gBAAgB,KAAhB,gBAAgB,QAI3B;AAED,cAAc;AACd,MAAM,CAAN,IAAY,kBAOX;AAPD,WAAY,kBAAkB;IAC1B,oEAAc,CAAA;IACd,kEAAa,CAAA;IACb,kGAA6B,CAAA;IAC7B,gGAA4B,CAAA;IAC5B,gGAA4B,CAAA;IAC5B,8FAA2B,CAAA;AAC/B,CAAC,EAPW,kBAAkB,KAAlB,kBAAkB,QAO7B;AAED,cAAc;AACd,MAAM,CAAN,IAAY,cAMX;AAND,WAAY,cAAc;IACtB,wDAAY,CAAA;IACZ,oDAAU,CAAA;IACV,sDAAW,CAAA;IACX,gEAAgB,CAAA;IAChB,4EAAsB,CAAA;AAC1B,CAAC,EANW,cAAc,KAAd,cAAc,QAMzB;AAED,cAAc;AACd,MAAM,CAAN,IAAY,YAIX;AAJD,WAAY,YAAY;IACpB,oDAAY,CAAA;IACZ,kDAAW,CAAA;IACX,sEAAqB,CAAA;AACzB,CAAC,EAJW,YAAY,KAAZ,YAAY,QAIvB;AAED,cAAc;AACd,MAAM,CAAN,IAAY,iBAgBX;AAhBD,WAAY,iBAAiB;IACzB,yDAAQ,CAAA;IACR,uDAAO,CAAA;IACP,qEAAe,CAAA;IACf,yFAAyB,CAAA;IACzB,qEAAe,CAAA;IACf,yFAAyB,CAAA;IACzB,qEAAe,CAAA;IACf,yFAAyB,CAAA;IACzB,qEAAe,CAAA;IACf,yFAAyB,CAAA;IACzB,iFAAsB,CAAA;IACtB,qGAAgC,CAAA;IAChC,iFAAsB,CAAA;IACtB,qGAAgC,CAAA;IAChC,uFAAwB,CAAA;AAC5B,CAAC,EAhBW,iBAAiB,KAAjB,iBAAiB,QAgB5B","sourcesContent":["import type { AssetContainer } from \"core/assetContainer\";\r\nimport type { Bone } from \"core/Bones/bone\";\r\nimport type { Skeleton } from \"core/Bones/skeleton\";\r\nimport type { Texture } from \"core/Materials/Textures/texture\";\r\nimport type { Node } from \"core/node\";\r\nimport type { Scene } from \"core/scene\";\r\nimport type { Nullable } from \"core/types\";\r\n\r\n/**\r\n * Enums\r\n * @hidden\r\n */\r\nexport enum EComponentType {\r\n BYTE = 5120,\r\n UNSIGNED_BYTE = 5121,\r\n SHORT = 5122,\r\n UNSIGNED_SHORT = 5123,\r\n FLOAT = 5126,\r\n}\r\n\r\n/** @hidden */\r\nexport enum EShaderType {\r\n FRAGMENT = 35632,\r\n VERTEX = 35633,\r\n}\r\n\r\n/** @hidden */\r\nexport enum EParameterType {\r\n BYTE = 5120,\r\n UNSIGNED_BYTE = 5121,\r\n SHORT = 5122,\r\n UNSIGNED_SHORT = 5123,\r\n INT = 5124,\r\n UNSIGNED_INT = 5125,\r\n FLOAT = 5126,\r\n FLOAT_VEC2 = 35664,\r\n FLOAT_VEC3 = 35665,\r\n FLOAT_VEC4 = 35666,\r\n INT_VEC2 = 35667,\r\n INT_VEC3 = 35668,\r\n INT_VEC4 = 35669,\r\n BOOL = 35670,\r\n BOOL_VEC2 = 35671,\r\n BOOL_VEC3 = 35672,\r\n BOOL_VEC4 = 35673,\r\n FLOAT_MAT2 = 35674,\r\n FLOAT_MAT3 = 35675,\r\n FLOAT_MAT4 = 35676,\r\n SAMPLER_2D = 35678,\r\n}\r\n\r\n/** @hidden */\r\nexport enum ETextureWrapMode {\r\n CLAMP_TO_EDGE = 33071,\r\n MIRRORED_REPEAT = 33648,\r\n REPEAT = 10497,\r\n}\r\n\r\n/** @hidden */\r\nexport enum ETextureFilterType {\r\n NEAREST = 9728,\r\n LINEAR = 9728,\r\n NEAREST_MIPMAP_NEAREST = 9984,\r\n LINEAR_MIPMAP_NEAREST = 9985,\r\n NEAREST_MIPMAP_LINEAR = 9986,\r\n LINEAR_MIPMAP_LINEAR = 9987,\r\n}\r\n\r\n/** @hidden */\r\nexport enum ETextureFormat {\r\n ALPHA = 6406,\r\n RGB = 6407,\r\n RGBA = 6408,\r\n LUMINANCE = 6409,\r\n LUMINANCE_ALPHA = 6410,\r\n}\r\n\r\n/** @hidden */\r\nexport enum ECullingType {\r\n FRONT = 1028,\r\n BACK = 1029,\r\n FRONT_AND_BACK = 1032,\r\n}\r\n\r\n/** @hidden */\r\nexport enum EBlendingFunction {\r\n ZERO = 0,\r\n ONE = 1,\r\n SRC_COLOR = 768,\r\n ONE_MINUS_SRC_COLOR = 769,\r\n DST_COLOR = 774,\r\n ONE_MINUS_DST_COLOR = 775,\r\n SRC_ALPHA = 770,\r\n ONE_MINUS_SRC_ALPHA = 771,\r\n DST_ALPHA = 772,\r\n ONE_MINUS_DST_ALPHA = 773,\r\n CONSTANT_COLOR = 32769,\r\n ONE_MINUS_CONSTANT_COLOR = 32770,\r\n CONSTANT_ALPHA = 32771,\r\n ONE_MINUS_CONSTANT_ALPHA = 32772,\r\n SRC_ALPHA_SATURATE = 776,\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFProperty {\r\n extensions?: { [key: string]: any };\r\n extras?: Object;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFChildRootProperty extends IGLTFProperty {\r\n name?: string;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFAccessor extends IGLTFChildRootProperty {\r\n bufferView: string;\r\n byteOffset: number;\r\n byteStride: number;\r\n count: number;\r\n type: string;\r\n componentType: EComponentType;\r\n\r\n max?: number[];\r\n min?: number[];\r\n name?: string;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFBufferView extends IGLTFChildRootProperty {\r\n buffer: string;\r\n byteOffset: number;\r\n byteLength: number;\r\n byteStride: number;\r\n\r\n target?: number;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFBuffer extends IGLTFChildRootProperty {\r\n uri: string;\r\n\r\n byteLength?: number;\r\n type?: string;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFShader extends IGLTFChildRootProperty {\r\n uri: string;\r\n type: EShaderType;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFProgram extends IGLTFChildRootProperty {\r\n attributes: string[];\r\n fragmentShader: string;\r\n vertexShader: string;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFTechniqueParameter {\r\n type: number;\r\n\r\n count?: number;\r\n semantic?: string;\r\n node?: string;\r\n value?: number | boolean | string | Array<any>;\r\n source?: string;\r\n\r\n babylonValue?: any;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFTechniqueCommonProfile {\r\n lightingModel: string;\r\n texcoordBindings: Object;\r\n\r\n parameters?: Array<any>;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFTechniqueStatesFunctions {\r\n blendColor?: number[];\r\n blendEquationSeparate?: number[];\r\n blendFuncSeparate?: number[];\r\n colorMask: boolean[];\r\n cullFace: number[];\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFTechniqueStates {\r\n enable: number[];\r\n functions: IGLTFTechniqueStatesFunctions;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFTechnique extends IGLTFChildRootProperty {\r\n parameters: { [key: string]: IGLTFTechniqueParameter };\r\n program: string;\r\n\r\n attributes: { [key: string]: string };\r\n uniforms: { [key: string]: string };\r\n states: IGLTFTechniqueStates;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFMaterial extends IGLTFChildRootProperty {\r\n technique?: string;\r\n values: string[];\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFMeshPrimitive extends IGLTFProperty {\r\n attributes: { [key: string]: string };\r\n indices: string;\r\n material: string;\r\n\r\n mode?: number;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFMesh extends IGLTFChildRootProperty {\r\n primitives: IGLTFMeshPrimitive[];\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFImage extends IGLTFChildRootProperty {\r\n uri: string;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFSampler extends IGLTFChildRootProperty {\r\n magFilter?: number;\r\n minFilter?: number;\r\n wrapS?: number;\r\n wrapT?: number;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFTexture extends IGLTFChildRootProperty {\r\n sampler: string;\r\n source: string;\r\n\r\n format?: ETextureFormat;\r\n internalFormat?: ETextureFormat;\r\n target?: number;\r\n type?: number;\r\n\r\n // Babylon.js values (optimize)\r\n babylonTexture?: Texture;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFAmbienLight {\r\n color?: number[];\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFDirectionalLight {\r\n color?: number[];\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFPointLight {\r\n color?: number[];\r\n constantAttenuation?: number;\r\n linearAttenuation?: number;\r\n quadraticAttenuation?: number;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFSpotLight {\r\n color?: number[];\r\n constantAttenuation?: number;\r\n fallOfAngle?: number;\r\n fallOffExponent?: number;\r\n linearAttenuation?: number;\r\n quadraticAttenuation?: number;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFLight extends IGLTFChildRootProperty {\r\n type: string;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFCameraOrthographic {\r\n xmag: number;\r\n ymag: number;\r\n zfar: number;\r\n znear: number;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFCameraPerspective {\r\n aspectRatio: number;\r\n yfov: number;\r\n zfar: number;\r\n znear: number;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFCamera extends IGLTFChildRootProperty {\r\n type: string;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFAnimationChannelTarget {\r\n id: string;\r\n path: string;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFAnimationChannel {\r\n sampler: string;\r\n target: IGLTFAnimationChannelTarget;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFAnimationSampler {\r\n input: string;\r\n output: string;\r\n\r\n interpolation?: string;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFAnimation extends IGLTFChildRootProperty {\r\n channels?: IGLTFAnimationChannel[];\r\n parameters?: { [key: string]: string };\r\n samplers?: { [key: string]: IGLTFAnimationSampler };\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFNodeInstanceSkin {\r\n skeletons: string[];\r\n skin: string;\r\n meshes: string[];\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFSkins extends IGLTFChildRootProperty {\r\n bindShapeMatrix: number[];\r\n inverseBindMatrices: string;\r\n jointNames: string[];\r\n\r\n babylonSkeleton?: Skeleton;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFNode extends IGLTFChildRootProperty {\r\n camera?: string;\r\n children: string[];\r\n skin?: string;\r\n jointName?: string;\r\n light?: string;\r\n matrix: number[];\r\n mesh?: string;\r\n meshes?: string[];\r\n rotation?: number[];\r\n scale?: number[];\r\n translation?: number[];\r\n\r\n // Babylon.js values (optimize)\r\n babylonNode?: Node;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFScene extends IGLTFChildRootProperty {\r\n nodes: string[];\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFRuntime {\r\n extensions: { [key: string]: any };\r\n accessors: { [key: string]: IGLTFAccessor };\r\n buffers: { [key: string]: IGLTFBuffer };\r\n bufferViews: { [key: string]: IGLTFBufferView };\r\n meshes: { [key: string]: IGLTFMesh };\r\n lights: { [key: string]: IGLTFLight };\r\n cameras: { [key: string]: IGLTFCamera };\r\n nodes: { [key: string]: IGLTFNode };\r\n images: { [key: string]: IGLTFImage };\r\n textures: { [key: string]: IGLTFTexture };\r\n shaders: { [key: string]: IGLTFShader };\r\n programs: { [key: string]: IGLTFProgram };\r\n samplers: { [key: string]: IGLTFSampler };\r\n techniques: { [key: string]: IGLTFTechnique };\r\n materials: { [key: string]: IGLTFMaterial };\r\n animations: { [key: string]: IGLTFAnimation };\r\n skins: { [key: string]: IGLTFSkins };\r\n\r\n currentScene?: Object;\r\n scenes: { [key: string]: IGLTFScene }; // v1.1\r\n\r\n extensionsUsed: string[];\r\n extensionsRequired?: string[]; // v1.1\r\n\r\n buffersCount: number;\r\n shaderscount: number;\r\n\r\n scene: Scene;\r\n rootUrl: string;\r\n\r\n loadedBufferCount: number;\r\n loadedBufferViews: { [name: string]: ArrayBufferView };\r\n\r\n loadedShaderCount: number;\r\n\r\n importOnlyMeshes: boolean;\r\n importMeshesNames?: string[];\r\n\r\n dummyNodes: Node[];\r\n\r\n assetContainer: Nullable<AssetContainer>;\r\n}\r\n\r\n/** @hidden */\r\nexport interface INodeToRoot {\r\n bone: Bone;\r\n node: IGLTFNode;\r\n id: string;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IJointNode {\r\n node: IGLTFNode;\r\n id: string;\r\n}\r\n"]}
|
1
|
+
{"version":3,"file":"glTFLoaderInterfaces.js","sourceRoot":"","sources":["../../../../../../lts/loaders/generated/glTF/1.0/glTFLoaderInterfaces.ts"],"names":[],"mappings":"AAQA;;;GAGG;AACH,MAAM,CAAN,IAAY,cAMX;AAND,WAAY,cAAc;IACtB,sDAAW,CAAA;IACX,wEAAoB,CAAA;IACpB,wDAAY,CAAA;IACZ,0EAAqB,CAAA;IACrB,wDAAY,CAAA;AAChB,CAAC,EANW,cAAc,KAAd,cAAc,QAMzB;AAED,gBAAgB;AAChB,MAAM,CAAN,IAAY,WAGX;AAHD,WAAY,WAAW;IACnB,yDAAgB,CAAA;IAChB,qDAAc,CAAA;AAClB,CAAC,EAHW,WAAW,KAAX,WAAW,QAGtB;AAED,gBAAgB;AAChB,MAAM,CAAN,IAAY,cAsBX;AAtBD,WAAY,cAAc;IACtB,sDAAW,CAAA;IACX,wEAAoB,CAAA;IACpB,wDAAY,CAAA;IACZ,0EAAqB,CAAA;IACrB,oDAAU,CAAA;IACV,sEAAmB,CAAA;IACnB,wDAAY,CAAA;IACZ,mEAAkB,CAAA;IAClB,mEAAkB,CAAA;IAClB,mEAAkB,CAAA;IAClB,+DAAgB,CAAA;IAChB,+DAAgB,CAAA;IAChB,+DAAgB,CAAA;IAChB,uDAAY,CAAA;IACZ,iEAAiB,CAAA;IACjB,iEAAiB,CAAA;IACjB,iEAAiB,CAAA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GAAgC,CAAA;IAChC,uFAAwB,CAAA;AAC5B,CAAC,EAhBW,iBAAiB,KAAjB,iBAAiB,QAgB5B","sourcesContent":["import type { AssetContainer } from \"core/assetContainer\";\r\nimport type { Bone } from \"core/Bones/bone\";\r\nimport type { Skeleton } from \"core/Bones/skeleton\";\r\nimport type { Texture } from \"core/Materials/Textures/texture\";\r\nimport type { Node } from \"core/node\";\r\nimport type { Scene } from \"core/scene\";\r\nimport type { Nullable } from \"core/types\";\r\n\r\n/**\r\n * Enums\r\n * @internal\r\n */\r\nexport enum EComponentType {\r\n BYTE = 5120,\r\n UNSIGNED_BYTE = 5121,\r\n SHORT = 5122,\r\n UNSIGNED_SHORT = 5123,\r\n FLOAT = 5126,\r\n}\r\n\r\n/** @internal */\r\nexport enum EShaderType {\r\n FRAGMENT = 35632,\r\n VERTEX = 35633,\r\n}\r\n\r\n/** @internal */\r\nexport enum EParameterType {\r\n BYTE = 5120,\r\n UNSIGNED_BYTE = 5121,\r\n SHORT = 5122,\r\n UNSIGNED_SHORT = 5123,\r\n INT = 5124,\r\n UNSIGNED_INT = 5125,\r\n FLOAT = 5126,\r\n FLOAT_VEC2 = 35664,\r\n FLOAT_VEC3 = 35665,\r\n FLOAT_VEC4 = 35666,\r\n INT_VEC2 = 35667,\r\n INT_VEC3 = 35668,\r\n INT_VEC4 = 35669,\r\n BOOL = 35670,\r\n BOOL_VEC2 = 35671,\r\n BOOL_VEC3 = 35672,\r\n BOOL_VEC4 = 35673,\r\n FLOAT_MAT2 = 35674,\r\n FLOAT_MAT3 = 35675,\r\n FLOAT_MAT4 = 35676,\r\n SAMPLER_2D = 35678,\r\n}\r\n\r\n/** @internal */\r\nexport enum ETextureWrapMode {\r\n CLAMP_TO_EDGE = 33071,\r\n MIRRORED_REPEAT = 33648,\r\n REPEAT = 10497,\r\n}\r\n\r\n/** @internal */\r\nexport enum ETextureFilterType {\r\n NEAREST = 9728,\r\n LINEAR = 9728,\r\n NEAREST_MIPMAP_NEAREST = 9984,\r\n LINEAR_MIPMAP_NEAREST = 9985,\r\n NEAREST_MIPMAP_LINEAR = 9986,\r\n LINEAR_MIPMAP_LINEAR = 9987,\r\n}\r\n\r\n/** @internal */\r\nexport enum ETextureFormat {\r\n ALPHA = 6406,\r\n RGB = 6407,\r\n RGBA = 6408,\r\n LUMINANCE = 6409,\r\n LUMINANCE_ALPHA = 6410,\r\n}\r\n\r\n/** @internal */\r\nexport enum ECullingType {\r\n FRONT = 1028,\r\n BACK = 1029,\r\n FRONT_AND_BACK = 1032,\r\n}\r\n\r\n/** @internal */\r\nexport enum EBlendingFunction {\r\n ZERO = 0,\r\n ONE = 1,\r\n SRC_COLOR = 768,\r\n ONE_MINUS_SRC_COLOR = 769,\r\n DST_COLOR = 774,\r\n ONE_MINUS_DST_COLOR = 775,\r\n SRC_ALPHA = 770,\r\n ONE_MINUS_SRC_ALPHA = 771,\r\n DST_ALPHA = 772,\r\n ONE_MINUS_DST_ALPHA = 773,\r\n CONSTANT_COLOR = 32769,\r\n ONE_MINUS_CONSTANT_COLOR = 32770,\r\n CONSTANT_ALPHA = 32771,\r\n ONE_MINUS_CONSTANT_ALPHA = 32772,\r\n SRC_ALPHA_SATURATE = 776,\r\n}\r\n\r\n/** @internal */\r\nexport interface IGLTFProperty {\r\n extensions?: { [key: string]: any };\r\n extras?: Object;\r\n}\r\n\r\n/** @internal */\r\nexport interface IGLTFChildRootProperty extends IGLTFProperty {\r\n name?: string;\r\n}\r\n\r\n/** @internal */\r\nexport interface IGLTFAccessor extends IGLTFChildRootProperty {\r\n bufferView: string;\r\n byteOffset: number;\r\n byteStride: number;\r\n count: number;\r\n type: string;\r\n componentType: EComponentType;\r\n\r\n max?: number[];\r\n min?: number[];\r\n name?: string;\r\n}\r\n\r\n/** @internal */\r\nexport interface IGLTFBufferView extends IGLTFChildRootProperty {\r\n buffer: string;\r\n byteOffset: number;\r\n byteLength: number;\r\n byteStride: number;\r\n\r\n target?: number;\r\n}\r\n\r\n/** @internal */\r\nexport interface IGLTFBuffer extends IGLTFChildRootProperty {\r\n uri: string;\r\n\r\n byteLength?: number;\r\n type?: string;\r\n}\r\n\r\n/** @internal */\r\nexport interface IGLTFShader extends IGLTFChildRootProperty {\r\n uri: string;\r\n type: EShaderType;\r\n}\r\n\r\n/** @internal */\r\nexport interface IGLTFProgram extends IGLTFChildRootProperty {\r\n attributes: string[];\r\n fragmentShader: string;\r\n vertexShader: string;\r\n}\r\n\r\n/** @internal */\r\nexport interface IGLTFTechniqueParameter {\r\n type: number;\r\n\r\n count?: number;\r\n semantic?: string;\r\n node?: string;\r\n value?: number | boolean | string | Array<any>;\r\n source?: string;\r\n\r\n babylonValue?: any;\r\n}\r\n\r\n/** @internal */\r\nexport interface IGLTFTechniqueCommonProfile {\r\n lightingModel: string;\r\n texcoordBindings: Object;\r\n\r\n parameters?: Array<any>;\r\n}\r\n\r\n/** @internal */\r\nexport interface IGLTFTechniqueStatesFunctions {\r\n blendColor?: number[];\r\n blendEquationSeparate?: number[];\r\n blendFuncSeparate?: number[];\r\n colorMask: boolean[];\r\n cullFace: number[];\r\n}\r\n\r\n/** @internal */\r\nexport interface IGLTFTechniqueStates {\r\n enable: number[];\r\n functions: IGLTFTechniqueStatesFunctions;\r\n}\r\n\r\n/** @internal */\r\nexport interface IGLTFTechnique extends IGLTFChildRootProperty {\r\n parameters: { [key: string]: IGLTFTechniqueParameter };\r\n program: string;\r\n\r\n attributes: { [key: string]: string };\r\n uniforms: { [key: string]: string };\r\n states: IGLTFTechniqueStates;\r\n}\r\n\r\n/** @internal */\r\nexport interface IGLTFMaterial extends IGLTFChildRootProperty {\r\n technique?: string;\r\n values: string[];\r\n}\r\n\r\n/** @internal */\r\nexport interface IGLTFMeshPrimitive extends IGLTFProperty {\r\n attributes: { [key: string]: string };\r\n indices: string;\r\n material: string;\r\n\r\n mode?: number;\r\n}\r\n\r\n/** @internal */\r\nexport interface IGLTFMesh extends IGLTFChildRootProperty {\r\n primitives: IGLTFMeshPrimitive[];\r\n}\r\n\r\n/** @internal */\r\nexport interface IGLTFImage extends IGLTFChildRootProperty {\r\n uri: string;\r\n}\r\n\r\n/** @internal */\r\nexport interface IGLTFSampler extends IGLTFChildRootProperty {\r\n magFilter?: number;\r\n minFilter?: number;\r\n wrapS?: number;\r\n wrapT?: number;\r\n}\r\n\r\n/** @internal */\r\nexport interface IGLTFTexture extends IGLTFChildRootProperty {\r\n sampler: string;\r\n source: string;\r\n\r\n format?: ETextureFormat;\r\n internalFormat?: ETextureFormat;\r\n target?: number;\r\n type?: number;\r\n\r\n // Babylon.js values (optimize)\r\n babylonTexture?: Texture;\r\n}\r\n\r\n/** @internal */\r\nexport interface IGLTFAmbienLight {\r\n color?: number[];\r\n}\r\n\r\n/** @internal */\r\nexport interface IGLTFDirectionalLight {\r\n color?: number[];\r\n}\r\n\r\n/** @internal */\r\nexport interface IGLTFPointLight {\r\n color?: number[];\r\n constantAttenuation?: number;\r\n linearAttenuation?: number;\r\n quadraticAttenuation?: number;\r\n}\r\n\r\n/** @internal */\r\nexport interface IGLTFSpotLight {\r\n color?: number[];\r\n constantAttenuation?: number;\r\n fallOfAngle?: number;\r\n fallOffExponent?: number;\r\n linearAttenuation?: number;\r\n quadraticAttenuation?: number;\r\n}\r\n\r\n/** @internal */\r\nexport interface IGLTFLight extends IGLTFChildRootProperty {\r\n type: string;\r\n}\r\n\r\n/** @internal */\r\nexport interface IGLTFCameraOrthographic {\r\n xmag: number;\r\n ymag: number;\r\n zfar: number;\r\n znear: number;\r\n}\r\n\r\n/** @internal */\r\nexport interface IGLTFCameraPerspective {\r\n aspectRatio: number;\r\n yfov: number;\r\n zfar: number;\r\n znear: number;\r\n}\r\n\r\n/** @internal */\r\nexport interface IGLTFCamera extends IGLTFChildRootProperty {\r\n type: string;\r\n}\r\n\r\n/** @internal */\r\nexport interface IGLTFAnimationChannelTarget {\r\n id: string;\r\n path: string;\r\n}\r\n\r\n/** @internal */\r\nexport interface IGLTFAnimationChannel {\r\n sampler: string;\r\n target: IGLTFAnimationChannelTarget;\r\n}\r\n\r\n/** @internal */\r\nexport interface IGLTFAnimationSampler {\r\n input: string;\r\n output: string;\r\n\r\n interpolation?: string;\r\n}\r\n\r\n/** @internal */\r\nexport interface IGLTFAnimation extends IGLTFChildRootProperty {\r\n channels?: IGLTFAnimationChannel[];\r\n parameters?: { [key: string]: string };\r\n samplers?: { [key: string]: IGLTFAnimationSampler };\r\n}\r\n\r\n/** @internal */\r\nexport interface IGLTFNodeInstanceSkin {\r\n skeletons: string[];\r\n skin: string;\r\n meshes: string[];\r\n}\r\n\r\n/** @internal */\r\nexport interface IGLTFSkins extends IGLTFChildRootProperty {\r\n bindShapeMatrix: number[];\r\n inverseBindMatrices: string;\r\n jointNames: string[];\r\n\r\n babylonSkeleton?: Skeleton;\r\n}\r\n\r\n/** @internal */\r\nexport interface IGLTFNode extends IGLTFChildRootProperty {\r\n camera?: string;\r\n children: string[];\r\n skin?: string;\r\n jointName?: string;\r\n light?: string;\r\n matrix: number[];\r\n mesh?: string;\r\n meshes?: string[];\r\n rotation?: number[];\r\n scale?: number[];\r\n translation?: number[];\r\n\r\n // Babylon.js values (optimize)\r\n babylonNode?: Node;\r\n}\r\n\r\n/** @internal */\r\nexport interface IGLTFScene extends IGLTFChildRootProperty {\r\n nodes: string[];\r\n}\r\n\r\n/** @internal */\r\nexport interface IGLTFRuntime {\r\n extensions: { [key: string]: any };\r\n accessors: { [key: string]: IGLTFAccessor };\r\n buffers: { [key: string]: IGLTFBuffer };\r\n bufferViews: { [key: string]: IGLTFBufferView };\r\n meshes: { [key: string]: IGLTFMesh };\r\n lights: { [key: string]: IGLTFLight };\r\n cameras: { [key: string]: IGLTFCamera };\r\n nodes: { [key: string]: IGLTFNode };\r\n images: { [key: string]: IGLTFImage };\r\n textures: { [key: string]: IGLTFTexture };\r\n shaders: { [key: string]: IGLTFShader };\r\n programs: { [key: string]: IGLTFProgram };\r\n samplers: { [key: string]: IGLTFSampler };\r\n techniques: { [key: string]: IGLTFTechnique };\r\n materials: { [key: string]: IGLTFMaterial };\r\n animations: { [key: string]: IGLTFAnimation };\r\n skins: { [key: string]: IGLTFSkins };\r\n\r\n currentScene?: Object;\r\n scenes: { [key: string]: IGLTFScene }; // v1.1\r\n\r\n extensionsUsed: string[];\r\n extensionsRequired?: string[]; // v1.1\r\n\r\n buffersCount: number;\r\n shaderscount: number;\r\n\r\n scene: Scene;\r\n rootUrl: string;\r\n\r\n loadedBufferCount: number;\r\n loadedBufferViews: { [name: string]: ArrayBufferView };\r\n\r\n loadedShaderCount: number;\r\n\r\n importOnlyMeshes: boolean;\r\n importMeshesNames?: string[];\r\n\r\n dummyNodes: Node[];\r\n\r\n assetContainer: Nullable<AssetContainer>;\r\n}\r\n\r\n/** @internal */\r\nexport interface INodeToRoot {\r\n bone: Bone;\r\n node: IGLTFNode;\r\n id: string;\r\n}\r\n\r\n/** @internal */\r\nexport interface IJointNode {\r\n node: IGLTFNode;\r\n id: string;\r\n}\r\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"glTFLoaderUtils.js","sourceRoot":"","sources":["../../../../../../lts/loaders/generated/glTF/1.0/glTFLoaderUtils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAG9G,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,6CAA+B;AAC3E,OAAO,EAAE,MAAM,EAAE,4CAA8B;AAC/C,OAAO,EAAE,MAAM,EAAE,4CAA8B;AAC/C,OAAO,EAAE,cAAc,EAAE,oDAAsC;AAC/D,OAAO,EAAE,OAAO,EAAE,sDAAwC;AAI1D;;;;GAIG;AACH,MAAM,OAAO,SAAS;IAClB;;;;;;;OAOG;IACI,MAAM,CAAC,SAAS,CAAC,KAAY,EAAE,MAAY,EAAE,SAAkC,EAAE,WAAmB,EAAE,cAAuC;QAChJ,IAAI,GAAG,GAAqB,IAA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AAI,CAAC,IAAI,CAAC,CAAC;YAEb,MAAM,CAAC,YAAY,CAAC,gCAAgC,CAAC,GAAG;gBACpD,wBAAwB;gBACxB,EAAE;gBACF,0BAA0B;gBAC1B,EAAE;gBACF,iBAAiB;gBACjB,GAAG;gBACH,gCAAgC;gBAChC,GAAG;aACN,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAEb,MAAM,UAAU,GAAG;gBACf,MAAM,EAAE,qBAAqB;gBAC7B,QAAQ,EAAE,qBAAqB;aAClC,CAAC;YAEF,MAAM,OAAO,GAAG;gBACZ,UAAU,EAAE,CAAC,UAAU,CAAC;gBACxB,QAAQ,EAAE,CAAC,WAAW,EAAE,YAAY,EAAE,YAAY,CAAC;gBACnD,QAAQ,EAAE,IAAI,KAAK,EAAU;gBAC7B,iBAAiB,EAAE,KAAK;aAC3B,CAAC;YAEF,SAAS,CAAC,gBAAgB,GAAG,IAAI,cAAc,CAAC,qBAAqB,EAAE,KAAK,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC;YACnG,SAAS,CAAC,gBAAgB,CAAC,SAAS,CAAC,YAAY,EAAE,IAAI,MAAM,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;SACtF;QAED,OAAO,SAAS,CAAC,gBAAgB,CAAC;IACtC,CAAC;;AAED,4BAA4B;AACb,0BAAgB,GAA6B,IAAI,CAAC","sourcesContent":["import type { IGLTFTechniqueParameter, IGLTFAccessor, IGLTFRuntime, IGLTFBufferView } from \"./glTFLoaderInterfaces\";\r\nimport { EParameterType, ETextureWrapMode, ETextureFilterType, EComponentType } from \"./glTFLoaderInterfaces\";\r\n\r\nimport type { Nullable } from \"core/types\";\r\nimport { Vector2, Vector3, Vector4, Matrix } from \"core/Maths/math.vector\";\r\nimport { Color4 } from \"core/Maths/math.color\";\r\nimport { Effect } from \"core/Materials/effect\";\r\nimport { ShaderMaterial } from \"core/Materials/shaderMaterial\";\r\nimport { Texture } from \"core/Materials/Textures/texture\";\r\nimport type { Node } from \"core/node\";\r\nimport type { Scene } from \"core/scene\";\r\n\r\n/**\r\n * Utils functions for GLTF\r\n * @hidden\r\n * @deprecated\r\n */\r\nexport class GLTFUtils {\r\n /**\r\n * Sets the given \"parameter\" matrix\r\n * @param scene the Scene object\r\n * @param source the source node where to pick the matrix\r\n * @param parameter the GLTF technique parameter\r\n * @param uniformName the name of the shader's uniform\r\n * @param shaderMaterial the shader material\r\n */\r\n public static SetMatrix(scene: Scene, source: Node, parameter: IGLTFTechniqueParameter, uniformName: string, shaderMaterial: ShaderMaterial | Effect): void {\r\n let mat: Nullable<Matrix> = null;\r\n\r\n if (parameter.semantic === \"MODEL\") {\r\n mat = source.getWorldMatrix();\r\n } else if (parameter.semantic === \"PROJECTION\") {\r\n mat = scene.getProjectionMatrix();\r\n } else if (parameter.semantic === \"VIEW\") {\r\n mat = scene.getViewMatrix();\r\n } else if (parameter.semantic === \"MODELVIEWINVERSETRANSPOSE\") {\r\n mat = Matrix.Transpose(source.getWorldMatrix().multiply(scene.getViewMatrix()).invert());\r\n } else if (parameter.semantic === \"MODELVIEW\") {\r\n mat = source.getWorldMatrix().multiply(scene.getViewMatrix());\r\n } else if (parameter.semantic === \"MODELVIEWPROJECTION\") {\r\n mat = source.getWorldMatrix().multiply(scene.getTransformMatrix());\r\n } else if (parameter.semantic === \"MODELINVERSE\") {\r\n mat = source.getWorldMatrix().invert();\r\n } else if (parameter.semantic === \"VIEWINVERSE\") {\r\n mat = scene.getViewMatrix().invert();\r\n } else if (parameter.semantic === \"PROJECTIONINVERSE\") {\r\n mat = scene.getProjectionMatrix().invert();\r\n } else if (parameter.semantic === \"MODELVIEWINVERSE\") {\r\n mat = source.getWorldMatrix().multiply(scene.getViewMatrix()).invert();\r\n } else if (parameter.semantic === \"MODELVIEWPROJECTIONINVERSE\") {\r\n mat = source.getWorldMatrix().multiply(scene.getTransformMatrix()).invert();\r\n } else if (parameter.semantic === \"MODELINVERSETRANSPOSE\") {\r\n mat = Matrix.Transpose(source.getWorldMatrix().invert());\r\n }\r\n\r\n if (mat) {\r\n switch (parameter.type) {\r\n case EParameterType.FLOAT_MAT2:\r\n shaderMaterial.setMatrix2x2(uniformName, Matrix.GetAsMatrix2x2(mat));\r\n break;\r\n case EParameterType.FLOAT_MAT3:\r\n shaderMaterial.setMatrix3x3(uniformName, Matrix.GetAsMatrix3x3(mat));\r\n break;\r\n case EParameterType.FLOAT_MAT4:\r\n shaderMaterial.setMatrix(uniformName, mat);\r\n break;\r\n default:\r\n break;\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Sets the given \"parameter\" matrix\r\n * @param shaderMaterial the shader material\r\n * @param uniform the name of the shader's uniform\r\n * @param value the value of the uniform\r\n * @param type the uniform's type (EParameterType FLOAT, VEC2, VEC3 or VEC4)\r\n */\r\n public static SetUniform(shaderMaterial: ShaderMaterial | Effect, uniform: string, value: any, type: number): boolean {\r\n switch (type) {\r\n case EParameterType.FLOAT:\r\n shaderMaterial.setFloat(uniform, value);\r\n return true;\r\n case EParameterType.FLOAT_VEC2:\r\n shaderMaterial.setVector2(uniform, Vector2.FromArray(value));\r\n return true;\r\n case EParameterType.FLOAT_VEC3:\r\n shaderMaterial.setVector3(uniform, Vector3.FromArray(value));\r\n return true;\r\n case EParameterType.FLOAT_VEC4:\r\n shaderMaterial.setVector4(uniform, Vector4.FromArray(value));\r\n return true;\r\n default:\r\n return false;\r\n }\r\n }\r\n\r\n /**\r\n * Returns the wrap mode of the texture\r\n * @param mode the mode value\r\n */\r\n public static GetWrapMode(mode: number): number {\r\n switch (mode) {\r\n case ETextureWrapMode.CLAMP_TO_EDGE:\r\n return Texture.CLAMP_ADDRESSMODE;\r\n case ETextureWrapMode.MIRRORED_REPEAT:\r\n return Texture.MIRROR_ADDRESSMODE;\r\n case ETextureWrapMode.REPEAT:\r\n return Texture.WRAP_ADDRESSMODE;\r\n default:\r\n return Texture.WRAP_ADDRESSMODE;\r\n }\r\n }\r\n\r\n /**\r\n * Returns the byte stride giving an accessor\r\n * @param accessor the GLTF accessor objet\r\n */\r\n public static GetByteStrideFromType(accessor: IGLTFAccessor): number {\r\n // Needs this function since \"byteStride\" isn't requiered in glTF format\r\n const type = accessor.type;\r\n\r\n switch (type) {\r\n case \"VEC2\":\r\n return 2;\r\n case \"VEC3\":\r\n return 3;\r\n case \"VEC4\":\r\n return 4;\r\n case \"MAT2\":\r\n return 4;\r\n case \"MAT3\":\r\n return 9;\r\n case \"MAT4\":\r\n return 16;\r\n default:\r\n return 1;\r\n }\r\n }\r\n\r\n /**\r\n * Returns the texture filter mode giving a mode value\r\n * @param mode the filter mode value\r\n */\r\n public static GetTextureFilterMode(mode: number): ETextureFilterType {\r\n switch (mode) {\r\n case ETextureFilterType.LINEAR:\r\n case ETextureFilterType.LINEAR_MIPMAP_NEAREST:\r\n case ETextureFilterType.LINEAR_MIPMAP_LINEAR:\r\n return Texture.TRILINEAR_SAMPLINGMODE;\r\n case ETextureFilterType.NEAREST:\r\n case ETextureFilterType.NEAREST_MIPMAP_NEAREST:\r\n return Texture.NEAREST_SAMPLINGMODE;\r\n default:\r\n return Texture.BILINEAR_SAMPLINGMODE;\r\n }\r\n }\r\n\r\n public static GetBufferFromBufferView(\r\n gltfRuntime: IGLTFRuntime,\r\n bufferView: IGLTFBufferView,\r\n byteOffset: number,\r\n byteLength: number,\r\n componentType: EComponentType\r\n ): ArrayBufferView {\r\n byteOffset = bufferView.byteOffset + byteOffset;\r\n\r\n const loadedBufferView = gltfRuntime.loadedBufferViews[bufferView.buffer];\r\n if (byteOffset + byteLength > loadedBufferView.byteLength) {\r\n throw new Error(\"Buffer access is out of range\");\r\n }\r\n\r\n const buffer = loadedBufferView.buffer;\r\n byteOffset += loadedBufferView.byteOffset;\r\n\r\n switch (componentType) {\r\n case EComponentType.BYTE:\r\n return new Int8Array(buffer, byteOffset, byteLength);\r\n case EComponentType.UNSIGNED_BYTE:\r\n return new Uint8Array(buffer, byteOffset, byteLength);\r\n case EComponentType.SHORT:\r\n return new Int16Array(buffer, byteOffset, byteLength);\r\n case EComponentType.UNSIGNED_SHORT:\r\n return new Uint16Array(buffer, byteOffset, byteLength);\r\n default:\r\n return new Float32Array(buffer, byteOffset, byteLength);\r\n }\r\n }\r\n\r\n /**\r\n * Returns a buffer from its accessor\r\n * @param gltfRuntime the GLTF runtime\r\n * @param accessor the GLTF accessor\r\n */\r\n public static GetBufferFromAccessor(gltfRuntime: IGLTFRuntime, accessor: IGLTFAccessor): any {\r\n const bufferView: IGLTFBufferView = gltfRuntime.bufferViews[accessor.bufferView];\r\n const byteLength = accessor.count * GLTFUtils.GetByteStrideFromType(accessor);\r\n return GLTFUtils.GetBufferFromBufferView(gltfRuntime, bufferView, accessor.byteOffset, byteLength, accessor.componentType);\r\n }\r\n\r\n /**\r\n * Decodes a buffer view into a string\r\n * @param view the buffer view\r\n */\r\n public static DecodeBufferToText(view: ArrayBufferView): string {\r\n let result = \"\";\r\n const length = view.byteLength;\r\n\r\n for (let i = 0; i < length; ++i) {\r\n result += String.fromCharCode((<any>view)[i]);\r\n }\r\n\r\n return result;\r\n }\r\n\r\n /**\r\n * Returns the default material of gltf. Related to\r\n * https://github.com/KhronosGroup/glTF/tree/master/specification/1.0#appendix-a-default-material\r\n * @param scene the Babylon.js scene\r\n */\r\n public static GetDefaultMaterial(scene: Scene): ShaderMaterial {\r\n if (!GLTFUtils._DefaultMaterial) {\r\n Effect.ShadersStore[\"GLTFDefaultMaterialVertexShader\"] = [\r\n \"precision highp float;\",\r\n \"\",\r\n \"uniform mat4 worldView;\",\r\n \"uniform mat4 projection;\",\r\n \"\",\r\n \"attribute vec3 position;\",\r\n \"\",\r\n \"void main(void)\",\r\n \"{\",\r\n \" gl_Position = projection * worldView * vec4(position, 1.0);\",\r\n \"}\",\r\n ].join(\"\\n\");\r\n\r\n Effect.ShadersStore[\"GLTFDefaultMaterialPixelShader\"] = [\r\n \"precision highp float;\",\r\n \"\",\r\n \"uniform vec4 u_emission;\",\r\n \"\",\r\n \"void main(void)\",\r\n \"{\",\r\n \" gl_FragColor = u_emission;\",\r\n \"}\",\r\n ].join(\"\\n\");\r\n\r\n const shaderPath = {\r\n vertex: \"GLTFDefaultMaterial\",\r\n fragment: \"GLTFDefaultMaterial\",\r\n };\r\n\r\n const options = {\r\n attributes: [\"position\"],\r\n uniforms: [\"worldView\", \"projection\", \"u_emission\"],\r\n samplers: new Array<string>(),\r\n needAlphaBlending: false,\r\n };\r\n\r\n GLTFUtils._DefaultMaterial = new ShaderMaterial(\"GLTFDefaultMaterial\", scene, shaderPath, options);\r\n GLTFUtils._DefaultMaterial.setColor4(\"u_emission\", new Color4(0.5, 0.5, 0.5, 1.0));\r\n }\r\n\r\n return GLTFUtils._DefaultMaterial;\r\n }\r\n\r\n // The GLTF default material\r\n private static _DefaultMaterial: Nullable<ShaderMaterial> = null;\r\n}\r\n"]}
|
1
|
+
{"version":3,"file":"glTFLoaderUtils.js","sourceRoot":"","sources":["../../../../../../lts/loaders/generated/glTF/1.0/glTFLoaderUtils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAG9G,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,6CAA+B;AAC3E,OAAO,EAAE,MAAM,EAAE,4CAA8B;AAC/C,OAAO,EAAE,MAAM,EAAE,4CAA8B;AAC/C,OAAO,EAAE,cAAc,EAAE,oDAAsC;AAC/D,OAAO,EAAE,OAAO,EAAE,sDAAwC;AAI1D;;;;GAIG;AACH,MAAM,OAAO,SAAS;IAClB;;;;;;;OAOG;IACI,MAAM,CAAC,SAAS,CAAC,KAAY,EAAE,MAAY,EAAE,SAAkC,EAAE,WAAmB,EAAE,cAAuC;QAChJ,IAAI,GAAG,GAAqB,IAAI,CAAC;QAEjC,IAAI,SAAS,CAAC,QAAQ,KAAK,OAAO,EAAE;YAChC,GAAG,GAAG,MA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gBACpD,wBAAwB;gBACxB,EAAE;gBACF,0BAA0B;gBAC1B,EAAE;gBACF,iBAAiB;gBACjB,GAAG;gBACH,gCAAgC;gBAChC,GAAG;aACN,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAEb,MAAM,UAAU,GAAG;gBACf,MAAM,EAAE,qBAAqB;gBAC7B,QAAQ,EAAE,qBAAqB;aAClC,CAAC;YAEF,MAAM,OAAO,GAAG;gBACZ,UAAU,EAAE,CAAC,UAAU,CAAC;gBACxB,QAAQ,EAAE,CAAC,WAAW,EAAE,YAAY,EAAE,YAAY,CAAC;gBACnD,QAAQ,EAAE,IAAI,KAAK,EAAU;gBAC7B,iBAAiB,EAAE,KAAK;aAC3B,CAAC;YAEF,SAAS,CAAC,gBAAgB,GAAG,IAAI,cAAc,CAAC,qBAAqB,EAAE,KAAK,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC;YACnG,SAAS,CAAC,gBAAgB,CAAC,SAAS,CAAC,YAAY,EAAE,IAAI,MAAM,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;SACtF;QAED,OAAO,SAAS,CAAC,gBAAgB,CAAC;IACtC,CAAC;;AAED,4BAA4B;AACb,0BAAgB,GAA6B,IAAI,CAAC","sourcesContent":["import type { IGLTFTechniqueParameter, IGLTFAccessor, IGLTFRuntime, IGLTFBufferView } from \"./glTFLoaderInterfaces\";\r\nimport { EParameterType, ETextureWrapMode, ETextureFilterType, EComponentType } from \"./glTFLoaderInterfaces\";\r\n\r\nimport type { Nullable } from \"core/types\";\r\nimport { Vector2, Vector3, Vector4, Matrix } from \"core/Maths/math.vector\";\r\nimport { Color4 } from \"core/Maths/math.color\";\r\nimport { Effect } from \"core/Materials/effect\";\r\nimport { ShaderMaterial } from \"core/Materials/shaderMaterial\";\r\nimport { Texture } from \"core/Materials/Textures/texture\";\r\nimport type { Node } from \"core/node\";\r\nimport type { Scene } from \"core/scene\";\r\n\r\n/**\r\n * Utils functions for GLTF\r\n * @internal\r\n * @deprecated\r\n */\r\nexport class GLTFUtils {\r\n /**\r\n * Sets the given \"parameter\" matrix\r\n * @param scene the Scene object\r\n * @param source the source node where to pick the matrix\r\n * @param parameter the GLTF technique parameter\r\n * @param uniformName the name of the shader's uniform\r\n * @param shaderMaterial the shader material\r\n */\r\n public static SetMatrix(scene: Scene, source: Node, parameter: IGLTFTechniqueParameter, uniformName: string, shaderMaterial: ShaderMaterial | Effect): void {\r\n let mat: Nullable<Matrix> = null;\r\n\r\n if (parameter.semantic === \"MODEL\") {\r\n mat = source.getWorldMatrix();\r\n } else if (parameter.semantic === \"PROJECTION\") {\r\n mat = scene.getProjectionMatrix();\r\n } else if (parameter.semantic === \"VIEW\") {\r\n mat = scene.getViewMatrix();\r\n } else if (parameter.semantic === \"MODELVIEWINVERSETRANSPOSE\") {\r\n mat = Matrix.Transpose(source.getWorldMatrix().multiply(scene.getViewMatrix()).invert());\r\n } else if (parameter.semantic === \"MODELVIEW\") {\r\n mat = source.getWorldMatrix().multiply(scene.getViewMatrix());\r\n } else if (parameter.semantic === \"MODELVIEWPROJECTION\") {\r\n mat = source.getWorldMatrix().multiply(scene.getTransformMatrix());\r\n } else if (parameter.semantic === \"MODELINVERSE\") {\r\n mat = source.getWorldMatrix().invert();\r\n } else if (parameter.semantic === \"VIEWINVERSE\") {\r\n mat = scene.getViewMatrix().invert();\r\n } else if (parameter.semantic === \"PROJECTIONINVERSE\") {\r\n mat = scene.getProjectionMatrix().invert();\r\n } else if (parameter.semantic === \"MODELVIEWINVERSE\") {\r\n mat = source.getWorldMatrix().multiply(scene.getViewMatrix()).invert();\r\n } else if (parameter.semantic === \"MODELVIEWPROJECTIONINVERSE\") {\r\n mat = source.getWorldMatrix().multiply(scene.getTransformMatrix()).invert();\r\n } else if (parameter.semantic === \"MODELINVERSETRANSPOSE\") {\r\n mat = Matrix.Transpose(source.getWorldMatrix().invert());\r\n }\r\n\r\n if (mat) {\r\n switch (parameter.type) {\r\n case EParameterType.FLOAT_MAT2:\r\n shaderMaterial.setMatrix2x2(uniformName, Matrix.GetAsMatrix2x2(mat));\r\n break;\r\n case EParameterType.FLOAT_MAT3:\r\n shaderMaterial.setMatrix3x3(uniformName, Matrix.GetAsMatrix3x3(mat));\r\n break;\r\n case EParameterType.FLOAT_MAT4:\r\n shaderMaterial.setMatrix(uniformName, mat);\r\n break;\r\n default:\r\n break;\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Sets the given \"parameter\" matrix\r\n * @param shaderMaterial the shader material\r\n * @param uniform the name of the shader's uniform\r\n * @param value the value of the uniform\r\n * @param type the uniform's type (EParameterType FLOAT, VEC2, VEC3 or VEC4)\r\n */\r\n public static SetUniform(shaderMaterial: ShaderMaterial | Effect, uniform: string, value: any, type: number): boolean {\r\n switch (type) {\r\n case EParameterType.FLOAT:\r\n shaderMaterial.setFloat(uniform, value);\r\n return true;\r\n case EParameterType.FLOAT_VEC2:\r\n shaderMaterial.setVector2(uniform, Vector2.FromArray(value));\r\n return true;\r\n case EParameterType.FLOAT_VEC3:\r\n shaderMaterial.setVector3(uniform, Vector3.FromArray(value));\r\n return true;\r\n case EParameterType.FLOAT_VEC4:\r\n shaderMaterial.setVector4(uniform, Vector4.FromArray(value));\r\n return true;\r\n default:\r\n return false;\r\n }\r\n }\r\n\r\n /**\r\n * Returns the wrap mode of the texture\r\n * @param mode the mode value\r\n */\r\n public static GetWrapMode(mode: number): number {\r\n switch (mode) {\r\n case ETextureWrapMode.CLAMP_TO_EDGE:\r\n return Texture.CLAMP_ADDRESSMODE;\r\n case ETextureWrapMode.MIRRORED_REPEAT:\r\n return Texture.MIRROR_ADDRESSMODE;\r\n case ETextureWrapMode.REPEAT:\r\n return Texture.WRAP_ADDRESSMODE;\r\n default:\r\n return Texture.WRAP_ADDRESSMODE;\r\n }\r\n }\r\n\r\n /**\r\n * Returns the byte stride giving an accessor\r\n * @param accessor the GLTF accessor objet\r\n */\r\n public static GetByteStrideFromType(accessor: IGLTFAccessor): number {\r\n // Needs this function since \"byteStride\" isn't requiered in glTF format\r\n const type = accessor.type;\r\n\r\n switch (type) {\r\n case \"VEC2\":\r\n return 2;\r\n case \"VEC3\":\r\n return 3;\r\n case \"VEC4\":\r\n return 4;\r\n case \"MAT2\":\r\n return 4;\r\n case \"MAT3\":\r\n return 9;\r\n case \"MAT4\":\r\n return 16;\r\n default:\r\n return 1;\r\n }\r\n }\r\n\r\n /**\r\n * Returns the texture filter mode giving a mode value\r\n * @param mode the filter mode value\r\n */\r\n public static GetTextureFilterMode(mode: number): ETextureFilterType {\r\n switch (mode) {\r\n case ETextureFilterType.LINEAR:\r\n case ETextureFilterType.LINEAR_MIPMAP_NEAREST:\r\n case ETextureFilterType.LINEAR_MIPMAP_LINEAR:\r\n return Texture.TRILINEAR_SAMPLINGMODE;\r\n case ETextureFilterType.NEAREST:\r\n case ETextureFilterType.NEAREST_MIPMAP_NEAREST:\r\n return Texture.NEAREST_SAMPLINGMODE;\r\n default:\r\n return Texture.BILINEAR_SAMPLINGMODE;\r\n }\r\n }\r\n\r\n public static GetBufferFromBufferView(\r\n gltfRuntime: IGLTFRuntime,\r\n bufferView: IGLTFBufferView,\r\n byteOffset: number,\r\n byteLength: number,\r\n componentType: EComponentType\r\n ): ArrayBufferView {\r\n byteOffset = bufferView.byteOffset + byteOffset;\r\n\r\n const loadedBufferView = gltfRuntime.loadedBufferViews[bufferView.buffer];\r\n if (byteOffset + byteLength > loadedBufferView.byteLength) {\r\n throw new Error(\"Buffer access is out of range\");\r\n }\r\n\r\n const buffer = loadedBufferView.buffer;\r\n byteOffset += loadedBufferView.byteOffset;\r\n\r\n switch (componentType) {\r\n case EComponentType.BYTE:\r\n return new Int8Array(buffer, byteOffset, byteLength);\r\n case EComponentType.UNSIGNED_BYTE:\r\n return new Uint8Array(buffer, byteOffset, byteLength);\r\n case EComponentType.SHORT:\r\n return new Int16Array(buffer, byteOffset, byteLength);\r\n case EComponentType.UNSIGNED_SHORT:\r\n return new Uint16Array(buffer, byteOffset, byteLength);\r\n default:\r\n return new Float32Array(buffer, byteOffset, byteLength);\r\n }\r\n }\r\n\r\n /**\r\n * Returns a buffer from its accessor\r\n * @param gltfRuntime the GLTF runtime\r\n * @param accessor the GLTF accessor\r\n */\r\n public static GetBufferFromAccessor(gltfRuntime: IGLTFRuntime, accessor: IGLTFAccessor): any {\r\n const bufferView: IGLTFBufferView = gltfRuntime.bufferViews[accessor.bufferView];\r\n const byteLength = accessor.count * GLTFUtils.GetByteStrideFromType(accessor);\r\n return GLTFUtils.GetBufferFromBufferView(gltfRuntime, bufferView, accessor.byteOffset, byteLength, accessor.componentType);\r\n }\r\n\r\n /**\r\n * Decodes a buffer view into a string\r\n * @param view the buffer view\r\n */\r\n public static DecodeBufferToText(view: ArrayBufferView): string {\r\n let result = \"\";\r\n const length = view.byteLength;\r\n\r\n for (let i = 0; i < length; ++i) {\r\n result += String.fromCharCode((<any>view)[i]);\r\n }\r\n\r\n return result;\r\n }\r\n\r\n /**\r\n * Returns the default material of gltf. Related to\r\n * https://github.com/KhronosGroup/glTF/tree/master/specification/1.0#appendix-a-default-material\r\n * @param scene the Babylon.js scene\r\n */\r\n public static GetDefaultMaterial(scene: Scene): ShaderMaterial {\r\n if (!GLTFUtils._DefaultMaterial) {\r\n Effect.ShadersStore[\"GLTFDefaultMaterialVertexShader\"] = [\r\n \"precision highp float;\",\r\n \"\",\r\n \"uniform mat4 worldView;\",\r\n \"uniform mat4 projection;\",\r\n \"\",\r\n \"attribute vec3 position;\",\r\n \"\",\r\n \"void main(void)\",\r\n \"{\",\r\n \" gl_Position = projection * worldView * vec4(position, 1.0);\",\r\n \"}\",\r\n ].join(\"\\n\");\r\n\r\n Effect.ShadersStore[\"GLTFDefaultMaterialPixelShader\"] = [\r\n \"precision highp float;\",\r\n \"\",\r\n \"uniform vec4 u_emission;\",\r\n \"\",\r\n \"void main(void)\",\r\n \"{\",\r\n \" gl_FragColor = u_emission;\",\r\n \"}\",\r\n ].join(\"\\n\");\r\n\r\n const shaderPath = {\r\n vertex: \"GLTFDefaultMaterial\",\r\n fragment: \"GLTFDefaultMaterial\",\r\n };\r\n\r\n const options = {\r\n attributes: [\"position\"],\r\n uniforms: [\"worldView\", \"projection\", \"u_emission\"],\r\n samplers: new Array<string>(),\r\n needAlphaBlending: false,\r\n };\r\n\r\n GLTFUtils._DefaultMaterial = new ShaderMaterial(\"GLTFDefaultMaterial\", scene, shaderPath, options);\r\n GLTFUtils._DefaultMaterial.setColor4(\"u_emission\", new Color4(0.5, 0.5, 0.5, 1.0));\r\n }\r\n\r\n return GLTFUtils._DefaultMaterial;\r\n }\r\n\r\n // The GLTF default material\r\n private static _DefaultMaterial: Nullable<ShaderMaterial> = null;\r\n}\r\n"]}
|
@@ -2,7 +2,7 @@ import { GLTFLoaderExtension } from "./glTFLoader";
|
|
2
2
|
import type { IGLTFRuntime } from "./glTFLoaderInterfaces";
|
3
3
|
import { Material } from "@babylonjs/core/Materials/material.js";
|
4
4
|
/**
|
5
|
-
* @
|
5
|
+
* @internal
|
6
6
|
* @deprecated
|
7
7
|
*/
|
8
8
|
export declare class GLTFMaterialsCommonExtension extends GLTFLoaderExtension {
|
@@ -9,7 +9,7 @@ import { DirectionalLight } from "@babylonjs/core/Lights/directionalLight.js";
|
|
9
9
|
import { PointLight } from "@babylonjs/core/Lights/pointLight.js";
|
10
10
|
import { SpotLight } from "@babylonjs/core/Lights/spotLight.js";
|
11
11
|
/**
|
12
|
-
* @
|
12
|
+
* @internal
|
13
13
|
* @deprecated
|
14
14
|
*/
|
15
15
|
export class GLTFMaterialsCommonExtension extends GLTFLoaderExtension {
|