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.

58 lines (54 loc) 2.38 kB
import { c as FlowGraphExecutionBlockWithOutSignal, g as getNumericValue, M as MarkDelayInactive } from './KHR_interactivity-CnR665Qq.esm.js'; import { k as RichTypeFlowGraphInteger } from './declarationMapper-mPOKbCS_.esm.js'; import { u as RegisterClass } from './index-HyNDfLMI.esm.js'; import './objectModelMapping-OlchA9xj.esm.js'; import './spotLight.pure-C65PiYTZ.esm.js'; /** This file must only contain pure code and pure imports */ /** * This block cancels a delay that was previously scheduled. */ class FlowGraphCancelDelayBlock extends FlowGraphExecutionBlockWithOutSignal { constructor(config) { super(config); this.delayIndex = this.registerDataInput("delayIndex", RichTypeFlowGraphInteger); } _execute(context, _callingSignal) { const delayIndex = getNumericValue(this.delayIndex.getValue(context)); if (delayIndex < 0 || isNaN(delayIndex) || !isFinite(delayIndex)) { return this._reportError(context, "Invalid delay index"); } const timers = context._getGlobalContextVariable("pendingDelays", []); const timer = timers[delayIndex]; if (timer) { timer.dispose(); delete timers[delayIndex]; context._setGlobalContextVariable("pendingDelays", timers); } // The delay is cancelled, so drop it from the active set used by handle validity checks. MarkDelayInactive(context, delayIndex); // activate the out output flow this.out._activateSignal(context); } getClassName() { return "FlowGraphCancelDelayBlock" /* FlowGraphBlockNames.CancelDelay */; } } let _Registered = false; /** * Register side effects for flowGraphCancelDelayBlock. * Safe to call multiple times; only the first call has an effect. */ function RegisterFlowGraphCancelDelayBlock() { if (_Registered) { return; } _Registered = true; RegisterClass("FlowGraphCancelDelayBlock" /* FlowGraphBlockNames.CancelDelay */, FlowGraphCancelDelayBlock); } /** * Re-exports pure implementation and applies runtime side effects. * Import flowGraphCancelDelayBlock.pure for tree-shakeable, side-effect-free usage. */ RegisterFlowGraphCancelDelayBlock(); export { FlowGraphCancelDelayBlock, RegisterFlowGraphCancelDelayBlock }; //# sourceMappingURL=flowGraphCancelDelayBlock-DgGum9Vr.esm.js.map