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.
@@ -596,6 +596,7 @@ export * from "babylonjs-loaders/glTF/2.0/glTFLoader";
596
596
  export * from "babylonjs-loaders/glTF/2.0/glTFLoaderExtension";
597
597
  export * from "babylonjs-loaders/glTF/2.0/glTFLoaderExtensionRegistry";
598
598
  export * from "babylonjs-loaders/glTF/2.0/glTFLoaderInterfaces";
599
+ export * from "babylonjs-loaders/glTF/2.0/glTFLoaderAnimation";
599
600
  export * from "babylonjs-loaders/glTF/2.0/Extensions/index";
600
601
 
601
602
  }
@@ -1078,24 +1079,26 @@ export abstract class AnimationPropertyInfo {
1078
1079
  constructor(type: number, name: string, getValue: GetValueFn, getStride: (target: any) => number);
1079
1080
  protected _buildAnimation(name: string, fps: number, keys: any[]): Animation;
1080
1081
  /** @internal */
1081
- abstract buildAnimations(target: any, name: string, fps: number, keys: any[], callback: (babylonAnimatable: IAnimatable, babylonAnimation: Animation) => void): void;
1082
+ abstract buildAnimations(target: any, name: string, fps: number, keys: any[]): {
1083
+ babylonAnimatable: IAnimatable;
1084
+ babylonAnimation: Animation;
1085
+ }[];
1082
1086
  }
1083
1087
  /** @internal */
1084
1088
  export class TransformNodeAnimationPropertyInfo extends AnimationPropertyInfo {
1085
1089
  /** @internal */
1086
- buildAnimations(target: INode, name: string, fps: number, keys: any[], callback: (babylonAnimatable: IAnimatable, babylonAnimation: Animation) => void): void;
1090
+ buildAnimations(target: INode, name: string, fps: number, keys: any[]): {
1091
+ babylonAnimatable: IAnimatable;
1092
+ babylonAnimation: Animation;
1093
+ }[];
1087
1094
  }
1088
1095
  /** @internal */
1089
1096
  export class WeightAnimationPropertyInfo extends AnimationPropertyInfo {
1090
- buildAnimations(target: INode, name: string, fps: number, keys: any[], callback: (babylonAnimatable: IAnimatable, babylonAnimation: Animation) => void): void;
1097
+ buildAnimations(target: INode, name: string, fps: number, keys: any[]): {
1098
+ babylonAnimatable: IAnimatable;
1099
+ babylonAnimation: Animation;
1100
+ }[];
1091
1101
  }
1092
- /** @internal */
1093
- export const nodeAnimationData: {
1094
- translation: TransformNodeAnimationPropertyInfo[];
1095
- rotation: TransformNodeAnimationPropertyInfo[];
1096
- scale: TransformNodeAnimationPropertyInfo[];
1097
- weights: WeightAnimationPropertyInfo[];
1098
- };
1099
1102
 
1100
1103
  }
1101
1104
  declare module "babylonjs-loaders/glTF/2.0/glTFLoader" {
@@ -1123,6 +1126,7 @@ import { AssetContainer } from "babylonjs/assetContainer";
1123
1126
  import { AnimationPropertyInfo } from "babylonjs-loaders/glTF/2.0/glTFLoaderAnimation";
1124
1127
  import { IObjectInfo } from "babylonjs/ObjectModel/objectModelInterfaces";
1125
1128
  import { GLTFExtensionFactory } from "babylonjs-loaders/glTF/2.0/glTFLoaderExtensionRegistry";
1129
+ import { IInterpolationPropertyInfo } from "babylonjs/FlowGraph/typeDefinitions";
1126
1130
  export { GLTFFileLoader };
1127
1131
  interface IWithMetadata {
1128
1132
  metadata: any;
@@ -1176,6 +1180,8 @@ export class GLTFLoader implements IGLTFLoader {
1176
1180
  _disableInstancedMesh: number;
1177
1181
  /** @internal */
1178
1182
  _allMaterialsDirtyRequired: boolean;
1183
+ /** @internal */
1184
+ _skipStartAnimationStep: boolean;
1179
1185
  private readonly _parent;
1180
1186
  private readonly _extensions;
1181
1187
  private _disposed;
@@ -1333,7 +1339,7 @@ export class GLTFLoader implements IGLTFLoader {
1333
1339
  * @param onLoad Called for each animation loaded
1334
1340
  * @returns A void promise that resolves when the load is complete
1335
1341
  */
1336
- _loadAnimationChannelFromTargetInfoAsync(context: string, animationContext: string, animation: IAnimation, channel: IAnimationChannel, targetInfo: IObjectInfo<AnimationPropertyInfo[]>, onLoad: (babylonAnimatable: IAnimatable, babylonAnimation: Animation) => void): Promise<void>;
1342
+ _loadAnimationChannelFromTargetInfoAsync(context: string, animationContext: string, animation: IAnimation, channel: IAnimationChannel, targetInfo: IObjectInfo<IInterpolationPropertyInfo[]>, onLoad: (babylonAnimatable: IAnimatable, babylonAnimation: Animation) => void): Promise<void>;
1337
1343
  private _loadAnimationSamplerAsync;
1338
1344
  /**
1339
1345
  * Loads a glTF buffer.
@@ -1527,38 +1533,300 @@ export class GLTFLoader implements IGLTFLoader {
1527
1533
  }
1528
1534
 
1529
1535
  }
1530
- declare module "babylonjs-loaders/glTF/2.0/Extensions/interactivityUtils" {
1531
- export const gltfToFlowGraphTypeMap: {
1532
- [key: string]: string;
1533
- };
1534
- export const gltfTypeToBabylonType: any;
1535
-
1536
- }
1537
- declare module "babylonjs-loaders/glTF/2.0/Extensions/interactivityPathToObjectConverter" {
1538
- import { IGLTF } from "babylonjs-loaders/glTF/2.0/glTFLoaderInterfaces";
1536
+ declare module "babylonjs-loaders/glTF/2.0/Extensions/objectModelMapping" {
1537
+ import { TransformNode } from "babylonjs/Meshes/transformNode";
1538
+ import { IAnimation, ICamera, IGLTF, IKHRLightsPunctual_Light, IMaterial, IMesh, INode } from "babylonjs-loaders/glTF/2.0/glTFLoaderInterfaces";
1539
+ import { Vector3 } from "babylonjs/Maths/math.vector";
1540
+ import { Matrix, Quaternion, Vector2 } from "babylonjs/Maths/math.vector";
1541
+ import { Color3 } from "babylonjs/Maths/math.color";
1542
+ import { Color4 } from "babylonjs/Maths/math.color";
1543
+ import { PBRMaterial } from "babylonjs/Materials/PBR/pbrMaterial";
1544
+ import { Light } from "babylonjs/Lights/light";
1545
+ import { Nullable } from "babylonjs/types";
1546
+ import { IEXTLightsImageBased_LightImageBased } from "babylonjs-gltf2interface";
1547
+ import { BaseTexture } from "babylonjs/Materials/Textures/baseTexture";
1548
+ import { IInterpolationPropertyInfo, IObjectAccessor } from "babylonjs/FlowGraph/typeDefinitions";
1539
1549
  import { GLTFPathToObjectConverter } from "babylonjs-loaders/glTF/2.0/Extensions/gltfPathToObjectConverter";
1540
- import { IObjectAccessor } from "babylonjs/FlowGraph/typeDefinitions";
1541
- /**
1542
- * Class to convert an interactivity pointer path to a smart object
1543
- */
1544
- export class InteractivityPathToObjectConverter extends GLTFPathToObjectConverter<IObjectAccessor> {
1545
- constructor(gltf: IGLTF);
1550
+ import { AnimationGroup } from "babylonjs/Animations/animationGroup";
1551
+ import { Mesh } from "babylonjs/Meshes/mesh";
1552
+ export interface IGLTFObjectModelTree {
1553
+ cameras: IGLTFObjectModelTreeCamerasObject;
1554
+ nodes: IGLTFObjectModelTreeNodesObject;
1555
+ materials: IGLTFObjectModelTreeMaterialsObject;
1556
+ extensions: IGLTFObjectModelTreeExtensionsObject;
1557
+ animations: {
1558
+ length: IObjectAccessor<IAnimation[], AnimationGroup[], number>;
1559
+ __array__: {};
1560
+ };
1561
+ meshes: {
1562
+ length: IObjectAccessor<IMesh[], (Mesh | undefined)[], number>;
1563
+ __array__: {};
1564
+ };
1546
1565
  }
1547
-
1566
+ export interface IGLTFObjectModelTreeNodesObject<GLTFTargetType = INode, BabylonTargetType = TransformNode> {
1567
+ length: IObjectAccessor<GLTFTargetType[], BabylonTargetType[], number>;
1568
+ __array__: {
1569
+ __target__: boolean;
1570
+ translation: IObjectAccessor<GLTFTargetType, BabylonTargetType, Vector3>;
1571
+ rotation: IObjectAccessor<GLTFTargetType, BabylonTargetType, Quaternion>;
1572
+ scale: IObjectAccessor<GLTFTargetType, BabylonTargetType, Vector3>;
1573
+ matrix: IObjectAccessor<GLTFTargetType, BabylonTargetType, Matrix>;
1574
+ globalMatrix: IObjectAccessor<GLTFTargetType, BabylonTargetType, Matrix>;
1575
+ weights: {
1576
+ length: IObjectAccessor<GLTFTargetType, BabylonTargetType, number>;
1577
+ __array__: {
1578
+ __target__: boolean;
1579
+ } & IObjectAccessor<GLTFTargetType, BabylonTargetType, number>;
1580
+ } & IObjectAccessor<GLTFTargetType, BabylonTargetType, number[]>;
1581
+ extensions: {
1582
+ EXT_lights_ies?: {
1583
+ multiplier: IObjectAccessor<INode, Light, number>;
1584
+ color: IObjectAccessor<INode, Light, Color3>;
1585
+ };
1586
+ };
1587
+ };
1588
+ }
1589
+ export interface IGLTFObjectModelTreeCamerasObject {
1590
+ __array__: {
1591
+ __target__: boolean;
1592
+ orthographic: {
1593
+ xmag: IObjectAccessor<ICamera, ICamera, Vector2>;
1594
+ ymag: IObjectAccessor<ICamera, ICamera, Vector2>;
1595
+ zfar: IObjectAccessor<ICamera, ICamera, number>;
1596
+ znear: IObjectAccessor<ICamera, ICamera, number>;
1597
+ };
1598
+ perspective: {
1599
+ yfov: IObjectAccessor<ICamera, ICamera, number>;
1600
+ zfar: IObjectAccessor<ICamera, ICamera, number>;
1601
+ znear: IObjectAccessor<ICamera, ICamera, number>;
1602
+ aspectRatio: IObjectAccessor<ICamera, ICamera, Nullable<number>>;
1603
+ };
1604
+ };
1605
+ }
1606
+ export interface IGLTFObjectModelTreeMaterialsObject {
1607
+ __array__: {
1608
+ __target__: boolean;
1609
+ pbrMetallicRoughness: {
1610
+ baseColorFactor: IObjectAccessor<IMaterial, PBRMaterial, Color4>;
1611
+ metallicFactor: IObjectAccessor<IMaterial, PBRMaterial, Nullable<number>>;
1612
+ roughnessFactor: IObjectAccessor<IMaterial, PBRMaterial, Nullable<number>>;
1613
+ baseColorTexture: {
1614
+ extensions: {
1615
+ KHR_texture_transform: ITextureDefinition;
1616
+ };
1617
+ };
1618
+ metallicRoughnessTexture: {
1619
+ extensions: {
1620
+ KHR_texture_transform: ITextureDefinition;
1621
+ };
1622
+ };
1623
+ };
1624
+ emissiveFactor: IObjectAccessor<IMaterial, PBRMaterial, Color3>;
1625
+ normalTexture: {
1626
+ scale: IObjectAccessor<IMaterial, PBRMaterial, number>;
1627
+ extensions: {
1628
+ KHR_texture_transform: ITextureDefinition;
1629
+ };
1630
+ };
1631
+ occlusionTexture: {
1632
+ strength: IObjectAccessor<IMaterial, PBRMaterial, number>;
1633
+ extensions: {
1634
+ KHR_texture_transform: ITextureDefinition;
1635
+ };
1636
+ };
1637
+ emissiveTexture: {
1638
+ extensions: {
1639
+ KHR_texture_transform: ITextureDefinition;
1640
+ };
1641
+ };
1642
+ extensions: {
1643
+ KHR_materials_anisotropy: {
1644
+ anisotropyStrength: IObjectAccessor<IMaterial, PBRMaterial, number>;
1645
+ anisotropyRotation: IObjectAccessor<IMaterial, PBRMaterial, number>;
1646
+ anisotropyTexture: {
1647
+ extensions: {
1648
+ KHR_texture_transform: ITextureDefinition;
1649
+ };
1650
+ };
1651
+ };
1652
+ KHR_materials_clearcoat: {
1653
+ clearcoatFactor: IObjectAccessor<IMaterial, PBRMaterial, number>;
1654
+ clearcoatRoughnessFactor: IObjectAccessor<IMaterial, PBRMaterial, number>;
1655
+ clearcoatTexture: {
1656
+ extensions: {
1657
+ KHR_texture_transform: ITextureDefinition;
1658
+ };
1659
+ };
1660
+ clearcoatNormalTexture: {
1661
+ scale: IObjectAccessor<IMaterial, PBRMaterial, number>;
1662
+ extensions: {
1663
+ KHR_texture_transform: ITextureDefinition;
1664
+ };
1665
+ };
1666
+ clearcoatRoughnessTexture: {
1667
+ extensions: {
1668
+ KHR_texture_transform: ITextureDefinition;
1669
+ };
1670
+ };
1671
+ };
1672
+ KHR_materials_dispersion: {
1673
+ dispersion: IObjectAccessor<IMaterial, PBRMaterial, number>;
1674
+ };
1675
+ KHR_materials_emissive_strength: {
1676
+ emissiveStrength: IObjectAccessor<IMaterial, PBRMaterial, number>;
1677
+ };
1678
+ KHR_materials_ior: {
1679
+ ior: IObjectAccessor<IMaterial, PBRMaterial, number>;
1680
+ };
1681
+ KHR_materials_iridescence: {
1682
+ iridescenceFactor: IObjectAccessor<IMaterial, PBRMaterial, number>;
1683
+ iridescenceIor: IObjectAccessor<IMaterial, PBRMaterial, number>;
1684
+ iridescenceThicknessMinimum: IObjectAccessor<IMaterial, PBRMaterial, number>;
1685
+ iridescenceThicknessMaximum: IObjectAccessor<IMaterial, PBRMaterial, number>;
1686
+ iridescenceTexture: {
1687
+ extensions: {
1688
+ KHR_texture_transform: ITextureDefinition;
1689
+ };
1690
+ };
1691
+ iridescenceThicknessTexture: {
1692
+ extensions: {
1693
+ KHR_texture_transform: ITextureDefinition;
1694
+ };
1695
+ };
1696
+ };
1697
+ KHR_materials_sheen: {
1698
+ sheenColorFactor: IObjectAccessor<IMaterial, PBRMaterial, Color3>;
1699
+ sheenRoughnessFactor: IObjectAccessor<IMaterial, PBRMaterial, number>;
1700
+ sheenColorTexture: {
1701
+ extensions: {
1702
+ KHR_texture_transform: ITextureDefinition;
1703
+ };
1704
+ };
1705
+ sheenRoughnessTexture: {
1706
+ extensions: {
1707
+ KHR_texture_transform: ITextureDefinition;
1708
+ };
1709
+ };
1710
+ };
1711
+ KHR_materials_specular: {
1712
+ specularFactor: IObjectAccessor<IMaterial, PBRMaterial, number>;
1713
+ specularColorFactor: IObjectAccessor<IMaterial, PBRMaterial, Color3>;
1714
+ specularTexture: {
1715
+ extensions: {
1716
+ KHR_texture_transform: ITextureDefinition;
1717
+ };
1718
+ };
1719
+ specularColorTexture: {
1720
+ extensions: {
1721
+ KHR_texture_transform: ITextureDefinition;
1722
+ };
1723
+ };
1724
+ };
1725
+ KHR_materials_transmission: {
1726
+ transmissionFactor: IObjectAccessor<IMaterial, PBRMaterial, number>;
1727
+ transmissionTexture: {
1728
+ extensions: {
1729
+ KHR_texture_transform: ITextureDefinition;
1730
+ };
1731
+ };
1732
+ };
1733
+ KHR_materials_diffuse_transmission: {
1734
+ diffuseTransmissionFactor: IObjectAccessor<IMaterial, PBRMaterial, number>;
1735
+ diffuseTransmissionTexture: {
1736
+ extensions: {
1737
+ KHR_texture_transform: ITextureDefinition;
1738
+ };
1739
+ };
1740
+ diffuseTransmissionColorFactor: IObjectAccessor<IMaterial, PBRMaterial, Nullable<Color3>>;
1741
+ diffuseTransmissionColorTexture: {
1742
+ extensions: {
1743
+ KHR_texture_transform: ITextureDefinition;
1744
+ };
1745
+ };
1746
+ };
1747
+ KHR_materials_volume: {
1748
+ thicknessFactor: IObjectAccessor<IMaterial, PBRMaterial, number>;
1749
+ attenuationColor: IObjectAccessor<IMaterial, PBRMaterial, Color3>;
1750
+ attenuationDistance: IObjectAccessor<IMaterial, PBRMaterial, number>;
1751
+ thicknessTexture: {
1752
+ extensions: {
1753
+ KHR_texture_transform: ITextureDefinition;
1754
+ };
1755
+ };
1756
+ };
1757
+ };
1758
+ };
1759
+ }
1760
+ interface ITextureDefinition {
1761
+ offset: IObjectAccessor<IMaterial, PBRMaterial, Vector2>;
1762
+ rotation: IObjectAccessor<IMaterial, PBRMaterial, number>;
1763
+ scale: IObjectAccessor<IMaterial, PBRMaterial, Vector2>;
1764
+ }
1765
+ export interface IGLTFObjectModelTreeMeshesObject {
1766
+ }
1767
+ export interface IGLTFObjectModelTreeExtensionsObject {
1768
+ KHR_lights_punctual: {
1769
+ lights: {
1770
+ length: IObjectAccessor<IKHRLightsPunctual_Light[], Light[], number>;
1771
+ __array__: {
1772
+ __target__: boolean;
1773
+ color: IObjectAccessor<IKHRLightsPunctual_Light, Light, Color3>;
1774
+ intensity: IObjectAccessor<IKHRLightsPunctual_Light, Light, number>;
1775
+ range: IObjectAccessor<IKHRLightsPunctual_Light, Light, number>;
1776
+ spot: {
1777
+ innerConeAngle: IObjectAccessor<IKHRLightsPunctual_Light, Light, number>;
1778
+ outerConeAngle: IObjectAccessor<IKHRLightsPunctual_Light, Light, number>;
1779
+ };
1780
+ };
1781
+ };
1782
+ };
1783
+ EXT_lights_ies: {
1784
+ lights: {
1785
+ length: IObjectAccessor<IKHRLightsPunctual_Light[], Light[], number>;
1786
+ };
1787
+ };
1788
+ EXT_lights_image_based: {
1789
+ lights: {
1790
+ __array__: {
1791
+ __target__: boolean;
1792
+ intensity: IObjectAccessor<IEXTLightsImageBased_LightImageBased, BaseTexture, number>;
1793
+ rotation: IObjectAccessor<IEXTLightsImageBased_LightImageBased, BaseTexture, Quaternion>;
1794
+ };
1795
+ length: IObjectAccessor<IEXTLightsImageBased_LightImageBased[], BaseTexture[], number>;
1796
+ };
1797
+ };
1548
1798
  }
1549
- declare module "babylonjs-loaders/glTF/2.0/Extensions/interactivityFunctions" {
1550
- import { IKHRInteractivity } from "babylonjs-gltf2interface";
1551
- import { ISerializedFlowGraph } from "babylonjs/FlowGraph/typeDefinitions";
1552
1799
  /**
1553
- * @internal
1554
- * Converts a glTF Interactivity Extension to a serialized flow graph.
1555
- * @param gltf the interactivity data
1556
- * @returns a serialized flow graph
1800
+ * get a path-to-object converter for the given glTF tree
1801
+ * @param gltf the glTF tree to use
1802
+ * @returns a path-to-object converter for the given glTF tree
1803
+ */
1804
+ export function GetPathToObjectConverter(gltf: IGLTF): GLTFPathToObjectConverter<unknown, unknown, unknown>;
1805
+ /**
1806
+ * This function will return the object accessor for the given key in the object model
1807
+ * If the key is not found, it will return undefined
1808
+ * @param key the key to get the mapping for, for example /materials/\{\}/emissiveFactor
1809
+ * @returns an object accessor for the given key, or undefined if the key is not found
1810
+ */
1811
+ export function GetMappingForKey(key: string): IObjectAccessor | undefined;
1812
+ /**
1813
+ * Set interpolation for a specific key in the object model
1814
+ * @param key the key to set, for example /materials/\{\}/emissiveFactor
1815
+ * @param interpolation the interpolation elements array
1557
1816
  */
1558
- export function convertGLTFToSerializedFlowGraph(gltf: IKHRInteractivity): ISerializedFlowGraph;
1817
+ export function SetInterpolationForKey(key: string, interpolation?: IInterpolationPropertyInfo[]): void;
1818
+ /**
1819
+ * This will ad a new object accessor in the object model at the given key.
1820
+ * 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)
1821
+ * @param key the key to add the object accessor at. For example /cameras/\{\}/perspective/aspectRatio
1822
+ * @param accessor the object accessor to add
1823
+ */
1824
+ export function AddObjectAccessorToKey<GLTFTargetType = any, BabylonTargetType = any, BabylonValueType = any>(key: string, accessor: IObjectAccessor<GLTFTargetType, BabylonTargetType, BabylonValueType>): void;
1825
+ export {};
1559
1826
 
1560
1827
  }
1561
1828
  declare module "babylonjs-loaders/glTF/2.0/Extensions/index" {
1829
+ export * from "babylonjs-loaders/glTF/2.0/Extensions/objectModelMapping";
1562
1830
  export * from "babylonjs-loaders/glTF/2.0/Extensions/EXT_lights_image_based";
1563
1831
  export * from "babylonjs-loaders/glTF/2.0/Extensions/EXT_mesh_gpu_instancing";
1564
1832
  export * from "babylonjs-loaders/glTF/2.0/Extensions/EXT_meshopt_compression";
@@ -1592,24 +1860,29 @@ export * from "babylonjs-loaders/glTF/2.0/Extensions/MSFT_minecraftMesh";
1592
1860
  export * from "babylonjs-loaders/glTF/2.0/Extensions/MSFT_sRGBFactors";
1593
1861
  export * from "babylonjs-loaders/glTF/2.0/Extensions/KHR_interactivity";
1594
1862
  export * from "babylonjs-loaders/glTF/2.0/Extensions/KHR_node_visibility";
1863
+ export * from "babylonjs-loaders/glTF/2.0/Extensions/KHR_node_selectability";
1864
+ export * from "babylonjs-loaders/glTF/2.0/Extensions/KHR_node_hoverability";
1595
1865
  export * from "babylonjs-loaders/glTF/2.0/Extensions/ExtrasAsMetadata";
1866
+ export * from "babylonjs-loaders/glTF/2.0/Extensions/KHR_interactivity/index";
1596
1867
 
1597
1868
  }
1598
1869
  declare module "babylonjs-loaders/glTF/2.0/Extensions/gltfPathToObjectConverter" {
1599
1870
  import { IObjectInfo, IPathToObjectConverter } from "babylonjs/ObjectModel/objectModelInterfaces";
1600
1871
  import { IGLTF } from "babylonjs-loaders/glTF/2.0/glTFLoaderInterfaces";
1872
+ import { IObjectAccessor } from "babylonjs/FlowGraph/typeDefinitions";
1601
1873
  /**
1602
1874
  * A converter that takes a glTF Object Model JSON Pointer
1603
1875
  * and transforms it into an ObjectAccessorContainer, allowing
1604
1876
  * objects referenced in the glTF to be associated with their
1605
1877
  * respective Babylon.js objects.
1606
1878
  */
1607
- export class GLTFPathToObjectConverter<T> implements IPathToObjectConverter<T> {
1879
+ export class GLTFPathToObjectConverter<T, BabylonType, BabylonValue> implements IPathToObjectConverter<IObjectAccessor<T, BabylonType, BabylonValue>> {
1608
1880
  private _gltf;
1609
1881
  private _infoTree;
1610
1882
  constructor(_gltf: IGLTF, _infoTree: any);
1611
1883
  /**
1612
1884
  * The pointer string is represented by a [JSON pointer](https://datatracker.ietf.org/doc/html/rfc6901).
1885
+ * See also https://github.com/KhronosGroup/glTF/blob/main/specification/2.0/ObjectModel.adoc#core-pointers
1613
1886
  * <animationPointer> := /<rootNode>/<assetIndex>/<propertyPath>
1614
1887
  * <rootNode> := "nodes" | "materials" | "meshes" | "cameras" | "extensions"
1615
1888
  * <assetIndex> := <digit> | <name>
@@ -1621,6 +1894,7 @@ export class GLTFPathToObjectConverter<T> implements IPathToObjectConverter<T> {
1621
1894
  *
1622
1895
  * Examples:
1623
1896
  * - "/nodes/0/rotation"
1897
+ * - "/nodes.length"
1624
1898
  * - "/materials/2/emissiveFactor"
1625
1899
  * - "/materials/2/pbrMetallicRoughness/baseColorFactor"
1626
1900
  * - "/materials/2/extensions/KHR_materials_emissive_strength/emissiveStrength"
@@ -1628,7 +1902,7 @@ export class GLTFPathToObjectConverter<T> implements IPathToObjectConverter<T> {
1628
1902
  * @param path The path to convert
1629
1903
  * @returns The object and info associated with the path
1630
1904
  */
1631
- convert(path: string): IObjectInfo<T>;
1905
+ convert(path: string): IObjectInfo<IObjectAccessor<T, BabylonType, BabylonValue>>;
1632
1906
  }
1633
1907
 
1634
1908
  }
@@ -2015,6 +2289,39 @@ export class KHR_node_visibility implements IGLTFLoaderExtension {
2015
2289
  dispose(): void;
2016
2290
  }
2017
2291
 
2292
+ }
2293
+ declare module "babylonjs-loaders/glTF/2.0/Extensions/KHR_node_selectability" {
2294
+ import { GLTFLoader } from "babylonjs-loaders/glTF/2.0/glTFLoader";
2295
+ import { IGLTFLoaderExtension } from "babylonjs-loaders/glTF/2.0/glTFLoaderExtension";
2296
+ module "babylonjs-loaders/glTF/glTFFileLoader" {
2297
+ interface GLTFLoaderExtensionOptions {
2298
+ /**
2299
+ * Defines options for the KHR_selectability extension.
2300
+ */
2301
+ ["KHR_node_selectability"]: {};
2302
+ }
2303
+ }
2304
+ /**
2305
+ * Loader extension for KHR_selectability
2306
+ */
2307
+ export class KHR_node_selectability implements IGLTFLoaderExtension {
2308
+ /**
2309
+ * The name of this extension.
2310
+ */
2311
+ readonly name: string;
2312
+ /**
2313
+ * Defines whether this extension is enabled.
2314
+ */
2315
+ enabled: boolean;
2316
+ private _loader;
2317
+ /**
2318
+ * @internal
2319
+ */
2320
+ constructor(loader: GLTFLoader);
2321
+ onReady(): Promise<void>;
2322
+ dispose(): void;
2323
+ }
2324
+
2018
2325
  }
2019
2326
  declare module "babylonjs-loaders/glTF/2.0/Extensions/KHR_node_hoverability" {
2020
2327
  import { GLTFLoader } from "babylonjs-loaders/glTF/2.0/glTFLoader";
@@ -2834,6 +3141,7 @@ export class KHR_lights implements IGLTFLoaderExtension {
2834
3141
  declare module "babylonjs-loaders/glTF/2.0/Extensions/KHR_interactivity" {
2835
3142
  import { GLTFLoader } from "babylonjs-loaders/glTF/2.0/glTFLoader";
2836
3143
  import { IGLTFLoaderExtension } from "babylonjs-loaders/glTF/2.0/glTFLoaderExtension";
3144
+ import { Scene } from "babylonjs/scene";
2837
3145
  module "babylonjs-loaders/glTF/glTFFileLoader" {
2838
3146
  interface GLTFLoaderExtensionOptions {
2839
3147
  /**
@@ -2862,8 +3170,13 @@ export class KHR_interactivity implements IGLTFLoaderExtension {
2862
3170
  */
2863
3171
  constructor(_loader: GLTFLoader);
2864
3172
  dispose(): void;
2865
- onReady(): void;
3173
+ onReady(): Promise<void>;
2866
3174
  }
3175
+ /**
3176
+ * @internal
3177
+ * populates the object model with the interactivity extension
3178
+ */
3179
+ export function _AddInteractivityObjectModel(scene: Scene): void;
2867
3180
 
2868
3181
  }
2869
3182
  declare module "babylonjs-loaders/glTF/2.0/Extensions/KHR_draco_mesh_compression" {
@@ -2917,356 +3230,58 @@ export class KHR_draco_mesh_compression implements IGLTFLoaderExtension {
2917
3230
 
2918
3231
  }
2919
3232
  declare module "babylonjs-loaders/glTF/2.0/Extensions/KHR_animation_pointer.data" {
3233
+ export {};
3234
+
3235
+ }
3236
+ declare module "babylonjs-loaders/glTF/2.0/Extensions/KHR_animation_pointer" {
3237
+ import { IGLTFLoaderExtension } from "babylonjs-loaders/glTF/2.0/glTFLoaderExtension";
3238
+ import { GLTFLoader } from "babylonjs-loaders/glTF/2.0/glTFLoader";
3239
+ import { Nullable } from "babylonjs/types";
2920
3240
  import { Animation } from "babylonjs/Animations/animation";
2921
- import { ICamera, IKHRLightsPunctual_Light, IMaterial } from "babylonjs-loaders/glTF/2.0/glTFLoaderInterfaces";
2922
3241
  import { IAnimatable } from "babylonjs/Animations/animatable.interface";
2923
- import { AnimationPropertyInfo } from "babylonjs-loaders/glTF/2.0/glTFLoaderAnimation";
2924
- class CameraAnimationPropertyInfo extends AnimationPropertyInfo {
2925
- /** @internal */
2926
- buildAnimations(target: ICamera, name: string, fps: number, keys: any[], callback: (babylonAnimatable: IAnimatable, babylonAnimation: Animation) => void): void;
3242
+ import { IAnimation, IAnimationChannel } from "babylonjs-loaders/glTF/2.0/glTFLoaderInterfaces";
3243
+ import "babylonjs-loaders/glTF/2.0/Extensions/KHR_animation_pointer.data";
3244
+ module "babylonjs-loaders/glTF/glTFFileLoader" {
3245
+ interface GLTFLoaderExtensionOptions {
3246
+ /**
3247
+ * Defines options for the KHR_animation_pointer extension.
3248
+ */
3249
+ ["KHR_animation_pointer"]: {};
3250
+ }
2927
3251
  }
2928
- class MaterialAnimationPropertyInfo extends AnimationPropertyInfo {
3252
+ /**
3253
+ * [Specification PR](https://github.com/KhronosGroup/glTF/pull/2147)
3254
+ * !!! Experimental Extension Subject to Changes !!!
3255
+ */
3256
+ export class KHR_animation_pointer implements IGLTFLoaderExtension {
3257
+ /**
3258
+ * The name of this extension.
3259
+ */
3260
+ readonly name: string;
3261
+ private _loader;
3262
+ private _pathToObjectConverter?;
3263
+ /**
3264
+ * @internal
3265
+ */
3266
+ constructor(loader: GLTFLoader);
3267
+ /**
3268
+ * Defines whether this extension is enabled.
3269
+ */
3270
+ get enabled(): boolean;
2929
3271
  /** @internal */
2930
- buildAnimations(target: IMaterial, name: string, fps: number, keys: any[], callback: (babylonAnimatable: IAnimatable, babylonAnimation: Animation) => void): void;
3272
+ dispose(): void;
3273
+ /**
3274
+ * Loads a glTF animation channel.
3275
+ * @param context The context when loading the asset
3276
+ * @param animationContext The context of the animation when loading the asset
3277
+ * @param animation The glTF animation property
3278
+ * @param channel The glTF animation channel property
3279
+ * @param onLoad Called for each animation loaded
3280
+ * @returns A void promise that resolves when the load is complete or null if not handled
3281
+ */
3282
+ _loadAnimationChannelAsync(context: string, animationContext: string, animation: IAnimation, channel: IAnimationChannel, onLoad: (babylonAnimatable: IAnimatable, babylonAnimation: Animation) => void): Nullable<Promise<void>>;
2931
3283
  }
2932
- class LightAnimationPropertyInfo extends AnimationPropertyInfo {
2933
- /** @internal */
2934
- buildAnimations(target: IKHRLightsPunctual_Light, name: string, fps: number, keys: any[], callback: (babylonAnimatable: IAnimatable, babylonAnimation: Animation) => void): void;
2935
- }
2936
- /** @internal */
2937
- export const animationPointerTree: {
2938
- nodes: {
2939
- __array__: {
2940
- translation: import("babylonjs-loaders/glTF/2.0/glTFLoaderAnimation").TransformNodeAnimationPropertyInfo[];
2941
- rotation: import("babylonjs-loaders/glTF/2.0/glTFLoaderAnimation").TransformNodeAnimationPropertyInfo[];
2942
- scale: import("babylonjs-loaders/glTF/2.0/glTFLoaderAnimation").TransformNodeAnimationPropertyInfo[];
2943
- weights: import("babylonjs-loaders/glTF/2.0/glTFLoaderAnimation").WeightAnimationPropertyInfo[];
2944
- __target__: boolean;
2945
- };
2946
- };
2947
- materials: {
2948
- __array__: {
2949
- __target__: boolean;
2950
- pbrMetallicRoughness: {
2951
- baseColorFactor: MaterialAnimationPropertyInfo[];
2952
- metallicFactor: MaterialAnimationPropertyInfo[];
2953
- roughnessFactor: MaterialAnimationPropertyInfo[];
2954
- baseColorTexture: {
2955
- extensions: {
2956
- KHR_texture_transform: {
2957
- scale: MaterialAnimationPropertyInfo[];
2958
- offset: MaterialAnimationPropertyInfo[];
2959
- rotation: MaterialAnimationPropertyInfo[];
2960
- };
2961
- };
2962
- };
2963
- metallicRoughnessTexture: {
2964
- extensions: {
2965
- KHR_texture_transform: {
2966
- scale: MaterialAnimationPropertyInfo[];
2967
- offset: MaterialAnimationPropertyInfo[];
2968
- rotation: MaterialAnimationPropertyInfo[];
2969
- };
2970
- };
2971
- };
2972
- };
2973
- emissiveFactor: MaterialAnimationPropertyInfo[];
2974
- normalTexture: {
2975
- scale: MaterialAnimationPropertyInfo[];
2976
- extensions: {
2977
- KHR_texture_transform: {
2978
- scale: MaterialAnimationPropertyInfo[];
2979
- offset: MaterialAnimationPropertyInfo[];
2980
- rotation: MaterialAnimationPropertyInfo[];
2981
- };
2982
- };
2983
- };
2984
- occlusionTexture: {
2985
- strength: MaterialAnimationPropertyInfo[];
2986
- extensions: {
2987
- KHR_texture_transform: {
2988
- scale: MaterialAnimationPropertyInfo[];
2989
- offset: MaterialAnimationPropertyInfo[];
2990
- rotation: MaterialAnimationPropertyInfo[];
2991
- };
2992
- };
2993
- };
2994
- emissiveTexture: {
2995
- extensions: {
2996
- KHR_texture_transform: {
2997
- scale: MaterialAnimationPropertyInfo[];
2998
- offset: MaterialAnimationPropertyInfo[];
2999
- rotation: MaterialAnimationPropertyInfo[];
3000
- };
3001
- };
3002
- };
3003
- extensions: {
3004
- KHR_materials_anisotropy: {
3005
- anisotropyStrength: MaterialAnimationPropertyInfo[];
3006
- anisotropyRotation: MaterialAnimationPropertyInfo[];
3007
- anisotropyTexture: {
3008
- extensions: {
3009
- KHR_texture_transform: {
3010
- scale: MaterialAnimationPropertyInfo[];
3011
- offset: MaterialAnimationPropertyInfo[];
3012
- rotation: MaterialAnimationPropertyInfo[];
3013
- };
3014
- };
3015
- };
3016
- };
3017
- KHR_materials_clearcoat: {
3018
- clearcoatFactor: MaterialAnimationPropertyInfo[];
3019
- clearcoatRoughnessFactor: MaterialAnimationPropertyInfo[];
3020
- clearcoatTexture: {
3021
- extensions: {
3022
- KHR_texture_transform: {
3023
- scale: MaterialAnimationPropertyInfo[];
3024
- offset: MaterialAnimationPropertyInfo[];
3025
- rotation: MaterialAnimationPropertyInfo[];
3026
- };
3027
- };
3028
- };
3029
- clearcoatNormalTexture: {
3030
- scale: MaterialAnimationPropertyInfo[];
3031
- extensions: {
3032
- KHR_texture_transform: {
3033
- scale: MaterialAnimationPropertyInfo[];
3034
- offset: MaterialAnimationPropertyInfo[];
3035
- rotation: MaterialAnimationPropertyInfo[];
3036
- };
3037
- };
3038
- };
3039
- clearcoatRoughnessTexture: {
3040
- extensions: {
3041
- KHR_texture_transform: {
3042
- scale: MaterialAnimationPropertyInfo[];
3043
- offset: MaterialAnimationPropertyInfo[];
3044
- rotation: MaterialAnimationPropertyInfo[];
3045
- };
3046
- };
3047
- };
3048
- };
3049
- KHR_materials_dispersion: {
3050
- dispersion: MaterialAnimationPropertyInfo[];
3051
- };
3052
- KHR_materials_emissive_strength: {
3053
- emissiveStrength: MaterialAnimationPropertyInfo[];
3054
- };
3055
- KHR_materials_ior: {
3056
- ior: MaterialAnimationPropertyInfo[];
3057
- };
3058
- KHR_materials_iridescence: {
3059
- iridescenceFactor: MaterialAnimationPropertyInfo[];
3060
- iridescenceIor: MaterialAnimationPropertyInfo[];
3061
- iridescenceThicknessMinimum: MaterialAnimationPropertyInfo[];
3062
- iridescenceThicknessMaximum: MaterialAnimationPropertyInfo[];
3063
- iridescenceTexture: {
3064
- extensions: {
3065
- KHR_texture_transform: {
3066
- scale: MaterialAnimationPropertyInfo[];
3067
- offset: MaterialAnimationPropertyInfo[];
3068
- rotation: MaterialAnimationPropertyInfo[];
3069
- };
3070
- };
3071
- };
3072
- iridescenceThicknessTexture: {
3073
- extensions: {
3074
- KHR_texture_transform: {
3075
- scale: MaterialAnimationPropertyInfo[];
3076
- offset: MaterialAnimationPropertyInfo[];
3077
- rotation: MaterialAnimationPropertyInfo[];
3078
- };
3079
- };
3080
- };
3081
- };
3082
- KHR_materials_sheen: {
3083
- sheenColorFactor: MaterialAnimationPropertyInfo[];
3084
- sheenRoughnessFactor: MaterialAnimationPropertyInfo[];
3085
- sheenColorTexture: {
3086
- extensions: {
3087
- KHR_texture_transform: {
3088
- scale: MaterialAnimationPropertyInfo[];
3089
- offset: MaterialAnimationPropertyInfo[];
3090
- rotation: MaterialAnimationPropertyInfo[];
3091
- };
3092
- };
3093
- };
3094
- sheenRoughnessTexture: {
3095
- extensions: {
3096
- KHR_texture_transform: {
3097
- scale: MaterialAnimationPropertyInfo[];
3098
- offset: MaterialAnimationPropertyInfo[];
3099
- rotation: MaterialAnimationPropertyInfo[];
3100
- };
3101
- };
3102
- };
3103
- };
3104
- KHR_materials_specular: {
3105
- specularFactor: MaterialAnimationPropertyInfo[];
3106
- specularColorFactor: MaterialAnimationPropertyInfo[];
3107
- specularTexture: {
3108
- extensions: {
3109
- KHR_texture_transform: {
3110
- scale: MaterialAnimationPropertyInfo[];
3111
- offset: MaterialAnimationPropertyInfo[];
3112
- rotation: MaterialAnimationPropertyInfo[];
3113
- };
3114
- };
3115
- };
3116
- specularColorTexture: {
3117
- extensions: {
3118
- KHR_texture_transform: {
3119
- scale: MaterialAnimationPropertyInfo[];
3120
- offset: MaterialAnimationPropertyInfo[];
3121
- rotation: MaterialAnimationPropertyInfo[];
3122
- };
3123
- };
3124
- };
3125
- };
3126
- KHR_materials_transmission: {
3127
- transmissionFactor: MaterialAnimationPropertyInfo[];
3128
- transmissionTexture: {
3129
- extensions: {
3130
- KHR_texture_transform: {
3131
- scale: MaterialAnimationPropertyInfo[];
3132
- offset: MaterialAnimationPropertyInfo[];
3133
- rotation: MaterialAnimationPropertyInfo[];
3134
- };
3135
- };
3136
- };
3137
- };
3138
- KHR_materials_volume: {
3139
- attenuationColor: MaterialAnimationPropertyInfo[];
3140
- attenuationDistance: MaterialAnimationPropertyInfo[];
3141
- thicknessFactor: MaterialAnimationPropertyInfo[];
3142
- thicknessTexture: {
3143
- extensions: {
3144
- KHR_texture_transform: {
3145
- scale: MaterialAnimationPropertyInfo[];
3146
- offset: MaterialAnimationPropertyInfo[];
3147
- rotation: MaterialAnimationPropertyInfo[];
3148
- };
3149
- };
3150
- };
3151
- };
3152
- KHR_materials_diffuse_transmission: {
3153
- diffuseTransmissionFactor: MaterialAnimationPropertyInfo[];
3154
- diffuseTransmissionTexture: {
3155
- extensions: {
3156
- KHR_texture_transform: {
3157
- scale: MaterialAnimationPropertyInfo[];
3158
- offset: MaterialAnimationPropertyInfo[];
3159
- rotation: MaterialAnimationPropertyInfo[];
3160
- };
3161
- };
3162
- };
3163
- diffuseTransmissionColorFactor: MaterialAnimationPropertyInfo[];
3164
- diffuseTransmissionColorTexture: {
3165
- extensions: {
3166
- KHR_texture_transform: {
3167
- scale: MaterialAnimationPropertyInfo[];
3168
- offset: MaterialAnimationPropertyInfo[];
3169
- rotation: MaterialAnimationPropertyInfo[];
3170
- };
3171
- };
3172
- };
3173
- };
3174
- };
3175
- };
3176
- };
3177
- cameras: {
3178
- __array__: {
3179
- __target__: boolean;
3180
- orthographic: {
3181
- xmag: CameraAnimationPropertyInfo[];
3182
- ymag: CameraAnimationPropertyInfo[];
3183
- zfar: CameraAnimationPropertyInfo[];
3184
- znear: CameraAnimationPropertyInfo[];
3185
- };
3186
- perspective: {
3187
- yfov: CameraAnimationPropertyInfo[];
3188
- zfar: CameraAnimationPropertyInfo[];
3189
- znear: CameraAnimationPropertyInfo[];
3190
- };
3191
- };
3192
- };
3193
- extensions: {
3194
- KHR_lights_punctual: {
3195
- lights: {
3196
- __array__: {
3197
- __target__: boolean;
3198
- color: LightAnimationPropertyInfo[];
3199
- intensity: LightAnimationPropertyInfo[];
3200
- range: LightAnimationPropertyInfo[];
3201
- spot: {
3202
- innerConeAngle: LightAnimationPropertyInfo[];
3203
- outerConeAngle: LightAnimationPropertyInfo[];
3204
- };
3205
- };
3206
- };
3207
- };
3208
- EXT_lights_ies: {
3209
- lights: {
3210
- __array__: {
3211
- __target__: boolean;
3212
- color: LightAnimationPropertyInfo[];
3213
- multiplier: LightAnimationPropertyInfo[];
3214
- };
3215
- };
3216
- };
3217
- };
3218
- };
3219
- export {};
3220
-
3221
- }
3222
- declare module "babylonjs-loaders/glTF/2.0/Extensions/KHR_animation_pointer" {
3223
- import { IGLTFLoaderExtension } from "babylonjs-loaders/glTF/2.0/glTFLoaderExtension";
3224
- import { GLTFLoader } from "babylonjs-loaders/glTF/2.0/glTFLoader";
3225
- import { Nullable } from "babylonjs/types";
3226
- import { Animation } from "babylonjs/Animations/animation";
3227
- import { IAnimatable } from "babylonjs/Animations/animatable.interface";
3228
- import { IAnimation, IAnimationChannel } from "babylonjs-loaders/glTF/2.0/glTFLoaderInterfaces";
3229
- module "babylonjs-loaders/glTF/glTFFileLoader" {
3230
- interface GLTFLoaderExtensionOptions {
3231
- /**
3232
- * Defines options for the KHR_animation_pointer extension.
3233
- */
3234
- ["KHR_animation_pointer"]: {};
3235
- }
3236
- }
3237
- /**
3238
- * [Specification PR](https://github.com/KhronosGroup/glTF/pull/2147)
3239
- * !!! Experimental Extension Subject to Changes !!!
3240
- */
3241
- export class KHR_animation_pointer implements IGLTFLoaderExtension {
3242
- /**
3243
- * The name of this extension.
3244
- */
3245
- readonly name: string;
3246
- private _loader;
3247
- private _pathToObjectConverter?;
3248
- /**
3249
- * @internal
3250
- */
3251
- constructor(loader: GLTFLoader);
3252
- /**
3253
- * Defines whether this extension is enabled.
3254
- */
3255
- get enabled(): boolean;
3256
- /** @internal */
3257
- dispose(): void;
3258
- /**
3259
- * Loads a glTF animation channel.
3260
- * @param context The context when loading the asset
3261
- * @param animationContext The context of the animation when loading the asset
3262
- * @param animation The glTF animation property
3263
- * @param channel The glTF animation channel property
3264
- * @param onLoad Called for each animation loaded
3265
- * @returns A void promise that resolves when the load is complete or null if not handled
3266
- */
3267
- _loadAnimationChannelAsync(context: string, animationContext: string, animation: IAnimation, channel: IAnimationChannel, onLoad: (babylonAnimatable: IAnimatable, babylonAnimation: Animation) => void): Nullable<Promise<void>>;
3268
- }
3269
-
3284
+
3270
3285
  }
3271
3286
  declare module "babylonjs-loaders/glTF/2.0/Extensions/ExtrasAsMetadata" {
3272
3287
  import { Nullable } from "babylonjs/types";
@@ -3570,6 +3585,464 @@ export class EXT_lights_ies implements IGLTFLoaderExtension {
3570
3585
  loadNodeAsync(context: string, node: INode, assign: (babylonTransformNode: TransformNode) => void): Nullable<Promise<TransformNode>>;
3571
3586
  }
3572
3587
 
3588
+ }
3589
+ declare module "babylonjs-loaders/glTF/2.0/Extensions/KHR_interactivity/interactivityGraphParser" {
3590
+ import { IKHRInteractivity_Graph } from "babylonjs-gltf2interface";
3591
+ import { IGLTF } from "babylonjs-loaders/glTF/2.0/glTFLoaderInterfaces";
3592
+ import { IGLTFToFlowGraphMapping } from "babylonjs-loaders/glTF/2.0/Extensions/KHR_interactivity/declarationMapper";
3593
+ import { ISerializedFlowGraph, ISerializedFlowGraphBlock } from "babylonjs/FlowGraph/typeDefinitions";
3594
+ import { FlowGraphTypes } from "babylonjs/FlowGraph/flowGraphRichTypes";
3595
+ import { GLTFLoader } from "babylonjs-loaders/glTF/2.0/glTFLoader";
3596
+ export interface InteractivityEvent {
3597
+ eventId: string;
3598
+ eventData?: {
3599
+ eventData: boolean;
3600
+ id: string;
3601
+ type: string;
3602
+ value?: any;
3603
+ }[];
3604
+ }
3605
+ export const gltfTypeToBabylonType: {
3606
+ [key: string]: {
3607
+ length: number;
3608
+ flowGraphType: FlowGraphTypes;
3609
+ elementType: "number" | "boolean";
3610
+ };
3611
+ };
3612
+ export class InteractivityGraphToFlowGraphParser {
3613
+ private _interactivityGraph;
3614
+ private _gltf;
3615
+ _loader: GLTFLoader;
3616
+ /**
3617
+ * Note - the graph should be rejected if the same type is defined twice.
3618
+ * We currently don't validate that.
3619
+ */
3620
+ private _types;
3621
+ private _mappings;
3622
+ private _staticVariables;
3623
+ private _events;
3624
+ private _internalEventsCounter;
3625
+ private _nodes;
3626
+ constructor(_interactivityGraph: IKHRInteractivity_Graph, _gltf: IGLTF, _loader: GLTFLoader);
3627
+ get arrays(): {
3628
+ types: {
3629
+ length: number;
3630
+ flowGraphType: FlowGraphTypes;
3631
+ elementType: "number" | "boolean";
3632
+ }[];
3633
+ mappings: {
3634
+ flowGraphMapping: IGLTFToFlowGraphMapping;
3635
+ fullOperationName: string;
3636
+ }[];
3637
+ staticVariables: {
3638
+ type: FlowGraphTypes;
3639
+ value: any[];
3640
+ }[];
3641
+ events: InteractivityEvent[];
3642
+ nodes: {
3643
+ blocks: ISerializedFlowGraphBlock[];
3644
+ fullOperationName: string;
3645
+ }[];
3646
+ };
3647
+ private _parseTypes;
3648
+ private _parseDeclarations;
3649
+ private _parseVariables;
3650
+ private _parseVariable;
3651
+ private _parseEvents;
3652
+ private _parseNodes;
3653
+ private _getEmptyBlock;
3654
+ private _parseNodeConfiguration;
3655
+ private _parseNodeConnections;
3656
+ private _createNewSocketConnection;
3657
+ private _connectFlowGraphNodes;
3658
+ getVariableName(index: number): string;
3659
+ serializeToFlowGraph(): ISerializedFlowGraph;
3660
+ }
3661
+
3662
+ }
3663
+ declare module "babylonjs-loaders/glTF/2.0/Extensions/KHR_interactivity/index" {
3664
+ export * from "babylonjs-loaders/glTF/2.0/Extensions/KHR_interactivity/declarationMapper";
3665
+ export * from "babylonjs-loaders/glTF/2.0/Extensions/KHR_interactivity/interactivityGraphParser";
3666
+ export * from "babylonjs-loaders/glTF/2.0/Extensions/KHR_interactivity/flowGraphGLTFDataProvider";
3667
+
3668
+ }
3669
+ declare module "babylonjs-loaders/glTF/2.0/Extensions/KHR_interactivity/flowGraphGLTFDataProvider" {
3670
+ import { IFlowGraphBlockConfiguration } from "babylonjs/FlowGraph/flowGraphBlock";
3671
+ import { FlowGraphBlock } from "babylonjs/FlowGraph/flowGraphBlock";
3672
+ import { IGLTF } from "babylonjs-loaders/glTF/2.0/glTFLoaderInterfaces";
3673
+ import { FlowGraphDataConnection } from "babylonjs/FlowGraph/flowGraphDataConnection";
3674
+ import { AnimationGroup } from "babylonjs/Animations/animationGroup";
3675
+ import { TransformNode } from "babylonjs/Meshes/transformNode";
3676
+ /**
3677
+ * a configuration interface for this block
3678
+ */
3679
+ export interface IFlowGraphGLTFDataProviderBlockConfiguration extends IFlowGraphBlockConfiguration {
3680
+ /**
3681
+ * the glTF object to provide data from
3682
+ */
3683
+ glTF: IGLTF;
3684
+ }
3685
+ /**
3686
+ * a glTF-based FlowGraph block that provides arrays with babylon object, based on the glTF tree
3687
+ * Can be used, for example, to get animation index from a glTF animation
3688
+ */
3689
+ export class FlowGraphGLTFDataProvider extends FlowGraphBlock {
3690
+ /**
3691
+ * Output: an array of animation groups
3692
+ * Corresponds directly to the glTF animations array
3693
+ */
3694
+ readonly animationGroups: FlowGraphDataConnection<AnimationGroup[]>;
3695
+ /**
3696
+ * Output an array of (Transform) nodes
3697
+ * Corresponds directly to the glTF nodes array
3698
+ */
3699
+ readonly nodes: FlowGraphDataConnection<TransformNode[]>;
3700
+ constructor(config: IFlowGraphGLTFDataProviderBlockConfiguration);
3701
+ getClassName(): string;
3702
+ }
3703
+
3704
+ }
3705
+ declare module "babylonjs-loaders/glTF/2.0/Extensions/KHR_interactivity/declarationMapper" {
3706
+ import { IKHRInteractivity_Declaration, IKHRInteractivity_Graph, IKHRInteractivity_Node } from "babylonjs-gltf2interface";
3707
+ import { FlowGraphBlockNames } from "babylonjs/FlowGraph/Blocks/flowGraphBlockNames";
3708
+ import { ISerializedFlowGraphBlock, ISerializedFlowGraphContext } from "babylonjs/FlowGraph/typeDefinitions";
3709
+ import { InteractivityGraphToFlowGraphParser } from "babylonjs-loaders/glTF/2.0/Extensions/KHR_interactivity/interactivityGraphParser";
3710
+ import { IGLTF } from "babylonjs-loaders/glTF/2.0/glTFLoaderInterfaces";
3711
+ interface IGLTFToFlowGraphMappingObject<I = any, O = any> {
3712
+ /**
3713
+ * The name of the property in the FlowGraph block.
3714
+ */
3715
+ name: string;
3716
+ /**
3717
+ * The type of the property in the glTF specs.
3718
+ * If not provided will be inferred.
3719
+ */
3720
+ gltfType?: string;
3721
+ /**
3722
+ * The type of the property in the FlowGraph block.
3723
+ * If not defined it equals the glTF type.
3724
+ */
3725
+ flowGraphType?: string;
3726
+ /**
3727
+ * A function that transforms the data from the glTF to the FlowGraph block.
3728
+ */
3729
+ dataTransformer?: (data: I[], parser: InteractivityGraphToFlowGraphParser) => O[];
3730
+ /**
3731
+ * If the property is in the options passed to the constructor of the block.
3732
+ */
3733
+ inOptions?: boolean;
3734
+ /**
3735
+ * If the property is a pointer to a value.
3736
+ * This will add an extra JsonPointerParser block to the graph.
3737
+ */
3738
+ isPointer?: boolean;
3739
+ /**
3740
+ * If the property is an index to a value.
3741
+ * if defined this will be the name of the array to find the object in.
3742
+ */
3743
+ isVariable?: boolean;
3744
+ /**
3745
+ * the name of the class type this value will be mapped to.
3746
+ * This is used if we generate more than one block for a single glTF node.
3747
+ * Defaults to the first block in the mapping.
3748
+ */
3749
+ toBlock?: FlowGraphBlockNames;
3750
+ /**
3751
+ * Used in configuration values. If defined, this will be the default value, if no value is provided.
3752
+ */
3753
+ defaultValue?: O;
3754
+ }
3755
+ export interface IGLTFToFlowGraphMapping {
3756
+ /**
3757
+ * The type of the FlowGraph block(s).
3758
+ * Typically will be a single element in an array.
3759
+ * When adding blocks defined in this module use the KHR_interactivity prefix.
3760
+ */
3761
+ blocks: (FlowGraphBlockNames | string)[];
3762
+ /**
3763
+ * The inputs of the glTF node mapped to the FlowGraph block.
3764
+ */
3765
+ inputs?: {
3766
+ /**
3767
+ * The value inputs of the glTF node mapped to the FlowGraph block.
3768
+ */
3769
+ values?: {
3770
+ [originName: string]: IGLTFToFlowGraphMappingObject;
3771
+ };
3772
+ /**
3773
+ * The flow inputs of the glTF node mapped to the FlowGraph block.
3774
+ */
3775
+ flows?: {
3776
+ [originName: string]: IGLTFToFlowGraphMappingObject;
3777
+ };
3778
+ };
3779
+ /**
3780
+ * The outputs of the glTF node mapped to the FlowGraph block.
3781
+ */
3782
+ outputs?: {
3783
+ /**
3784
+ * The value outputs of the glTF node mapped to the FlowGraph block.
3785
+ */
3786
+ values?: {
3787
+ [originName: string]: IGLTFToFlowGraphMappingObject;
3788
+ };
3789
+ /**
3790
+ * The flow outputs of the glTF node mapped to the FlowGraph block.
3791
+ */
3792
+ flows?: {
3793
+ [originName: string]: IGLTFToFlowGraphMappingObject;
3794
+ };
3795
+ };
3796
+ /**
3797
+ * The configuration of the glTF node mapped to the FlowGraph block.
3798
+ * This information is usually passed to the constructor of the block.
3799
+ */
3800
+ configuration?: {
3801
+ [originName: string]: IGLTFToFlowGraphMappingObject;
3802
+ };
3803
+ /**
3804
+ * If we generate more than one block for a single glTF node, this mapping will be used to map
3805
+ * between the flowGraph classes.
3806
+ */
3807
+ typeToTypeMapping?: {
3808
+ [originName: string]: IGLTFToFlowGraphMappingObject;
3809
+ };
3810
+ /**
3811
+ * The connections between two or more blocks.
3812
+ * This is used to connect the blocks in the graph
3813
+ */
3814
+ interBlockConnectors?: {
3815
+ /**
3816
+ * The name of the input connection in the first block.
3817
+ */
3818
+ input: string;
3819
+ /**
3820
+ * The name of the output connection in the second block.
3821
+ */
3822
+ output: string;
3823
+ /**
3824
+ * The index of the block in the array of blocks that corresponds to the input.
3825
+ */
3826
+ inputBlockIndex: number;
3827
+ /**
3828
+ * The index of the block in the array of blocks that corresponds to the output.
3829
+ */
3830
+ outputBlockIndex: number;
3831
+ /**
3832
+ * If the connection is a variable connection or a flow connection.
3833
+ */
3834
+ isVariable?: boolean;
3835
+ }[];
3836
+ /**
3837
+ * This optional function will allow to validate the node, according to the glTF specs.
3838
+ * For example, if a node has a configuration object, it must be present and correct.
3839
+ * This is a basic node-based validation.
3840
+ * This function is expected to return false and log the error if the node is not valid.
3841
+ * Note that this function can also modify the node, if needed.
3842
+ *
3843
+ * @param gltfBlock the glTF node to validate
3844
+ * @param glTFObject the glTF object
3845
+ * @returns true if validated, false if not.
3846
+ */
3847
+ validation?: (gltfBlock: IKHRInteractivity_Node, interactivityGraph: IKHRInteractivity_Graph, glTFObject?: IGLTF) => boolean;
3848
+ /**
3849
+ * This is used if we need extra information for the constructor/options that is not provided directly by the glTF node.
3850
+ * This function can return more than one node, if extra nodes are needed for this block to function correctly.
3851
+ * Returning more than one block will usually happen when a json pointer was provided.
3852
+ *
3853
+ * @param gltfBlock the glTF node
3854
+ * @param mapping the mapping object
3855
+ * @param arrays the arrays of the interactivity object
3856
+ * @param serializedObjects the serialized object
3857
+ * @returns an array of serialized nodes that will be added to the graph.
3858
+ */
3859
+ extraProcessor?: (gltfBlock: IKHRInteractivity_Node, declaration: IKHRInteractivity_Declaration, mapping: IGLTFToFlowGraphMapping, parser: InteractivityGraphToFlowGraphParser, serializedObjects: ISerializedFlowGraphBlock[], context: ISerializedFlowGraphContext, globalGLTF?: IGLTF) => ISerializedFlowGraphBlock[];
3860
+ }
3861
+ export function getMappingForFullOperationName(fullOperationName: string): IGLTFToFlowGraphMapping | undefined;
3862
+ export function getMappingForDeclaration(declaration: IKHRInteractivity_Declaration, returnNoOpIfNotAvailable?: boolean): IGLTFToFlowGraphMapping | undefined;
3863
+ /**
3864
+ * This function will add new mapping to glTF interactivity.
3865
+ * Other extensions can define new types of blocks, this is the way to let interactivity know how to parse them.
3866
+ * @param key the type of node, i.e. "variable/get"
3867
+ * @param extension the extension of the interactivity operation, i.e. "KHR_selectability"
3868
+ * @param mapping The mapping object. See documentation or examples below.
3869
+ */
3870
+ export function addNewInteractivityFlowGraphMapping(key: string, extension: string, mapping: IGLTFToFlowGraphMapping): void;
3871
+ export function getAllSupportedNativeNodeTypes(): string[];
3872
+ export {};
3873
+ /**
3874
+ *
3875
+ * These are the nodes from the specs:
3876
+
3877
+ ### Math Nodes
3878
+ 1. **Constants**
3879
+ - E (`math/e`) FlowGraphBlockNames.E
3880
+ - Pi (`math/pi`) FlowGraphBlockNames.PI
3881
+ - Infinity (`math/inf`) FlowGraphBlockNames.Inf
3882
+ - Not a Number (`math/nan`) FlowGraphBlockNames.NaN
3883
+ 2. **Arithmetic Nodes**
3884
+ - Absolute Value (`math/abs`) FlowGraphBlockNames.Abs
3885
+ - Sign (`math/sign`) FlowGraphBlockNames.Sign
3886
+ - Truncate (`math/trunc`) FlowGraphBlockNames.Trunc
3887
+ - Floor (`math/floor`) FlowGraphBlockNames.Floor
3888
+ - Ceil (`math/ceil`) FlowGraphBlockNames.Ceil
3889
+ - Round (`math/round`) FlowGraphBlockNames.Round
3890
+ - Fraction (`math/fract`) FlowGraphBlockNames.Fract
3891
+ - Negation (`math/neg`) FlowGraphBlockNames.Negation
3892
+ - Addition (`math/add`) FlowGraphBlockNames.Add
3893
+ - Subtraction (`math/sub`) FlowGraphBlockNames.Subtract
3894
+ - Multiplication (`math/mul`) FlowGraphBlockNames.Multiply
3895
+ - Division (`math/div`) FlowGraphBlockNames.Divide
3896
+ - Remainder (`math/rem`) FlowGraphBlockNames.Modulo
3897
+ - Minimum (`math/min`) FlowGraphBlockNames.Min
3898
+ - Maximum (`math/max`) FlowGraphBlockNames.Max
3899
+ - Clamp (`math/clamp`) FlowGraphBlockNames.Clamp
3900
+ - Saturate (`math/saturate`) FlowGraphBlockNames.Saturate
3901
+ - Interpolate (`math/mix`) FlowGraphBlockNames.MathInterpolation
3902
+ 3. **Comparison Nodes**
3903
+ - Equality (`math/eq`) FlowGraphBlockNames.Equality
3904
+ - Less Than (`math/lt`) FlowGraphBlockNames.LessThan
3905
+ - Less Than Or Equal To (`math/le`) FlowGraphBlockNames.LessThanOrEqual
3906
+ - Greater Than (`math/gt`) FlowGraphBlockNames.GreaterThan
3907
+ - Greater Than Or Equal To (`math/ge`) FlowGraphBlockNames.GreaterThanOrEqual
3908
+ 4. **Special Nodes**
3909
+ - Is Not a Number (`math/isnan`) FlowGraphBlockNames.IsNaN
3910
+ - Is Infinity (`math/isinf`) FlowGraphBlockNames.IsInfinity
3911
+ - Select (`math/select`) FlowGraphBlockNames.Conditional
3912
+ - Random (`math/random`) FlowGraphBlockNames.Random
3913
+ 5. **Angle and Trigonometry Nodes**
3914
+ - Degrees-To-Radians (`math/rad`) FlowGraphBlockNames.DegToRad
3915
+ - Radians-To-Degrees (`math/deg`) FlowGraphBlockNames.RadToDeg
3916
+ - Sine (`math/sin`) FlowGraphBlockNames.Sin
3917
+ - Cosine (`math/cos`) FlowGraphBlockNames.Cos
3918
+ - Tangent (`math/tan`) FlowGraphBlockNames.Tan
3919
+ - Arcsine (`math/asin`) FlowGraphBlockNames.Asin
3920
+ - Arccosine (`math/acos`) FlowGraphBlockNames.Acos
3921
+ - Arctangent (`math/atan`) FlowGraphBlockNames.Atan
3922
+ - Arctangent 2 (`math/atan2`) FlowGraphBlockNames.Atan2
3923
+ 6. **Hyperbolic Nodes**
3924
+ - Hyperbolic Sine (`math/sinh`) FlowGraphBlockNames.Sinh
3925
+ - Hyperbolic Cosine (`math/cosh`) FlowGraphBlockNames.Cosh
3926
+ - Hyperbolic Tangent (`math/tanh`) FlowGraphBlockNames.Tanh
3927
+ - Inverse Hyperbolic Sine (`math/asinh`) FlowGraphBlockNames.Asinh
3928
+ - Inverse Hyperbolic Cosine (`math/acosh`) FlowGraphBlockNames.Acosh
3929
+ - Inverse Hyperbolic Tangent (`math/atanh`) FlowGraphBlockNames.Atanh
3930
+ 7. **Exponential Nodes**
3931
+ - Exponent (`math/exp`) FlowGraphBlockNames.Exponential
3932
+ - Natural Logarithm (`math/log`) FlowGraphBlockNames.Log
3933
+ - Base-2 Logarithm (`math/log2`) FlowGraphBlockNames.Log2
3934
+ - Base-10 Logarithm (`math/log10`) FlowGraphBlockNames.Log10
3935
+ - Square Root (`math/sqrt`) FlowGraphBlockNames.SquareRoot
3936
+ - Cube Root (`math/cbrt`) FlowGraphBlockNames.CubeRoot
3937
+ - Power (`math/pow`) FlowGraphBlockNames.Power
3938
+ 8. **Vector Nodes**
3939
+ - Length (`math/length`) FlowGraphBlockNames.Length
3940
+ - Normalize (`math/normalize`) FlowGraphBlockNames.Normalize
3941
+ - Dot Product (`math/dot`) FlowGraphBlockNames.Dot
3942
+ - Cross Product (`math/cross`) FlowGraphBlockNames.Cross
3943
+ - Rotate 2D (`math/rotate2d`) FlowGraphBlockNames.Rotate2D
3944
+ - Rotate 3D (`math/rotate3d`) FlowGraphBlockNames.Rotate3D
3945
+ - Transform (`math/transform`) FlowGraphBlockNames.TransformVector
3946
+ 9. **Matrix Nodes**
3947
+ - Transpose (`math/transpose`) FlowGraphBlockNames.Transpose
3948
+ - Determinant (`math/determinant`) FlowGraphBlockNames.Determinant
3949
+ - Inverse (`math/inverse`) FlowGraphBlockNames.InvertMatrix
3950
+ - Multiplication (`math/matmul`) FlowGraphBlockNames.MatrixMultiplication
3951
+ 10. **Swizzle Nodes**
3952
+ - Combine (`math/combine2`, `math/combine3`, `math/combine4`, `math/combine2x2`, `math/combine3x3`, `math/combine4x4`)
3953
+ FlowGraphBlockNames.CombineVector2, FlowGraphBlockNames.CombineVector3, FlowGraphBlockNames.CombineVector4
3954
+ FlowGraphBlockNames.CombineMatrix2D, FlowGraphBlockNames.CombineMatrix3D, FlowGraphBlockNames.CombineMatrix
3955
+ - Extract (`math/extract2`, `math/extract3`, `math/extract4`, `math/extract2x2`, `math/extract3x3`, `math/extract4x4`)
3956
+ FlowGraphBlockNames.ExtractVector2, FlowGraphBlockNames.ExtractVector3, FlowGraphBlockNames.ExtractVector4
3957
+ FlowGraphBlockNames.ExtractMatrix2D, FlowGraphBlockNames.ExtractMatrix3D, FlowGraphBlockNames.ExtractMatrix
3958
+ 11. **Integer Arithmetic Nodes**
3959
+ - Absolute Value (`math/abs`) FlowGraphBlockNames.Abs
3960
+ - Sign (`math/sign`) FlowGraphBlockNames.Sign
3961
+ - Negation (`math/neg`) FlowGraphBlockNames.Negation
3962
+ - Addition (`math/add`) FlowGraphBlockNames.Add
3963
+ - Subtraction (`math/sub`) FlowGraphBlockNames.Subtract
3964
+ - Multiplication (`math/mul`) FlowGraphBlockNames.Multiply
3965
+ - Division (`math/div`) FlowGraphBlockNames.Divide
3966
+ - Remainder (`math/rem`) FlowGraphBlockNames.Modulo
3967
+ - Minimum (`math/min`) FlowGraphBlockNames.Min
3968
+ - Maximum (`math/max`) FlowGraphBlockNames.Max
3969
+ - Clamp (`math/clamp`) FlowGraphBlockNames.Clamp
3970
+ 12. **Integer Comparison Nodes**
3971
+ - Equality (`math/eq`) FlowGraphBlockNames.Equality
3972
+ - Less Than (`math/lt`) FlowGraphBlockNames.LessThan
3973
+ - Less Than Or Equal To (`math/le`) FlowGraphBlockNames.LessThanOrEqual
3974
+ - Greater Than (`math/gt`) FlowGraphBlockNames.GreaterThan
3975
+ - Greater Than Or Equal To (`math/ge`) FlowGraphBlockNames.GreaterThanOrEqual
3976
+ 13. **Integer Bitwise Nodes**
3977
+ - Bitwise NOT (`math/not`) FlowGraphBlockNames.BitwiseNot
3978
+ - Bitwise AND (`math/and`) FlowGraphBlockNames.BitwiseAnd
3979
+ - Bitwise OR (`math/or`) FlowGraphBlockNames.BitwiseOr
3980
+ - Bitwise XOR (`math/xor`) FlowGraphBlockNames.BitwiseXor
3981
+ - Right Shift (`math/asr`) FlowGraphBlockNames.BitwiseRightShift
3982
+ - Left Shift (`math/lsl`) FlowGraphBlockNames.BitwiseLeftShift
3983
+ - Count Leading Zeros (`math/clz`) FlowGraphBlockNames.LeadingZeros
3984
+ - Count Trailing Zeros (`math/ctz`) FlowGraphBlockNames.TrailingZeros
3985
+ - Count One Bits (`math/popcnt`) FlowGraphBlockNames.OneBitsCounter
3986
+ 14. **Boolean Arithmetic Nodes**
3987
+ - Equality (`math/eq`) FlowGraphBlockNames.Equality
3988
+ - Boolean NOT (`math/not`) FlowGraphBlockNames.BitwiseNot
3989
+ - Boolean AND (`math/and`) FlowGraphBlockNames.BitwiseAnd
3990
+ - Boolean OR (`math/or`) FlowGraphBlockNames.BitwiseOr
3991
+ - Boolean XOR (`math/xor`) FlowGraphBlockNames.BitwiseXor
3992
+
3993
+ ### Type Conversion Nodes
3994
+ 1. **Boolean Conversion Nodes**
3995
+ - Boolean to Integer (`type/boolToInt`) FlowGraphBlockNames.BooleanToInt
3996
+ - Boolean to Float (`type/boolToFloat`) FlowGraphBlockNames.BooleanToFloat
3997
+ 2. **Integer Conversion Nodes**
3998
+ - Integer to Boolean (`type/intToBool`) FlowGraphBlockNames.IntToBoolean
3999
+ - Integer to Float (`type/intToFloat`) FlowGraphBlockNames.IntToFloat
4000
+ 3. **Float Conversion Nodes**
4001
+ - Float to Boolean (`type/floatToBool`) FlowGraphBlockNames.FloatToBoolean
4002
+ - Float to Integer (`type/floatToInt`) FlowGraphBlockNames.FloatToInt
4003
+
4004
+ ### Control Flow Nodes
4005
+ 1. **Sync Nodes**
4006
+ - Sequence (`flow/sequence`) FlowGraphBlockNames.Sequence
4007
+ - Branch (`flow/branch`) FlowGraphBlockNames.Branch
4008
+ - Switch (`flow/switch`) FlowGraphBlockNames.Switch
4009
+ - While Loop (`flow/while`) FlowGraphBlockNames.WhileLoop
4010
+ - For Loop (`flow/for`) FlowGraphBlockNames.ForLoop
4011
+ - Do N (`flow/doN`) FlowGraphBlockNames.DoN
4012
+ - Multi Gate (`flow/multiGate`) FlowGraphBlockNames.MultiGate
4013
+ - Wait All (`flow/waitAll`) FlowGraphBlockNames.WaitAll
4014
+ - Throttle (`flow/throttle`) FlowGraphBlockNames.Throttle
4015
+ 2. **Delay Nodes**
4016
+ - Set Delay (`flow/setDelay`) FlowGraphBlockNames.SetDelay
4017
+ - Cancel Delay (`flow/cancelDelay`) FlowGraphBlockNames.CancelDelay
4018
+
4019
+ ### State Manipulation Nodes
4020
+ 1. **Custom Variable Access**
4021
+ - Variable Get (`variable/get`) FlowGraphBlockNames.GetVariable
4022
+ - Variable Set (`variable/set`) FlowGraphBlockNames.SetVariable
4023
+ - Variable Interpolate (`variable/interpolate`)
4024
+ 2. **Object Model Access** // TODO fully test this!!!
4025
+ - JSON Pointer Template Parsing (`pointer/get`) [FlowGraphBlockNames.GetProperty, FlowGraphBlockNames.JsonPointerParser]
4026
+ - Effective JSON Pointer Generation (`pointer/set`) [FlowGraphBlockNames.SetProperty, FlowGraphBlockNames.JsonPointerParser]
4027
+ - Pointer Get (`pointer/get`) [FlowGraphBlockNames.GetProperty, FlowGraphBlockNames.JsonPointerParser]
4028
+ - Pointer Set (`pointer/set`) [FlowGraphBlockNames.SetProperty, FlowGraphBlockNames.JsonPointerParser]
4029
+ - Pointer Interpolate (`pointer/interpolate`) [FlowGraphBlockNames.ValueInterpolation, FlowGraphBlockNames.JsonPointerParser, FlowGraphBlockNames.PlayAnimation, FlowGraphBlockNames.Easing]
4030
+
4031
+ ### Animation Control Nodes
4032
+ 1. **Animation Play** (`animation/start`) FlowGraphBlockNames.PlayAnimation
4033
+ 2. **Animation Stop** (`animation/stop`) FlowGraphBlockNames.StopAnimation
4034
+ 3. **Animation Stop At** (`animation/stopAt`) FlowGraphBlockNames.StopAnimation
4035
+
4036
+ ### Event Nodes
4037
+ 1. **Lifecycle Event Nodes**
4038
+ - On Start (`event/onStart`) FlowGraphBlockNames.SceneReadyEvent
4039
+ - On Tick (`event/onTick`) FlowGraphBlockNames.SceneTickEvent
4040
+ 2. **Custom Event Nodes**
4041
+ - Receive (`event/receive`) FlowGraphBlockNames.ReceiveCustomEvent
4042
+ - Send (`event/send`) FlowGraphBlockNames.SendCustomEvent
4043
+
4044
+ */
4045
+
3573
4046
  }
3574
4047
  declare module "babylonjs-loaders/glTF/1.0/index" {
3575
4048
  export * from "babylonjs-loaders/glTF/1.0/glTFBinaryExtension";
@@ -5990,24 +6463,26 @@ declare module BABYLON.GLTF2 {
5990
6463
  constructor(type: number, name: string, getValue: GetValueFn, getStride: (target: any) => number);
5991
6464
  protected _buildAnimation(name: string, fps: number, keys: any[]): Animation;
5992
6465
  /** @internal */
5993
- abstract buildAnimations(target: any, name: string, fps: number, keys: any[], callback: (babylonAnimatable: IAnimatable, babylonAnimation: Animation) => void): void;
6466
+ abstract buildAnimations(target: any, name: string, fps: number, keys: any[]): {
6467
+ babylonAnimatable: IAnimatable;
6468
+ babylonAnimation: Animation;
6469
+ }[];
5994
6470
  }
5995
6471
  /** @internal */
5996
6472
  export class TransformNodeAnimationPropertyInfo extends AnimationPropertyInfo {
5997
6473
  /** @internal */
5998
- buildAnimations(target: BABYLON.GLTF2.Loader.INode, name: string, fps: number, keys: any[], callback: (babylonAnimatable: IAnimatable, babylonAnimation: Animation) => void): void;
6474
+ buildAnimations(target: BABYLON.GLTF2.Loader.INode, name: string, fps: number, keys: any[]): {
6475
+ babylonAnimatable: IAnimatable;
6476
+ babylonAnimation: Animation;
6477
+ }[];
5999
6478
  }
6000
6479
  /** @internal */
6001
6480
  export class WeightAnimationPropertyInfo extends AnimationPropertyInfo {
6002
- buildAnimations(target: BABYLON.GLTF2.Loader.INode, name: string, fps: number, keys: any[], callback: (babylonAnimatable: IAnimatable, babylonAnimation: Animation) => void): void;
6481
+ buildAnimations(target: BABYLON.GLTF2.Loader.INode, name: string, fps: number, keys: any[]): {
6482
+ babylonAnimatable: IAnimatable;
6483
+ babylonAnimation: Animation;
6484
+ }[];
6003
6485
  }
6004
- /** @internal */
6005
- export var nodeAnimationData: {
6006
- translation: TransformNodeAnimationPropertyInfo[];
6007
- rotation: TransformNodeAnimationPropertyInfo[];
6008
- scale: TransformNodeAnimationPropertyInfo[];
6009
- weights: WeightAnimationPropertyInfo[];
6010
- };
6011
6486
 
6012
6487
 
6013
6488
 
@@ -6069,6 +6544,8 @@ declare module BABYLON.GLTF2 {
6069
6544
  _disableInstancedMesh: number;
6070
6545
  /** @internal */
6071
6546
  _allMaterialsDirtyRequired: boolean;
6547
+ /** @internal */
6548
+ _skipStartAnimationStep: boolean;
6072
6549
  private readonly _parent;
6073
6550
  private readonly _extensions;
6074
6551
  private _disposed;
@@ -6226,7 +6703,7 @@ declare module BABYLON.GLTF2 {
6226
6703
  * @param onLoad Called for each animation loaded
6227
6704
  * @returns A void promise that resolves when the load is complete
6228
6705
  */
6229
- _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>;
6706
+ _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>;
6230
6707
  private _loadAnimationSamplerAsync;
6231
6708
  /**
6232
6709
  * Loads a glTF buffer.
@@ -6427,41 +6904,279 @@ declare module BABYLON {
6427
6904
 
6428
6905
  }
6429
6906
  declare module BABYLON.GLTF2.Loader.Extensions {
6430
- export var gltfToFlowGraphTypeMap: {
6431
- [key: string]: string;
6432
- };
6433
- export var gltfTypeToBabylonType: any;
6434
-
6435
-
6436
-
6437
- }
6438
- declare module BABYLON {
6439
-
6440
-
6441
- }
6442
- declare module BABYLON.GLTF2.Loader.Extensions {
6443
- /**
6444
- * Class to convert an interactivity pointer path to a smart object
6445
- */
6446
- export class InteractivityPathToObjectConverter extends BABYLON.GLTF2.Loader.Extensions.GLTFPathToObjectConverter<IObjectAccessor> {
6447
- constructor(gltf: BABYLON.GLTF2.Loader.IGLTF);
6907
+ export interface IGLTFObjectModelTree {
6908
+ cameras: IGLTFObjectModelTreeCamerasObject;
6909
+ nodes: IGLTFObjectModelTreeNodesObject;
6910
+ materials: IGLTFObjectModelTreeMaterialsObject;
6911
+ extensions: IGLTFObjectModelTreeExtensionsObject;
6912
+ animations: {
6913
+ length: IObjectAccessor<BABYLON.GLTF2.Loader.IAnimation[], AnimationGroup[], number>;
6914
+ __array__: {};
6915
+ };
6916
+ meshes: {
6917
+ length: IObjectAccessor<BABYLON.GLTF2.Loader.IMesh[], (Mesh | undefined)[], number>;
6918
+ __array__: {};
6919
+ };
6920
+ }
6921
+ export interface IGLTFObjectModelTreeNodesObject<GLTFTargetType = BABYLON.GLTF2.Loader.INode, BabylonTargetType = TransformNode> {
6922
+ length: IObjectAccessor<GLTFTargetType[], BabylonTargetType[], number>;
6923
+ __array__: {
6924
+ __target__: boolean;
6925
+ translation: IObjectAccessor<GLTFTargetType, BabylonTargetType, Vector3>;
6926
+ rotation: IObjectAccessor<GLTFTargetType, BabylonTargetType, Quaternion>;
6927
+ scale: IObjectAccessor<GLTFTargetType, BabylonTargetType, Vector3>;
6928
+ matrix: IObjectAccessor<GLTFTargetType, BabylonTargetType, Matrix>;
6929
+ globalMatrix: IObjectAccessor<GLTFTargetType, BabylonTargetType, Matrix>;
6930
+ weights: {
6931
+ length: IObjectAccessor<GLTFTargetType, BabylonTargetType, number>;
6932
+ __array__: {
6933
+ __target__: boolean;
6934
+ } & IObjectAccessor<GLTFTargetType, BabylonTargetType, number>;
6935
+ } & IObjectAccessor<GLTFTargetType, BabylonTargetType, number[]>;
6936
+ extensions: {
6937
+ EXT_lights_ies?: {
6938
+ multiplier: IObjectAccessor<BABYLON.GLTF2.Loader.INode, Light, number>;
6939
+ color: IObjectAccessor<BABYLON.GLTF2.Loader.INode, Light, Color3>;
6940
+ };
6941
+ };
6942
+ };
6943
+ }
6944
+ export interface IGLTFObjectModelTreeCamerasObject {
6945
+ __array__: {
6946
+ __target__: boolean;
6947
+ orthographic: {
6948
+ xmag: IObjectAccessor<BABYLON.GLTF2.Loader.ICamera, BABYLON.GLTF2.Loader.ICamera, Vector2>;
6949
+ ymag: IObjectAccessor<BABYLON.GLTF2.Loader.ICamera, BABYLON.GLTF2.Loader.ICamera, Vector2>;
6950
+ zfar: IObjectAccessor<BABYLON.GLTF2.Loader.ICamera, BABYLON.GLTF2.Loader.ICamera, number>;
6951
+ znear: IObjectAccessor<BABYLON.GLTF2.Loader.ICamera, BABYLON.GLTF2.Loader.ICamera, number>;
6952
+ };
6953
+ perspective: {
6954
+ yfov: IObjectAccessor<BABYLON.GLTF2.Loader.ICamera, BABYLON.GLTF2.Loader.ICamera, number>;
6955
+ zfar: IObjectAccessor<BABYLON.GLTF2.Loader.ICamera, BABYLON.GLTF2.Loader.ICamera, number>;
6956
+ znear: IObjectAccessor<BABYLON.GLTF2.Loader.ICamera, BABYLON.GLTF2.Loader.ICamera, number>;
6957
+ aspectRatio: IObjectAccessor<BABYLON.GLTF2.Loader.ICamera, BABYLON.GLTF2.Loader.ICamera, Nullable<number>>;
6958
+ };
6959
+ };
6960
+ }
6961
+ export interface IGLTFObjectModelTreeMaterialsObject {
6962
+ __array__: {
6963
+ __target__: boolean;
6964
+ pbrMetallicRoughness: {
6965
+ baseColorFactor: IObjectAccessor<BABYLON.GLTF2.Loader.IMaterial, PBRMaterial, Color4>;
6966
+ metallicFactor: IObjectAccessor<BABYLON.GLTF2.Loader.IMaterial, PBRMaterial, Nullable<number>>;
6967
+ roughnessFactor: IObjectAccessor<BABYLON.GLTF2.Loader.IMaterial, PBRMaterial, Nullable<number>>;
6968
+ baseColorTexture: {
6969
+ extensions: {
6970
+ KHR_texture_transform: ITextureDefinition;
6971
+ };
6972
+ };
6973
+ metallicRoughnessTexture: {
6974
+ extensions: {
6975
+ KHR_texture_transform: ITextureDefinition;
6976
+ };
6977
+ };
6978
+ };
6979
+ emissiveFactor: IObjectAccessor<BABYLON.GLTF2.Loader.IMaterial, PBRMaterial, Color3>;
6980
+ normalTexture: {
6981
+ scale: IObjectAccessor<BABYLON.GLTF2.Loader.IMaterial, PBRMaterial, number>;
6982
+ extensions: {
6983
+ KHR_texture_transform: ITextureDefinition;
6984
+ };
6985
+ };
6986
+ occlusionTexture: {
6987
+ strength: IObjectAccessor<BABYLON.GLTF2.Loader.IMaterial, PBRMaterial, number>;
6988
+ extensions: {
6989
+ KHR_texture_transform: ITextureDefinition;
6990
+ };
6991
+ };
6992
+ emissiveTexture: {
6993
+ extensions: {
6994
+ KHR_texture_transform: ITextureDefinition;
6995
+ };
6996
+ };
6997
+ extensions: {
6998
+ KHR_materials_anisotropy: {
6999
+ anisotropyStrength: IObjectAccessor<BABYLON.GLTF2.Loader.IMaterial, PBRMaterial, number>;
7000
+ anisotropyRotation: IObjectAccessor<BABYLON.GLTF2.Loader.IMaterial, PBRMaterial, number>;
7001
+ anisotropyTexture: {
7002
+ extensions: {
7003
+ KHR_texture_transform: ITextureDefinition;
7004
+ };
7005
+ };
7006
+ };
7007
+ KHR_materials_clearcoat: {
7008
+ clearcoatFactor: IObjectAccessor<BABYLON.GLTF2.Loader.IMaterial, PBRMaterial, number>;
7009
+ clearcoatRoughnessFactor: IObjectAccessor<BABYLON.GLTF2.Loader.IMaterial, PBRMaterial, number>;
7010
+ clearcoatTexture: {
7011
+ extensions: {
7012
+ KHR_texture_transform: ITextureDefinition;
7013
+ };
7014
+ };
7015
+ clearcoatNormalTexture: {
7016
+ scale: IObjectAccessor<BABYLON.GLTF2.Loader.IMaterial, PBRMaterial, number>;
7017
+ extensions: {
7018
+ KHR_texture_transform: ITextureDefinition;
7019
+ };
7020
+ };
7021
+ clearcoatRoughnessTexture: {
7022
+ extensions: {
7023
+ KHR_texture_transform: ITextureDefinition;
7024
+ };
7025
+ };
7026
+ };
7027
+ KHR_materials_dispersion: {
7028
+ dispersion: IObjectAccessor<BABYLON.GLTF2.Loader.IMaterial, PBRMaterial, number>;
7029
+ };
7030
+ KHR_materials_emissive_strength: {
7031
+ emissiveStrength: IObjectAccessor<BABYLON.GLTF2.Loader.IMaterial, PBRMaterial, number>;
7032
+ };
7033
+ KHR_materials_ior: {
7034
+ ior: IObjectAccessor<BABYLON.GLTF2.Loader.IMaterial, PBRMaterial, number>;
7035
+ };
7036
+ KHR_materials_iridescence: {
7037
+ iridescenceFactor: IObjectAccessor<BABYLON.GLTF2.Loader.IMaterial, PBRMaterial, number>;
7038
+ iridescenceIor: IObjectAccessor<BABYLON.GLTF2.Loader.IMaterial, PBRMaterial, number>;
7039
+ iridescenceThicknessMinimum: IObjectAccessor<BABYLON.GLTF2.Loader.IMaterial, PBRMaterial, number>;
7040
+ iridescenceThicknessMaximum: IObjectAccessor<BABYLON.GLTF2.Loader.IMaterial, PBRMaterial, number>;
7041
+ iridescenceTexture: {
7042
+ extensions: {
7043
+ KHR_texture_transform: ITextureDefinition;
7044
+ };
7045
+ };
7046
+ iridescenceThicknessTexture: {
7047
+ extensions: {
7048
+ KHR_texture_transform: ITextureDefinition;
7049
+ };
7050
+ };
7051
+ };
7052
+ KHR_materials_sheen: {
7053
+ sheenColorFactor: IObjectAccessor<BABYLON.GLTF2.Loader.IMaterial, PBRMaterial, Color3>;
7054
+ sheenRoughnessFactor: IObjectAccessor<BABYLON.GLTF2.Loader.IMaterial, PBRMaterial, number>;
7055
+ sheenColorTexture: {
7056
+ extensions: {
7057
+ KHR_texture_transform: ITextureDefinition;
7058
+ };
7059
+ };
7060
+ sheenRoughnessTexture: {
7061
+ extensions: {
7062
+ KHR_texture_transform: ITextureDefinition;
7063
+ };
7064
+ };
7065
+ };
7066
+ KHR_materials_specular: {
7067
+ specularFactor: IObjectAccessor<BABYLON.GLTF2.Loader.IMaterial, PBRMaterial, number>;
7068
+ specularColorFactor: IObjectAccessor<BABYLON.GLTF2.Loader.IMaterial, PBRMaterial, Color3>;
7069
+ specularTexture: {
7070
+ extensions: {
7071
+ KHR_texture_transform: ITextureDefinition;
7072
+ };
7073
+ };
7074
+ specularColorTexture: {
7075
+ extensions: {
7076
+ KHR_texture_transform: ITextureDefinition;
7077
+ };
7078
+ };
7079
+ };
7080
+ KHR_materials_transmission: {
7081
+ transmissionFactor: IObjectAccessor<BABYLON.GLTF2.Loader.IMaterial, PBRMaterial, number>;
7082
+ transmissionTexture: {
7083
+ extensions: {
7084
+ KHR_texture_transform: ITextureDefinition;
7085
+ };
7086
+ };
7087
+ };
7088
+ KHR_materials_diffuse_transmission: {
7089
+ diffuseTransmissionFactor: IObjectAccessor<BABYLON.GLTF2.Loader.IMaterial, PBRMaterial, number>;
7090
+ diffuseTransmissionTexture: {
7091
+ extensions: {
7092
+ KHR_texture_transform: ITextureDefinition;
7093
+ };
7094
+ };
7095
+ diffuseTransmissionColorFactor: IObjectAccessor<BABYLON.GLTF2.Loader.IMaterial, PBRMaterial, Nullable<Color3>>;
7096
+ diffuseTransmissionColorTexture: {
7097
+ extensions: {
7098
+ KHR_texture_transform: ITextureDefinition;
7099
+ };
7100
+ };
7101
+ };
7102
+ KHR_materials_volume: {
7103
+ thicknessFactor: IObjectAccessor<BABYLON.GLTF2.Loader.IMaterial, PBRMaterial, number>;
7104
+ attenuationColor: IObjectAccessor<BABYLON.GLTF2.Loader.IMaterial, PBRMaterial, Color3>;
7105
+ attenuationDistance: IObjectAccessor<BABYLON.GLTF2.Loader.IMaterial, PBRMaterial, number>;
7106
+ thicknessTexture: {
7107
+ extensions: {
7108
+ KHR_texture_transform: ITextureDefinition;
7109
+ };
7110
+ };
7111
+ };
7112
+ };
7113
+ };
7114
+ }
7115
+ interface ITextureDefinition {
7116
+ offset: IObjectAccessor<BABYLON.GLTF2.Loader.IMaterial, PBRMaterial, Vector2>;
7117
+ rotation: IObjectAccessor<BABYLON.GLTF2.Loader.IMaterial, PBRMaterial, number>;
7118
+ scale: IObjectAccessor<BABYLON.GLTF2.Loader.IMaterial, PBRMaterial, Vector2>;
7119
+ }
7120
+ export interface IGLTFObjectModelTreeMeshesObject {
7121
+ }
7122
+ export interface IGLTFObjectModelTreeExtensionsObject {
7123
+ KHR_lights_punctual: {
7124
+ lights: {
7125
+ length: IObjectAccessor<BABYLON.GLTF2.Loader.IKHRLightsPunctual_Light[], Light[], number>;
7126
+ __array__: {
7127
+ __target__: boolean;
7128
+ color: IObjectAccessor<BABYLON.GLTF2.Loader.IKHRLightsPunctual_Light, Light, Color3>;
7129
+ intensity: IObjectAccessor<BABYLON.GLTF2.Loader.IKHRLightsPunctual_Light, Light, number>;
7130
+ range: IObjectAccessor<BABYLON.GLTF2.Loader.IKHRLightsPunctual_Light, Light, number>;
7131
+ spot: {
7132
+ innerConeAngle: IObjectAccessor<BABYLON.GLTF2.Loader.IKHRLightsPunctual_Light, Light, number>;
7133
+ outerConeAngle: IObjectAccessor<BABYLON.GLTF2.Loader.IKHRLightsPunctual_Light, Light, number>;
7134
+ };
7135
+ };
7136
+ };
7137
+ };
7138
+ EXT_lights_ies: {
7139
+ lights: {
7140
+ length: IObjectAccessor<BABYLON.GLTF2.Loader.IKHRLightsPunctual_Light[], Light[], number>;
7141
+ };
7142
+ };
7143
+ EXT_lights_image_based: {
7144
+ lights: {
7145
+ __array__: {
7146
+ __target__: boolean;
7147
+ intensity: IObjectAccessor<BABYLON.GLTF2.IEXTLightsImageBased_LightImageBased, BaseTexture, number>;
7148
+ rotation: IObjectAccessor<BABYLON.GLTF2.IEXTLightsImageBased_LightImageBased, BaseTexture, Quaternion>;
7149
+ };
7150
+ length: IObjectAccessor<BABYLON.GLTF2.IEXTLightsImageBased_LightImageBased[], BaseTexture[], number>;
7151
+ };
7152
+ };
6448
7153
  }
6449
-
6450
-
6451
-
6452
- }
6453
- declare module BABYLON {
6454
-
6455
-
6456
- }
6457
- declare module BABYLON.GLTF2.Loader.Extensions {
6458
- /**
6459
- * @internal
6460
- * Converts a glTF Interactivity Extension to a serialized flow graph.
6461
- * @param gltf the interactivity data
6462
- * @returns a serialized flow graph
7154
+ /**
7155
+ * get a path-to-object converter for the given glTF tree
7156
+ * @param gltf the glTF tree to use
7157
+ * @returns a path-to-object converter for the given glTF tree
7158
+ */
7159
+ export function GetPathToObjectConverter(gltf: BABYLON.GLTF2.Loader.IGLTF): BABYLON.GLTF2.Loader.Extensions.GLTFPathToObjectConverter<unknown, unknown, unknown>;
7160
+ /**
7161
+ * This function will return the object accessor for the given key in the object model
7162
+ * If the key is not found, it will return undefined
7163
+ * @param key the key to get the mapping for, for example /materials/\{\}/emissiveFactor
7164
+ * @returns an object accessor for the given key, or undefined if the key is not found
7165
+ */
7166
+ export function GetMappingForKey(key: string): IObjectAccessor | undefined;
7167
+ /**
7168
+ * Set interpolation for a specific key in the object model
7169
+ * @param key the key to set, for example /materials/\{\}/emissiveFactor
7170
+ * @param interpolation the interpolation elements array
7171
+ */
7172
+ export function SetInterpolationForKey(key: string, interpolation?: IInterpolationPropertyInfo[]): void;
7173
+ /**
7174
+ * This will ad a new object accessor in the object model at the given key.
7175
+ * 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)
7176
+ * @param key the key to add the object accessor at. For example /cameras/\{\}/perspective/aspectRatio
7177
+ * @param accessor the object accessor to add
6463
7178
  */
6464
- export function convertGLTFToSerializedFlowGraph(gltf: BABYLON.GLTF2.IKHRInteractivity): ISerializedFlowGraph;
7179
+ export function AddObjectAccessorToKey<GLTFTargetType = any, BabylonTargetType = any, BabylonValueType = any>(key: string, accessor: IObjectAccessor<GLTFTargetType, BabylonTargetType, BabylonValueType>): void;
6465
7180
 
6466
7181
 
6467
7182
 
@@ -6486,12 +7201,13 @@ declare module BABYLON.GLTF2.Loader.Extensions {
6486
7201
  * objects referenced in the glTF to be associated with their
6487
7202
  * respective Babylon.js objects.
6488
7203
  */
6489
- export class GLTFPathToObjectConverter<T> implements IPathToObjectConverter<T> {
7204
+ export class GLTFPathToObjectConverter<T, BabylonType, BabylonValue> implements IPathToObjectConverter<IObjectAccessor<T, BabylonType, BabylonValue>> {
6490
7205
  private _gltf;
6491
7206
  private _infoTree;
6492
7207
  constructor(_gltf: BABYLON.GLTF2.Loader.IGLTF, _infoTree: any);
6493
7208
  /**
6494
7209
  * The pointer string is represented by a [JSON pointer](https://datatracker.ietf.org/doc/html/rfc6901).
7210
+ * See also https://github.com/KhronosGroup/glTF/blob/main/specification/2.0/ObjectModel.adoc#core-pointers
6495
7211
  * <animationPointer> := /<rootNode>/<assetIndex>/<propertyPath>
6496
7212
  * <rootNode> := "nodes" | "materials" | "meshes" | "cameras" | "extensions"
6497
7213
  * <assetIndex> := <digit> | <name>
@@ -6503,6 +7219,7 @@ declare module BABYLON.GLTF2.Loader.Extensions {
6503
7219
  *
6504
7220
  * Examples:
6505
7221
  * - "/nodes/0/rotation"
7222
+ * - "/nodes.length"
6506
7223
  * - "/materials/2/emissiveFactor"
6507
7224
  * - "/materials/2/pbrMetallicRoughness/baseColorFactor"
6508
7225
  * - "/materials/2/extensions/KHR_materials_emissive_strength/emissiveStrength"
@@ -6510,7 +7227,7 @@ declare module BABYLON.GLTF2.Loader.Extensions {
6510
7227
  * @param path The path to convert
6511
7228
  * @returns The object and info associated with the path
6512
7229
  */
6513
- convert(path: string): IObjectInfo<T>;
7230
+ convert(path: string): IObjectInfo<IObjectAccessor<T, BabylonType, BabylonValue>>;
6514
7231
  }
6515
7232
 
6516
7233
 
@@ -6893,6 +7610,40 @@ declare module BABYLON {
6893
7610
  ["KHR_node_visibility"]: {};
6894
7611
  }
6895
7612
 
7613
+ }
7614
+ declare module BABYLON.GLTF2.Loader.Extensions {
7615
+ /**
7616
+ * Loader extension for KHR_selectability
7617
+ */
7618
+ export class KHR_node_selectability implements BABYLON.GLTF2.IGLTFLoaderExtension {
7619
+ /**
7620
+ * The name of this extension.
7621
+ */
7622
+ readonly name = "KHR_node_selectability";
7623
+ /**
7624
+ * Defines whether this extension is enabled.
7625
+ */
7626
+ enabled: boolean;
7627
+ private _loader;
7628
+ /**
7629
+ * @internal
7630
+ */
7631
+ constructor(loader: BABYLON.GLTF2.GLTFLoader);
7632
+ onReady(): Promise<void>;
7633
+ dispose(): void;
7634
+ }
7635
+
7636
+
7637
+
7638
+ }
7639
+ declare module BABYLON {
7640
+ interface GLTFLoaderExtensionOptions {
7641
+ /**
7642
+ * Defines options for the KHR_selectability extension.
7643
+ */
7644
+ ["KHR_node_selectability"]: {};
7645
+ }
7646
+
6896
7647
  }
6897
7648
  declare module BABYLON.GLTF2.Loader.Extensions {
6898
7649
  /**
@@ -7699,8 +8450,13 @@ declare module BABYLON.GLTF2.Loader.Extensions {
7699
8450
  */
7700
8451
  constructor(_loader: BABYLON.GLTF2.GLTFLoader);
7701
8452
  dispose(): void;
7702
- onReady(): void;
8453
+ onReady(): Promise<void>;
7703
8454
  }
8455
+ /**
8456
+ * @internal
8457
+ * populates the object model with the interactivity extension
8458
+ */
8459
+ export function _AddInteractivityObjectModel(scene: Scene): void;
7704
8460
 
7705
8461
 
7706
8462
 
@@ -7761,302 +8517,7 @@ declare module BABYLON {
7761
8517
 
7762
8518
  }
7763
8519
  declare module BABYLON.GLTF2.Loader.Extensions {
7764
- class CameraAnimationPropertyInfo extends BABYLON.GLTF2.AnimationPropertyInfo {
7765
- /** @internal */
7766
- buildAnimations(target: BABYLON.GLTF2.Loader.ICamera, name: string, fps: number, keys: any[], callback: (babylonAnimatable: IAnimatable, babylonAnimation: Animation) => void): void;
7767
- }
7768
- class MaterialAnimationPropertyInfo extends BABYLON.GLTF2.AnimationPropertyInfo {
7769
- /** @internal */
7770
- buildAnimations(target: BABYLON.GLTF2.Loader.IMaterial, name: string, fps: number, keys: any[], callback: (babylonAnimatable: IAnimatable, babylonAnimation: Animation) => void): void;
7771
- }
7772
- class LightAnimationPropertyInfo extends BABYLON.GLTF2.AnimationPropertyInfo {
7773
- /** @internal */
7774
- buildAnimations(target: BABYLON.GLTF2.Loader.IKHRLightsPunctual_Light, name: string, fps: number, keys: any[], callback: (babylonAnimatable: IAnimatable, babylonAnimation: Animation) => void): void;
7775
- }
7776
- /** @internal */
7777
- export var animationPointerTree: {
7778
- nodes: {
7779
- __array__: {
7780
- translation: TransformNodeAnimationPropertyInfo[];
7781
- rotation: TransformNodeAnimationPropertyInfo[];
7782
- scale: TransformNodeAnimationPropertyInfo[];
7783
- weights: WeightAnimationPropertyInfo[];
7784
- __target__: boolean;
7785
- };
7786
- };
7787
- materials: {
7788
- __array__: {
7789
- __target__: boolean;
7790
- pbrMetallicRoughness: {
7791
- baseColorFactor: MaterialAnimationPropertyInfo[];
7792
- metallicFactor: MaterialAnimationPropertyInfo[];
7793
- roughnessFactor: MaterialAnimationPropertyInfo[];
7794
- baseColorTexture: {
7795
- extensions: {
7796
- KHR_texture_transform: {
7797
- scale: MaterialAnimationPropertyInfo[];
7798
- offset: MaterialAnimationPropertyInfo[];
7799
- rotation: MaterialAnimationPropertyInfo[];
7800
- };
7801
- };
7802
- };
7803
- metallicRoughnessTexture: {
7804
- extensions: {
7805
- KHR_texture_transform: {
7806
- scale: MaterialAnimationPropertyInfo[];
7807
- offset: MaterialAnimationPropertyInfo[];
7808
- rotation: MaterialAnimationPropertyInfo[];
7809
- };
7810
- };
7811
- };
7812
- };
7813
- emissiveFactor: MaterialAnimationPropertyInfo[];
7814
- normalTexture: {
7815
- scale: MaterialAnimationPropertyInfo[];
7816
- extensions: {
7817
- KHR_texture_transform: {
7818
- scale: MaterialAnimationPropertyInfo[];
7819
- offset: MaterialAnimationPropertyInfo[];
7820
- rotation: MaterialAnimationPropertyInfo[];
7821
- };
7822
- };
7823
- };
7824
- occlusionTexture: {
7825
- strength: MaterialAnimationPropertyInfo[];
7826
- extensions: {
7827
- KHR_texture_transform: {
7828
- scale: MaterialAnimationPropertyInfo[];
7829
- offset: MaterialAnimationPropertyInfo[];
7830
- rotation: MaterialAnimationPropertyInfo[];
7831
- };
7832
- };
7833
- };
7834
- emissiveTexture: {
7835
- extensions: {
7836
- KHR_texture_transform: {
7837
- scale: MaterialAnimationPropertyInfo[];
7838
- offset: MaterialAnimationPropertyInfo[];
7839
- rotation: MaterialAnimationPropertyInfo[];
7840
- };
7841
- };
7842
- };
7843
- extensions: {
7844
- KHR_materials_anisotropy: {
7845
- anisotropyStrength: MaterialAnimationPropertyInfo[];
7846
- anisotropyRotation: MaterialAnimationPropertyInfo[];
7847
- anisotropyTexture: {
7848
- extensions: {
7849
- KHR_texture_transform: {
7850
- scale: MaterialAnimationPropertyInfo[];
7851
- offset: MaterialAnimationPropertyInfo[];
7852
- rotation: MaterialAnimationPropertyInfo[];
7853
- };
7854
- };
7855
- };
7856
- };
7857
- KHR_materials_clearcoat: {
7858
- clearcoatFactor: MaterialAnimationPropertyInfo[];
7859
- clearcoatRoughnessFactor: MaterialAnimationPropertyInfo[];
7860
- clearcoatTexture: {
7861
- extensions: {
7862
- KHR_texture_transform: {
7863
- scale: MaterialAnimationPropertyInfo[];
7864
- offset: MaterialAnimationPropertyInfo[];
7865
- rotation: MaterialAnimationPropertyInfo[];
7866
- };
7867
- };
7868
- };
7869
- clearcoatNormalTexture: {
7870
- scale: MaterialAnimationPropertyInfo[];
7871
- extensions: {
7872
- KHR_texture_transform: {
7873
- scale: MaterialAnimationPropertyInfo[];
7874
- offset: MaterialAnimationPropertyInfo[];
7875
- rotation: MaterialAnimationPropertyInfo[];
7876
- };
7877
- };
7878
- };
7879
- clearcoatRoughnessTexture: {
7880
- extensions: {
7881
- KHR_texture_transform: {
7882
- scale: MaterialAnimationPropertyInfo[];
7883
- offset: MaterialAnimationPropertyInfo[];
7884
- rotation: MaterialAnimationPropertyInfo[];
7885
- };
7886
- };
7887
- };
7888
- };
7889
- KHR_materials_dispersion: {
7890
- dispersion: MaterialAnimationPropertyInfo[];
7891
- };
7892
- KHR_materials_emissive_strength: {
7893
- emissiveStrength: MaterialAnimationPropertyInfo[];
7894
- };
7895
- KHR_materials_ior: {
7896
- ior: MaterialAnimationPropertyInfo[];
7897
- };
7898
- KHR_materials_iridescence: {
7899
- iridescenceFactor: MaterialAnimationPropertyInfo[];
7900
- iridescenceIor: MaterialAnimationPropertyInfo[];
7901
- iridescenceThicknessMinimum: MaterialAnimationPropertyInfo[];
7902
- iridescenceThicknessMaximum: MaterialAnimationPropertyInfo[];
7903
- iridescenceTexture: {
7904
- extensions: {
7905
- KHR_texture_transform: {
7906
- scale: MaterialAnimationPropertyInfo[];
7907
- offset: MaterialAnimationPropertyInfo[];
7908
- rotation: MaterialAnimationPropertyInfo[];
7909
- };
7910
- };
7911
- };
7912
- iridescenceThicknessTexture: {
7913
- extensions: {
7914
- KHR_texture_transform: {
7915
- scale: MaterialAnimationPropertyInfo[];
7916
- offset: MaterialAnimationPropertyInfo[];
7917
- rotation: MaterialAnimationPropertyInfo[];
7918
- };
7919
- };
7920
- };
7921
- };
7922
- KHR_materials_sheen: {
7923
- sheenColorFactor: MaterialAnimationPropertyInfo[];
7924
- sheenRoughnessFactor: MaterialAnimationPropertyInfo[];
7925
- sheenColorTexture: {
7926
- extensions: {
7927
- KHR_texture_transform: {
7928
- scale: MaterialAnimationPropertyInfo[];
7929
- offset: MaterialAnimationPropertyInfo[];
7930
- rotation: MaterialAnimationPropertyInfo[];
7931
- };
7932
- };
7933
- };
7934
- sheenRoughnessTexture: {
7935
- extensions: {
7936
- KHR_texture_transform: {
7937
- scale: MaterialAnimationPropertyInfo[];
7938
- offset: MaterialAnimationPropertyInfo[];
7939
- rotation: MaterialAnimationPropertyInfo[];
7940
- };
7941
- };
7942
- };
7943
- };
7944
- KHR_materials_specular: {
7945
- specularFactor: MaterialAnimationPropertyInfo[];
7946
- specularColorFactor: MaterialAnimationPropertyInfo[];
7947
- specularTexture: {
7948
- extensions: {
7949
- KHR_texture_transform: {
7950
- scale: MaterialAnimationPropertyInfo[];
7951
- offset: MaterialAnimationPropertyInfo[];
7952
- rotation: MaterialAnimationPropertyInfo[];
7953
- };
7954
- };
7955
- };
7956
- specularColorTexture: {
7957
- extensions: {
7958
- KHR_texture_transform: {
7959
- scale: MaterialAnimationPropertyInfo[];
7960
- offset: MaterialAnimationPropertyInfo[];
7961
- rotation: MaterialAnimationPropertyInfo[];
7962
- };
7963
- };
7964
- };
7965
- };
7966
- KHR_materials_transmission: {
7967
- transmissionFactor: MaterialAnimationPropertyInfo[];
7968
- transmissionTexture: {
7969
- extensions: {
7970
- KHR_texture_transform: {
7971
- scale: MaterialAnimationPropertyInfo[];
7972
- offset: MaterialAnimationPropertyInfo[];
7973
- rotation: MaterialAnimationPropertyInfo[];
7974
- };
7975
- };
7976
- };
7977
- };
7978
- KHR_materials_volume: {
7979
- attenuationColor: MaterialAnimationPropertyInfo[];
7980
- attenuationDistance: MaterialAnimationPropertyInfo[];
7981
- thicknessFactor: MaterialAnimationPropertyInfo[];
7982
- thicknessTexture: {
7983
- extensions: {
7984
- KHR_texture_transform: {
7985
- scale: MaterialAnimationPropertyInfo[];
7986
- offset: MaterialAnimationPropertyInfo[];
7987
- rotation: MaterialAnimationPropertyInfo[];
7988
- };
7989
- };
7990
- };
7991
- };
7992
- KHR_materials_diffuse_transmission: {
7993
- diffuseTransmissionFactor: MaterialAnimationPropertyInfo[];
7994
- diffuseTransmissionTexture: {
7995
- extensions: {
7996
- KHR_texture_transform: {
7997
- scale: MaterialAnimationPropertyInfo[];
7998
- offset: MaterialAnimationPropertyInfo[];
7999
- rotation: MaterialAnimationPropertyInfo[];
8000
- };
8001
- };
8002
- };
8003
- diffuseTransmissionColorFactor: MaterialAnimationPropertyInfo[];
8004
- diffuseTransmissionColorTexture: {
8005
- extensions: {
8006
- KHR_texture_transform: {
8007
- scale: MaterialAnimationPropertyInfo[];
8008
- offset: MaterialAnimationPropertyInfo[];
8009
- rotation: MaterialAnimationPropertyInfo[];
8010
- };
8011
- };
8012
- };
8013
- };
8014
- };
8015
- };
8016
- };
8017
- cameras: {
8018
- __array__: {
8019
- __target__: boolean;
8020
- orthographic: {
8021
- xmag: CameraAnimationPropertyInfo[];
8022
- ymag: CameraAnimationPropertyInfo[];
8023
- zfar: CameraAnimationPropertyInfo[];
8024
- znear: CameraAnimationPropertyInfo[];
8025
- };
8026
- perspective: {
8027
- yfov: CameraAnimationPropertyInfo[];
8028
- zfar: CameraAnimationPropertyInfo[];
8029
- znear: CameraAnimationPropertyInfo[];
8030
- };
8031
- };
8032
- };
8033
- extensions: {
8034
- KHR_lights_punctual: {
8035
- lights: {
8036
- __array__: {
8037
- __target__: boolean;
8038
- color: LightAnimationPropertyInfo[];
8039
- intensity: LightAnimationPropertyInfo[];
8040
- range: LightAnimationPropertyInfo[];
8041
- spot: {
8042
- innerConeAngle: LightAnimationPropertyInfo[];
8043
- outerConeAngle: LightAnimationPropertyInfo[];
8044
- };
8045
- };
8046
- };
8047
- };
8048
- EXT_lights_ies: {
8049
- lights: {
8050
- __array__: {
8051
- __target__: boolean;
8052
- color: LightAnimationPropertyInfo[];
8053
- multiplier: LightAnimationPropertyInfo[];
8054
- };
8055
- };
8056
- };
8057
- };
8058
- };
8059
-
8520
+
8060
8521
 
8061
8522
 
8062
8523
  }
@@ -8394,6 +8855,460 @@ declare module BABYLON {
8394
8855
  ["EXT_lights_ies"]: {};
8395
8856
  }
8396
8857
 
8858
+ }
8859
+ declare module BABYLON.GLTF2.Loader.Extensions {
8860
+ export interface InteractivityEvent {
8861
+ eventId: string;
8862
+ eventData?: {
8863
+ eventData: boolean;
8864
+ id: string;
8865
+ type: string;
8866
+ value?: any;
8867
+ }[];
8868
+ }
8869
+ export var gltfTypeToBabylonType: {
8870
+ [key: string]: {
8871
+ length: number;
8872
+ flowGraphType: FlowGraphTypes;
8873
+ elementType: "number" | "boolean";
8874
+ };
8875
+ };
8876
+ export class InteractivityGraphToFlowGraphParser {
8877
+ private _interactivityGraph;
8878
+ private _gltf;
8879
+ _loader: BABYLON.GLTF2.GLTFLoader;
8880
+ /**
8881
+ * Note - the graph should be rejected if the same type is defined twice.
8882
+ * We currently don't validate that.
8883
+ */
8884
+ private _types;
8885
+ private _mappings;
8886
+ private _staticVariables;
8887
+ private _events;
8888
+ private _internalEventsCounter;
8889
+ private _nodes;
8890
+ constructor(_interactivityGraph: BABYLON.GLTF2.IKHRInteractivity_Graph, _gltf: BABYLON.GLTF2.Loader.IGLTF, _loader: BABYLON.GLTF2.GLTFLoader);
8891
+ get arrays(): {
8892
+ types: {
8893
+ length: number;
8894
+ flowGraphType: FlowGraphTypes;
8895
+ elementType: "number" | "boolean";
8896
+ }[];
8897
+ mappings: {
8898
+ flowGraphMapping: BABYLON.GLTF2.Loader.Extensions.IGLTFToFlowGraphMapping;
8899
+ fullOperationName: string;
8900
+ }[];
8901
+ staticVariables: {
8902
+ type: FlowGraphTypes;
8903
+ value: any[];
8904
+ }[];
8905
+ events: InteractivityEvent[];
8906
+ nodes: {
8907
+ blocks: ISerializedFlowGraphBlock[];
8908
+ fullOperationName: string;
8909
+ }[];
8910
+ };
8911
+ private _parseTypes;
8912
+ private _parseDeclarations;
8913
+ private _parseVariables;
8914
+ private _parseVariable;
8915
+ private _parseEvents;
8916
+ private _parseNodes;
8917
+ private _getEmptyBlock;
8918
+ private _parseNodeConfiguration;
8919
+ private _parseNodeConnections;
8920
+ private _createNewSocketConnection;
8921
+ private _connectFlowGraphNodes;
8922
+ getVariableName(index: number): string;
8923
+ serializeToFlowGraph(): ISerializedFlowGraph;
8924
+ }
8925
+
8926
+
8927
+
8928
+ }
8929
+ declare module BABYLON {
8930
+
8931
+
8932
+ }
8933
+ declare module BABYLON.GLTF2.Loader.Extensions {
8934
+
8935
+
8936
+
8937
+ }
8938
+ declare module BABYLON {
8939
+
8940
+
8941
+ }
8942
+ declare module BABYLON.GLTF2.Loader.Extensions {
8943
+ /**
8944
+ * a configuration interface for this block
8945
+ */
8946
+ export interface IFlowGraphGLTFDataProviderBlockConfiguration extends IFlowGraphBlockConfiguration {
8947
+ /**
8948
+ * the glTF object to provide data from
8949
+ */
8950
+ glTF: BABYLON.GLTF2.Loader.IGLTF;
8951
+ }
8952
+ /**
8953
+ * a glTF-based FlowGraph block that provides arrays with babylon object, based on the glTF tree
8954
+ * Can be used, for example, to get animation index from a glTF animation
8955
+ */
8956
+ export class FlowGraphGLTFDataProvider extends FlowGraphBlock {
8957
+ /**
8958
+ * Output: an array of animation groups
8959
+ * Corresponds directly to the glTF animations array
8960
+ */
8961
+ readonly animationGroups: FlowGraphDataConnection<AnimationGroup[]>;
8962
+ /**
8963
+ * Output an array of (Transform) nodes
8964
+ * Corresponds directly to the glTF nodes array
8965
+ */
8966
+ readonly nodes: FlowGraphDataConnection<TransformNode[]>;
8967
+ constructor(config: IFlowGraphGLTFDataProviderBlockConfiguration);
8968
+ getClassName(): string;
8969
+ }
8970
+
8971
+
8972
+
8973
+ }
8974
+ declare module BABYLON {
8975
+
8976
+
8977
+ }
8978
+ declare module BABYLON.GLTF2.Loader.Extensions {
8979
+ interface IGLTFToFlowGraphMappingObject<I = any, O = any> {
8980
+ /**
8981
+ * The name of the property in the FlowGraph block.
8982
+ */
8983
+ name: string;
8984
+ /**
8985
+ * The type of the property in the glTF specs.
8986
+ * If not provided will be inferred.
8987
+ */
8988
+ gltfType?: string;
8989
+ /**
8990
+ * The type of the property in the FlowGraph block.
8991
+ * If not defined it equals the glTF type.
8992
+ */
8993
+ flowGraphType?: string;
8994
+ /**
8995
+ * A function that transforms the data from the glTF to the FlowGraph block.
8996
+ */
8997
+ dataTransformer?: (data: I[], parser: BABYLON.GLTF2.Loader.Extensions.InteractivityGraphToFlowGraphParser) => O[];
8998
+ /**
8999
+ * If the property is in the options passed to the constructor of the block.
9000
+ */
9001
+ inOptions?: boolean;
9002
+ /**
9003
+ * If the property is a pointer to a value.
9004
+ * This will add an extra JsonPointerParser block to the graph.
9005
+ */
9006
+ isPointer?: boolean;
9007
+ /**
9008
+ * If the property is an index to a value.
9009
+ * if defined this will be the name of the array to find the object in.
9010
+ */
9011
+ isVariable?: boolean;
9012
+ /**
9013
+ * the name of the class type this value will be mapped to.
9014
+ * This is used if we generate more than one block for a single glTF node.
9015
+ * Defaults to the first block in the mapping.
9016
+ */
9017
+ toBlock?: FlowGraphBlockNames;
9018
+ /**
9019
+ * Used in configuration values. If defined, this will be the default value, if no value is provided.
9020
+ */
9021
+ defaultValue?: O;
9022
+ }
9023
+ export interface IGLTFToFlowGraphMapping {
9024
+ /**
9025
+ * The type of the FlowGraph block(s).
9026
+ * Typically will be a single element in an array.
9027
+ * When adding blocks defined in this module use the KHR_interactivity prefix.
9028
+ */
9029
+ blocks: (FlowGraphBlockNames | string)[];
9030
+ /**
9031
+ * The inputs of the glTF node mapped to the FlowGraph block.
9032
+ */
9033
+ inputs?: {
9034
+ /**
9035
+ * The value inputs of the glTF node mapped to the FlowGraph block.
9036
+ */
9037
+ values?: {
9038
+ [originName: string]: IGLTFToFlowGraphMappingObject;
9039
+ };
9040
+ /**
9041
+ * The flow inputs of the glTF node mapped to the FlowGraph block.
9042
+ */
9043
+ flows?: {
9044
+ [originName: string]: IGLTFToFlowGraphMappingObject;
9045
+ };
9046
+ };
9047
+ /**
9048
+ * The outputs of the glTF node mapped to the FlowGraph block.
9049
+ */
9050
+ outputs?: {
9051
+ /**
9052
+ * The value outputs of the glTF node mapped to the FlowGraph block.
9053
+ */
9054
+ values?: {
9055
+ [originName: string]: IGLTFToFlowGraphMappingObject;
9056
+ };
9057
+ /**
9058
+ * The flow outputs of the glTF node mapped to the FlowGraph block.
9059
+ */
9060
+ flows?: {
9061
+ [originName: string]: IGLTFToFlowGraphMappingObject;
9062
+ };
9063
+ };
9064
+ /**
9065
+ * The configuration of the glTF node mapped to the FlowGraph block.
9066
+ * This information is usually passed to the constructor of the block.
9067
+ */
9068
+ configuration?: {
9069
+ [originName: string]: IGLTFToFlowGraphMappingObject;
9070
+ };
9071
+ /**
9072
+ * If we generate more than one block for a single glTF node, this mapping will be used to map
9073
+ * between the flowGraph classes.
9074
+ */
9075
+ typeToTypeMapping?: {
9076
+ [originName: string]: IGLTFToFlowGraphMappingObject;
9077
+ };
9078
+ /**
9079
+ * The connections between two or more blocks.
9080
+ * This is used to connect the blocks in the graph
9081
+ */
9082
+ interBlockConnectors?: {
9083
+ /**
9084
+ * The name of the input connection in the first block.
9085
+ */
9086
+ input: string;
9087
+ /**
9088
+ * The name of the output connection in the second block.
9089
+ */
9090
+ output: string;
9091
+ /**
9092
+ * The index of the block in the array of blocks that corresponds to the input.
9093
+ */
9094
+ inputBlockIndex: number;
9095
+ /**
9096
+ * The index of the block in the array of blocks that corresponds to the output.
9097
+ */
9098
+ outputBlockIndex: number;
9099
+ /**
9100
+ * If the connection is a variable connection or a flow connection.
9101
+ */
9102
+ isVariable?: boolean;
9103
+ }[];
9104
+ /**
9105
+ * This optional function will allow to validate the node, according to the glTF specs.
9106
+ * For example, if a node has a configuration object, it must be present and correct.
9107
+ * This is a basic node-based validation.
9108
+ * This function is expected to return false and log the error if the node is not valid.
9109
+ * Note that this function can also modify the node, if needed.
9110
+ *
9111
+ * @param gltfBlock the glTF node to validate
9112
+ * @param glTFObject the glTF object
9113
+ * @returns true if validated, false if not.
9114
+ */
9115
+ validation?: (gltfBlock: BABYLON.GLTF2.IKHRInteractivity_Node, interactivityGraph: BABYLON.GLTF2.IKHRInteractivity_Graph, glTFObject?: BABYLON.GLTF2.Loader.IGLTF) => boolean;
9116
+ /**
9117
+ * This is used if we need extra information for the constructor/options that is not provided directly by the glTF node.
9118
+ * This function can return more than one node, if extra nodes are needed for this block to function correctly.
9119
+ * Returning more than one block will usually happen when a json pointer was provided.
9120
+ *
9121
+ * @param gltfBlock the glTF node
9122
+ * @param mapping the mapping object
9123
+ * @param arrays the arrays of the interactivity object
9124
+ * @param serializedObjects the serialized object
9125
+ * @returns an array of serialized nodes that will be added to the graph.
9126
+ */
9127
+ 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[];
9128
+ }
9129
+ export function getMappingForFullOperationName(fullOperationName: string): IGLTFToFlowGraphMapping | undefined;
9130
+ export function getMappingForDeclaration(declaration: BABYLON.GLTF2.IKHRInteractivity_Declaration, returnNoOpIfNotAvailable?: boolean): IGLTFToFlowGraphMapping | undefined;
9131
+ /**
9132
+ * This function will add new mapping to glTF interactivity.
9133
+ * Other extensions can define new types of blocks, this is the way to let interactivity know how to parse them.
9134
+ * @param key the type of node, i.e. "variable/get"
9135
+ * @param extension the extension of the interactivity operation, i.e. "KHR_selectability"
9136
+ * @param mapping The mapping object. See documentation or examples below.
9137
+ */
9138
+ export function addNewInteractivityFlowGraphMapping(key: string, extension: string, mapping: IGLTFToFlowGraphMapping): void;
9139
+ export function getAllSupportedNativeNodeTypes(): string[];
9140
+ /**
9141
+ *
9142
+ * These are the nodes from the specs:
9143
+ ### Math Nodes
9144
+ 1. **Constants**
9145
+ - E (`math/e`) FlowGraphBlockNames.E
9146
+ - Pi (`math/pi`) FlowGraphBlockNames.PI
9147
+ - Infinity (`math/inf`) FlowGraphBlockNames.Inf
9148
+ - Not a Number (`math/nan`) FlowGraphBlockNames.NaN
9149
+ 2. **Arithmetic Nodes**
9150
+ - Absolute Value (`math/abs`) FlowGraphBlockNames.Abs
9151
+ - Sign (`math/sign`) FlowGraphBlockNames.Sign
9152
+ - Truncate (`math/trunc`) FlowGraphBlockNames.Trunc
9153
+ - Floor (`math/floor`) FlowGraphBlockNames.Floor
9154
+ - Ceil (`math/ceil`) FlowGraphBlockNames.Ceil
9155
+ - Round (`math/round`) FlowGraphBlockNames.Round
9156
+ - Fraction (`math/fract`) FlowGraphBlockNames.Fract
9157
+ - Negation (`math/neg`) FlowGraphBlockNames.Negation
9158
+ - Addition (`math/add`) FlowGraphBlockNames.Add
9159
+ - Subtraction (`math/sub`) FlowGraphBlockNames.Subtract
9160
+ - Multiplication (`math/mul`) FlowGraphBlockNames.Multiply
9161
+ - Division (`math/div`) FlowGraphBlockNames.Divide
9162
+ - Remainder (`math/rem`) FlowGraphBlockNames.Modulo
9163
+ - Minimum (`math/min`) FlowGraphBlockNames.Min
9164
+ - Maximum (`math/max`) FlowGraphBlockNames.Max
9165
+ - Clamp (`math/clamp`) FlowGraphBlockNames.Clamp
9166
+ - Saturate (`math/saturate`) FlowGraphBlockNames.Saturate
9167
+ - Interpolate (`math/mix`) FlowGraphBlockNames.MathInterpolation
9168
+ 3. **Comparison Nodes**
9169
+ - Equality (`math/eq`) FlowGraphBlockNames.Equality
9170
+ - Less Than (`math/lt`) FlowGraphBlockNames.LessThan
9171
+ - Less Than Or Equal To (`math/le`) FlowGraphBlockNames.LessThanOrEqual
9172
+ - Greater Than (`math/gt`) FlowGraphBlockNames.GreaterThan
9173
+ - Greater Than Or Equal To (`math/ge`) FlowGraphBlockNames.GreaterThanOrEqual
9174
+ 4. **Special Nodes**
9175
+ - Is Not a Number (`math/isnan`) FlowGraphBlockNames.IsNaN
9176
+ - Is Infinity (`math/isinf`) FlowGraphBlockNames.IsInfinity
9177
+ - Select (`math/select`) FlowGraphBlockNames.Conditional
9178
+ - Random (`math/random`) FlowGraphBlockNames.Random
9179
+ 5. **Angle and Trigonometry Nodes**
9180
+ - Degrees-To-Radians (`math/rad`) FlowGraphBlockNames.DegToRad
9181
+ - Radians-To-Degrees (`math/deg`) FlowGraphBlockNames.RadToDeg
9182
+ - Sine (`math/sin`) FlowGraphBlockNames.Sin
9183
+ - Cosine (`math/cos`) FlowGraphBlockNames.Cos
9184
+ - Tangent (`math/tan`) FlowGraphBlockNames.Tan
9185
+ - Arcsine (`math/asin`) FlowGraphBlockNames.Asin
9186
+ - Arccosine (`math/acos`) FlowGraphBlockNames.Acos
9187
+ - Arctangent (`math/atan`) FlowGraphBlockNames.Atan
9188
+ - Arctangent 2 (`math/atan2`) FlowGraphBlockNames.Atan2
9189
+ 6. **Hyperbolic Nodes**
9190
+ - Hyperbolic Sine (`math/sinh`) FlowGraphBlockNames.Sinh
9191
+ - Hyperbolic Cosine (`math/cosh`) FlowGraphBlockNames.Cosh
9192
+ - Hyperbolic Tangent (`math/tanh`) FlowGraphBlockNames.Tanh
9193
+ - Inverse Hyperbolic Sine (`math/asinh`) FlowGraphBlockNames.Asinh
9194
+ - Inverse Hyperbolic Cosine (`math/acosh`) FlowGraphBlockNames.Acosh
9195
+ - Inverse Hyperbolic Tangent (`math/atanh`) FlowGraphBlockNames.Atanh
9196
+ 7. **Exponential Nodes**
9197
+ - Exponent (`math/exp`) FlowGraphBlockNames.Exponential
9198
+ - Natural Logarithm (`math/log`) FlowGraphBlockNames.Log
9199
+ - Base-2 Logarithm (`math/log2`) FlowGraphBlockNames.Log2
9200
+ - Base-10 Logarithm (`math/log10`) FlowGraphBlockNames.Log10
9201
+ - Square Root (`math/sqrt`) FlowGraphBlockNames.SquareRoot
9202
+ - Cube Root (`math/cbrt`) FlowGraphBlockNames.CubeRoot
9203
+ - Power (`math/pow`) FlowGraphBlockNames.Power
9204
+ 8. **Vector Nodes**
9205
+ - Length (`math/length`) FlowGraphBlockNames.Length
9206
+ - Normalize (`math/normalize`) FlowGraphBlockNames.Normalize
9207
+ - Dot Product (`math/dot`) FlowGraphBlockNames.Dot
9208
+ - Cross Product (`math/cross`) FlowGraphBlockNames.Cross
9209
+ - Rotate 2D (`math/rotate2d`) FlowGraphBlockNames.Rotate2D
9210
+ - Rotate 3D (`math/rotate3d`) FlowGraphBlockNames.Rotate3D
9211
+ - Transform (`math/transform`) FlowGraphBlockNames.TransformVector
9212
+ 9. **Matrix Nodes**
9213
+ - Transpose (`math/transpose`) FlowGraphBlockNames.Transpose
9214
+ - Determinant (`math/determinant`) FlowGraphBlockNames.Determinant
9215
+ - Inverse (`math/inverse`) FlowGraphBlockNames.InvertMatrix
9216
+ - Multiplication (`math/matmul`) FlowGraphBlockNames.MatrixMultiplication
9217
+ 10. **Swizzle Nodes**
9218
+ - Combine (`math/combine2`, `math/combine3`, `math/combine4`, `math/combine2x2`, `math/combine3x3`, `math/combine4x4`)
9219
+ FlowGraphBlockNames.CombineVector2, FlowGraphBlockNames.CombineVector3, FlowGraphBlockNames.CombineVector4
9220
+ FlowGraphBlockNames.CombineMatrix2D, FlowGraphBlockNames.CombineMatrix3D, FlowGraphBlockNames.CombineMatrix
9221
+ - Extract (`math/extract2`, `math/extract3`, `math/extract4`, `math/extract2x2`, `math/extract3x3`, `math/extract4x4`)
9222
+ FlowGraphBlockNames.ExtractVector2, FlowGraphBlockNames.ExtractVector3, FlowGraphBlockNames.ExtractVector4
9223
+ FlowGraphBlockNames.ExtractMatrix2D, FlowGraphBlockNames.ExtractMatrix3D, FlowGraphBlockNames.ExtractMatrix
9224
+ 11. **Integer Arithmetic Nodes**
9225
+ - Absolute Value (`math/abs`) FlowGraphBlockNames.Abs
9226
+ - Sign (`math/sign`) FlowGraphBlockNames.Sign
9227
+ - Negation (`math/neg`) FlowGraphBlockNames.Negation
9228
+ - Addition (`math/add`) FlowGraphBlockNames.Add
9229
+ - Subtraction (`math/sub`) FlowGraphBlockNames.Subtract
9230
+ - Multiplication (`math/mul`) FlowGraphBlockNames.Multiply
9231
+ - Division (`math/div`) FlowGraphBlockNames.Divide
9232
+ - Remainder (`math/rem`) FlowGraphBlockNames.Modulo
9233
+ - Minimum (`math/min`) FlowGraphBlockNames.Min
9234
+ - Maximum (`math/max`) FlowGraphBlockNames.Max
9235
+ - Clamp (`math/clamp`) FlowGraphBlockNames.Clamp
9236
+ 12. **Integer Comparison Nodes**
9237
+ - Equality (`math/eq`) FlowGraphBlockNames.Equality
9238
+ - Less Than (`math/lt`) FlowGraphBlockNames.LessThan
9239
+ - Less Than Or Equal To (`math/le`) FlowGraphBlockNames.LessThanOrEqual
9240
+ - Greater Than (`math/gt`) FlowGraphBlockNames.GreaterThan
9241
+ - Greater Than Or Equal To (`math/ge`) FlowGraphBlockNames.GreaterThanOrEqual
9242
+ 13. **Integer Bitwise Nodes**
9243
+ - Bitwise NOT (`math/not`) FlowGraphBlockNames.BitwiseNot
9244
+ - Bitwise AND (`math/and`) FlowGraphBlockNames.BitwiseAnd
9245
+ - Bitwise OR (`math/or`) FlowGraphBlockNames.BitwiseOr
9246
+ - Bitwise XOR (`math/xor`) FlowGraphBlockNames.BitwiseXor
9247
+ - Right Shift (`math/asr`) FlowGraphBlockNames.BitwiseRightShift
9248
+ - Left Shift (`math/lsl`) FlowGraphBlockNames.BitwiseLeftShift
9249
+ - Count Leading Zeros (`math/clz`) FlowGraphBlockNames.LeadingZeros
9250
+ - Count Trailing Zeros (`math/ctz`) FlowGraphBlockNames.TrailingZeros
9251
+ - Count One Bits (`math/popcnt`) FlowGraphBlockNames.OneBitsCounter
9252
+ 14. **Boolean Arithmetic Nodes**
9253
+ - Equality (`math/eq`) FlowGraphBlockNames.Equality
9254
+ - Boolean NOT (`math/not`) FlowGraphBlockNames.BitwiseNot
9255
+ - Boolean AND (`math/and`) FlowGraphBlockNames.BitwiseAnd
9256
+ - Boolean OR (`math/or`) FlowGraphBlockNames.BitwiseOr
9257
+ - Boolean XOR (`math/xor`) FlowGraphBlockNames.BitwiseXor
9258
+ ### Type Conversion Nodes
9259
+ 1. **Boolean Conversion Nodes**
9260
+ - Boolean to Integer (`type/boolToInt`) FlowGraphBlockNames.BooleanToInt
9261
+ - Boolean to Float (`type/boolToFloat`) FlowGraphBlockNames.BooleanToFloat
9262
+ 2. **Integer Conversion Nodes**
9263
+ - Integer to Boolean (`type/intToBool`) FlowGraphBlockNames.IntToBoolean
9264
+ - Integer to Float (`type/intToFloat`) FlowGraphBlockNames.IntToFloat
9265
+ 3. **Float Conversion Nodes**
9266
+ - Float to Boolean (`type/floatToBool`) FlowGraphBlockNames.FloatToBoolean
9267
+ - Float to Integer (`type/floatToInt`) FlowGraphBlockNames.FloatToInt
9268
+ ### Control Flow Nodes
9269
+ 1. **Sync Nodes**
9270
+ - Sequence (`flow/sequence`) FlowGraphBlockNames.Sequence
9271
+ - Branch (`flow/branch`) FlowGraphBlockNames.Branch
9272
+ - Switch (`flow/switch`) FlowGraphBlockNames.Switch
9273
+ - While Loop (`flow/while`) FlowGraphBlockNames.WhileLoop
9274
+ - For Loop (`flow/for`) FlowGraphBlockNames.ForLoop
9275
+ - Do N (`flow/doN`) FlowGraphBlockNames.DoN
9276
+ - Multi Gate (`flow/multiGate`) FlowGraphBlockNames.MultiGate
9277
+ - Wait All (`flow/waitAll`) FlowGraphBlockNames.WaitAll
9278
+ - Throttle (`flow/throttle`) FlowGraphBlockNames.Throttle
9279
+ 2. **Delay Nodes**
9280
+ - Set Delay (`flow/setDelay`) FlowGraphBlockNames.SetDelay
9281
+ - Cancel Delay (`flow/cancelDelay`) FlowGraphBlockNames.CancelDelay
9282
+ ### State Manipulation Nodes
9283
+ 1. **Custom Variable Access**
9284
+ - Variable Get (`variable/get`) FlowGraphBlockNames.GetVariable
9285
+ - Variable Set (`variable/set`) FlowGraphBlockNames.SetVariable
9286
+ - Variable Interpolate (`variable/interpolate`)
9287
+ 2. **Object Model Access** // TODO fully test this!!!
9288
+ - JSON Pointer Template Parsing (`pointer/get`) [FlowGraphBlockNames.GetProperty, FlowGraphBlockNames.JsonPointerParser]
9289
+ - Effective JSON Pointer Generation (`pointer/set`) [FlowGraphBlockNames.SetProperty, FlowGraphBlockNames.JsonPointerParser]
9290
+ - Pointer Get (`pointer/get`) [FlowGraphBlockNames.GetProperty, FlowGraphBlockNames.JsonPointerParser]
9291
+ - Pointer Set (`pointer/set`) [FlowGraphBlockNames.SetProperty, FlowGraphBlockNames.JsonPointerParser]
9292
+ - Pointer Interpolate (`pointer/interpolate`) [FlowGraphBlockNames.ValueInterpolation, FlowGraphBlockNames.JsonPointerParser, FlowGraphBlockNames.PlayAnimation, FlowGraphBlockNames.Easing]
9293
+ ### Animation Control Nodes
9294
+ 1. **Animation Play** (`animation/start`) FlowGraphBlockNames.PlayAnimation
9295
+ 2. **Animation Stop** (`animation/stop`) FlowGraphBlockNames.StopAnimation
9296
+ 3. **Animation Stop At** (`animation/stopAt`) FlowGraphBlockNames.StopAnimation
9297
+ ### Event Nodes
9298
+ 1. **Lifecycle Event Nodes**
9299
+ - On Start (`event/onStart`) FlowGraphBlockNames.SceneReadyEvent
9300
+ - On Tick (`event/onTick`) FlowGraphBlockNames.SceneTickEvent
9301
+ 2. **Custom Event Nodes**
9302
+ - Receive (`event/receive`) FlowGraphBlockNames.ReceiveCustomEvent
9303
+ - Send (`event/send`) FlowGraphBlockNames.SendCustomEvent
9304
+ */
9305
+
9306
+
9307
+
9308
+ }
9309
+ declare module BABYLON {
9310
+
9311
+
8397
9312
  }
8398
9313
  declare module BABYLON.GLTF1 {
8399
9314