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.

62 lines (58 loc) 2.52 kB
import { a as FlowGraphEventBlock, e as _IsDescendantOf } from './KHR_interactivity-CEwUaqxQ.esm.js'; import { d as RichTypeNumber, R as RichTypeAny } 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 */ /** * A pointe out event block. * This block can be used as an entry pointer to when a pointer is out of a specific target mesh. */ class FlowGraphPointerOutEventBlock extends FlowGraphEventBlock { constructor(config) { super(config); this.type = "PointerOut" /* FlowGraphEventType.PointerOut */; this.pointerId = this.registerDataOutput("pointerId", RichTypeNumber); this.targetMesh = this.registerDataInput("targetMesh", RichTypeAny, config?.targetMesh); this.meshOutOfPointer = this.registerDataOutput("meshOutOfPointer", RichTypeAny); } _executeEvent(context, payload) { const mesh = this.targetMesh.getValue(context); this.meshOutOfPointer.setValue(payload.mesh, context); this.pointerId.setValue(payload.pointerId, context); const skipEvent = payload.over && _IsDescendantOf(payload.mesh, mesh); if (!skipEvent && (payload.mesh === mesh || _IsDescendantOf(payload.mesh, mesh))) { this._execute(context); return !this.config?.stopPropagation; } return true; } _preparePendingTasks(_context) { // no-op } _cancelPendingTasks(_context) { // no-op } getClassName() { return "FlowGraphPointerOutEventBlock" /* FlowGraphBlockNames.PointerOutEvent */; } } let _Registered = false; /** * Register side effects for flowGraphPointerOutEventBlock. * Safe to call multiple times; only the first call has an effect. */ function RegisterFlowGraphPointerOutEventBlock() { if (_Registered) { return; } _Registered = true; RegisterClass("FlowGraphPointerOutEventBlock" /* FlowGraphBlockNames.PointerOutEvent */, FlowGraphPointerOutEventBlock); } /** * Re-exports pure implementation and applies runtime side effects. * Import flowGraphPointerOutEventBlock.pure for tree-shakeable, side-effect-free usage. */ RegisterFlowGraphPointerOutEventBlock(); export { FlowGraphPointerOutEventBlock, RegisterFlowGraphPointerOutEventBlock }; //# sourceMappingURL=flowGraphPointerOutEventBlock-B4VJN2yy.esm.js.map