@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.
58 lines (54 loc) • 2.07 kB
JavaScript
import { f as FlowGraphExecutionBlock } from './KHR_interactivity-CEwUaqxQ.esm.js';
import { a as RichTypeBoolean } from './declarationMapper-CqO08-WM.esm.js';
import { u as RegisterClass } from './index-MZPybX0H.esm.js';
import './objectModelMapping-De5EKNEZ.esm.js';
import './spotLight.pure-CRdZC6Ci.esm.js';
/** This file must only contain pure code and pure imports */
/**
* 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 */;
}
}
let _Registered = false;
/**
* Register side effects for flowGraphFlipFlopBlock.
* Safe to call multiple times; only the first call has an effect.
*/
function RegisterFlowGraphFlipFlopBlock() {
if (_Registered) {
return;
}
_Registered = true;
RegisterClass("FlowGraphFlipFlopBlock" /* FlowGraphBlockNames.FlipFlop */, FlowGraphFlipFlopBlock);
}
/**
* Re-exports pure implementation and applies runtime side effects.
* Import flowGraphFlipFlopBlock.pure for tree-shakeable, side-effect-free usage.
*/
RegisterFlowGraphFlipFlopBlock();
export { FlowGraphFlipFlopBlock, RegisterFlowGraphFlipFlopBlock };
//# sourceMappingURL=flowGraphFlipFlopBlock-B0gG_WtG.esm.js.map