@babylonjs/core 7.51.1 → 7.51.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Animations/animation.js +2 -1
- package/Animations/animation.js.map +1 -1
- package/Buffers/bufferUtils.d.ts +7 -5
- package/Buffers/bufferUtils.js +13 -9
- package/Buffers/bufferUtils.js.map +1 -1
- package/Engines/ICanvas.d.ts +96 -1
- package/Engines/ICanvas.js.map +1 -1
- package/Engines/Native/nativeInterfaces.d.ts +7 -1
- package/Engines/Native/nativeInterfaces.js.map +1 -1
- package/Engines/WebGPU/webgpuTextureManager.js +3 -3
- package/Engines/WebGPU/webgpuTextureManager.js.map +1 -1
- package/Engines/abstractEngine.d.ts +7 -1
- package/Engines/abstractEngine.js +10 -2
- package/Engines/abstractEngine.js.map +1 -1
- package/Engines/constants.d.ts +32 -0
- package/Engines/constants.js +33 -0
- package/Engines/constants.js.map +1 -1
- package/Engines/nativeEngine.d.ts +7 -1
- package/Engines/nativeEngine.js +12 -0
- package/Engines/nativeEngine.js.map +1 -1
- package/Engines/webgpuEngine.js +6 -3
- package/Engines/webgpuEngine.js.map +1 -1
- package/FlowGraph/Blocks/Data/Math/flowGraphMathBlocks.d.ts +148 -465
- package/FlowGraph/Blocks/Data/Math/flowGraphMathBlocks.js +394 -691
- package/FlowGraph/Blocks/Data/Math/flowGraphMathBlocks.js.map +1 -1
- package/FlowGraph/Blocks/Data/Math/flowGraphMathCombineExtractBlocks.d.ts +142 -0
- package/FlowGraph/Blocks/Data/Math/flowGraphMathCombineExtractBlocks.js +342 -0
- package/FlowGraph/Blocks/Data/Math/flowGraphMathCombineExtractBlocks.js.map +1 -0
- package/FlowGraph/Blocks/Data/Math/flowGraphMatrixMathBlocks.d.ts +111 -0
- package/FlowGraph/Blocks/Data/Math/flowGraphMatrixMathBlocks.js +141 -0
- package/FlowGraph/Blocks/Data/Math/flowGraphMatrixMathBlocks.js.map +1 -0
- package/FlowGraph/Blocks/Data/Math/flowGraphVectorMathBlocks.d.ts +77 -0
- package/FlowGraph/Blocks/Data/Math/flowGraphVectorMathBlocks.js +139 -0
- package/FlowGraph/Blocks/Data/Math/flowGraphVectorMathBlocks.js.map +1 -0
- package/FlowGraph/Blocks/Data/Math/index.d.ts +3 -0
- package/FlowGraph/Blocks/Data/Math/index.js +3 -0
- package/FlowGraph/Blocks/Data/Math/index.js.map +1 -1
- package/FlowGraph/Blocks/Data/Transformers/flowGraphJsonPointerParserBlock.d.ts +85 -0
- package/FlowGraph/Blocks/Data/Transformers/flowGraphJsonPointerParserBlock.js +133 -0
- package/FlowGraph/Blocks/Data/Transformers/flowGraphJsonPointerParserBlock.js.map +1 -0
- package/FlowGraph/Blocks/Data/Transformers/flowGraphTypeToTypeBlocks.d.ts +49 -0
- package/FlowGraph/Blocks/Data/Transformers/flowGraphTypeToTypeBlocks.js +71 -0
- package/FlowGraph/Blocks/Data/Transformers/flowGraphTypeToTypeBlocks.js.map +1 -0
- package/FlowGraph/Blocks/Data/Transformers/index.d.ts +2 -0
- package/FlowGraph/Blocks/Data/Transformers/index.js +3 -0
- package/FlowGraph/Blocks/Data/Transformers/index.js.map +1 -0
- package/FlowGraph/Blocks/Data/Utils/flowGraphArrayIndexBlock.d.ts +39 -0
- package/FlowGraph/Blocks/Data/Utils/flowGraphArrayIndexBlock.js +46 -0
- package/FlowGraph/Blocks/Data/Utils/flowGraphArrayIndexBlock.js.map +1 -0
- package/FlowGraph/Blocks/Data/Utils/flowGraphCodeExecutionBlock.d.ts +35 -0
- package/FlowGraph/Blocks/Data/Utils/flowGraphCodeExecutionBlock.js +34 -0
- package/FlowGraph/Blocks/Data/Utils/flowGraphCodeExecutionBlock.js.map +1 -0
- package/FlowGraph/Blocks/Data/Utils/flowGraphContextBlock.d.ts +20 -0
- package/FlowGraph/Blocks/Data/Utils/flowGraphContextBlock.js +25 -0
- package/FlowGraph/Blocks/Data/Utils/flowGraphContextBlock.js.map +1 -0
- package/FlowGraph/Blocks/Data/Utils/flowGraphFunctionReferenceBlock.d.ts +34 -0
- package/FlowGraph/Blocks/Data/Utils/flowGraphFunctionReferenceBlock.js +35 -0
- package/FlowGraph/Blocks/Data/Utils/flowGraphFunctionReferenceBlock.js.map +1 -0
- package/FlowGraph/Blocks/Data/Utils/flowGraphIndexOfBlock.d.ts +39 -0
- package/FlowGraph/Blocks/Data/Utils/flowGraphIndexOfBlock.js +42 -0
- package/FlowGraph/Blocks/Data/Utils/flowGraphIndexOfBlock.js.map +1 -0
- package/FlowGraph/Blocks/Data/Utils/index.d.ts +5 -0
- package/FlowGraph/Blocks/Data/Utils/index.js +6 -0
- package/FlowGraph/Blocks/Data/Utils/index.js.map +1 -0
- package/FlowGraph/Blocks/Data/flowGraphBinaryOperationBlock.d.ts +0 -1
- package/FlowGraph/Blocks/Data/flowGraphBinaryOperationBlock.js +3 -2
- package/FlowGraph/Blocks/Data/flowGraphBinaryOperationBlock.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphCachedOperationBlock.d.ts +1 -1
- package/FlowGraph/Blocks/Data/flowGraphCachedOperationBlock.js +4 -4
- package/FlowGraph/Blocks/Data/flowGraphCachedOperationBlock.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphConditionalDataBlock.d.ts +6 -3
- package/FlowGraph/Blocks/Data/flowGraphConditionalDataBlock.js +12 -6
- package/FlowGraph/Blocks/Data/flowGraphConditionalDataBlock.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphConstantBlock.d.ts +0 -2
- package/FlowGraph/Blocks/Data/flowGraphConstantBlock.js +2 -3
- package/FlowGraph/Blocks/Data/flowGraphConstantBlock.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphConstantOperationBlock.d.ts +5 -4
- package/FlowGraph/Blocks/Data/flowGraphConstantOperationBlock.js +5 -4
- package/FlowGraph/Blocks/Data/flowGraphConstantOperationBlock.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphGetAssetBlock.d.ts +62 -0
- package/FlowGraph/Blocks/Data/flowGraphGetAssetBlock.js +41 -0
- package/FlowGraph/Blocks/Data/flowGraphGetAssetBlock.js.map +1 -0
- package/FlowGraph/Blocks/Data/flowGraphGetPropertyBlock.d.ts +38 -33
- package/FlowGraph/Blocks/Data/flowGraphGetPropertyBlock.js +42 -25
- package/FlowGraph/Blocks/Data/flowGraphGetPropertyBlock.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphGetVariableBlock.d.ts +11 -16
- package/FlowGraph/Blocks/Data/flowGraphGetVariableBlock.js +9 -17
- package/FlowGraph/Blocks/Data/flowGraphGetVariableBlock.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphTernaryOperationBlock.d.ts +1 -1
- package/FlowGraph/Blocks/Data/flowGraphTernaryOperationBlock.js +1 -1
- package/FlowGraph/Blocks/Data/flowGraphTernaryOperationBlock.js.map +1 -1
- package/FlowGraph/Blocks/Data/{flowGraphCoordinateTransformBlock.d.ts → flowGraphTransformCoordinatesSystemBlock.d.ts} +1 -2
- package/FlowGraph/Blocks/Data/{flowGraphCoordinateTransformBlock.js → flowGraphTransformCoordinatesSystemBlock.js} +4 -5
- package/FlowGraph/Blocks/Data/flowGraphTransformCoordinatesSystemBlock.js.map +1 -0
- package/FlowGraph/Blocks/Data/flowGraphUnaryOperationBlock.d.ts +1 -1
- package/FlowGraph/Blocks/Data/flowGraphUnaryOperationBlock.js +1 -1
- package/FlowGraph/Blocks/Data/flowGraphUnaryOperationBlock.js.map +1 -1
- package/FlowGraph/Blocks/Data/index.d.ts +7 -3
- package/FlowGraph/Blocks/Data/index.js +9 -4
- package/FlowGraph/Blocks/Data/index.js.map +1 -1
- package/FlowGraph/Blocks/Event/flowGraphMeshPickEventBlock.d.ts +45 -24
- package/FlowGraph/Blocks/Event/flowGraphMeshPickEventBlock.js +45 -51
- package/FlowGraph/Blocks/Event/flowGraphMeshPickEventBlock.js.map +1 -1
- package/FlowGraph/Blocks/Event/flowGraphPointerOutEventBlock.d.ts +61 -0
- package/FlowGraph/Blocks/Event/flowGraphPointerOutEventBlock.js +39 -0
- package/FlowGraph/Blocks/Event/flowGraphPointerOutEventBlock.js.map +1 -0
- package/FlowGraph/Blocks/Event/flowGraphPointerOverEventBlock.d.ts +61 -0
- package/FlowGraph/Blocks/Event/flowGraphPointerOverEventBlock.js +40 -0
- package/FlowGraph/Blocks/Event/flowGraphPointerOverEventBlock.js.map +1 -0
- package/FlowGraph/Blocks/Event/flowGraphReceiveCustomEventBlock.d.ts +12 -14
- package/FlowGraph/Blocks/Event/flowGraphReceiveCustomEventBlock.js +19 -26
- package/FlowGraph/Blocks/Event/flowGraphReceiveCustomEventBlock.js.map +1 -1
- package/FlowGraph/Blocks/Event/flowGraphSceneReadyEventBlock.d.ts +6 -12
- package/FlowGraph/Blocks/Event/flowGraphSceneReadyEventBlock.js +13 -24
- package/FlowGraph/Blocks/Event/flowGraphSceneReadyEventBlock.js.map +1 -1
- package/FlowGraph/Blocks/Event/flowGraphSceneTickEventBlock.d.ts +31 -7
- package/FlowGraph/Blocks/Event/flowGraphSceneTickEventBlock.js +22 -20
- package/FlowGraph/Blocks/Event/flowGraphSceneTickEventBlock.js.map +1 -1
- package/FlowGraph/Blocks/{Execution → Event}/flowGraphSendCustomEventBlock.d.ts +12 -7
- package/FlowGraph/Blocks/Event/flowGraphSendCustomEventBlock.js +39 -0
- package/FlowGraph/Blocks/Event/flowGraphSendCustomEventBlock.js.map +1 -0
- package/FlowGraph/Blocks/Event/index.d.ts +3 -0
- package/FlowGraph/Blocks/Event/index.js +3 -0
- package/FlowGraph/Blocks/Event/index.js.map +1 -1
- package/FlowGraph/Blocks/Execution/Animation/flowGraphBezierCurveEasingBlock.d.ts +44 -0
- package/FlowGraph/Blocks/Execution/Animation/flowGraphBezierCurveEasingBlock.js +46 -0
- package/FlowGraph/Blocks/Execution/Animation/flowGraphBezierCurveEasingBlock.js.map +1 -0
- package/FlowGraph/Blocks/Execution/Animation/flowGraphEasingBlock.d.ts +60 -0
- package/FlowGraph/Blocks/Execution/Animation/flowGraphEasingBlock.js +93 -0
- package/FlowGraph/Blocks/Execution/Animation/flowGraphEasingBlock.js.map +1 -0
- package/FlowGraph/Blocks/Execution/Animation/flowGraphInterpolationBlock.d.ts +82 -0
- package/FlowGraph/Blocks/Execution/Animation/flowGraphInterpolationBlock.js +105 -0
- package/FlowGraph/Blocks/Execution/Animation/flowGraphInterpolationBlock.js.map +1 -0
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPauseAnimationBlock.d.ts +2 -2
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPauseAnimationBlock.js +2 -2
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPauseAnimationBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.d.ts +40 -42
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.js +116 -50
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/Animation/flowGraphStopAnimationBlock.d.ts +12 -4
- package/FlowGraph/Blocks/Execution/Animation/flowGraphStopAnimationBlock.js +86 -8
- package/FlowGraph/Blocks/Execution/Animation/flowGraphStopAnimationBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/Animation/index.d.ts +3 -0
- package/FlowGraph/Blocks/Execution/Animation/index.js +3 -0
- package/FlowGraph/Blocks/Execution/Animation/index.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphBranchBlock.d.ts +1 -2
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphBranchBlock.js +3 -4
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphBranchBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/{Audio/flowGraphStopAudioBlock.d.ts → ControlFlow/flowGraphCancelDelayBlock.d.ts} +6 -8
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCancelDelayBlock.js +31 -0
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCancelDelayBlock.js.map +1 -0
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCounterBlock.d.ts +2 -2
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCounterBlock.js +5 -5
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCounterBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDebounceBlock.d.ts +0 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDebounceBlock.js +2 -3
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDebounceBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDoNBlock.d.ts +5 -10
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDoNBlock.js +11 -15
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDoNBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphFlipFlopBlock.d.ts +11 -3
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphFlipFlopBlock.js +5 -6
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphFlipFlopBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphForLoopBlock.d.ts +27 -7
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphForLoopBlock.js +28 -30
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphForLoopBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphMultiGateBlock.d.ts +13 -16
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphMultiGateBlock.js +50 -52
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphMultiGateBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSequenceBlock.d.ts +8 -9
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSequenceBlock.js +26 -13
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSequenceBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSetDelayBlock.d.ts +32 -0
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSetDelayBlock.js +84 -0
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSetDelayBlock.js.map +1 -0
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSwitchBlock.d.ts +20 -6
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSwitchBlock.js +55 -16
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSwitchBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphThrottleBlock.d.ts +3 -4
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphThrottleBlock.js +36 -13
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphThrottleBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWaitAllBlock.d.ts +13 -5
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWaitAllBlock.js +22 -17
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWaitAllBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWhileLoopBlock.d.ts +12 -16
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWhileLoopBlock.js +21 -21
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWhileLoopBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/index.d.ts +2 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/index.js +2 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/index.js.map +1 -1
- package/FlowGraph/Blocks/Execution/flowGraphConsoleLogBlock.d.ts +4 -5
- package/FlowGraph/Blocks/Execution/flowGraphConsoleLogBlock.js +13 -8
- package/FlowGraph/Blocks/Execution/flowGraphConsoleLogBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/flowGraphSetPropertyBlock.d.ts +33 -36
- package/FlowGraph/Blocks/Execution/flowGraphSetPropertyBlock.js +42 -26
- package/FlowGraph/Blocks/Execution/flowGraphSetPropertyBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/flowGraphSetVariableBlock.d.ts +10 -25
- package/FlowGraph/Blocks/Execution/flowGraphSetVariableBlock.js +38 -24
- package/FlowGraph/Blocks/Execution/flowGraphSetVariableBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/index.d.ts +0 -3
- package/FlowGraph/Blocks/Execution/index.js +0 -3
- package/FlowGraph/Blocks/Execution/index.js.map +1 -1
- package/FlowGraph/Blocks/flowGraphBlockFactory.d.ts +16 -0
- package/FlowGraph/Blocks/flowGraphBlockFactory.js +292 -0
- package/FlowGraph/Blocks/flowGraphBlockFactory.js.map +1 -0
- package/FlowGraph/Blocks/flowGraphBlockNames.d.ts +145 -0
- package/FlowGraph/Blocks/flowGraphBlockNames.js +147 -0
- package/FlowGraph/Blocks/flowGraphBlockNames.js.map +1 -0
- package/FlowGraph/Blocks/index.d.ts +2 -0
- package/FlowGraph/Blocks/index.js +2 -0
- package/FlowGraph/Blocks/index.js.map +1 -1
- package/FlowGraph/{flowGraphInteger.d.ts → CustomTypes/flowGraphInteger.d.ts} +2 -3
- package/FlowGraph/{flowGraphInteger.js → CustomTypes/flowGraphInteger.js} +4 -5
- package/FlowGraph/CustomTypes/flowGraphInteger.js.map +1 -0
- package/FlowGraph/CustomTypes/flowGraphMatrix.d.ts +196 -0
- package/FlowGraph/CustomTypes/flowGraphMatrix.js +272 -0
- package/FlowGraph/CustomTypes/flowGraphMatrix.js.map +1 -0
- package/FlowGraph/CustomTypes/index.d.ts +2 -0
- package/FlowGraph/CustomTypes/index.js +3 -0
- package/FlowGraph/CustomTypes/index.js.map +1 -0
- package/FlowGraph/flowGraph.d.ts +29 -34
- package/FlowGraph/flowGraph.js +120 -104
- package/FlowGraph/flowGraph.js.map +1 -1
- package/FlowGraph/flowGraphAssetsContext.d.ts +29 -0
- package/FlowGraph/flowGraphAssetsContext.js +52 -0
- package/FlowGraph/flowGraphAssetsContext.js.map +1 -0
- package/FlowGraph/flowGraphAsyncExecutionBlock.d.ts +15 -8
- package/FlowGraph/flowGraphAsyncExecutionBlock.js +25 -5
- package/FlowGraph/flowGraphAsyncExecutionBlock.js.map +1 -1
- package/FlowGraph/flowGraphBlock.d.ts +22 -15
- package/FlowGraph/flowGraphBlock.js +31 -52
- package/FlowGraph/flowGraphBlock.js.map +1 -1
- package/FlowGraph/flowGraphConnection.d.ts +13 -12
- package/FlowGraph/flowGraphConnection.js +31 -16
- package/FlowGraph/flowGraphConnection.js.map +1 -1
- package/FlowGraph/flowGraphContext.d.ts +89 -13
- package/FlowGraph/flowGraphContext.js +210 -23
- package/FlowGraph/flowGraphContext.js.map +1 -1
- package/FlowGraph/flowGraphCoordinator.d.ts +4 -10
- package/FlowGraph/flowGraphCoordinator.js +4 -16
- package/FlowGraph/flowGraphCoordinator.js.map +1 -1
- package/FlowGraph/flowGraphDataConnection.d.ts +52 -14
- package/FlowGraph/flowGraphDataConnection.js +73 -26
- package/FlowGraph/flowGraphDataConnection.js.map +1 -1
- package/FlowGraph/flowGraphEventBlock.d.ts +17 -1
- package/FlowGraph/flowGraphEventBlock.js +13 -2
- package/FlowGraph/flowGraphEventBlock.js.map +1 -1
- package/FlowGraph/flowGraphEventType.d.ts +16 -0
- package/FlowGraph/flowGraphEventType.js +18 -0
- package/FlowGraph/flowGraphEventType.js.map +1 -0
- package/FlowGraph/flowGraphExecutionBlock.d.ts +11 -1
- package/FlowGraph/flowGraphExecutionBlock.js +21 -2
- package/FlowGraph/flowGraphExecutionBlock.js.map +1 -1
- package/FlowGraph/flowGraphExecutionBlockWithOutSignal.d.ts +2 -2
- package/FlowGraph/flowGraphExecutionBlockWithOutSignal.js +0 -1
- package/FlowGraph/flowGraphExecutionBlockWithOutSignal.js.map +1 -1
- package/FlowGraph/flowGraphLogger.d.ts +60 -0
- package/FlowGraph/flowGraphLogger.js +53 -0
- package/FlowGraph/flowGraphLogger.js.map +1 -0
- package/FlowGraph/flowGraphParser.d.ts +85 -0
- package/FlowGraph/flowGraphParser.js +271 -0
- package/FlowGraph/flowGraphParser.js.map +1 -0
- package/FlowGraph/flowGraphPathConverter.d.ts +1 -1
- package/FlowGraph/flowGraphPathConverter.js +3 -2
- package/FlowGraph/flowGraphPathConverter.js.map +1 -1
- package/FlowGraph/flowGraphPathConverterComponent.d.ts +8 -1
- package/FlowGraph/flowGraphPathConverterComponent.js +18 -2
- package/FlowGraph/flowGraphPathConverterComponent.js.map +1 -1
- package/FlowGraph/flowGraphRichTypes.d.ts +51 -9
- package/FlowGraph/flowGraphRichTypes.js +160 -50
- package/FlowGraph/flowGraphRichTypes.js.map +1 -1
- package/FlowGraph/flowGraphSceneEventCoordinator.d.ts +45 -0
- package/FlowGraph/flowGraphSceneEventCoordinator.js +77 -0
- package/FlowGraph/flowGraphSceneEventCoordinator.js.map +1 -0
- package/FlowGraph/flowGraphSignalConnection.d.ts +8 -5
- package/FlowGraph/flowGraphSignalConnection.js +26 -9
- package/FlowGraph/flowGraphSignalConnection.js.map +1 -1
- package/FlowGraph/index.d.ts +6 -1
- package/FlowGraph/index.js +7 -1
- package/FlowGraph/index.js.map +1 -1
- package/FlowGraph/serialization.d.ts +5 -2
- package/FlowGraph/serialization.js +94 -22
- package/FlowGraph/serialization.js.map +1 -1
- package/FlowGraph/typeDefinitions.d.ts +74 -12
- package/FlowGraph/typeDefinitions.js.map +1 -1
- package/FlowGraph/utils.d.ts +47 -0
- package/FlowGraph/utils.js +55 -0
- package/FlowGraph/utils.js.map +1 -1
- package/Layers/effectLayer.d.ts +5 -0
- package/Layers/effectLayer.js +7 -0
- package/Layers/effectLayer.js.map +1 -1
- package/Loading/sceneLoader.d.ts +25 -11
- package/Loading/sceneLoader.js +28 -11
- package/Loading/sceneLoader.js.map +1 -1
- package/Materials/material.js +1 -0
- package/Materials/material.js.map +1 -1
- package/Maths/math.path.js +3 -0
- package/Maths/math.path.js.map +1 -1
- package/Meshes/csg2.d.ts +2 -2
- package/Meshes/csg2.js +2 -2
- package/Meshes/csg2.js.map +1 -1
- package/Meshes/geometry.d.ts +2 -1
- package/Meshes/geometry.js +8 -2
- package/Meshes/geometry.js.map +1 -1
- package/Meshes/instancedMesh.d.ts +5 -0
- package/Meshes/instancedMesh.js +6 -0
- package/Meshes/instancedMesh.js.map +1 -1
- package/Meshes/mesh.d.ts +2 -1
- package/Meshes/mesh.js +3 -2
- package/Meshes/mesh.js.map +1 -1
- package/Misc/environmentTextureTools.js +2 -2
- package/Misc/environmentTextureTools.js.map +1 -1
- package/ObjectModel/objectModelInterfaces.d.ts +2 -2
- package/ObjectModel/objectModelInterfaces.js.map +1 -1
- package/Rendering/IBLShadows/iblShadowsPluginMaterial.js +26 -18
- package/Rendering/IBLShadows/iblShadowsPluginMaterial.js.map +1 -1
- package/package.json +1 -1
- package/scene.js +8 -0
- package/scene.js.map +1 -1
- package/FlowGraph/Blocks/Data/Logic/flowGraphLogicBlocks.d.ts +0 -24
- package/FlowGraph/Blocks/Data/Logic/flowGraphLogicBlocks.js +0 -39
- package/FlowGraph/Blocks/Data/Logic/flowGraphLogicBlocks.js.map +0 -1
- package/FlowGraph/Blocks/Data/Logic/index.d.ts +0 -1
- package/FlowGraph/Blocks/Data/Logic/index.js +0 -2
- package/FlowGraph/Blocks/Data/Logic/index.js.map +0 -1
- package/FlowGraph/Blocks/Data/flowGraphCoordinateTransformBlock.js.map +0 -1
- package/FlowGraph/Blocks/Execution/Audio/flowGraphPlayAudioBlock.d.ts +0 -19
- package/FlowGraph/Blocks/Execution/Audio/flowGraphPlayAudioBlock.js +0 -26
- package/FlowGraph/Blocks/Execution/Audio/flowGraphPlayAudioBlock.js.map +0 -1
- package/FlowGraph/Blocks/Execution/Audio/flowGraphStopAudioBlock.js +0 -25
- package/FlowGraph/Blocks/Execution/Audio/flowGraphStopAudioBlock.js.map +0 -1
- package/FlowGraph/Blocks/Execution/Audio/index.d.ts +0 -2
- package/FlowGraph/Blocks/Execution/Audio/index.js +0 -3
- package/FlowGraph/Blocks/Execution/Audio/index.js.map +0 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphTimerBlock.d.ts +0 -31
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphTimerBlock.js +0 -69
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphTimerBlock.js.map +0 -1
- package/FlowGraph/Blocks/Execution/flowGraphSendCustomEventBlock.js +0 -38
- package/FlowGraph/Blocks/Execution/flowGraphSendCustomEventBlock.js.map +0 -1
- package/FlowGraph/flowGraphContextLogger.d.ts +0 -9
- package/FlowGraph/flowGraphContextLogger.js +0 -14
- package/FlowGraph/flowGraphContextLogger.js.map +0 -1
- package/FlowGraph/flowGraphInteger.js.map +0 -1
|
@@ -1,57 +1,78 @@
|
|
|
1
|
-
import { AbstractMesh } from "../../../Meshes/abstractMesh";
|
|
1
|
+
import type { AbstractMesh } from "../../../Meshes/abstractMesh";
|
|
2
2
|
import { FlowGraphEventBlock } from "../../flowGraphEventBlock";
|
|
3
|
+
import type { PointerInfo } from "../../../Events/pointerEvents";
|
|
4
|
+
import { PointerEventTypes } from "../../../Events/pointerEvents";
|
|
3
5
|
import type { FlowGraphContext } from "../../flowGraphContext";
|
|
4
6
|
import type { IFlowGraphBlockConfiguration } from "../../flowGraphBlock";
|
|
5
|
-
import type {
|
|
6
|
-
import type {
|
|
7
|
+
import type { FlowGraphDataConnection } from "../../flowGraphDataConnection.js";
|
|
8
|
+
import type { Vector3 } from "../../../Maths/math.vector.js";
|
|
9
|
+
import { FlowGraphEventType } from "../../flowGraphEventType.js";
|
|
7
10
|
/**
|
|
8
|
-
*
|
|
11
|
+
* Configuration for the mesh pick event block.
|
|
9
12
|
*/
|
|
10
13
|
export interface IFlowGraphMeshPickEventBlockConfiguration extends IFlowGraphBlockConfiguration {
|
|
11
14
|
/**
|
|
12
|
-
*
|
|
15
|
+
* Should this mesh block propagation of the event.
|
|
13
16
|
*/
|
|
14
|
-
|
|
17
|
+
stopPropagation?: boolean;
|
|
15
18
|
/**
|
|
16
|
-
* The
|
|
19
|
+
* The mesh to listen to. Can also be set by the asset input.
|
|
17
20
|
*/
|
|
18
|
-
|
|
21
|
+
targetMesh?: AbstractMesh;
|
|
19
22
|
}
|
|
20
23
|
/**
|
|
21
|
-
* @experimental
|
|
22
24
|
* A block that activates when a mesh is picked.
|
|
23
25
|
*/
|
|
24
26
|
export declare class FlowGraphMeshPickEventBlock extends FlowGraphEventBlock {
|
|
25
27
|
/**
|
|
26
28
|
* the configuration of the block
|
|
27
29
|
*/
|
|
28
|
-
config
|
|
30
|
+
config?: IFlowGraphMeshPickEventBlockConfiguration | undefined;
|
|
31
|
+
/**
|
|
32
|
+
* Input connection: The mesh to listen to.
|
|
33
|
+
*/
|
|
34
|
+
readonly asset: FlowGraphDataConnection<AbstractMesh>;
|
|
35
|
+
/**
|
|
36
|
+
* Output connection: The picked point.
|
|
37
|
+
*/
|
|
38
|
+
readonly pickedPoint: FlowGraphDataConnection<Vector3>;
|
|
39
|
+
/**
|
|
40
|
+
* Output connection: The picked origin.
|
|
41
|
+
*/
|
|
42
|
+
readonly pickOrigin: FlowGraphDataConnection<Vector3>;
|
|
43
|
+
/**
|
|
44
|
+
* Output connection: The pointer id.
|
|
45
|
+
*/
|
|
46
|
+
readonly pointerId: FlowGraphDataConnection<number>;
|
|
47
|
+
/**
|
|
48
|
+
* Output connection: The picked mesh. Possibly NOT the same as the asset (could be a descendant).
|
|
49
|
+
*/
|
|
50
|
+
readonly pickedMesh: FlowGraphDataConnection<AbstractMesh>;
|
|
51
|
+
/**
|
|
52
|
+
* Input connection: The type of the pointer event.
|
|
53
|
+
*/
|
|
54
|
+
readonly pointerType: FlowGraphDataConnection<PointerEventTypes>;
|
|
55
|
+
/**
|
|
56
|
+
* the type of the event this block reacts to
|
|
57
|
+
*/
|
|
58
|
+
readonly type: FlowGraphEventType;
|
|
29
59
|
constructor(
|
|
30
60
|
/**
|
|
31
61
|
* the configuration of the block
|
|
32
62
|
*/
|
|
33
|
-
config
|
|
34
|
-
_getReferencedMesh(): AbstractMesh;
|
|
63
|
+
config?: IFlowGraphMeshPickEventBlockConfiguration | undefined);
|
|
64
|
+
_getReferencedMesh(context: FlowGraphContext): AbstractMesh;
|
|
65
|
+
_executeEvent(context: FlowGraphContext, pickedInfo: PointerInfo): boolean;
|
|
35
66
|
/**
|
|
36
67
|
* @internal
|
|
37
68
|
*/
|
|
38
|
-
_preparePendingTasks(
|
|
39
|
-
_onDispose(context: FlowGraphContext): void;
|
|
69
|
+
_preparePendingTasks(_context: FlowGraphContext): void;
|
|
40
70
|
/**
|
|
41
71
|
* @internal
|
|
42
72
|
*/
|
|
43
|
-
_cancelPendingTasks(
|
|
73
|
+
_cancelPendingTasks(_context: FlowGraphContext): void;
|
|
44
74
|
/**
|
|
45
75
|
* @returns class name of the block.
|
|
46
76
|
*/
|
|
47
77
|
getClassName(): string;
|
|
48
|
-
/**
|
|
49
|
-
* Serializes the block to a JSON object.
|
|
50
|
-
* @param serializationObject the object to serialize to.
|
|
51
|
-
*/
|
|
52
|
-
serialize(serializationObject?: any): void;
|
|
53
|
-
/**
|
|
54
|
-
* Class name of the block.
|
|
55
|
-
*/
|
|
56
|
-
static ClassName: string;
|
|
57
78
|
}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { AbstractMesh } from "../../../Meshes/abstractMesh.js";
|
|
2
1
|
import { FlowGraphEventBlock } from "../../flowGraphEventBlock.js";
|
|
3
2
|
import { PointerEventTypes } from "../../../Events/pointerEvents.js";
|
|
4
3
|
import { RegisterClass } from "../../../Misc/typeStore.js";
|
|
5
4
|
import { _isADescendantOf } from "../../utils.js";
|
|
5
|
+
import { RichTypeAny, RichTypeNumber, RichTypeVector3 } from "../../flowGraphRichTypes.js";
|
|
6
6
|
/**
|
|
7
|
-
* @experimental
|
|
8
7
|
* A block that activates when a mesh is picked.
|
|
9
8
|
*/
|
|
10
9
|
export class FlowGraphMeshPickEventBlock extends FlowGraphEventBlock {
|
|
@@ -15,70 +14,65 @@ export class FlowGraphMeshPickEventBlock extends FlowGraphEventBlock {
|
|
|
15
14
|
config) {
|
|
16
15
|
super(config);
|
|
17
16
|
this.config = config;
|
|
17
|
+
/**
|
|
18
|
+
* the type of the event this block reacts to
|
|
19
|
+
*/
|
|
20
|
+
this.type = "MeshPick" /* FlowGraphEventType.MeshPick */;
|
|
21
|
+
this.asset = this.registerDataInput("asset", RichTypeAny, config?.targetMesh);
|
|
22
|
+
this.pickedPoint = this.registerDataOutput("pickedPoint", RichTypeVector3);
|
|
23
|
+
this.pickOrigin = this.registerDataOutput("pickOrigin", RichTypeVector3);
|
|
24
|
+
this.pointerId = this.registerDataOutput("pointerId", RichTypeNumber);
|
|
25
|
+
this.pickedMesh = this.registerDataOutput("pickedMesh", RichTypeAny);
|
|
26
|
+
this.pointerType = this.registerDataInput("pointerType", RichTypeAny, PointerEventTypes.POINTERPICK);
|
|
18
27
|
}
|
|
19
|
-
_getReferencedMesh() {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
28
|
+
_getReferencedMesh(context) {
|
|
29
|
+
return this.asset.getValue(context);
|
|
30
|
+
}
|
|
31
|
+
_executeEvent(context, pickedInfo) {
|
|
32
|
+
// get the pointer type
|
|
33
|
+
const pointerType = this.pointerType.getValue(context);
|
|
34
|
+
if (pointerType !== pickedInfo.type) {
|
|
35
|
+
// returning true here to continue the propagation of the pointer event to the rest of the blocks
|
|
36
|
+
return true;
|
|
37
|
+
}
|
|
38
|
+
// check if the mesh is the picked mesh or a descendant
|
|
39
|
+
const mesh = this._getReferencedMesh(context);
|
|
40
|
+
if (mesh && pickedInfo.pickInfo?.pickedMesh && (pickedInfo.pickInfo?.pickedMesh === mesh || _isADescendantOf(pickedInfo.pickInfo?.pickedMesh, mesh))) {
|
|
41
|
+
this.pointerId.setValue(pickedInfo.event.pointerId, context);
|
|
42
|
+
this.pickOrigin.setValue(pickedInfo.pickInfo.ray?.origin, context);
|
|
43
|
+
this.pickedPoint.setValue(pickedInfo.pickInfo.pickedPoint, context);
|
|
44
|
+
this.pickedMesh.setValue(pickedInfo.pickInfo.pickedMesh, context);
|
|
45
|
+
this._execute(context);
|
|
46
|
+
// stop the propagation if the configuration says so
|
|
47
|
+
return !this.config?.stopPropagation;
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
// reset the outputs
|
|
51
|
+
this.pointerId.resetToDefaultValue(context);
|
|
52
|
+
this.pickOrigin.resetToDefaultValue(context);
|
|
53
|
+
this.pickedPoint.resetToDefaultValue(context);
|
|
54
|
+
this.pickedMesh.resetToDefaultValue(context);
|
|
24
55
|
}
|
|
25
|
-
return
|
|
56
|
+
return true;
|
|
26
57
|
}
|
|
27
58
|
/**
|
|
28
59
|
* @internal
|
|
29
60
|
*/
|
|
30
|
-
_preparePendingTasks(
|
|
31
|
-
|
|
32
|
-
if (!pickObserver) {
|
|
33
|
-
const mesh = this._getReferencedMesh();
|
|
34
|
-
context._setExecutionVariable(this, "mesh", mesh);
|
|
35
|
-
pickObserver = mesh.getScene().onPointerObservable.add((pointerInfo) => {
|
|
36
|
-
if (pointerInfo.type === PointerEventTypes.POINTERPICK &&
|
|
37
|
-
pointerInfo.pickInfo?.pickedMesh &&
|
|
38
|
-
(pointerInfo.pickInfo?.pickedMesh === mesh || _isADescendantOf(pointerInfo.pickInfo?.pickedMesh, mesh))) {
|
|
39
|
-
this._execute(context);
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
const disposeObserver = mesh.onDisposeObservable.add(() => this._onDispose);
|
|
43
|
-
context._setExecutionVariable(this, "meshPickObserver", pickObserver);
|
|
44
|
-
context._setExecutionVariable(this, "meshDisposeObserver", disposeObserver);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
_onDispose(context) {
|
|
48
|
-
this._cancelPendingTasks(context);
|
|
49
|
-
context._removePendingBlock(this);
|
|
61
|
+
_preparePendingTasks(_context) {
|
|
62
|
+
// no-op
|
|
50
63
|
}
|
|
51
64
|
/**
|
|
52
65
|
* @internal
|
|
53
66
|
*/
|
|
54
|
-
_cancelPendingTasks(
|
|
55
|
-
|
|
56
|
-
const pickObserver = context._getExecutionVariable(this, "meshPickObserver");
|
|
57
|
-
const disposeObserver = context._getExecutionVariable(this, "meshDisposeObserver");
|
|
58
|
-
mesh.getScene().onPointerObservable.remove(pickObserver);
|
|
59
|
-
mesh.onDisposeObservable.remove(disposeObserver);
|
|
60
|
-
context._deleteExecutionVariable(this, "mesh");
|
|
61
|
-
context._deleteExecutionVariable(this, "meshPickObserver");
|
|
62
|
-
context._deleteExecutionVariable(this, "meshDisposeObserver");
|
|
67
|
+
_cancelPendingTasks(_context) {
|
|
68
|
+
// no-op
|
|
63
69
|
}
|
|
64
70
|
/**
|
|
65
71
|
* @returns class name of the block.
|
|
66
72
|
*/
|
|
67
73
|
getClassName() {
|
|
68
|
-
return FlowGraphMeshPickEventBlock.
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* Serializes the block to a JSON object.
|
|
72
|
-
* @param serializationObject the object to serialize to.
|
|
73
|
-
*/
|
|
74
|
-
serialize(serializationObject) {
|
|
75
|
-
super.serialize(serializationObject);
|
|
76
|
-
serializationObject.config.path = this.config.path;
|
|
74
|
+
return "FlowGraphMeshPickEventBlock" /* FlowGraphBlockNames.MeshPickEvent */;
|
|
77
75
|
}
|
|
78
76
|
}
|
|
79
|
-
|
|
80
|
-
* Class name of the block.
|
|
81
|
-
*/
|
|
82
|
-
FlowGraphMeshPickEventBlock.ClassName = "FGMeshPickEventBlock";
|
|
83
|
-
RegisterClass(FlowGraphMeshPickEventBlock.ClassName, FlowGraphMeshPickEventBlock);
|
|
77
|
+
RegisterClass("FlowGraphMeshPickEventBlock" /* FlowGraphBlockNames.MeshPickEvent */, FlowGraphMeshPickEventBlock);
|
|
84
78
|
//# sourceMappingURL=flowGraphMeshPickEventBlock.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flowGraphMeshPickEventBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Event/flowGraphMeshPickEventBlock.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"flowGraphMeshPickEventBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Event/flowGraphMeshPickEventBlock.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAEhE,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAGlE,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAG/C,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,eAAe,EAAE,oCAA0C;AAiBjG;;GAEG;AACH,MAAM,OAAO,2BAA4B,SAAQ,mBAAmB;IAoChE;IACI;;OAEG;IACa,MAAkD;QAElE,KAAK,CAAC,MAAM,CAAC,CAAC;QAFE,WAAM,GAAN,MAAM,CAA4C;QATtE;;WAEG;QACsB,SAAI,gDAAmD;QAS5E,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,iBAAiB,CAAC,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC;QAC9E,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,kBAAkB,CAAC,aAAa,EAAE,eAAe,CAAC,CAAC;QAC3E,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,kBAAkB,CAAC,YAAY,EAAE,eAAe,CAAC,CAAC;QACzE,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,kBAAkB,CAAC,WAAW,EAAE,cAAc,CAAC,CAAC;QACtE,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,kBAAkB,CAAC,YAAY,EAAE,WAAW,CAAC,CAAC;QACrE,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,iBAAiB,CAAC,aAAa,EAAE,WAAW,EAAE,iBAAiB,CAAC,WAAW,CAAC,CAAC;IACzG,CAAC;IAEM,kBAAkB,CAAC,OAAyB;QAC/C,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAiB,CAAC;IACxD,CAAC;IAEe,aAAa,CAAC,OAAyB,EAAE,UAAuB;QAC5E,uBAAuB;QACvB,MAAM,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QACvD,IAAI,WAAW,KAAK,UAAU,CAAC,IAAI,EAAE,CAAC;YAClC,iGAAiG;YACjG,OAAO,IAAI,CAAC;QAChB,CAAC;QACD,uDAAuD;QACvD,MAAM,IAAI,GAAG,IAAI,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC;QAC9C,IAAI,IAAI,IAAI,UAAU,CAAC,QAAQ,EAAE,UAAU,IAAI,CAAC,UAAU,CAAC,QAAQ,EAAE,UAAU,KAAK,IAAI,IAAI,gBAAgB,CAAC,UAAU,CAAC,QAAQ,EAAE,UAAU,EAAE,IAAI,CAAC,CAAC,EAAE,CAAC;YACnJ,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAE,UAAU,CAAC,KAAsB,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;YAC/E,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,UAAU,CAAC,QAAQ,CAAC,GAAG,EAAE,MAAO,EAAE,OAAO,CAAC,CAAC;YACpE,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,UAAU,CAAC,QAAQ,CAAC,WAAY,EAAE,OAAO,CAAC,CAAC;YACrE,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,UAAU,CAAC,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;YAClE,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;YACvB,oDAAoD;YACpD,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,eAAe,CAAC;QACzC,CAAC;aAAM,CAAC;YACJ,oBAAoB;YACpB,IAAI,CAAC,SAAS,CAAC,mBAAmB,CAAC,OAAO,CAAC,CAAC;YAC5C,IAAI,CAAC,UAAU,CAAC,mBAAmB,CAAC,OAAO,CAAC,CAAC;YAC7C,IAAI,CAAC,WAAW,CAAC,mBAAmB,CAAC,OAAO,CAAC,CAAC;YAC9C,IAAI,CAAC,UAAU,CAAC,mBAAmB,CAAC,OAAO,CAAC,CAAC;QACjD,CAAC;QACD,OAAO,IAAI,CAAC;IAChB,CAAC;IAED;;OAEG;IACI,oBAAoB,CAAC,QAA0B;QAClD,QAAQ;IACZ,CAAC;IAED;;OAEG;IACI,mBAAmB,CAAC,QAA0B;QACjD,QAAQ;IACZ,CAAC;IAED;;OAEG;IACa,YAAY;QACxB,6EAAyC;IAC7C,CAAC;CACJ;AACD,aAAa,wEAAoC,2BAA2B,CAAC,CAAC","sourcesContent":["import type { AbstractMesh } from \"../../../Meshes/abstractMesh\";\r\nimport { FlowGraphEventBlock } from \"../../flowGraphEventBlock\";\r\nimport type { PointerInfo } from \"../../../Events/pointerEvents\";\r\nimport { PointerEventTypes } from \"../../../Events/pointerEvents\";\r\nimport type { FlowGraphContext } from \"../../flowGraphContext\";\r\nimport type { IFlowGraphBlockConfiguration } from \"../../flowGraphBlock\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\nimport { _isADescendantOf } from \"../../utils\";\r\nimport { FlowGraphBlockNames } from \"../flowGraphBlockNames\";\r\nimport type { FlowGraphDataConnection } from \"core/FlowGraph/flowGraphDataConnection\";\r\nimport { RichTypeAny, RichTypeNumber, RichTypeVector3 } from \"core/FlowGraph/flowGraphRichTypes\";\r\nimport type { Vector3 } from \"core/Maths/math.vector\";\r\nimport { FlowGraphEventType } from \"core/FlowGraph/flowGraphEventType\";\r\n/**\r\n * Configuration for the mesh pick event block.\r\n */\r\nexport interface IFlowGraphMeshPickEventBlockConfiguration extends IFlowGraphBlockConfiguration {\r\n /**\r\n * Should this mesh block propagation of the event.\r\n */\r\n stopPropagation?: boolean;\r\n\r\n /**\r\n * The mesh to listen to. Can also be set by the asset input.\r\n */\r\n targetMesh?: AbstractMesh;\r\n}\r\n/**\r\n * A block that activates when a mesh is picked.\r\n */\r\nexport class FlowGraphMeshPickEventBlock extends FlowGraphEventBlock {\r\n /**\r\n * Input connection: The mesh to listen to.\r\n */\r\n public readonly asset: FlowGraphDataConnection<AbstractMesh>;\r\n\r\n /**\r\n * Output connection: The picked point.\r\n */\r\n public readonly pickedPoint: FlowGraphDataConnection<Vector3>;\r\n\r\n /**\r\n * Output connection: The picked origin.\r\n */\r\n public readonly pickOrigin: FlowGraphDataConnection<Vector3>;\r\n\r\n /**\r\n * Output connection: The pointer id.\r\n */\r\n public readonly pointerId: FlowGraphDataConnection<number>;\r\n\r\n /**\r\n * Output connection: The picked mesh. Possibly NOT the same as the asset (could be a descendant).\r\n */\r\n public readonly pickedMesh: FlowGraphDataConnection<AbstractMesh>;\r\n\r\n /**\r\n * Input connection: The type of the pointer event.\r\n */\r\n public readonly pointerType: FlowGraphDataConnection<PointerEventTypes>;\r\n\r\n /**\r\n * the type of the event this block reacts to\r\n */\r\n public override readonly type: FlowGraphEventType = FlowGraphEventType.MeshPick;\r\n\r\n public constructor(\r\n /**\r\n * the configuration of the block\r\n */\r\n public override config?: IFlowGraphMeshPickEventBlockConfiguration\r\n ) {\r\n super(config);\r\n this.asset = this.registerDataInput(\"asset\", RichTypeAny, config?.targetMesh);\r\n this.pickedPoint = this.registerDataOutput(\"pickedPoint\", RichTypeVector3);\r\n this.pickOrigin = this.registerDataOutput(\"pickOrigin\", RichTypeVector3);\r\n this.pointerId = this.registerDataOutput(\"pointerId\", RichTypeNumber);\r\n this.pickedMesh = this.registerDataOutput(\"pickedMesh\", RichTypeAny);\r\n this.pointerType = this.registerDataInput(\"pointerType\", RichTypeAny, PointerEventTypes.POINTERPICK);\r\n }\r\n\r\n public _getReferencedMesh(context: FlowGraphContext): AbstractMesh {\r\n return this.asset.getValue(context) as AbstractMesh;\r\n }\r\n\r\n public override _executeEvent(context: FlowGraphContext, pickedInfo: PointerInfo): boolean {\r\n // get the pointer type\r\n const pointerType = this.pointerType.getValue(context);\r\n if (pointerType !== pickedInfo.type) {\r\n // returning true here to continue the propagation of the pointer event to the rest of the blocks\r\n return true;\r\n }\r\n // check if the mesh is the picked mesh or a descendant\r\n const mesh = this._getReferencedMesh(context);\r\n if (mesh && pickedInfo.pickInfo?.pickedMesh && (pickedInfo.pickInfo?.pickedMesh === mesh || _isADescendantOf(pickedInfo.pickInfo?.pickedMesh, mesh))) {\r\n this.pointerId.setValue((pickedInfo.event as PointerEvent).pointerId, context);\r\n this.pickOrigin.setValue(pickedInfo.pickInfo.ray?.origin!, context);\r\n this.pickedPoint.setValue(pickedInfo.pickInfo.pickedPoint!, context);\r\n this.pickedMesh.setValue(pickedInfo.pickInfo.pickedMesh, context);\r\n this._execute(context);\r\n // stop the propagation if the configuration says so\r\n return !this.config?.stopPropagation;\r\n } else {\r\n // reset the outputs\r\n this.pointerId.resetToDefaultValue(context);\r\n this.pickOrigin.resetToDefaultValue(context);\r\n this.pickedPoint.resetToDefaultValue(context);\r\n this.pickedMesh.resetToDefaultValue(context);\r\n }\r\n return true;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _preparePendingTasks(_context: FlowGraphContext): void {\r\n // no-op\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _cancelPendingTasks(_context: FlowGraphContext): void {\r\n // no-op\r\n }\r\n\r\n /**\r\n * @returns class name of the block.\r\n */\r\n public override getClassName(): string {\r\n return FlowGraphBlockNames.MeshPickEvent;\r\n }\r\n}\r\nRegisterClass(FlowGraphBlockNames.MeshPickEvent, FlowGraphMeshPickEventBlock);\r\n"]}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { FlowGraphContext } from "../../flowGraphContext.js";
|
|
2
|
+
import { FlowGraphEventBlock } from "../../flowGraphEventBlock.js";
|
|
3
|
+
import { FlowGraphEventType } from "../../flowGraphEventType.js";
|
|
4
|
+
import { FlowGraphBlockNames } from "../flowGraphBlockNames";
|
|
5
|
+
import type { AbstractMesh } from "../../../Meshes/abstractMesh.js";
|
|
6
|
+
import type { FlowGraphDataConnection } from "../../flowGraphDataConnection.js";
|
|
7
|
+
import type { IFlowGraphBlockConfiguration } from "../../flowGraphBlock.js";
|
|
8
|
+
/**
|
|
9
|
+
* Configuration for the pointer out event block.
|
|
10
|
+
*/
|
|
11
|
+
export interface IFlowGraphPointerOutEventBlockConfiguration extends IFlowGraphBlockConfiguration {
|
|
12
|
+
/**
|
|
13
|
+
* Should this mesh block propagation of the event.
|
|
14
|
+
*/
|
|
15
|
+
stopPropagation?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* The mesh to listen to. Can also be set by the asset input.
|
|
18
|
+
*/
|
|
19
|
+
targetMesh?: AbstractMesh;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Payload for the pointer out event.
|
|
23
|
+
*/
|
|
24
|
+
export interface IFlowGraphPointerOutEventPayload {
|
|
25
|
+
/**
|
|
26
|
+
* The pointer id.
|
|
27
|
+
*/
|
|
28
|
+
pointerId: number;
|
|
29
|
+
/**
|
|
30
|
+
* The mesh that was picked.
|
|
31
|
+
*/
|
|
32
|
+
mesh: AbstractMesh;
|
|
33
|
+
/**
|
|
34
|
+
* If populated, the hover event moved to this mesh from the `mesh` variable
|
|
35
|
+
*/
|
|
36
|
+
over?: AbstractMesh;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* A pointe out event block.
|
|
40
|
+
* This block can be used as an entry pointer to when a pointer is out of a specific target mesh.
|
|
41
|
+
*/
|
|
42
|
+
export declare class FlowGraphPointerOutEventBlock extends FlowGraphEventBlock {
|
|
43
|
+
/**
|
|
44
|
+
* Output connection: The pointer id.
|
|
45
|
+
*/
|
|
46
|
+
readonly pointerId: FlowGraphDataConnection<number>;
|
|
47
|
+
/**
|
|
48
|
+
* Input connection: The mesh to listen to.
|
|
49
|
+
*/
|
|
50
|
+
readonly targetMesh: FlowGraphDataConnection<AbstractMesh>;
|
|
51
|
+
/**
|
|
52
|
+
* Output connection: The mesh that the pointer is out of.
|
|
53
|
+
*/
|
|
54
|
+
readonly meshOutOfPointer: FlowGraphDataConnection<AbstractMesh>;
|
|
55
|
+
readonly type: FlowGraphEventType;
|
|
56
|
+
constructor(config?: IFlowGraphPointerOutEventBlockConfiguration);
|
|
57
|
+
_executeEvent(context: FlowGraphContext, payload: IFlowGraphPointerOutEventPayload): boolean;
|
|
58
|
+
_preparePendingTasks(_context: FlowGraphContext): void;
|
|
59
|
+
_cancelPendingTasks(_context: FlowGraphContext): void;
|
|
60
|
+
getClassName(): FlowGraphBlockNames;
|
|
61
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { FlowGraphEventBlock } from "../../flowGraphEventBlock.js";
|
|
2
|
+
import { RichTypeAny, RichTypeNumber } from "../../flowGraphRichTypes.js";
|
|
3
|
+
import { RegisterClass } from "../../../Misc/typeStore.js";
|
|
4
|
+
import { _isADescendantOf } from "../../utils.js";
|
|
5
|
+
/**
|
|
6
|
+
* A pointe out event block.
|
|
7
|
+
* This block can be used as an entry pointer to when a pointer is out of a specific target mesh.
|
|
8
|
+
*/
|
|
9
|
+
export class FlowGraphPointerOutEventBlock extends FlowGraphEventBlock {
|
|
10
|
+
constructor(config) {
|
|
11
|
+
super(config);
|
|
12
|
+
this.type = "PointerOut" /* FlowGraphEventType.PointerOut */;
|
|
13
|
+
this.pointerId = this.registerDataOutput("pointerId", RichTypeNumber);
|
|
14
|
+
this.targetMesh = this.registerDataInput("targetMesh", RichTypeAny, config?.targetMesh);
|
|
15
|
+
this.meshOutOfPointer = this.registerDataOutput("meshOutOfPointer", RichTypeAny);
|
|
16
|
+
}
|
|
17
|
+
_executeEvent(context, payload) {
|
|
18
|
+
const mesh = this.targetMesh.getValue(context);
|
|
19
|
+
this.meshOutOfPointer.setValue(payload.mesh, context);
|
|
20
|
+
this.pointerId.setValue(payload.pointerId, context);
|
|
21
|
+
const skipEvent = payload.over && _isADescendantOf(payload.mesh, mesh);
|
|
22
|
+
if (!skipEvent && (payload.mesh === mesh || _isADescendantOf(payload.mesh, mesh))) {
|
|
23
|
+
this._execute(context);
|
|
24
|
+
return !this.config?.stopPropagation;
|
|
25
|
+
}
|
|
26
|
+
return true;
|
|
27
|
+
}
|
|
28
|
+
_preparePendingTasks(_context) {
|
|
29
|
+
// no-op
|
|
30
|
+
}
|
|
31
|
+
_cancelPendingTasks(_context) {
|
|
32
|
+
// no-op
|
|
33
|
+
}
|
|
34
|
+
getClassName() {
|
|
35
|
+
return "FlowGraphPointerOutEventBlock" /* FlowGraphBlockNames.PointerOutEvent */;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
RegisterClass("FlowGraphPointerOutEventBlock" /* FlowGraphBlockNames.PointerOutEvent */, FlowGraphPointerOutEventBlock);
|
|
39
|
+
//# sourceMappingURL=flowGraphPointerOutEventBlock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flowGraphPointerOutEventBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Event/flowGraphPointerOutEventBlock.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,qCAA2C;AAMzE,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,oCAA0C;AAChF,OAAO,EAAE,aAAa,EAAE,mCAA4B;AACpD,OAAO,EAAE,gBAAgB,EAAE,uBAA6B;AAoCxD;;;GAGG;AACH,MAAM,OAAO,6BAA8B,SAAQ,mBAAmB;IAkBlE,YAAmB,MAAoD;QACnE,KAAK,CAAC,MAAM,CAAC,CAAC;QAHO,SAAI,oDAAqD;QAI9E,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,kBAAkB,CAAC,WAAW,EAAE,cAAc,CAAC,CAAC;QACtE,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,iBAAiB,CAAC,YAAY,EAAE,WAAW,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC;QACxF,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,kBAAkB,CAAC,kBAAkB,EAAE,WAAW,CAAC,CAAC;IACrF,CAAC;IAEe,aAAa,CAAC,OAAyB,EAAE,OAAyC;QAC9F,MAAM,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QAC/C,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QACtD,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;QACpD,MAAM,SAAS,GAAG,OAAO,CAAC,IAAI,IAAI,gBAAgB,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QACvE,IAAI,CAAC,SAAS,IAAI,CAAC,OAAO,CAAC,IAAI,KAAK,IAAI,IAAI,gBAAgB,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,EAAE,CAAC;YAChF,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;YACvB,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,eAAe,CAAC;QACzC,CAAC;QACD,OAAO,IAAI,CAAC;IAChB,CAAC;IACe,oBAAoB,CAAC,QAA0B;QAC3D,QAAQ;IACZ,CAAC;IACe,mBAAmB,CAAC,QAA0B;QAC1D,QAAQ;IACZ,CAAC;IACe,YAAY;QACxB,iFAA2C;IAC/C,CAAC;CACJ;AAED,aAAa,4EAAsC,6BAA6B,CAAC,CAAC","sourcesContent":["import type { FlowGraphContext } from \"core/FlowGraph/flowGraphContext\";\nimport { FlowGraphEventBlock } from \"core/FlowGraph/flowGraphEventBlock\";\nimport { FlowGraphEventType } from \"core/FlowGraph/flowGraphEventType\";\nimport { FlowGraphBlockNames } from \"../flowGraphBlockNames\";\nimport type { AbstractMesh } from \"core/Meshes/abstractMesh\";\nimport type { FlowGraphDataConnection } from \"core/FlowGraph/flowGraphDataConnection\";\nimport type { IFlowGraphBlockConfiguration } from \"core/FlowGraph/flowGraphBlock\";\nimport { RichTypeAny, RichTypeNumber } from \"core/FlowGraph/flowGraphRichTypes\";\nimport { RegisterClass } from \"core/Misc/typeStore\";\nimport { _isADescendantOf } from \"core/FlowGraph/utils\";\n\n/**\n * Configuration for the pointer out event block.\n */\nexport interface IFlowGraphPointerOutEventBlockConfiguration extends IFlowGraphBlockConfiguration {\n /**\n * Should this mesh block propagation of the event.\n */\n stopPropagation?: boolean;\n\n /**\n * The mesh to listen to. Can also be set by the asset input.\n */\n targetMesh?: AbstractMesh;\n}\n\n/**\n * Payload for the pointer out event.\n */\nexport interface IFlowGraphPointerOutEventPayload {\n /**\n * The pointer id.\n */\n pointerId: number;\n /**\n * The mesh that was picked.\n */\n mesh: AbstractMesh;\n\n /**\n * If populated, the hover event moved to this mesh from the `mesh` variable\n */\n over?: AbstractMesh;\n}\n\n/**\n * A pointe out event block.\n * This block can be used as an entry pointer to when a pointer is out of a specific target mesh.\n */\nexport class FlowGraphPointerOutEventBlock extends FlowGraphEventBlock {\n /**\n * Output connection: The pointer id.\n */\n public readonly pointerId: FlowGraphDataConnection<number>;\n\n /**\n * Input connection: The mesh to listen to.\n */\n public readonly targetMesh: FlowGraphDataConnection<AbstractMesh>;\n\n /**\n * Output connection: The mesh that the pointer is out of.\n */\n public readonly meshOutOfPointer: FlowGraphDataConnection<AbstractMesh>;\n\n public override readonly type: FlowGraphEventType = FlowGraphEventType.PointerOut;\n\n public constructor(config?: IFlowGraphPointerOutEventBlockConfiguration) {\n super(config);\n this.pointerId = this.registerDataOutput(\"pointerId\", RichTypeNumber);\n this.targetMesh = this.registerDataInput(\"targetMesh\", RichTypeAny, config?.targetMesh);\n this.meshOutOfPointer = this.registerDataOutput(\"meshOutOfPointer\", RichTypeAny);\n }\n\n public override _executeEvent(context: FlowGraphContext, payload: IFlowGraphPointerOutEventPayload): boolean {\n const mesh = this.targetMesh.getValue(context);\n this.meshOutOfPointer.setValue(payload.mesh, context);\n this.pointerId.setValue(payload.pointerId, context);\n const skipEvent = payload.over && _isADescendantOf(payload.mesh, mesh);\n if (!skipEvent && (payload.mesh === mesh || _isADescendantOf(payload.mesh, mesh))) {\n this._execute(context);\n return !this.config?.stopPropagation;\n }\n return true;\n }\n public override _preparePendingTasks(_context: FlowGraphContext): void {\n // no-op\n }\n public override _cancelPendingTasks(_context: FlowGraphContext): void {\n // no-op\n }\n public override getClassName() {\n return FlowGraphBlockNames.PointerOutEvent;\n }\n}\n\nRegisterClass(FlowGraphBlockNames.PointerOutEvent, FlowGraphPointerOutEventBlock);\n"]}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { FlowGraphContext } from "../../flowGraphContext.js";
|
|
2
|
+
import { FlowGraphEventBlock } from "../../flowGraphEventBlock.js";
|
|
3
|
+
import { FlowGraphEventType } from "../../flowGraphEventType.js";
|
|
4
|
+
import { FlowGraphBlockNames } from "../flowGraphBlockNames";
|
|
5
|
+
import type { AbstractMesh } from "../../../Meshes/abstractMesh.js";
|
|
6
|
+
import type { FlowGraphDataConnection } from "../../flowGraphDataConnection.js";
|
|
7
|
+
import type { IFlowGraphBlockConfiguration } from "../../flowGraphBlock.js";
|
|
8
|
+
/**
|
|
9
|
+
* Configuration for the pointer over event block.
|
|
10
|
+
*/
|
|
11
|
+
export interface IFlowGraphPointerOverEventBlockConfiguration extends IFlowGraphBlockConfiguration {
|
|
12
|
+
/**
|
|
13
|
+
* Should this mesh block propagation of the event.
|
|
14
|
+
*/
|
|
15
|
+
stopPropagation?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* The mesh to listen to. Can also be set by the asset input.
|
|
18
|
+
*/
|
|
19
|
+
targetMesh?: AbstractMesh;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Payload for the pointer over event.
|
|
23
|
+
*/
|
|
24
|
+
export interface IFlowGraphPointerOverEventPayload {
|
|
25
|
+
/**
|
|
26
|
+
* The pointer id.
|
|
27
|
+
*/
|
|
28
|
+
pointerId: number;
|
|
29
|
+
/**
|
|
30
|
+
* The mesh that was picked.
|
|
31
|
+
*/
|
|
32
|
+
mesh: AbstractMesh;
|
|
33
|
+
/**
|
|
34
|
+
* If populated, the hover event moved from this mesh to the `mesh` variable
|
|
35
|
+
*/
|
|
36
|
+
out?: AbstractMesh;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* A pointer over event block.
|
|
40
|
+
* This block can be used as an entry pointer to when a pointer is over a specific target mesh.
|
|
41
|
+
*/
|
|
42
|
+
export declare class FlowGraphPointerOverEventBlock extends FlowGraphEventBlock {
|
|
43
|
+
/**
|
|
44
|
+
* Output connection: The pointer id.
|
|
45
|
+
*/
|
|
46
|
+
readonly pointerId: FlowGraphDataConnection<number>;
|
|
47
|
+
/**
|
|
48
|
+
* Input connection: The mesh to listen to.
|
|
49
|
+
*/
|
|
50
|
+
readonly targetMesh: FlowGraphDataConnection<AbstractMesh>;
|
|
51
|
+
/**
|
|
52
|
+
* Output connection: The mesh that is under the pointer.
|
|
53
|
+
*/
|
|
54
|
+
readonly meshUnderPointer: FlowGraphDataConnection<AbstractMesh>;
|
|
55
|
+
readonly type: FlowGraphEventType;
|
|
56
|
+
constructor(config?: IFlowGraphPointerOverEventBlockConfiguration);
|
|
57
|
+
_executeEvent(context: FlowGraphContext, payload: IFlowGraphPointerOverEventPayload): boolean;
|
|
58
|
+
_preparePendingTasks(_context: FlowGraphContext): void;
|
|
59
|
+
_cancelPendingTasks(_context: FlowGraphContext): void;
|
|
60
|
+
getClassName(): FlowGraphBlockNames;
|
|
61
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { FlowGraphEventBlock } from "../../flowGraphEventBlock.js";
|
|
2
|
+
import { RichTypeAny, RichTypeNumber } from "../../flowGraphRichTypes.js";
|
|
3
|
+
import { RegisterClass } from "../../../Misc/typeStore.js";
|
|
4
|
+
import { _isADescendantOf } from "../../utils.js";
|
|
5
|
+
/**
|
|
6
|
+
* A pointer over event block.
|
|
7
|
+
* This block can be used as an entry pointer to when a pointer is over a specific target mesh.
|
|
8
|
+
*/
|
|
9
|
+
export class FlowGraphPointerOverEventBlock extends FlowGraphEventBlock {
|
|
10
|
+
constructor(config) {
|
|
11
|
+
super(config);
|
|
12
|
+
this.type = "PointerOver" /* FlowGraphEventType.PointerOver */;
|
|
13
|
+
this.pointerId = this.registerDataOutput("pointerId", RichTypeNumber);
|
|
14
|
+
this.targetMesh = this.registerDataInput("targetMesh", RichTypeAny, config?.targetMesh);
|
|
15
|
+
this.meshUnderPointer = this.registerDataOutput("meshUnderPointer", RichTypeAny);
|
|
16
|
+
}
|
|
17
|
+
_executeEvent(context, payload) {
|
|
18
|
+
const mesh = this.targetMesh.getValue(context);
|
|
19
|
+
this.meshUnderPointer.setValue(payload.mesh, context);
|
|
20
|
+
// skip if we moved from a mesh that is under the hierarchy of the target mesh
|
|
21
|
+
const skipEvent = payload.out && _isADescendantOf(payload.out, mesh);
|
|
22
|
+
this.pointerId.setValue(payload.pointerId, context);
|
|
23
|
+
if (!skipEvent && (payload.mesh === mesh || _isADescendantOf(payload.mesh, mesh))) {
|
|
24
|
+
this._execute(context);
|
|
25
|
+
return !this.config?.stopPropagation;
|
|
26
|
+
}
|
|
27
|
+
return true;
|
|
28
|
+
}
|
|
29
|
+
_preparePendingTasks(_context) {
|
|
30
|
+
// no-op
|
|
31
|
+
}
|
|
32
|
+
_cancelPendingTasks(_context) {
|
|
33
|
+
// no-op
|
|
34
|
+
}
|
|
35
|
+
getClassName() {
|
|
36
|
+
return "FlowGraphPointerOverEventBlock" /* FlowGraphBlockNames.PointerOverEvent */;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
RegisterClass("FlowGraphPointerOverEventBlock" /* FlowGraphBlockNames.PointerOverEvent */, FlowGraphPointerOverEventBlock);
|
|
40
|
+
//# sourceMappingURL=flowGraphPointerOverEventBlock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flowGraphPointerOverEventBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Event/flowGraphPointerOverEventBlock.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,qCAA2C;AAMzE,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,oCAA0C;AAChF,OAAO,EAAE,aAAa,EAAE,mCAA4B;AACpD,OAAO,EAAE,gBAAgB,EAAE,uBAA6B;AAoCxD;;;GAGG;AACH,MAAM,OAAO,8BAA+B,SAAQ,mBAAmB;IAkBnE,YAAmB,MAAqD;QACpE,KAAK,CAAC,MAAM,CAAC,CAAC;QAHO,SAAI,sDAAsD;QAI/E,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,kBAAkB,CAAC,WAAW,EAAE,cAAc,CAAC,CAAC;QACtE,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,iBAAiB,CAAC,YAAY,EAAE,WAAW,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC;QACxF,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,kBAAkB,CAAC,kBAAkB,EAAE,WAAW,CAAC,CAAC;IACrF,CAAC;IAEe,aAAa,CAAC,OAAyB,EAAE,OAA0C;QAC/F,MAAM,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QAC/C,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QACtD,8EAA8E;QAC9E,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,IAAI,gBAAgB,CAAC,OAAO,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QACrE,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;QACpD,IAAI,CAAC,SAAS,IAAI,CAAC,OAAO,CAAC,IAAI,KAAK,IAAI,IAAI,gBAAgB,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,EAAE,CAAC;YAChF,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;YACvB,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,eAAe,CAAC;QACzC,CAAC;QACD,OAAO,IAAI,CAAC;IAChB,CAAC;IACe,oBAAoB,CAAC,QAA0B;QAC3D,QAAQ;IACZ,CAAC;IACe,mBAAmB,CAAC,QAA0B;QAC1D,QAAQ;IACZ,CAAC;IACe,YAAY;QACxB,mFAA4C;IAChD,CAAC;CACJ;AAED,aAAa,8EAAuC,8BAA8B,CAAC,CAAC","sourcesContent":["import type { FlowGraphContext } from \"core/FlowGraph/flowGraphContext\";\nimport { FlowGraphEventBlock } from \"core/FlowGraph/flowGraphEventBlock\";\nimport { FlowGraphEventType } from \"core/FlowGraph/flowGraphEventType\";\nimport { FlowGraphBlockNames } from \"../flowGraphBlockNames\";\nimport type { AbstractMesh } from \"core/Meshes/abstractMesh\";\nimport type { FlowGraphDataConnection } from \"core/FlowGraph/flowGraphDataConnection\";\nimport type { IFlowGraphBlockConfiguration } from \"core/FlowGraph/flowGraphBlock\";\nimport { RichTypeAny, RichTypeNumber } from \"core/FlowGraph/flowGraphRichTypes\";\nimport { RegisterClass } from \"core/Misc/typeStore\";\nimport { _isADescendantOf } from \"core/FlowGraph/utils\";\n\n/**\n * Configuration for the pointer over event block.\n */\nexport interface IFlowGraphPointerOverEventBlockConfiguration extends IFlowGraphBlockConfiguration {\n /**\n * Should this mesh block propagation of the event.\n */\n stopPropagation?: boolean;\n\n /**\n * The mesh to listen to. Can also be set by the asset input.\n */\n targetMesh?: AbstractMesh;\n}\n\n/**\n * Payload for the pointer over event.\n */\nexport interface IFlowGraphPointerOverEventPayload {\n /**\n * The pointer id.\n */\n pointerId: number;\n /**\n * The mesh that was picked.\n */\n mesh: AbstractMesh;\n\n /**\n * If populated, the hover event moved from this mesh to the `mesh` variable\n */\n out?: AbstractMesh;\n}\n\n/**\n * A pointer over event block.\n * This block can be used as an entry pointer to when a pointer is over a specific target mesh.\n */\nexport class FlowGraphPointerOverEventBlock extends FlowGraphEventBlock {\n /**\n * Output connection: The pointer id.\n */\n public readonly pointerId: FlowGraphDataConnection<number>;\n\n /**\n * Input connection: The mesh to listen to.\n */\n public readonly targetMesh: FlowGraphDataConnection<AbstractMesh>;\n\n /**\n * Output connection: The mesh that is under the pointer.\n */\n public readonly meshUnderPointer: FlowGraphDataConnection<AbstractMesh>;\n\n public override readonly type: FlowGraphEventType = FlowGraphEventType.PointerOver;\n\n public constructor(config?: IFlowGraphPointerOverEventBlockConfiguration) {\n super(config);\n this.pointerId = this.registerDataOutput(\"pointerId\", RichTypeNumber);\n this.targetMesh = this.registerDataInput(\"targetMesh\", RichTypeAny, config?.targetMesh);\n this.meshUnderPointer = this.registerDataOutput(\"meshUnderPointer\", RichTypeAny);\n }\n\n public override _executeEvent(context: FlowGraphContext, payload: IFlowGraphPointerOverEventPayload): boolean {\n const mesh = this.targetMesh.getValue(context);\n this.meshUnderPointer.setValue(payload.mesh, context);\n // skip if we moved from a mesh that is under the hierarchy of the target mesh\n const skipEvent = payload.out && _isADescendantOf(payload.out, mesh);\n this.pointerId.setValue(payload.pointerId, context);\n if (!skipEvent && (payload.mesh === mesh || _isADescendantOf(payload.mesh, mesh))) {\n this._execute(context);\n return !this.config?.stopPropagation;\n }\n return true;\n }\n public override _preparePendingTasks(_context: FlowGraphContext): void {\n // no-op\n }\n public override _cancelPendingTasks(_context: FlowGraphContext): void {\n // no-op\n }\n public override getClassName() {\n return FlowGraphBlockNames.PointerOverEvent;\n }\n}\n\nRegisterClass(FlowGraphBlockNames.PointerOverEvent, FlowGraphPointerOverEventBlock);\n"]}
|
|
@@ -1,31 +1,37 @@
|
|
|
1
1
|
import type { FlowGraphContext } from "../../flowGraphContext";
|
|
2
2
|
import { FlowGraphEventBlock } from "../../flowGraphEventBlock";
|
|
3
|
+
import type { RichType } from "../../flowGraphRichTypes";
|
|
3
4
|
import type { IFlowGraphBlockConfiguration } from "../../flowGraphBlock";
|
|
4
5
|
/**
|
|
5
|
-
* @experimental
|
|
6
6
|
* Parameters used to create a FlowGraphReceiveCustomEventBlock.
|
|
7
7
|
*/
|
|
8
8
|
export interface IFlowGraphReceiveCustomEventBlockConfiguration extends IFlowGraphBlockConfiguration {
|
|
9
9
|
/**
|
|
10
10
|
* The id of the event to receive.
|
|
11
|
+
* This event id is unique to the environment (not the context).
|
|
11
12
|
*/
|
|
12
13
|
eventId: string;
|
|
13
14
|
/**
|
|
14
15
|
* The names of the data outputs for that event. Should be in the same order as the event data in
|
|
15
16
|
* SendCustomEvent
|
|
16
17
|
*/
|
|
17
|
-
eventData:
|
|
18
|
+
eventData: {
|
|
19
|
+
[key: string]: {
|
|
20
|
+
type: RichType<any>;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
18
23
|
}
|
|
19
24
|
/**
|
|
20
|
-
*
|
|
21
|
-
*
|
|
25
|
+
* A block that receives a custom event.
|
|
26
|
+
* It saves the event data in the data outputs, based on the provided eventData in the configuration. For example, if the event data is
|
|
27
|
+
* `{ x: { type: RichTypeNumber }, y: { type: RichTypeNumber } }`, the block will have two data outputs: x and y.
|
|
22
28
|
*/
|
|
23
29
|
export declare class FlowGraphReceiveCustomEventBlock extends FlowGraphEventBlock {
|
|
24
30
|
/**
|
|
25
31
|
* the configuration of the block
|
|
26
32
|
*/
|
|
27
33
|
config: IFlowGraphReceiveCustomEventBlockConfiguration;
|
|
28
|
-
|
|
34
|
+
initPriority: number;
|
|
29
35
|
constructor(
|
|
30
36
|
/**
|
|
31
37
|
* the configuration of the block
|
|
@@ -33,17 +39,9 @@ export declare class FlowGraphReceiveCustomEventBlock extends FlowGraphEventBloc
|
|
|
33
39
|
config: IFlowGraphReceiveCustomEventBlockConfiguration);
|
|
34
40
|
_preparePendingTasks(context: FlowGraphContext): void;
|
|
35
41
|
_cancelPendingTasks(context: FlowGraphContext): void;
|
|
42
|
+
_executeEvent(_context: FlowGraphContext, _payload: any): boolean;
|
|
36
43
|
/**
|
|
37
44
|
* @returns class name of the block.
|
|
38
45
|
*/
|
|
39
46
|
getClassName(): string;
|
|
40
|
-
/**
|
|
41
|
-
* the class name of the block.
|
|
42
|
-
*/
|
|
43
|
-
static ClassName: string;
|
|
44
|
-
/**
|
|
45
|
-
* Serializes this block
|
|
46
|
-
* @param serializationObject the object to serialize to
|
|
47
|
-
*/
|
|
48
|
-
serialize(serializationObject?: any): void;
|
|
49
47
|
}
|