UNPKG

@babylonjs/viewer

Version:

The Babylon Viewer aims to simplify a specific but common Babylon.js use case: loading, viewing, and interacting with a 3D model.

39 lines (36 loc) 1.47 kB
import { k as FlowGraphExecutionBlock } from './KHR_interactivity-Bmb38TjL.esm.js'; import { h as RichTypeBoolean } from './declarationMapper-rcGCdcDP.esm.js'; import { R as RegisterClass } from './index-FzOfPXLV.esm.js'; import './objectModelMapping-CJnQ6at_.esm.js'; /** * This block flip flops between two outputs. */ class FlowGraphFlipFlopBlock extends FlowGraphExecutionBlock { constructor(config) { super(config); this.onOn = this._registerSignalOutput("onOn"); this.onOff = this._registerSignalOutput("onOff"); this.value = this.registerDataOutput("value", RichTypeBoolean); } _execute(context, _callingSignal) { let value = context._getExecutionVariable(this, "value", typeof this.config?.startValue === "boolean" ? !this.config.startValue : false); value = !value; context._setExecutionVariable(this, "value", value); this.value.setValue(value, context); if (value) { this.onOn._activateSignal(context); } else { this.onOff._activateSignal(context); } } /** * @returns class name of the block. */ getClassName() { return "FlowGraphFlipFlopBlock" /* FlowGraphBlockNames.FlipFlop */; } } RegisterClass("FlowGraphFlipFlopBlock" /* FlowGraphBlockNames.FlipFlop */, FlowGraphFlipFlopBlock); export { FlowGraphFlipFlopBlock }; //# sourceMappingURL=flowGraphFlipFlopBlock-Dy2UiHCa.esm.js.map