Class InteractivityGraphToFlowGraphParser
Constructors
constructor
-
new InteractivityGraphToFlowGraphParser(
interactivityGraph: IKHRInteractivity_Graph,
_gltf: IGLTF,
_animationTargetFps?: number,
_graphIndex?: number,
_supportedExtensions?: ReadonlySet<string>,
_declarationModels?: readonly IKHRInteractivityDeclarationModel[],
canonicalGraph?: any,
): InteractivityGraphToFlowGraphParserParameters
- interactivityGraph: IKHRInteractivity_Graph
- _gltf: IGLTF
- _animationTargetFps: number = 60
- _graphIndex: number = 0
Optional_supportedExtensions: ReadonlySet<string>Optional_declarationModels: readonly IKHRInteractivityDeclarationModel[]OptionalcanonicalGraph: any
Returns InteractivityGraphToFlowGraphParser
Accessors
arrays
-
get arrays(): {
events: InteractivityEvent[];
mappings: {
declaration: IKHRInteractivityDeclarationModel;
flowGraphMapping: IGLTFToFlowGraphMapping;
fullOperationName: string;
}[];
nodes: { blocks: ISerializedFlowGraphBlock[]; fullOperationName: string }[];
staticVariables: { type: FlowGraphTypes; value: any[] }[];
types: {
elementType: "string" | "number" | "boolean" | "any";
flowGraphType: FlowGraphTypes;
length: number;
}[];
}Returns {
events: InteractivityEvent[];
mappings: {
declaration: IKHRInteractivityDeclarationModel;
flowGraphMapping: IGLTFToFlowGraphMapping;
fullOperationName: string;
}[];
nodes: { blocks: ISerializedFlowGraphBlock[]; fullOperationName: string }[];
staticVariables: { type: FlowGraphTypes; value: any[] }[];
types: {
elementType: "string" | "number" | "boolean" | "any";
flowGraphType: FlowGraphTypes;
length: number;
}[];
}
Methods
get Variable Name
-
Returns the deterministic FlowGraph user-variable name used for the static variable at the given declaration index.
Parameters
- index: number
zero-based index into the interactivity graph's
variablesarray.
Returns string
the FlowGraph variable name (e.g.
staticVariable_3). - index: number
serialize To Flow Graph
-
Serializes the parsed interactivity graph into the ISerializedFlowGraph payload consumed by
ParseFlowGraphAsync. Performs node-connection wiring and seeds the execution context with the graph's static variables.Returns ISerializedFlowGraph
the serialized FlowGraph for the parsed KHR_interactivity graph.
Parses a KHR_interactivity graph definition (the raw glTF JSON object) into the serialized FlowGraph form consumed by ParseFlowGraphAsync.
The class walks the interactivity types, declarations, variables, events and nodes in order and emits an ISerializedFlowGraph via serializeToFlowGraph.