UNPKG

@babylonjs/core

Version:

Getting started? Play directly with the Babylon.js API using our [playground](https://playground.babylonjs.com/). It also contains a lot of samples to learn how to use it.

68 lines (67 loc) 2.59 kB
import { type FlowGraphSignalConnection } from "../../../flowGraphSignalConnection.js"; import { type FlowGraphDataConnection } from "../../../flowGraphDataConnection.js"; import { FlowGraphExecutionBlockWithOutSignal } from "../../../flowGraphExecutionBlockWithOutSignal.js"; import { type FlowGraphContext } from "../../../flowGraphContext.js"; import { type IFlowGraphBlockConfiguration } from "../../../flowGraphBlock.js"; import { type FlowGraphNumber } from "../../../utils.js"; import { FlowGraphInteger } from "../../../CustomTypes/flowGraphInteger.js"; /** * Configuration for the For Loop block. */ export interface IFlowGraphForLoopBlockConfiguration extends IFlowGraphBlockConfiguration { /** * The initial index of the loop. * if not set will default to 0 */ initialIndex?: FlowGraphNumber; /** * If set to true, the index of the case will be incremented when the loop is done. * This will result that the index will equal endIndex when the loop finished its work. * This is the default behavior in glTF interactivity */ incrementIndexWhenLoopDone?: boolean; } /** * Block that executes an action in a loop. */ export declare class FlowGraphForLoopBlock extends FlowGraphExecutionBlockWithOutSignal { /** * The maximum number of iterations allowed for the loop. * If the loop exceeds this number, it will stop. This number is configurable to avoid infinite loops. */ static MaxLoopIterations: number; /** * Input connection: The start index of the loop. */ readonly startIndex: FlowGraphDataConnection<FlowGraphNumber>; /** * Input connection: The end index of the loop. */ readonly endIndex: FlowGraphDataConnection<FlowGraphNumber>; /** * Input connection: The step of the loop. */ readonly step: FlowGraphDataConnection<number>; /** * Output connection: The current index of the loop. */ readonly index: FlowGraphDataConnection<FlowGraphInteger>; /** * Output connection: The signal that is activated when the loop body is executed. */ readonly executionFlow: FlowGraphSignalConnection; /** * Output connection: The completed signal. Triggered when condition is false. * No out signal is available. */ readonly completed: FlowGraphSignalConnection; constructor(config?: IFlowGraphForLoopBlockConfiguration); /** * @internal */ _execute(context: FlowGraphContext): void; /** * @returns class name of the block. */ getClassName(): string; }