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.

74 lines (70 loc) 2.56 kB
import { a as FlowGraphEventBlock } from './KHR_interactivity-CnR665Qq.esm.js'; import { d as RichTypeNumber, b as RichTypeString } 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 */ /** Event source key used to build this block's event reference. */ const EventKey = "sceneTick"; /** * Block that triggers on scene tick (before each render). */ class FlowGraphSceneTickEventBlock extends FlowGraphEventBlock { constructor() { super(); this.type = "SceneBeforeRender" /* FlowGraphEventType.SceneBeforeRender */; this.timeSinceStart = this.registerDataOutput("timeSinceStart", RichTypeNumber); this.deltaTime = this.registerDataOutput("deltaTime", RichTypeNumber); this.eventRef = this.registerDataOutput("event", RichTypeString); } _updateOutputs(context) { this.eventRef.setValue(context.getEventReference(EventKey), context); } /** * @internal */ _preparePendingTasks(_context) { // no-op } /** * @internal */ _executeEvent(context, payload) { this.timeSinceStart.setValue(payload.timeSinceStart, context); this.deltaTime.setValue(payload.deltaTime, context); this.eventRef.setValue(context.getEventReference(EventKey), context); this._execute(context); return true; } /** * @internal */ _cancelPendingTasks(_context) { // no-op } /** * @returns class name of the block. */ getClassName() { return "FlowGraphSceneTickEventBlock" /* FlowGraphBlockNames.SceneTickEvent */; } } let _Registered = false; /** * Register side effects for flowGraphSceneTickEventBlock. * Safe to call multiple times; only the first call has an effect. */ function RegisterFlowGraphSceneTickEventBlock() { if (_Registered) { return; } _Registered = true; RegisterClass("FlowGraphSceneTickEventBlock" /* FlowGraphBlockNames.SceneTickEvent */, FlowGraphSceneTickEventBlock); } /** * Re-exports pure implementation and applies runtime side effects. * Import flowGraphSceneTickEventBlock.pure for tree-shakeable, side-effect-free usage. */ RegisterFlowGraphSceneTickEventBlock(); export { FlowGraphSceneTickEventBlock, RegisterFlowGraphSceneTickEventBlock }; //# sourceMappingURL=flowGraphSceneTickEventBlock-D0RQq3os.esm.js.map