@babylonjs/core 7.51.0 → 7.51.2
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/abstractEngine.js +2 -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/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 +107 -0
- package/FlowGraph/Blocks/Data/Math/flowGraphMatrixMathBlocks.js +130 -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/Maths/math.path.js +3 -0
- package/Maths/math.path.js.map +1 -1
- package/Meshes/geometry.d.ts +2 -1
- package/Meshes/geometry.js +8 -3
- package/Meshes/geometry.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/sceneOptimizer.js +1 -0
- package/Misc/sceneOptimizer.js.map +1 -1
- package/Misc/screenshotTools.d.ts +4 -2
- package/Misc/screenshotTools.js +8 -5
- package/Misc/screenshotTools.js.map +1 -1
- package/ObjectModel/objectModelInterfaces.d.ts +2 -2
- package/ObjectModel/objectModelInterfaces.js.map +1 -1
- package/Physics/v2/characterController.d.ts +8 -0
- package/Physics/v2/characterController.js +12 -5
- package/Physics/v2/characterController.js.map +1 -1
- package/Shaders/ShadersInclude/pbrBlockSubSurface.js +1 -1
- package/Shaders/ShadersInclude/pbrBlockSubSurface.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/pbrBlockSubSurface.js +1 -1
- package/ShadersWGSL/ShadersInclude/pbrBlockSubSurface.js.map +1 -1
- package/package.json +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,342 @@
|
|
|
1
|
+
import { FlowGraphCachedOperationBlock } from "../flowGraphCachedOperationBlock.js";
|
|
2
|
+
import { RichTypeMatrix, RichTypeMatrix2D, RichTypeMatrix3D, RichTypeNumber, RichTypeVector2, RichTypeVector3, RichTypeVector4, } from "../../../flowGraphRichTypes.js";
|
|
3
|
+
import { FlowGraphBlock } from "../../../flowGraphBlock.js";
|
|
4
|
+
import { Matrix, Vector2, Vector3, Vector4 } from "../../../../Maths/math.vector.js";
|
|
5
|
+
import { RegisterClass } from "../../../../Misc/typeStore.js";
|
|
6
|
+
import { FlowGraphMatrix2D, FlowGraphMatrix3D } from "../../../CustomTypes/flowGraphMatrix.js";
|
|
7
|
+
class FlowGraphMathCombineBlock extends FlowGraphCachedOperationBlock {
|
|
8
|
+
/**
|
|
9
|
+
* Base class for blocks that combine multiple numeric inputs into a single result.
|
|
10
|
+
* Handles registering data inputs and managing cached outputs.
|
|
11
|
+
* @param numberOfInputs The number of input values to combine.
|
|
12
|
+
* @param type The type of the result.
|
|
13
|
+
* @param config The block configuration.
|
|
14
|
+
*/
|
|
15
|
+
constructor(numberOfInputs, type, config) {
|
|
16
|
+
super(type, config);
|
|
17
|
+
for (let i = 0; i < numberOfInputs; i++) {
|
|
18
|
+
this.registerDataInput(`input_${i}`, RichTypeNumber, 0);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Abstract class representing a flow graph block that extracts multiple outputs from a single input.
|
|
24
|
+
*/
|
|
25
|
+
class FlowGraphMathExtractBlock extends FlowGraphBlock {
|
|
26
|
+
/**
|
|
27
|
+
* Creates an instance of FlowGraphMathExtractBlock.
|
|
28
|
+
*
|
|
29
|
+
* @param numberOfOutputs - The number of outputs to be extracted from the input.
|
|
30
|
+
* @param type - The type of the input data.
|
|
31
|
+
* @param config - Optional configuration for the flow graph block.
|
|
32
|
+
*/
|
|
33
|
+
constructor(numberOfOutputs, type, config) {
|
|
34
|
+
super(config);
|
|
35
|
+
this.registerDataInput("input", type);
|
|
36
|
+
for (let i = 0; i < numberOfOutputs; i++) {
|
|
37
|
+
this.registerDataOutput(`output_${i}`, RichTypeNumber, 0);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Combines two floats into a new Vector2
|
|
43
|
+
*/
|
|
44
|
+
export class FlowGraphCombineVector2Block extends FlowGraphMathCombineBlock {
|
|
45
|
+
constructor(config) {
|
|
46
|
+
super(2, RichTypeVector2, config);
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* @internal
|
|
50
|
+
* Combines two floats into a new Vector2
|
|
51
|
+
*/
|
|
52
|
+
_doOperation(context) {
|
|
53
|
+
if (!context._hasExecutionVariable(this, "cachedVector")) {
|
|
54
|
+
context._setExecutionVariable(this, "cachedVector", new Vector2());
|
|
55
|
+
}
|
|
56
|
+
const vector = context._getExecutionVariable(this, "cachedVector", null);
|
|
57
|
+
vector.set(this.getDataInput("input_0").getValue(context), this.getDataInput("input_1").getValue(context));
|
|
58
|
+
return vector;
|
|
59
|
+
}
|
|
60
|
+
getClassName() {
|
|
61
|
+
return "FlowGraphCombineVector2Block" /* FlowGraphBlockNames.CombineVector2 */;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
RegisterClass("FlowGraphCombineVector2Block" /* FlowGraphBlockNames.CombineVector2 */, FlowGraphCombineVector2Block);
|
|
65
|
+
/**
|
|
66
|
+
* Combines three floats into a new Vector3
|
|
67
|
+
*/
|
|
68
|
+
export class FlowGraphCombineVector3Block extends FlowGraphMathCombineBlock {
|
|
69
|
+
constructor(config) {
|
|
70
|
+
super(3, RichTypeVector3, config);
|
|
71
|
+
}
|
|
72
|
+
_doOperation(context) {
|
|
73
|
+
if (!context._hasExecutionVariable(this, "cachedVector")) {
|
|
74
|
+
context._setExecutionVariable(this, "cachedVector", new Vector3());
|
|
75
|
+
}
|
|
76
|
+
const vector = context._getExecutionVariable(this, "cachedVector", null);
|
|
77
|
+
vector.set(this.getDataInput("input_0").getValue(context), this.getDataInput("input_1").getValue(context), this.getDataInput("input_2").getValue(context));
|
|
78
|
+
return vector;
|
|
79
|
+
}
|
|
80
|
+
getClassName() {
|
|
81
|
+
return "FlowGraphCombineVector3Block" /* FlowGraphBlockNames.CombineVector3 */;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
RegisterClass("FlowGraphCombineVector3Block" /* FlowGraphBlockNames.CombineVector3 */, FlowGraphCombineVector3Block);
|
|
85
|
+
/**
|
|
86
|
+
* Combines four floats into a new Vector4
|
|
87
|
+
*/
|
|
88
|
+
export class FlowGraphCombineVector4Block extends FlowGraphMathCombineBlock {
|
|
89
|
+
constructor(config) {
|
|
90
|
+
super(4, RichTypeVector4, config);
|
|
91
|
+
}
|
|
92
|
+
_doOperation(context) {
|
|
93
|
+
if (!context._hasExecutionVariable(this, "cachedVector")) {
|
|
94
|
+
context._setExecutionVariable(this, "cachedVector", new Vector4());
|
|
95
|
+
}
|
|
96
|
+
const vector = context._getExecutionVariable(this, "cachedVector", null);
|
|
97
|
+
vector.set(this.getDataInput("input_0").getValue(context), this.getDataInput("input_1").getValue(context), this.getDataInput("input_2").getValue(context), this.getDataInput("input_3").getValue(context));
|
|
98
|
+
return vector;
|
|
99
|
+
}
|
|
100
|
+
getClassName() {
|
|
101
|
+
return "FlowGraphCombineVector4Block" /* FlowGraphBlockNames.CombineVector4 */;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
RegisterClass("FlowGraphCombineVector4Block" /* FlowGraphBlockNames.CombineVector4 */, FlowGraphCombineVector4Block);
|
|
105
|
+
/**
|
|
106
|
+
* Combines 16 floats into a new Matrix
|
|
107
|
+
*
|
|
108
|
+
* Note that glTF interactivity's combine4x4 uses column-major order, while Babylon.js uses row-major order.
|
|
109
|
+
*/
|
|
110
|
+
export class FlowGraphCombineMatrixBlock extends FlowGraphMathCombineBlock {
|
|
111
|
+
constructor(config) {
|
|
112
|
+
super(16, RichTypeMatrix, config);
|
|
113
|
+
}
|
|
114
|
+
_doOperation(context) {
|
|
115
|
+
if (!context._hasExecutionVariable(this, "cachedMatrix")) {
|
|
116
|
+
context._setExecutionVariable(this, "cachedMatrix", new Matrix());
|
|
117
|
+
}
|
|
118
|
+
const matrix = context._getExecutionVariable(this, "cachedMatrix", null);
|
|
119
|
+
if (this.config?.inputIsColumnMajor) {
|
|
120
|
+
matrix.set(this.getDataInput("input_0").getValue(context), this.getDataInput("input_4").getValue(context), this.getDataInput("input_8").getValue(context), this.getDataInput("input_12").getValue(context), this.getDataInput("input_1").getValue(context), this.getDataInput("input_5").getValue(context), this.getDataInput("input_9").getValue(context), this.getDataInput("input_13").getValue(context), this.getDataInput("input_2").getValue(context), this.getDataInput("input_6").getValue(context), this.getDataInput("input_10").getValue(context), this.getDataInput("input_14").getValue(context), this.getDataInput("input_3").getValue(context), this.getDataInput("input_7").getValue(context), this.getDataInput("input_11").getValue(context), this.getDataInput("input_15").getValue(context));
|
|
121
|
+
}
|
|
122
|
+
else {
|
|
123
|
+
matrix.set(this.getDataInput("input_0").getValue(context), this.getDataInput("input_1").getValue(context), this.getDataInput("input_2").getValue(context), this.getDataInput("input_3").getValue(context), this.getDataInput("input_4").getValue(context), this.getDataInput("input_5").getValue(context), this.getDataInput("input_6").getValue(context), this.getDataInput("input_7").getValue(context), this.getDataInput("input_8").getValue(context), this.getDataInput("input_9").getValue(context), this.getDataInput("input_10").getValue(context), this.getDataInput("input_11").getValue(context), this.getDataInput("input_12").getValue(context), this.getDataInput("input_13").getValue(context), this.getDataInput("input_14").getValue(context), this.getDataInput("input_15").getValue(context));
|
|
124
|
+
}
|
|
125
|
+
return matrix;
|
|
126
|
+
}
|
|
127
|
+
getClassName() {
|
|
128
|
+
return "FlowGraphCombineMatrixBlock" /* FlowGraphBlockNames.CombineMatrix */;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
RegisterClass("FlowGraphCombineMatrixBlock" /* FlowGraphBlockNames.CombineMatrix */, FlowGraphCombineMatrixBlock);
|
|
132
|
+
/**
|
|
133
|
+
* Combines 4 floats into a new Matrix
|
|
134
|
+
*/
|
|
135
|
+
export class FlowGraphCombineMatrix2DBlock extends FlowGraphMathCombineBlock {
|
|
136
|
+
constructor(config) {
|
|
137
|
+
super(4, RichTypeMatrix2D, config);
|
|
138
|
+
}
|
|
139
|
+
_doOperation(context) {
|
|
140
|
+
if (!context._hasExecutionVariable(this, "cachedMatrix")) {
|
|
141
|
+
context._setExecutionVariable(this, "cachedMatrix", new FlowGraphMatrix2D());
|
|
142
|
+
}
|
|
143
|
+
const matrix = context._getExecutionVariable(this, "cachedMatrix", null);
|
|
144
|
+
const array = this.config?.inputIsColumnMajor
|
|
145
|
+
? [
|
|
146
|
+
// column to row-major
|
|
147
|
+
this.getDataInput("input_0").getValue(context),
|
|
148
|
+
this.getDataInput("input_2").getValue(context),
|
|
149
|
+
this.getDataInput("input_1").getValue(context),
|
|
150
|
+
this.getDataInput("input_3").getValue(context),
|
|
151
|
+
]
|
|
152
|
+
: [
|
|
153
|
+
this.getDataInput("input_0").getValue(context),
|
|
154
|
+
this.getDataInput("input_1").getValue(context),
|
|
155
|
+
this.getDataInput("input_2").getValue(context),
|
|
156
|
+
this.getDataInput("input_3").getValue(context),
|
|
157
|
+
];
|
|
158
|
+
matrix.fromArray(array);
|
|
159
|
+
return matrix;
|
|
160
|
+
}
|
|
161
|
+
getClassName() {
|
|
162
|
+
return "FlowGraphCombineMatrix2DBlock" /* FlowGraphBlockNames.CombineMatrix2D */;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
RegisterClass("FlowGraphCombineMatrix2DBlock" /* FlowGraphBlockNames.CombineMatrix2D */, FlowGraphCombineMatrix2DBlock);
|
|
166
|
+
/**
|
|
167
|
+
* Combines 9 floats into a new Matrix3D
|
|
168
|
+
*/
|
|
169
|
+
export class FlowGraphCombineMatrix3DBlock extends FlowGraphMathCombineBlock {
|
|
170
|
+
constructor(config) {
|
|
171
|
+
super(9, RichTypeMatrix3D, config);
|
|
172
|
+
}
|
|
173
|
+
_doOperation(context) {
|
|
174
|
+
if (!context._hasExecutionVariable(this, "cachedMatrix")) {
|
|
175
|
+
context._setExecutionVariable(this, "cachedMatrix", new FlowGraphMatrix3D());
|
|
176
|
+
}
|
|
177
|
+
const matrix = context._getExecutionVariable(this, "cachedMatrix", null);
|
|
178
|
+
const array = this.config?.inputIsColumnMajor
|
|
179
|
+
? [
|
|
180
|
+
// column to row major
|
|
181
|
+
this.getDataInput("input_0").getValue(context),
|
|
182
|
+
this.getDataInput("input_3").getValue(context),
|
|
183
|
+
this.getDataInput("input_6").getValue(context),
|
|
184
|
+
this.getDataInput("input_1").getValue(context),
|
|
185
|
+
this.getDataInput("input_4").getValue(context),
|
|
186
|
+
this.getDataInput("input_7").getValue(context),
|
|
187
|
+
this.getDataInput("input_2").getValue(context),
|
|
188
|
+
this.getDataInput("input_5").getValue(context),
|
|
189
|
+
this.getDataInput("input_8").getValue(context),
|
|
190
|
+
]
|
|
191
|
+
: [
|
|
192
|
+
this.getDataInput("input_0").getValue(context),
|
|
193
|
+
this.getDataInput("input_1").getValue(context),
|
|
194
|
+
this.getDataInput("input_2").getValue(context),
|
|
195
|
+
this.getDataInput("input_3").getValue(context),
|
|
196
|
+
this.getDataInput("input_4").getValue(context),
|
|
197
|
+
this.getDataInput("input_5").getValue(context),
|
|
198
|
+
this.getDataInput("input_6").getValue(context),
|
|
199
|
+
this.getDataInput("input_7").getValue(context),
|
|
200
|
+
this.getDataInput("input_8").getValue(context),
|
|
201
|
+
];
|
|
202
|
+
matrix.fromArray(array);
|
|
203
|
+
return matrix;
|
|
204
|
+
}
|
|
205
|
+
getClassName() {
|
|
206
|
+
return "FlowGraphCombineMatrix3DBlock" /* FlowGraphBlockNames.CombineMatrix3D */;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
RegisterClass("FlowGraphCombineMatrix3DBlock" /* FlowGraphBlockNames.CombineMatrix3D */, FlowGraphCombineMatrix3DBlock);
|
|
210
|
+
/**
|
|
211
|
+
* Extracts two floats from a Vector2
|
|
212
|
+
*/
|
|
213
|
+
export class FlowGraphExtractVector2Block extends FlowGraphMathExtractBlock {
|
|
214
|
+
constructor(config) {
|
|
215
|
+
super(2, RichTypeVector2, config);
|
|
216
|
+
}
|
|
217
|
+
_updateOutputs(context) {
|
|
218
|
+
let input = this.getDataInput("input")?.getValue(context);
|
|
219
|
+
if (!input) {
|
|
220
|
+
input = Vector2.Zero();
|
|
221
|
+
this.getDataInput("input").setValue(input, context);
|
|
222
|
+
}
|
|
223
|
+
this.getDataOutput("output_0").setValue(input.x, context);
|
|
224
|
+
this.getDataOutput("output_1").setValue(input.y, context);
|
|
225
|
+
}
|
|
226
|
+
getClassName() {
|
|
227
|
+
return "FlowGraphExtractVector2Block" /* FlowGraphBlockNames.ExtractVector2 */;
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
RegisterClass("FlowGraphExtractVector2Block" /* FlowGraphBlockNames.ExtractVector2 */, FlowGraphExtractVector2Block);
|
|
231
|
+
/**
|
|
232
|
+
* Extracts three floats from a Vector3
|
|
233
|
+
*/
|
|
234
|
+
export class FlowGraphExtractVector3Block extends FlowGraphMathExtractBlock {
|
|
235
|
+
constructor(config) {
|
|
236
|
+
super(3, RichTypeVector3, config);
|
|
237
|
+
}
|
|
238
|
+
_updateOutputs(context) {
|
|
239
|
+
let input = this.getDataInput("input")?.getValue(context);
|
|
240
|
+
if (!input) {
|
|
241
|
+
input = Vector3.Zero();
|
|
242
|
+
this.getDataInput("input").setValue(input, context);
|
|
243
|
+
}
|
|
244
|
+
this.getDataOutput("output_0").setValue(input.x, context);
|
|
245
|
+
this.getDataOutput("output_1").setValue(input.y, context);
|
|
246
|
+
this.getDataOutput("output_2").setValue(input.z, context);
|
|
247
|
+
}
|
|
248
|
+
getClassName() {
|
|
249
|
+
return "FlowGraphExtractVector3Block" /* FlowGraphBlockNames.ExtractVector3 */;
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
RegisterClass("FlowGraphExtractVector3Block" /* FlowGraphBlockNames.ExtractVector3 */, FlowGraphExtractVector3Block);
|
|
253
|
+
/**
|
|
254
|
+
* Extracts four floats from a Vector4
|
|
255
|
+
*/
|
|
256
|
+
export class FlowGraphExtractVector4Block extends FlowGraphMathExtractBlock {
|
|
257
|
+
constructor(config) {
|
|
258
|
+
super(4, RichTypeVector4, config);
|
|
259
|
+
}
|
|
260
|
+
_updateOutputs(context) {
|
|
261
|
+
let input = this.getDataInput("input")?.getValue(context);
|
|
262
|
+
if (!input) {
|
|
263
|
+
input = Vector4.Zero();
|
|
264
|
+
this.getDataInput("input").setValue(input, context);
|
|
265
|
+
}
|
|
266
|
+
this.getDataOutput("output_0").setValue(input.x, context);
|
|
267
|
+
this.getDataOutput("output_1").setValue(input.y, context);
|
|
268
|
+
this.getDataOutput("output_2").setValue(input.z, context);
|
|
269
|
+
this.getDataOutput("output_3").setValue(input.w, context);
|
|
270
|
+
}
|
|
271
|
+
getClassName() {
|
|
272
|
+
return "FlowGraphExtractVector4Block" /* FlowGraphBlockNames.ExtractVector4 */;
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
RegisterClass("FlowGraphExtractVector4Block" /* FlowGraphBlockNames.ExtractVector4 */, FlowGraphExtractVector4Block);
|
|
276
|
+
/**
|
|
277
|
+
* Extracts 16 floats from a Matrix
|
|
278
|
+
*/
|
|
279
|
+
export class FlowGraphExtractMatrixBlock extends FlowGraphMathExtractBlock {
|
|
280
|
+
constructor(config) {
|
|
281
|
+
super(16, RichTypeMatrix, config);
|
|
282
|
+
}
|
|
283
|
+
_updateOutputs(context) {
|
|
284
|
+
let input = this.getDataInput("input")?.getValue(context);
|
|
285
|
+
if (!input) {
|
|
286
|
+
input = Matrix.Identity();
|
|
287
|
+
this.getDataInput("input").setValue(input, context);
|
|
288
|
+
}
|
|
289
|
+
for (let i = 0; i < 16; i++) {
|
|
290
|
+
this.getDataOutput(`output_${i}`).setValue(input.m[i], context);
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
getClassName() {
|
|
294
|
+
return "FlowGraphExtractMatrixBlock" /* FlowGraphBlockNames.ExtractMatrix */;
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
RegisterClass("FlowGraphExtractMatrixBlock" /* FlowGraphBlockNames.ExtractMatrix */, FlowGraphExtractMatrixBlock);
|
|
298
|
+
/**
|
|
299
|
+
* Extracts 4 floats from a Matrix2D
|
|
300
|
+
*/
|
|
301
|
+
export class FlowGraphExtractMatrix2DBlock extends FlowGraphMathExtractBlock {
|
|
302
|
+
constructor(config) {
|
|
303
|
+
super(4, RichTypeMatrix2D, config);
|
|
304
|
+
}
|
|
305
|
+
_updateOutputs(context) {
|
|
306
|
+
let input = this.getDataInput("input")?.getValue(context);
|
|
307
|
+
if (!input) {
|
|
308
|
+
input = new FlowGraphMatrix2D();
|
|
309
|
+
this.getDataInput("input").setValue(input, context);
|
|
310
|
+
}
|
|
311
|
+
for (let i = 0; i < 4; i++) {
|
|
312
|
+
this.getDataOutput(`output_${i}`).setValue(input.m[i], context);
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
getClassName() {
|
|
316
|
+
return "FlowGraphExtractMatrix2DBlock" /* FlowGraphBlockNames.ExtractMatrix2D */;
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
RegisterClass("FlowGraphExtractMatrix2DBlock" /* FlowGraphBlockNames.ExtractMatrix2D */, FlowGraphExtractMatrix2DBlock);
|
|
320
|
+
/**
|
|
321
|
+
* Extracts 4 floats from a Matrix2D
|
|
322
|
+
*/
|
|
323
|
+
export class FlowGraphExtractMatrix3DBlock extends FlowGraphMathExtractBlock {
|
|
324
|
+
constructor(config) {
|
|
325
|
+
super(9, RichTypeMatrix3D, config);
|
|
326
|
+
}
|
|
327
|
+
_updateOutputs(context) {
|
|
328
|
+
let input = this.getDataInput("input")?.getValue(context);
|
|
329
|
+
if (!input) {
|
|
330
|
+
input = new FlowGraphMatrix3D();
|
|
331
|
+
this.getDataInput("input").setValue(input, context);
|
|
332
|
+
}
|
|
333
|
+
for (let i = 0; i < 9; i++) {
|
|
334
|
+
this.getDataOutput(`output_${i}`).setValue(input.m[i], context);
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
getClassName() {
|
|
338
|
+
return "FlowGraphExtractMatrix3DBlock" /* FlowGraphBlockNames.ExtractMatrix3D */;
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
RegisterClass("FlowGraphExtractMatrix3DBlock" /* FlowGraphBlockNames.ExtractMatrix3D */, FlowGraphExtractMatrix3DBlock);
|
|
342
|
+
//# sourceMappingURL=flowGraphMathCombineExtractBlocks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flowGraphMathCombineExtractBlocks.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Data/Math/flowGraphMathCombineExtractBlocks.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,6BAA6B,EAAE,MAAM,kCAAkC,CAAC;AACjF,OAAO,EACH,cAAc,EACd,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,eAAe,EACf,eAAe,GAElB,uCAA0C;AAC3C,OAAO,EAAE,cAAc,EAAqC,mCAAsC;AAClG,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,yCAA+B;AAG3E,OAAO,EAAE,aAAa,EAAE,sCAA4B;AACpD,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,gDAAmD;AAElG,MAAe,yBAAmC,SAAQ,6BAAsC;IAC5F;;;;;;OAMG;IACH,YAAY,cAAsB,EAAE,IAAuB,EAAE,MAAqC;QAC9F,KAAK,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QACpB,KAAK,IAAI,C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AAC,EAAE,EAAE,CAAC;YACzB,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,EAAE,CAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;QACrE,CAAC;IACL,CAAC;IAEe,YAAY;QACxB,iFAA2C;IAC/C,CAAC;CACJ;AAED,aAAa,4EAAsC,6BAA6B,CAAC,CAAC;AAElF;;GAEG;AACH,MAAM,OAAO,6BAA8B,SAAQ,yBAA4C;IAC3F,YAAY,MAAqC;QAC7C,KAAK,CAAC,CAAC,EAAE,gBAAgB,EAAE,MAAM,CAAC,CAAC;IACvC,CAAC;IACe,cAAc,CAAC,OAAyB;QACpD,IAAI,KAAK,GAAG,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,EAAE,QAAQ,CAAC,OAAO,CAAsB,CAAC;QAC/E,IAAI,CAAC,KAAK,EAAE,CAAC;YACT,KAAK,GAAG,IAAI,iBAAiB,EAAE,CAAC;YAChC,IAAI,CAAC,YAAY,CAAC,OAAO,CAAE,CAAC,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;QACzD,CAAC;QACD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;YACzB,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,EAAE,CAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;QACrE,CAAC;IACL,CAAC;IAEe,YAAY;QACxB,iFAA2C;IAC/C,CAAC;CACJ;AAED,aAAa,4EAAsC,6BAA6B,CAAC,CAAC","sourcesContent":["import type { FlowGraphContext } from \"core/FlowGraph/flowGraphContext\";\nimport { FlowGraphCachedOperationBlock } from \"../flowGraphCachedOperationBlock\";\nimport {\n RichTypeMatrix,\n RichTypeMatrix2D,\n RichTypeMatrix3D,\n RichTypeNumber,\n RichTypeVector2,\n RichTypeVector3,\n RichTypeVector4,\n type RichType,\n} from \"core/FlowGraph/flowGraphRichTypes\";\nimport { FlowGraphBlock, type IFlowGraphBlockConfiguration } from \"core/FlowGraph/flowGraphBlock\";\nimport { Matrix, Vector2, Vector3, Vector4 } from \"core/Maths/math.vector\";\nimport type { Nullable } from \"core/types\";\nimport { FlowGraphBlockNames } from \"../../flowGraphBlockNames\";\nimport { RegisterClass } from \"core/Misc/typeStore\";\nimport { FlowGraphMatrix2D, FlowGraphMatrix3D } from \"core/FlowGraph/CustomTypes/flowGraphMatrix\";\n\nabstract class FlowGraphMathCombineBlock<ResultT> extends FlowGraphCachedOperationBlock<ResultT> {\n /**\n * Base class for blocks that combine multiple numeric inputs into a single result.\n * Handles registering data inputs and managing cached outputs.\n * @param numberOfInputs The number of input values to combine.\n * @param type The type of the result.\n * @param config The block configuration.\n */\n constructor(numberOfInputs: number, type: RichType<ResultT>, config?: IFlowGraphBlockConfiguration) {\n super(type, config);\n for (let i = 0; i < numberOfInputs; i++) {\n this.registerDataInput(`input_${i}`, RichTypeNumber, 0);\n }\n }\n}\n\n/**\n * Abstract class representing a flow graph block that extracts multiple outputs from a single input.\n */\nabstract class FlowGraphMathExtractBlock<InputT> extends FlowGraphBlock {\n /**\n * Creates an instance of FlowGraphMathExtractBlock.\n *\n * @param numberOfOutputs - The number of outputs to be extracted from the input.\n * @param type - The type of the input data.\n * @param config - Optional configuration for the flow graph block.\n */\n constructor(numberOfOutputs: number, type: RichType<InputT>, config?: IFlowGraphBlockConfiguration) {\n super(config);\n this.registerDataInput(\"input\", type);\n for (let i = 0; i < numberOfOutputs; i++) {\n this.registerDataOutput(`output_${i}`, RichTypeNumber, 0);\n }\n }\n}\n/**\n * Combines two floats into a new Vector2\n */\nexport class FlowGraphCombineVector2Block extends FlowGraphMathCombineBlock<Vector2> {\n constructor(config?: IFlowGraphBlockConfiguration) {\n super(2, RichTypeVector2, config);\n }\n\n /**\n * @internal\n * Combines two floats into a new Vector2\n */\n public override _doOperation(context: FlowGraphContext): Vector2 {\n if (!context._hasExecutionVariable(this, \"cachedVector\")) {\n context._setExecutionVariable(this, \"cachedVector\", new Vector2());\n }\n const vector = context._getExecutionVariable<Nullable<Vector2>>(this, \"cachedVector\", null) as Vector2;\n vector.set(this.getDataInput(\"input_0\")!.getValue(context), this.getDataInput(\"input_1\")!.getValue(context));\n return vector;\n }\n\n public override getClassName(): string {\n return FlowGraphBlockNames.CombineVector2;\n }\n}\n\nRegisterClass(FlowGraphBlockNames.CombineVector2, FlowGraphCombineVector2Block);\n\n/**\n * Combines three floats into a new Vector3\n */\nexport class FlowGraphCombineVector3Block extends FlowGraphMathCombineBlock<Vector3> {\n constructor(config?: IFlowGraphBlockConfiguration) {\n super(3, RichTypeVector3, config);\n }\n\n public override _doOperation(context: FlowGraphContext): Vector3 {\n if (!context._hasExecutionVariable(this, \"cachedVector\")) {\n context._setExecutionVariable(this, \"cachedVector\", new Vector3());\n }\n const vector = context._getExecutionVariable<Nullable<Vector3>>(this, \"cachedVector\", null) as Vector3;\n vector.set(this.getDataInput(\"input_0\")!.getValue(context), this.getDataInput(\"input_1\")!.getValue(context), this.getDataInput(\"input_2\")!.getValue(context));\n return vector;\n }\n\n public override getClassName(): string {\n return FlowGraphBlockNames.CombineVector3;\n }\n}\n\nRegisterClass(FlowGraphBlockNames.CombineVector3, FlowGraphCombineVector3Block);\n\n/**\n * Combines four floats into a new Vector4\n */\nexport class FlowGraphCombineVector4Block extends FlowGraphMathCombineBlock<Vector4> {\n constructor(config?: IFlowGraphBlockConfiguration) {\n super(4, RichTypeVector4, config);\n }\n\n public override _doOperation(context: FlowGraphContext): Vector4 {\n if (!context._hasExecutionVariable(this, \"cachedVector\")) {\n context._setExecutionVariable(this, \"cachedVector\", new Vector4());\n }\n const vector = context._getExecutionVariable<Nullable<Vector4>>(this, \"cachedVector\", null) as Vector4;\n vector.set(\n this.getDataInput(\"input_0\")!.getValue(context),\n this.getDataInput(\"input_1\")!.getValue(context),\n this.getDataInput(\"input_2\")!.getValue(context),\n this.getDataInput(\"input_3\")!.getValue(context)\n );\n return vector;\n }\n\n public override getClassName(): string {\n return FlowGraphBlockNames.CombineVector4;\n }\n}\n\nRegisterClass(FlowGraphBlockNames.CombineVector4, FlowGraphCombineVector4Block);\n\n/**\n * Configuration for the matrix combine blocks.\n */\nexport interface IFlowGraphCombineMatrixBlockConfiguration extends IFlowGraphBlockConfiguration {\n /**\n * Whether the input is in column-major order. Default is false.\n * Note - Babylon's matrix is the same as WebGL's. So unless your matrix requires transformation, you should leave this as false.\n */\n inputIsColumnMajor?: boolean;\n}\n\n/**\n * Combines 16 floats into a new Matrix\n *\n * Note that glTF interactivity's combine4x4 uses column-major order, while Babylon.js uses row-major order.\n */\nexport class FlowGraphCombineMatrixBlock extends FlowGraphMathCombineBlock<Matrix> {\n constructor(config?: IFlowGraphCombineMatrixBlockConfiguration) {\n super(16, RichTypeMatrix, config);\n }\n\n public override _doOperation(context: FlowGraphContext): Matrix {\n if (!context._hasExecutionVariable(this, \"cachedMatrix\")) {\n context._setExecutionVariable(this, \"cachedMatrix\", new Matrix());\n }\n const matrix = context._getExecutionVariable<Nullable<Matrix>>(this, \"cachedMatrix\", null) as Matrix;\n if (this.config?.inputIsColumnMajor) {\n matrix.set(\n this.getDataInput(\"input_0\")!.getValue(context),\n this.getDataInput(\"input_4\")!.getValue(context),\n this.getDataInput(\"input_8\")!.getValue(context),\n this.getDataInput(\"input_12\")!.getValue(context),\n this.getDataInput(\"input_1\")!.getValue(context),\n this.getDataInput(\"input_5\")!.getValue(context),\n this.getDataInput(\"input_9\")!.getValue(context),\n this.getDataInput(\"input_13\")!.getValue(context),\n this.getDataInput(\"input_2\")!.getValue(context),\n this.getDataInput(\"input_6\")!.getValue(context),\n this.getDataInput(\"input_10\")!.getValue(context),\n this.getDataInput(\"input_14\")!.getValue(context),\n this.getDataInput(\"input_3\")!.getValue(context),\n this.getDataInput(\"input_7\")!.getValue(context),\n this.getDataInput(\"input_11\")!.getValue(context),\n this.getDataInput(\"input_15\")!.getValue(context)\n );\n } else {\n matrix.set(\n this.getDataInput(\"input_0\")!.getValue(context),\n this.getDataInput(\"input_1\")!.getValue(context),\n this.getDataInput(\"input_2\")!.getValue(context),\n this.getDataInput(\"input_3\")!.getValue(context),\n this.getDataInput(\"input_4\")!.getValue(context),\n this.getDataInput(\"input_5\")!.getValue(context),\n this.getDataInput(\"input_6\")!.getValue(context),\n this.getDataInput(\"input_7\")!.getValue(context),\n this.getDataInput(\"input_8\")!.getValue(context),\n this.getDataInput(\"input_9\")!.getValue(context),\n this.getDataInput(\"input_10\")!.getValue(context),\n this.getDataInput(\"input_11\")!.getValue(context),\n this.getDataInput(\"input_12\")!.getValue(context),\n this.getDataInput(\"input_13\")!.getValue(context),\n this.getDataInput(\"input_14\")!.getValue(context),\n this.getDataInput(\"input_15\")!.getValue(context)\n );\n }\n return matrix;\n }\n\n public override getClassName(): string {\n return FlowGraphBlockNames.CombineMatrix;\n }\n}\n\nRegisterClass(FlowGraphBlockNames.CombineMatrix, FlowGraphCombineMatrixBlock);\n\n/**\n * Combines 4 floats into a new Matrix\n */\nexport class FlowGraphCombineMatrix2DBlock extends FlowGraphMathCombineBlock<FlowGraphMatrix2D> {\n constructor(config?: IFlowGraphCombineMatrixBlockConfiguration) {\n super(4, RichTypeMatrix2D, config);\n }\n\n public override _doOperation(context: FlowGraphContext): FlowGraphMatrix2D {\n if (!context._hasExecutionVariable(this, \"cachedMatrix\")) {\n context._setExecutionVariable(this, \"cachedMatrix\", new FlowGraphMatrix2D());\n }\n const matrix = context._getExecutionVariable<Nullable<FlowGraphMatrix2D>>(this, \"cachedMatrix\", null) as FlowGraphMatrix2D;\n const array = this.config?.inputIsColumnMajor\n ? [\n // column to row-major\n this.getDataInput(\"input_0\")!.getValue(context),\n this.getDataInput(\"input_2\")!.getValue(context),\n this.getDataInput(\"input_1\")!.getValue(context),\n this.getDataInput(\"input_3\")!.getValue(context),\n ]\n : [\n this.getDataInput(\"input_0\")!.getValue(context),\n this.getDataInput(\"input_1\")!.getValue(context),\n this.getDataInput(\"input_2\")!.getValue(context),\n this.getDataInput(\"input_3\")!.getValue(context),\n ];\n matrix.fromArray(array);\n return matrix;\n }\n\n public override getClassName(): string {\n return FlowGraphBlockNames.CombineMatrix2D;\n }\n}\n\nRegisterClass(FlowGraphBlockNames.CombineMatrix2D, FlowGraphCombineMatrix2DBlock);\n\n/**\n * Combines 9 floats into a new Matrix3D\n */\nexport class FlowGraphCombineMatrix3DBlock extends FlowGraphMathCombineBlock<FlowGraphMatrix3D> {\n constructor(config?: IFlowGraphCombineMatrixBlockConfiguration) {\n super(9, RichTypeMatrix3D, config);\n }\n\n public override _doOperation(context: FlowGraphContext): FlowGraphMatrix3D {\n if (!context._hasExecutionVariable(this, \"cachedMatrix\")) {\n context._setExecutionVariable(this, \"cachedMatrix\", new FlowGraphMatrix3D());\n }\n const matrix = context._getExecutionVariable<Nullable<FlowGraphMatrix3D>>(this, \"cachedMatrix\", null) as FlowGraphMatrix3D;\n const array = this.config?.inputIsColumnMajor\n ? [\n // column to row major\n this.getDataInput(\"input_0\")!.getValue(context),\n this.getDataInput(\"input_3\")!.getValue(context),\n this.getDataInput(\"input_6\")!.getValue(context),\n this.getDataInput(\"input_1\")!.getValue(context),\n this.getDataInput(\"input_4\")!.getValue(context),\n this.getDataInput(\"input_7\")!.getValue(context),\n this.getDataInput(\"input_2\")!.getValue(context),\n this.getDataInput(\"input_5\")!.getValue(context),\n this.getDataInput(\"input_8\")!.getValue(context),\n ]\n : [\n this.getDataInput(\"input_0\")!.getValue(context),\n this.getDataInput(\"input_1\")!.getValue(context),\n this.getDataInput(\"input_2\")!.getValue(context),\n this.getDataInput(\"input_3\")!.getValue(context),\n this.getDataInput(\"input_4\")!.getValue(context),\n this.getDataInput(\"input_5\")!.getValue(context),\n this.getDataInput(\"input_6\")!.getValue(context),\n this.getDataInput(\"input_7\")!.getValue(context),\n this.getDataInput(\"input_8\")!.getValue(context),\n ];\n matrix.fromArray(array);\n return matrix;\n }\n\n public override getClassName(): string {\n return FlowGraphBlockNames.CombineMatrix3D;\n }\n}\n\nRegisterClass(FlowGraphBlockNames.CombineMatrix3D, FlowGraphCombineMatrix3DBlock);\n\n/**\n * Extracts two floats from a Vector2\n */\nexport class FlowGraphExtractVector2Block extends FlowGraphMathExtractBlock<Vector2> {\n constructor(config?: IFlowGraphBlockConfiguration) {\n super(2, RichTypeVector2, config);\n }\n\n public override _updateOutputs(context: FlowGraphContext): void {\n let input = this.getDataInput(\"input\")?.getValue(context) as Vector2;\n if (!input) {\n input = Vector2.Zero();\n this.getDataInput(\"input\")!.setValue(input, context);\n }\n this.getDataOutput(\"output_0\")!.setValue(input.x, context);\n this.getDataOutput(\"output_1\")!.setValue(input.y, context);\n }\n\n public override getClassName(): string {\n return FlowGraphBlockNames.ExtractVector2;\n }\n}\n\nRegisterClass(FlowGraphBlockNames.ExtractVector2, FlowGraphExtractVector2Block);\n\n/**\n * Extracts three floats from a Vector3\n */\nexport class FlowGraphExtractVector3Block extends FlowGraphMathExtractBlock<Vector3> {\n constructor(config?: IFlowGraphBlockConfiguration) {\n super(3, RichTypeVector3, config);\n }\n public override _updateOutputs(context: FlowGraphContext): void {\n let input = this.getDataInput(\"input\")?.getValue(context) as Vector3;\n if (!input) {\n input = Vector3.Zero();\n this.getDataInput(\"input\")!.setValue(input, context);\n }\n this.getDataOutput(\"output_0\")!.setValue(input.x, context);\n this.getDataOutput(\"output_1\")!.setValue(input.y, context);\n this.getDataOutput(\"output_2\")!.setValue(input.z, context);\n }\n\n public override getClassName(): string {\n return FlowGraphBlockNames.ExtractVector3;\n }\n}\n\nRegisterClass(FlowGraphBlockNames.ExtractVector3, FlowGraphExtractVector3Block);\n\n/**\n * Extracts four floats from a Vector4\n */\nexport class FlowGraphExtractVector4Block extends FlowGraphMathExtractBlock<Vector4> {\n constructor(config?: IFlowGraphBlockConfiguration) {\n super(4, RichTypeVector4, config);\n }\n public override _updateOutputs(context: FlowGraphContext): void {\n let input = this.getDataInput(\"input\")?.getValue(context) as Vector4;\n if (!input) {\n input = Vector4.Zero();\n this.getDataInput(\"input\")!.setValue(input, context);\n }\n this.getDataOutput(\"output_0\")!.setValue(input.x, context);\n this.getDataOutput(\"output_1\")!.setValue(input.y, context);\n this.getDataOutput(\"output_2\")!.setValue(input.z, context);\n this.getDataOutput(\"output_3\")!.setValue(input.w, context);\n }\n\n public override getClassName(): string {\n return FlowGraphBlockNames.ExtractVector4;\n }\n}\n\nRegisterClass(FlowGraphBlockNames.ExtractVector4, FlowGraphExtractVector4Block);\n\n/**\n * Extracts 16 floats from a Matrix\n */\nexport class FlowGraphExtractMatrixBlock extends FlowGraphMathExtractBlock<Matrix> {\n constructor(config?: IFlowGraphBlockConfiguration) {\n super(16, RichTypeMatrix, config);\n }\n public override _updateOutputs(context: FlowGraphContext): void {\n let input = this.getDataInput(\"input\")?.getValue(context) as Matrix;\n if (!input) {\n input = Matrix.Identity();\n this.getDataInput(\"input\")!.setValue(input, context);\n }\n for (let i = 0; i < 16; i++) {\n this.getDataOutput(`output_${i}`)!.setValue(input.m[i], context);\n }\n }\n\n public override getClassName(): string {\n return FlowGraphBlockNames.ExtractMatrix;\n }\n}\n\nRegisterClass(FlowGraphBlockNames.ExtractMatrix, FlowGraphExtractMatrixBlock);\n\n/**\n * Extracts 4 floats from a Matrix2D\n */\nexport class FlowGraphExtractMatrix2DBlock extends FlowGraphMathExtractBlock<FlowGraphMatrix2D> {\n constructor(config?: IFlowGraphBlockConfiguration) {\n super(4, RichTypeMatrix2D, config);\n }\n public override _updateOutputs(context: FlowGraphContext): void {\n let input = this.getDataInput(\"input\")?.getValue(context) as FlowGraphMatrix2D;\n if (!input) {\n input = new FlowGraphMatrix2D();\n this.getDataInput(\"input\")!.setValue(input, context);\n }\n for (let i = 0; i < 4; i++) {\n this.getDataOutput(`output_${i}`)!.setValue(input.m[i], context);\n }\n }\n\n public override getClassName(): string {\n return FlowGraphBlockNames.ExtractMatrix2D;\n }\n}\n\nRegisterClass(FlowGraphBlockNames.ExtractMatrix2D, FlowGraphExtractMatrix2DBlock);\n\n/**\n * Extracts 4 floats from a Matrix2D\n */\nexport class FlowGraphExtractMatrix3DBlock extends FlowGraphMathExtractBlock<FlowGraphMatrix3D> {\n constructor(config?: IFlowGraphBlockConfiguration) {\n super(9, RichTypeMatrix3D, config);\n }\n public override _updateOutputs(context: FlowGraphContext): void {\n let input = this.getDataInput(\"input\")?.getValue(context) as FlowGraphMatrix3D;\n if (!input) {\n input = new FlowGraphMatrix3D();\n this.getDataInput(\"input\")!.setValue(input, context);\n }\n for (let i = 0; i < 9; i++) {\n this.getDataOutput(`output_${i}`)!.setValue(input.m[i], context);\n }\n }\n\n public override getClassName(): string {\n return FlowGraphBlockNames.ExtractMatrix3D;\n }\n}\n\nRegisterClass(FlowGraphBlockNames.ExtractMatrix3D, FlowGraphExtractMatrix3DBlock);\n"]}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import type { IFlowGraphBlockConfiguration } from "../../../flowGraphBlock.js";
|
|
2
|
+
import { FlowGraphBlock } from "../../../flowGraphBlock.js";
|
|
3
|
+
import type { FlowGraphContext } from "../../../flowGraphContext.js";
|
|
4
|
+
import type { FlowGraphDataConnection } from "../../../flowGraphDataConnection.js";
|
|
5
|
+
import { FlowGraphTypes } from "../../../flowGraphRichTypes.js";
|
|
6
|
+
import { Matrix, Quaternion, Vector3 } from "../../../../Maths/math.vector.js";
|
|
7
|
+
import { FlowGraphUnaryOperationBlock } from "../flowGraphUnaryOperationBlock";
|
|
8
|
+
import { FlowGraphBinaryOperationBlock } from "../flowGraphBinaryOperationBlock";
|
|
9
|
+
import type { FlowGraphMatrix } from "../../../utils.js";
|
|
10
|
+
/**
|
|
11
|
+
* Configuration for the matrix blocks.
|
|
12
|
+
*/
|
|
13
|
+
export interface IFlowGraphMatrixBlockConfiguration extends IFlowGraphBlockConfiguration {
|
|
14
|
+
/**
|
|
15
|
+
* The type of the matrix. Default is Matrix (which is 4x4)
|
|
16
|
+
*/
|
|
17
|
+
matrixType: FlowGraphTypes;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Transposes a matrix.
|
|
21
|
+
*/
|
|
22
|
+
export declare class FlowGraphTransposeBlock extends FlowGraphUnaryOperationBlock<FlowGraphMatrix, FlowGraphMatrix> {
|
|
23
|
+
/**
|
|
24
|
+
* Creates a new instance of the block.
|
|
25
|
+
* @param config the configuration of the block
|
|
26
|
+
*/
|
|
27
|
+
constructor(config?: IFlowGraphMatrixBlockConfiguration);
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Gets the determinant of a matrix.
|
|
31
|
+
*/
|
|
32
|
+
export declare class FlowGraphDeterminantBlock extends FlowGraphUnaryOperationBlock<FlowGraphMatrix, number> {
|
|
33
|
+
/**
|
|
34
|
+
* Creates a new instance of the block.
|
|
35
|
+
* @param config the configuration of the block
|
|
36
|
+
*/
|
|
37
|
+
constructor(config?: IFlowGraphMatrixBlockConfiguration);
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Inverts a matrix.
|
|
41
|
+
*/
|
|
42
|
+
export declare class FlowGraphInvertMatrixBlock extends FlowGraphUnaryOperationBlock<FlowGraphMatrix, FlowGraphMatrix> {
|
|
43
|
+
/**
|
|
44
|
+
* Creates a new instance of the inverse block.
|
|
45
|
+
* @param config the configuration of the block
|
|
46
|
+
*/
|
|
47
|
+
constructor(config?: IFlowGraphMatrixBlockConfiguration);
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Multiplies two matrices.
|
|
51
|
+
*/
|
|
52
|
+
export declare class FlowGraphMatrixMultiplicationBlock extends FlowGraphBinaryOperationBlock<FlowGraphMatrix, FlowGraphMatrix, FlowGraphMatrix> {
|
|
53
|
+
/**
|
|
54
|
+
* Creates a new instance of the multiplication block.
|
|
55
|
+
* Note - this is similar to the math multiplication if not using matrix per-component multiplication.
|
|
56
|
+
* @param config the configuration of the block
|
|
57
|
+
*/
|
|
58
|
+
constructor(config?: IFlowGraphMatrixBlockConfiguration);
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Matrix decompose block
|
|
62
|
+
*/
|
|
63
|
+
export declare class FlowGraphMatrixDecomposeBlock extends FlowGraphBlock {
|
|
64
|
+
/**
|
|
65
|
+
* The input of this block
|
|
66
|
+
*/
|
|
67
|
+
readonly input: FlowGraphDataConnection<Matrix>;
|
|
68
|
+
/**
|
|
69
|
+
* The position output of this block
|
|
70
|
+
*/
|
|
71
|
+
readonly position: FlowGraphDataConnection<Vector3>;
|
|
72
|
+
/**
|
|
73
|
+
* The rotation output of this block
|
|
74
|
+
*/
|
|
75
|
+
readonly rotationQuaternion: FlowGraphDataConnection<Quaternion>;
|
|
76
|
+
/**
|
|
77
|
+
* The scaling output of this block
|
|
78
|
+
*/
|
|
79
|
+
readonly scaling: FlowGraphDataConnection<Vector3>;
|
|
80
|
+
constructor(config?: IFlowGraphBlockConfiguration);
|
|
81
|
+
_updateOutputs(context: FlowGraphContext): void;
|
|
82
|
+
getClassName(): string;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Matrix compose block
|
|
86
|
+
*/
|
|
87
|
+
export declare class FlowGraphMatrixComposeBlock extends FlowGraphBlock {
|
|
88
|
+
/**
|
|
89
|
+
* The position input of this block
|
|
90
|
+
*/
|
|
91
|
+
readonly position: FlowGraphDataConnection<Vector3>;
|
|
92
|
+
/**
|
|
93
|
+
* The rotation input of this block
|
|
94
|
+
*/
|
|
95
|
+
readonly rotationQuaternion: FlowGraphDataConnection<Quaternion>;
|
|
96
|
+
/**
|
|
97
|
+
* The scaling input of this block
|
|
98
|
+
*/
|
|
99
|
+
readonly scaling: FlowGraphDataConnection<Vector3>;
|
|
100
|
+
/**
|
|
101
|
+
* The output of this block
|
|
102
|
+
*/
|
|
103
|
+
readonly output: FlowGraphDataConnection<Matrix>;
|
|
104
|
+
constructor(config?: IFlowGraphBlockConfiguration);
|
|
105
|
+
_updateOutputs(context: FlowGraphContext): void;
|
|
106
|
+
getClassName(): string;
|
|
107
|
+
}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { FlowGraphBlock } from "../../../flowGraphBlock.js";
|
|
2
|
+
import { getRichTypeByFlowGraphType, RichTypeMatrix, RichTypeNumber, RichTypeQuaternion, RichTypeVector3 } from "../../../flowGraphRichTypes.js";
|
|
3
|
+
import { Matrix, Quaternion, Vector3 } from "../../../../Maths/math.vector.js";
|
|
4
|
+
import { RegisterClass } from "../../../../Misc/typeStore.js";
|
|
5
|
+
import { FlowGraphUnaryOperationBlock } from "../flowGraphUnaryOperationBlock.js";
|
|
6
|
+
import { FlowGraphBinaryOperationBlock } from "../flowGraphBinaryOperationBlock.js";
|
|
7
|
+
/**
|
|
8
|
+
* Transposes a matrix.
|
|
9
|
+
*/
|
|
10
|
+
export class FlowGraphTransposeBlock extends FlowGraphUnaryOperationBlock {
|
|
11
|
+
/**
|
|
12
|
+
* Creates a new instance of the block.
|
|
13
|
+
* @param config the configuration of the block
|
|
14
|
+
*/
|
|
15
|
+
constructor(config) {
|
|
16
|
+
super(getRichTypeByFlowGraphType(config?.matrixType || "Matrix" /* FlowGraphTypes.Matrix */), getRichTypeByFlowGraphType(config?.matrixType || "Matrix" /* FlowGraphTypes.Matrix */), (a) => (a.transpose ? a.transpose() : Matrix.Transpose(a)), "FlowGraphTransposeBlock" /* FlowGraphBlockNames.Transpose */, config);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
RegisterClass("FlowGraphTransposeBlock" /* FlowGraphBlockNames.Transpose */, FlowGraphTransposeBlock);
|
|
20
|
+
/**
|
|
21
|
+
* Gets the determinant of a matrix.
|
|
22
|
+
*/
|
|
23
|
+
export class FlowGraphDeterminantBlock extends FlowGraphUnaryOperationBlock {
|
|
24
|
+
/**
|
|
25
|
+
* Creates a new instance of the block.
|
|
26
|
+
* @param config the configuration of the block
|
|
27
|
+
*/
|
|
28
|
+
constructor(config) {
|
|
29
|
+
super(getRichTypeByFlowGraphType(config?.matrixType || "Matrix" /* FlowGraphTypes.Matrix */), RichTypeNumber, (a) => a.determinant(), "FlowGraphDeterminantBlock" /* FlowGraphBlockNames.Determinant */, config);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
RegisterClass("FlowGraphDeterminantBlock" /* FlowGraphBlockNames.Determinant */, FlowGraphDeterminantBlock);
|
|
33
|
+
/**
|
|
34
|
+
* Inverts a matrix.
|
|
35
|
+
*/
|
|
36
|
+
export class FlowGraphInvertMatrixBlock extends FlowGraphUnaryOperationBlock {
|
|
37
|
+
/**
|
|
38
|
+
* Creates a new instance of the inverse block.
|
|
39
|
+
* @param config the configuration of the block
|
|
40
|
+
*/
|
|
41
|
+
constructor(config) {
|
|
42
|
+
super(getRichTypeByFlowGraphType(config?.matrixType || "Matrix" /* FlowGraphTypes.Matrix */), getRichTypeByFlowGraphType(config?.matrixType || "Matrix" /* FlowGraphTypes.Matrix */), (a) => (a.inverse ? a.inverse() : Matrix.Invert(a)), "FlowGraphInvertMatrixBlock" /* FlowGraphBlockNames.InvertMatrix */, config);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
RegisterClass("FlowGraphInvertMatrixBlock" /* FlowGraphBlockNames.InvertMatrix */, FlowGraphInvertMatrixBlock);
|
|
46
|
+
/**
|
|
47
|
+
* Multiplies two matrices.
|
|
48
|
+
*/
|
|
49
|
+
export class FlowGraphMatrixMultiplicationBlock extends FlowGraphBinaryOperationBlock {
|
|
50
|
+
/**
|
|
51
|
+
* Creates a new instance of the multiplication block.
|
|
52
|
+
* Note - this is similar to the math multiplication if not using matrix per-component multiplication.
|
|
53
|
+
* @param config the configuration of the block
|
|
54
|
+
*/
|
|
55
|
+
constructor(config) {
|
|
56
|
+
super(getRichTypeByFlowGraphType(config?.matrixType || "Matrix" /* FlowGraphTypes.Matrix */), getRichTypeByFlowGraphType(config?.matrixType || "Matrix" /* FlowGraphTypes.Matrix */), getRichTypeByFlowGraphType(config?.matrixType || "Matrix" /* FlowGraphTypes.Matrix */), (a, b) => a.multiply(b), "FlowGraphMatrixMultiplicationBlock" /* FlowGraphBlockNames.MatrixMultiplication */, config);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
RegisterClass("FlowGraphMatrixMultiplicationBlock" /* FlowGraphBlockNames.MatrixMultiplication */, FlowGraphMatrixMultiplicationBlock);
|
|
60
|
+
/**
|
|
61
|
+
* Matrix decompose block
|
|
62
|
+
*/
|
|
63
|
+
export class FlowGraphMatrixDecomposeBlock extends FlowGraphBlock {
|
|
64
|
+
constructor(config) {
|
|
65
|
+
super(config);
|
|
66
|
+
this.input = this.registerDataInput("input", RichTypeMatrix);
|
|
67
|
+
this.position = this.registerDataOutput("position", RichTypeVector3);
|
|
68
|
+
this.rotationQuaternion = this.registerDataOutput("rotationQuaternion", RichTypeQuaternion);
|
|
69
|
+
this.scaling = this.registerDataOutput("scaling", RichTypeVector3);
|
|
70
|
+
}
|
|
71
|
+
_updateOutputs(context) {
|
|
72
|
+
const cachedExecutionId = context._getExecutionVariable(this, "executionId", -1);
|
|
73
|
+
const cachedPosition = context._getExecutionVariable(this, "cachedPosition", null);
|
|
74
|
+
const cachedRotation = context._getExecutionVariable(this, "cachedRotation", null);
|
|
75
|
+
const cachedScaling = context._getExecutionVariable(this, "cachedScaling", null);
|
|
76
|
+
if (cachedExecutionId === context.executionId && cachedPosition && cachedRotation && cachedScaling) {
|
|
77
|
+
this.position.setValue(cachedPosition, context);
|
|
78
|
+
this.rotationQuaternion.setValue(cachedRotation, context);
|
|
79
|
+
this.scaling.setValue(cachedScaling, context);
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
const matrix = this.input.getValue(context);
|
|
83
|
+
const position = cachedPosition || new Vector3();
|
|
84
|
+
const rotation = cachedRotation || new Quaternion();
|
|
85
|
+
const scaling = cachedScaling || new Vector3();
|
|
86
|
+
matrix.decompose(scaling, rotation, position);
|
|
87
|
+
this.position.setValue(position, context);
|
|
88
|
+
this.rotationQuaternion.setValue(rotation, context);
|
|
89
|
+
this.scaling.setValue(scaling, context);
|
|
90
|
+
context._setExecutionVariable(this, "cachedPosition", position);
|
|
91
|
+
context._setExecutionVariable(this, "cachedRotation", rotation);
|
|
92
|
+
context._setExecutionVariable(this, "cachedScaling", scaling);
|
|
93
|
+
context._setExecutionVariable(this, "executionId", context.executionId);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
getClassName() {
|
|
97
|
+
return "FlowGraphMatrixDecompose" /* FlowGraphBlockNames.MatrixDecompose */;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
RegisterClass("FlowGraphMatrixDecompose" /* FlowGraphBlockNames.MatrixDecompose */, FlowGraphMatrixDecomposeBlock);
|
|
101
|
+
/**
|
|
102
|
+
* Matrix compose block
|
|
103
|
+
*/
|
|
104
|
+
export class FlowGraphMatrixComposeBlock extends FlowGraphBlock {
|
|
105
|
+
constructor(config) {
|
|
106
|
+
super(config);
|
|
107
|
+
this.position = this.registerDataInput("position", RichTypeVector3);
|
|
108
|
+
this.rotationQuaternion = this.registerDataInput("rotationQuaternion", RichTypeQuaternion);
|
|
109
|
+
this.scaling = this.registerDataInput("scaling", RichTypeVector3);
|
|
110
|
+
this.output = this.registerDataOutput("output", RichTypeMatrix);
|
|
111
|
+
}
|
|
112
|
+
_updateOutputs(context) {
|
|
113
|
+
const cachedExecutionId = context._getExecutionVariable(this, "executionId", -1);
|
|
114
|
+
const cachedMatrix = context._getExecutionVariable(this, "cachedMatrix", null);
|
|
115
|
+
if (cachedExecutionId === context.executionId && cachedMatrix) {
|
|
116
|
+
this.output.setValue(cachedMatrix, context);
|
|
117
|
+
}
|
|
118
|
+
else {
|
|
119
|
+
const matrix = Matrix.Compose(this.scaling.getValue(context), this.rotationQuaternion.getValue(context), this.position.getValue(context));
|
|
120
|
+
this.output.setValue(matrix, context);
|
|
121
|
+
context._setExecutionVariable(this, "cachedMatrix", matrix);
|
|
122
|
+
context._setExecutionVariable(this, "executionId", context.executionId);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
getClassName() {
|
|
126
|
+
return "FlowGraphMatrixCompose" /* FlowGraphBlockNames.MatrixCompose */;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
RegisterClass("FlowGraphMatrixCompose" /* FlowGraphBlockNames.MatrixCompose */, FlowGraphMatrixComposeBlock);
|
|
130
|
+
//# sourceMappingURL=flowGraphMatrixMathBlocks.js.map
|