babylonjs-loaders 9.26.1 → 9.26.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.
- package/babylon.glTF2FileLoader.js +1 -1
- package/babylon.glTF2FileLoader.js.map +1 -1
- package/babylon.glTF2FileLoader.min.js +1 -1
- package/babylon.glTF2FileLoader.min.js.map +1 -1
- package/babylon.glTFFileLoader.js +1 -1
- package/babylon.glTFFileLoader.js.map +1 -1
- package/babylon.glTFFileLoader.min.js +1 -1
- package/babylon.glTFFileLoader.min.js.map +1 -1
- package/babylonjs.loaders.d.ts +563 -46
- package/babylonjs.loaders.es5.js +5711 -4444
- package/babylonjs.loaders.js +1 -1
- package/babylonjs.loaders.js.map +1 -1
- package/babylonjs.loaders.min.js +1 -1
- package/babylonjs.loaders.min.js.map +1 -1
- package/babylonjs.loaders.module.d.ts +1131 -93
- package/package.json +3 -3
package/babylonjs.loaders.d.ts
CHANGED
|
@@ -2828,8 +2828,9 @@ declare namespace BABYLON.GLTF2 {
|
|
|
2828
2828
|
onLoading?(): void;
|
|
2829
2829
|
/**
|
|
2830
2830
|
* Called after the loader state changes to READY.
|
|
2831
|
+
* @returns a promise when the extension has asynchronous readiness work
|
|
2831
2832
|
*/
|
|
2832
|
-
onReady?(): void
|
|
2833
|
+
onReady?(): void | Promise<void>;
|
|
2833
2834
|
/**
|
|
2834
2835
|
* Define this method to modify the default behavior when loading scenes.
|
|
2835
2836
|
* @param context The context when loading the asset
|
|
@@ -3417,7 +3418,7 @@ declare namespace BABYLON.GLTF2 {
|
|
|
3417
3418
|
private _forEachExtensions;
|
|
3418
3419
|
private _applyExtensions;
|
|
3419
3420
|
private _extensionsOnLoading;
|
|
3420
|
-
private
|
|
3421
|
+
private _extensionsOnReadyAsync;
|
|
3421
3422
|
private _extensionsLoadSceneAsync;
|
|
3422
3423
|
private _extensionsLoadNodeAsync;
|
|
3423
3424
|
private _extensionsLoadCameraAsync;
|
|
@@ -4060,9 +4061,10 @@ declare namespace BABYLON.GLTF2.Loader.Extensions {
|
|
|
4060
4061
|
/**
|
|
4061
4062
|
* get a path-to-object converter for the given glTF tree
|
|
4062
4063
|
* @param gltf the glTF tree to use
|
|
4064
|
+
* @param configure optional callback for adding asset-local accessors to this converter
|
|
4063
4065
|
* @returns a path-to-object converter for the given glTF tree
|
|
4064
4066
|
*/
|
|
4065
|
-
export function GetPathToObjectConverter(gltf: BABYLON.GLTF2.Loader.IGLTF): BABYLON.GLTF2.Loader.Extensions.GLTFPathToObjectConverter<unknown, unknown, unknown>;
|
|
4067
|
+
export function GetPathToObjectConverter(gltf: BABYLON.GLTF2.Loader.IGLTF, configure?: (mapping: object) => void): BABYLON.GLTF2.Loader.Extensions.GLTFPathToObjectConverter<unknown, unknown, unknown>;
|
|
4066
4068
|
/**
|
|
4067
4069
|
* This function will return the object accessor for the given key in the object model
|
|
4068
4070
|
* If the key is not found, it will return undefined
|
|
@@ -4081,8 +4083,9 @@ declare namespace BABYLON.GLTF2.Loader.Extensions {
|
|
|
4081
4083
|
* 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)
|
|
4082
4084
|
* @param key the key to add the object accessor at. For example /cameras/\{\}/perspective/aspectRatio
|
|
4083
4085
|
* @param accessor the object accessor to add
|
|
4086
|
+
* @param mapping object-model mapping to update; defaults to the process-wide mapping used as the template for new converters
|
|
4084
4087
|
*/
|
|
4085
|
-
export function AddObjectAccessorToKey<GLTFTargetType = any, BabylonTargetType = any, BabylonValueType = any>(key: string, accessor: IObjectAccessor<GLTFTargetType, BabylonTargetType, BabylonValueType
|
|
4088
|
+
export function AddObjectAccessorToKey<GLTFTargetType = any, BabylonTargetType = any, BabylonValueType = any>(key: string, accessor: IObjectAccessor<GLTFTargetType, BabylonTargetType, BabylonValueType>, mapping?: object): void;
|
|
4086
4089
|
|
|
4087
4090
|
|
|
4088
4091
|
|
|
@@ -5038,6 +5041,8 @@ declare namespace BABYLON.GLTF2.Loader.Extensions {
|
|
|
5038
5041
|
* The name of this extension.
|
|
5039
5042
|
*/
|
|
5040
5043
|
readonly name = "KHR_node_selectability";
|
|
5044
|
+
/** Applies node state before KHR_interactivity graphs start. */
|
|
5045
|
+
readonly order = 100;
|
|
5041
5046
|
/**
|
|
5042
5047
|
* Defines whether this extension is enabled.
|
|
5043
5048
|
*/
|
|
@@ -5105,6 +5110,8 @@ declare namespace BABYLON.GLTF2.Loader.Extensions {
|
|
|
5105
5110
|
* The name of this extension.
|
|
5106
5111
|
*/
|
|
5107
5112
|
readonly name = "KHR_node_hoverability";
|
|
5113
|
+
/** Applies node state before KHR_interactivity graphs start. */
|
|
5114
|
+
readonly order = 100;
|
|
5108
5115
|
/**
|
|
5109
5116
|
* Defines whether this extension is enabled.
|
|
5110
5117
|
*/
|
|
@@ -6645,12 +6652,74 @@ declare namespace BABYLON {
|
|
|
6645
6652
|
/**
|
|
6646
6653
|
* Defines options for the KHR_interactivity extension.
|
|
6647
6654
|
*/
|
|
6648
|
-
["KHR_interactivity"]: {
|
|
6655
|
+
["KHR_interactivity"]: {
|
|
6656
|
+
/**
|
|
6657
|
+
* Whether the selected default graph starts automatically after import.
|
|
6658
|
+
* Defaults to true.
|
|
6659
|
+
*/
|
|
6660
|
+
autoStart?: boolean;
|
|
6661
|
+
/**
|
|
6662
|
+
* Whether to retain only the canonical source model and executable
|
|
6663
|
+
* FlowGraph serialization without constructing runtime graphs.
|
|
6664
|
+
* Defaults to false.
|
|
6665
|
+
*/
|
|
6666
|
+
parseOnly?: boolean;
|
|
6667
|
+
/**
|
|
6668
|
+
* Whether to enforce the ratified graph validation rules.
|
|
6669
|
+
* Defaults to true. Set to false only for pre-ratification assets.
|
|
6670
|
+
*/
|
|
6671
|
+
strictValidation?: boolean;
|
|
6672
|
+
};
|
|
6649
6673
|
}
|
|
6650
6674
|
|
|
6651
6675
|
}
|
|
6652
6676
|
declare namespace BABYLON.GLTF2.Loader.Extensions {
|
|
6653
6677
|
/**
|
|
6678
|
+
* Runtime projection of one canonical KHR_interactivity graph.
|
|
6679
|
+
*/
|
|
6680
|
+
export interface IKHRInteractivityGraphImportResult {
|
|
6681
|
+
/** Canonical source graph and diagnostics. */
|
|
6682
|
+
graph: BABYLON.GLTF2.Loader.Extensions.IKHRInteractivityGraphModel;
|
|
6683
|
+
/** Executable FlowGraph serialization when lowering succeeded. */
|
|
6684
|
+
serializedFlowGraph?: ISerializedFlowGraph;
|
|
6685
|
+
/** Runtime FlowGraph when runtime construction was requested. */
|
|
6686
|
+
flowGraph?: FlowGraph;
|
|
6687
|
+
/** Coordinator that owns the runtime FlowGraph. */
|
|
6688
|
+
coordinator?: FlowGraphCoordinator;
|
|
6689
|
+
/** Additional lowering/runtime diagnostics. */
|
|
6690
|
+
diagnostics: BABYLON.GLTF2.Loader.Extensions.IKHRInteractivityDiagnostic[];
|
|
6691
|
+
}
|
|
6692
|
+
/**
|
|
6693
|
+
* Completed KHR_interactivity import result associated with a loaded scene.
|
|
6694
|
+
*/
|
|
6695
|
+
export interface IKHRInteractivityImportResult {
|
|
6696
|
+
/** Stable zero-based identity of this interactivity asset among assets appended to the scene. */
|
|
6697
|
+
assetIndex: number;
|
|
6698
|
+
/** Canonical, lossless source document. */
|
|
6699
|
+
document: BABYLON.GLTF2.Loader.Extensions.IKHRInteractivityDocument;
|
|
6700
|
+
/** Graph import results in source order. */
|
|
6701
|
+
graphs: IKHRInteractivityGraphImportResult[];
|
|
6702
|
+
/** Shared path converter required by pointer blocks. */
|
|
6703
|
+
pathConverter: BABYLON.GLTF2.Loader.Extensions.CompositePathToObjectConverter<IObjectAccessor>;
|
|
6704
|
+
/** Live glTF loader data used by glTF data-provider blocks. */
|
|
6705
|
+
glTF: BABYLON.GLTF2.GLTFLoader["gltf"];
|
|
6706
|
+
/** Host resolver that supplies KHR reference semantics to executable graphs. */
|
|
6707
|
+
hostResolver: BABYLON.GLTF2.Loader.Extensions.InteractivityHostResolver;
|
|
6708
|
+
}
|
|
6709
|
+
/**
|
|
6710
|
+
* Gets the completed KHR_interactivity import result for a loaded scene.
|
|
6711
|
+
* @param scene scene loaded from the glTF asset
|
|
6712
|
+
* @returns the import result, or undefined when the scene has no KHR_interactivity data
|
|
6713
|
+
*/
|
|
6714
|
+
export function GetKHRInteractivityImportResult(scene: Scene): IKHRInteractivityImportResult | undefined;
|
|
6715
|
+
/**
|
|
6716
|
+
* Gets every completed KHR_interactivity import result appended to a loaded scene.
|
|
6717
|
+
* Results remain in asset load order and each result has a stable {@link IKHRInteractivityImportResult.assetIndex}.
|
|
6718
|
+
* @param scene scene containing the loaded glTF assets
|
|
6719
|
+
* @returns the scene's import results, or an empty array when it has no KHR_interactivity data
|
|
6720
|
+
*/
|
|
6721
|
+
export function GetKHRInteractivityImportResults(scene: Scene): readonly IKHRInteractivityImportResult[];
|
|
6722
|
+
/**
|
|
6654
6723
|
* Loader extension for KHR_interactivity
|
|
6655
6724
|
*/
|
|
6656
6725
|
export class KHR_interactivity implements BABYLON.GLTF2.IGLTFLoaderExtension {
|
|
@@ -6659,6 +6728,8 @@ declare namespace BABYLON.GLTF2.Loader.Extensions {
|
|
|
6659
6728
|
* The name of this extension.
|
|
6660
6729
|
*/
|
|
6661
6730
|
readonly name = "KHR_interactivity";
|
|
6731
|
+
/** Runs after extensions that contribute interactivity operations and object state. */
|
|
6732
|
+
readonly order = 200;
|
|
6662
6733
|
/**
|
|
6663
6734
|
* Defines whether this extension is enabled.
|
|
6664
6735
|
*/
|
|
@@ -6670,6 +6741,7 @@ declare namespace BABYLON.GLTF2.Loader.Extensions {
|
|
|
6670
6741
|
* @param _loader
|
|
6671
6742
|
*/
|
|
6672
6743
|
constructor(_loader: BABYLON.GLTF2.GLTFLoader);
|
|
6744
|
+
private _initializePathConverter;
|
|
6673
6745
|
dispose(): void;
|
|
6674
6746
|
onReady(): Promise<void>;
|
|
6675
6747
|
}
|
|
@@ -6677,7 +6749,7 @@ declare namespace BABYLON.GLTF2.Loader.Extensions {
|
|
|
6677
6749
|
* @internal
|
|
6678
6750
|
* populates the object model with the interactivity extension
|
|
6679
6751
|
*/
|
|
6680
|
-
export function _AddInteractivityObjectModel(scene: Scene): void;
|
|
6752
|
+
export function _AddInteractivityObjectModel(scene: Scene, targetFps: number, mapping: object): void;
|
|
6681
6753
|
/**
|
|
6682
6754
|
* @internal
|
|
6683
6755
|
* Registers KHR_interactivity runtime dependencies without changing the extension registry.
|
|
@@ -7549,6 +7621,37 @@ declare namespace BABYLON.GLTF2.Loader.Extensions {
|
|
|
7549
7621
|
|
|
7550
7622
|
|
|
7551
7623
|
|
|
7624
|
+
}
|
|
7625
|
+
declare namespace BABYLON {
|
|
7626
|
+
|
|
7627
|
+
|
|
7628
|
+
}
|
|
7629
|
+
declare namespace BABYLON.GLTF2.Loader.Extensions {
|
|
7630
|
+
type InteractivityNodeState = "hoverable" | "selectable";
|
|
7631
|
+
/**
|
|
7632
|
+
* Initializes authored and inherited selectability or hoverability state.
|
|
7633
|
+
* @param nodes all nodes in the glTF asset
|
|
7634
|
+
* @param state state kind to initialize
|
|
7635
|
+
* @param getAuthoredState reads the extension-authored local state
|
|
7636
|
+
*/
|
|
7637
|
+
export function InitializeInteractivityNodeState(nodes: readonly BABYLON.GLTF2.Loader.INode[], state: InteractivityNodeState, getAuthoredState: (node: BABYLON.GLTF2.Loader.INode) => boolean | undefined): void;
|
|
7638
|
+
/**
|
|
7639
|
+
* Gets the locally authored runtime state for a node.
|
|
7640
|
+
* @param node glTF node
|
|
7641
|
+
* @param state state kind
|
|
7642
|
+
* @returns local state, defaulting to true
|
|
7643
|
+
*/
|
|
7644
|
+
export function GetInteractivityNodeState(node: BABYLON.GLTF2.Loader.INode, state: InteractivityNodeState): boolean;
|
|
7645
|
+
/**
|
|
7646
|
+
* Updates local state and reapplies inherited state to the affected subtree.
|
|
7647
|
+
* @param node glTF node
|
|
7648
|
+
* @param state state kind
|
|
7649
|
+
* @param value new local state
|
|
7650
|
+
*/
|
|
7651
|
+
export function SetInteractivityNodeState(node: BABYLON.GLTF2.Loader.INode, state: InteractivityNodeState, value: boolean): void;
|
|
7652
|
+
|
|
7653
|
+
|
|
7654
|
+
|
|
7552
7655
|
}
|
|
7553
7656
|
declare namespace BABYLON {
|
|
7554
7657
|
|
|
@@ -7574,9 +7677,10 @@ declare namespace BABYLON.GLTF2.Loader.Extensions {
|
|
|
7574
7677
|
decodeEventReference(reference: string): string | undefined;
|
|
7575
7678
|
/**
|
|
7576
7679
|
* @param reference the reference to decode
|
|
7680
|
+
* @param collection optional glTF root collection the reference must address
|
|
7577
7681
|
* @returns the index the reference denotes, or `undefined` when it is not an indexed JSON Pointer
|
|
7578
7682
|
*/
|
|
7579
|
-
decodeIndexReference(reference: string): number | undefined;
|
|
7683
|
+
decodeIndexReference(reference: string, collection?: string): number | undefined;
|
|
7580
7684
|
/**
|
|
7581
7685
|
* Maps a Babylon object loaded from the glTF back to a JSON Pointer addressing it.
|
|
7582
7686
|
*
|
|
@@ -7621,13 +7725,6 @@ declare namespace BABYLON.GLTF2.Loader.Extensions {
|
|
|
7621
7725
|
value?: any;
|
|
7622
7726
|
}[];
|
|
7623
7727
|
}
|
|
7624
|
-
export var gltfTypeToBabylonType: {
|
|
7625
|
-
[key: string]: {
|
|
7626
|
-
length: number;
|
|
7627
|
-
flowGraphType: FlowGraphTypes;
|
|
7628
|
-
elementType: "number" | "boolean" | "string";
|
|
7629
|
-
};
|
|
7630
|
-
};
|
|
7631
7728
|
/**
|
|
7632
7729
|
* Parses a KHR_interactivity graph definition (the raw glTF JSON object) into
|
|
7633
7730
|
* the serialized FlowGraph form consumed by {@link ParseFlowGraphAsync}.
|
|
@@ -7637,9 +7734,11 @@ declare namespace BABYLON.GLTF2.Loader.Extensions {
|
|
|
7637
7734
|
* {@link serializeToFlowGraph}.
|
|
7638
7735
|
*/
|
|
7639
7736
|
export class InteractivityGraphToFlowGraphParser {
|
|
7640
|
-
private _interactivityGraph;
|
|
7641
7737
|
private _gltf;
|
|
7642
7738
|
_animationTargetFps: number;
|
|
7739
|
+
private _graphIndex;
|
|
7740
|
+
private _supportedExtensions?;
|
|
7741
|
+
private _declarationModels?;
|
|
7643
7742
|
/**
|
|
7644
7743
|
* Note - the graph should be rejected if the same type is defined twice.
|
|
7645
7744
|
* We currently don't validate that.
|
|
@@ -7657,16 +7756,22 @@ declare namespace BABYLON.GLTF2.Loader.Extensions {
|
|
|
7657
7756
|
* the last block) is not disturbed, then concatenated into the serialized graph.
|
|
7658
7757
|
*/
|
|
7659
7758
|
private _insertedBlocks;
|
|
7660
|
-
constructor(
|
|
7759
|
+
constructor(interactivityGraph: BABYLON.GLTF2.IKHRInteractivity_Graph, _gltf: BABYLON.GLTF2.Loader.IGLTF, _animationTargetFps?: number, _graphIndex?: number, _supportedExtensions?: ReadonlySet<string> | undefined, _declarationModels?: readonly BABYLON.GLTF2.Loader.Extensions.IKHRInteractivityDeclarationModel[] | undefined);
|
|
7760
|
+
private _interactivityGraph;
|
|
7761
|
+
private get _strictValidation();
|
|
7762
|
+
private _hasDefaultFlowInput;
|
|
7763
|
+
private _getAllowedDynamicValueSockets;
|
|
7764
|
+
private _getAllowedDynamicFlowSockets;
|
|
7661
7765
|
get arrays(): {
|
|
7662
7766
|
types: {
|
|
7663
7767
|
length: number;
|
|
7664
7768
|
flowGraphType: FlowGraphTypes;
|
|
7665
|
-
elementType: "number" | "boolean" | "string";
|
|
7769
|
+
elementType: "number" | "boolean" | "string" | "any";
|
|
7666
7770
|
}[];
|
|
7667
7771
|
mappings: {
|
|
7668
7772
|
flowGraphMapping: BABYLON.GLTF2.Loader.Extensions.IGLTFToFlowGraphMapping;
|
|
7669
7773
|
fullOperationName: string;
|
|
7774
|
+
declaration: BABYLON.GLTF2.Loader.Extensions.IKHRInteractivityDeclarationModel;
|
|
7670
7775
|
}[];
|
|
7671
7776
|
staticVariables: {
|
|
7672
7777
|
type: FlowGraphTypes;
|
|
@@ -7682,12 +7787,15 @@ declare namespace BABYLON.GLTF2.Loader.Extensions {
|
|
|
7682
7787
|
private _parseDeclarations;
|
|
7683
7788
|
private _parseVariables;
|
|
7684
7789
|
private _parseVariable;
|
|
7790
|
+
private _normalizeStaticReference;
|
|
7685
7791
|
private _parseEvents;
|
|
7686
7792
|
private _parseNodes;
|
|
7687
7793
|
private _getEmptyBlock;
|
|
7794
|
+
private _createUnsupportedExtensionBlock;
|
|
7688
7795
|
private _parseNodeConfiguration;
|
|
7689
7796
|
private _parseNodeConnections;
|
|
7690
7797
|
private _createNewSocketConnection;
|
|
7798
|
+
private _isUnsupportedExtensionBlock;
|
|
7691
7799
|
/**
|
|
7692
7800
|
* Wires an upstream data output into a downstream data input through a runtime multiply block that
|
|
7693
7801
|
* scales the value by the animation target fps. This converts a KHR animation time (seconds),
|
|
@@ -7697,6 +7805,8 @@ declare namespace BABYLON.GLTF2.Loader.Extensions {
|
|
|
7697
7805
|
* @param context the serialized flow graph context that stores literal socket values
|
|
7698
7806
|
* @param upstreamOutput the data output socket providing the time value (in seconds)
|
|
7699
7807
|
* @param downstreamInput the data input socket that expects the time in frames
|
|
7808
|
+
* @param nodeIndex source node receiving the converted value
|
|
7809
|
+
* @param declarationIndex source declaration used by the receiving node
|
|
7700
7810
|
*/
|
|
7701
7811
|
private _connectWithSecondsToFramesConversion;
|
|
7702
7812
|
private _connectFlowGraphNodes;
|
|
@@ -7718,6 +7828,125 @@ declare namespace BABYLON.GLTF2.Loader.Extensions {
|
|
|
7718
7828
|
|
|
7719
7829
|
|
|
7720
7830
|
|
|
7831
|
+
}
|
|
7832
|
+
declare namespace BABYLON {
|
|
7833
|
+
|
|
7834
|
+
|
|
7835
|
+
}
|
|
7836
|
+
declare namespace BABYLON.GLTF2.Loader.Extensions {
|
|
7837
|
+
/**
|
|
7838
|
+
* Ratified KHR_interactivity specification baseline used by this importer.
|
|
7839
|
+
*/
|
|
7840
|
+
export const KHR_INTERACTIVITY_SPECIFICATION_COMMIT = "f798712c5685bc9223a628140fba707db8889300";
|
|
7841
|
+
/**
|
|
7842
|
+
* Runtime representation of every ratified built-in KHR_interactivity type.
|
|
7843
|
+
*/
|
|
7844
|
+
export var gltfTypeToBabylonType: {
|
|
7845
|
+
[key: string]: {
|
|
7846
|
+
length: number;
|
|
7847
|
+
flowGraphType: FlowGraphTypes;
|
|
7848
|
+
elementType: "number" | "boolean" | "string" | "any";
|
|
7849
|
+
};
|
|
7850
|
+
};
|
|
7851
|
+
/**
|
|
7852
|
+
* Classification of a KHR_interactivity declaration.
|
|
7853
|
+
*/
|
|
7854
|
+
export type KHRInteractivityDeclarationSupport = "core" | "extension" | "unsupported-extension" | "unknown-core";
|
|
7855
|
+
/**
|
|
7856
|
+
* A structured KHR_interactivity import diagnostic.
|
|
7857
|
+
*/
|
|
7858
|
+
export interface IKHRInteractivityDiagnostic {
|
|
7859
|
+
/** JSON pointer identifying the source location. */
|
|
7860
|
+
path: string;
|
|
7861
|
+
/** Human-readable diagnostic text. */
|
|
7862
|
+
message: string;
|
|
7863
|
+
/** Diagnostic severity. */
|
|
7864
|
+
severity: "error" | "warning";
|
|
7865
|
+
}
|
|
7866
|
+
/**
|
|
7867
|
+
* Canonical declaration information retained during import.
|
|
7868
|
+
*/
|
|
7869
|
+
export interface IKHRInteractivityDeclarationModel {
|
|
7870
|
+
/** Declaration index in the source graph. */
|
|
7871
|
+
index: number;
|
|
7872
|
+
/** Full operation name, including the defining extension when present. */
|
|
7873
|
+
operation: string;
|
|
7874
|
+
/** Whether Babylon can execute the declaration. */
|
|
7875
|
+
support: KHRInteractivityDeclarationSupport;
|
|
7876
|
+
/** Exact source declaration. */
|
|
7877
|
+
source: BABYLON.GLTF2.IKHRInteractivity_Declaration;
|
|
7878
|
+
}
|
|
7879
|
+
/**
|
|
7880
|
+
* Canonical graph information retained during import.
|
|
7881
|
+
*/
|
|
7882
|
+
export interface IKHRInteractivityGraphModel {
|
|
7883
|
+
/** Graph index in the root extension. */
|
|
7884
|
+
index: number;
|
|
7885
|
+
/** Stable source path. */
|
|
7886
|
+
path: string;
|
|
7887
|
+
/** Human-readable graph name. */
|
|
7888
|
+
name: string;
|
|
7889
|
+
/** Exact source graph, including extension and extras payloads. */
|
|
7890
|
+
source: BABYLON.GLTF2.IKHRInteractivity_Graph;
|
|
7891
|
+
/** Executable graph with specification defaults and fallbacks applied. */
|
|
7892
|
+
effectiveSource: BABYLON.GLTF2.IKHRInteractivity_Graph;
|
|
7893
|
+
/** Canonical declarations in source order. */
|
|
7894
|
+
declarations: IKHRInteractivityDeclarationModel[];
|
|
7895
|
+
/** Validation diagnostics for this graph. */
|
|
7896
|
+
diagnostics: IKHRInteractivityDiagnostic[];
|
|
7897
|
+
/** Whether this graph is valid and can be lowered to FlowGraph. */
|
|
7898
|
+
valid: boolean;
|
|
7899
|
+
}
|
|
7900
|
+
/**
|
|
7901
|
+
* Lossless canonical representation of a KHR_interactivity root extension.
|
|
7902
|
+
*/
|
|
7903
|
+
export interface IKHRInteractivityDocument {
|
|
7904
|
+
/** Ratified specification revision used for validation. */
|
|
7905
|
+
specificationCommit: string;
|
|
7906
|
+
/** Exact source extension, including unknown extensions and extras. */
|
|
7907
|
+
source: BABYLON.GLTF2.IKHRInteractivity;
|
|
7908
|
+
/** Default graph index, or -1 when the source selection is invalid. */
|
|
7909
|
+
defaultGraphIndex: number;
|
|
7910
|
+
/** Canonical graph models in source order. */
|
|
7911
|
+
graphs: IKHRInteractivityGraphModel[];
|
|
7912
|
+
/** Root-level validation diagnostics. */
|
|
7913
|
+
diagnostics: IKHRInteractivityDiagnostic[];
|
|
7914
|
+
}
|
|
7915
|
+
/**
|
|
7916
|
+
* Creates a detached JSON copy of a KHR_interactivity graph.
|
|
7917
|
+
* @param graph source graph
|
|
7918
|
+
* @returns a lossless JSON copy
|
|
7919
|
+
*/
|
|
7920
|
+
export function CloneKHRInteractivityGraph(graph: BABYLON.GLTF2.IKHRInteractivity_Graph): BABYLON.GLTF2.IKHRInteractivity_Graph;
|
|
7921
|
+
/**
|
|
7922
|
+
* Creates the executable graph view with all ratified configuration defaults and fallback rules
|
|
7923
|
+
* applied without modifying the lossless source graph.
|
|
7924
|
+
* @param graph source graph
|
|
7925
|
+
* @param declarations canonical declarations
|
|
7926
|
+
* @param assetNodeCount number of glTF nodes in the containing asset
|
|
7927
|
+
* @returns normalized executable graph
|
|
7928
|
+
*/
|
|
7929
|
+
export function CreateEffectiveKHRInteractivityGraph(graph: BABYLON.GLTF2.IKHRInteractivity_Graph, declarations: readonly IKHRInteractivityDeclarationModel[], assetNodeCount?: number): BABYLON.GLTF2.IKHRInteractivity_Graph;
|
|
7930
|
+
/**
|
|
7931
|
+
* Creates and validates a canonical copy of one KHR_interactivity graph.
|
|
7932
|
+
* @param graph source graph
|
|
7933
|
+
* @param index graph index in the root extension
|
|
7934
|
+
* @param supportedExtensions enabled extensions that may provide executable operations
|
|
7935
|
+
* @param assetNodeCount number of nodes in the containing glTF asset
|
|
7936
|
+
* @returns the canonical graph model
|
|
7937
|
+
*/
|
|
7938
|
+
export function CreateKHRInteractivityGraphModel(graph: BABYLON.GLTF2.IKHRInteractivity_Graph | null | undefined, index?: number, supportedExtensions?: ReadonlySet<string>, assetNodeCount?: number): IKHRInteractivityGraphModel;
|
|
7939
|
+
/**
|
|
7940
|
+
* Creates an immutable canonical KHR_interactivity document and validates all graph-local references.
|
|
7941
|
+
* @param extension source extension object from the glTF document
|
|
7942
|
+
* @param supportedExtensions enabled extensions that may provide executable operations
|
|
7943
|
+
* @param assetNodeCount number of nodes in the containing glTF asset
|
|
7944
|
+
* @returns the canonical document
|
|
7945
|
+
*/
|
|
7946
|
+
export function CreateKHRInteractivityDocument(extension: BABYLON.GLTF2.IKHRInteractivity, supportedExtensions?: ReadonlySet<string>, assetNodeCount?: number): IKHRInteractivityDocument;
|
|
7947
|
+
|
|
7948
|
+
|
|
7949
|
+
|
|
7721
7950
|
}
|
|
7722
7951
|
declare namespace BABYLON {
|
|
7723
7952
|
|
|
@@ -7727,6 +7956,82 @@ declare namespace BABYLON.GLTF2.Loader.Extensions {
|
|
|
7727
7956
|
|
|
7728
7957
|
|
|
7729
7958
|
|
|
7959
|
+
}
|
|
7960
|
+
declare namespace BABYLON {
|
|
7961
|
+
|
|
7962
|
+
|
|
7963
|
+
}
|
|
7964
|
+
declare namespace BABYLON.GLTF2.Loader.Extensions {
|
|
7965
|
+
/**
|
|
7966
|
+
* Socket definition retained for an unsupported extension operation.
|
|
7967
|
+
*/
|
|
7968
|
+
export interface IFlowGraphUnsupportedInteractivitySocket {
|
|
7969
|
+
/** Socket name. */
|
|
7970
|
+
name: string;
|
|
7971
|
+
/** FlowGraph runtime type name. */
|
|
7972
|
+
type?: string;
|
|
7973
|
+
/** Exact KHR_interactivity type signature. */
|
|
7974
|
+
signature?: string;
|
|
7975
|
+
}
|
|
7976
|
+
/**
|
|
7977
|
+
* Configuration for an unsupported KHR_interactivity extension operation.
|
|
7978
|
+
*/
|
|
7979
|
+
export interface IFlowGraphUnsupportedInteractivityBlockConfiguration extends IFlowGraphBlockConfiguration {
|
|
7980
|
+
/** Full extension operation name. */
|
|
7981
|
+
operation: string;
|
|
7982
|
+
/** Input value sockets declared by the extension. */
|
|
7983
|
+
inputValueSockets: IFlowGraphUnsupportedInteractivitySocket[];
|
|
7984
|
+
/** Output value sockets declared by the extension. */
|
|
7985
|
+
outputValueSockets: IFlowGraphUnsupportedInteractivitySocket[];
|
|
7986
|
+
/** Input flow sockets used by the source graph. */
|
|
7987
|
+
inputFlowSockets: string[];
|
|
7988
|
+
/** Output flow sockets used by the source graph. */
|
|
7989
|
+
outputFlowSockets: string[];
|
|
7990
|
+
}
|
|
7991
|
+
/**
|
|
7992
|
+
* Inspectable runtime no-op for an operation owned by an unsupported glTF extension.
|
|
7993
|
+
*/
|
|
7994
|
+
export class FlowGraphUnsupportedInteractivityBlock extends FlowGraphExecutionBlock {
|
|
7995
|
+
config: IFlowGraphUnsupportedInteractivityBlockConfiguration;
|
|
7996
|
+
constructor(config: IFlowGraphUnsupportedInteractivityBlockConfiguration);
|
|
7997
|
+
/** @internal */
|
|
7998
|
+
_execute(_context: FlowGraphContext, _callingSignal: FlowGraphSignalConnection): void;
|
|
7999
|
+
/** @returns the serialized class name */
|
|
8000
|
+
getClassName(): string;
|
|
8001
|
+
}
|
|
8002
|
+
|
|
8003
|
+
|
|
8004
|
+
|
|
8005
|
+
}
|
|
8006
|
+
declare namespace BABYLON {
|
|
8007
|
+
|
|
8008
|
+
|
|
8009
|
+
}
|
|
8010
|
+
declare namespace BABYLON.GLTF2.Loader.Extensions {
|
|
8011
|
+
/**
|
|
8012
|
+
* Resolves a runtime object to its owning glTF node reference.
|
|
8013
|
+
* @param context active FlowGraph context
|
|
8014
|
+
* @param value runtime object, usually a picked primitive
|
|
8015
|
+
* @returns the owning node reference or the null reference
|
|
8016
|
+
*/
|
|
8017
|
+
export function GetInteractivityObjectReference(context: FlowGraphContext, value: object | undefined): string;
|
|
8018
|
+
/**
|
|
8019
|
+
* Converts a runtime object into the opaque reference used by KHR_interactivity.
|
|
8020
|
+
*/
|
|
8021
|
+
export class FlowGraphObjectReferenceBlock extends FlowGraphBlock {
|
|
8022
|
+
/** Runtime object to encode. */
|
|
8023
|
+
readonly object: FlowGraphDataConnection<object | undefined>;
|
|
8024
|
+
/** Opaque KHR_interactivity reference. */
|
|
8025
|
+
readonly value: FlowGraphDataConnection<string>;
|
|
8026
|
+
constructor(config?: IFlowGraphBlockConfiguration);
|
|
8027
|
+
/** @internal */
|
|
8028
|
+
_updateOutputs(context: FlowGraphContext): void;
|
|
8029
|
+
/** @returns the serialized class name */
|
|
8030
|
+
getClassName(): string;
|
|
8031
|
+
}
|
|
8032
|
+
|
|
8033
|
+
|
|
8034
|
+
|
|
7730
8035
|
}
|
|
7731
8036
|
declare namespace BABYLON {
|
|
7732
8037
|
|
|
@@ -7740,7 +8045,7 @@ declare namespace BABYLON.GLTF2.Loader.Extensions {
|
|
|
7740
8045
|
/**
|
|
7741
8046
|
* the glTF object to provide data from
|
|
7742
8047
|
*/
|
|
7743
|
-
glTF
|
|
8048
|
+
glTF?: BABYLON.GLTF2.Loader.IGLTF;
|
|
7744
8049
|
}
|
|
7745
8050
|
/**
|
|
7746
8051
|
* a glTF-based FlowGraph block that provides arrays with babylon object, based on the glTF tree
|
|
@@ -7757,7 +8062,7 @@ declare namespace BABYLON.GLTF2.Loader.Extensions {
|
|
|
7757
8062
|
* Corresponds directly to the glTF nodes array
|
|
7758
8063
|
*/
|
|
7759
8064
|
readonly nodes: FlowGraphDataConnection<TransformNode[]>;
|
|
7760
|
-
constructor(config
|
|
8065
|
+
constructor(config?: IFlowGraphGLTFDataProviderBlockConfiguration);
|
|
7761
8066
|
getClassName(): string;
|
|
7762
8067
|
}
|
|
7763
8068
|
|
|
@@ -7769,11 +8074,71 @@ declare namespace BABYLON {
|
|
|
7769
8074
|
|
|
7770
8075
|
}
|
|
7771
8076
|
declare namespace BABYLON.GLTF2.Loader.Extensions {
|
|
7772
|
-
|
|
8077
|
+
/**
|
|
8078
|
+
* Configuration for a KHR event reference output.
|
|
8079
|
+
*/
|
|
8080
|
+
export interface IFlowGraphEventReferenceBlockConfiguration extends IFlowGraphBlockConfiguration {
|
|
8081
|
+
/** Stable key shared by equivalent event operations. */
|
|
8082
|
+
eventKey?: string;
|
|
8083
|
+
}
|
|
8084
|
+
/**
|
|
8085
|
+
* Produces the opaque reference associated with a KHR event operation.
|
|
8086
|
+
*/
|
|
8087
|
+
export class FlowGraphEventReferenceBlock extends FlowGraphExecutionBlock {
|
|
8088
|
+
config: IFlowGraphEventReferenceBlockConfiguration;
|
|
8089
|
+
private readonly _assetInverse;
|
|
8090
|
+
private readonly _selectionPointValue;
|
|
8091
|
+
private readonly _selectionRayOriginValue;
|
|
8092
|
+
/** Output flow activated after event values are captured. */
|
|
8093
|
+
readonly out: FlowGraphSignalConnection;
|
|
8094
|
+
/** Runtime node associated with the event. */
|
|
8095
|
+
readonly node: FlowGraphDataConnection<object | undefined>;
|
|
8096
|
+
/** Controller index associated with the event. */
|
|
8097
|
+
readonly controllerIndexInput: FlowGraphDataConnection<number>;
|
|
8098
|
+
/** Selection point associated with the event. */
|
|
8099
|
+
readonly selectionPointInput: FlowGraphDataConnection<Vector3>;
|
|
8100
|
+
/** Selection ray origin associated with the event. */
|
|
8101
|
+
readonly selectionRayOriginInput: FlowGraphDataConnection<Vector3>;
|
|
8102
|
+
/** Opaque node reference. */
|
|
8103
|
+
readonly nodeReference: FlowGraphDataConnection<string>;
|
|
8104
|
+
/** Retained controller index. */
|
|
8105
|
+
readonly controllerIndex: FlowGraphDataConnection<number>;
|
|
8106
|
+
/** Retained selection point. */
|
|
8107
|
+
readonly selectionPoint: FlowGraphDataConnection<Vector3>;
|
|
8108
|
+
/** Retained selection ray origin. */
|
|
8109
|
+
readonly selectionRayOrigin: FlowGraphDataConnection<Vector3>;
|
|
8110
|
+
/** Opaque event reference. */
|
|
8111
|
+
readonly value: FlowGraphDataConnection<string>;
|
|
8112
|
+
constructor(config: IFlowGraphEventReferenceBlockConfiguration);
|
|
8113
|
+
/** @internal */
|
|
8114
|
+
_execute(context: FlowGraphContext): void;
|
|
8115
|
+
/** @returns the serialized class name */
|
|
8116
|
+
getClassName(): string;
|
|
8117
|
+
}
|
|
8118
|
+
|
|
8119
|
+
|
|
8120
|
+
|
|
8121
|
+
}
|
|
8122
|
+
declare namespace BABYLON {
|
|
8123
|
+
|
|
8124
|
+
|
|
8125
|
+
}
|
|
8126
|
+
declare namespace BABYLON.GLTF2.Loader.Extensions {
|
|
8127
|
+
/**
|
|
8128
|
+
* Describes how one KHR_interactivity configuration or socket property maps to FlowGraph.
|
|
8129
|
+
*
|
|
8130
|
+
* The same contract is used for fixed sockets, wildcard sockets, configuration validation,
|
|
8131
|
+
* defaulting, and multi-block routing during strict graph lowering.
|
|
8132
|
+
*/
|
|
8133
|
+
export interface IGLTFToFlowGraphMappingObject {
|
|
7773
8134
|
/**
|
|
7774
8135
|
* The name of the property in the FlowGraph block.
|
|
7775
8136
|
*/
|
|
7776
8137
|
name: string;
|
|
8138
|
+
/**
|
|
8139
|
+
* Whether this socket mapping exists only for pre-ratification compatibility input.
|
|
8140
|
+
*/
|
|
8141
|
+
compatibilityOnly?: boolean;
|
|
7777
8142
|
/**
|
|
7778
8143
|
* The type of the property in the glTF specs.
|
|
7779
8144
|
* If not provided will be inferred.
|
|
@@ -7806,7 +8171,7 @@ declare namespace BABYLON.GLTF2.Loader.Extensions {
|
|
|
7806
8171
|
* This is used if we generate more than one block for a single glTF node.
|
|
7807
8172
|
* Defaults to the first block in the mapping.
|
|
7808
8173
|
*/
|
|
7809
|
-
toBlock?: FlowGraphBlockNames;
|
|
8174
|
+
toBlock?: FlowGraphBlockNames | string;
|
|
7810
8175
|
/**
|
|
7811
8176
|
* Used in configuration values. If defined, this will be the default value, if no value is provided.
|
|
7812
8177
|
*/
|
|
@@ -7820,6 +8185,75 @@ declare namespace BABYLON.GLTF2.Loader.Extensions {
|
|
|
7820
8185
|
* be fed by a `pointer/get` (e.g. the read-only `maxTime` animation pointer).
|
|
7821
8186
|
*/
|
|
7822
8187
|
convertConnectedTimeToFrames?: boolean;
|
|
8188
|
+
/**
|
|
8189
|
+
* KHR configuration value type used by canonical validation.
|
|
8190
|
+
*/
|
|
8191
|
+
configurationType?: "bool" | "int" | "int[]" | "string";
|
|
8192
|
+
/**
|
|
8193
|
+
* Whether this configuration entry exists only for canonical validation.
|
|
8194
|
+
*/
|
|
8195
|
+
validationOnly?: boolean;
|
|
8196
|
+
/**
|
|
8197
|
+
* Whether an operation without a complete default configuration requires this property.
|
|
8198
|
+
*/
|
|
8199
|
+
required?: boolean;
|
|
8200
|
+
/**
|
|
8201
|
+
* Graph array referenced by an integer configuration value.
|
|
8202
|
+
*/
|
|
8203
|
+
indexSource?: "types" | "variables" | "events" | "nodes" | "assetNodes";
|
|
8204
|
+
/**
|
|
8205
|
+
* Minimum number of values required for an array configuration.
|
|
8206
|
+
*/
|
|
8207
|
+
minItems?: number;
|
|
8208
|
+
/**
|
|
8209
|
+
* Whether the configured indices generate required input value sockets.
|
|
8210
|
+
*/
|
|
8211
|
+
generatesInputValueSockets?: boolean;
|
|
8212
|
+
/**
|
|
8213
|
+
* Whether integer case values generate required input value sockets.
|
|
8214
|
+
*/
|
|
8215
|
+
generatesCaseInputValueSockets?: boolean;
|
|
8216
|
+
/**
|
|
8217
|
+
* Whether this string configuration generates JSON Pointer Template sockets.
|
|
8218
|
+
*/
|
|
8219
|
+
pointerTemplate?: boolean;
|
|
8220
|
+
/**
|
|
8221
|
+
* Whether an invalid value falls back to the operation's default configuration.
|
|
8222
|
+
*/
|
|
8223
|
+
invalidUsesDefault?: boolean;
|
|
8224
|
+
/**
|
|
8225
|
+
* Allowed KHR type signatures for a type-index configuration.
|
|
8226
|
+
*/
|
|
8227
|
+
allowedSignatures?: readonly ("bool" | "float" | "float2" | "float3" | "float4" | "float2x2" | "float3x3" | "float4x4" | "int" | "ref" | "custom")[];
|
|
8228
|
+
/**
|
|
8229
|
+
* Input socket whose effective type determines this output socket type.
|
|
8230
|
+
*/
|
|
8231
|
+
typeSourceInput?: string;
|
|
8232
|
+
/** Inclusive minimum for an integer configuration value. */
|
|
8233
|
+
minimum?: number;
|
|
8234
|
+
/** Inclusive maximum for an integer configuration value. */
|
|
8235
|
+
maximum?: number;
|
|
8236
|
+
/**
|
|
8237
|
+
* Whether this configuration value generates numbered input flow sockets.
|
|
8238
|
+
*/
|
|
8239
|
+
generatesInputFlowSockets?: boolean;
|
|
8240
|
+
/**
|
|
8241
|
+
* Whether this configuration array generates output flow sockets.
|
|
8242
|
+
*/
|
|
8243
|
+
generatesOutputFlowSockets?: boolean;
|
|
8244
|
+
/**
|
|
8245
|
+
* Properties in the same group fall back to their defaults together when any member is
|
|
8246
|
+
* missing or invalid.
|
|
8247
|
+
*/
|
|
8248
|
+
configurationGroup?: string;
|
|
8249
|
+
/**
|
|
8250
|
+
* Whether duplicate array values are removed from the effective configuration.
|
|
8251
|
+
*/
|
|
8252
|
+
uniqueValues?: boolean;
|
|
8253
|
+
/**
|
|
8254
|
+
* Whether a string configuration value is a `debug/log` message template.
|
|
8255
|
+
*/
|
|
8256
|
+
debugLogTemplate?: boolean;
|
|
7823
8257
|
}
|
|
7824
8258
|
/**
|
|
7825
8259
|
* Description of how a KHR_interactivity declaration (op such as
|
|
@@ -7834,6 +8268,13 @@ declare namespace BABYLON.GLTF2.Loader.Extensions {
|
|
|
7834
8268
|
* When adding blocks defined in this module use the KHR_interactivity prefix.
|
|
7835
8269
|
*/
|
|
7836
8270
|
blocks: (FlowGraphBlockNames | string)[];
|
|
8271
|
+
/**
|
|
8272
|
+
* Exact value socket contract for an operation supplied by another extension.
|
|
8273
|
+
*/
|
|
8274
|
+
declarationSchema?: {
|
|
8275
|
+
inputValueSockets: Record<string, "bool" | "float" | "float2" | "float3" | "float4" | "float2x2" | "float3x3" | "float4x4" | "int" | "ref" | "custom">;
|
|
8276
|
+
outputValueSockets: Record<string, "bool" | "float" | "float2" | "float3" | "float4" | "float2x2" | "float3x3" | "float4x4" | "int" | "ref" | "custom">;
|
|
8277
|
+
};
|
|
7837
8278
|
/**
|
|
7838
8279
|
* The inputs of the glTF node mapped to the FlowGraph block.
|
|
7839
8280
|
*/
|
|
@@ -7942,6 +8383,12 @@ declare namespace BABYLON.GLTF2.Loader.Extensions {
|
|
|
7942
8383
|
}
|
|
7943
8384
|
export function getMappingForFullOperationName(fullOperationName: string): IGLTFToFlowGraphMapping | undefined;
|
|
7944
8385
|
export function getMappingForDeclaration(declaration: BABYLON.GLTF2.IKHRInteractivity_Declaration, returnNoOpIfNotAvailable?: boolean): IGLTFToFlowGraphMapping | undefined;
|
|
8386
|
+
/**
|
|
8387
|
+
* Creates the typed no-op mapping required for an unsupported extension declaration.
|
|
8388
|
+
* @param declaration unsupported extension declaration
|
|
8389
|
+
* @returns a mapping that preserves the declared value sockets
|
|
8390
|
+
*/
|
|
8391
|
+
export function getNoOpMappingForDeclaration(declaration: BABYLON.GLTF2.IKHRInteractivity_Declaration): IGLTFToFlowGraphMapping;
|
|
7945
8392
|
/**
|
|
7946
8393
|
* This function will add new mapping to glTF interactivity.
|
|
7947
8394
|
* Other extensions can define new types of blocks, this is the way to let interactivity know how to parse them.
|
|
@@ -7950,6 +8397,22 @@ declare namespace BABYLON.GLTF2.Loader.Extensions {
|
|
|
7950
8397
|
* @param mapping The mapping object. See documentation or examples below.
|
|
7951
8398
|
*/
|
|
7952
8399
|
export function addNewInteractivityFlowGraphMapping(key: string, extension: string, mapping: IGLTFToFlowGraphMapping): void;
|
|
8400
|
+
/**
|
|
8401
|
+
* Result of parsing a ratified `debug/log` message template.
|
|
8402
|
+
*/
|
|
8403
|
+
export interface IDebugLogTemplateParseResult {
|
|
8404
|
+
/** Whether all literal braces are doubled and every parameter is well formed. */
|
|
8405
|
+
valid: boolean;
|
|
8406
|
+
/** Unique parameter socket ids in first-occurrence order. */
|
|
8407
|
+
sockets: string[];
|
|
8408
|
+
}
|
|
8409
|
+
/**
|
|
8410
|
+
* Parses a ratified `debug/log` message template.
|
|
8411
|
+
* Literal braces must be doubled; non-empty text inside a single brace pair defines a socket id.
|
|
8412
|
+
* @param message message template to parse
|
|
8413
|
+
* @returns template validity and its exact dynamic socket ids
|
|
8414
|
+
*/
|
|
8415
|
+
export function ParseDebugLogTemplate(message: string): IDebugLogTemplateParseResult;
|
|
7953
8416
|
export function getAllSupportedNativeNodeTypes(): string[];
|
|
7954
8417
|
/**
|
|
7955
8418
|
*
|
|
@@ -10322,17 +10785,20 @@ declare namespace BABYLON {
|
|
|
10322
10785
|
/** Number of times a failed file download is retried before giving up. PlayCanvas default `2`. */
|
|
10323
10786
|
maxDownloadRetries?: number;
|
|
10324
10787
|
/**
|
|
10325
|
-
* GPU memory
|
|
10326
|
-
*
|
|
10327
|
-
*
|
|
10328
|
-
*
|
|
10329
|
-
*
|
|
10788
|
+
* Initial GPU/CPU memory estimate (in megabytes) for resident splats. It is converted to a splat count
|
|
10789
|
+
* using the per-splat cost (core data plus any baked SH and rotation/scale textures), combined with
|
|
10790
|
+
* {@link maxResidentSplats} by taking the smaller limit, then raised when necessary to fit the complete
|
|
10791
|
+
* coarse layer. The work buffer has a fixed lifetime capacity; construct a new stream to use another limit.
|
|
10792
|
+
* Finite non-positive values leave this limit unset; non-finite values are rejected.
|
|
10330
10793
|
*/
|
|
10331
10794
|
memoryBudgetMb?: number;
|
|
10332
10795
|
/**
|
|
10333
|
-
*
|
|
10334
|
-
*
|
|
10335
|
-
*
|
|
10796
|
+
* Initial maximum number of splats kept resident in the fixed-size work buffer. It is raised when necessary
|
|
10797
|
+
* to fit the complete coarse layer. When unset and the complete source size is known, streams retain the complete
|
|
10798
|
+
* source. Streams that defer finer metadata use a bounded device-tiered default with coarse-derived refinement
|
|
10799
|
+
* headroom.
|
|
10800
|
+
* Finite non-positive values leave this limit unset; non-finite or unsafe positive counts are rejected.
|
|
10801
|
+
* Positive fractional counts are floored to at least one splat before applying the coarse minimum.
|
|
10336
10802
|
*/
|
|
10337
10803
|
maxResidentSplats?: number;
|
|
10338
10804
|
/**
|
|
@@ -10362,10 +10828,10 @@ declare namespace BABYLON {
|
|
|
10362
10828
|
/**
|
|
10363
10829
|
* When true, higher-order spherical-harmonics carried by the SOG files (`shN`) are GPU-decoded into baked
|
|
10364
10830
|
* packed-u32 SH textures so the streamed splats render with view-dependent lighting (matching the non-stream
|
|
10365
|
-
* `.spz`/`.sog` path) instead of flat DC-only color.
|
|
10366
|
-
*
|
|
10367
|
-
*
|
|
10368
|
-
*
|
|
10831
|
+
* `.spz`/`.sog` path) instead of flat DC-only color. Streams with complete initial metadata use the maximum
|
|
10832
|
+
* source SH degree. Streams that defer finer metadata reserve the supported degree-4 layout before it is known,
|
|
10833
|
+
* even if the files ultimately carry no `shN`; lower-degree files neutral-fill the unused bands.
|
|
10834
|
+
* Defaults to `true`; set to `false` to force flat DC-only color and avoid the SH decode cost/texture memory.
|
|
10369
10835
|
*/
|
|
10370
10836
|
decodeSh?: boolean;
|
|
10371
10837
|
/**
|
|
@@ -10410,6 +10876,7 @@ declare namespace BABYLON {
|
|
|
10410
10876
|
private _hostBudgetAllocation;
|
|
10411
10877
|
private _frustumCulling;
|
|
10412
10878
|
private readonly _frustumPlanes;
|
|
10879
|
+
private readonly _cullCameraViewProj;
|
|
10413
10880
|
private readonly _cullViewProj;
|
|
10414
10881
|
private readonly _frustumScratch;
|
|
10415
10882
|
private _workBuffer;
|
|
@@ -10423,6 +10890,7 @@ declare namespace BABYLON {
|
|
|
10423
10890
|
private _residency;
|
|
10424
10891
|
private readonly _fileCounts;
|
|
10425
10892
|
private readonly _fileMeta;
|
|
10893
|
+
private readonly _baseFileIds;
|
|
10426
10894
|
private readonly _decodedFiles;
|
|
10427
10895
|
private readonly _loadingFiles;
|
|
10428
10896
|
private readonly _decodeQueue;
|
|
@@ -10430,6 +10898,7 @@ declare namespace BABYLON {
|
|
|
10430
10898
|
private readonly _cancelledDecodes;
|
|
10431
10899
|
private _evictionEnabled;
|
|
10432
10900
|
private _residentBudget;
|
|
10901
|
+
private _minimumResidentSplats;
|
|
10433
10902
|
private _maxResidentSplats;
|
|
10434
10903
|
private _memoryBudgetMb;
|
|
10435
10904
|
private _evictionCooldownFrames;
|
|
@@ -10441,6 +10910,7 @@ declare namespace BABYLON {
|
|
|
10441
10910
|
private _environmentFiles;
|
|
10442
10911
|
private _lodObserver;
|
|
10443
10912
|
private _baseLayerReady;
|
|
10913
|
+
private _metadataReady;
|
|
10444
10914
|
private _framesSinceLodUpdate;
|
|
10445
10915
|
private readonly _lastLodCamPositions;
|
|
10446
10916
|
private _lastLodSignature;
|
|
@@ -10563,10 +11033,19 @@ declare namespace BABYLON {
|
|
|
10563
11033
|
/**
|
|
10564
11034
|
* The resolved maximum number of splats kept resident in the work buffer. This combines
|
|
10565
11035
|
* {@link IGaussianSplattingStreamOptions.maxResidentSplats} and {@link IGaussianSplattingStreamOptions.memoryBudgetMb},
|
|
10566
|
-
* taking the smaller limit
|
|
11036
|
+
* taking the smaller positive limit and raising it to {@link minimumResidentSplats}. With neither limit set,
|
|
11037
|
+
* the complete source size is retained when known; otherwise a bounded device-tiered default is used.
|
|
11038
|
+
* The fixed capacity is capped at the device texture limit. `0` means initial capacity has not been resolved.
|
|
10567
11039
|
* @experimental
|
|
10568
11040
|
*/
|
|
10569
11041
|
get residentSplatBudget(): number;
|
|
11042
|
+
/**
|
|
11043
|
+
* Minimum fixed work-buffer capacity required for the complete coarse representation: one invisible padding
|
|
11044
|
+
* splat, the included environment, and every unique whole coarse source file. It is `0` until the required
|
|
11045
|
+
* coarse metadata has resolved. Initial residency options below this value are raised to it.
|
|
11046
|
+
* @experimental
|
|
11047
|
+
*/
|
|
11048
|
+
get minimumResidentSplats(): number;
|
|
10570
11049
|
/**
|
|
10571
11050
|
* The total number of splats represented by valid level-0 leaf entries. This remains pending while source
|
|
10572
11051
|
* metadata is loading and is unavailable when no applicable level-0 entries exist or required metadata fails.
|
|
@@ -10641,14 +11120,14 @@ declare namespace BABYLON {
|
|
|
10641
11120
|
set debugLodSource(value: GaussianSplattingStreamDebugLodSource);
|
|
10642
11121
|
dispose(doNotRecurse?: boolean): void;
|
|
10643
11122
|
/**
|
|
10644
|
-
* Disposes this stream
|
|
10645
|
-
*
|
|
11123
|
+
* Disposes this stream and, when hosted, compacts the host once to reclaim its tombstoned region's reserved
|
|
11124
|
+
* rows. Used on a definitive load failure / empty result — a discrete, one-off reclaim, versus a bare
|
|
10646
11125
|
* {@link dispose} that only tombstones so tearing down several parts doesn't rebuild the atlas repeatedly.
|
|
10647
11126
|
*/
|
|
10648
11127
|
private _disposeAndReclaim;
|
|
10649
11128
|
/**
|
|
10650
11129
|
* The world matrix that actually places this stream's splats, used to map the camera into the space the
|
|
10651
|
-
* node bounds live in (for LOD distance) and to build
|
|
11130
|
+
* node bounds live in (for LOD distance) and to build camera-local frusta (for frustum culling). Standalone:
|
|
10652
11131
|
* this controller mesh carries the transform. Hosted: this controller is a hidden, unplaced node — the splats
|
|
10653
11132
|
* are placed by the reserved part's proxy (SOG up-axis basis composed with the host's placement), so LOD and
|
|
10654
11133
|
* culling MUST use the proxy's world matrix or they compute distances/frustum tests in the wrong space
|
|
@@ -10716,9 +11195,9 @@ declare namespace BABYLON {
|
|
|
10716
11195
|
*/
|
|
10717
11196
|
private _collectLodEntries;
|
|
10718
11197
|
/**
|
|
10719
|
-
* Streams the scene
|
|
10720
|
-
*
|
|
10721
|
-
*
|
|
11198
|
+
* Streams the scene. Large streams fetch only required coarse metadata before allocating and decoding the
|
|
11199
|
+
* complete coarse layer; finer metadata starts afterwards so it cannot occupy the download queue ahead of
|
|
11200
|
+
* visible geometry. Small streams and streams containing only coarse files retain an exact all-file capacity upper bound.
|
|
10722
11201
|
*/
|
|
10723
11202
|
private _streamAllAsync;
|
|
10724
11203
|
/**
|
|
@@ -10731,26 +11210,47 @@ declare namespace BABYLON {
|
|
|
10731
11210
|
*/
|
|
10732
11211
|
private _waitForCanBackupAsync;
|
|
10733
11212
|
/**
|
|
10734
|
-
* Resolves the
|
|
10735
|
-
*
|
|
10736
|
-
*
|
|
10737
|
-
*
|
|
11213
|
+
* Resolves the fixed initial work-buffer capacity. Explicit count/MB limits are combined by taking the smaller
|
|
11214
|
+
* and then raised to the complete coarse minimum. Without an explicit limit, a known complete source retains
|
|
11215
|
+
* legacy full residency. When finer metadata is deferred and the complete size is unknown, the device-tiered
|
|
11216
|
+
* memory estimate is given at least one largest-coarse-file of headroom so one replacement file can refine
|
|
11217
|
+
* while all coarse fallback files remain pinned.
|
|
11218
|
+
* @param fullCapacity exact complete source capacity, or null when unavailable
|
|
11219
|
+
* @param largestBaseFileCount largest whole coarse source file, used as modest replacement headroom
|
|
11220
|
+
* @returns the fixed initial work-buffer capacity
|
|
10738
11221
|
*/
|
|
10739
11222
|
private _resolveResidentBudget;
|
|
11223
|
+
/**
|
|
11224
|
+
* Returns the estimated combined GPU/CPU bytes occupied by one resident splat.
|
|
11225
|
+
* @returns estimated bytes per resident splat
|
|
11226
|
+
*/
|
|
11227
|
+
private _bytesPerResidentSplat;
|
|
10740
11228
|
/**
|
|
10741
11229
|
* Collects the unique set of source file indices referenced by any LOD of any leaf, sorted ascending.
|
|
10742
11230
|
* @returns sorted unique file indices
|
|
10743
11231
|
*/
|
|
10744
11232
|
private _collectAllFileIds;
|
|
11233
|
+
/**
|
|
11234
|
+
* Collects unique whole source files required by the coarsest entry of every valid leaf.
|
|
11235
|
+
* @returns sorted unique coarse file indices
|
|
11236
|
+
*/
|
|
11237
|
+
private _collectBaseFileIds;
|
|
11238
|
+
/**
|
|
11239
|
+
* Resolves the immutable minimum initial capacity from padding, environment, and unique whole coarse files.
|
|
11240
|
+
* @param baseFileIds unique coarse source file indices
|
|
11241
|
+
* @param environmentCount included environment splat count
|
|
11242
|
+
*/
|
|
11243
|
+
private _resolveMinimumResidentSplats;
|
|
10745
11244
|
/**
|
|
10746
11245
|
* Settles the level-0 diagnostic from normalized renderable leaf entries after their source metadata resolves.
|
|
10747
11246
|
* A file may back several leaf ranges, so its source count is deliberately not used in the total.
|
|
10748
11247
|
*/
|
|
10749
11248
|
private _resolveLod0SplatCount;
|
|
10750
11249
|
/**
|
|
10751
|
-
* Fetches the environment bundle and
|
|
10752
|
-
* each file's parsed metadata for the later on-demand decode.
|
|
11250
|
+
* Fetches the environment bundle and the supplied referenced files' metadata to learn splat counts, caching
|
|
11251
|
+
* each file's parsed metadata for the later on-demand decode. File metadata fetches run in parallel.
|
|
10753
11252
|
* @param fileIds file indices to fetch metadata for
|
|
11253
|
+
* @param includeEnvironment whether to fetch the optional environment bundle in this phase
|
|
10754
11254
|
* @returns the environment splat count (0 when there is no environment)
|
|
10755
11255
|
*/
|
|
10756
11256
|
private _gatherCountsAsync;
|
|
@@ -10818,6 +11318,7 @@ declare namespace BABYLON {
|
|
|
10818
11318
|
* Concurrent or repeat requests for the same file are ignored. If the file is cancelled mid-flight
|
|
10819
11319
|
* (because every node that wanted it retargeted), the decode bails cooperatively at the next checkpoint.
|
|
10820
11320
|
* @param fileId file index to decode
|
|
11321
|
+
* @returns whether the file was decoded and published successfully
|
|
10821
11322
|
*/
|
|
10822
11323
|
private _decodeFileAsync;
|
|
10823
11324
|
/**
|
|
@@ -10982,6 +11483,22 @@ declare namespace BABYLON {
|
|
|
10982
11483
|
* @returns whether any node's in-frustum state changed
|
|
10983
11484
|
*/
|
|
10984
11485
|
private _updateNodeFrustum;
|
|
11486
|
+
/**
|
|
11487
|
+
* Normalizes an initial residency option, preserving finite non-positive values as an unset limit.
|
|
11488
|
+
* @param value option value
|
|
11489
|
+
* @param name option name used in errors
|
|
11490
|
+
* @param integer whether the normalized value must be an integer splat count
|
|
11491
|
+
* @returns normalized value
|
|
11492
|
+
*/
|
|
11493
|
+
private static _NormalizeResidentLimit;
|
|
11494
|
+
/**
|
|
11495
|
+
* Adds trusted non-negative integer counts without allowing unsafe capacity arithmetic.
|
|
11496
|
+
* @param left first count
|
|
11497
|
+
* @param right second count
|
|
11498
|
+
* @param label capacity name used in errors
|
|
11499
|
+
* @returns the safe integer sum
|
|
11500
|
+
*/
|
|
11501
|
+
private static _SafeAddCounts;
|
|
10985
11502
|
/**
|
|
10986
11503
|
* Reads the splat count from SOG metadata, coerced to a finite non-negative integer (metadata is untrusted, so
|
|
10987
11504
|
* `count` / `shape[0]` may be a string or malformed — a non-numeric value must not leak into count arithmetic).
|