@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.
54 lines (50 loc) • 1.82 kB
JavaScript
import { a as RichTypeBoolean } from './declarationMapper-CqO08-WM.esm.js';
import { f as FlowGraphExecutionBlock } from './KHR_interactivity-CEwUaqxQ.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 */
/**
* A block that evaluates a condition and activates one of two branches.
*/
class FlowGraphBranchBlock extends FlowGraphExecutionBlock {
constructor(config) {
super(config);
this.condition = this.registerDataInput("condition", RichTypeBoolean);
this.onTrue = this._registerSignalOutput("onTrue");
this.onFalse = this._registerSignalOutput("onFalse");
}
_execute(context) {
if (this.condition.getValue(context)) {
this.onTrue._activateSignal(context);
}
else {
this.onFalse._activateSignal(context);
}
}
/**
* @returns class name of the block.
*/
getClassName() {
return "FlowGraphBranchBlock" /* FlowGraphBlockNames.Branch */;
}
}
let _Registered = false;
/**
* Register side effects for flowGraphBranchBlock.
* Safe to call multiple times; only the first call has an effect.
*/
function RegisterFlowGraphBranchBlock() {
if (_Registered) {
return;
}
_Registered = true;
RegisterClass("FlowGraphBranchBlock" /* FlowGraphBlockNames.Branch */, FlowGraphBranchBlock);
}
/**
* Re-exports pure implementation and applies runtime side effects.
* Import flowGraphBranchBlock.pure for tree-shakeable, side-effect-free usage.
*/
RegisterFlowGraphBranchBlock();
export { FlowGraphBranchBlock, RegisterFlowGraphBranchBlock };
//# sourceMappingURL=flowGraphBranchBlock-DutoF6ho.esm.js.map