@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
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type { EasingFunction } from "../../../../Animations/easing.js";
|
|
2
|
+
import type { IFlowGraphBlockConfiguration } from "../../../flowGraphBlock.js";
|
|
3
|
+
import { FlowGraphBlock } from "../../../flowGraphBlock.js";
|
|
4
|
+
import type { FlowGraphContext } from "../../../flowGraphContext.js";
|
|
5
|
+
import type { FlowGraphDataConnection } from "../../../flowGraphDataConnection.js";
|
|
6
|
+
/**
|
|
7
|
+
* The type of the easing function.
|
|
8
|
+
*/
|
|
9
|
+
export declare enum EasingFunctionType {
|
|
10
|
+
CircleEase = 0,
|
|
11
|
+
BackEase = 1,
|
|
12
|
+
BounceEase = 2,
|
|
13
|
+
CubicEase = 3,
|
|
14
|
+
ElasticEase = 4,
|
|
15
|
+
ExponentialEase = 5,
|
|
16
|
+
PowerEase = 6,
|
|
17
|
+
QuadraticEase = 7,
|
|
18
|
+
QuarticEase = 8,
|
|
19
|
+
QuinticEase = 9,
|
|
20
|
+
SineEase = 10,
|
|
21
|
+
BezierCurveEase = 11
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* An easing block that generates an easingFunction object based on the data provided.
|
|
25
|
+
*/
|
|
26
|
+
export declare class FlowGraphEasingBlock extends FlowGraphBlock {
|
|
27
|
+
/**
|
|
28
|
+
* the configuration of the block
|
|
29
|
+
*/
|
|
30
|
+
config?: IFlowGraphBlockConfiguration | undefined;
|
|
31
|
+
/**
|
|
32
|
+
* Input connection: The type of the easing function.
|
|
33
|
+
*/
|
|
34
|
+
readonly type: FlowGraphDataConnection<EasingFunctionType>;
|
|
35
|
+
/**
|
|
36
|
+
* Input connection: The mode of the easing function.
|
|
37
|
+
* EasingFunction.EASINGMODE_EASEIN, EasingFunction.EASINGMODE_EASEOUT, EasingFunction.EASINGMODE_EASEINOUT
|
|
38
|
+
*/
|
|
39
|
+
readonly mode: FlowGraphDataConnection<number>;
|
|
40
|
+
/**
|
|
41
|
+
* Input connection:parameters for easing. for example control points for BezierCurveEase.
|
|
42
|
+
*/
|
|
43
|
+
readonly parameters: FlowGraphDataConnection<number[]>;
|
|
44
|
+
/**
|
|
45
|
+
* Output connection: The easing function object.
|
|
46
|
+
*/
|
|
47
|
+
readonly easingFunction: FlowGraphDataConnection<EasingFunction>;
|
|
48
|
+
/**
|
|
49
|
+
* Internal cache of reusable easing functions.
|
|
50
|
+
* key is type-mode-properties
|
|
51
|
+
*/
|
|
52
|
+
private _easingFunctions;
|
|
53
|
+
constructor(
|
|
54
|
+
/**
|
|
55
|
+
* the configuration of the block
|
|
56
|
+
*/
|
|
57
|
+
config?: IFlowGraphBlockConfiguration | undefined);
|
|
58
|
+
_updateOutputs(context: FlowGraphContext): void;
|
|
59
|
+
getClassName(): string;
|
|
60
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { BackEase, BezierCurveEase, BounceEase, CircleEase, CubicEase, ElasticEase, ExponentialEase } from "../../../../Animations/easing.js";
|
|
2
|
+
import { FlowGraphBlock } from "../../../flowGraphBlock.js";
|
|
3
|
+
import { RichTypeAny, RichTypeNumber } from "../../../flowGraphRichTypes.js";
|
|
4
|
+
import { RegisterClass } from "../../../../Misc/typeStore.js";
|
|
5
|
+
/**
|
|
6
|
+
* The type of the easing function.
|
|
7
|
+
*/
|
|
8
|
+
export var EasingFunctionType;
|
|
9
|
+
(function (EasingFunctionType) {
|
|
10
|
+
EasingFunctionType[EasingFunctionType["CircleEase"] = 0] = "CircleEase";
|
|
11
|
+
EasingFunctionType[EasingFunctionType["BackEase"] = 1] = "BackEase";
|
|
12
|
+
EasingFunctionType[EasingFunctionType["BounceEase"] = 2] = "BounceEase";
|
|
13
|
+
EasingFunctionType[EasingFunctionType["CubicEase"] = 3] = "CubicEase";
|
|
14
|
+
EasingFunctionType[EasingFunctionType["ElasticEase"] = 4] = "ElasticEase";
|
|
15
|
+
EasingFunctionType[EasingFunctionType["ExponentialEase"] = 5] = "ExponentialEase";
|
|
16
|
+
EasingFunctionType[EasingFunctionType["PowerEase"] = 6] = "PowerEase";
|
|
17
|
+
EasingFunctionType[EasingFunctionType["QuadraticEase"] = 7] = "QuadraticEase";
|
|
18
|
+
EasingFunctionType[EasingFunctionType["QuarticEase"] = 8] = "QuarticEase";
|
|
19
|
+
EasingFunctionType[EasingFunctionType["QuinticEase"] = 9] = "QuinticEase";
|
|
20
|
+
EasingFunctionType[EasingFunctionType["SineEase"] = 10] = "SineEase";
|
|
21
|
+
EasingFunctionType[EasingFunctionType["BezierCurveEase"] = 11] = "BezierCurveEase";
|
|
22
|
+
})(EasingFunctionType || (EasingFunctionType = {}));
|
|
23
|
+
/**
|
|
24
|
+
* @internal
|
|
25
|
+
* Creates an easing function object based on the type and parameters provided.
|
|
26
|
+
* This is not tree-shaking friendly, so if you need cubic bezier, use the dedicated bezier block.
|
|
27
|
+
* @param type The type of the easing function.
|
|
28
|
+
* @param controlPoint1 The first control point for the bezier curve.
|
|
29
|
+
* @param controlPoint2 The second control point for the bezier curve.
|
|
30
|
+
* @returns The easing function object.
|
|
31
|
+
*/
|
|
32
|
+
function CreateEasingFunction(type, ...parameters) {
|
|
33
|
+
switch (type) {
|
|
34
|
+
case 11 /* EasingFunctionType.BezierCurveEase */:
|
|
35
|
+
return new BezierCurveEase(...parameters);
|
|
36
|
+
case 0 /* EasingFunctionType.CircleEase */:
|
|
37
|
+
return new CircleEase();
|
|
38
|
+
case 1 /* EasingFunctionType.BackEase */:
|
|
39
|
+
return new BackEase(...parameters);
|
|
40
|
+
case 2 /* EasingFunctionType.BounceEase */:
|
|
41
|
+
return new BounceEase(...parameters);
|
|
42
|
+
case 3 /* EasingFunctionType.CubicEase */:
|
|
43
|
+
return new CubicEase();
|
|
44
|
+
case 4 /* EasingFunctionType.ElasticEase */:
|
|
45
|
+
return new ElasticEase(...parameters);
|
|
46
|
+
case 5 /* EasingFunctionType.ExponentialEase */:
|
|
47
|
+
return new ExponentialEase(...parameters);
|
|
48
|
+
default:
|
|
49
|
+
throw new Error("Easing type not yet implemented");
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* An easing block that generates an easingFunction object based on the data provided.
|
|
54
|
+
*/
|
|
55
|
+
export class FlowGraphEasingBlock extends FlowGraphBlock {
|
|
56
|
+
constructor(
|
|
57
|
+
/**
|
|
58
|
+
* the configuration of the block
|
|
59
|
+
*/
|
|
60
|
+
config) {
|
|
61
|
+
super(config);
|
|
62
|
+
this.config = config;
|
|
63
|
+
/**
|
|
64
|
+
* Internal cache of reusable easing functions.
|
|
65
|
+
* key is type-mode-properties
|
|
66
|
+
*/
|
|
67
|
+
this._easingFunctions = {};
|
|
68
|
+
this.type = this.registerDataInput("type", RichTypeAny, 11);
|
|
69
|
+
this.mode = this.registerDataInput("mode", RichTypeNumber, 0);
|
|
70
|
+
this.parameters = this.registerDataInput("parameters", RichTypeAny, [1, 0, 0, 1]);
|
|
71
|
+
this.easingFunction = this.registerDataOutput("easingFunction", RichTypeAny);
|
|
72
|
+
}
|
|
73
|
+
_updateOutputs(context) {
|
|
74
|
+
const type = this.type.getValue(context);
|
|
75
|
+
const mode = this.mode.getValue(context);
|
|
76
|
+
const parameters = this.parameters.getValue(context);
|
|
77
|
+
if (type === undefined || mode === undefined) {
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
const key = `${type}-${mode}-${parameters.join("-")}`;
|
|
81
|
+
if (!this._easingFunctions[key]) {
|
|
82
|
+
const easing = CreateEasingFunction(type, ...parameters);
|
|
83
|
+
easing.setEasingMode(mode);
|
|
84
|
+
this._easingFunctions[key] = easing;
|
|
85
|
+
}
|
|
86
|
+
this.easingFunction.setValue(this._easingFunctions[key], context);
|
|
87
|
+
}
|
|
88
|
+
getClassName() {
|
|
89
|
+
return "FlowGraphEasingBlock" /* FlowGraphBlockNames.Easing */;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
RegisterClass("FlowGraphEasingBlock" /* FlowGraphBlockNames.Easing */, FlowGraphEasingBlock);
|
|
93
|
+
//# sourceMappingURL=flowGraphEasingBlock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flowGraphEasingBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Execution/Animation/flowGraphEasingBlock.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,eAAe,EAAE,yCAA+B;AAEpI,OAAO,EAAE,cAAc,EAAE,mCAAsC;AAG/D,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,uCAA0C;AAEhF,OAAO,EAAE,aAAa,EAAE,sCAA4B;AAEpD;;GAEG;AACH,MAAM,CAAN,IAAkB,kBAajB;AAbD,WAAkB,kBAAkB;IAChC,uEAAc,CAAA;IACd,mEAAY,CAAA;IACZ,uEAAc,CAAA;IACd,qEAAa,CAAA;IACb,yEAAe,CAAA;IACf,iFAAmB,CAAA;IACnB,qEAAa,CAAA;IACb,6EAAiB,CAAA;IACjB,yEAAe,CAAA;IACf,yEAAe,CAAA;IACf,oEAAa,CAAA;IACb,kFAAoB,CAAA;AACxB,CAAC,EAbiB,kB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F,CAAC;IAEe,cAAc,CAAC,OAAyB;QACpD,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QACzC,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QACzC,MAAM,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QAErD,IAAI,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;YAC3C,OAAO;QACX,CAAC;QAED,MAAM,GAAG,GAAG,GAAG,IAAI,IAAI,IAAI,IAAI,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;QACtD,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,EAAE,CAAC;YAC9B,MAAM,MAAM,GAAG,oBAAoB,CAAC,IAAI,EAAE,GAAG,UAAU,CAAC,CAAC;YACzD,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;YAC3B,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC;QACxC,CAAC;QACD,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC,CAAC;IACtE,CAAC;IAEe,YAAY;QACxB,+DAAkC;IACtC,CAAC;CACJ;AAED,aAAa,0DAA6B,oBAAoB,CAAC,CAAC","sourcesContent":["import type { EasingFunction } from \"core/Animations/easing\";\nimport { BackEase, BezierCurveEase, BounceEase, CircleEase, CubicEase, ElasticEase, ExponentialEase } from \"core/Animations/easing\";\nimport type { IFlowGraphBlockConfiguration } from \"core/FlowGraph/flowGraphBlock\";\nimport { FlowGraphBlock } from \"core/FlowGraph/flowGraphBlock\";\nimport type { FlowGraphContext } from \"core/FlowGraph/flowGraphContext\";\nimport type { FlowGraphDataConnection } from \"core/FlowGraph/flowGraphDataConnection\";\nimport { RichTypeAny, RichTypeNumber } from \"core/FlowGraph/flowGraphRichTypes\";\nimport { FlowGraphBlockNames } from \"../../flowGraphBlockNames\";\nimport { RegisterClass } from \"core/Misc/typeStore\";\n\n/**\n * The type of the easing function.\n */\nexport const enum EasingFunctionType {\n CircleEase = 0,\n BackEase = 1,\n BounceEase = 2,\n CubicEase = 3,\n ElasticEase = 4,\n ExponentialEase = 5,\n PowerEase = 6,\n QuadraticEase = 7,\n QuarticEase = 8,\n QuinticEase = 9,\n SineEase = 10,\n BezierCurveEase = 11,\n}\n\n/**\n * @internal\n * Creates an easing function object based on the type and parameters provided.\n * This is not tree-shaking friendly, so if you need cubic bezier, use the dedicated bezier block.\n * @param type The type of the easing function.\n * @param controlPoint1 The first control point for the bezier curve.\n * @param controlPoint2 The second control point for the bezier curve.\n * @returns The easing function object.\n */\nfunction CreateEasingFunction(type: EasingFunctionType, ...parameters: number[]): EasingFunction {\n switch (type) {\n case EasingFunctionType.BezierCurveEase:\n return new BezierCurveEase(...parameters);\n case EasingFunctionType.CircleEase:\n return new CircleEase();\n case EasingFunctionType.BackEase:\n return new BackEase(...parameters);\n case EasingFunctionType.BounceEase:\n return new BounceEase(...parameters);\n case EasingFunctionType.CubicEase:\n return new CubicEase();\n case EasingFunctionType.ElasticEase:\n return new ElasticEase(...parameters);\n case EasingFunctionType.ExponentialEase:\n return new ExponentialEase(...parameters);\n default:\n throw new Error(\"Easing type not yet implemented\");\n }\n}\n\n/**\n * An easing block that generates an easingFunction object based on the data provided.\n */\nexport class FlowGraphEasingBlock extends FlowGraphBlock {\n /**\n * Input connection: The type of the easing function.\n */\n public readonly type: FlowGraphDataConnection<EasingFunctionType>;\n\n /**\n * Input connection: The mode of the easing function.\n * EasingFunction.EASINGMODE_EASEIN, EasingFunction.EASINGMODE_EASEOUT, EasingFunction.EASINGMODE_EASEINOUT\n */\n public readonly mode: FlowGraphDataConnection<number>;\n\n /**\n * Input connection:parameters for easing. for example control points for BezierCurveEase.\n */\n public readonly parameters: FlowGraphDataConnection<number[]>;\n\n /**\n * Output connection: The easing function object.\n */\n public readonly easingFunction: FlowGraphDataConnection<EasingFunction>;\n\n /**\n * Internal cache of reusable easing functions.\n * key is type-mode-properties\n */\n private _easingFunctions: { [key: string]: EasingFunction } = {};\n\n constructor(\n /**\n * the configuration of the block\n */\n public override config?: IFlowGraphBlockConfiguration\n ) {\n super(config);\n\n this.type = this.registerDataInput(\"type\", RichTypeAny, 11);\n this.mode = this.registerDataInput(\"mode\", RichTypeNumber, 0);\n this.parameters = this.registerDataInput(\"parameters\", RichTypeAny, [1, 0, 0, 1]);\n\n this.easingFunction = this.registerDataOutput(\"easingFunction\", RichTypeAny);\n }\n\n public override _updateOutputs(context: FlowGraphContext) {\n const type = this.type.getValue(context);\n const mode = this.mode.getValue(context);\n const parameters = this.parameters.getValue(context);\n\n if (type === undefined || mode === undefined) {\n return;\n }\n\n const key = `${type}-${mode}-${parameters.join(\"-\")}`;\n if (!this._easingFunctions[key]) {\n const easing = CreateEasingFunction(type, ...parameters);\n easing.setEasingMode(mode);\n this._easingFunctions[key] = easing;\n }\n this.easingFunction.setValue(this._easingFunctions[key], context);\n }\n\n public override getClassName(): string {\n return FlowGraphBlockNames.Easing;\n }\n}\n\nRegisterClass(FlowGraphBlockNames.Easing, FlowGraphEasingBlock);\n"]}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import type { EasingFunction } from "../../../../Animations/easing.js";
|
|
2
|
+
import { FlowGraphBlock, type IFlowGraphBlockConfiguration } from "../../../flowGraphBlock.js";
|
|
3
|
+
import type { FlowGraphContext } from "../../../flowGraphContext.js";
|
|
4
|
+
import type { FlowGraphDataConnection } from "../../../flowGraphDataConnection.js";
|
|
5
|
+
import type { FlowGraphTypes } from "../../../flowGraphRichTypes.js";
|
|
6
|
+
import { Animation } from "../../../../Animations/animation.js";
|
|
7
|
+
/**
|
|
8
|
+
* Configuration for the interpolation block.
|
|
9
|
+
*/
|
|
10
|
+
export interface IFlowGraphInterpolationBlockConfiguration extends IFlowGraphBlockConfiguration {
|
|
11
|
+
/**
|
|
12
|
+
* The number of keyframes to interpolate between.
|
|
13
|
+
* Will default to 1 if not provided (i.e. from currentValue to a provided value in the time provided)
|
|
14
|
+
*/
|
|
15
|
+
keyFramesCount?: number;
|
|
16
|
+
/**
|
|
17
|
+
* The duration of the interpolation.
|
|
18
|
+
*/
|
|
19
|
+
duration?: number;
|
|
20
|
+
/**
|
|
21
|
+
* The name of the property that will be interpolated.
|
|
22
|
+
*/
|
|
23
|
+
propertyName?: string | string[];
|
|
24
|
+
/**
|
|
25
|
+
* The type of the animation to create.
|
|
26
|
+
* Default is ANIMATIONTYPE_FLOAT
|
|
27
|
+
* This cannot be changed after construction, so make sure to pass the right value.
|
|
28
|
+
*/
|
|
29
|
+
animationType?: number | FlowGraphTypes;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* This block is responsible for interpolating between two values.
|
|
33
|
+
* The babylon concept used is Animation, and it is the output of this block.
|
|
34
|
+
*
|
|
35
|
+
* Note that values will be parsed when the in connection is triggered. until then changing the value will not trigger a new interpolation.
|
|
36
|
+
*
|
|
37
|
+
* Internally this block uses the Animation class.
|
|
38
|
+
*
|
|
39
|
+
* Note that if the interpolation is already running a signal will be sent to stop the animation group running it.
|
|
40
|
+
*/
|
|
41
|
+
export declare class FlowGraphInterpolationBlock<T> extends FlowGraphBlock {
|
|
42
|
+
/**
|
|
43
|
+
* Input connection: The value to interpolate from.
|
|
44
|
+
* Optional. If not provided, the current value will be used.
|
|
45
|
+
* Note that if provided, every time the animation is created this value will be used!
|
|
46
|
+
*/
|
|
47
|
+
readonly initialValue: FlowGraphDataConnection<T>;
|
|
48
|
+
/**
|
|
49
|
+
* Input connection: The value to interpolate to.
|
|
50
|
+
* Optional. This can also be set using the KeyFrames input!
|
|
51
|
+
* If provided it will be set to the last keyframe value.
|
|
52
|
+
*/
|
|
53
|
+
readonly endValue: FlowGraphDataConnection<T>;
|
|
54
|
+
/**
|
|
55
|
+
* output connection: The animation that will be created when in is triggered.
|
|
56
|
+
*/
|
|
57
|
+
readonly animation: FlowGraphDataConnection<Animation | Animation[]>;
|
|
58
|
+
/**
|
|
59
|
+
* Input connection: An optional easing function to use for the interpolation.
|
|
60
|
+
*/
|
|
61
|
+
readonly easingFunction: FlowGraphDataConnection<EasingFunction>;
|
|
62
|
+
/**
|
|
63
|
+
* Input connection: The name of the property that will be set
|
|
64
|
+
*/
|
|
65
|
+
readonly propertyName: FlowGraphDataConnection<string | string[]>;
|
|
66
|
+
/**
|
|
67
|
+
* If provided, this function will be used to create the animation object(s).
|
|
68
|
+
*/
|
|
69
|
+
readonly customBuildAnimation: FlowGraphDataConnection<() => (keys: any[], fps: number, animationType: number, easingFunction?: EasingFunction) => Animation | Animation[]>;
|
|
70
|
+
/**
|
|
71
|
+
* The keyframes to interpolate between.
|
|
72
|
+
* Each keyframe has a duration input and a value input.
|
|
73
|
+
*/
|
|
74
|
+
readonly keyFrames: {
|
|
75
|
+
duration: FlowGraphDataConnection<number>;
|
|
76
|
+
value: FlowGraphDataConnection<T>;
|
|
77
|
+
}[];
|
|
78
|
+
constructor(config?: IFlowGraphInterpolationBlockConfiguration);
|
|
79
|
+
_updateOutputs(context: FlowGraphContext): void;
|
|
80
|
+
private _createAnimation;
|
|
81
|
+
getClassName(): string;
|
|
82
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
|
|
2
|
+
import { FlowGraphBlock } from "../../../flowGraphBlock.js";
|
|
3
|
+
import { getRichTypeByAnimationType, getRichTypeByFlowGraphType, RichTypeAny, RichTypeNumber } from "../../../flowGraphRichTypes.js";
|
|
4
|
+
import { Animation } from "../../../../Animations/animation.js";
|
|
5
|
+
import { RegisterClass } from "../../../../Misc/typeStore.js";
|
|
6
|
+
/**
|
|
7
|
+
* This block is responsible for interpolating between two values.
|
|
8
|
+
* The babylon concept used is Animation, and it is the output of this block.
|
|
9
|
+
*
|
|
10
|
+
* Note that values will be parsed when the in connection is triggered. until then changing the value will not trigger a new interpolation.
|
|
11
|
+
*
|
|
12
|
+
* Internally this block uses the Animation class.
|
|
13
|
+
*
|
|
14
|
+
* Note that if the interpolation is already running a signal will be sent to stop the animation group running it.
|
|
15
|
+
*/
|
|
16
|
+
export class FlowGraphInterpolationBlock extends FlowGraphBlock {
|
|
17
|
+
constructor(config = {}) {
|
|
18
|
+
super(config);
|
|
19
|
+
/**
|
|
20
|
+
* The keyframes to interpolate between.
|
|
21
|
+
* Each keyframe has a duration input and a value input.
|
|
22
|
+
*/
|
|
23
|
+
this.keyFrames = [];
|
|
24
|
+
const type = typeof config?.animationType === "string"
|
|
25
|
+
? getRichTypeByFlowGraphType(config.animationType)
|
|
26
|
+
: getRichTypeByAnimationType(config?.animationType ?? 0);
|
|
27
|
+
const numberOfKeyFrames = config?.keyFramesCount ?? 1;
|
|
28
|
+
const duration = this.registerDataInput(`duration_0`, RichTypeNumber, 0);
|
|
29
|
+
const value = this.registerDataInput(`value_0`, type);
|
|
30
|
+
this.keyFrames.push({ duration, value });
|
|
31
|
+
for (let i = 1; i < numberOfKeyFrames + 1; i++) {
|
|
32
|
+
const duration = this.registerDataInput(`duration_${i}`, RichTypeNumber, i === numberOfKeyFrames ? config.duration : undefined);
|
|
33
|
+
const value = this.registerDataInput(`value_${i}`, type);
|
|
34
|
+
this.keyFrames.push({ duration, value });
|
|
35
|
+
}
|
|
36
|
+
this.initialValue = this.keyFrames[0].value;
|
|
37
|
+
this.endValue = this.keyFrames[numberOfKeyFrames].value;
|
|
38
|
+
this.easingFunction = this.registerDataInput("easingFunction", RichTypeAny);
|
|
39
|
+
this.animation = this.registerDataOutput("animation", RichTypeAny);
|
|
40
|
+
this.propertyName = this.registerDataInput("propertyName", RichTypeAny, config?.propertyName);
|
|
41
|
+
this.customBuildAnimation = this.registerDataInput("customBuildAnimation", RichTypeAny);
|
|
42
|
+
}
|
|
43
|
+
_updateOutputs(context) {
|
|
44
|
+
const interpolationAnimations = context._getGlobalContextVariable("interpolationAnimations", []);
|
|
45
|
+
const propertyName = this.propertyName.getValue(context);
|
|
46
|
+
const easingFunction = this.easingFunction.getValue(context);
|
|
47
|
+
const animation = this._createAnimation(context, propertyName, easingFunction);
|
|
48
|
+
// If an old animation exists, it will be ignored here.
|
|
49
|
+
// This is because if the animation is running and they both have the same target, the old will be stopped.
|
|
50
|
+
// This doesn't happen here, it happens in the play animation block.
|
|
51
|
+
this.animation.setValue(animation, context);
|
|
52
|
+
// to make sure no 2 interpolations are running on the same target, we will mark the animation in the context
|
|
53
|
+
if (Array.isArray(animation)) {
|
|
54
|
+
for (const anim of animation) {
|
|
55
|
+
interpolationAnimations.push(anim.uniqueId);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
interpolationAnimations.push(animation.uniqueId);
|
|
60
|
+
}
|
|
61
|
+
context._setGlobalContextVariable("interpolationAnimations", interpolationAnimations);
|
|
62
|
+
}
|
|
63
|
+
_createAnimation(context, propertyName, easingFunction) {
|
|
64
|
+
const type = this.initialValue.richType;
|
|
65
|
+
const keys = [];
|
|
66
|
+
// add initial value
|
|
67
|
+
const currentValue = this.initialValue.getValue(context) || type.defaultValue;
|
|
68
|
+
keys.push({ frame: 0, value: currentValue });
|
|
69
|
+
const numberOfKeyFrames = this.config?.numberOfKeyFrames ?? 1;
|
|
70
|
+
for (let i = 1; i < numberOfKeyFrames + 1; i++) {
|
|
71
|
+
const duration = this.keyFrames[i].duration?.getValue(context);
|
|
72
|
+
let value = this.keyFrames[i].value?.getValue(context);
|
|
73
|
+
if (i === numberOfKeyFrames - 1) {
|
|
74
|
+
value = value || type.defaultValue;
|
|
75
|
+
}
|
|
76
|
+
if (duration !== undefined && value) {
|
|
77
|
+
// convert duration to frames, based on 60 fps
|
|
78
|
+
keys.push({ frame: duration * 60, value });
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
const customBuildAnimation = this.customBuildAnimation.getValue(context);
|
|
82
|
+
if (customBuildAnimation) {
|
|
83
|
+
return customBuildAnimation()(keys, 60, type.animationType, easingFunction);
|
|
84
|
+
}
|
|
85
|
+
if (typeof propertyName === "string") {
|
|
86
|
+
const animation = Animation.CreateAnimation(propertyName, type.animationType, 60, easingFunction);
|
|
87
|
+
animation.setKeys(keys);
|
|
88
|
+
return [animation];
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
const animations = propertyName.map((name) => {
|
|
92
|
+
const animation = Animation.CreateAnimation(name, type.animationType, 60, easingFunction);
|
|
93
|
+
animation.setKeys(keys);
|
|
94
|
+
return animation;
|
|
95
|
+
});
|
|
96
|
+
return animations;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
getClassName() {
|
|
100
|
+
return "FlowGraphInterpolationBlock" /* FlowGraphBlockNames.ValueInterpolation */;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
RegisterClass("FlowGraphInterpolationBlock" /* FlowGraphBlockNames.ValueInterpolation */, FlowGraphInterpolationBlock);
|
|
104
|
+
// #L54P2C
|
|
105
|
+
//# sourceMappingURL=flowGraphInterpolationBlock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flowGraphInterpolationBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Execution/Animation/flowGraphInterpolationBlock.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,yCAA+B;AACnD,OAAO,EAAE,cAAc,EAAqC,mCAAsC;AAIlG,OAAO,EAAE,0BAA0B,EAAE,0BAA0B,EAAE,WAAW,EAAE,cAAc,EAAE,uCAA0C;AACxI,OAAO,EAAE,SAAS,EAAE,4CAAkC;AACtD,OAAO,EAAE,aAAa,EAAE,sCAA4B;AA+BpD;;;;;;;;;GASG;AACH,MAAM,OAAO,2BAA+B,SAAQ,cAAc;IA8C9D,YAAY,SAAoD,EAAE;QAC9D,KAAK,CAAC,MAAM,CAAC,CAAC;QAVlB;;;WAGG;QACa,cAA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AAE,CAAC,IAAI,EAAE,EAAE,EAAE,IAAI,CAAC,aAAa,EAAE,cAAc,CAAC,CAAC;QAChF,CAAC;QACD,IAAI,OAAO,YAAY,KAAK,QAAQ,EAAE,CAAC;YACnC,MAAM,SAAS,GAAG,SAAS,CAAC,eAAe,CAAC,YAAY,EAAE,IAAI,CAAC,aAAa,EAAE,EAAE,EAAE,cAAc,CAAC,CAAC;YAClG,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;YACxB,OAAO,CAAC,SAAS,CAAC,CAAC;QACvB,CAAC;aAAM,CAAC;YACJ,MAAM,UAAU,GAAG,YAAY,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;gBACzC,MAAM,SAAS,GAAG,SAAS,CAAC,eAAe,CAAC,IAAI,EAAE,IAAI,CAAC,aAAa,EAAE,EAAE,EAAE,cAAc,CAAC,CAAC;gBAC1F,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;gBACxB,OAAO,SAAS,CAAC;YACrB,CAAC,CAAC,CAAC;YACH,OAAO,UAAU,CAAC;QACtB,CAAC;IACL,CAAC;IAEe,YAAY;QACxB,kFAA8C;IAClD,CAAC;CACJ;AAED,aAAa,6EAAyC,2BAA2B,CAAC,CAAC;AAEnF,UAAU","sourcesContent":["import type { EasingFunction } from \"core/Animations/easing\";\nimport { Constants } from \"core/Engines/constants\";\nimport { FlowGraphBlock, type IFlowGraphBlockConfiguration } from \"core/FlowGraph/flowGraphBlock\";\nimport type { FlowGraphContext } from \"core/FlowGraph/flowGraphContext\";\nimport type { FlowGraphDataConnection } from \"core/FlowGraph/flowGraphDataConnection\";\nimport type { FlowGraphTypes } from \"core/FlowGraph/flowGraphRichTypes\";\nimport { getRichTypeByAnimationType, getRichTypeByFlowGraphType, RichTypeAny, RichTypeNumber } from \"core/FlowGraph/flowGraphRichTypes\";\nimport { Animation } from \"core/Animations/animation\";\nimport { RegisterClass } from \"core/Misc/typeStore\";\nimport { FlowGraphBlockNames } from \"../../flowGraphBlockNames\";\n\n/**\n * Configuration for the interpolation block.\n */\nexport interface IFlowGraphInterpolationBlockConfiguration extends IFlowGraphBlockConfiguration {\n /**\n * The number of keyframes to interpolate between.\n * Will default to 1 if not provided (i.e. from currentValue to a provided value in the time provided)\n */\n keyFramesCount?: number;\n\n /**\n * The duration of the interpolation.\n */\n duration?: number;\n\n /**\n * The name of the property that will be interpolated.\n */\n propertyName?: string | string[];\n\n /**\n * The type of the animation to create.\n * Default is ANIMATIONTYPE_FLOAT\n * This cannot be changed after construction, so make sure to pass the right value.\n */\n animationType?: number | FlowGraphTypes;\n}\n\n/**\n * This block is responsible for interpolating between two values.\n * The babylon concept used is Animation, and it is the output of this block.\n *\n * Note that values will be parsed when the in connection is triggered. until then changing the value will not trigger a new interpolation.\n *\n * Internally this block uses the Animation class.\n *\n * Note that if the interpolation is already running a signal will be sent to stop the animation group running it.\n */\nexport class FlowGraphInterpolationBlock<T> extends FlowGraphBlock {\n /**\n * Input connection: The value to interpolate from.\n * Optional. If not provided, the current value will be used.\n * Note that if provided, every time the animation is created this value will be used!\n */\n public readonly initialValue: FlowGraphDataConnection<T>;\n\n /**\n * Input connection: The value to interpolate to.\n * Optional. This can also be set using the KeyFrames input!\n * If provided it will be set to the last keyframe value.\n */\n public readonly endValue: FlowGraphDataConnection<T>;\n\n /**\n * output connection: The animation that will be created when in is triggered.\n */\n public readonly animation: FlowGraphDataConnection<Animation | Animation[]>;\n\n /**\n * Input connection: An optional easing function to use for the interpolation.\n */\n public readonly easingFunction: FlowGraphDataConnection<EasingFunction>;\n\n /**\n * Input connection: The name of the property that will be set\n */\n public readonly propertyName: FlowGraphDataConnection<string | string[]>;\n\n /**\n * If provided, this function will be used to create the animation object(s).\n */\n public readonly customBuildAnimation: FlowGraphDataConnection<\n () => (keys: any[], fps: number, animationType: number, easingFunction?: EasingFunction) => Animation | Animation[]\n >;\n\n /**\n * The keyframes to interpolate between.\n * Each keyframe has a duration input and a value input.\n */\n public readonly keyFrames: {\n duration: FlowGraphDataConnection<number>;\n value: FlowGraphDataConnection<T>;\n }[] = [];\n\n constructor(config: IFlowGraphInterpolationBlockConfiguration = {}) {\n super(config);\n const type =\n typeof config?.animationType === \"string\"\n ? getRichTypeByFlowGraphType(config.animationType)\n : getRichTypeByAnimationType(config?.animationType ?? Constants.ANIMATIONTYPE_FLOAT);\n\n const numberOfKeyFrames = config?.keyFramesCount ?? 1;\n const duration = this.registerDataInput(`duration_0`, RichTypeNumber, 0);\n const value = this.registerDataInput(`value_0`, type);\n this.keyFrames.push({ duration, value });\n for (let i = 1; i < numberOfKeyFrames + 1; i++) {\n const duration = this.registerDataInput(`duration_${i}`, RichTypeNumber, i === numberOfKeyFrames ? config.duration : undefined);\n const value = this.registerDataInput(`value_${i}`, type);\n this.keyFrames.push({ duration, value });\n }\n this.initialValue = this.keyFrames[0].value;\n this.endValue = this.keyFrames[numberOfKeyFrames].value;\n this.easingFunction = this.registerDataInput(\"easingFunction\", RichTypeAny);\n this.animation = this.registerDataOutput(\"animation\", RichTypeAny);\n this.propertyName = this.registerDataInput(\"propertyName\", RichTypeAny, config?.propertyName);\n this.customBuildAnimation = this.registerDataInput(\"customBuildAnimation\", RichTypeAny);\n }\n\n public override _updateOutputs(context: FlowGraphContext): void {\n const interpolationAnimations = context._getGlobalContextVariable(\"interpolationAnimations\", []) as number[];\n const propertyName = this.propertyName.getValue(context);\n const easingFunction = this.easingFunction.getValue(context);\n const animation = this._createAnimation(context, propertyName, easingFunction);\n // If an old animation exists, it will be ignored here.\n // This is because if the animation is running and they both have the same target, the old will be stopped.\n // This doesn't happen here, it happens in the play animation block.\n this.animation.setValue(animation, context);\n // to make sure no 2 interpolations are running on the same target, we will mark the animation in the context\n if (Array.isArray(animation)) {\n for (const anim of animation) {\n interpolationAnimations.push(anim.uniqueId);\n }\n } else {\n interpolationAnimations.push(animation.uniqueId);\n }\n context._setGlobalContextVariable(\"interpolationAnimations\", interpolationAnimations);\n }\n\n private _createAnimation(context: FlowGraphContext, propertyName: string | string[], easingFunction: EasingFunction): Animation | Animation[] {\n const type = this.initialValue.richType;\n const keys: { frame: number; value: T }[] = [];\n // add initial value\n const currentValue = this.initialValue.getValue(context) || type.defaultValue;\n keys.push({ frame: 0, value: currentValue });\n const numberOfKeyFrames = this.config?.numberOfKeyFrames ?? 1;\n for (let i = 1; i < numberOfKeyFrames + 1; i++) {\n const duration = this.keyFrames[i].duration?.getValue(context);\n let value = this.keyFrames[i].value?.getValue(context);\n if (i === numberOfKeyFrames - 1) {\n value = value || type.defaultValue;\n }\n if (duration !== undefined && value) {\n // convert duration to frames, based on 60 fps\n keys.push({ frame: duration * 60, value });\n }\n }\n const customBuildAnimation = this.customBuildAnimation.getValue(context);\n if (customBuildAnimation) {\n return customBuildAnimation()(keys, 60, type.animationType, easingFunction);\n }\n if (typeof propertyName === \"string\") {\n const animation = Animation.CreateAnimation(propertyName, type.animationType, 60, easingFunction);\n animation.setKeys(keys);\n return [animation];\n } else {\n const animations = propertyName.map((name) => {\n const animation = Animation.CreateAnimation(name, type.animationType, 60, easingFunction);\n animation.setKeys(keys);\n return animation;\n });\n return animations;\n }\n }\n\n public override getClassName(): string {\n return FlowGraphBlockNames.ValueInterpolation;\n }\n}\n\nRegisterClass(FlowGraphBlockNames.ValueInterpolation, FlowGraphInterpolationBlock);\n\n// #L54P2C\n"]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { FlowGraphContext } from "../../../flowGraphContext";
|
|
2
2
|
import type { FlowGraphDataConnection } from "../../../flowGraphDataConnection";
|
|
3
3
|
import { FlowGraphExecutionBlockWithOutSignal } from "../../../flowGraphExecutionBlockWithOutSignal";
|
|
4
|
-
import type { Animatable } from "../../../../Animations/animatable.core";
|
|
5
4
|
import type { IFlowGraphBlockConfiguration } from "../../../flowGraphBlock";
|
|
5
|
+
import type { AnimationGroup } from "../../../../Animations/animationGroup.js";
|
|
6
6
|
/**
|
|
7
7
|
* @experimental
|
|
8
8
|
* Block that pauses a running animation
|
|
@@ -11,7 +11,7 @@ export declare class FlowGraphPauseAnimationBlock extends FlowGraphExecutionBloc
|
|
|
11
11
|
/**
|
|
12
12
|
* Input connection: The animation to pause.
|
|
13
13
|
*/
|
|
14
|
-
readonly animationToPause: FlowGraphDataConnection<
|
|
14
|
+
readonly animationToPause: FlowGraphDataConnection<AnimationGroup>;
|
|
15
15
|
constructor(config?: IFlowGraphBlockConfiguration);
|
|
16
16
|
_execute(context: FlowGraphContext): void;
|
|
17
17
|
/**
|
|
@@ -19,8 +19,8 @@ export class FlowGraphPauseAnimationBlock extends FlowGraphExecutionBlockWithOut
|
|
|
19
19
|
* @returns class name of the block.
|
|
20
20
|
*/
|
|
21
21
|
getClassName() {
|
|
22
|
-
return "
|
|
22
|
+
return "FlowGraphPauseAnimationBlock" /* FlowGraphBlockNames.PauseAnimation */;
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
|
-
RegisterClass("
|
|
25
|
+
RegisterClass("FlowGraphPauseAnimationBlock" /* FlowGraphBlockNames.PauseAnimation */, FlowGraphPauseAnimationBlock);
|
|
26
26
|
//# sourceMappingURL=flowGraphPauseAnimationBlock.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flowGraphPauseAnimationBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Execution/Animation/flowGraphPauseAnimationBlock.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oCAAoC,EAAE,MAAM,+CAA+C,CAAC;
|
|
1
|
+
{"version":3,"file":"flowGraphPauseAnimationBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Execution/Animation/flowGraphPauseAnimationBlock.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oCAAoC,EAAE,MAAM,+CAA+C,CAAC;AACrG,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAE1D,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAG3D;;;GAGG;AACH,MAAM,OAAO,4BAA6B,SAAQ,oCAAoC;IAMlF,YAAY,MAAqC;QAC7C,KAAK,CAAC,MAAM,CAAC,CAAC;QACd,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,iBAAiB,CAAC,kBAAkB,EAAE,WAAW,CAAC,CAAC;IACpF,CAAC;IAEM,QAAQ,CAAC,OAAyB;QACrC,MAAM,qBAAqB,GAAG,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QACtE,qBAAqB,CAAC,KAAK,EAAE,CAAC;QAC9B,IAAI,CAAC,GAAG,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;IACtC,CAAC;IAED;;OAEG;IACa,YAAY;QACxB,+EAA0C;IAC9C,CAAC;CACJ;AACD,aAAa,0EAAqC,4BAA4B,CAAC,CAAC","sourcesContent":["import type { FlowGraphContext } from \"../../../flowGraphContext\";\r\nimport type { FlowGraphDataConnection } from \"../../../flowGraphDataConnection\";\r\nimport { FlowGraphExecutionBlockWithOutSignal } from \"../../../flowGraphExecutionBlockWithOutSignal\";\r\nimport { RichTypeAny } from \"../../../flowGraphRichTypes\";\r\nimport type { IFlowGraphBlockConfiguration } from \"../../../flowGraphBlock\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\nimport type { AnimationGroup } from \"core/Animations/animationGroup\";\r\nimport { FlowGraphBlockNames } from \"../../flowGraphBlockNames\";\r\n/**\r\n * @experimental\r\n * Block that pauses a running animation\r\n */\r\nexport class FlowGraphPauseAnimationBlock extends FlowGraphExecutionBlockWithOutSignal {\r\n /**\r\n * Input connection: The animation to pause.\r\n */\r\n public readonly animationToPause: FlowGraphDataConnection<AnimationGroup>;\r\n\r\n constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(config);\r\n this.animationToPause = this.registerDataInput(\"animationToPause\", RichTypeAny);\r\n }\r\n\r\n public _execute(context: FlowGraphContext): void {\r\n const animationToPauseValue = this.animationToPause.getValue(context);\r\n animationToPauseValue.pause();\r\n this.out._activateSignal(context);\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.PauseAnimation;\r\n }\r\n}\r\nRegisterClass(FlowGraphBlockNames.PauseAnimation, FlowGraphPauseAnimationBlock);\r\n"]}
|
|
@@ -1,28 +1,9 @@
|
|
|
1
1
|
import type { FlowGraphContext } from "../../../flowGraphContext";
|
|
2
|
-
import type { Animatable } from "../../../../Animations/animatable.core";
|
|
3
2
|
import type { FlowGraphDataConnection } from "../../../flowGraphDataConnection";
|
|
4
3
|
import { FlowGraphAsyncExecutionBlock } from "../../../flowGraphAsyncExecutionBlock";
|
|
5
4
|
import type { IFlowGraphBlockConfiguration } from "../../../flowGraphBlock";
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import type { IObjectAccessor } from "../../../typeDefinitions";
|
|
9
|
-
/**
|
|
10
|
-
* @experimental
|
|
11
|
-
*/
|
|
12
|
-
export interface IFlowGraphPlayAnimationBlockConfiguration extends IFlowGraphBlockConfiguration {
|
|
13
|
-
/**
|
|
14
|
-
* The path to the target object that will be animated.
|
|
15
|
-
*/
|
|
16
|
-
targetPath: string;
|
|
17
|
-
/**
|
|
18
|
-
* The path to the animation that will be played.
|
|
19
|
-
*/
|
|
20
|
-
animationPath: string;
|
|
21
|
-
/**
|
|
22
|
-
* The path converter to use to convert the path to an object accessor.
|
|
23
|
-
*/
|
|
24
|
-
pathConverter: IPathToObjectConverter<IObjectAccessor>;
|
|
25
|
-
}
|
|
5
|
+
import { AnimationGroup } from "../../../../Animations/animationGroup.js";
|
|
6
|
+
import type { Animation } from "../../../../Animations/animation.js";
|
|
26
7
|
/**
|
|
27
8
|
* @experimental
|
|
28
9
|
* A block that plays an animation on an animatable object.
|
|
@@ -31,21 +12,14 @@ export declare class FlowGraphPlayAnimationBlock extends FlowGraphAsyncExecution
|
|
|
31
12
|
/**
|
|
32
13
|
* the configuration of the block
|
|
33
14
|
*/
|
|
34
|
-
config
|
|
35
|
-
/**
|
|
36
|
-
* The substitution inputs for template strings in the target
|
|
37
|
-
*/
|
|
38
|
-
readonly templateTargetComponent: FlowGraphPathConverterComponent;
|
|
39
|
-
/**
|
|
40
|
-
* The substitution inputs for template strings in the animation
|
|
41
|
-
*/
|
|
42
|
-
readonly templateAnimationComponent: FlowGraphPathConverterComponent;
|
|
15
|
+
config?: IFlowGraphBlockConfiguration | undefined;
|
|
43
16
|
/**
|
|
44
17
|
* Input connection: The speed of the animation.
|
|
45
18
|
*/
|
|
46
19
|
readonly speed: FlowGraphDataConnection<number>;
|
|
47
20
|
/**
|
|
48
21
|
* Input connection: Should the animation loop?
|
|
22
|
+
* Not in glTF specs, but useful for the engine.
|
|
49
23
|
*/
|
|
50
24
|
readonly loop: FlowGraphDataConnection<boolean>;
|
|
51
25
|
/**
|
|
@@ -56,22 +30,55 @@ export declare class FlowGraphPlayAnimationBlock extends FlowGraphAsyncExecution
|
|
|
56
30
|
* Input connection: The ending frame of the animation.
|
|
57
31
|
*/
|
|
58
32
|
readonly to: FlowGraphDataConnection<number>;
|
|
33
|
+
/**
|
|
34
|
+
* Output connection: The current frame of the animation.
|
|
35
|
+
*/
|
|
36
|
+
readonly currentFrame: FlowGraphDataConnection<number>;
|
|
37
|
+
/**
|
|
38
|
+
* Output connection: The current time of the animation.
|
|
39
|
+
*/
|
|
40
|
+
readonly currentTime: FlowGraphDataConnection<number>;
|
|
59
41
|
/**
|
|
60
42
|
* Output connection: The animatable that is currently running.
|
|
61
43
|
*/
|
|
62
|
-
readonly
|
|
44
|
+
readonly currentAnimationGroup: FlowGraphDataConnection<AnimationGroup>;
|
|
45
|
+
/**
|
|
46
|
+
* Input: Will be initialized if no animation group was provided in the configuration.
|
|
47
|
+
*/
|
|
48
|
+
readonly animationGroup: FlowGraphDataConnection<AnimationGroup>;
|
|
49
|
+
/**
|
|
50
|
+
* Input: If provided this animation will be used. Priority will be given to the animation group input.
|
|
51
|
+
*/
|
|
52
|
+
readonly animation: FlowGraphDataConnection<Animation | Animation[]>;
|
|
53
|
+
/**
|
|
54
|
+
* Input connection: The target object that will be animated. If animation group is provided this input will be ignored.
|
|
55
|
+
*/
|
|
56
|
+
readonly object: FlowGraphDataConnection<any>;
|
|
63
57
|
constructor(
|
|
64
58
|
/**
|
|
65
59
|
* the configuration of the block
|
|
66
60
|
*/
|
|
67
|
-
config
|
|
61
|
+
config?: IFlowGraphBlockConfiguration | undefined);
|
|
68
62
|
/**
|
|
69
63
|
* @internal
|
|
70
64
|
* @param context
|
|
71
65
|
*/
|
|
72
66
|
_preparePendingTasks(context: FlowGraphContext): void;
|
|
67
|
+
/**
|
|
68
|
+
* @internal
|
|
69
|
+
*/
|
|
70
|
+
_executeOnTick(_context: FlowGraphContext): void;
|
|
73
71
|
_execute(context: FlowGraphContext): void;
|
|
74
|
-
private
|
|
72
|
+
private _onAnimationGroupEnd;
|
|
73
|
+
/**
|
|
74
|
+
* The idea behind this function is to check every running animation group and check if the targeted animations it uses are interpolation animations.
|
|
75
|
+
* If they are, we want to see that they don't collide with the current interpolation animations that are starting to play.
|
|
76
|
+
* If they do, we want to stop the already-running animation group.
|
|
77
|
+
* @internal
|
|
78
|
+
*/
|
|
79
|
+
private _checkInterpolationDuplications;
|
|
80
|
+
private _stopAnimationGroup;
|
|
81
|
+
private _removeFromCurrentlyRunning;
|
|
75
82
|
/**
|
|
76
83
|
* @internal
|
|
77
84
|
* Stop any currently running animations.
|
|
@@ -81,13 +88,4 @@ export declare class FlowGraphPlayAnimationBlock extends FlowGraphAsyncExecution
|
|
|
81
88
|
* @returns class name of the block.
|
|
82
89
|
*/
|
|
83
90
|
getClassName(): string;
|
|
84
|
-
/**
|
|
85
|
-
* Serializes the block to a JSON object.
|
|
86
|
-
* @param serializationObject the object to serialize to.
|
|
87
|
-
*/
|
|
88
|
-
serialize(serializationObject?: any): void;
|
|
89
|
-
/**
|
|
90
|
-
* Class name of the block.
|
|
91
|
-
*/
|
|
92
|
-
static ClassName: string;
|
|
93
91
|
}
|