@babylonjs/loaders 9.19.1 → 9.20.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/SPLAT/gaussianSplattingStream.d.ts +170 -1
  2. package/SPLAT/gaussianSplattingStream.js +516 -40
  3. package/SPLAT/gaussianSplattingStream.js.map +1 -1
  4. package/SPLAT/gaussianSplattingWorkBuffer.d.ts +163 -4
  5. package/SPLAT/gaussianSplattingWorkBuffer.js +683 -35
  6. package/SPLAT/gaussianSplattingWorkBuffer.js.map +1 -1
  7. package/SPLAT/gaussianSplattingWorkBufferShaders.d.ts +70 -2
  8. package/SPLAT/gaussianSplattingWorkBufferShaders.js +465 -4
  9. package/SPLAT/gaussianSplattingWorkBufferShaders.js.map +1 -1
  10. package/glTF/2.0/Extensions/KHR_interactivity/declarationMapper.d.ts +16 -1
  11. package/glTF/2.0/Extensions/KHR_interactivity/declarationMapper.js +232 -25
  12. package/glTF/2.0/Extensions/KHR_interactivity/declarationMapper.js.map +1 -1
  13. package/glTF/2.0/Extensions/KHR_interactivity/interactivityGraphParser.d.ts +52 -2
  14. package/glTF/2.0/Extensions/KHR_interactivity/interactivityGraphParser.js +108 -7
  15. package/glTF/2.0/Extensions/KHR_interactivity/interactivityGraphParser.js.map +1 -1
  16. package/glTF/2.0/Extensions/KHR_interactivity/interactivityHostResolver.d.ts +37 -0
  17. package/glTF/2.0/Extensions/KHR_interactivity/interactivityHostResolver.js +69 -0
  18. package/glTF/2.0/Extensions/KHR_interactivity/interactivityHostResolver.js.map +1 -0
  19. package/glTF/2.0/Extensions/KHR_interactivity/interactivityReferences.d.ts +44 -0
  20. package/glTF/2.0/Extensions/KHR_interactivity/interactivityReferences.js +51 -0
  21. package/glTF/2.0/Extensions/KHR_interactivity/interactivityReferences.js.map +1 -0
  22. package/glTF/2.0/Extensions/KHR_interactivity.pure.d.ts +1 -0
  23. package/glTF/2.0/Extensions/KHR_interactivity.pure.js +143 -12
  24. package/glTF/2.0/Extensions/KHR_interactivity.pure.js.map +1 -1
  25. package/glTF/2.0/Extensions/KHR_node_hoverability.pure.js +6 -0
  26. package/glTF/2.0/Extensions/KHR_node_hoverability.pure.js.map +1 -1
  27. package/glTF/2.0/Extensions/KHR_node_selectability.pure.js +4 -0
  28. package/glTF/2.0/Extensions/KHR_node_selectability.pure.js.map +1 -1
  29. package/glTF/2.0/Extensions/KHR_node_visibility.pure.js +11 -0
  30. package/glTF/2.0/Extensions/KHR_node_visibility.pure.js.map +1 -1
  31. package/glTF/2.0/Extensions/babylonScenePathToObjectConverter.d.ts +126 -0
  32. package/glTF/2.0/Extensions/babylonScenePathToObjectConverter.js +251 -0
  33. package/glTF/2.0/Extensions/babylonScenePathToObjectConverter.js.map +1 -0
  34. package/glTF/2.0/Extensions/compositePathToObjectConverter.d.ts +51 -0
  35. package/glTF/2.0/Extensions/compositePathToObjectConverter.js +51 -0
  36. package/glTF/2.0/Extensions/compositePathToObjectConverter.js.map +1 -0
  37. package/glTF/2.0/Extensions/gltfPathToObjectConverter.js +69 -7
  38. package/glTF/2.0/Extensions/gltfPathToObjectConverter.js.map +1 -1
  39. package/glTF/2.0/Extensions/interactivityAssetPathToObjectConverter.d.ts +41 -0
  40. package/glTF/2.0/Extensions/interactivityAssetPathToObjectConverter.js +108 -0
  41. package/glTF/2.0/Extensions/interactivityAssetPathToObjectConverter.js.map +1 -0
  42. package/glTF/2.0/Extensions/interactivityRefPathToObjectConverter.d.ts +28 -0
  43. package/glTF/2.0/Extensions/interactivityRefPathToObjectConverter.js +71 -0
  44. package/glTF/2.0/Extensions/interactivityRefPathToObjectConverter.js.map +1 -0
  45. package/glTF/2.0/Extensions/objectModelMapping.d.ts +118 -30
  46. package/glTF/2.0/Extensions/objectModelMapping.js +472 -70
  47. package/glTF/2.0/Extensions/objectModelMapping.js.map +1 -1
  48. package/glTF/2.0/Extensions/transmissionHelper.js +4 -0
  49. package/glTF/2.0/Extensions/transmissionHelper.js.map +1 -1
  50. package/glTF/2.0/glTFLoader.pure.js +2 -1
  51. package/glTF/2.0/glTFLoader.pure.js.map +1 -1
  52. package/package.json +3 -3
@@ -1,5 +1,5 @@
1
1
  import { type TransformNode } from "@babylonjs/core/Meshes/transformNode.js";
2
- import { type IAnimation, type ICamera, type IGLTF, type IKHRLightsPunctual_Light, type IEXTLightsArea_Light, type IMaterial, type IMesh, type INode } from "../glTFLoaderInterfaces.js";
2
+ import { type IAnimation, type ICamera, type IGLTF, type IKHRLightsPunctual_Light, type IEXTLightsArea_Light, type IMaterial, type IMesh, type IMeshPrimitive, type INode, type IScene, type ISkin } from "../glTFLoaderInterfaces.js";
3
3
  import { type Vector3, Matrix, Quaternion, Vector2 } from "@babylonjs/core/Maths/math.vector.pure.js";
4
4
  import { type Color3, Color4 } from "@babylonjs/core/Maths/math.color.pure.js";
5
5
  import { type PBRMaterial } from "@babylonjs/core/Materials/PBR/pbrMaterial.js";
@@ -8,38 +8,49 @@ import { type Nullable } from "@babylonjs/core/types.js";
8
8
  import { type IEXTLightsImageBased_LightImageBased } from "babylonjs-gltf2interface";
9
9
  import { type BaseTexture } from "@babylonjs/core/Materials/Textures/baseTexture.js";
10
10
  import { type IInterpolationPropertyInfo, type IObjectAccessor } from "@babylonjs/core/FlowGraph/typeDefinitions.js";
11
+ import { FlowGraphInteger } from "@babylonjs/core/FlowGraph/CustomTypes/flowGraphInteger.pure.js";
11
12
  import { GLTFPathToObjectConverter } from "./gltfPathToObjectConverter.js";
12
13
  import { type AnimationGroup } from "@babylonjs/core/Animations/animationGroup.js";
13
14
  import { type Mesh } from "@babylonjs/core/Meshes/mesh.js";
14
15
  /**
15
- * Describes the object model tree that maps glTF pointer paths to their corresponding Babylon objects.
16
+ * Top-level shape of the glTF Object Model accessor tree. Each property
17
+ * describes a navigable section of the JSON-Pointer namespace (e.g. `/nodes`,
18
+ * `/materials`, `/scenes`) that KHR_interactivity, KHR_animation_pointer and
19
+ * other extensions consume via {@link GetMappingForKey}.
16
20
  */
17
21
  export interface IGLTFObjectModelTree {
18
- /** Mapping for the glTF cameras collection. */
22
+ /** Read-only accessor for the active scene index (`/scene`). */
23
+ scene: {
24
+ __target__: boolean;
25
+ } & IObjectAccessor<number | undefined, any, number>;
26
+ /** Accessor tree for `/cameras`. */
19
27
  cameras: IGLTFObjectModelTreeCamerasObject;
20
- /** Mapping for the glTF nodes collection. */
28
+ /** Accessor tree for `/nodes`. */
21
29
  nodes: IGLTFObjectModelTreeNodesObject;
22
- /** Mapping for the glTF materials collection. */
30
+ /** Accessor tree for `/materials`. */
23
31
  materials: IGLTFObjectModelTreeMaterialsObject;
24
- /** Mapping for the glTF extensions. */
32
+ /** Accessor tree for `/extensions` (root-level glTF extensions). */
25
33
  extensions: IGLTFObjectModelTreeExtensionsObject;
26
- /** Mapping for the glTF animations collection. */
34
+ /** Accessor tree for `/animations`. */
27
35
  animations: {
28
- length: IObjectAccessor<IAnimation[], AnimationGroup[], number>;
29
- __array__: {};
30
- };
31
- /** Mapping for the glTF meshes collection. */
32
- meshes: {
33
- length: IObjectAccessor<IMesh[], (Mesh | undefined)[], number>;
36
+ length: IObjectAccessor<IAnimation[], AnimationGroup[], FlowGraphInteger>;
34
37
  __array__: {};
35
38
  };
39
+ /** Accessor tree for `/meshes`. */
40
+ meshes: IGLTFObjectModelTreeMeshesObject;
41
+ /** Accessor tree for `/scenes`. */
42
+ scenes: IGLTFObjectModelTreeScenesObject;
43
+ /** Accessor tree for `/skins`. */
44
+ skins: IGLTFObjectModelTreeSkinsObject;
36
45
  }
37
46
  /**
38
- * Describes the mapping of glTF node properties to their corresponding Babylon transform node properties.
47
+ * Accessor tree describing the `/nodes` section of the glTF Object Model.
48
+ * Exposes per-node TRS, ref-typed parent/children/camera/mesh/skin links,
49
+ * morph-target weights and node-extension properties.
39
50
  */
40
51
  export interface IGLTFObjectModelTreeNodesObject<GLTFTargetType = INode, BabylonTargetType = TransformNode> {
41
- /** Accessor for the number of nodes. */
42
- length: IObjectAccessor<GLTFTargetType[], BabylonTargetType[], number>;
52
+ /** Number of nodes in the array. */
53
+ length: IObjectAccessor<GLTFTargetType[], BabylonTargetType[], FlowGraphInteger>;
43
54
  __array__: {
44
55
  __target__: boolean;
45
56
  translation: IObjectAccessor<GLTFTargetType, BabylonTargetType, Vector3>;
@@ -47,11 +58,23 @@ export interface IGLTFObjectModelTreeNodesObject<GLTFTargetType = INode, Babylon
47
58
  scale: IObjectAccessor<GLTFTargetType, BabylonTargetType, Vector3>;
48
59
  matrix: IObjectAccessor<GLTFTargetType, BabylonTargetType, Matrix>;
49
60
  globalMatrix: IObjectAccessor<GLTFTargetType, BabylonTargetType, Matrix>;
61
+ camera: IObjectAccessor<GLTFTargetType, any, string | undefined>;
62
+ mesh: IObjectAccessor<GLTFTargetType, any, string | undefined>;
63
+ skin: IObjectAccessor<GLTFTargetType, any, string | undefined>;
64
+ parent: IObjectAccessor<GLTFTargetType, any, string | undefined>;
65
+ children: {
66
+ length: IObjectAccessor<number[], any, FlowGraphInteger>;
67
+ __array__: {
68
+ __target__: boolean;
69
+ } & IObjectAccessor<any, any, string>;
70
+ };
50
71
  weights: {
51
- length: IObjectAccessor<GLTFTargetType, BabylonTargetType, number>;
72
+ /** When true, the path converter skips objectTree traversal for this property, keeping the parent target. */
73
+ __passThroughTarget__?: boolean;
74
+ length: IObjectAccessor<GLTFTargetType, BabylonTargetType, FlowGraphInteger>;
52
75
  __array__: {
53
76
  __target__: boolean;
54
- } & IObjectAccessor<GLTFTargetType, BabylonTargetType, number>;
77
+ } & IObjectAccessor<GLTFTargetType, any, number>;
55
78
  } & IObjectAccessor<GLTFTargetType, BabylonTargetType, number[]>;
56
79
  extensions: {
57
80
  EXT_lights_ies?: {
@@ -65,9 +88,12 @@ export interface IGLTFObjectModelTreeNodesObject<GLTFTargetType = INode, Babylon
65
88
  };
66
89
  }
67
90
  /**
68
- * Describes the mapping of glTF camera properties to their corresponding Babylon camera properties.
91
+ * Accessor tree describing the `/cameras` section of the glTF Object Model.
92
+ * Exposes orthographic and perspective camera properties.
69
93
  */
70
94
  export interface IGLTFObjectModelTreeCamerasObject {
95
+ /** Number of cameras in the array. */
96
+ length: IObjectAccessor<ICamera[], any, FlowGraphInteger>;
71
97
  __array__: {
72
98
  __target__: boolean;
73
99
  orthographic: {
@@ -85,11 +111,16 @@ export interface IGLTFObjectModelTreeCamerasObject {
85
111
  };
86
112
  }
87
113
  /**
88
- * Describes the mapping of glTF material properties to their corresponding Babylon material properties.
114
+ * Accessor tree describing the `/materials` section of the glTF Object Model.
115
+ * Covers core PBR properties as well as the family of KHR_materials_* extensions.
89
116
  */
90
117
  export interface IGLTFObjectModelTreeMaterialsObject {
118
+ /** Number of materials in the array. */
119
+ length: IObjectAccessor<IMaterial[], PBRMaterial[], FlowGraphInteger>;
91
120
  __array__: {
92
121
  __target__: boolean;
122
+ doubleSided: IObjectAccessor<IMaterial, PBRMaterial, boolean>;
123
+ alphaCutoff: IObjectAccessor<IMaterial, PBRMaterial, number>;
93
124
  pbrMetallicRoughness: {
94
125
  baseColorFactor: IObjectAccessor<IMaterial, PBRMaterial, Color4>;
95
126
  metallicFactor: IObjectAccessor<IMaterial, PBRMaterial, Nullable<number>>;
@@ -247,18 +278,75 @@ interface ITextureDefinition {
247
278
  scale: IObjectAccessor<IMaterial, PBRMaterial, Vector2>;
248
279
  }
249
280
  /**
250
- * Describes the mapping of glTF mesh properties to their corresponding Babylon mesh properties.
281
+ * Accessor tree describing the `/meshes` section of the glTF Object Model.
282
+ * Exposes per-mesh primitives (and their material refs) and the mesh-level
283
+ * morph-target weights array.
251
284
  */
252
285
  export interface IGLTFObjectModelTreeMeshesObject {
286
+ /** Number of meshes in the array. */
287
+ length: IObjectAccessor<IMesh[], (Mesh | undefined)[], FlowGraphInteger>;
288
+ __array__: {
289
+ __target__: boolean;
290
+ primitives: {
291
+ length: IObjectAccessor<IMeshPrimitive[], any, FlowGraphInteger>;
292
+ __array__: {
293
+ __target__: boolean;
294
+ material: IObjectAccessor<any, any, string | undefined>;
295
+ };
296
+ };
297
+ weights: {
298
+ length: IObjectAccessor<number[], any, FlowGraphInteger>;
299
+ __array__: {
300
+ __target__: boolean;
301
+ } & IObjectAccessor<any, any, number>;
302
+ };
303
+ };
304
+ }
305
+ /**
306
+ * Accessor tree describing the `/scenes` section of the glTF Object Model.
307
+ * Per-scene root-node refs are exposed under `nodes/{i}`.
308
+ */
309
+ export interface IGLTFObjectModelTreeScenesObject {
310
+ /** Number of scenes in the array. */
311
+ length: IObjectAccessor<IScene[], any, FlowGraphInteger>;
312
+ __array__: {
313
+ __target__: boolean;
314
+ nodes: {
315
+ length: IObjectAccessor<number[], any, FlowGraphInteger>;
316
+ __array__: {
317
+ __target__: boolean;
318
+ } & IObjectAccessor<any, any, string>;
319
+ };
320
+ };
321
+ }
322
+ /**
323
+ * Accessor tree describing the `/skins` section of the glTF Object Model.
324
+ * Joint and skeleton properties are exposed as JSON-Pointer refs.
325
+ */
326
+ export interface IGLTFObjectModelTreeSkinsObject {
327
+ /** Number of skins in the array. */
328
+ length: IObjectAccessor<ISkin[], any, FlowGraphInteger>;
329
+ __array__: {
330
+ __target__: boolean;
331
+ joints: {
332
+ length: IObjectAccessor<number[], any, FlowGraphInteger>;
333
+ __array__: {
334
+ __target__: boolean;
335
+ } & IObjectAccessor<any, any, string>;
336
+ };
337
+ skeleton: IObjectAccessor<ISkin, any, string | undefined>;
338
+ };
253
339
  }
254
340
  /**
255
- * Describes the mapping of glTF extension properties to their corresponding Babylon properties.
341
+ * Accessor tree describing root-level glTF extensions exposed through the
342
+ * Object Model. Currently covers the punctual / area / IES / image-based
343
+ * light extension families.
256
344
  */
257
345
  export interface IGLTFObjectModelTreeExtensionsObject {
258
- /** Mapping for the KHR_lights_punctual extension. */
346
+ /** Accessor tree for `/extensions/KHR_lights_punctual`. */
259
347
  KHR_lights_punctual: {
260
348
  lights: {
261
- length: IObjectAccessor<IKHRLightsPunctual_Light[], Light[], number>;
349
+ length: IObjectAccessor<IKHRLightsPunctual_Light[], Light[], FlowGraphInteger>;
262
350
  __array__: {
263
351
  __target__: boolean;
264
352
  color: IObjectAccessor<IKHRLightsPunctual_Light, Light, Color3>;
@@ -271,10 +359,10 @@ export interface IGLTFObjectModelTreeExtensionsObject {
271
359
  };
272
360
  };
273
361
  };
274
- /** Mapping for the EXT_lights_area extension. */
362
+ /** Accessor tree for `/extensions/EXT_lights_area`. */
275
363
  EXT_lights_area: {
276
364
  lights: {
277
- length: IObjectAccessor<IEXTLightsArea_Light[], Light[], number>;
365
+ length: IObjectAccessor<IEXTLightsArea_Light[], Light[], FlowGraphInteger>;
278
366
  __array__: {
279
367
  __target__: boolean;
280
368
  color: IObjectAccessor<IEXTLightsArea_Light, Light, Color3>;
@@ -286,13 +374,13 @@ export interface IGLTFObjectModelTreeExtensionsObject {
286
374
  };
287
375
  };
288
376
  };
289
- /** Mapping for the EXT_lights_ies extension. */
377
+ /** Accessor tree for `/extensions/EXT_lights_ies`. */
290
378
  EXT_lights_ies: {
291
379
  lights: {
292
- length: IObjectAccessor<IKHRLightsPunctual_Light[], Light[], number>;
380
+ length: IObjectAccessor<IKHRLightsPunctual_Light[], Light[], FlowGraphInteger>;
293
381
  };
294
382
  };
295
- /** Mapping for the EXT_lights_image_based extension. */
383
+ /** Accessor tree for `/extensions/EXT_lights_image_based`. */
296
384
  EXT_lights_image_based: {
297
385
  lights: {
298
386
  __array__: {
@@ -300,7 +388,7 @@ export interface IGLTFObjectModelTreeExtensionsObject {
300
388
  intensity: IObjectAccessor<IEXTLightsImageBased_LightImageBased, BaseTexture, number>;
301
389
  rotation: IObjectAccessor<IEXTLightsImageBased_LightImageBased, BaseTexture, Quaternion>;
302
390
  };
303
- length: IObjectAccessor<IEXTLightsImageBased_LightImageBased[], BaseTexture[], number>;
391
+ length: IObjectAccessor<IEXTLightsImageBased_LightImageBased[], BaseTexture[], FlowGraphInteger>;
304
392
  };
305
393
  };
306
394
  }