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.

3 lines (2 loc) 1.58 kB
import{c as t,g as e}from"./KHR_interactivity-BMn2G2LI.esm.min.js";import{R as i,d as s,k as o}from"./declarationMapper-sl3auZpG.esm.min.js";import{F as n}from"./objectModelMapping-DA3c5cv8.esm.min.js";import{y as a,u as r}from"./index-OM-TXt9s.esm.min.js";import"./spotLight.pure-guqQj5Iw.esm.min.js";class p extends t{constructor(t){super(t),this.startIndex=this.registerDataInput("startIndex",i,0),this.endIndex=this.registerDataInput("endIndex",i),this.step=this.registerDataInput("step",s,1),this.index=this.registerDataOutput("index",o,new n(e(t?.initialIndex??0))),this.executionFlow=this._registerSignalOutput("executionFlow"),this.completed=this._registerSignalOutput("completed"),this._unregisterSignalOutput("out")}_execute(t){const i=e(this.startIndex.getValue(t)),s=this.step.getValue(t);let o=e(this.endIndex.getValue(t));const r=this.config?.maxLoopIterations??p.MaxLoopIterations;let l=0,h=!1;for(let a=i;a<o;a+=s)if(this.index.setValue(new n(a),t),this.executionFlow._activateSignal(t),o=e(this.endIndex.getValue(t)),++l>=r){h=!0;break}h&&a.Warn(`FlowGraphForLoopBlock: loop stopped after reaching the ${r}-iteration safety cap before its range completed.`),this.config?.incrementIndexWhenLoopDone&&this.index.setValue(new n(e(this.index.getValue(t))+s),t),this.completed._activateSignal(t)}getClassName(){return"FlowGraphForLoopBlock"}}p.MaxLoopIterations=1e3;let l=!1;function h(){l||(l=!0,r("FlowGraphForLoopBlock",p))}h();export{p as FlowGraphForLoopBlock,h as RegisterFlowGraphForLoopBlock}; //# sourceMappingURL=flowGraphForLoopBlock-CxJD0voe.esm.min.js.map