babylonjs-loaders 7.51.0 → 7.51.2

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.
@@ -1033,24 +1033,26 @@ declare module BABYLON.GLTF2 {
1033
1033
  constructor(type: number, name: string, getValue: GetValueFn, getStride: (target: any) => number);
1034
1034
  protected _buildAnimation(name: string, fps: number, keys: any[]): Animation;
1035
1035
  /** @internal */
1036
- abstract buildAnimations(target: any, name: string, fps: number, keys: any[], callback: (babylonAnimatable: IAnimatable, babylonAnimation: Animation) => void): void;
1036
+ abstract buildAnimations(target: any, name: string, fps: number, keys: any[]): {
1037
+ babylonAnimatable: IAnimatable;
1038
+ babylonAnimation: Animation;
1039
+ }[];
1037
1040
  }
1038
1041
  /** @internal */
1039
1042
  export class TransformNodeAnimationPropertyInfo extends AnimationPropertyInfo {
1040
1043
  /** @internal */
1041
- buildAnimations(target: BABYLON.GLTF2.Loader.INode, name: string, fps: number, keys: any[], callback: (babylonAnimatable: IAnimatable, babylonAnimation: Animation) => void): void;
1044
+ buildAnimations(target: BABYLON.GLTF2.Loader.INode, name: string, fps: number, keys: any[]): {
1045
+ babylonAnimatable: IAnimatable;
1046
+ babylonAnimation: Animation;
1047
+ }[];
1042
1048
  }
1043
1049
  /** @internal */
1044
1050
  export class WeightAnimationPropertyInfo extends AnimationPropertyInfo {
1045
- buildAnimations(target: BABYLON.GLTF2.Loader.INode, name: string, fps: number, keys: any[], callback: (babylonAnimatable: IAnimatable, babylonAnimation: Animation) => void): void;
1051
+ buildAnimations(target: BABYLON.GLTF2.Loader.INode, name: string, fps: number, keys: any[]): {
1052
+ babylonAnimatable: IAnimatable;
1053
+ babylonAnimation: Animation;
1054
+ }[];
1046
1055
  }
1047
- /** @internal */
1048
- export var nodeAnimationData: {
1049
- translation: TransformNodeAnimationPropertyInfo[];
1050
- rotation: TransformNodeAnimationPropertyInfo[];
1051
- scale: TransformNodeAnimationPropertyInfo[];
1052
- weights: WeightAnimationPropertyInfo[];
1053
- };
1054
1056
 
1055
1057
 
1056
1058
 
@@ -1112,6 +1114,8 @@ declare module BABYLON.GLTF2 {
1112
1114
  _disableInstancedMesh: number;
1113
1115
  /** @internal */
1114
1116
  _allMaterialsDirtyRequired: boolean;
1117
+ /** @internal */
1118
+ _skipStartAnimationStep: boolean;
1115
1119
  private readonly _parent;
1116
1120
  private readonly _extensions;
1117
1121
  private _disposed;
@@ -1269,7 +1273,7 @@ declare module BABYLON.GLTF2 {
1269
1273
  * @param onLoad Called for each animation loaded
1270
1274
  * @returns A void promise that resolves when the load is complete
1271
1275
  */
1272
- _loadAnimationChannelFromTargetInfoAsync(context: string, animationContext: string, animation: BABYLON.GLTF2.Loader.IAnimation, channel: BABYLON.GLTF2.Loader.IAnimationChannel, targetInfo: IObjectInfo<BABYLON.GLTF2.AnimationPropertyInfo[]>, onLoad: (babylonAnimatable: IAnimatable, babylonAnimation: Animation) => void): Promise<void>;
1276
+ _loadAnimationChannelFromTargetInfoAsync(context: string, animationContext: string, animation: BABYLON.GLTF2.Loader.IAnimation, channel: BABYLON.GLTF2.Loader.IAnimationChannel, targetInfo: IObjectInfo<IInterpolationPropertyInfo[]>, onLoad: (babylonAnimatable: IAnimatable, babylonAnimation: Animation) => void): Promise<void>;
1273
1277
  private _loadAnimationSamplerAsync;
1274
1278
  /**
1275
1279
  * Loads a glTF buffer.
@@ -1470,41 +1474,279 @@ declare module BABYLON {
1470
1474
 
1471
1475
  }
1472
1476
  declare module BABYLON.GLTF2.Loader.Extensions {
1473
- export var gltfToFlowGraphTypeMap: {
1474
- [key: string]: string;
1475
- };
1476
- export var gltfTypeToBabylonType: any;
1477
-
1478
-
1479
-
1480
- }
1481
- declare module BABYLON {
1482
-
1483
-
1484
- }
1485
- declare module BABYLON.GLTF2.Loader.Extensions {
1486
- /**
1487
- * Class to convert an interactivity pointer path to a smart object
1488
- */
1489
- export class InteractivityPathToObjectConverter extends BABYLON.GLTF2.Loader.Extensions.GLTFPathToObjectConverter<IObjectAccessor> {
1490
- constructor(gltf: BABYLON.GLTF2.Loader.IGLTF);
1477
+ export interface IGLTFObjectModelTree {
1478
+ cameras: IGLTFObjectModelTreeCamerasObject;
1479
+ nodes: IGLTFObjectModelTreeNodesObject;
1480
+ materials: IGLTFObjectModelTreeMaterialsObject;
1481
+ extensions: IGLTFObjectModelTreeExtensionsObject;
1482
+ animations: {
1483
+ length: IObjectAccessor<BABYLON.GLTF2.Loader.IAnimation[], AnimationGroup[], number>;
1484
+ __array__: {};
1485
+ };
1486
+ meshes: {
1487
+ length: IObjectAccessor<BABYLON.GLTF2.Loader.IMesh[], (Mesh | undefined)[], number>;
1488
+ __array__: {};
1489
+ };
1491
1490
  }
1492
-
1493
-
1494
-
1495
- }
1496
- declare module BABYLON {
1497
-
1498
-
1499
- }
1500
- declare module BABYLON.GLTF2.Loader.Extensions {
1501
- /**
1502
- * @internal
1503
- * Converts a glTF Interactivity Extension to a serialized flow graph.
1504
- * @param gltf the interactivity data
1505
- * @returns a serialized flow graph
1491
+ export interface IGLTFObjectModelTreeNodesObject<GLTFTargetType = BABYLON.GLTF2.Loader.INode, BabylonTargetType = TransformNode> {
1492
+ length: IObjectAccessor<GLTFTargetType[], BabylonTargetType[], number>;
1493
+ __array__: {
1494
+ __target__: boolean;
1495
+ translation: IObjectAccessor<GLTFTargetType, BabylonTargetType, Vector3>;
1496
+ rotation: IObjectAccessor<GLTFTargetType, BabylonTargetType, Quaternion>;
1497
+ scale: IObjectAccessor<GLTFTargetType, BabylonTargetType, Vector3>;
1498
+ matrix: IObjectAccessor<GLTFTargetType, BabylonTargetType, Matrix>;
1499
+ globalMatrix: IObjectAccessor<GLTFTargetType, BabylonTargetType, Matrix>;
1500
+ weights: {
1501
+ length: IObjectAccessor<GLTFTargetType, BabylonTargetType, number>;
1502
+ __array__: {
1503
+ __target__: boolean;
1504
+ } & IObjectAccessor<GLTFTargetType, BabylonTargetType, number>;
1505
+ } & IObjectAccessor<GLTFTargetType, BabylonTargetType, number[]>;
1506
+ extensions: {
1507
+ EXT_lights_ies?: {
1508
+ multiplier: IObjectAccessor<BABYLON.GLTF2.Loader.INode, Light, number>;
1509
+ color: IObjectAccessor<BABYLON.GLTF2.Loader.INode, Light, Color3>;
1510
+ };
1511
+ };
1512
+ };
1513
+ }
1514
+ export interface IGLTFObjectModelTreeCamerasObject {
1515
+ __array__: {
1516
+ __target__: boolean;
1517
+ orthographic: {
1518
+ xmag: IObjectAccessor<BABYLON.GLTF2.Loader.ICamera, BABYLON.GLTF2.Loader.ICamera, Vector2>;
1519
+ ymag: IObjectAccessor<BABYLON.GLTF2.Loader.ICamera, BABYLON.GLTF2.Loader.ICamera, Vector2>;
1520
+ zfar: IObjectAccessor<BABYLON.GLTF2.Loader.ICamera, BABYLON.GLTF2.Loader.ICamera, number>;
1521
+ znear: IObjectAccessor<BABYLON.GLTF2.Loader.ICamera, BABYLON.GLTF2.Loader.ICamera, number>;
1522
+ };
1523
+ perspective: {
1524
+ yfov: IObjectAccessor<BABYLON.GLTF2.Loader.ICamera, BABYLON.GLTF2.Loader.ICamera, number>;
1525
+ zfar: IObjectAccessor<BABYLON.GLTF2.Loader.ICamera, BABYLON.GLTF2.Loader.ICamera, number>;
1526
+ znear: IObjectAccessor<BABYLON.GLTF2.Loader.ICamera, BABYLON.GLTF2.Loader.ICamera, number>;
1527
+ aspectRatio: IObjectAccessor<BABYLON.GLTF2.Loader.ICamera, BABYLON.GLTF2.Loader.ICamera, Nullable<number>>;
1528
+ };
1529
+ };
1530
+ }
1531
+ export interface IGLTFObjectModelTreeMaterialsObject {
1532
+ __array__: {
1533
+ __target__: boolean;
1534
+ pbrMetallicRoughness: {
1535
+ baseColorFactor: IObjectAccessor<BABYLON.GLTF2.Loader.IMaterial, PBRMaterial, Color4>;
1536
+ metallicFactor: IObjectAccessor<BABYLON.GLTF2.Loader.IMaterial, PBRMaterial, Nullable<number>>;
1537
+ roughnessFactor: IObjectAccessor<BABYLON.GLTF2.Loader.IMaterial, PBRMaterial, Nullable<number>>;
1538
+ baseColorTexture: {
1539
+ extensions: {
1540
+ KHR_texture_transform: ITextureDefinition;
1541
+ };
1542
+ };
1543
+ metallicRoughnessTexture: {
1544
+ extensions: {
1545
+ KHR_texture_transform: ITextureDefinition;
1546
+ };
1547
+ };
1548
+ };
1549
+ emissiveFactor: IObjectAccessor<BABYLON.GLTF2.Loader.IMaterial, PBRMaterial, Color3>;
1550
+ normalTexture: {
1551
+ scale: IObjectAccessor<BABYLON.GLTF2.Loader.IMaterial, PBRMaterial, number>;
1552
+ extensions: {
1553
+ KHR_texture_transform: ITextureDefinition;
1554
+ };
1555
+ };
1556
+ occlusionTexture: {
1557
+ strength: IObjectAccessor<BABYLON.GLTF2.Loader.IMaterial, PBRMaterial, number>;
1558
+ extensions: {
1559
+ KHR_texture_transform: ITextureDefinition;
1560
+ };
1561
+ };
1562
+ emissiveTexture: {
1563
+ extensions: {
1564
+ KHR_texture_transform: ITextureDefinition;
1565
+ };
1566
+ };
1567
+ extensions: {
1568
+ KHR_materials_anisotropy: {
1569
+ anisotropyStrength: IObjectAccessor<BABYLON.GLTF2.Loader.IMaterial, PBRMaterial, number>;
1570
+ anisotropyRotation: IObjectAccessor<BABYLON.GLTF2.Loader.IMaterial, PBRMaterial, number>;
1571
+ anisotropyTexture: {
1572
+ extensions: {
1573
+ KHR_texture_transform: ITextureDefinition;
1574
+ };
1575
+ };
1576
+ };
1577
+ KHR_materials_clearcoat: {
1578
+ clearcoatFactor: IObjectAccessor<BABYLON.GLTF2.Loader.IMaterial, PBRMaterial, number>;
1579
+ clearcoatRoughnessFactor: IObjectAccessor<BABYLON.GLTF2.Loader.IMaterial, PBRMaterial, number>;
1580
+ clearcoatTexture: {
1581
+ extensions: {
1582
+ KHR_texture_transform: ITextureDefinition;
1583
+ };
1584
+ };
1585
+ clearcoatNormalTexture: {
1586
+ scale: IObjectAccessor<BABYLON.GLTF2.Loader.IMaterial, PBRMaterial, number>;
1587
+ extensions: {
1588
+ KHR_texture_transform: ITextureDefinition;
1589
+ };
1590
+ };
1591
+ clearcoatRoughnessTexture: {
1592
+ extensions: {
1593
+ KHR_texture_transform: ITextureDefinition;
1594
+ };
1595
+ };
1596
+ };
1597
+ KHR_materials_dispersion: {
1598
+ dispersion: IObjectAccessor<BABYLON.GLTF2.Loader.IMaterial, PBRMaterial, number>;
1599
+ };
1600
+ KHR_materials_emissive_strength: {
1601
+ emissiveStrength: IObjectAccessor<BABYLON.GLTF2.Loader.IMaterial, PBRMaterial, number>;
1602
+ };
1603
+ KHR_materials_ior: {
1604
+ ior: IObjectAccessor<BABYLON.GLTF2.Loader.IMaterial, PBRMaterial, number>;
1605
+ };
1606
+ KHR_materials_iridescence: {
1607
+ iridescenceFactor: IObjectAccessor<BABYLON.GLTF2.Loader.IMaterial, PBRMaterial, number>;
1608
+ iridescenceIor: IObjectAccessor<BABYLON.GLTF2.Loader.IMaterial, PBRMaterial, number>;
1609
+ iridescenceThicknessMinimum: IObjectAccessor<BABYLON.GLTF2.Loader.IMaterial, PBRMaterial, number>;
1610
+ iridescenceThicknessMaximum: IObjectAccessor<BABYLON.GLTF2.Loader.IMaterial, PBRMaterial, number>;
1611
+ iridescenceTexture: {
1612
+ extensions: {
1613
+ KHR_texture_transform: ITextureDefinition;
1614
+ };
1615
+ };
1616
+ iridescenceThicknessTexture: {
1617
+ extensions: {
1618
+ KHR_texture_transform: ITextureDefinition;
1619
+ };
1620
+ };
1621
+ };
1622
+ KHR_materials_sheen: {
1623
+ sheenColorFactor: IObjectAccessor<BABYLON.GLTF2.Loader.IMaterial, PBRMaterial, Color3>;
1624
+ sheenRoughnessFactor: IObjectAccessor<BABYLON.GLTF2.Loader.IMaterial, PBRMaterial, number>;
1625
+ sheenColorTexture: {
1626
+ extensions: {
1627
+ KHR_texture_transform: ITextureDefinition;
1628
+ };
1629
+ };
1630
+ sheenRoughnessTexture: {
1631
+ extensions: {
1632
+ KHR_texture_transform: ITextureDefinition;
1633
+ };
1634
+ };
1635
+ };
1636
+ KHR_materials_specular: {
1637
+ specularFactor: IObjectAccessor<BABYLON.GLTF2.Loader.IMaterial, PBRMaterial, number>;
1638
+ specularColorFactor: IObjectAccessor<BABYLON.GLTF2.Loader.IMaterial, PBRMaterial, Color3>;
1639
+ specularTexture: {
1640
+ extensions: {
1641
+ KHR_texture_transform: ITextureDefinition;
1642
+ };
1643
+ };
1644
+ specularColorTexture: {
1645
+ extensions: {
1646
+ KHR_texture_transform: ITextureDefinition;
1647
+ };
1648
+ };
1649
+ };
1650
+ KHR_materials_transmission: {
1651
+ transmissionFactor: IObjectAccessor<BABYLON.GLTF2.Loader.IMaterial, PBRMaterial, number>;
1652
+ transmissionTexture: {
1653
+ extensions: {
1654
+ KHR_texture_transform: ITextureDefinition;
1655
+ };
1656
+ };
1657
+ };
1658
+ KHR_materials_diffuse_transmission: {
1659
+ diffuseTransmissionFactor: IObjectAccessor<BABYLON.GLTF2.Loader.IMaterial, PBRMaterial, number>;
1660
+ diffuseTransmissionTexture: {
1661
+ extensions: {
1662
+ KHR_texture_transform: ITextureDefinition;
1663
+ };
1664
+ };
1665
+ diffuseTransmissionColorFactor: IObjectAccessor<BABYLON.GLTF2.Loader.IMaterial, PBRMaterial, Nullable<Color3>>;
1666
+ diffuseTransmissionColorTexture: {
1667
+ extensions: {
1668
+ KHR_texture_transform: ITextureDefinition;
1669
+ };
1670
+ };
1671
+ };
1672
+ KHR_materials_volume: {
1673
+ thicknessFactor: IObjectAccessor<BABYLON.GLTF2.Loader.IMaterial, PBRMaterial, number>;
1674
+ attenuationColor: IObjectAccessor<BABYLON.GLTF2.Loader.IMaterial, PBRMaterial, Color3>;
1675
+ attenuationDistance: IObjectAccessor<BABYLON.GLTF2.Loader.IMaterial, PBRMaterial, number>;
1676
+ thicknessTexture: {
1677
+ extensions: {
1678
+ KHR_texture_transform: ITextureDefinition;
1679
+ };
1680
+ };
1681
+ };
1682
+ };
1683
+ };
1684
+ }
1685
+ interface ITextureDefinition {
1686
+ offset: IObjectAccessor<BABYLON.GLTF2.Loader.IMaterial, PBRMaterial, Vector2>;
1687
+ rotation: IObjectAccessor<BABYLON.GLTF2.Loader.IMaterial, PBRMaterial, number>;
1688
+ scale: IObjectAccessor<BABYLON.GLTF2.Loader.IMaterial, PBRMaterial, Vector2>;
1689
+ }
1690
+ export interface IGLTFObjectModelTreeMeshesObject {
1691
+ }
1692
+ export interface IGLTFObjectModelTreeExtensionsObject {
1693
+ KHR_lights_punctual: {
1694
+ lights: {
1695
+ length: IObjectAccessor<BABYLON.GLTF2.Loader.IKHRLightsPunctual_Light[], Light[], number>;
1696
+ __array__: {
1697
+ __target__: boolean;
1698
+ color: IObjectAccessor<BABYLON.GLTF2.Loader.IKHRLightsPunctual_Light, Light, Color3>;
1699
+ intensity: IObjectAccessor<BABYLON.GLTF2.Loader.IKHRLightsPunctual_Light, Light, number>;
1700
+ range: IObjectAccessor<BABYLON.GLTF2.Loader.IKHRLightsPunctual_Light, Light, number>;
1701
+ spot: {
1702
+ innerConeAngle: IObjectAccessor<BABYLON.GLTF2.Loader.IKHRLightsPunctual_Light, Light, number>;
1703
+ outerConeAngle: IObjectAccessor<BABYLON.GLTF2.Loader.IKHRLightsPunctual_Light, Light, number>;
1704
+ };
1705
+ };
1706
+ };
1707
+ };
1708
+ EXT_lights_ies: {
1709
+ lights: {
1710
+ length: IObjectAccessor<BABYLON.GLTF2.Loader.IKHRLightsPunctual_Light[], Light[], number>;
1711
+ };
1712
+ };
1713
+ EXT_lights_image_based: {
1714
+ lights: {
1715
+ __array__: {
1716
+ __target__: boolean;
1717
+ intensity: IObjectAccessor<BABYLON.GLTF2.IEXTLightsImageBased_LightImageBased, BaseTexture, number>;
1718
+ rotation: IObjectAccessor<BABYLON.GLTF2.IEXTLightsImageBased_LightImageBased, BaseTexture, Quaternion>;
1719
+ };
1720
+ length: IObjectAccessor<BABYLON.GLTF2.IEXTLightsImageBased_LightImageBased[], BaseTexture[], number>;
1721
+ };
1722
+ };
1723
+ }
1724
+ /**
1725
+ * get a path-to-object converter for the given glTF tree
1726
+ * @param gltf the glTF tree to use
1727
+ * @returns a path-to-object converter for the given glTF tree
1728
+ */
1729
+ export function GetPathToObjectConverter(gltf: BABYLON.GLTF2.Loader.IGLTF): BABYLON.GLTF2.Loader.Extensions.GLTFPathToObjectConverter<unknown, unknown, unknown>;
1730
+ /**
1731
+ * This function will return the object accessor for the given key in the object model
1732
+ * If the key is not found, it will return undefined
1733
+ * @param key the key to get the mapping for, for example /materials/\{\}/emissiveFactor
1734
+ * @returns an object accessor for the given key, or undefined if the key is not found
1735
+ */
1736
+ export function GetMappingForKey(key: string): IObjectAccessor | undefined;
1737
+ /**
1738
+ * Set interpolation for a specific key in the object model
1739
+ * @param key the key to set, for example /materials/\{\}/emissiveFactor
1740
+ * @param interpolation the interpolation elements array
1741
+ */
1742
+ export function SetInterpolationForKey(key: string, interpolation?: IInterpolationPropertyInfo[]): void;
1743
+ /**
1744
+ * This will ad a new object accessor in the object model at the given key.
1745
+ * Note that this will NOT change the typescript types. To do that you will need to change the interface itself (extending it in the module that uses it)
1746
+ * @param key the key to add the object accessor at. For example /cameras/\{\}/perspective/aspectRatio
1747
+ * @param accessor the object accessor to add
1506
1748
  */
1507
- export function convertGLTFToSerializedFlowGraph(gltf: BABYLON.GLTF2.IKHRInteractivity): ISerializedFlowGraph;
1749
+ export function AddObjectAccessorToKey<GLTFTargetType = any, BabylonTargetType = any, BabylonValueType = any>(key: string, accessor: IObjectAccessor<GLTFTargetType, BabylonTargetType, BabylonValueType>): void;
1508
1750
 
1509
1751
 
1510
1752
 
@@ -1529,12 +1771,13 @@ declare module BABYLON.GLTF2.Loader.Extensions {
1529
1771
  * objects referenced in the glTF to be associated with their
1530
1772
  * respective Babylon.js objects.
1531
1773
  */
1532
- export class GLTFPathToObjectConverter<T> implements IPathToObjectConverter<T> {
1774
+ export class GLTFPathToObjectConverter<T, BabylonType, BabylonValue> implements IPathToObjectConverter<IObjectAccessor<T, BabylonType, BabylonValue>> {
1533
1775
  private _gltf;
1534
1776
  private _infoTree;
1535
1777
  constructor(_gltf: BABYLON.GLTF2.Loader.IGLTF, _infoTree: any);
1536
1778
  /**
1537
1779
  * The pointer string is represented by a [JSON pointer](https://datatracker.ietf.org/doc/html/rfc6901).
1780
+ * See also https://github.com/KhronosGroup/glTF/blob/main/specification/2.0/ObjectModel.adoc#core-pointers
1538
1781
  * <animationPointer> := /<rootNode>/<assetIndex>/<propertyPath>
1539
1782
  * <rootNode> := "nodes" | "materials" | "meshes" | "cameras" | "extensions"
1540
1783
  * <assetIndex> := <digit> | <name>
@@ -1546,6 +1789,7 @@ declare module BABYLON.GLTF2.Loader.Extensions {
1546
1789
  *
1547
1790
  * Examples:
1548
1791
  * - "/nodes/0/rotation"
1792
+ * - "/nodes.length"
1549
1793
  * - "/materials/2/emissiveFactor"
1550
1794
  * - "/materials/2/pbrMetallicRoughness/baseColorFactor"
1551
1795
  * - "/materials/2/extensions/KHR_materials_emissive_strength/emissiveStrength"
@@ -1553,7 +1797,7 @@ declare module BABYLON.GLTF2.Loader.Extensions {
1553
1797
  * @param path The path to convert
1554
1798
  * @returns The object and info associated with the path
1555
1799
  */
1556
- convert(path: string): IObjectInfo<T>;
1800
+ convert(path: string): IObjectInfo<IObjectAccessor<T, BabylonType, BabylonValue>>;
1557
1801
  }
1558
1802
 
1559
1803
 
@@ -1936,6 +2180,40 @@ declare module BABYLON {
1936
2180
  ["KHR_node_visibility"]: {};
1937
2181
  }
1938
2182
 
2183
+ }
2184
+ declare module BABYLON.GLTF2.Loader.Extensions {
2185
+ /**
2186
+ * Loader extension for KHR_selectability
2187
+ */
2188
+ export class KHR_node_selectability implements BABYLON.GLTF2.IGLTFLoaderExtension {
2189
+ /**
2190
+ * The name of this extension.
2191
+ */
2192
+ readonly name = "KHR_node_selectability";
2193
+ /**
2194
+ * Defines whether this extension is enabled.
2195
+ */
2196
+ enabled: boolean;
2197
+ private _loader;
2198
+ /**
2199
+ * @internal
2200
+ */
2201
+ constructor(loader: BABYLON.GLTF2.GLTFLoader);
2202
+ onReady(): Promise<void>;
2203
+ dispose(): void;
2204
+ }
2205
+
2206
+
2207
+
2208
+ }
2209
+ declare module BABYLON {
2210
+ interface GLTFLoaderExtensionOptions {
2211
+ /**
2212
+ * Defines options for the KHR_selectability extension.
2213
+ */
2214
+ ["KHR_node_selectability"]: {};
2215
+ }
2216
+
1939
2217
  }
1940
2218
  declare module BABYLON.GLTF2.Loader.Extensions {
1941
2219
  /**
@@ -2742,8 +3020,13 @@ declare module BABYLON.GLTF2.Loader.Extensions {
2742
3020
  */
2743
3021
  constructor(_loader: BABYLON.GLTF2.GLTFLoader);
2744
3022
  dispose(): void;
2745
- onReady(): void;
3023
+ onReady(): Promise<void>;
2746
3024
  }
3025
+ /**
3026
+ * @internal
3027
+ * populates the object model with the interactivity extension
3028
+ */
3029
+ export function _AddInteractivityObjectModel(scene: Scene): void;
2747
3030
 
2748
3031
 
2749
3032
 
@@ -2804,302 +3087,7 @@ declare module BABYLON {
2804
3087
 
2805
3088
  }
2806
3089
  declare module BABYLON.GLTF2.Loader.Extensions {
2807
- class CameraAnimationPropertyInfo extends BABYLON.GLTF2.AnimationPropertyInfo {
2808
- /** @internal */
2809
- buildAnimations(target: BABYLON.GLTF2.Loader.ICamera, name: string, fps: number, keys: any[], callback: (babylonAnimatable: IAnimatable, babylonAnimation: Animation) => void): void;
2810
- }
2811
- class MaterialAnimationPropertyInfo extends BABYLON.GLTF2.AnimationPropertyInfo {
2812
- /** @internal */
2813
- buildAnimations(target: BABYLON.GLTF2.Loader.IMaterial, name: string, fps: number, keys: any[], callback: (babylonAnimatable: IAnimatable, babylonAnimation: Animation) => void): void;
2814
- }
2815
- class LightAnimationPropertyInfo extends BABYLON.GLTF2.AnimationPropertyInfo {
2816
- /** @internal */
2817
- buildAnimations(target: BABYLON.GLTF2.Loader.IKHRLightsPunctual_Light, name: string, fps: number, keys: any[], callback: (babylonAnimatable: IAnimatable, babylonAnimation: Animation) => void): void;
2818
- }
2819
- /** @internal */
2820
- export var animationPointerTree: {
2821
- nodes: {
2822
- __array__: {
2823
- translation: TransformNodeAnimationPropertyInfo[];
2824
- rotation: TransformNodeAnimationPropertyInfo[];
2825
- scale: TransformNodeAnimationPropertyInfo[];
2826
- weights: WeightAnimationPropertyInfo[];
2827
- __target__: boolean;
2828
- };
2829
- };
2830
- materials: {
2831
- __array__: {
2832
- __target__: boolean;
2833
- pbrMetallicRoughness: {
2834
- baseColorFactor: MaterialAnimationPropertyInfo[];
2835
- metallicFactor: MaterialAnimationPropertyInfo[];
2836
- roughnessFactor: MaterialAnimationPropertyInfo[];
2837
- baseColorTexture: {
2838
- extensions: {
2839
- KHR_texture_transform: {
2840
- scale: MaterialAnimationPropertyInfo[];
2841
- offset: MaterialAnimationPropertyInfo[];
2842
- rotation: MaterialAnimationPropertyInfo[];
2843
- };
2844
- };
2845
- };
2846
- metallicRoughnessTexture: {
2847
- extensions: {
2848
- KHR_texture_transform: {
2849
- scale: MaterialAnimationPropertyInfo[];
2850
- offset: MaterialAnimationPropertyInfo[];
2851
- rotation: MaterialAnimationPropertyInfo[];
2852
- };
2853
- };
2854
- };
2855
- };
2856
- emissiveFactor: MaterialAnimationPropertyInfo[];
2857
- normalTexture: {
2858
- scale: MaterialAnimationPropertyInfo[];
2859
- extensions: {
2860
- KHR_texture_transform: {
2861
- scale: MaterialAnimationPropertyInfo[];
2862
- offset: MaterialAnimationPropertyInfo[];
2863
- rotation: MaterialAnimationPropertyInfo[];
2864
- };
2865
- };
2866
- };
2867
- occlusionTexture: {
2868
- strength: MaterialAnimationPropertyInfo[];
2869
- extensions: {
2870
- KHR_texture_transform: {
2871
- scale: MaterialAnimationPropertyInfo[];
2872
- offset: MaterialAnimationPropertyInfo[];
2873
- rotation: MaterialAnimationPropertyInfo[];
2874
- };
2875
- };
2876
- };
2877
- emissiveTexture: {
2878
- extensions: {
2879
- KHR_texture_transform: {
2880
- scale: MaterialAnimationPropertyInfo[];
2881
- offset: MaterialAnimationPropertyInfo[];
2882
- rotation: MaterialAnimationPropertyInfo[];
2883
- };
2884
- };
2885
- };
2886
- extensions: {
2887
- KHR_materials_anisotropy: {
2888
- anisotropyStrength: MaterialAnimationPropertyInfo[];
2889
- anisotropyRotation: MaterialAnimationPropertyInfo[];
2890
- anisotropyTexture: {
2891
- extensions: {
2892
- KHR_texture_transform: {
2893
- scale: MaterialAnimationPropertyInfo[];
2894
- offset: MaterialAnimationPropertyInfo[];
2895
- rotation: MaterialAnimationPropertyInfo[];
2896
- };
2897
- };
2898
- };
2899
- };
2900
- KHR_materials_clearcoat: {
2901
- clearcoatFactor: MaterialAnimationPropertyInfo[];
2902
- clearcoatRoughnessFactor: MaterialAnimationPropertyInfo[];
2903
- clearcoatTexture: {
2904
- extensions: {
2905
- KHR_texture_transform: {
2906
- scale: MaterialAnimationPropertyInfo[];
2907
- offset: MaterialAnimationPropertyInfo[];
2908
- rotation: MaterialAnimationPropertyInfo[];
2909
- };
2910
- };
2911
- };
2912
- clearcoatNormalTexture: {
2913
- scale: MaterialAnimationPropertyInfo[];
2914
- extensions: {
2915
- KHR_texture_transform: {
2916
- scale: MaterialAnimationPropertyInfo[];
2917
- offset: MaterialAnimationPropertyInfo[];
2918
- rotation: MaterialAnimationPropertyInfo[];
2919
- };
2920
- };
2921
- };
2922
- clearcoatRoughnessTexture: {
2923
- extensions: {
2924
- KHR_texture_transform: {
2925
- scale: MaterialAnimationPropertyInfo[];
2926
- offset: MaterialAnimationPropertyInfo[];
2927
- rotation: MaterialAnimationPropertyInfo[];
2928
- };
2929
- };
2930
- };
2931
- };
2932
- KHR_materials_dispersion: {
2933
- dispersion: MaterialAnimationPropertyInfo[];
2934
- };
2935
- KHR_materials_emissive_strength: {
2936
- emissiveStrength: MaterialAnimationPropertyInfo[];
2937
- };
2938
- KHR_materials_ior: {
2939
- ior: MaterialAnimationPropertyInfo[];
2940
- };
2941
- KHR_materials_iridescence: {
2942
- iridescenceFactor: MaterialAnimationPropertyInfo[];
2943
- iridescenceIor: MaterialAnimationPropertyInfo[];
2944
- iridescenceThicknessMinimum: MaterialAnimationPropertyInfo[];
2945
- iridescenceThicknessMaximum: MaterialAnimationPropertyInfo[];
2946
- iridescenceTexture: {
2947
- extensions: {
2948
- KHR_texture_transform: {
2949
- scale: MaterialAnimationPropertyInfo[];
2950
- offset: MaterialAnimationPropertyInfo[];
2951
- rotation: MaterialAnimationPropertyInfo[];
2952
- };
2953
- };
2954
- };
2955
- iridescenceThicknessTexture: {
2956
- extensions: {
2957
- KHR_texture_transform: {
2958
- scale: MaterialAnimationPropertyInfo[];
2959
- offset: MaterialAnimationPropertyInfo[];
2960
- rotation: MaterialAnimationPropertyInfo[];
2961
- };
2962
- };
2963
- };
2964
- };
2965
- KHR_materials_sheen: {
2966
- sheenColorFactor: MaterialAnimationPropertyInfo[];
2967
- sheenRoughnessFactor: MaterialAnimationPropertyInfo[];
2968
- sheenColorTexture: {
2969
- extensions: {
2970
- KHR_texture_transform: {
2971
- scale: MaterialAnimationPropertyInfo[];
2972
- offset: MaterialAnimationPropertyInfo[];
2973
- rotation: MaterialAnimationPropertyInfo[];
2974
- };
2975
- };
2976
- };
2977
- sheenRoughnessTexture: {
2978
- extensions: {
2979
- KHR_texture_transform: {
2980
- scale: MaterialAnimationPropertyInfo[];
2981
- offset: MaterialAnimationPropertyInfo[];
2982
- rotation: MaterialAnimationPropertyInfo[];
2983
- };
2984
- };
2985
- };
2986
- };
2987
- KHR_materials_specular: {
2988
- specularFactor: MaterialAnimationPropertyInfo[];
2989
- specularColorFactor: MaterialAnimationPropertyInfo[];
2990
- specularTexture: {
2991
- extensions: {
2992
- KHR_texture_transform: {
2993
- scale: MaterialAnimationPropertyInfo[];
2994
- offset: MaterialAnimationPropertyInfo[];
2995
- rotation: MaterialAnimationPropertyInfo[];
2996
- };
2997
- };
2998
- };
2999
- specularColorTexture: {
3000
- extensions: {
3001
- KHR_texture_transform: {
3002
- scale: MaterialAnimationPropertyInfo[];
3003
- offset: MaterialAnimationPropertyInfo[];
3004
- rotation: MaterialAnimationPropertyInfo[];
3005
- };
3006
- };
3007
- };
3008
- };
3009
- KHR_materials_transmission: {
3010
- transmissionFactor: MaterialAnimationPropertyInfo[];
3011
- transmissionTexture: {
3012
- extensions: {
3013
- KHR_texture_transform: {
3014
- scale: MaterialAnimationPropertyInfo[];
3015
- offset: MaterialAnimationPropertyInfo[];
3016
- rotation: MaterialAnimationPropertyInfo[];
3017
- };
3018
- };
3019
- };
3020
- };
3021
- KHR_materials_volume: {
3022
- attenuationColor: MaterialAnimationPropertyInfo[];
3023
- attenuationDistance: MaterialAnimationPropertyInfo[];
3024
- thicknessFactor: MaterialAnimationPropertyInfo[];
3025
- thicknessTexture: {
3026
- extensions: {
3027
- KHR_texture_transform: {
3028
- scale: MaterialAnimationPropertyInfo[];
3029
- offset: MaterialAnimationPropertyInfo[];
3030
- rotation: MaterialAnimationPropertyInfo[];
3031
- };
3032
- };
3033
- };
3034
- };
3035
- KHR_materials_diffuse_transmission: {
3036
- diffuseTransmissionFactor: MaterialAnimationPropertyInfo[];
3037
- diffuseTransmissionTexture: {
3038
- extensions: {
3039
- KHR_texture_transform: {
3040
- scale: MaterialAnimationPropertyInfo[];
3041
- offset: MaterialAnimationPropertyInfo[];
3042
- rotation: MaterialAnimationPropertyInfo[];
3043
- };
3044
- };
3045
- };
3046
- diffuseTransmissionColorFactor: MaterialAnimationPropertyInfo[];
3047
- diffuseTransmissionColorTexture: {
3048
- extensions: {
3049
- KHR_texture_transform: {
3050
- scale: MaterialAnimationPropertyInfo[];
3051
- offset: MaterialAnimationPropertyInfo[];
3052
- rotation: MaterialAnimationPropertyInfo[];
3053
- };
3054
- };
3055
- };
3056
- };
3057
- };
3058
- };
3059
- };
3060
- cameras: {
3061
- __array__: {
3062
- __target__: boolean;
3063
- orthographic: {
3064
- xmag: CameraAnimationPropertyInfo[];
3065
- ymag: CameraAnimationPropertyInfo[];
3066
- zfar: CameraAnimationPropertyInfo[];
3067
- znear: CameraAnimationPropertyInfo[];
3068
- };
3069
- perspective: {
3070
- yfov: CameraAnimationPropertyInfo[];
3071
- zfar: CameraAnimationPropertyInfo[];
3072
- znear: CameraAnimationPropertyInfo[];
3073
- };
3074
- };
3075
- };
3076
- extensions: {
3077
- KHR_lights_punctual: {
3078
- lights: {
3079
- __array__: {
3080
- __target__: boolean;
3081
- color: LightAnimationPropertyInfo[];
3082
- intensity: LightAnimationPropertyInfo[];
3083
- range: LightAnimationPropertyInfo[];
3084
- spot: {
3085
- innerConeAngle: LightAnimationPropertyInfo[];
3086
- outerConeAngle: LightAnimationPropertyInfo[];
3087
- };
3088
- };
3089
- };
3090
- };
3091
- EXT_lights_ies: {
3092
- lights: {
3093
- __array__: {
3094
- __target__: boolean;
3095
- color: LightAnimationPropertyInfo[];
3096
- multiplier: LightAnimationPropertyInfo[];
3097
- };
3098
- };
3099
- };
3100
- };
3101
- };
3102
-
3090
+
3103
3091
 
3104
3092
 
3105
3093
  }
@@ -3437,6 +3425,460 @@ declare module BABYLON {
3437
3425
  ["EXT_lights_ies"]: {};
3438
3426
  }
3439
3427
 
3428
+ }
3429
+ declare module BABYLON.GLTF2.Loader.Extensions {
3430
+ export interface InteractivityEvent {
3431
+ eventId: string;
3432
+ eventData?: {
3433
+ eventData: boolean;
3434
+ id: string;
3435
+ type: string;
3436
+ value?: any;
3437
+ }[];
3438
+ }
3439
+ export var gltfTypeToBabylonType: {
3440
+ [key: string]: {
3441
+ length: number;
3442
+ flowGraphType: FlowGraphTypes;
3443
+ elementType: "number" | "boolean";
3444
+ };
3445
+ };
3446
+ export class InteractivityGraphToFlowGraphParser {
3447
+ private _interactivityGraph;
3448
+ private _gltf;
3449
+ _loader: BABYLON.GLTF2.GLTFLoader;
3450
+ /**
3451
+ * Note - the graph should be rejected if the same type is defined twice.
3452
+ * We currently don't validate that.
3453
+ */
3454
+ private _types;
3455
+ private _mappings;
3456
+ private _staticVariables;
3457
+ private _events;
3458
+ private _internalEventsCounter;
3459
+ private _nodes;
3460
+ constructor(_interactivityGraph: BABYLON.GLTF2.IKHRInteractivity_Graph, _gltf: BABYLON.GLTF2.Loader.IGLTF, _loader: BABYLON.GLTF2.GLTFLoader);
3461
+ get arrays(): {
3462
+ types: {
3463
+ length: number;
3464
+ flowGraphType: FlowGraphTypes;
3465
+ elementType: "number" | "boolean";
3466
+ }[];
3467
+ mappings: {
3468
+ flowGraphMapping: BABYLON.GLTF2.Loader.Extensions.IGLTFToFlowGraphMapping;
3469
+ fullOperationName: string;
3470
+ }[];
3471
+ staticVariables: {
3472
+ type: FlowGraphTypes;
3473
+ value: any[];
3474
+ }[];
3475
+ events: InteractivityEvent[];
3476
+ nodes: {
3477
+ blocks: ISerializedFlowGraphBlock[];
3478
+ fullOperationName: string;
3479
+ }[];
3480
+ };
3481
+ private _parseTypes;
3482
+ private _parseDeclarations;
3483
+ private _parseVariables;
3484
+ private _parseVariable;
3485
+ private _parseEvents;
3486
+ private _parseNodes;
3487
+ private _getEmptyBlock;
3488
+ private _parseNodeConfiguration;
3489
+ private _parseNodeConnections;
3490
+ private _createNewSocketConnection;
3491
+ private _connectFlowGraphNodes;
3492
+ getVariableName(index: number): string;
3493
+ serializeToFlowGraph(): ISerializedFlowGraph;
3494
+ }
3495
+
3496
+
3497
+
3498
+ }
3499
+ declare module BABYLON {
3500
+
3501
+
3502
+ }
3503
+ declare module BABYLON.GLTF2.Loader.Extensions {
3504
+
3505
+
3506
+
3507
+ }
3508
+ declare module BABYLON {
3509
+
3510
+
3511
+ }
3512
+ declare module BABYLON.GLTF2.Loader.Extensions {
3513
+ /**
3514
+ * a configuration interface for this block
3515
+ */
3516
+ export interface IFlowGraphGLTFDataProviderBlockConfiguration extends IFlowGraphBlockConfiguration {
3517
+ /**
3518
+ * the glTF object to provide data from
3519
+ */
3520
+ glTF: BABYLON.GLTF2.Loader.IGLTF;
3521
+ }
3522
+ /**
3523
+ * a glTF-based FlowGraph block that provides arrays with babylon object, based on the glTF tree
3524
+ * Can be used, for example, to get animation index from a glTF animation
3525
+ */
3526
+ export class FlowGraphGLTFDataProvider extends FlowGraphBlock {
3527
+ /**
3528
+ * Output: an array of animation groups
3529
+ * Corresponds directly to the glTF animations array
3530
+ */
3531
+ readonly animationGroups: FlowGraphDataConnection<AnimationGroup[]>;
3532
+ /**
3533
+ * Output an array of (Transform) nodes
3534
+ * Corresponds directly to the glTF nodes array
3535
+ */
3536
+ readonly nodes: FlowGraphDataConnection<TransformNode[]>;
3537
+ constructor(config: IFlowGraphGLTFDataProviderBlockConfiguration);
3538
+ getClassName(): string;
3539
+ }
3540
+
3541
+
3542
+
3543
+ }
3544
+ declare module BABYLON {
3545
+
3546
+
3547
+ }
3548
+ declare module BABYLON.GLTF2.Loader.Extensions {
3549
+ interface IGLTFToFlowGraphMappingObject<I = any, O = any> {
3550
+ /**
3551
+ * The name of the property in the FlowGraph block.
3552
+ */
3553
+ name: string;
3554
+ /**
3555
+ * The type of the property in the glTF specs.
3556
+ * If not provided will be inferred.
3557
+ */
3558
+ gltfType?: string;
3559
+ /**
3560
+ * The type of the property in the FlowGraph block.
3561
+ * If not defined it equals the glTF type.
3562
+ */
3563
+ flowGraphType?: string;
3564
+ /**
3565
+ * A function that transforms the data from the glTF to the FlowGraph block.
3566
+ */
3567
+ dataTransformer?: (data: I[], parser: BABYLON.GLTF2.Loader.Extensions.InteractivityGraphToFlowGraphParser) => O[];
3568
+ /**
3569
+ * If the property is in the options passed to the constructor of the block.
3570
+ */
3571
+ inOptions?: boolean;
3572
+ /**
3573
+ * If the property is a pointer to a value.
3574
+ * This will add an extra JsonPointerParser block to the graph.
3575
+ */
3576
+ isPointer?: boolean;
3577
+ /**
3578
+ * If the property is an index to a value.
3579
+ * if defined this will be the name of the array to find the object in.
3580
+ */
3581
+ isVariable?: boolean;
3582
+ /**
3583
+ * the name of the class type this value will be mapped to.
3584
+ * This is used if we generate more than one block for a single glTF node.
3585
+ * Defaults to the first block in the mapping.
3586
+ */
3587
+ toBlock?: FlowGraphBlockNames;
3588
+ /**
3589
+ * Used in configuration values. If defined, this will be the default value, if no value is provided.
3590
+ */
3591
+ defaultValue?: O;
3592
+ }
3593
+ export interface IGLTFToFlowGraphMapping {
3594
+ /**
3595
+ * The type of the FlowGraph block(s).
3596
+ * Typically will be a single element in an array.
3597
+ * When adding blocks defined in this module use the KHR_interactivity prefix.
3598
+ */
3599
+ blocks: (FlowGraphBlockNames | string)[];
3600
+ /**
3601
+ * The inputs of the glTF node mapped to the FlowGraph block.
3602
+ */
3603
+ inputs?: {
3604
+ /**
3605
+ * The value inputs of the glTF node mapped to the FlowGraph block.
3606
+ */
3607
+ values?: {
3608
+ [originName: string]: IGLTFToFlowGraphMappingObject;
3609
+ };
3610
+ /**
3611
+ * The flow inputs of the glTF node mapped to the FlowGraph block.
3612
+ */
3613
+ flows?: {
3614
+ [originName: string]: IGLTFToFlowGraphMappingObject;
3615
+ };
3616
+ };
3617
+ /**
3618
+ * The outputs of the glTF node mapped to the FlowGraph block.
3619
+ */
3620
+ outputs?: {
3621
+ /**
3622
+ * The value outputs of the glTF node mapped to the FlowGraph block.
3623
+ */
3624
+ values?: {
3625
+ [originName: string]: IGLTFToFlowGraphMappingObject;
3626
+ };
3627
+ /**
3628
+ * The flow outputs of the glTF node mapped to the FlowGraph block.
3629
+ */
3630
+ flows?: {
3631
+ [originName: string]: IGLTFToFlowGraphMappingObject;
3632
+ };
3633
+ };
3634
+ /**
3635
+ * The configuration of the glTF node mapped to the FlowGraph block.
3636
+ * This information is usually passed to the constructor of the block.
3637
+ */
3638
+ configuration?: {
3639
+ [originName: string]: IGLTFToFlowGraphMappingObject;
3640
+ };
3641
+ /**
3642
+ * If we generate more than one block for a single glTF node, this mapping will be used to map
3643
+ * between the flowGraph classes.
3644
+ */
3645
+ typeToTypeMapping?: {
3646
+ [originName: string]: IGLTFToFlowGraphMappingObject;
3647
+ };
3648
+ /**
3649
+ * The connections between two or more blocks.
3650
+ * This is used to connect the blocks in the graph
3651
+ */
3652
+ interBlockConnectors?: {
3653
+ /**
3654
+ * The name of the input connection in the first block.
3655
+ */
3656
+ input: string;
3657
+ /**
3658
+ * The name of the output connection in the second block.
3659
+ */
3660
+ output: string;
3661
+ /**
3662
+ * The index of the block in the array of blocks that corresponds to the input.
3663
+ */
3664
+ inputBlockIndex: number;
3665
+ /**
3666
+ * The index of the block in the array of blocks that corresponds to the output.
3667
+ */
3668
+ outputBlockIndex: number;
3669
+ /**
3670
+ * If the connection is a variable connection or a flow connection.
3671
+ */
3672
+ isVariable?: boolean;
3673
+ }[];
3674
+ /**
3675
+ * This optional function will allow to validate the node, according to the glTF specs.
3676
+ * For example, if a node has a configuration object, it must be present and correct.
3677
+ * This is a basic node-based validation.
3678
+ * This function is expected to return false and log the error if the node is not valid.
3679
+ * Note that this function can also modify the node, if needed.
3680
+ *
3681
+ * @param gltfBlock the glTF node to validate
3682
+ * @param glTFObject the glTF object
3683
+ * @returns true if validated, false if not.
3684
+ */
3685
+ validation?: (gltfBlock: BABYLON.GLTF2.IKHRInteractivity_Node, interactivityGraph: BABYLON.GLTF2.IKHRInteractivity_Graph, glTFObject?: BABYLON.GLTF2.Loader.IGLTF) => boolean;
3686
+ /**
3687
+ * This is used if we need extra information for the constructor/options that is not provided directly by the glTF node.
3688
+ * This function can return more than one node, if extra nodes are needed for this block to function correctly.
3689
+ * Returning more than one block will usually happen when a json pointer was provided.
3690
+ *
3691
+ * @param gltfBlock the glTF node
3692
+ * @param mapping the mapping object
3693
+ * @param arrays the arrays of the interactivity object
3694
+ * @param serializedObjects the serialized object
3695
+ * @returns an array of serialized nodes that will be added to the graph.
3696
+ */
3697
+ extraProcessor?: (gltfBlock: BABYLON.GLTF2.IKHRInteractivity_Node, declaration: BABYLON.GLTF2.IKHRInteractivity_Declaration, mapping: IGLTFToFlowGraphMapping, parser: BABYLON.GLTF2.Loader.Extensions.InteractivityGraphToFlowGraphParser, serializedObjects: ISerializedFlowGraphBlock[], context: ISerializedFlowGraphContext, globalGLTF?: BABYLON.GLTF2.Loader.IGLTF) => ISerializedFlowGraphBlock[];
3698
+ }
3699
+ export function getMappingForFullOperationName(fullOperationName: string): IGLTFToFlowGraphMapping | undefined;
3700
+ export function getMappingForDeclaration(declaration: BABYLON.GLTF2.IKHRInteractivity_Declaration, returnNoOpIfNotAvailable?: boolean): IGLTFToFlowGraphMapping | undefined;
3701
+ /**
3702
+ * This function will add new mapping to glTF interactivity.
3703
+ * Other extensions can define new types of blocks, this is the way to let interactivity know how to parse them.
3704
+ * @param key the type of node, i.e. "variable/get"
3705
+ * @param extension the extension of the interactivity operation, i.e. "KHR_selectability"
3706
+ * @param mapping The mapping object. See documentation or examples below.
3707
+ */
3708
+ export function addNewInteractivityFlowGraphMapping(key: string, extension: string, mapping: IGLTFToFlowGraphMapping): void;
3709
+ export function getAllSupportedNativeNodeTypes(): string[];
3710
+ /**
3711
+ *
3712
+ * These are the nodes from the specs:
3713
+ ### Math Nodes
3714
+ 1. **Constants**
3715
+ - E (`math/e`) FlowGraphBlockNames.E
3716
+ - Pi (`math/pi`) FlowGraphBlockNames.PI
3717
+ - Infinity (`math/inf`) FlowGraphBlockNames.Inf
3718
+ - Not a Number (`math/nan`) FlowGraphBlockNames.NaN
3719
+ 2. **Arithmetic Nodes**
3720
+ - Absolute Value (`math/abs`) FlowGraphBlockNames.Abs
3721
+ - Sign (`math/sign`) FlowGraphBlockNames.Sign
3722
+ - Truncate (`math/trunc`) FlowGraphBlockNames.Trunc
3723
+ - Floor (`math/floor`) FlowGraphBlockNames.Floor
3724
+ - Ceil (`math/ceil`) FlowGraphBlockNames.Ceil
3725
+ - Round (`math/round`) FlowGraphBlockNames.Round
3726
+ - Fraction (`math/fract`) FlowGraphBlockNames.Fract
3727
+ - Negation (`math/neg`) FlowGraphBlockNames.Negation
3728
+ - Addition (`math/add`) FlowGraphBlockNames.Add
3729
+ - Subtraction (`math/sub`) FlowGraphBlockNames.Subtract
3730
+ - Multiplication (`math/mul`) FlowGraphBlockNames.Multiply
3731
+ - Division (`math/div`) FlowGraphBlockNames.Divide
3732
+ - Remainder (`math/rem`) FlowGraphBlockNames.Modulo
3733
+ - Minimum (`math/min`) FlowGraphBlockNames.Min
3734
+ - Maximum (`math/max`) FlowGraphBlockNames.Max
3735
+ - Clamp (`math/clamp`) FlowGraphBlockNames.Clamp
3736
+ - Saturate (`math/saturate`) FlowGraphBlockNames.Saturate
3737
+ - Interpolate (`math/mix`) FlowGraphBlockNames.MathInterpolation
3738
+ 3. **Comparison Nodes**
3739
+ - Equality (`math/eq`) FlowGraphBlockNames.Equality
3740
+ - Less Than (`math/lt`) FlowGraphBlockNames.LessThan
3741
+ - Less Than Or Equal To (`math/le`) FlowGraphBlockNames.LessThanOrEqual
3742
+ - Greater Than (`math/gt`) FlowGraphBlockNames.GreaterThan
3743
+ - Greater Than Or Equal To (`math/ge`) FlowGraphBlockNames.GreaterThanOrEqual
3744
+ 4. **Special Nodes**
3745
+ - Is Not a Number (`math/isnan`) FlowGraphBlockNames.IsNaN
3746
+ - Is Infinity (`math/isinf`) FlowGraphBlockNames.IsInfinity
3747
+ - Select (`math/select`) FlowGraphBlockNames.Conditional
3748
+ - Random (`math/random`) FlowGraphBlockNames.Random
3749
+ 5. **Angle and Trigonometry Nodes**
3750
+ - Degrees-To-Radians (`math/rad`) FlowGraphBlockNames.DegToRad
3751
+ - Radians-To-Degrees (`math/deg`) FlowGraphBlockNames.RadToDeg
3752
+ - Sine (`math/sin`) FlowGraphBlockNames.Sin
3753
+ - Cosine (`math/cos`) FlowGraphBlockNames.Cos
3754
+ - Tangent (`math/tan`) FlowGraphBlockNames.Tan
3755
+ - Arcsine (`math/asin`) FlowGraphBlockNames.Asin
3756
+ - Arccosine (`math/acos`) FlowGraphBlockNames.Acos
3757
+ - Arctangent (`math/atan`) FlowGraphBlockNames.Atan
3758
+ - Arctangent 2 (`math/atan2`) FlowGraphBlockNames.Atan2
3759
+ 6. **Hyperbolic Nodes**
3760
+ - Hyperbolic Sine (`math/sinh`) FlowGraphBlockNames.Sinh
3761
+ - Hyperbolic Cosine (`math/cosh`) FlowGraphBlockNames.Cosh
3762
+ - Hyperbolic Tangent (`math/tanh`) FlowGraphBlockNames.Tanh
3763
+ - Inverse Hyperbolic Sine (`math/asinh`) FlowGraphBlockNames.Asinh
3764
+ - Inverse Hyperbolic Cosine (`math/acosh`) FlowGraphBlockNames.Acosh
3765
+ - Inverse Hyperbolic Tangent (`math/atanh`) FlowGraphBlockNames.Atanh
3766
+ 7. **Exponential Nodes**
3767
+ - Exponent (`math/exp`) FlowGraphBlockNames.Exponential
3768
+ - Natural Logarithm (`math/log`) FlowGraphBlockNames.Log
3769
+ - Base-2 Logarithm (`math/log2`) FlowGraphBlockNames.Log2
3770
+ - Base-10 Logarithm (`math/log10`) FlowGraphBlockNames.Log10
3771
+ - Square Root (`math/sqrt`) FlowGraphBlockNames.SquareRoot
3772
+ - Cube Root (`math/cbrt`) FlowGraphBlockNames.CubeRoot
3773
+ - Power (`math/pow`) FlowGraphBlockNames.Power
3774
+ 8. **Vector Nodes**
3775
+ - Length (`math/length`) FlowGraphBlockNames.Length
3776
+ - Normalize (`math/normalize`) FlowGraphBlockNames.Normalize
3777
+ - Dot Product (`math/dot`) FlowGraphBlockNames.Dot
3778
+ - Cross Product (`math/cross`) FlowGraphBlockNames.Cross
3779
+ - Rotate 2D (`math/rotate2d`) FlowGraphBlockNames.Rotate2D
3780
+ - Rotate 3D (`math/rotate3d`) FlowGraphBlockNames.Rotate3D
3781
+ - Transform (`math/transform`) FlowGraphBlockNames.TransformVector
3782
+ 9. **Matrix Nodes**
3783
+ - Transpose (`math/transpose`) FlowGraphBlockNames.Transpose
3784
+ - Determinant (`math/determinant`) FlowGraphBlockNames.Determinant
3785
+ - Inverse (`math/inverse`) FlowGraphBlockNames.InvertMatrix
3786
+ - Multiplication (`math/matmul`) FlowGraphBlockNames.MatrixMultiplication
3787
+ 10. **Swizzle Nodes**
3788
+ - Combine (`math/combine2`, `math/combine3`, `math/combine4`, `math/combine2x2`, `math/combine3x3`, `math/combine4x4`)
3789
+ FlowGraphBlockNames.CombineVector2, FlowGraphBlockNames.CombineVector3, FlowGraphBlockNames.CombineVector4
3790
+ FlowGraphBlockNames.CombineMatrix2D, FlowGraphBlockNames.CombineMatrix3D, FlowGraphBlockNames.CombineMatrix
3791
+ - Extract (`math/extract2`, `math/extract3`, `math/extract4`, `math/extract2x2`, `math/extract3x3`, `math/extract4x4`)
3792
+ FlowGraphBlockNames.ExtractVector2, FlowGraphBlockNames.ExtractVector3, FlowGraphBlockNames.ExtractVector4
3793
+ FlowGraphBlockNames.ExtractMatrix2D, FlowGraphBlockNames.ExtractMatrix3D, FlowGraphBlockNames.ExtractMatrix
3794
+ 11. **Integer Arithmetic Nodes**
3795
+ - Absolute Value (`math/abs`) FlowGraphBlockNames.Abs
3796
+ - Sign (`math/sign`) FlowGraphBlockNames.Sign
3797
+ - Negation (`math/neg`) FlowGraphBlockNames.Negation
3798
+ - Addition (`math/add`) FlowGraphBlockNames.Add
3799
+ - Subtraction (`math/sub`) FlowGraphBlockNames.Subtract
3800
+ - Multiplication (`math/mul`) FlowGraphBlockNames.Multiply
3801
+ - Division (`math/div`) FlowGraphBlockNames.Divide
3802
+ - Remainder (`math/rem`) FlowGraphBlockNames.Modulo
3803
+ - Minimum (`math/min`) FlowGraphBlockNames.Min
3804
+ - Maximum (`math/max`) FlowGraphBlockNames.Max
3805
+ - Clamp (`math/clamp`) FlowGraphBlockNames.Clamp
3806
+ 12. **Integer Comparison Nodes**
3807
+ - Equality (`math/eq`) FlowGraphBlockNames.Equality
3808
+ - Less Than (`math/lt`) FlowGraphBlockNames.LessThan
3809
+ - Less Than Or Equal To (`math/le`) FlowGraphBlockNames.LessThanOrEqual
3810
+ - Greater Than (`math/gt`) FlowGraphBlockNames.GreaterThan
3811
+ - Greater Than Or Equal To (`math/ge`) FlowGraphBlockNames.GreaterThanOrEqual
3812
+ 13. **Integer Bitwise Nodes**
3813
+ - Bitwise NOT (`math/not`) FlowGraphBlockNames.BitwiseNot
3814
+ - Bitwise AND (`math/and`) FlowGraphBlockNames.BitwiseAnd
3815
+ - Bitwise OR (`math/or`) FlowGraphBlockNames.BitwiseOr
3816
+ - Bitwise XOR (`math/xor`) FlowGraphBlockNames.BitwiseXor
3817
+ - Right Shift (`math/asr`) FlowGraphBlockNames.BitwiseRightShift
3818
+ - Left Shift (`math/lsl`) FlowGraphBlockNames.BitwiseLeftShift
3819
+ - Count Leading Zeros (`math/clz`) FlowGraphBlockNames.LeadingZeros
3820
+ - Count Trailing Zeros (`math/ctz`) FlowGraphBlockNames.TrailingZeros
3821
+ - Count One Bits (`math/popcnt`) FlowGraphBlockNames.OneBitsCounter
3822
+ 14. **Boolean Arithmetic Nodes**
3823
+ - Equality (`math/eq`) FlowGraphBlockNames.Equality
3824
+ - Boolean NOT (`math/not`) FlowGraphBlockNames.BitwiseNot
3825
+ - Boolean AND (`math/and`) FlowGraphBlockNames.BitwiseAnd
3826
+ - Boolean OR (`math/or`) FlowGraphBlockNames.BitwiseOr
3827
+ - Boolean XOR (`math/xor`) FlowGraphBlockNames.BitwiseXor
3828
+ ### Type Conversion Nodes
3829
+ 1. **Boolean Conversion Nodes**
3830
+ - Boolean to Integer (`type/boolToInt`) FlowGraphBlockNames.BooleanToInt
3831
+ - Boolean to Float (`type/boolToFloat`) FlowGraphBlockNames.BooleanToFloat
3832
+ 2. **Integer Conversion Nodes**
3833
+ - Integer to Boolean (`type/intToBool`) FlowGraphBlockNames.IntToBoolean
3834
+ - Integer to Float (`type/intToFloat`) FlowGraphBlockNames.IntToFloat
3835
+ 3. **Float Conversion Nodes**
3836
+ - Float to Boolean (`type/floatToBool`) FlowGraphBlockNames.FloatToBoolean
3837
+ - Float to Integer (`type/floatToInt`) FlowGraphBlockNames.FloatToInt
3838
+ ### Control Flow Nodes
3839
+ 1. **Sync Nodes**
3840
+ - Sequence (`flow/sequence`) FlowGraphBlockNames.Sequence
3841
+ - Branch (`flow/branch`) FlowGraphBlockNames.Branch
3842
+ - Switch (`flow/switch`) FlowGraphBlockNames.Switch
3843
+ - While Loop (`flow/while`) FlowGraphBlockNames.WhileLoop
3844
+ - For Loop (`flow/for`) FlowGraphBlockNames.ForLoop
3845
+ - Do N (`flow/doN`) FlowGraphBlockNames.DoN
3846
+ - Multi Gate (`flow/multiGate`) FlowGraphBlockNames.MultiGate
3847
+ - Wait All (`flow/waitAll`) FlowGraphBlockNames.WaitAll
3848
+ - Throttle (`flow/throttle`) FlowGraphBlockNames.Throttle
3849
+ 2. **Delay Nodes**
3850
+ - Set Delay (`flow/setDelay`) FlowGraphBlockNames.SetDelay
3851
+ - Cancel Delay (`flow/cancelDelay`) FlowGraphBlockNames.CancelDelay
3852
+ ### State Manipulation Nodes
3853
+ 1. **Custom Variable Access**
3854
+ - Variable Get (`variable/get`) FlowGraphBlockNames.GetVariable
3855
+ - Variable Set (`variable/set`) FlowGraphBlockNames.SetVariable
3856
+ - Variable Interpolate (`variable/interpolate`)
3857
+ 2. **Object Model Access** // TODO fully test this!!!
3858
+ - JSON Pointer Template Parsing (`pointer/get`) [FlowGraphBlockNames.GetProperty, FlowGraphBlockNames.JsonPointerParser]
3859
+ - Effective JSON Pointer Generation (`pointer/set`) [FlowGraphBlockNames.SetProperty, FlowGraphBlockNames.JsonPointerParser]
3860
+ - Pointer Get (`pointer/get`) [FlowGraphBlockNames.GetProperty, FlowGraphBlockNames.JsonPointerParser]
3861
+ - Pointer Set (`pointer/set`) [FlowGraphBlockNames.SetProperty, FlowGraphBlockNames.JsonPointerParser]
3862
+ - Pointer Interpolate (`pointer/interpolate`) [FlowGraphBlockNames.ValueInterpolation, FlowGraphBlockNames.JsonPointerParser, FlowGraphBlockNames.PlayAnimation, FlowGraphBlockNames.Easing]
3863
+ ### Animation Control Nodes
3864
+ 1. **Animation Play** (`animation/start`) FlowGraphBlockNames.PlayAnimation
3865
+ 2. **Animation Stop** (`animation/stop`) FlowGraphBlockNames.StopAnimation
3866
+ 3. **Animation Stop At** (`animation/stopAt`) FlowGraphBlockNames.StopAnimation
3867
+ ### Event Nodes
3868
+ 1. **Lifecycle Event Nodes**
3869
+ - On Start (`event/onStart`) FlowGraphBlockNames.SceneReadyEvent
3870
+ - On Tick (`event/onTick`) FlowGraphBlockNames.SceneTickEvent
3871
+ 2. **Custom Event Nodes**
3872
+ - Receive (`event/receive`) FlowGraphBlockNames.ReceiveCustomEvent
3873
+ - Send (`event/send`) FlowGraphBlockNames.SendCustomEvent
3874
+ */
3875
+
3876
+
3877
+
3878
+ }
3879
+ declare module BABYLON {
3880
+
3881
+
3440
3882
  }
3441
3883
  declare module BABYLON.GLTF1 {
3442
3884