@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
|
@@ -1,32 +1,49 @@
|
|
|
1
1
|
import { FlowGraphConnection } from "./flowGraphConnection.js";
|
|
2
2
|
import { RegisterClass } from "../Misc/typeStore.js";
|
|
3
3
|
/**
|
|
4
|
-
* @experimental
|
|
5
4
|
* Represents a connection point for a signal.
|
|
6
5
|
* When an output point is activated, it will activate the connected input point.
|
|
7
6
|
* When an input point is activated, it will execute the block it belongs to.
|
|
8
7
|
*/
|
|
9
8
|
export class FlowGraphSignalConnection extends FlowGraphConnection {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
9
|
+
constructor() {
|
|
10
|
+
super(...arguments);
|
|
11
|
+
/**
|
|
12
|
+
* The priority of the signal. Signals with higher priority will be executed first.
|
|
13
|
+
* Set priority before adding the connection as sorting happens only when the connection is added.
|
|
14
|
+
*/
|
|
15
|
+
this.priority = 0;
|
|
16
|
+
}
|
|
16
17
|
_isSingularConnection() {
|
|
17
|
-
return
|
|
18
|
+
return false;
|
|
19
|
+
}
|
|
20
|
+
connectTo(point) {
|
|
21
|
+
super.connectTo(point);
|
|
22
|
+
// sort according to priority to handle execution order
|
|
23
|
+
this._connectedPoint.sort((a, b) => b.priority - a.priority);
|
|
18
24
|
}
|
|
19
25
|
/**
|
|
20
26
|
* @internal
|
|
21
27
|
*/
|
|
22
28
|
_activateSignal(context) {
|
|
29
|
+
context.logger?.addLogItem({
|
|
30
|
+
action: "ActivateSignal" /* FlowGraphAction.ActivateSignal */,
|
|
31
|
+
className: this._ownerBlock.getClassName(),
|
|
32
|
+
uniqueId: this._ownerBlock.uniqueId,
|
|
33
|
+
payload: {
|
|
34
|
+
connectionType: this.connectionType,
|
|
35
|
+
name: this.name,
|
|
36
|
+
},
|
|
37
|
+
});
|
|
23
38
|
if (this.connectionType === 0 /* FlowGraphConnectionType.Input */) {
|
|
24
39
|
context._notifyExecuteNode(this._ownerBlock);
|
|
25
40
|
this._ownerBlock._execute(context, this);
|
|
26
41
|
context._increaseExecutionId();
|
|
27
42
|
}
|
|
28
43
|
else {
|
|
29
|
-
this._connectedPoint
|
|
44
|
+
for (const connectedPoint of this._connectedPoint) {
|
|
45
|
+
connectedPoint._activateSignal(context);
|
|
46
|
+
}
|
|
30
47
|
}
|
|
31
48
|
}
|
|
32
49
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flowGraphSignalConnection.js","sourceRoot":"","sources":["../../../../dev/core/src/FlowGraph/flowGraphSignalConnection.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAA2B,MAAM,uBAAuB,CAAC;AAErF,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"flowGraphSignalConnection.js","sourceRoot":"","sources":["../../../../dev/core/src/FlowGraph/flowGraphSignalConnection.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAA2B,MAAM,uBAAuB,CAAC;AAErF,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAGlD;;;;GAIG;AACH,MAAM,OAAO,yBAA0B,SAAQ,mBAAuE;IAAtH;;QAMI;;;WAGG;QACI,aAAQ,GAAW,CAAC,CAAC;IAmChC,CAAC;IAjCmB,qBAAqB;QACjC,OAAO,KAAK,CAAC;IACjB,CAAC;IAEe,SAAS,CAAC,KAAgC;QACtD,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QACvB,uDAAuD;QACvD,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,GAAG,CAAC,CAAC,QAAQ,CAAC,CAAC;IACjE,CAAC;IAED;;OAEG;IACI,eAAe,CAAC,OAAyB;QAC5C,OAAO,CAAC,MAAM,EAAE,UAAU,CAAC;YACvB,MAAM,uDAAgC;YACtC,SAAS,EAAE,IAAI,CAAC,WAAW,CAAC,YAAY,EAAE;YAC1C,QAAQ,EAAE,IAAI,CAAC,WAAW,CAAC,QAAQ;YACnC,OAAO,EAAE;gBACL,cAAc,EAAE,IAAI,CAAC,cAAc;gBACnC,IAAI,EAAE,IAAI,CAAC,IAAI;aAClB;SACJ,CAAC,CAAC;QACH,IAAI,IAAI,CAAC,cAAc,0CAAkC,EAAE,CAAC;YACxD,OAAO,CAAC,kBAAkB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;YAC7C,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;YACzC,OAAO,CAAC,oBAAoB,EAAE,CAAC;QACnC,CAAC;aAAM,CAAC;YACJ,KAAK,MAAM,cAAc,IAAI,IAAI,CAAC,eAAe,EAAE,CAAC;gBAChD,cAAc,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;YAC5C,CAAC;QACL,CAAC;IACL,CAAC;CACJ;AAED,aAAa,CAAC,2BAA2B,EAAE,yBAAyB,CAAC,CAAC","sourcesContent":["import type { FlowGraphExecutionBlock } from \"./flowGraphExecutionBlock\";\r\nimport { FlowGraphConnection, FlowGraphConnectionType } from \"./flowGraphConnection\";\r\nimport type { FlowGraphContext } from \"./flowGraphContext\";\r\nimport { RegisterClass } from \"../Misc/typeStore\";\r\nimport { FlowGraphAction } from \"./flowGraphLogger\";\r\n\r\n/**\r\n * Represents a connection point for a signal.\r\n * When an output point is activated, it will activate the connected input point.\r\n * When an input point is activated, it will execute the block it belongs to.\r\n */\r\nexport class FlowGraphSignalConnection extends FlowGraphConnection<FlowGraphExecutionBlock, FlowGraphSignalConnection> {\r\n /**\r\n * Optional payload. Can be used, for example, when an error is thrown to pass additional information.\r\n */\r\n public payload: any;\r\n\r\n /**\r\n * The priority of the signal. Signals with higher priority will be executed first.\r\n * Set priority before adding the connection as sorting happens only when the connection is added.\r\n */\r\n public priority: number = 0;\r\n\r\n public override _isSingularConnection(): boolean {\r\n return false;\r\n }\r\n\r\n public override connectTo(point: FlowGraphSignalConnection): void {\r\n super.connectTo(point);\r\n // sort according to priority to handle execution order\r\n this._connectedPoint.sort((a, b) => b.priority - a.priority);\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _activateSignal(context: FlowGraphContext): void {\r\n context.logger?.addLogItem({\r\n action: FlowGraphAction.ActivateSignal,\r\n className: this._ownerBlock.getClassName(),\r\n uniqueId: this._ownerBlock.uniqueId,\r\n payload: {\r\n connectionType: this.connectionType,\r\n name: this.name,\r\n },\r\n });\r\n if (this.connectionType === FlowGraphConnectionType.Input) {\r\n context._notifyExecuteNode(this._ownerBlock);\r\n this._ownerBlock._execute(context, this);\r\n context._increaseExecutionId();\r\n } else {\r\n for (const connectedPoint of this._connectedPoint) {\r\n connectedPoint._activateSignal(context);\r\n }\r\n }\r\n }\r\n}\r\n\r\nRegisterClass(\"FlowGraphSignalConnection\", FlowGraphSignalConnection);\r\n"]}
|
package/FlowGraph/index.d.ts
CHANGED
|
@@ -7,7 +7,12 @@ export * from "./flowGraphRichTypes";
|
|
|
7
7
|
export * from "./flowGraphContext";
|
|
8
8
|
export * from "./flowGraphCoordinator";
|
|
9
9
|
export * from "./typeDefinitions";
|
|
10
|
-
export * from "./flowGraphContextLogger";
|
|
11
10
|
export * from "./flowGraphConnection";
|
|
12
11
|
export * from "./flowGraphDataConnection";
|
|
12
|
+
export * from "./flowGraphAssetsContext";
|
|
13
|
+
export * from "./flowGraphParser";
|
|
14
|
+
export * from "./flowGraphPathConverter";
|
|
15
|
+
export * from "./flowGraphPathConverterComponent";
|
|
16
|
+
export * from "./flowGraphLogger";
|
|
13
17
|
export * from "./Blocks/index";
|
|
18
|
+
export * from "./CustomTypes/index";
|
package/FlowGraph/index.js
CHANGED
|
@@ -7,9 +7,15 @@ export * from "./flowGraphRichTypes.js";
|
|
|
7
7
|
export * from "./flowGraphContext.js";
|
|
8
8
|
export * from "./flowGraphCoordinator.js";
|
|
9
9
|
export * from "./typeDefinitions.js";
|
|
10
|
-
export * from "./flowGraphContextLogger.js";
|
|
11
10
|
export * from "./flowGraphConnection.js";
|
|
12
11
|
export * from "./flowGraphDataConnection.js";
|
|
12
|
+
export * from "./flowGraphAssetsContext.js";
|
|
13
|
+
export * from "./flowGraphParser.js";
|
|
14
|
+
export * from "./flowGraphPathConverter.js";
|
|
15
|
+
export * from "./flowGraphPathConverterComponent.js";
|
|
16
|
+
export * from "./flowGraphLogger.js";
|
|
13
17
|
// eslint-disable-next-line import/no-internal-modules
|
|
14
18
|
export * from "./Blocks/index.js";
|
|
19
|
+
// eslint-disable-next-line import/no-internal-modules
|
|
20
|
+
export * from "./CustomTypes/index.js";
|
|
15
21
|
//# sourceMappingURL=index.js.map
|
package/FlowGraph/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../dev/core/src/FlowGraph/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../dev/core/src/FlowGraph/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0BAA0B,CAAC;AACzC,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,mCAAmC,CAAC;AAClD,cAAc,mBAAmB,CAAC;AAClC,sDAAsD;AACtD,cAAc,gBAAgB,CAAC;AAC/B,sDAAsD;AACtD,cAAc,qBAAqB,CAAC","sourcesContent":["export * from \"./flowGraph\";\r\nexport * from \"./flowGraphBlock\";\r\nexport * from \"./flowGraphSignalConnection\";\r\nexport * from \"./flowGraphExecutionBlock\";\r\nexport * from \"./flowGraphEventBlock\";\r\nexport * from \"./flowGraphRichTypes\";\r\nexport * from \"./flowGraphContext\";\r\nexport * from \"./flowGraphCoordinator\";\r\nexport * from \"./typeDefinitions\";\r\nexport * from \"./flowGraphConnection\";\r\nexport * from \"./flowGraphDataConnection\";\r\nexport * from \"./flowGraphAssetsContext\";\r\nexport * from \"./flowGraphParser\";\r\nexport * from \"./flowGraphPathConverter\";\r\nexport * from \"./flowGraphPathConverterComponent\";\r\nexport * from \"./flowGraphLogger\";\r\n// eslint-disable-next-line import/no-internal-modules\r\nexport * from \"./Blocks/index\";\r\n// eslint-disable-next-line import/no-internal-modules\r\nexport * from \"./CustomTypes/index\";\r\n"]}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import type { IAssetContainer } from "../IAssetContainer.js";
|
|
1
2
|
import type { Scene } from "../scene";
|
|
3
|
+
import { FlowGraphBlockNames } from "./Blocks/flowGraphBlockNames";
|
|
2
4
|
/**
|
|
3
5
|
* The default function that serializes values in a context object to a serialization object
|
|
4
6
|
* @param key the key where the value should be stored in the serialization object
|
|
@@ -10,10 +12,11 @@ export declare function defaultValueSerializationFunction(key: string, value: an
|
|
|
10
12
|
* The default function that parses values stored in a serialization object
|
|
11
13
|
* @param key the key to the value that will be parsed
|
|
12
14
|
* @param serializationObject the object that will be parsed
|
|
15
|
+
* @param assetsContainer the assets container that will be used to find the objects
|
|
13
16
|
* @param scene
|
|
14
17
|
* @returns
|
|
15
18
|
*/
|
|
16
|
-
export declare function defaultValueParseFunction(key: string, serializationObject: any, scene: Scene): any;
|
|
19
|
+
export declare function defaultValueParseFunction(key: string, serializationObject: any, assetsContainer: IAssetContainer, scene: Scene): any;
|
|
17
20
|
/**
|
|
18
21
|
* Given a name of a flow graph block class, return if this
|
|
19
22
|
* class needs to be created with a path converter. Used in
|
|
@@ -21,4 +24,4 @@ export declare function defaultValueParseFunction(key: string, serializationObje
|
|
|
21
24
|
* @param className the name of the flow graph block class
|
|
22
25
|
* @returns a boolean indicating if the class needs a path converter
|
|
23
26
|
*/
|
|
24
|
-
export declare function needsPathConverter(className: string): className is
|
|
27
|
+
export declare function needsPathConverter(className: string): className is FlowGraphBlockNames.JsonPointerParser;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { Color3, Color4 } from "../Maths/math.color.js";
|
|
2
2
|
import { Matrix, Quaternion, Vector2, Vector3, Vector4 } from "../Maths/math.vector.js";
|
|
3
|
-
import { FlowGraphInteger } from "./flowGraphInteger.js";
|
|
3
|
+
import { FlowGraphInteger } from "./CustomTypes/flowGraphInteger.js";
|
|
4
|
+
import { getRichTypeByFlowGraphType } from "./flowGraphRichTypes.js";
|
|
5
|
+
import { FlowGraphMatrix2D, FlowGraphMatrix3D } from "./CustomTypes/flowGraphMatrix.js";
|
|
4
6
|
function isMeshClassName(className) {
|
|
5
7
|
return (className === "Mesh" ||
|
|
6
8
|
className === "AbstractMesh" ||
|
|
@@ -12,25 +14,43 @@ function isMeshClassName(className) {
|
|
|
12
14
|
className === "TrailMesh");
|
|
13
15
|
}
|
|
14
16
|
function isVectorClassName(className) {
|
|
15
|
-
return className === "Vector2"
|
|
17
|
+
return (className === "Vector2" /* FlowGraphTypes.Vector2 */ ||
|
|
18
|
+
className === "Vector3" /* FlowGraphTypes.Vector3 */ ||
|
|
19
|
+
className === "Vector4" /* FlowGraphTypes.Vector4 */ ||
|
|
20
|
+
className === "Quaternion" /* FlowGraphTypes.Quaternion */ ||
|
|
21
|
+
className === "Color3" /* FlowGraphTypes.Color3 */ ||
|
|
22
|
+
className === "Color4" /* FlowGraphTypes.Color4 */);
|
|
16
23
|
}
|
|
17
|
-
function
|
|
18
|
-
|
|
24
|
+
function isMatrixClassName(className) {
|
|
25
|
+
return className === "Matrix" /* FlowGraphTypes.Matrix */ || className === "Matrix2D" /* FlowGraphTypes.Matrix2D */ || className === "Matrix3D" /* FlowGraphTypes.Matrix3D */;
|
|
26
|
+
}
|
|
27
|
+
function isAnimationGroupClassName(className) {
|
|
28
|
+
return className === "AnimationGroup";
|
|
29
|
+
}
|
|
30
|
+
function parseVector(className, value, flipHandedness = false) {
|
|
31
|
+
if (className === "Vector2" /* FlowGraphTypes.Vector2 */) {
|
|
19
32
|
return Vector2.FromArray(value);
|
|
20
33
|
}
|
|
21
|
-
else if (className === "Vector3") {
|
|
34
|
+
else if (className === "Vector3" /* FlowGraphTypes.Vector3 */) {
|
|
35
|
+
if (flipHandedness) {
|
|
36
|
+
value[2] *= -1;
|
|
37
|
+
}
|
|
22
38
|
return Vector3.FromArray(value);
|
|
23
39
|
}
|
|
24
|
-
else if (className === "Vector4") {
|
|
40
|
+
else if (className === "Vector4" /* FlowGraphTypes.Vector4 */) {
|
|
25
41
|
return Vector4.FromArray(value);
|
|
26
42
|
}
|
|
27
|
-
else if (className === "Quaternion") {
|
|
43
|
+
else if (className === "Quaternion" /* FlowGraphTypes.Quaternion */) {
|
|
44
|
+
if (flipHandedness) {
|
|
45
|
+
value[2] *= -1;
|
|
46
|
+
value[3] *= -1;
|
|
47
|
+
}
|
|
28
48
|
return Quaternion.FromArray(value);
|
|
29
49
|
}
|
|
30
|
-
else if (className === "Color3") {
|
|
50
|
+
else if (className === "Color3" /* FlowGraphTypes.Color3 */) {
|
|
31
51
|
return new Color3(value[0], value[1], value[2]);
|
|
32
52
|
}
|
|
33
|
-
else if (className === "Color4") {
|
|
53
|
+
else if (className === "Color4" /* FlowGraphTypes.Color4 */) {
|
|
34
54
|
return new Color4(value[0], value[1], value[2], value[3]);
|
|
35
55
|
}
|
|
36
56
|
else {
|
|
@@ -45,50 +65,102 @@ function parseVector(className, value) {
|
|
|
45
65
|
*/
|
|
46
66
|
export function defaultValueSerializationFunction(key, value, serializationObject) {
|
|
47
67
|
const className = value?.getClassName?.() ?? "";
|
|
48
|
-
if (
|
|
68
|
+
if (isVectorClassName(className) || isMatrixClassName(className)) {
|
|
49
69
|
serializationObject[key] = {
|
|
50
|
-
|
|
70
|
+
value: value.asArray(),
|
|
51
71
|
className,
|
|
52
72
|
};
|
|
53
73
|
}
|
|
54
|
-
else if (
|
|
74
|
+
else if (className === "FlowGraphInteger" /* FlowGraphTypes.Integer */) {
|
|
55
75
|
serializationObject[key] = {
|
|
56
|
-
value: value.
|
|
76
|
+
value: value.value,
|
|
57
77
|
className,
|
|
58
78
|
};
|
|
59
79
|
}
|
|
60
80
|
else {
|
|
61
|
-
|
|
81
|
+
if (className && (value.id || value.name)) {
|
|
82
|
+
serializationObject[key] = {
|
|
83
|
+
id: value.id,
|
|
84
|
+
name: value.name,
|
|
85
|
+
className,
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
// only if it is not an object
|
|
90
|
+
if (typeof value !== "object") {
|
|
91
|
+
serializationObject[key] = value;
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
throw new Error(`Could not serialize value ${value}`);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
62
97
|
}
|
|
63
98
|
}
|
|
64
99
|
/**
|
|
65
100
|
* The default function that parses values stored in a serialization object
|
|
66
101
|
* @param key the key to the value that will be parsed
|
|
67
102
|
* @param serializationObject the object that will be parsed
|
|
103
|
+
* @param assetsContainer the assets container that will be used to find the objects
|
|
68
104
|
* @param scene
|
|
69
105
|
* @returns
|
|
70
106
|
*/
|
|
71
|
-
export function defaultValueParseFunction(key, serializationObject, scene) {
|
|
107
|
+
export function defaultValueParseFunction(key, serializationObject, assetsContainer, scene) {
|
|
72
108
|
const intermediateValue = serializationObject[key];
|
|
73
109
|
let finalValue;
|
|
74
|
-
const className = intermediateValue?.className;
|
|
110
|
+
const className = intermediateValue?.type ?? intermediateValue?.className;
|
|
75
111
|
if (isMeshClassName(className)) {
|
|
76
|
-
|
|
112
|
+
let nodes = scene.meshes.filter((m) => (intermediateValue.id ? m.id === intermediateValue.id : m.name === intermediateValue.name));
|
|
113
|
+
if (nodes.length === 0) {
|
|
114
|
+
nodes = scene.transformNodes.filter((m) => (intermediateValue.id ? m.id === intermediateValue.id : m.name === intermediateValue.name));
|
|
115
|
+
}
|
|
116
|
+
finalValue = intermediateValue.uniqueId ? nodes.find((m) => m.uniqueId === intermediateValue.uniqueId) : nodes[0];
|
|
77
117
|
}
|
|
78
118
|
else if (isVectorClassName(className)) {
|
|
79
119
|
finalValue = parseVector(className, intermediateValue.value);
|
|
80
120
|
}
|
|
81
|
-
else if (className
|
|
121
|
+
else if (isAnimationGroupClassName(className)) {
|
|
122
|
+
// do not use the scene.getAnimationGroupByName because it is possible that two AGs will have the same name
|
|
123
|
+
const ags = scene.animationGroups.filter((ag) => ag.name === intermediateValue.name);
|
|
124
|
+
// uniqueId changes on each load. this is used for the glTF loader, that uses serialization after the scene was loaded.
|
|
125
|
+
finalValue = ags.length === 1 ? ags[0] : ags.find((ag) => ag.uniqueId === intermediateValue.uniqueId);
|
|
126
|
+
}
|
|
127
|
+
else if (className === "Matrix" /* FlowGraphTypes.Matrix */) {
|
|
82
128
|
finalValue = Matrix.FromArray(intermediateValue.value);
|
|
83
129
|
}
|
|
84
|
-
else if (className ===
|
|
85
|
-
finalValue =
|
|
130
|
+
else if (className === "Matrix2D" /* FlowGraphTypes.Matrix2D */) {
|
|
131
|
+
finalValue = new FlowGraphMatrix2D(intermediateValue.value);
|
|
132
|
+
}
|
|
133
|
+
else if (className === "Matrix3D" /* FlowGraphTypes.Matrix3D */) {
|
|
134
|
+
finalValue = new FlowGraphMatrix3D(intermediateValue.value);
|
|
135
|
+
}
|
|
136
|
+
else if (className === "FlowGraphInteger" /* FlowGraphTypes.Integer */) {
|
|
137
|
+
finalValue = FlowGraphInteger.FromValue(intermediateValue.value);
|
|
138
|
+
}
|
|
139
|
+
else if (className === "number" /* FlowGraphTypes.Number */ || className === "string" /* FlowGraphTypes.String */ || className === "boolean" /* FlowGraphTypes.Boolean */) {
|
|
140
|
+
finalValue = intermediateValue.value[0];
|
|
86
141
|
}
|
|
87
142
|
else if (intermediateValue && intermediateValue.value !== undefined) {
|
|
88
143
|
finalValue = intermediateValue.value;
|
|
89
144
|
}
|
|
90
145
|
else {
|
|
91
|
-
|
|
146
|
+
if (Array.isArray(intermediateValue)) {
|
|
147
|
+
// configuration data of an event
|
|
148
|
+
finalValue = intermediateValue.reduce((acc, val) => {
|
|
149
|
+
if (!val.eventData) {
|
|
150
|
+
return acc;
|
|
151
|
+
}
|
|
152
|
+
acc[val.id] = {
|
|
153
|
+
type: getRichTypeByFlowGraphType(val.type),
|
|
154
|
+
};
|
|
155
|
+
if (typeof val.value !== "undefined") {
|
|
156
|
+
acc[val.id].value = defaultValueParseFunction("value", val, assetsContainer, scene);
|
|
157
|
+
}
|
|
158
|
+
return acc;
|
|
159
|
+
}, {});
|
|
160
|
+
}
|
|
161
|
+
else {
|
|
162
|
+
finalValue = intermediateValue;
|
|
163
|
+
}
|
|
92
164
|
}
|
|
93
165
|
return finalValue;
|
|
94
166
|
}
|
|
@@ -102,6 +174,6 @@ export function defaultValueParseFunction(key, serializationObject, scene) {
|
|
|
102
174
|
export function needsPathConverter(className) {
|
|
103
175
|
// I am not using the ClassName property here because it was causing a circular dependency
|
|
104
176
|
// that jest didn't like!
|
|
105
|
-
return className === "
|
|
177
|
+
return className === "FlowGraphJsonPointerParserBlock" /* FlowGraphBlockNames.JsonPointerParser */;
|
|
106
178
|
}
|
|
107
179
|
//# sourceMappingURL=serialization.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serialization.js","sourceRoot":"","sources":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AE,SAAS,CAAC;IAC/C,IAAI,eAAe,CAAC,SAAS,CAAC,EAAE,CAAC;QAC7B,UAAU,GAAG,KAAK,CAAC,aAAa,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;IAC7D,CAAC;SAAM,IAAI,iBAAiB,CAAC,SAAS,CAAC,EAAE,CAAC;QACtC,UAAU,GAAG,WAAW,CAAC,SAAS,EAAE,iBAAiB,CAAC,KAAK,CAAC,CAAC;IACjE,CAAC;SAAM,IAAI,SAAS,KAAK,QAAQ,EAAE,CAAC;QAChC,UAAU,GAAG,MAAM,CAAC,SAAS,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;IAC3D,CAAC;SAAM,IAAI,SAAS,KAAK,gBAAgB,CAAC,SAAS,EAAE,CAAC;QAClD,UAAU,GAAG,gBAAgB,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC;IAC3D,CAAC;SAAM,IAAI,iBAAiB,IAAI,iBAAiB,CAAC,KAAK,KAAK,SAAS,EAAE,CAAC;QACpE,UAAU,GAAG,iBAAiB,CAAC,KAAK,CAAC;IACzC,CAAC;SAAM,CAAC;QACJ,UAAU,GAAG,iBAAiB,CAAC;IACnC,CAAC;IACD,OAAO,UAAU,CAAC;AACtB,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,kBAAkB,CAAC,SAAiB;IAChD,0FAA0F;IAC1F,yBAAyB;IACzB,OAAO,SAAS,KAAK,oBAAoB,IAAI,SAAS,KAAK,oBAAoB,IAAI,SAAS,KAAK,sBAAsB,IAAI,SAAS,KAAK,sBAAsB,CAAC;AACpK,CAAC","sourcesContent":["import { Color3, Color4 } from \"../Maths/math.color\";\r\nimport { Matrix, Quaternion, Vector2, Vector3, Vector4 } from \"../Maths/math.vector\";\r\nimport type { Scene } from \"../scene\";\r\nimport { FlowGraphInteger } from \"./flowGraphInteger\";\r\n\r\nfunction isMeshClassName(className: string) {\r\n return (\r\n className === \"Mesh\" ||\r\n className === \"AbstractMesh\" ||\r\n className === \"GroundMesh\" ||\r\n className === \"InstanceMesh\" ||\r\n className === \"LinesMesh\" ||\r\n className === \"GoldbergMesh\" ||\r\n className === \"GreasedLineMesh\" ||\r\n className === \"TrailMesh\"\r\n );\r\n}\r\n\r\nfunction isVectorClassName(className: string) {\r\n return className === \"Vector2\" || className === \"Vector3\" || className === \"Vector4\" || className === \"Quaternion\" || className === \"Color3\" || className === \"Color4\";\r\n}\r\n\r\nfunction parseVector(className: string, value: Array<number>) {\r\n if (className === \"Vector2\") {\r\n return Vector2.FromArray(value);\r\n } else if (className === \"Vector3\") {\r\n return Vector3.FromArray(value);\r\n } else if (className === \"Vector4\") {\r\n return Vector4.FromArray(value);\r\n } else if (className === \"Quaternion\") {\r\n return Quaternion.FromArray(value);\r\n } else if (className === \"Color3\") {\r\n return new Color3(value[0], value[1], value[2]);\r\n } else if (className === \"Color4\") {\r\n return new Color4(value[0], value[1], value[2], value[3]);\r\n } else {\r\n throw new Error(`Unknown vector class name ${className}`);\r\n }\r\n}\r\n\r\n/**\r\n * The default function that serializes values in a context object to a serialization object\r\n * @param key the key where the value should be stored in the serialization object\r\n * @param value the value to store\r\n * @param serializationObject the object where the value will be stored\r\n */\r\nexport function defaultValueSerializationFunction(key: string, value: any, serializationObject: any) {\r\n const className = value?.getClassName?.() ?? \"\";\r\n if (isMeshClassName(className)) {\r\n serializationObject[key] = {\r\n name: value.name,\r\n className,\r\n };\r\n } else if (isVectorClassName(className)) {\r\n serializationObject[key] = {\r\n value: value.asArray(),\r\n className,\r\n };\r\n } else {\r\n serializationObject[key] = value;\r\n }\r\n}\r\n\r\n/**\r\n * The default function that parses values stored in a serialization object\r\n * @param key the key to the value that will be parsed\r\n * @param serializationObject the object that will be parsed\r\n * @param scene\r\n * @returns\r\n */\r\nexport function defaultValueParseFunction(key: string, serializationObject: any, scene: Scene) {\r\n const intermediateValue = serializationObject[key];\r\n let finalValue;\r\n const className = intermediateValue?.className;\r\n if (isMeshClassName(className)) {\r\n finalValue = scene.getMeshByName(intermediateValue.name);\r\n } else if (isVectorClassName(className)) {\r\n finalValue = parseVector(className, intermediateValue.value);\r\n } else if (className === \"Matrix\") {\r\n finalValue = Matrix.FromArray(intermediateValue.value);\r\n } else if (className === FlowGraphInteger.ClassName) {\r\n finalValue = FlowGraphInteger.Parse(intermediateValue);\r\n } else if (intermediateValue && intermediateValue.value !== undefined) {\r\n finalValue = intermediateValue.value;\r\n } else {\r\n finalValue = intermediateValue;\r\n }\r\n return finalValue;\r\n}\r\n\r\n/**\r\n * Given a name of a flow graph block class, return if this\r\n * class needs to be created with a path converter. Used in\r\n * parsing.\r\n * @param className the name of the flow graph block class\r\n * @returns a boolean indicating if the class needs a path converter\r\n */\r\nexport function needsPathConverter(className: string) {\r\n // I am not using the ClassName property here because it was causing a circular dependency\r\n // that jest didn't like!\r\n return className === \"FGSetPropertyBlock\" || className === \"FGGetPropertyBlock\" || className === \"FGPlayAnimationBlock\" || className === \"FGMeshPickEventBlock\";\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"serialization.js","sourceRoot":"","sources":["../../../../dev/core/src/FlowGraph/serialization.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAGrF,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAkB,0BAA0B,EAAE,MAAM,sBAAsB,CAAC;AAElF,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAErF,SAAS,eAAe,CAAC,SAAiB;IACtC,OAAO,CACH,SAAS,KAAK,MAAM;QACpB,SAAS,KAAK,cAAc;QAC5B,SAAS,KAAK,YAAY;QAC1B,SAAS,KAAK,cAAc;QAC5B,SAAS,KAAK,WAAW;QACzB,SAAS,KAAK,cAAc;Q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r\nimport { Matrix, Quaternion, Vector2, Vector3, Vector4 } from \"../Maths/math.vector\";\r\nimport type { Scene } from \"../scene\";\r\nimport { FlowGraphBlockNames } from \"./Blocks/flowGraphBlockNames\";\r\nimport { FlowGraphInteger } from \"./CustomTypes/flowGraphInteger\";\r\nimport { FlowGraphTypes, getRichTypeByFlowGraphType } from \"./flowGraphRichTypes\";\r\nimport type { TransformNode } from \"core/Meshes/transformNode\";\r\nimport { FlowGraphMatrix2D, FlowGraphMatrix3D } from \"./CustomTypes/flowGraphMatrix\";\r\n\r\nfunction isMeshClassName(className: string) {\r\n return (\r\n className === \"Mesh\" ||\r\n className === \"AbstractMesh\" ||\r\n className === \"GroundMesh\" ||\r\n className === \"InstanceMesh\" ||\r\n className === \"LinesMesh\" ||\r\n className === \"GoldbergMesh\" ||\r\n className === \"GreasedLineMesh\" ||\r\n className === \"TrailMesh\"\r\n );\r\n}\r\n\r\nfunction isVectorClassName(className: string) {\r\n return (\r\n className === FlowGraphTypes.Vector2 ||\r\n className === FlowGraphTypes.Vector3 ||\r\n className === FlowGraphTypes.Vector4 ||\r\n className === FlowGraphTypes.Quaternion ||\r\n className === FlowGraphTypes.Color3 ||\r\n className === FlowGraphTypes.Color4\r\n );\r\n}\r\n\r\nfunction isMatrixClassName(className: string) {\r\n return className === FlowGraphTypes.Matrix || className === FlowGraphTypes.Matrix2D || className === FlowGraphTypes.Matrix3D;\r\n}\r\n\r\nfunction isAnimationGroupClassName(className: string) {\r\n return className === \"AnimationGroup\";\r\n}\r\n\r\nfunction parseVector(className: string, value: Array<number>, flipHandedness = false) {\r\n if (className === FlowGraphTypes.Vector2) {\r\n return Vector2.FromArray(value);\r\n } else if (className === FlowGraphTypes.Vector3) {\r\n if (flipHandedness) {\r\n value[2] *= -1;\r\n }\r\n return Vector3.FromArray(value);\r\n } else if (className === FlowGraphTypes.Vector4) {\r\n return Vector4.FromArray(value);\r\n } else if (className === FlowGraphTypes.Quaternion) {\r\n if (flipHandedness) {\r\n value[2] *= -1;\r\n value[3] *= -1;\r\n }\r\n return Quaternion.FromArray(value);\r\n } else if (className === FlowGraphTypes.Color3) {\r\n return new Color3(value[0], value[1], value[2]);\r\n } else if (className === FlowGraphTypes.Color4) {\r\n return new Color4(value[0], value[1], value[2], value[3]);\r\n } else {\r\n throw new Error(`Unknown vector class name ${className}`);\r\n }\r\n}\r\n\r\n/**\r\n * The default function that serializes values in a context object to a serialization object\r\n * @param key the key where the value should be stored in the serialization object\r\n * @param value the value to store\r\n * @param serializationObject the object where the value will be stored\r\n */\r\nexport function defaultValueSerializationFunction(key: string, value: any, serializationObject: any) {\r\n const className = value?.getClassName?.() ?? \"\";\r\n if (isVectorClassName(className) || isMatrixClassName(className)) {\r\n serializationObject[key] = {\r\n value: value.asArray(),\r\n className,\r\n };\r\n } else if (className === FlowGraphTypes.Integer) {\r\n serializationObject[key] = {\r\n value: value.value,\r\n className,\r\n };\r\n } else {\r\n if (className && (value.id || value.name)) {\r\n serializationObject[key] = {\r\n id: value.id,\r\n name: value.name,\r\n className,\r\n };\r\n } else {\r\n // only if it is not an object\r\n if (typeof value !== \"object\") {\r\n serializationObject[key] = value;\r\n } else {\r\n throw new Error(`Could not serialize value ${value}`);\r\n }\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * The default function that parses values stored in a serialization object\r\n * @param key the key to the value that will be parsed\r\n * @param serializationObject the object that will be parsed\r\n * @param assetsContainer the assets container that will be used to find the objects\r\n * @param scene\r\n * @returns\r\n */\r\nexport function defaultValueParseFunction(key: string, serializationObject: any, assetsContainer: IAssetContainer, scene: Scene) {\r\n const intermediateValue = serializationObject[key];\r\n let finalValue;\r\n const className = intermediateValue?.type ?? intermediateValue?.className;\r\n if (isMeshClassName(className)) {\r\n let nodes: TransformNode[] = scene.meshes.filter((m) => (intermediateValue.id ? m.id === intermediateValue.id : m.name === intermediateValue.name));\r\n if (nodes.length === 0) {\r\n nodes = scene.transformNodes.filter((m) => (intermediateValue.id ? m.id === intermediateValue.id : m.name === intermediateValue.name));\r\n }\r\n finalValue = intermediateValue.uniqueId ? nodes.find((m) => m.uniqueId === intermediateValue.uniqueId) : nodes[0];\r\n } else if (isVectorClassName(className)) {\r\n finalValue = parseVector(className, intermediateValue.value);\r\n } else if (isAnimationGroupClassName(className)) {\r\n // do not use the scene.getAnimationGroupByName because it is possible that two AGs will have the same name\r\n const ags = scene.animationGroups.filter((ag) => ag.name === intermediateValue.name);\r\n // uniqueId changes on each load. this is used for the glTF loader, that uses serialization after the scene was loaded.\r\n finalValue = ags.length === 1 ? ags[0] : ags.find((ag) => ag.uniqueId === intermediateValue.uniqueId);\r\n } else if (className === FlowGraphTypes.Matrix) {\r\n finalValue = Matrix.FromArray(intermediateValue.value);\r\n } else if (className === FlowGraphTypes.Matrix2D) {\r\n finalValue = new FlowGraphMatrix2D(intermediateValue.value);\r\n } else if (className === FlowGraphTypes.Matrix3D) {\r\n finalValue = new FlowGraphMatrix3D(intermediateValue.value);\r\n } else if (className === FlowGraphTypes.Integer) {\r\n finalValue = FlowGraphInteger.FromValue(intermediateValue.value);\r\n } else if (className === FlowGraphTypes.Number || className === FlowGraphTypes.String || className === FlowGraphTypes.Boolean) {\r\n finalValue = intermediateValue.value[0];\r\n } else if (intermediateValue && intermediateValue.value !== undefined) {\r\n finalValue = intermediateValue.value;\r\n } else {\r\n if (Array.isArray(intermediateValue)) {\r\n // configuration data of an event\r\n finalValue = intermediateValue.reduce((acc, val) => {\r\n if (!val.eventData) {\r\n return acc;\r\n }\r\n acc[val.id] = {\r\n type: getRichTypeByFlowGraphType(val.type),\r\n };\r\n if (typeof val.value !== \"undefined\") {\r\n acc[val.id].value = defaultValueParseFunction(\"value\", val, assetsContainer, scene);\r\n }\r\n return acc;\r\n }, {});\r\n } else {\r\n finalValue = intermediateValue;\r\n }\r\n }\r\n return finalValue;\r\n}\r\n\r\n/**\r\n * Given a name of a flow graph block class, return if this\r\n * class needs to be created with a path converter. Used in\r\n * parsing.\r\n * @param className the name of the flow graph block class\r\n * @returns a boolean indicating if the class needs a path converter\r\n */\r\nexport function needsPathConverter(className: string) {\r\n // I am not using the ClassName property here because it was causing a circular dependency\r\n // that jest didn't like!\r\n return className === FlowGraphBlockNames.JsonPointerParser;\r\n}\r\n"]}
|
|
@@ -1,28 +1,72 @@
|
|
|
1
|
+
import type { IAnimatable } from "../Animations/animatable.interface.js";
|
|
2
|
+
import type { Animation } from "../Animations/animation.js";
|
|
1
3
|
import type { FlowGraphConnectionType } from "./flowGraphConnection";
|
|
4
|
+
/**
|
|
5
|
+
* Interpolation generator
|
|
6
|
+
*/
|
|
7
|
+
export interface IInterpolationPropertyInfo {
|
|
8
|
+
/**
|
|
9
|
+
* type of the interpolation
|
|
10
|
+
*/
|
|
11
|
+
type: number;
|
|
12
|
+
/**
|
|
13
|
+
* The name of the property
|
|
14
|
+
*/
|
|
15
|
+
name: string;
|
|
16
|
+
/** @internal */
|
|
17
|
+
getValue: (target: any, source: Float32Array, offset: number, scale: number) => any;
|
|
18
|
+
/** @internal */
|
|
19
|
+
getStride: (target: any) => number;
|
|
20
|
+
/**
|
|
21
|
+
* @internal
|
|
22
|
+
*/
|
|
23
|
+
buildAnimations(target: any, name: string, fps: number, keys: any[]): {
|
|
24
|
+
babylonAnimatable: IAnimatable;
|
|
25
|
+
babylonAnimation: Animation;
|
|
26
|
+
}[];
|
|
27
|
+
}
|
|
2
28
|
/**
|
|
3
29
|
* An accessor that allows modifying properties on some other object.
|
|
4
30
|
*/
|
|
5
|
-
export interface IObjectAccessor {
|
|
31
|
+
export interface IObjectAccessor<GLTFTargetType = any, BabylonTargetType = any, BabylonValueType = any> {
|
|
32
|
+
/**
|
|
33
|
+
* The number of components that are changed in the property when setting this value.
|
|
34
|
+
* This will usually be 1. But, for example, Babylon has both orthoLeft and orthoRight (two components) properties that are changed when setting xmag (single value in glTF).
|
|
35
|
+
* Defaults to 1 if not provided!
|
|
36
|
+
*/
|
|
37
|
+
componentsCount?: number;
|
|
6
38
|
/**
|
|
7
|
-
* The type of the
|
|
39
|
+
* The (babylon) type of the property.
|
|
8
40
|
*/
|
|
9
41
|
type: string;
|
|
10
42
|
/**
|
|
11
|
-
* Get
|
|
12
|
-
* @param args any necessary arguments to get the property value
|
|
43
|
+
* Get the value of the property.
|
|
13
44
|
*/
|
|
14
|
-
get(
|
|
45
|
+
get: (target: GLTFTargetType, index?: number, payload?: any) => BabylonValueType | undefined;
|
|
15
46
|
/**
|
|
16
|
-
*
|
|
17
|
-
* @param value the value to set
|
|
18
|
-
* @param args any necessary arguments to set the property value
|
|
47
|
+
* Get the target of the property.
|
|
19
48
|
*/
|
|
20
|
-
|
|
49
|
+
getTarget: (target: GLTFTargetType, index?: number, payload?: any) => BabylonTargetType | undefined;
|
|
21
50
|
/**
|
|
22
|
-
*
|
|
23
|
-
* @param args any necessary arguments to get the original object
|
|
51
|
+
* is the property readonly?
|
|
24
52
|
*/
|
|
25
|
-
|
|
53
|
+
isReadOnly?: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* @deprecated Use get instead
|
|
56
|
+
*/
|
|
57
|
+
getPropertyName?: Array<(target: GLTFTargetType) => string>;
|
|
58
|
+
/**
|
|
59
|
+
* Set a new value to the property.
|
|
60
|
+
* @param newValue the new value to set
|
|
61
|
+
* @param target the target object
|
|
62
|
+
* @param index the index of the target object in the array (optional)
|
|
63
|
+
*/
|
|
64
|
+
set?: (newValue: BabylonValueType, target: GLTFTargetType, index?: number, payload?: any) => void;
|
|
65
|
+
/**
|
|
66
|
+
* Interpolation/animation information for the property.
|
|
67
|
+
* This is an array that can be used to animate the value over time.
|
|
68
|
+
*/
|
|
69
|
+
interpolation?: IInterpolationPropertyInfo[];
|
|
26
70
|
}
|
|
27
71
|
/**
|
|
28
72
|
* A Serialized Flow Graph Context
|
|
@@ -44,6 +88,16 @@ export interface ISerializedFlowGraphContext {
|
|
|
44
88
|
_connectionValues: {
|
|
45
89
|
[key: string]: any;
|
|
46
90
|
};
|
|
91
|
+
/**
|
|
92
|
+
* Assets context, if not the scene
|
|
93
|
+
*/
|
|
94
|
+
_assetsContext?: {
|
|
95
|
+
[key: string]: any;
|
|
96
|
+
};
|
|
97
|
+
/**
|
|
98
|
+
* Should logging be enabled?
|
|
99
|
+
*/
|
|
100
|
+
enableLogging?: boolean;
|
|
47
101
|
}
|
|
48
102
|
/**
|
|
49
103
|
* A Serialized Flow Graph Connection
|
|
@@ -74,6 +128,10 @@ export interface ISerializedFlowGraphBlock {
|
|
|
74
128
|
* The class name of the block
|
|
75
129
|
*/
|
|
76
130
|
className: string;
|
|
131
|
+
/**
|
|
132
|
+
* The glTF type of the block
|
|
133
|
+
*/
|
|
134
|
+
type: string;
|
|
77
135
|
/**
|
|
78
136
|
* Configuration parameters for the block
|
|
79
137
|
*/
|
|
@@ -115,4 +173,8 @@ export interface ISerializedFlowGraph {
|
|
|
115
173
|
* Blocks belonging to the flow graph
|
|
116
174
|
*/
|
|
117
175
|
allBlocks: ISerializedFlowGraphBlock[];
|
|
176
|
+
/**
|
|
177
|
+
* Is the flow graph in RHS mode?
|
|
178
|
+
*/
|
|
179
|
+
rightHanded?: boolean;
|
|
118
180
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typeDefinitions.js","sourceRoot":"","sources":["../../../../dev/core/src/FlowGraph/typeDefinitions.ts"],"names":[],"mappings":"","sourcesContent":["import type { FlowGraphConnectionType } from \"./flowGraphConnection\";\r\n\r\n/**\r\n * An accessor that allows modifying properties on some other object.\r\n */\r\nexport interface IObjectAccessor {\r\n /**\r\n * The
|
|
1
|
+
{"version":3,"file":"typeDefinitions.js","sourceRoot":"","sources":["../../../../dev/core/src/FlowGraph/typeDefinitions.ts"],"names":[],"mappings":"","sourcesContent":["import type { IAnimatable } from \"core/Animations/animatable.interface\";\r\nimport type { Animation } from \"core/Animations/animation\";\r\nimport type { FlowGraphConnectionType } from \"./flowGraphConnection\";\r\n\r\n/**\r\n * Interpolation generator\r\n */\r\nexport interface IInterpolationPropertyInfo {\r\n /**\r\n * type of the interpolation\r\n */\r\n type: number;\r\n /**\r\n * The name of the property\r\n */\r\n name: string;\r\n /** @internal */\r\n getValue: (target: any, source: Float32Array, offset: number, scale: number) => any;\r\n /** @internal */\r\n getStride: (target: any) => number;\r\n /**\r\n * @internal\r\n */\r\n buildAnimations(target: any, name: string, fps: number, keys: any[]): { babylonAnimatable: IAnimatable; babylonAnimation: Animation }[];\r\n}\r\n\r\n/**\r\n * An accessor that allows modifying properties on some other object.\r\n */\r\nexport interface IObjectAccessor<GLTFTargetType = any, BabylonTargetType = any, BabylonValueType = any> {\r\n /**\r\n * The number of components that are changed in the property when setting this value.\r\n * This will usually be 1. But, for example, Babylon has both orthoLeft and orthoRight (two components) properties that are changed when setting xmag (single value in glTF).\r\n * Defaults to 1 if not provided!\r\n */\r\n componentsCount?: number;\r\n /**\r\n * The (babylon) type of the property.\r\n */\r\n type: string;\r\n /**\r\n * Get the value of the property.\r\n */\r\n get: (target: GLTFTargetType, index?: number, payload?: any) => BabylonValueType | undefined;\r\n /**\r\n * Get the target of the property.\r\n */\r\n getTarget: (target: GLTFTargetType, index?: number, payload?: any) => BabylonTargetType | undefined;\r\n /**\r\n * is the property readonly?\r\n */\r\n isReadOnly?: boolean;\r\n /**\r\n * @deprecated Use get instead\r\n */\r\n getPropertyName?: Array<(target: GLTFTargetType) => string>;\r\n /**\r\n * Set a new value to the property.\r\n * @param newValue the new value to set\r\n * @param target the target object\r\n * @param index the index of the target object in the array (optional)\r\n */\r\n set?: (newValue: BabylonValueType, target: GLTFTargetType, index?: number, payload?: any) => void;\r\n /**\r\n * Interpolation/animation information for the property.\r\n * This is an array that can be used to animate the value over time.\r\n */\r\n interpolation?: IInterpolationPropertyInfo[];\r\n}\r\n\r\n/**\r\n * A Serialized Flow Graph Context\r\n */\r\nexport interface ISerializedFlowGraphContext {\r\n /**\r\n * The unique id of the context\r\n */\r\n uniqueId: string;\r\n /**\r\n * User variables\r\n */\r\n _userVariables: { [key: string]: any };\r\n /**\r\n * Values of the connection points\r\n */\r\n _connectionValues: { [key: string]: any };\r\n\r\n /**\r\n * Assets context, if not the scene\r\n */\r\n _assetsContext?: { [key: string]: any };\r\n\r\n /**\r\n * Should logging be enabled?\r\n */\r\n enableLogging?: boolean;\r\n}\r\n\r\n/**\r\n * A Serialized Flow Graph Connection\r\n */\r\nexport interface ISerializedFlowGraphConnection {\r\n /**\r\n * The unique id of the connection\r\n */\r\n uniqueId: string;\r\n /**\r\n * The name of the connection\r\n */\r\n name: string;\r\n /**\r\n * The type of the connection\r\n */\r\n _connectionType: FlowGraphConnectionType;\r\n /**\r\n * The id of the connection that this is connected to\r\n */\r\n connectedPointIds: string[];\r\n}\r\n\r\n/**\r\n * A Serialized Flow Graph Block\r\n */\r\nexport interface ISerializedFlowGraphBlock {\r\n /**\r\n * The class name of the block\r\n */\r\n className: string;\r\n /**\r\n * The glTF type of the block\r\n */\r\n type: string;\r\n /**\r\n * Configuration parameters for the block\r\n */\r\n config: any;\r\n /**\r\n * The unique id of the block\r\n */\r\n uniqueId: string;\r\n /**\r\n * Input connection data\r\n */\r\n dataInputs: ISerializedFlowGraphConnection[];\r\n /**\r\n * Output connection data\r\n */\r\n dataOutputs: ISerializedFlowGraphConnection[];\r\n /**\r\n * Metadata for the block\r\n */\r\n metadata: any;\r\n /**\r\n * Input connection signal\r\n */\r\n signalInputs: ISerializedFlowGraphConnection[];\r\n /**\r\n * Output connection signal\r\n */\r\n signalOutputs: ISerializedFlowGraphConnection[];\r\n}\r\n\r\n/**\r\n * A Serialized Flow Graph\r\n */\r\nexport interface ISerializedFlowGraph {\r\n /**\r\n * Contexts belonging to the flow graph\r\n */\r\n executionContexts: ISerializedFlowGraphContext[];\r\n /**\r\n * Blocks belonging to the flow graph\r\n */\r\n allBlocks: ISerializedFlowGraphBlock[];\r\n\r\n /**\r\n * Is the flow graph in RHS mode?\r\n */\r\n rightHanded?: boolean;\r\n}\r\n"]}
|
package/FlowGraph/utils.d.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
+
import type { Matrix, Quaternion, Vector2, Vector3, Vector4 } from "../Maths/math.vector.js";
|
|
1
2
|
import type { Node } from "../node";
|
|
3
|
+
import type { FlowGraphInteger } from "./CustomTypes/flowGraphInteger";
|
|
4
|
+
import type { FlowGraphMatrix2D, FlowGraphMatrix3D } from "./CustomTypes/flowGraphMatrix";
|
|
2
5
|
/**
|
|
3
6
|
* @internal
|
|
4
7
|
* Returns if mesh1 is a descendant of mesh2
|
|
@@ -7,3 +10,47 @@ import type { Node } from "../node";
|
|
|
7
10
|
* @returns
|
|
8
11
|
*/
|
|
9
12
|
export declare function _isADescendantOf(mesh1: Node, mesh2: Node): boolean;
|
|
13
|
+
export type FlowGraphNumber = number | FlowGraphInteger;
|
|
14
|
+
export type FlowGraphVector = Vector2 | Vector3 | Vector4 | Quaternion;
|
|
15
|
+
export type FlowGraphMatrix = Matrix | FlowGraphMatrix2D | FlowGraphMatrix3D;
|
|
16
|
+
export type FlowGraphMathOperationType = FlowGraphNumber | FlowGraphVector | FlowGraphMatrix | boolean;
|
|
17
|
+
/**
|
|
18
|
+
* @internal
|
|
19
|
+
*/
|
|
20
|
+
export declare function _getClassNameOf(v: any): any;
|
|
21
|
+
/**
|
|
22
|
+
* @internal
|
|
23
|
+
* Check if two classname are the same and are vector classes.
|
|
24
|
+
* @param className the first class name
|
|
25
|
+
* @param className2 the second class name
|
|
26
|
+
* @returns whether the two class names are the same and are vector classes.
|
|
27
|
+
*/
|
|
28
|
+
export declare function _areSameVectorClass(className: string, className2: string): boolean;
|
|
29
|
+
/**
|
|
30
|
+
* @internal
|
|
31
|
+
* Check if two classname are the same and are matrix classes.
|
|
32
|
+
* @param className the first class name
|
|
33
|
+
* @param className2 the second class name
|
|
34
|
+
* @returns whether the two class names are the same and are matrix classes.
|
|
35
|
+
*/
|
|
36
|
+
export declare function _areSameMatrixClass(className: string, className2: string): boolean;
|
|
37
|
+
/**
|
|
38
|
+
* @internal
|
|
39
|
+
* Check if two classname are the same and are integer classes.
|
|
40
|
+
* @param className the first class name
|
|
41
|
+
* @param className2 the second class name
|
|
42
|
+
* @returns whether the two class names are the same and are integer classes.
|
|
43
|
+
*/
|
|
44
|
+
export declare function _areSameIntegerClass(className: string, className2: string): boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Check if an object has a numeric value.
|
|
47
|
+
* @param a the object to check if it is a number.
|
|
48
|
+
* @returns whether a is a FlowGraphNumber (Integer or number).
|
|
49
|
+
*/
|
|
50
|
+
export declare function isNumeric(a: FlowGraphMathOperationType): a is FlowGraphNumber;
|
|
51
|
+
/**
|
|
52
|
+
* Get the numeric value of a FlowGraphNumber.
|
|
53
|
+
* @param a the object to get the numeric value from.
|
|
54
|
+
* @returns the numeric value.
|
|
55
|
+
*/
|
|
56
|
+
export declare function getNumericValue(a: FlowGraphNumber): number;
|