@babylonjs/core 6.33.1 → 6.34.0

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.
Files changed (175) hide show
  1. package/Animations/animationGroup.js +2 -2
  2. package/Animations/animationGroup.js.map +1 -1
  3. package/Animations/animationGroupMask.d.ts +4 -0
  4. package/Animations/animationGroupMask.js +4 -0
  5. package/Animations/animationGroupMask.js.map +1 -1
  6. package/Compute/computeShader.d.ts +5 -0
  7. package/Compute/computeShader.js +42 -32
  8. package/Compute/computeShader.js.map +1 -1
  9. package/Engines/WebGPU/Extensions/engine.computeShader.js +4 -2
  10. package/Engines/WebGPU/Extensions/engine.computeShader.js.map +1 -1
  11. package/Engines/engine.d.ts +16 -10
  12. package/Engines/thinEngine.js +3 -2
  13. package/Engines/thinEngine.js.map +1 -1
  14. package/FlowGraph/Blocks/Data/Math/flowGraphMathBlocks.d.ts +296 -0
  15. package/FlowGraph/Blocks/Data/Math/flowGraphMathBlocks.js +758 -0
  16. package/FlowGraph/Blocks/Data/Math/flowGraphMathBlocks.js.map +1 -0
  17. package/FlowGraph/Blocks/Data/Math/index.d.ts +1 -5
  18. package/FlowGraph/Blocks/Data/Math/index.js +1 -5
  19. package/FlowGraph/Blocks/Data/Math/index.js.map +1 -1
  20. package/FlowGraph/Blocks/Data/flowGraphBinaryOperationBlock.d.ts +2 -2
  21. package/FlowGraph/Blocks/Data/flowGraphBinaryOperationBlock.js +3 -3
  22. package/FlowGraph/Blocks/Data/flowGraphBinaryOperationBlock.js.map +1 -1
  23. package/FlowGraph/Blocks/Data/flowGraphCachedOperationBlock.d.ts +1 -1
  24. package/FlowGraph/Blocks/Data/flowGraphCachedOperationBlock.js +3 -3
  25. package/FlowGraph/Blocks/Data/flowGraphCachedOperationBlock.js.map +1 -1
  26. package/FlowGraph/Blocks/Data/flowGraphConstantBlock.d.ts +1 -0
  27. package/FlowGraph/Blocks/Data/flowGraphConstantBlock.js +5 -0
  28. package/FlowGraph/Blocks/Data/flowGraphConstantBlock.js.map +1 -1
  29. package/FlowGraph/Blocks/Data/flowGraphGetPropertyBlock.d.ts +25 -0
  30. package/FlowGraph/Blocks/Data/flowGraphGetPropertyBlock.js +22 -0
  31. package/FlowGraph/Blocks/Data/flowGraphGetPropertyBlock.js.map +1 -0
  32. package/FlowGraph/Blocks/Data/flowGraphGetVariableBlock.d.ts +11 -5
  33. package/FlowGraph/Blocks/Data/flowGraphGetVariableBlock.js +12 -6
  34. package/FlowGraph/Blocks/Data/flowGraphGetVariableBlock.js.map +1 -1
  35. package/FlowGraph/Blocks/Data/flowGraphTernaryOperationBlock.d.ts +19 -0
  36. package/FlowGraph/Blocks/Data/flowGraphTernaryOperationBlock.js +22 -0
  37. package/FlowGraph/Blocks/Data/flowGraphTernaryOperationBlock.js.map +1 -0
  38. package/FlowGraph/Blocks/Data/index.d.ts +1 -0
  39. package/FlowGraph/Blocks/Data/index.js +1 -0
  40. package/FlowGraph/Blocks/Data/index.js.map +1 -1
  41. package/FlowGraph/Blocks/Event/flowGraphReceiveCustomEventBlock.d.ts +10 -5
  42. package/FlowGraph/Blocks/Event/flowGraphReceiveCustomEventBlock.js +15 -5
  43. package/FlowGraph/Blocks/Event/flowGraphReceiveCustomEventBlock.js.map +1 -1
  44. package/FlowGraph/Blocks/Event/flowGraphSceneReadyEventBlock.d.ts +1 -0
  45. package/FlowGraph/Blocks/Event/flowGraphSceneReadyEventBlock.js +2 -1
  46. package/FlowGraph/Blocks/Event/flowGraphSceneReadyEventBlock.js.map +1 -1
  47. package/FlowGraph/Blocks/Event/flowGraphSceneTickEventBlock.d.ts +1 -0
  48. package/FlowGraph/Blocks/Event/flowGraphSceneTickEventBlock.js +3 -2
  49. package/FlowGraph/Blocks/Event/flowGraphSceneTickEventBlock.js.map +1 -1
  50. package/FlowGraph/Blocks/Execution/Animation/flowGraphPauseAnimationBlock.d.ts +2 -2
  51. package/FlowGraph/Blocks/Execution/Animation/flowGraphPauseAnimationBlock.js +3 -3
  52. package/FlowGraph/Blocks/Execution/Animation/flowGraphPauseAnimationBlock.js.map +1 -1
  53. package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.d.ts +0 -5
  54. package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.js +2 -3
  55. package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.js.map +1 -1
  56. package/FlowGraph/Blocks/Execution/Animation/flowGraphStopAnimationBlock.d.ts +2 -2
  57. package/FlowGraph/Blocks/Execution/Animation/flowGraphStopAnimationBlock.js +3 -3
  58. package/FlowGraph/Blocks/Execution/Animation/flowGraphStopAnimationBlock.js.map +1 -1
  59. package/FlowGraph/Blocks/Execution/Audio/flowGraphPlayAudioBlock.d.ts +2 -2
  60. package/FlowGraph/Blocks/Execution/Audio/flowGraphPlayAudioBlock.js +3 -3
  61. package/FlowGraph/Blocks/Execution/Audio/flowGraphPlayAudioBlock.js.map +1 -1
  62. package/FlowGraph/Blocks/Execution/Audio/flowGraphStopAudioBlock.d.ts +2 -2
  63. package/FlowGraph/Blocks/Execution/Audio/flowGraphStopAudioBlock.js +2 -2
  64. package/FlowGraph/Blocks/Execution/Audio/flowGraphStopAudioBlock.js.map +1 -1
  65. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCounterBlock.d.ts +2 -2
  66. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCounterBlock.js +3 -3
  67. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCounterBlock.js.map +1 -1
  68. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDebounceBlock.d.ts +2 -2
  69. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDebounceBlock.js +3 -3
  70. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDebounceBlock.js.map +1 -1
  71. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDoNBlock.d.ts +13 -5
  72. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDoNBlock.js +14 -12
  73. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDoNBlock.js.map +1 -1
  74. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphForLoopBlock.d.ts +2 -6
  75. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphForLoopBlock.js +3 -4
  76. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphForLoopBlock.js.map +1 -1
  77. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSequenceBlock.d.ts +16 -0
  78. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSequenceBlock.js +26 -0
  79. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSequenceBlock.js.map +1 -0
  80. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphThrottleBlock.d.ts +2 -2
  81. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphThrottleBlock.js +3 -3
  82. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphThrottleBlock.js.map +1 -1
  83. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphTimerBlock.d.ts +1 -6
  84. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphTimerBlock.js +4 -4
  85. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphTimerBlock.js.map +1 -1
  86. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWaitAllBlock.d.ts +2 -2
  87. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWaitAllBlock.js +4 -4
  88. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWaitAllBlock.js.map +1 -1
  89. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWhileLoopBlock.d.ts +3 -2
  90. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWhileLoopBlock.js +6 -5
  91. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWhileLoopBlock.js.map +1 -1
  92. package/FlowGraph/Blocks/Execution/ControlFlow/index.d.ts +1 -0
  93. package/FlowGraph/Blocks/Execution/ControlFlow/index.js +1 -0
  94. package/FlowGraph/Blocks/Execution/ControlFlow/index.js.map +1 -1
  95. package/FlowGraph/Blocks/Execution/{flowGraphLogBlock.d.ts → flowGraphConsoleLogBlock.d.ts} +3 -2
  96. package/FlowGraph/Blocks/Execution/{flowGraphLogBlock.js → flowGraphConsoleLogBlock.js} +7 -6
  97. package/FlowGraph/Blocks/Execution/flowGraphConsoleLogBlock.js.map +1 -0
  98. package/FlowGraph/Blocks/Execution/flowGraphSendCustomEventBlock.d.ts +16 -8
  99. package/FlowGraph/Blocks/Execution/flowGraphSendCustomEventBlock.js +17 -10
  100. package/FlowGraph/Blocks/Execution/flowGraphSendCustomEventBlock.js.map +1 -1
  101. package/FlowGraph/Blocks/Execution/flowGraphSetPropertyBlock.d.ts +4 -3
  102. package/FlowGraph/Blocks/Execution/flowGraphSetPropertyBlock.js +7 -6
  103. package/FlowGraph/Blocks/Execution/flowGraphSetPropertyBlock.js.map +1 -1
  104. package/FlowGraph/Blocks/Execution/flowGraphSetVariableBlock.d.ts +12 -7
  105. package/FlowGraph/Blocks/Execution/flowGraphSetVariableBlock.js +10 -9
  106. package/FlowGraph/Blocks/Execution/flowGraphSetVariableBlock.js.map +1 -1
  107. package/FlowGraph/Blocks/Execution/index.d.ts +1 -2
  108. package/FlowGraph/Blocks/Execution/index.js +1 -3
  109. package/FlowGraph/Blocks/Execution/index.js.map +1 -1
  110. package/FlowGraph/flowGraph.d.ts +3 -1
  111. package/FlowGraph/flowGraph.js +6 -2
  112. package/FlowGraph/flowGraph.js.map +1 -1
  113. package/FlowGraph/flowGraphAsyncExecutionBlock.d.ts +6 -2
  114. package/FlowGraph/flowGraphAsyncExecutionBlock.js +2 -1
  115. package/FlowGraph/flowGraphAsyncExecutionBlock.js.map +1 -1
  116. package/FlowGraph/flowGraphBlock.d.ts +7 -2
  117. package/FlowGraph/flowGraphBlock.js +36 -14
  118. package/FlowGraph/flowGraphBlock.js.map +1 -1
  119. package/FlowGraph/flowGraphContext.d.ts +9 -5
  120. package/FlowGraph/flowGraphContext.js +7 -2
  121. package/FlowGraph/flowGraphContext.js.map +1 -1
  122. package/FlowGraph/flowGraphCoordinator.d.ts +4 -5
  123. package/FlowGraph/flowGraphCoordinator.js +12 -7
  124. package/FlowGraph/flowGraphCoordinator.js.map +1 -1
  125. package/FlowGraph/flowGraphEventBlock.js +1 -1
  126. package/FlowGraph/flowGraphEventBlock.js.map +1 -1
  127. package/FlowGraph/flowGraphExecutionBlock.d.ts +3 -2
  128. package/FlowGraph/flowGraphExecutionBlock.js +7 -11
  129. package/FlowGraph/flowGraphExecutionBlock.js.map +1 -1
  130. package/FlowGraph/flowGraphPath.d.ts +20 -2
  131. package/FlowGraph/flowGraphPath.js +27 -7
  132. package/FlowGraph/flowGraphPath.js.map +1 -1
  133. package/FlowGraph/flowGraphWithOnDoneExecutionBlock.d.ts +3 -3
  134. package/FlowGraph/flowGraphWithOnDoneExecutionBlock.js +3 -3
  135. package/FlowGraph/flowGraphWithOnDoneExecutionBlock.js.map +1 -1
  136. package/FlowGraph/index.d.ts +3 -0
  137. package/FlowGraph/index.js +3 -0
  138. package/FlowGraph/index.js.map +1 -1
  139. package/FlowGraph/serialization.js +20 -6
  140. package/FlowGraph/serialization.js.map +1 -1
  141. package/FlowGraph/typeDefinitions.d.ts +33 -0
  142. package/FlowGraph/typeDefinitions.js +2 -0
  143. package/FlowGraph/typeDefinitions.js.map +1 -0
  144. package/Lights/light.d.ts +15 -0
  145. package/Lights/light.js +18 -0
  146. package/Lights/light.js.map +1 -1
  147. package/Lights/shadowLight.d.ts +18 -1
  148. package/Lights/shadowLight.js +34 -1
  149. package/Lights/shadowLight.js.map +1 -1
  150. package/Meshes/Node/nodeGeometryBlock.js +9 -1
  151. package/Meshes/Node/nodeGeometryBlock.js.map +1 -1
  152. package/Meshes/abstractMesh.js +3 -1
  153. package/Meshes/abstractMesh.js.map +1 -1
  154. package/XR/features/WebXRMeshDetector.d.ts +14 -2
  155. package/XR/features/WebXRMeshDetector.js +43 -8
  156. package/XR/features/WebXRMeshDetector.js.map +1 -1
  157. package/package.json +1 -1
  158. package/scene.d.ts +1 -2
  159. package/scene.js.map +1 -1
  160. package/FlowGraph/Blocks/Data/Math/flowGraphMatrixBlocks.d.ts +0 -172
  161. package/FlowGraph/Blocks/Data/Math/flowGraphMatrixBlocks.js +0 -235
  162. package/FlowGraph/Blocks/Data/Math/flowGraphMatrixBlocks.js.map +0 -1
  163. package/FlowGraph/Blocks/Data/Math/flowGraphNumberMathBlocks.d.ts +0 -269
  164. package/FlowGraph/Blocks/Data/Math/flowGraphNumberMathBlocks.js +0 -429
  165. package/FlowGraph/Blocks/Data/Math/flowGraphNumberMathBlocks.js.map +0 -1
  166. package/FlowGraph/Blocks/Data/Math/flowGraphVector2MathBlocks.d.ts +0 -115
  167. package/FlowGraph/Blocks/Data/Math/flowGraphVector2MathBlocks.js +0 -146
  168. package/FlowGraph/Blocks/Data/Math/flowGraphVector2MathBlocks.js.map +0 -1
  169. package/FlowGraph/Blocks/Data/Math/flowGraphVector3MathBlocks.d.ts +0 -155
  170. package/FlowGraph/Blocks/Data/Math/flowGraphVector3MathBlocks.js +0 -190
  171. package/FlowGraph/Blocks/Data/Math/flowGraphVector3MathBlocks.js.map +0 -1
  172. package/FlowGraph/Blocks/Data/Math/flowGraphVector4MathBlocks.d.ts +0 -116
  173. package/FlowGraph/Blocks/Data/Math/flowGraphVector4MathBlocks.js +0 -144
  174. package/FlowGraph/Blocks/Data/Math/flowGraphVector4MathBlocks.js.map +0 -1
  175. package/FlowGraph/Blocks/Execution/flowGraphLogBlock.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"flowGraphNumberMathBlocks.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Data/Math/flowGraphNumberMathBlocks.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,6BAA6B,CA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AAe,EAAE,oCAAoC,CAAC,CAAC;AAErE,MAAM,OAAO,GAAG,kBAAkB,CAAC;AACnC;;;GAGG;AACH,MAAM,OAAO,uBAAwB,SAAQ,cAAc;IAOvD,YAAY,MAAqC;QAC7C,KAAK,CAAC,MAAM,CAAC,CAAC;QACd,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,iBAAiB,CAAC,WAAW,EAAE,cAAc,CAAC,CAAC;QACrE,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,iBAAiB,CAAC,YAAY,EAAE,cAAc,CAAC,CAAC;QACvE,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,iBAAiB,CAAC,YAAY,EAAE,cAAc,CAAC,CAAC;QACvE,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,kBAAkB,CAAC,cAAc,EAAE,cAAc,CAAC,CAAC;IAChF,CAAC;IAEM,cAAc,CAAC,QAA0B;QAC5C,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;QAC/C,MAAM,KAAK,GAAG,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;QACjD,MAAM,KAAK,GAAG,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;QACjD,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,KAAK,GAAG,IAAI,CAAC,GAAG,KAAK,CAAC;QAC1C,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;IAC9C,CAAC;IAEM,YAAY;QACf,OAAO,OAAO,CAAC;IACnB,CAAC;CACJ;AACD,aAAa,CAAC,OAAO,EAAE,uBAAuB,CAAC,CAAC","sourcesContent":["import type { IFlowGraphBlockConfiguration } from \"../../../flowGraphBlock\";\r\nimport { FlowGraphBlock } from \"../../../flowGraphBlock\";\r\nimport { RichTypeBoolean, RichTypeNumber } from \"../../../flowGraphRichTypes\";\r\nimport { FlowGraphBinaryOperationBlock } from \"../flowGraphBinaryOperationBlock\";\r\nimport { FlowGraphConstantOperationBlock } from \"../flowGraphConstantOperationBlock\";\r\nimport { FlowGraphUnaryOperationBlock } from \"../flowGraphUnaryOperationBlock\";\r\nimport type { FlowGraphDataConnection } from \"../../../flowGraphDataConnection\";\r\nimport type { FlowGraphContext } from \"../../../flowGraphContext\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\n/**\r\n * Module for all of the number math blocks.\r\n * @see https://docs.google.com/spreadsheets/d/1wSFUFLPpRFVlL-va3YtYC6sepNvPapVawG1-nzoTF34/edit#gid=0\r\n */\r\n\r\nconst ADDNAME = \"FGAddNumberBlock\";\r\n/**\r\n * Outputs the addition of the left and right inputs.\r\n * @experimental\r\n */\r\nexport class FlowGraphAddNumberBlock extends FlowGraphBinaryOperationBlock<number, number, number> {\r\n constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(RichTypeNumber, RichTypeNumber, RichTypeNumber, (left, right) => left + right, ADDNAME, config);\r\n }\r\n}\r\nRegisterClass(ADDNAME, FlowGraphAddNumberBlock);\r\n\r\nconst SUBNAME = \"FGSubtractNumberBlock\";\r\n/**\r\n * Outputs the subtraction of the left and right inputs.\r\n * @experimental\r\n */\r\nexport class FlowGraphSubtractNumberBlock extends FlowGraphBinaryOperationBlock<number, number, number> {\r\n constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(RichTypeNumber, RichTypeNumber, RichTypeNumber, (left, right) => left - right, SUBNAME, config);\r\n }\r\n}\r\nRegisterClass(SUBNAME, FlowGraphSubtractNumberBlock);\r\n\r\nconst MULTIPLYNAME = \"FGMultiplyNumberBlock\";\r\n/**\r\n * Outputs the multiplication of the left and right inputs.\r\n * @experimental\r\n */\r\nexport class FlowGraphMultiplyNumberBlock extends FlowGraphBinaryOperationBlock<number, number, number> {\r\n constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(RichTypeNumber, RichTypeNumber, RichTypeNumber, (left, right) => left * right, MULTIPLYNAME, config);\r\n }\r\n}\r\nRegisterClass(MULTIPLYNAME, FlowGraphMultiplyNumberBlock);\r\n\r\nconst DIVIDENAME = \"FGDivideNumberBlock\";\r\n/**\r\n * Ouputs the division of the left and right inputs.\r\n * @experimental\r\n */\r\nexport class FlowGraphDivideNumberBlock extends FlowGraphBinaryOperationBlock<number, number, number> {\r\n constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(RichTypeNumber, RichTypeNumber, RichTypeNumber, (left, right) => left / right, DIVIDENAME, config);\r\n }\r\n}\r\nRegisterClass(DIVIDENAME, FlowGraphDivideNumberBlock);\r\n\r\nconst MODNAME = \"FGModNumberBlock\";\r\n/**\r\n * Outputs the modulo of the left and right inputs.\r\n * @experimental\r\n */\r\nexport class FlowGraphModNumberBlock extends FlowGraphBinaryOperationBlock<number, number, number> {\r\n constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(RichTypeNumber, RichTypeNumber, RichTypeNumber, (left, right) => left % right, MODNAME, config);\r\n }\r\n}\r\nRegisterClass(MODNAME, FlowGraphModNumberBlock);\r\n\r\nconst POWNAME = \"FGPowNumberBlock\";\r\n/**\r\n * Outputs left to the power of right.\r\n * @experimental\r\n */\r\nexport class FlowGraphPowNumberBlock extends FlowGraphBinaryOperationBlock<number, number, number> {\r\n constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(RichTypeNumber, RichTypeNumber, RichTypeNumber, (left, right) => Math.pow(left, right), POWNAME, config);\r\n }\r\n}\r\nRegisterClass(POWNAME, FlowGraphPowNumberBlock);\r\n\r\nconst ISNANNAME = \"FGIsNaNNumberBlock\";\r\n/**\r\n * Outputs true if the number is NaN, false otherwise.\r\n * @experimental\r\n */\r\nexport class FlowGraphIsNaNNumberBlock extends FlowGraphUnaryOperationBlock<number, boolean> {\r\n constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(RichTypeNumber, RichTypeBoolean, (input) => isNaN(input), ISNANNAME, config);\r\n }\r\n}\r\nRegisterClass(ISNANNAME, FlowGraphIsNaNNumberBlock);\r\n\r\nconst ISINFINITENAME = \"FGIsInfinityNumberBlock\";\r\n/**\r\n * Outputs true if the number is infinite, false otherwise.\r\n * @experimental\r\n */\r\nexport class FlowGraphIsInfinityNumberBlock extends FlowGraphUnaryOperationBlock<number, boolean> {\r\n constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(RichTypeNumber, RichTypeBoolean, (input) => !isFinite(input), ISINFINITENAME, config);\r\n }\r\n}\r\nRegisterClass(ISINFINITENAME, FlowGraphIsInfinityNumberBlock);\r\n\r\nconst SQRTNAME = \"FGSqrtNumberBlock\";\r\n/**\r\n * Outputs the square root of the input.\r\n * @experimental\r\n */\r\nexport class FlowGraphSqrtNumberBlock extends FlowGraphUnaryOperationBlock<number, number> {\r\n constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(RichTypeNumber, RichTypeNumber, (input) => Math.sqrt(input), SQRTNAME, config);\r\n }\r\n}\r\nRegisterClass(SQRTNAME, FlowGraphSqrtNumberBlock);\r\n\r\nconst ABSNAME = \"FGAbsNumberBlock\";\r\n/**\r\n * Outputs the absolute value of the input.\r\n * @experimental\r\n */\r\nexport class FlowGraphAbsNumberBlock extends FlowGraphUnaryOperationBlock<number, number> {\r\n constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(RichTypeNumber, RichTypeNumber, (input) => Math.abs(input), ABSNAME, config);\r\n }\r\n}\r\nRegisterClass(ABSNAME, FlowGraphAbsNumberBlock);\r\n\r\nconst NEGNAME = \"FGNegateNumberBlock\";\r\n/**\r\n * Negates the input.\r\n * @experimental\r\n */\r\nexport class FlowGraphNegateNumberBlock extends FlowGraphUnaryOperationBlock<number, number> {\r\n constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(RichTypeNumber, RichTypeNumber, (input) => -input, NEGNAME, config);\r\n }\r\n}\r\nRegisterClass(NEGNAME, FlowGraphNegateNumberBlock);\r\n\r\nconst FLOORNAME = \"FGFloorNumberBlock\";\r\n/**\r\n * Outputs the floor of the input.\r\n * @experimental\r\n */\r\nexport class FlowGraphFloorNumberBlock extends FlowGraphUnaryOperationBlock<number, number> {\r\n constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(RichTypeNumber, RichTypeNumber, (input) => Math.floor(input), FLOORNAME, config);\r\n }\r\n}\r\n\r\nRegisterClass(FLOORNAME, FlowGraphFloorNumberBlock);\r\n\r\nconst CEILNAME = \"FGCeilNumberBlock\";\r\n/**\r\n * Outputs the ceiling of the input.\r\n * @experimental\r\n */\r\nexport class FlowGraphCeilNumberBlock extends FlowGraphUnaryOperationBlock<number, number> {\r\n constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(RichTypeNumber, RichTypeNumber, (input) => Math.ceil(input), CEILNAME, config);\r\n }\r\n}\r\nRegisterClass(CEILNAME, FlowGraphCeilNumberBlock);\r\n\r\nconst ROUNDNAME = \"FGRoundNumberBlock\";\r\n/**\r\n * Rounds the left input to right digits of precision.\r\n * @see rounding function from: https://docs.google.com/spreadsheets/d/1wSFUFLPpRFVlL-va3YtYC6sepNvPapVawG1-nzoTF34/edit#gid=0\r\n * @experimental\r\n */\r\nexport class FlowGraphRoundNumberBlock extends FlowGraphBinaryOperationBlock<number, number, number> {\r\n constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(RichTypeNumber, RichTypeNumber, RichTypeNumber, (input, digits) => Math.round(input / Math.pow(10, digits)) / Math.pow(10, digits), ROUNDNAME, config);\r\n }\r\n}\r\nRegisterClass(ROUNDNAME, FlowGraphRoundNumberBlock);\r\n\r\nconst TRUNCNAME = \"FGTruncNumberBlock\";\r\n/**\r\n * Truncates the input.\r\n * @experimental\r\n */\r\nexport class FlowGraphTruncNumberBlock extends FlowGraphUnaryOperationBlock<number, number> {\r\n constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(RichTypeNumber, RichTypeNumber, (input) => Math.trunc(input), TRUNCNAME, config);\r\n }\r\n}\r\nRegisterClass(TRUNCNAME, FlowGraphTruncNumberBlock);\r\n\r\nconst EXPNAME = \"FGExpNumberBlock\";\r\n/**\r\n * Outputs the exponential of the input.\r\n * @experimental\r\n */\r\nexport class FlowGraphExpNumberBlock extends FlowGraphUnaryOperationBlock<number, number> {\r\n constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(RichTypeNumber, RichTypeNumber, (input) => Math.exp(input), EXPNAME, config);\r\n }\r\n}\r\nRegisterClass(EXPNAME, FlowGraphExpNumberBlock);\r\n\r\nconst LOG10NAME = \"FGLog10NumberBlock\";\r\n/**\r\n * Outputs the base 10 logarithm of the input.\r\n * @experimental\r\n */\r\nexport class FlowGraphLog10NumberBlock extends FlowGraphUnaryOperationBlock<number, number> {\r\n constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(RichTypeNumber, RichTypeNumber, (input) => Math.log10(input), LOG10NAME, config);\r\n }\r\n}\r\nRegisterClass(LOG10NAME, FlowGraphLog10NumberBlock);\r\n\r\nconst LOGNAME = \"FGLogNumberBlock\";\r\n/**\r\n * Outputs the natural logarithm of the input.\r\n * @experimental\r\n */\r\nexport class FlowGraphLogNumberBlock extends FlowGraphUnaryOperationBlock<number, number> {\r\n constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(RichTypeNumber, RichTypeNumber, (input) => Math.log(input), LOGNAME, config);\r\n }\r\n}\r\nRegisterClass(LOGNAME, FlowGraphLogNumberBlock);\r\n\r\nconst LNNAME = \"FGLnNumberBlock\";\r\n/**\r\n * Outputs the base 2 logarithm of the input.\r\n * @experimental\r\n */\r\nexport class FlowGraphLnNumberBlock extends FlowGraphUnaryOperationBlock<number, number> {\r\n constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(RichTypeNumber, RichTypeNumber, (input) => Math.log(input) / Math.LN2, LNNAME, config);\r\n }\r\n}\r\nRegisterClass(LNNAME, FlowGraphLnNumberBlock);\r\n\r\nconst SINENAME = \"FGSineNumberBlock\";\r\n/**\r\n * Outputs the sine of the input.\r\n * @experimental\r\n */\r\nexport class FlowGraphSinNumberBlock extends FlowGraphUnaryOperationBlock<number, number> {\r\n constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(RichTypeNumber, RichTypeNumber, (input) => Math.sin(input), SINENAME, config);\r\n }\r\n}\r\nRegisterClass(SINENAME, FlowGraphSinNumberBlock);\r\n\r\nconst COSNAME = \"FGCosNumberBlock\";\r\n/**\r\n * Outputs the cosine of the input.\r\n * @experimental\r\n */\r\nexport class FlowGraphCosNumberBlock extends FlowGraphUnaryOperationBlock<number, number> {\r\n constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(RichTypeNumber, RichTypeNumber, (input) => Math.cos(input), COSNAME, config);\r\n }\r\n}\r\nRegisterClass(COSNAME, FlowGraphCosNumberBlock);\r\n\r\nconst TANNAME = \"FGTanNumberBlock\";\r\n/**\r\n * Outputs the tangent of the input.\r\n * @experimental\r\n */\r\nexport class FlowGraphTanNumberBlock extends FlowGraphUnaryOperationBlock<number, number> {\r\n constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(RichTypeNumber, RichTypeNumber, (input) => Math.tan(input), TANNAME, config);\r\n }\r\n}\r\nRegisterClass(TANNAME, FlowGraphTanNumberBlock);\r\n\r\nconst ASINENAME = \"FGASineNumberBlock\";\r\n/**\r\n * Outputs the arcsine of the input.\r\n * @experimental\r\n */\r\nexport class FlowGraphASinNumberBlock extends FlowGraphUnaryOperationBlock<number, number> {\r\n constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(RichTypeNumber, RichTypeNumber, (input) => Math.asin(input), ASINENAME, config);\r\n }\r\n}\r\nRegisterClass(ASINENAME, FlowGraphASinNumberBlock);\r\n\r\nconst ACOSNAME = \"FGACosNumberBlock\";\r\n/**\r\n * Outputs the arccosine of the input.\r\n * @experimental\r\n */\r\nexport class FlowGraphACosNumberBlock extends FlowGraphUnaryOperationBlock<number, number> {\r\n constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(RichTypeNumber, RichTypeNumber, (input) => Math.acos(input), ACOSNAME, config);\r\n }\r\n}\r\nRegisterClass(ACOSNAME, FlowGraphACosNumberBlock);\r\n\r\nconst ATANNAME = \"FGATanNumberBlock\";\r\n/**\r\n * Outputs the arctangent of the input.\r\n * @experimental\r\n */\r\nexport class FlowGraphATanNumberBlock extends FlowGraphUnaryOperationBlock<number, number> {\r\n constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(RichTypeNumber, RichTypeNumber, (input) => Math.atan(input), ATANNAME, config);\r\n }\r\n}\r\nRegisterClass(ATANNAME, FlowGraphATanNumberBlock);\r\n\r\nconst ENAME = \"FGENumberBlock\";\r\n/**\r\n * Outputs the number E.\r\n * @experimental\r\n */\r\nexport class FlowGraphENumberBlock extends FlowGraphConstantOperationBlock<number> {\r\n constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(RichTypeNumber, () => Math.E, ENAME, config);\r\n }\r\n}\r\nRegisterClass(ENAME, FlowGraphENumberBlock);\r\n\r\nconst PINAME = \"FGPiNumberBlock\";\r\n/**\r\n * Outputs the number PI.\r\n * @experimental\r\n */\r\nexport class FlowGraphPiNumberBlock extends FlowGraphConstantOperationBlock<number> {\r\n constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(RichTypeNumber, () => Math.PI, PINAME, config);\r\n }\r\n}\r\nRegisterClass(PINAME, FlowGraphPiNumberBlock);\r\n\r\nconst ATAN2NAME = \"FGATan2NumberBlock\";\r\n/**\r\n * Outputs the arctan2 of the left and right inputs.\r\n * @experimental\r\n */\r\nexport class FlowGraphATan2NumberBlock extends FlowGraphBinaryOperationBlock<number, number, number> {\r\n constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(RichTypeNumber, RichTypeNumber, RichTypeNumber, (left, right) => Math.atan2(left, right), ATAN2NAME, config);\r\n }\r\n}\r\nRegisterClass(ATAN2NAME, FlowGraphATan2NumberBlock);\r\n\r\nconst RNDNAME = \"FGRandomNumberBlock\";\r\n/**\r\n * @experimental\r\n * Outputs a number between left and right.\r\n */\r\nexport class FlowGraphRandomNumberBlock extends FlowGraphBinaryOperationBlock<number, number, number> {\r\n constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(RichTypeNumber, RichTypeNumber, RichTypeNumber, (left, right) => left + Math.random() * (right - left), RNDNAME, config);\r\n }\r\n}\r\nRegisterClass(RNDNAME, FlowGraphRandomNumberBlock);\r\n\r\nconst MINNAME = \"FGMinNumberBlock\";\r\n/**\r\n * Outputs the minimum of the left and right inputs.\r\n * @experimental\r\n */\r\nexport class FlowGraphMinNumberBlock extends FlowGraphBinaryOperationBlock<number, number, number> {\r\n constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(RichTypeNumber, RichTypeNumber, RichTypeNumber, (left, right) => Math.min(left, right), MINNAME, config);\r\n }\r\n}\r\nRegisterClass(MINNAME, FlowGraphMinNumberBlock);\r\n\r\nconst MAXNAME = \"FGMaxNumberBlock\";\r\n/**\r\n * Outputs the maximum of the left and right inputs.\r\n * @experimental\r\n */\r\nexport class FlowGraphMaxNumberBlock extends FlowGraphBinaryOperationBlock<number, number, number> {\r\n constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(RichTypeNumber, RichTypeNumber, RichTypeNumber, (left, right) => Math.max(left, right), MAXNAME, config);\r\n }\r\n}\r\nRegisterClass(MAXNAME, FlowGraphMaxNumberBlock);\r\n\r\nconst EQUALSNAME = \"FGEqualsNumberBlock\";\r\n/**\r\n * Outputs true if left is equal to right, false otherwise.\r\n * @experimental\r\n */\r\nexport class FlowGraphEqualsNumberBlock extends FlowGraphBinaryOperationBlock<number, number, boolean> {\r\n constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(RichTypeNumber, RichTypeNumber, RichTypeBoolean, (left, right) => left === right, EQUALSNAME, config);\r\n }\r\n}\r\nRegisterClass(EQUALSNAME, FlowGraphEqualsNumberBlock);\r\n\r\nconst GREATERTHANNAME = \"FGGreaterThanNumberBlock\";\r\n/**\r\n * Outputs true if left is greater than right, false otherwise.\r\n */\r\nexport class FlowGraphGreaterThanNumberBlock extends FlowGraphBinaryOperationBlock<number, number, boolean> {\r\n constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(RichTypeNumber, RichTypeNumber, RichTypeBoolean, (left, right) => left > right, GREATERTHANNAME, config);\r\n }\r\n}\r\nRegisterClass(GREATERTHANNAME, FlowGraphGreaterThanNumberBlock);\r\n\r\nconst GREATEROREQUALNAME = \"FGGreaterThanOrEqualsNumberBlock\";\r\n/**\r\n * Outputs true if left is greater than or equal to right, false otherwise.\r\n */\r\nexport class FlowGraphGreaterThanOrEqualsNumberBlock extends FlowGraphBinaryOperationBlock<number, number, boolean> {\r\n constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(RichTypeNumber, RichTypeNumber, RichTypeBoolean, (left, right) => left >= right, GREATEROREQUALNAME, config);\r\n }\r\n}\r\nRegisterClass(GREATEROREQUALNAME, FlowGraphGreaterThanOrEqualsNumberBlock);\r\n\r\nconst LESSTHANNAME = \"FGLessThanNumberBlock\";\r\n/**\r\n * Outputs true if left is less than right, false otherwise.\r\n */\r\nexport class FlowGraphLessThanNumberBlock extends FlowGraphBinaryOperationBlock<number, number, boolean> {\r\n constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(RichTypeNumber, RichTypeNumber, RichTypeBoolean, (left, right) => left < right, LESSTHANNAME, config);\r\n }\r\n}\r\nRegisterClass(LESSTHANNAME, FlowGraphLessThanNumberBlock);\r\n\r\nconst LESSOREQUALNAME = \"FGLessThanOrEqualsNumberBlock\";\r\n/**\r\n * Outputs true if left is less than or equal to right, false otherwise.\r\n */\r\nexport class FlowGraphLessThanOrEqualsNumberBlock extends FlowGraphBinaryOperationBlock<number, number, boolean> {\r\n constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(RichTypeNumber, RichTypeNumber, RichTypeBoolean, (left, right) => left <= right, LESSOREQUALNAME, config);\r\n }\r\n}\r\nRegisterClass(LESSOREQUALNAME, FlowGraphLessThanOrEqualsNumberBlock);\r\n\r\nconst MIXNAME = \"FGMixNumberBlock\";\r\n/**\r\n * Outputs a mix of left and right based on alpha.\r\n * @experimental\r\n */\r\nexport class FlowGraphMixNumberBlock extends FlowGraphBlock {\r\n public leftInput: FlowGraphDataConnection<number>;\r\n public rightInput: FlowGraphDataConnection<number>;\r\n public alphaInput: FlowGraphDataConnection<number>;\r\n\r\n public resultOutput: FlowGraphDataConnection<number>;\r\n\r\n constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(config);\r\n this.leftInput = this.registerDataInput(\"leftInput\", RichTypeNumber);\r\n this.rightInput = this.registerDataInput(\"rightInput\", RichTypeNumber);\r\n this.alphaInput = this.registerDataInput(\"alphaInput\", RichTypeNumber);\r\n this.resultOutput = this.registerDataOutput(\"resultOutput\", RichTypeNumber);\r\n }\r\n\r\n public _updateOutputs(_context: FlowGraphContext): void {\r\n const left = this.leftInput.getValue(_context);\r\n const right = this.rightInput.getValue(_context);\r\n const alpha = this.alphaInput.getValue(_context);\r\n const mix = left + (right - left) * alpha;\r\n this.resultOutput.setValue(mix, _context);\r\n }\r\n\r\n public getClassName(): string {\r\n return MIXNAME;\r\n }\r\n}\r\nRegisterClass(MIXNAME, FlowGraphMixNumberBlock);\r\n"]}
@@ -1,115 +0,0 @@
1
- import { Vector2 } from "../../../../Maths/math.vector";
2
- import { FlowGraphBinaryOperationBlock } from "../flowGraphBinaryOperationBlock";
3
- import { FlowGraphUnaryOperationBlock } from "../flowGraphUnaryOperationBlock";
4
- import type { IFlowGraphBlockConfiguration } from "../../../flowGraphBlock";
5
- import { FlowGraphBlock } from "../../../flowGraphBlock";
6
- import type { FlowGraphDataConnection } from "../../../flowGraphDataConnection";
7
- import type { FlowGraphContext } from "../../../flowGraphContext";
8
- /**
9
- * Adds two vectors together.
10
- * @experimental
11
- */
12
- export declare class FlowGraphAddVector2Block extends FlowGraphBinaryOperationBlock<Vector2, Vector2, Vector2> {
13
- constructor(config: IFlowGraphBlockConfiguration);
14
- }
15
- /**
16
- * Subtracts two vectors.
17
- * @experimental
18
- */
19
- export declare class FlowGraphSubtractVector2Block extends FlowGraphBinaryOperationBlock<Vector2, Vector2, Vector2> {
20
- constructor(config: IFlowGraphBlockConfiguration);
21
- }
22
- /**
23
- * Multiplies two vectors together.
24
- * @experimental
25
- */
26
- export declare class FlowGraphMultiplyVector2Block extends FlowGraphBinaryOperationBlock<Vector2, Vector2, Vector2> {
27
- constructor(config: IFlowGraphBlockConfiguration);
28
- }
29
- /**
30
- * Divides two vectors.
31
- * @experimental
32
- */
33
- export declare class FlowGraphDivideVector2Block extends FlowGraphBinaryOperationBlock<Vector2, Vector2, Vector2> {
34
- constructor(config: IFlowGraphBlockConfiguration);
35
- }
36
- /**
37
- * Scales a vector by a given factor.
38
- * @experimental
39
- */
40
- export declare class FlowGraphScaleVector2Block extends FlowGraphBinaryOperationBlock<Vector2, number, Vector2> {
41
- constructor(config?: IFlowGraphBlockConfiguration);
42
- }
43
- /**
44
- * Gets the length of a vector.
45
- * @experimental
46
- */
47
- export declare class FlowGraphLengthVector2Block extends FlowGraphUnaryOperationBlock<Vector2, number> {
48
- constructor(config: IFlowGraphBlockConfiguration);
49
- }
50
- /**
51
- * Normalizes a vector.
52
- * @experimental
53
- */
54
- export declare class FlowGraphNormalizeVector2Block extends FlowGraphUnaryOperationBlock<Vector2, Vector2> {
55
- constructor(config: IFlowGraphBlockConfiguration);
56
- }
57
- /**
58
- * Creates a vector from two components.
59
- */
60
- export declare class FlowGraphCreateVector2Block extends FlowGraphBlock {
61
- /**
62
- * Input connection: The x component of the vector.
63
- */
64
- readonly x: FlowGraphDataConnection<number>;
65
- /**
66
- * Input connection: The y component of the vector.
67
- */
68
- readonly y: FlowGraphDataConnection<number>;
69
- /**
70
- * Output connection: The created vector.
71
- */
72
- readonly vector: FlowGraphDataConnection<Vector2>;
73
- private _cachedVector;
74
- constructor(config?: IFlowGraphBlockConfiguration);
75
- _updateOutputs(_context: FlowGraphContext): void;
76
- }
77
- /**
78
- * Split a vector into its components.
79
- */
80
- export declare class FlowGraphSplitVector2Block extends FlowGraphBlock {
81
- /**
82
- * Input connection: The vector to split.
83
- */
84
- readonly vector: FlowGraphDataConnection<Vector2>;
85
- /**
86
- * Output connection: The x component of the vector.
87
- */
88
- readonly x: FlowGraphDataConnection<number>;
89
- /**
90
- * Output connection: The y component of the vector.
91
- */
92
- readonly y: FlowGraphDataConnection<number>;
93
- constructor(config?: IFlowGraphBlockConfiguration);
94
- _updateOutputs(_context: FlowGraphContext): void;
95
- }
96
- /**
97
- * Rotates a vector by a given angle.
98
- */
99
- export declare class FlowGraphRotate2dVector2Block extends FlowGraphBlock {
100
- /**
101
- * Input connection: The vector to rotate.
102
- */
103
- readonly input: FlowGraphDataConnection<Vector2>;
104
- /**
105
- * Input connection: The angle to rotate by.
106
- */
107
- readonly angle: FlowGraphDataConnection<number>;
108
- /**
109
- * Output connection: The rotated vector.
110
- */
111
- readonly output: FlowGraphDataConnection<Vector2>;
112
- private _cachedVector;
113
- constructor(config?: IFlowGraphBlockConfiguration);
114
- _updateOutputs(_context: FlowGraphContext): void;
115
- }
@@ -1,146 +0,0 @@
1
- import { RichTypeNumber, RichTypeVector2 } from "../../../flowGraphRichTypes.js";
2
- import { Vector2 } from "../../../../Maths/math.vector.js";
3
- import { FlowGraphBinaryOperationBlock } from "../flowGraphBinaryOperationBlock.js";
4
- import { FlowGraphUnaryOperationBlock } from "../flowGraphUnaryOperationBlock.js";
5
- import { FlowGraphBlock } from "../../../flowGraphBlock.js";
6
- import { RegisterClass } from "../../../../Misc/typeStore.js";
7
- const ADDNAME = "FGAddVector2Block";
8
- /**
9
- * Adds two vectors together.
10
- * @experimental
11
- */
12
- export class FlowGraphAddVector2Block extends FlowGraphBinaryOperationBlock {
13
- constructor(config) {
14
- super(RichTypeVector2, RichTypeVector2, RichTypeVector2, (left, right) => left.add(right), ADDNAME, config);
15
- }
16
- }
17
- RegisterClass(ADDNAME, FlowGraphAddVector2Block);
18
- const SUBNAME = "FGSubtractVector2Block";
19
- /**
20
- * Subtracts two vectors.
21
- * @experimental
22
- */
23
- export class FlowGraphSubtractVector2Block extends FlowGraphBinaryOperationBlock {
24
- constructor(config) {
25
- super(RichTypeVector2, RichTypeVector2, RichTypeVector2, (left, right) => left.subtract(right), SUBNAME, config);
26
- }
27
- }
28
- RegisterClass(SUBNAME, FlowGraphSubtractVector2Block);
29
- const MULNAME = "FGMultiplyVector2Block";
30
- /**
31
- * Multiplies two vectors together.
32
- * @experimental
33
- */
34
- export class FlowGraphMultiplyVector2Block extends FlowGraphBinaryOperationBlock {
35
- constructor(config) {
36
- super(RichTypeVector2, RichTypeVector2, RichTypeVector2, (left, right) => left.multiply(right), MULNAME, config);
37
- }
38
- }
39
- RegisterClass(MULNAME, FlowGraphMultiplyVector2Block);
40
- const DIVNAME = "FGDivideVector2Block";
41
- /**
42
- * Divides two vectors.
43
- * @experimental
44
- */
45
- export class FlowGraphDivideVector2Block extends FlowGraphBinaryOperationBlock {
46
- constructor(config) {
47
- super(RichTypeVector2, RichTypeVector2, RichTypeVector2, (left, right) => left.divide(right), DIVNAME, config);
48
- }
49
- }
50
- RegisterClass(DIVNAME, FlowGraphDivideVector2Block);
51
- const SCALENAME = "FGScaleVector2Block";
52
- /**
53
- * Scales a vector by a given factor.
54
- * @experimental
55
- */
56
- export class FlowGraphScaleVector2Block extends FlowGraphBinaryOperationBlock {
57
- constructor(config) {
58
- super(RichTypeVector2, RichTypeNumber, RichTypeVector2, (left, right) => left.scale(right), SCALENAME, config);
59
- }
60
- }
61
- RegisterClass(SCALENAME, FlowGraphScaleVector2Block);
62
- const LENNAME = "FGLengthVector2Block";
63
- /**
64
- * Gets the length of a vector.
65
- * @experimental
66
- */
67
- export class FlowGraphLengthVector2Block extends FlowGraphUnaryOperationBlock {
68
- constructor(config) {
69
- super(RichTypeVector2, RichTypeNumber, (value) => value.length(), LENNAME, config);
70
- }
71
- }
72
- RegisterClass(LENNAME, FlowGraphLengthVector2Block);
73
- const NORMALIZENAME = "FGNormalizeVector2Block";
74
- /**
75
- * Normalizes a vector.
76
- * @experimental
77
- */
78
- export class FlowGraphNormalizeVector2Block extends FlowGraphUnaryOperationBlock {
79
- constructor(config) {
80
- super(RichTypeVector2, RichTypeVector2, (value) => {
81
- const copy = value.clone();
82
- copy.normalize();
83
- return copy;
84
- }, NORMALIZENAME, config);
85
- }
86
- }
87
- RegisterClass(NORMALIZENAME, FlowGraphNormalizeVector2Block);
88
- const CREATENAME = "FGCreateVector2Block";
89
- /**
90
- * Creates a vector from two components.
91
- */
92
- export class FlowGraphCreateVector2Block extends FlowGraphBlock {
93
- constructor(config) {
94
- super(config);
95
- this._cachedVector = Vector2.Zero();
96
- this.x = this.registerDataInput("x", RichTypeNumber);
97
- this.y = this.registerDataInput("y", RichTypeNumber);
98
- this.vector = this.registerDataOutput("vector", RichTypeVector2);
99
- }
100
- _updateOutputs(_context) {
101
- this._cachedVector.x = this.x.getValue(_context);
102
- this._cachedVector.y = this.y.getValue(_context);
103
- this.vector.setValue(this._cachedVector, _context);
104
- }
105
- }
106
- RegisterClass(CREATENAME, FlowGraphCreateVector2Block);
107
- const SPLITNAME = "FGSplitVector2Block";
108
- /**
109
- * Split a vector into its components.
110
- */
111
- export class FlowGraphSplitVector2Block extends FlowGraphBlock {
112
- constructor(config) {
113
- super(config);
114
- this.vector = this.registerDataInput("vector", RichTypeVector2);
115
- this.x = this.registerDataOutput("x", RichTypeNumber);
116
- this.y = this.registerDataOutput("y", RichTypeNumber);
117
- }
118
- _updateOutputs(_context) {
119
- const vector = this.vector.getValue(_context);
120
- this.x.setValue(vector.x, _context);
121
- this.y.setValue(vector.y, _context);
122
- }
123
- }
124
- RegisterClass(SPLITNAME, FlowGraphSplitVector2Block);
125
- const ROTATENAME = "FGRotate2dVector2Block";
126
- /**
127
- * Rotates a vector by a given angle.
128
- */
129
- export class FlowGraphRotate2dVector2Block extends FlowGraphBlock {
130
- constructor(config) {
131
- super(config);
132
- this._cachedVector = Vector2.Zero();
133
- this.input = this.registerDataInput("input", RichTypeVector2);
134
- this.angle = this.registerDataInput("angle", RichTypeNumber);
135
- this.output = this.registerDataOutput("output", RichTypeVector2);
136
- }
137
- _updateOutputs(_context) {
138
- const input = this.input.getValue(_context);
139
- const angle = this.angle.getValue(_context);
140
- this._cachedVector.x = input.x * Math.cos(angle) - input.y * Math.sin(angle);
141
- this._cachedVector.y = input.x * Math.sin(angle) + input.y * Math.cos(angle);
142
- this.output.setValue(this._cachedVector, _context);
143
- }
144
- }
145
- RegisterClass(ROTATENAME, FlowGraphRotate2dVector2Block);
146
- //# sourceMappingURL=flowGraphVector2MathBlocks.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"flowGraphVector2MathBlocks.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Data/Math/flowGraphVector2MathBlocks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,uCAA0C;AACpF,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AACxD,OAAO,EAAE,6BAA6B,EAAE,MAAM,kCAAkC,CAAC;AACjF,OAAO,EAAE,4BAA4B,EAAE,MAAM,iCAAiC,CAAC;AAE/E,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAI3D,MAAM,OAAO,GAAG,mBAAmB,CAAC;AACpC;;;GAGG;AACH,MAAM,OAAO,wBAAyB,SAAQ,6BAAwD;IAClG,YAAY,MAAoC;QAC5C,KAAK,CAAC,eAAe,EAAE,eAAe,EAAE,eAAe,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;IAChH,CAAC;CACJ;AACD,aAAa,CAAC,OAAO,EAAE,wBAAwB,CAAC,CAAC;AAEjD,MAAM,OAAO,GAAG,wBAAwB,CAAC;AACzC;;;GAGG;AACH,MAAM,OAAO,6BAA8B,SAAQ,6BAAwD;IACvG,YAAY,MAAoC;QAC5C,KAAK,C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A8B,SAAQ,cAAc;IAgB7D,YAAY,MAAqC;QAC7C,KAAK,CAAC,MAAM,CAAC,CAAC;QAHV,kBAAa,GAAY,OAAO,CAAC,IAAI,EAAE,CAAC;QAI5C,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,iBAAiB,CAAC,OAAO,EAAE,eAAe,CAAC,CAAC;QAC9D,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,iBAAiB,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC;QAC7D,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,kBAAkB,CAAC,QAAQ,EAAE,eAAe,CAAC,CAAC;IACrE,CAAC;IAEM,cAAc,CAAC,QAA0B;QAC5C,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;QAC5C,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;QAC5C,IAAI,CAAC,aAAa,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QAC7E,IAAI,CAAC,aAAa,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QAC7E,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAC;IACvD,CAAC;CACJ;AACD,aAAa,CAAC,UAAU,EAAE,6BAA6B,CAAC,CAAC","sourcesContent":["import { RichTypeNumber, RichTypeVector2 } from \"core/FlowGraph/flowGraphRichTypes\";\r\nimport { Vector2 } from \"../../../../Maths/math.vector\";\r\nimport { FlowGraphBinaryOperationBlock } from \"../flowGraphBinaryOperationBlock\";\r\nimport { FlowGraphUnaryOperationBlock } from \"../flowGraphUnaryOperationBlock\";\r\nimport type { IFlowGraphBlockConfiguration } from \"../../../flowGraphBlock\";\r\nimport { FlowGraphBlock } from \"../../../flowGraphBlock\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\nimport type { FlowGraphDataConnection } from \"../../../flowGraphDataConnection\";\r\nimport type { FlowGraphContext } from \"../../../flowGraphContext\";\r\n\r\nconst ADDNAME = \"FGAddVector2Block\";\r\n/**\r\n * Adds two vectors together.\r\n * @experimental\r\n */\r\nexport class FlowGraphAddVector2Block extends FlowGraphBinaryOperationBlock<Vector2, Vector2, Vector2> {\r\n constructor(config: IFlowGraphBlockConfiguration) {\r\n super(RichTypeVector2, RichTypeVector2, RichTypeVector2, (left, right) => left.add(right), ADDNAME, config);\r\n }\r\n}\r\nRegisterClass(ADDNAME, FlowGraphAddVector2Block);\r\n\r\nconst SUBNAME = \"FGSubtractVector2Block\";\r\n/**\r\n * Subtracts two vectors.\r\n * @experimental\r\n */\r\nexport class FlowGraphSubtractVector2Block extends FlowGraphBinaryOperationBlock<Vector2, Vector2, Vector2> {\r\n constructor(config: IFlowGraphBlockConfiguration) {\r\n super(RichTypeVector2, RichTypeVector2, RichTypeVector2, (left, right) => left.subtract(right), SUBNAME, config);\r\n }\r\n}\r\nRegisterClass(SUBNAME, FlowGraphSubtractVector2Block);\r\n\r\nconst MULNAME = \"FGMultiplyVector2Block\";\r\n/**\r\n * Multiplies two vectors together.\r\n * @experimental\r\n */\r\nexport class FlowGraphMultiplyVector2Block extends FlowGraphBinaryOperationBlock<Vector2, Vector2, Vector2> {\r\n constructor(config: IFlowGraphBlockConfiguration) {\r\n super(RichTypeVector2, RichTypeVector2, RichTypeVector2, (left, right) => left.multiply(right), MULNAME, config);\r\n }\r\n}\r\nRegisterClass(MULNAME, FlowGraphMultiplyVector2Block);\r\n\r\nconst DIVNAME = \"FGDivideVector2Block\";\r\n/**\r\n * Divides two vectors.\r\n * @experimental\r\n */\r\nexport class FlowGraphDivideVector2Block extends FlowGraphBinaryOperationBlock<Vector2, Vector2, Vector2> {\r\n constructor(config: IFlowGraphBlockConfiguration) {\r\n super(RichTypeVector2, RichTypeVector2, RichTypeVector2, (left, right) => left.divide(right), DIVNAME, config);\r\n }\r\n}\r\nRegisterClass(DIVNAME, FlowGraphDivideVector2Block);\r\n\r\nconst SCALENAME = \"FGScaleVector2Block\";\r\n/**\r\n * Scales a vector by a given factor.\r\n * @experimental\r\n */\r\nexport class FlowGraphScaleVector2Block extends FlowGraphBinaryOperationBlock<Vector2, number, Vector2> {\r\n constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(RichTypeVector2, RichTypeNumber, RichTypeVector2, (left, right) => left.scale(right), SCALENAME, config);\r\n }\r\n}\r\nRegisterClass(SCALENAME, FlowGraphScaleVector2Block);\r\n\r\nconst LENNAME = \"FGLengthVector2Block\";\r\n/**\r\n * Gets the length of a vector.\r\n * @experimental\r\n */\r\nexport class FlowGraphLengthVector2Block extends FlowGraphUnaryOperationBlock<Vector2, number> {\r\n constructor(config: IFlowGraphBlockConfiguration) {\r\n super(RichTypeVector2, RichTypeNumber, (value) => value.length(), LENNAME, config);\r\n }\r\n}\r\nRegisterClass(LENNAME, FlowGraphLengthVector2Block);\r\n\r\nconst NORMALIZENAME = \"FGNormalizeVector2Block\";\r\n/**\r\n * Normalizes a vector.\r\n * @experimental\r\n */\r\nexport class FlowGraphNormalizeVector2Block extends FlowGraphUnaryOperationBlock<Vector2, Vector2> {\r\n constructor(config: IFlowGraphBlockConfiguration) {\r\n super(\r\n RichTypeVector2,\r\n RichTypeVector2,\r\n (value: Vector2) => {\r\n const copy: Vector2 = value.clone();\r\n copy.normalize();\r\n return copy;\r\n },\r\n NORMALIZENAME,\r\n config\r\n );\r\n }\r\n}\r\nRegisterClass(NORMALIZENAME, FlowGraphNormalizeVector2Block);\r\n\r\nconst CREATENAME = \"FGCreateVector2Block\";\r\n/**\r\n * Creates a vector from two components.\r\n */\r\nexport class FlowGraphCreateVector2Block extends FlowGraphBlock {\r\n /**\r\n * Input connection: The x component of the vector.\r\n */\r\n public readonly x: FlowGraphDataConnection<number>;\r\n /**\r\n * Input connection: The y component of the vector.\r\n */\r\n public readonly y: FlowGraphDataConnection<number>;\r\n /**\r\n * Output connection: The created vector.\r\n */\r\n public readonly vector: FlowGraphDataConnection<Vector2>;\r\n\r\n private _cachedVector: Vector2 = Vector2.Zero();\r\n\r\n constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(config);\r\n\r\n this.x = this.registerDataInput(\"x\", RichTypeNumber);\r\n this.y = this.registerDataInput(\"y\", RichTypeNumber);\r\n this.vector = this.registerDataOutput(\"vector\", RichTypeVector2);\r\n }\r\n\r\n public _updateOutputs(_context: FlowGraphContext): void {\r\n this._cachedVector.x = this.x.getValue(_context);\r\n this._cachedVector.y = this.y.getValue(_context);\r\n this.vector.setValue(this._cachedVector, _context);\r\n }\r\n}\r\nRegisterClass(CREATENAME, FlowGraphCreateVector2Block);\r\n\r\nconst SPLITNAME = \"FGSplitVector2Block\";\r\n/**\r\n * Split a vector into its components.\r\n */\r\nexport class FlowGraphSplitVector2Block extends FlowGraphBlock {\r\n /**\r\n * Input connection: The vector to split.\r\n */\r\n public readonly vector: FlowGraphDataConnection<Vector2>;\r\n /**\r\n * Output connection: The x component of the vector.\r\n */\r\n public readonly x: FlowGraphDataConnection<number>;\r\n /**\r\n * Output connection: The y component of the vector.\r\n */\r\n public readonly y: FlowGraphDataConnection<number>;\r\n\r\n constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(config);\r\n\r\n this.vector = this.registerDataInput(\"vector\", RichTypeVector2);\r\n this.x = this.registerDataOutput(\"x\", RichTypeNumber);\r\n this.y = this.registerDataOutput(\"y\", RichTypeNumber);\r\n }\r\n\r\n public _updateOutputs(_context: FlowGraphContext): void {\r\n const vector = this.vector.getValue(_context);\r\n this.x.setValue(vector.x, _context);\r\n this.y.setValue(vector.y, _context);\r\n }\r\n}\r\nRegisterClass(SPLITNAME, FlowGraphSplitVector2Block);\r\n\r\nconst ROTATENAME = \"FGRotate2dVector2Block\";\r\n/**\r\n * Rotates a vector by a given angle.\r\n */\r\nexport class FlowGraphRotate2dVector2Block extends FlowGraphBlock {\r\n /**\r\n * Input connection: The vector to rotate.\r\n */\r\n public readonly input: FlowGraphDataConnection<Vector2>;\r\n /**\r\n * Input connection: The angle to rotate by.\r\n */\r\n public readonly angle: FlowGraphDataConnection<number>;\r\n /**\r\n * Output connection: The rotated vector.\r\n */\r\n public readonly output: FlowGraphDataConnection<Vector2>;\r\n\r\n private _cachedVector: Vector2 = Vector2.Zero();\r\n\r\n constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(config);\r\n this.input = this.registerDataInput(\"input\", RichTypeVector2);\r\n this.angle = this.registerDataInput(\"angle\", RichTypeNumber);\r\n this.output = this.registerDataOutput(\"output\", RichTypeVector2);\r\n }\r\n\r\n public _updateOutputs(_context: FlowGraphContext): void {\r\n const input = this.input.getValue(_context);\r\n const angle = this.angle.getValue(_context);\r\n this._cachedVector.x = input.x * Math.cos(angle) - input.y * Math.sin(angle);\r\n this._cachedVector.y = input.x * Math.sin(angle) + input.y * Math.cos(angle);\r\n this.output.setValue(this._cachedVector, _context);\r\n }\r\n}\r\nRegisterClass(ROTATENAME, FlowGraphRotate2dVector2Block);\r\n"]}
@@ -1,155 +0,0 @@
1
- import { FlowGraphBinaryOperationBlock } from "../flowGraphBinaryOperationBlock";
2
- import type { Matrix } from "../../../../Maths/math.vector";
3
- import { Vector3 } from "../../../../Maths/math.vector";
4
- import { FlowGraphUnaryOperationBlock } from "../flowGraphUnaryOperationBlock";
5
- import type { IFlowGraphBlockConfiguration } from "../../../flowGraphBlock";
6
- import { FlowGraphBlock } from "../../../flowGraphBlock";
7
- import type { FlowGraphContext } from "../../../flowGraphContext";
8
- import type { FlowGraphDataConnection } from "../../../flowGraphDataConnection";
9
- /**
10
- * Add two vectors together.
11
- * @experimental
12
- */
13
- export declare class FlowGraphAddVector3Block extends FlowGraphBinaryOperationBlock<Vector3, Vector3, Vector3> {
14
- constructor(config?: IFlowGraphBlockConfiguration);
15
- }
16
- /**
17
- * Subtract two vectors.
18
- * @experimental
19
- */
20
- export declare class FlowGraphSubtractVector3Block extends FlowGraphBinaryOperationBlock<Vector3, Vector3, Vector3> {
21
- constructor(config: IFlowGraphBlockConfiguration);
22
- }
23
- /**
24
- * Multiply two vectors together.
25
- * @experimental
26
- */
27
- export declare class FlowGraphMultiplyVector3Block extends FlowGraphBinaryOperationBlock<Vector3, Vector3, Vector3> {
28
- constructor(config: IFlowGraphBlockConfiguration);
29
- }
30
- /**
31
- * Divide two vectors.
32
- * @experimental
33
- */
34
- export declare class FlowGraphDivideVector3Block extends FlowGraphBinaryOperationBlock<Vector3, Vector3, Vector3> {
35
- constructor(config?: IFlowGraphBlockConfiguration);
36
- }
37
- /**
38
- * Scale a vector by a number.
39
- * @experimental
40
- */
41
- export declare class FlowGraphScaleVector3Block extends FlowGraphBinaryOperationBlock<Vector3, number, Vector3> {
42
- constructor(config?: IFlowGraphBlockConfiguration);
43
- }
44
- /**
45
- * Get the length of a vector.
46
- * @experimental
47
- */
48
- export declare class FlowGraphLengthVector3Block extends FlowGraphUnaryOperationBlock<Vector3, number> {
49
- constructor(config?: IFlowGraphBlockConfiguration);
50
- }
51
- /**
52
- * Normalize a vector.
53
- * @experimental
54
- */
55
- export declare class FlowGraphNormalizeVector3Block extends FlowGraphUnaryOperationBlock<Vector3, Vector3> {
56
- constructor(config?: IFlowGraphBlockConfiguration);
57
- }
58
- /**
59
- * Get the dot product of two vectors.
60
- * @experimental
61
- */
62
- export declare class FlowGraphDotVector3Block extends FlowGraphBinaryOperationBlock<Vector3, Vector3, number> {
63
- constructor(config?: IFlowGraphBlockConfiguration);
64
- }
65
- /**
66
- * Get the cross product of two vectors.
67
- * @experimental
68
- */
69
- export declare class FlowGraphCrossVector3Block extends FlowGraphBinaryOperationBlock<Vector3, Vector3, Vector3> {
70
- constructor(config?: IFlowGraphBlockConfiguration);
71
- }
72
- /**
73
- * Create a vector from its components.
74
- * @experimental
75
- */
76
- export declare class FlowGraphCreateVector3Block extends FlowGraphBlock {
77
- /**
78
- * Input connection: The x component of the vector.
79
- */
80
- readonly x: FlowGraphDataConnection<number>;
81
- /**
82
- * Input connection: The y component of the vector.
83
- */
84
- readonly y: FlowGraphDataConnection<number>;
85
- /**
86
- * Input connection: The z component of the vector.
87
- */
88
- readonly z: FlowGraphDataConnection<number>;
89
- /**
90
- * Output connection: The created vector.
91
- */
92
- readonly vector: FlowGraphDataConnection<Vector3>;
93
- private _cachedVector;
94
- constructor(config?: IFlowGraphBlockConfiguration);
95
- _updateOutputs(_context: FlowGraphContext): void;
96
- getClassName(): string;
97
- }
98
- /**
99
- * Split a vector into its components.
100
- * @experimental
101
- */
102
- export declare class FlowGraphSplitVector3Block extends FlowGraphBlock {
103
- /**
104
- * Input connection: The vector to split.
105
- */
106
- readonly vector: FlowGraphDataConnection<Vector3>;
107
- /**
108
- * Output connection: The x component of the vector.
109
- */
110
- readonly x: FlowGraphDataConnection<number>;
111
- /**
112
- * Output connection: The y component of the vector.
113
- */
114
- readonly y: FlowGraphDataConnection<number>;
115
- /**
116
- * Input connection: The z component of the vector.
117
- */
118
- readonly z: FlowGraphDataConnection<number>;
119
- constructor(config?: IFlowGraphBlockConfiguration);
120
- _updateOutputs(_context: FlowGraphContext): void;
121
- getClassName(): string;
122
- }
123
- /**
124
- * Rotates a vector by a given angle.
125
- */
126
- export declare class FlowGraphRotate3dVector3Block extends FlowGraphBlock {
127
- /**
128
- * Input connection: The vector to rotate.
129
- */
130
- readonly input: FlowGraphDataConnection<Vector3>;
131
- /**
132
- * Input connection: The axis to rotate around.
133
- */
134
- readonly axis: FlowGraphDataConnection<Vector3>;
135
- /**
136
- * Input connection: The angle to rotate by.
137
- */
138
- readonly angle: FlowGraphDataConnection<number>;
139
- /**
140
- * Output connection: The rotated vector.
141
- */
142
- readonly output: FlowGraphDataConnection<Vector3>;
143
- private _cachedQuaternion;
144
- constructor(config?: IFlowGraphBlockConfiguration);
145
- _updateOutputs(_context: FlowGraphContext): void;
146
- getClassName(): string;
147
- }
148
- /**
149
- * Transforms a vector by a given matrix.
150
- * @experimental
151
- */
152
- export declare class FlowGraphTransformVector3Block extends FlowGraphBinaryOperationBlock<Matrix, Vector3, Vector3> {
153
- private _cachedResult;
154
- constructor(config?: IFlowGraphBlockConfiguration);
155
- }