@onerjs/core 8.54.4 → 8.54.6

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 (234) hide show
  1. package/Engines/Native/nativeHelpers.js +5 -0
  2. package/Engines/Native/nativeHelpers.js.map +1 -1
  3. package/Engines/WebGPU/Extensions/engine.cubeTexture.pure.js +1 -1
  4. package/Engines/WebGPU/Extensions/engine.cubeTexture.pure.js.map +1 -1
  5. package/Engines/WebGPU/Extensions/engine.rawTexture.pure.js +2 -2
  6. package/Engines/WebGPU/Extensions/engine.rawTexture.pure.js.map +1 -1
  7. package/Engines/WebGPU/webgpuCacheRenderPipeline.d.ts +1 -0
  8. package/Engines/WebGPU/webgpuCacheRenderPipeline.js +18 -4
  9. package/Engines/WebGPU/webgpuCacheRenderPipeline.js.map +1 -1
  10. package/Engines/WebGPU/webgpuCacheTextureView.d.ts +13 -0
  11. package/Engines/WebGPU/webgpuCacheTextureView.js +32 -0
  12. package/Engines/WebGPU/webgpuCacheTextureView.js.map +1 -0
  13. package/Engines/WebGPU/webgpuRenderTargetWrapper.d.ts +10 -0
  14. package/Engines/WebGPU/webgpuRenderTargetWrapper.js +10 -0
  15. package/Engines/WebGPU/webgpuRenderTargetWrapper.js.map +1 -1
  16. package/Engines/WebGPU/webgpuShaderProcessorsWGSL.pure.js +57 -4
  17. package/Engines/WebGPU/webgpuShaderProcessorsWGSL.pure.js.map +1 -1
  18. package/Engines/WebGPU/webgpuTextureManager.d.ts +1 -1
  19. package/Engines/WebGPU/webgpuTextureManager.js +4 -2
  20. package/Engines/WebGPU/webgpuTextureManager.js.map +1 -1
  21. package/Engines/abstractEngine.pure.js +2 -2
  22. package/Engines/abstractEngine.pure.js.map +1 -1
  23. package/Engines/engineCapabilities.d.ts +5 -0
  24. package/Engines/engineCapabilities.js.map +1 -1
  25. package/Engines/thinNativeEngine.pure.d.ts +5 -0
  26. package/Engines/thinNativeEngine.pure.js +52 -10
  27. package/Engines/thinNativeEngine.pure.js.map +1 -1
  28. package/Engines/webgpuEngine.pure.d.ts +1 -0
  29. package/Engines/webgpuEngine.pure.js +22 -8
  30. package/Engines/webgpuEngine.pure.js.map +1 -1
  31. package/FlowGraph/Blocks/Data/Math/flowGraphMathBlocks.pure.d.ts +95 -1
  32. package/FlowGraph/Blocks/Data/Math/flowGraphMathBlocks.pure.js +169 -4
  33. package/FlowGraph/Blocks/Data/Math/flowGraphMathBlocks.pure.js.map +1 -1
  34. package/FlowGraph/Blocks/Data/Math/flowGraphMathCombineExtractBlocks.pure.d.ts +21 -6
  35. package/FlowGraph/Blocks/Data/Math/flowGraphMathCombineExtractBlocks.pure.js +28 -26
  36. package/FlowGraph/Blocks/Data/Math/flowGraphMathCombineExtractBlocks.pure.js.map +1 -1
  37. package/FlowGraph/Blocks/Data/Math/flowGraphMatrixMathBlocks.pure.d.ts +30 -2
  38. package/FlowGraph/Blocks/Data/Math/flowGraphMatrixMathBlocks.pure.js +111 -29
  39. package/FlowGraph/Blocks/Data/Math/flowGraphMatrixMathBlocks.pure.js.map +1 -1
  40. package/FlowGraph/Blocks/Data/Math/flowGraphVectorMathBlocks.pure.d.ts +56 -2
  41. package/FlowGraph/Blocks/Data/Math/flowGraphVectorMathBlocks.pure.js +99 -14
  42. package/FlowGraph/Blocks/Data/Math/flowGraphVectorMathBlocks.pure.js.map +1 -1
  43. package/FlowGraph/Blocks/Data/Transformers/flowGraphJsonPointerParserBlock.pure.js +10 -2
  44. package/FlowGraph/Blocks/Data/Transformers/flowGraphJsonPointerParserBlock.pure.js.map +1 -1
  45. package/FlowGraph/Blocks/Data/Utils/flowGraphArrayIndexBlock.pure.js +21 -1
  46. package/FlowGraph/Blocks/Data/Utils/flowGraphArrayIndexBlock.pure.js.map +1 -1
  47. package/FlowGraph/Blocks/Data/flowGraphCachedOperationBlock.d.ts +18 -0
  48. package/FlowGraph/Blocks/Data/flowGraphCachedOperationBlock.js +29 -2
  49. package/FlowGraph/Blocks/Data/flowGraphCachedOperationBlock.js.map +1 -1
  50. package/FlowGraph/Blocks/Event/flowGraphReceiveCustomEventBlock.pure.d.ts +15 -0
  51. package/FlowGraph/Blocks/Event/flowGraphReceiveCustomEventBlock.pure.js +44 -7
  52. package/FlowGraph/Blocks/Event/flowGraphReceiveCustomEventBlock.pure.js.map +1 -1
  53. package/FlowGraph/Blocks/Event/flowGraphSceneReadyEventBlock.pure.d.ts +9 -0
  54. package/FlowGraph/Blocks/Event/flowGraphSceneReadyEventBlock.pure.js +9 -1
  55. package/FlowGraph/Blocks/Event/flowGraphSceneReadyEventBlock.pure.js.map +1 -1
  56. package/FlowGraph/Blocks/Event/flowGraphSceneTickEventBlock.pure.d.ts +7 -0
  57. package/FlowGraph/Blocks/Event/flowGraphSceneTickEventBlock.pure.js +8 -1
  58. package/FlowGraph/Blocks/Event/flowGraphSceneTickEventBlock.pure.js.map +1 -1
  59. package/FlowGraph/Blocks/Event/flowGraphStopEventPropagationBlock.d.ts +5 -0
  60. package/FlowGraph/Blocks/Event/flowGraphStopEventPropagationBlock.js +8 -0
  61. package/FlowGraph/Blocks/Event/flowGraphStopEventPropagationBlock.js.map +1 -0
  62. package/FlowGraph/Blocks/Event/flowGraphStopEventPropagationBlock.pure.d.ts +37 -0
  63. package/FlowGraph/Blocks/Event/flowGraphStopEventPropagationBlock.pure.js +44 -0
  64. package/FlowGraph/Blocks/Event/flowGraphStopEventPropagationBlock.pure.js.map +1 -0
  65. package/FlowGraph/Blocks/Event/index.d.ts +1 -0
  66. package/FlowGraph/Blocks/Event/index.js +1 -0
  67. package/FlowGraph/Blocks/Event/index.js.map +1 -1
  68. package/FlowGraph/Blocks/Event/pure.d.ts +1 -0
  69. package/FlowGraph/Blocks/Event/pure.js +1 -0
  70. package/FlowGraph/Blocks/Event/pure.js.map +1 -1
  71. package/FlowGraph/Blocks/Execution/Animation/flowGraphBezierCurveEasingBlock.pure.d.ts +4 -1
  72. package/FlowGraph/Blocks/Execution/Animation/flowGraphBezierCurveEasingBlock.pure.js +67 -2
  73. package/FlowGraph/Blocks/Execution/Animation/flowGraphBezierCurveEasingBlock.pure.js.map +1 -1
  74. package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.pure.d.ts +13 -0
  75. package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.pure.js +102 -7
  76. package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.pure.js.map +1 -1
  77. package/FlowGraph/Blocks/Execution/Animation/flowGraphStopAnimationBlock.pure.js +5 -1
  78. package/FlowGraph/Blocks/Execution/Animation/flowGraphStopAnimationBlock.pure.js.map +1 -1
  79. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCancelDelayBlock.pure.js +5 -1
  80. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCancelDelayBlock.pure.js.map +1 -1
  81. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphForLoopBlock.pure.d.ts +11 -2
  82. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphForLoopBlock.pure.js +21 -3
  83. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphForLoopBlock.pure.js.map +1 -1
  84. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSetDelayBlock.pure.js +25 -4
  85. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSetDelayBlock.pure.js.map +1 -1
  86. package/FlowGraph/Blocks/flowGraphBlockFactory.js +18 -0
  87. package/FlowGraph/Blocks/flowGraphBlockFactory.js.map +1 -1
  88. package/FlowGraph/Blocks/flowGraphBlockNames.d.ts +9 -0
  89. package/FlowGraph/Blocks/flowGraphBlockNames.js +9 -0
  90. package/FlowGraph/Blocks/flowGraphBlockNames.js.map +1 -1
  91. package/FlowGraph/CustomTypes/flowGraphMatrix.d.ts +17 -3
  92. package/FlowGraph/CustomTypes/flowGraphMatrix.js +27 -21
  93. package/FlowGraph/CustomTypes/flowGraphMatrix.js.map +1 -1
  94. package/FlowGraph/flowGraphContext.d.ts +23 -0
  95. package/FlowGraph/flowGraphContext.js +29 -0
  96. package/FlowGraph/flowGraphContext.js.map +1 -1
  97. package/FlowGraph/flowGraphCoordinator.d.ts +58 -1
  98. package/FlowGraph/flowGraphCoordinator.js +72 -0
  99. package/FlowGraph/flowGraphCoordinator.js.map +1 -1
  100. package/FlowGraph/flowGraphDelayRegistry.d.ts +31 -0
  101. package/FlowGraph/flowGraphDelayRegistry.js +50 -0
  102. package/FlowGraph/flowGraphDelayRegistry.js.map +1 -0
  103. package/FlowGraph/flowGraphHostResolver.d.ts +69 -0
  104. package/FlowGraph/flowGraphHostResolver.js +25 -0
  105. package/FlowGraph/flowGraphHostResolver.js.map +1 -0
  106. package/FlowGraph/flowGraphMath.d.ts +48 -1
  107. package/FlowGraph/flowGraphMath.js +169 -4
  108. package/FlowGraph/flowGraphMath.js.map +1 -1
  109. package/FlowGraph/flowGraphPathConverterComponent.d.ts +14 -3
  110. package/FlowGraph/flowGraphPathConverterComponent.js +110 -18
  111. package/FlowGraph/flowGraphPathConverterComponent.js.map +1 -1
  112. package/FlowGraph/flowGraphSignalConnection.pure.js +7 -1
  113. package/FlowGraph/flowGraphSignalConnection.pure.js.map +1 -1
  114. package/FlowGraph/index.d.ts +2 -0
  115. package/FlowGraph/index.js +2 -0
  116. package/FlowGraph/index.js.map +1 -1
  117. package/FlowGraph/pure.d.ts +2 -0
  118. package/FlowGraph/pure.js +2 -0
  119. package/FlowGraph/pure.js.map +1 -1
  120. package/Materials/Node/nodeMaterial.pure.d.ts +3 -1
  121. package/Materials/Node/nodeMaterial.pure.js +18 -1
  122. package/Materials/Node/nodeMaterial.pure.js.map +1 -1
  123. package/Materials/Textures/envCubeTexture.pure.js +7 -2
  124. package/Materials/Textures/envCubeTexture.pure.js.map +1 -1
  125. package/Materials/materialHelper.functions.d.ts +14 -0
  126. package/Materials/materialHelper.functions.js +67 -0
  127. package/Materials/materialHelper.functions.js.map +1 -1
  128. package/Maths/math.vector.pure.d.ts +11 -1
  129. package/Maths/math.vector.pure.js +13 -0
  130. package/Maths/math.vector.pure.js.map +1 -1
  131. package/Meshes/GaussianSplatting/gaussianSplattingMesh.pure.d.ts +216 -1
  132. package/Meshes/GaussianSplatting/gaussianSplattingMesh.pure.js +714 -67
  133. package/Meshes/GaussianSplatting/gaussianSplattingMesh.pure.js.map +1 -1
  134. package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.d.ts +81 -4
  135. package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.js +466 -52
  136. package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.js.map +1 -1
  137. package/Meshes/GaussianSplatting/gaussianSplattingPartProxyMesh.pure.d.ts +19 -0
  138. package/Meshes/GaussianSplatting/gaussianSplattingPartProxyMesh.pure.js +24 -0
  139. package/Meshes/GaussianSplatting/gaussianSplattingPartProxyMesh.pure.js.map +1 -1
  140. package/Meshes/GaussianSplatting/gaussianSplattingSortWorker.js +31 -6
  141. package/Meshes/GaussianSplatting/gaussianSplattingSortWorker.js.map +1 -1
  142. package/Meshes/GreasedLine/greasedLineRibbonMesh.pure.js +5 -1
  143. package/Meshes/GreasedLine/greasedLineRibbonMesh.pure.js.map +1 -1
  144. package/Meshes/abstractMesh.pure.js +1 -0
  145. package/Meshes/abstractMesh.pure.js.map +1 -1
  146. package/Meshes/mesh.pure.js +5 -0
  147. package/Meshes/mesh.pure.js.map +1 -1
  148. package/Meshes/transformNode.pure.js +1 -0
  149. package/Meshes/transformNode.pure.js.map +1 -1
  150. package/Misc/areaLightsTextureTools.js +1 -1
  151. package/Misc/areaLightsTextureTools.js.map +1 -1
  152. package/Misc/greasedLineTools.js +1 -1
  153. package/Misc/greasedLineTools.js.map +1 -1
  154. package/Misc/tools.pure.js +14 -2
  155. package/Misc/tools.pure.js.map +1 -1
  156. package/Particles/gpuParticleSystem.pure.d.ts +66 -1
  157. package/Particles/gpuParticleSystem.pure.js +189 -49
  158. package/Particles/gpuParticleSystem.pure.js.map +1 -1
  159. package/Physics/v2/characterController.js +69 -17
  160. package/Physics/v2/characterController.js.map +1 -1
  161. package/PostProcesses/RenderPipeline/Pipelines/fsr1RenderingPipeline.d.ts +79 -0
  162. package/PostProcesses/RenderPipeline/Pipelines/fsr1RenderingPipeline.js +171 -0
  163. package/PostProcesses/RenderPipeline/Pipelines/fsr1RenderingPipeline.js.map +1 -0
  164. package/PostProcesses/RenderPipeline/Pipelines/index.d.ts +5 -0
  165. package/PostProcesses/RenderPipeline/Pipelines/index.js +6 -0
  166. package/PostProcesses/RenderPipeline/Pipelines/index.js.map +1 -1
  167. package/PostProcesses/RenderPipeline/Pipelines/pure.d.ts +1 -0
  168. package/PostProcesses/RenderPipeline/Pipelines/pure.js +1 -0
  169. package/PostProcesses/RenderPipeline/Pipelines/pure.js.map +1 -1
  170. package/PostProcesses/thinFSR1SharpenPostProcess.d.ts +32 -0
  171. package/PostProcesses/thinFSR1SharpenPostProcess.js +58 -0
  172. package/PostProcesses/thinFSR1SharpenPostProcess.js.map +1 -0
  173. package/PostProcesses/thinFSR1UpscalePostProcess.d.ts +37 -0
  174. package/PostProcesses/thinFSR1UpscalePostProcess.js +68 -0
  175. package/PostProcesses/thinFSR1UpscalePostProcess.js.map +1 -0
  176. package/Shaders/ShadersInclude/ffxFunctions.d.ts +5 -0
  177. package/Shaders/ShadersInclude/ffxFunctions.js +18 -0
  178. package/Shaders/ShadersInclude/ffxFunctions.js.map +1 -0
  179. package/Shaders/ShadersInclude/hdrFilteringFunctions.js +2 -2
  180. package/Shaders/ShadersInclude/hdrFilteringFunctions.js.map +1 -1
  181. package/Shaders/ShadersInclude/openpbrIblFunctions.js +1 -6
  182. package/Shaders/ShadersInclude/openpbrIblFunctions.js.map +1 -1
  183. package/Shaders/fsr1Sharpen.fragment.d.ts +5 -0
  184. package/Shaders/fsr1Sharpen.fragment.js +26 -0
  185. package/Shaders/fsr1Sharpen.fragment.js.map +1 -0
  186. package/Shaders/fsr1Upscale.fragment.d.ts +5 -0
  187. package/Shaders/fsr1Upscale.fragment.js +77 -0
  188. package/Shaders/fsr1Upscale.fragment.js.map +1 -0
  189. package/ShadersWGSL/ShadersInclude/ffxFunctions.d.ts +5 -0
  190. package/ShadersWGSL/ShadersInclude/ffxFunctions.js +18 -0
  191. package/ShadersWGSL/ShadersInclude/ffxFunctions.js.map +1 -0
  192. package/ShadersWGSL/fsr1Sharpen.fragment.d.ts +5 -0
  193. package/ShadersWGSL/fsr1Sharpen.fragment.js +34 -0
  194. package/ShadersWGSL/fsr1Sharpen.fragment.js.map +1 -0
  195. package/ShadersWGSL/fsr1Upscale.fragment.d.ts +5 -0
  196. package/ShadersWGSL/fsr1Upscale.fragment.js +68 -0
  197. package/ShadersWGSL/fsr1Upscale.fragment.js.map +1 -0
  198. package/XR/features/Layers/WebXRWebGPUCompositionLayer.d.ts +3 -9
  199. package/XR/features/Layers/WebXRWebGPUCompositionLayer.js +4 -11
  200. package/XR/features/Layers/WebXRWebGPUCompositionLayer.js.map +1 -1
  201. package/XR/features/WebXRAbstractFeature.d.ts +9 -0
  202. package/XR/features/WebXRAbstractFeature.js +16 -0
  203. package/XR/features/WebXRAbstractFeature.js.map +1 -1
  204. package/XR/features/WebXRDepthSensing.pure.d.ts +7 -0
  205. package/XR/features/WebXRDepthSensing.pure.js +350 -39
  206. package/XR/features/WebXRDepthSensing.pure.js.map +1 -1
  207. package/XR/features/WebXRImageTracking.pure.js.map +1 -1
  208. package/XR/features/WebXRLayers.pure.d.ts +6 -5
  209. package/XR/features/WebXRLayers.pure.js +65 -8
  210. package/XR/features/WebXRLayers.pure.js.map +1 -1
  211. package/XR/features/WebXRRawCameraAccess.pure.js +9 -2
  212. package/XR/features/WebXRRawCameraAccess.pure.js.map +1 -1
  213. package/XR/features/WebXRSpaceWarp.pure.d.ts +0 -1
  214. package/XR/features/WebXRSpaceWarp.pure.js +13 -4
  215. package/XR/features/WebXRSpaceWarp.pure.js.map +1 -1
  216. package/XR/features/WebXRWalkingLocomotion.pure.js.map +1 -1
  217. package/XR/webXRCamera.js +27 -0
  218. package/XR/webXRCamera.js.map +1 -1
  219. package/XR/webXRFeatureWarningRegistry.d.ts +14 -0
  220. package/XR/webXRFeatureWarningRegistry.js +19 -0
  221. package/XR/webXRFeatureWarningRegistry.js.map +1 -0
  222. package/XR/webXRFeaturesManager.d.ts +5 -0
  223. package/XR/webXRFeaturesManager.js +23 -4
  224. package/XR/webXRFeaturesManager.js.map +1 -1
  225. package/XR/webXRGraphicsBinding.d.ts +17 -10
  226. package/XR/webXRGraphicsBinding.js +8 -5
  227. package/XR/webXRGraphicsBinding.js.map +1 -1
  228. package/XR/webXRSessionManager.d.ts +3 -5
  229. package/XR/webXRSessionManager.js +1 -3
  230. package/XR/webXRSessionManager.js.map +1 -1
  231. package/XR/webXRWebGPURenderTargetTextureProvider.d.ts +21 -5
  232. package/XR/webXRWebGPURenderTargetTextureProvider.js +38 -10
  233. package/XR/webXRWebGPURenderTargetTextureProvider.js.map +1 -1
  234. package/package.json +1 -1
@@ -1,12 +1,14 @@
1
1
  /** This file must only contain pure code and pure imports */
2
- import { type IFlowGraphBlockConfiguration } from "../../../flowGraphBlock.js";
2
+ import { FlowGraphBlock, type IFlowGraphBlockConfiguration } from "../../../flowGraphBlock.js";
3
3
  import { FlowGraphTypes } from "../../../flowGraphRichTypes.pure.js";
4
4
  import { FlowGraphBinaryOperationBlock } from "../flowGraphBinaryOperationBlock.js";
5
5
  import { FlowGraphConstantOperationBlock } from "../flowGraphConstantOperationBlock.js";
6
+ import { Quaternion } from "../../../../Maths/math.vector.pure.js";
6
7
  import { FlowGraphUnaryOperationBlock } from "../flowGraphUnaryOperationBlock.js";
7
8
  import { FlowGraphTernaryOperationBlock } from "../flowGraphTernaryOperationBlock.js";
8
9
  import { FlowGraphInteger } from "../../../CustomTypes/flowGraphInteger.pure.js";
9
10
  import { type FlowGraphDataConnection } from "../../../flowGraphDataConnection.pure.js";
11
+ import { type FlowGraphContext } from "../../../flowGraphContext.js";
10
12
  import { type FlowGraphMathOperationType, type FlowGraphNumber } from "../../../utils.js";
11
13
  /**
12
14
  * A configuration interface for math blocks
@@ -122,6 +124,12 @@ export declare class FlowGraphEBlock extends FlowGraphConstantOperationBlock<num
122
124
  export declare class FlowGraphPiBlock extends FlowGraphConstantOperationBlock<number> {
123
125
  constructor(config?: IFlowGraphBlockConfiguration);
124
126
  }
127
+ /**
128
+ * Tau constant (2 * Pi), the ratio of a circle's circumference to its radius.
129
+ */
130
+ export declare class FlowGraphTauBlock extends FlowGraphConstantOperationBlock<number> {
131
+ constructor(config?: IFlowGraphBlockConfiguration);
132
+ }
125
133
  /**
126
134
  * Positive inf constant.
127
135
  */
@@ -246,6 +254,28 @@ export declare class FlowGraphMathInterpolationBlock extends FlowGraphTernaryOpe
246
254
  constructor(config?: IFlowGraphBlockConfiguration);
247
255
  private _polymorphicInterpolate;
248
256
  }
257
+ /**
258
+ * Spherical linear interpolation between two unit quaternions, matching the
259
+ * quaternion slerp operation. The two inputs are treated as
260
+ * Babylon `Quaternion` values regardless of their concrete class (the spec
261
+ * defines them as `float4`), and the output is a `Quaternion`.
262
+ *
263
+ * The underlying implementation is `Quaternion.Slerp`, whose algorithm matches
264
+ * the spec step-for-step (dot product, conditional sign-flip on `b`, sin-based
265
+ * weighting, and a near-identity short-circuit to a linear blend).
266
+ */
267
+ export declare class FlowGraphMathSlerpBlock extends FlowGraphTernaryOperationBlock<Quaternion, Quaternion, number, Quaternion> {
268
+ constructor(config?: IFlowGraphBlockConfiguration);
269
+ }
270
+ /**
271
+ * Smooth-step block, returning the Hermite interpolation coefficient.
272
+ * Operates component-wise over floatN inputs (the two edges `a`/`b` and the
273
+ * value `c`).
274
+ */
275
+ export declare class FlowGraphMathSmoothStepBlock extends FlowGraphTernaryOperationBlock<FlowGraphMathOperationType, FlowGraphMathOperationType, FlowGraphMathOperationType, FlowGraphMathOperationType> {
276
+ constructor(config?: IFlowGraphBlockConfiguration);
277
+ private _polymorphicSmoothStep;
278
+ }
249
279
  /**
250
280
  * Equals block.
251
281
  */
@@ -520,6 +550,70 @@ export declare class FlowGraphTrailingZerosBlock extends FlowGraphUnaryOperation
520
550
  export declare class FlowGraphOneBitsCounterBlock extends FlowGraphUnaryOperationBlock<FlowGraphInteger, FlowGraphInteger> {
521
551
  constructor(config?: IFlowGraphBlockConfiguration);
522
552
  }
553
+ /**
554
+ * Block that converts a linear sRGB color (r, g, b) to OkLCh (l, c, h). Hue is in radians.
555
+ */
556
+ export declare class FlowGraphRGBToOkLChBlock extends FlowGraphBlock {
557
+ /**
558
+ * Input connection: the linear red component.
559
+ */
560
+ readonly r: FlowGraphDataConnection<number>;
561
+ /**
562
+ * Input connection: the linear green component.
563
+ */
564
+ readonly g: FlowGraphDataConnection<number>;
565
+ /**
566
+ * Input connection: the linear blue component.
567
+ */
568
+ readonly b: FlowGraphDataConnection<number>;
569
+ /**
570
+ * Output connection: the OkLCh lightness.
571
+ */
572
+ readonly l: FlowGraphDataConnection<number>;
573
+ /**
574
+ * Output connection: the OkLCh chroma.
575
+ */
576
+ readonly c: FlowGraphDataConnection<number>;
577
+ /**
578
+ * Output connection: the OkLCh hue, in radians.
579
+ */
580
+ readonly h: FlowGraphDataConnection<number>;
581
+ constructor(config?: IFlowGraphBlockConfiguration);
582
+ _updateOutputs(context: FlowGraphContext): void;
583
+ getClassName(): string;
584
+ }
585
+ /**
586
+ * Block that converts an OkLCh color (l, c, h) to linear sRGB (r, g, b). Hue is in radians.
587
+ */
588
+ export declare class FlowGraphRGBFromOkLChBlock extends FlowGraphBlock {
589
+ /**
590
+ * Input connection: the OkLCh lightness.
591
+ */
592
+ readonly l: FlowGraphDataConnection<number>;
593
+ /**
594
+ * Input connection: the OkLCh chroma.
595
+ */
596
+ readonly c: FlowGraphDataConnection<number>;
597
+ /**
598
+ * Input connection: the OkLCh hue, in radians.
599
+ */
600
+ readonly h: FlowGraphDataConnection<number>;
601
+ /**
602
+ * Output connection: the linear red component.
603
+ */
604
+ readonly r: FlowGraphDataConnection<number>;
605
+ /**
606
+ * Output connection: the linear green component.
607
+ */
608
+ readonly g: FlowGraphDataConnection<number>;
609
+ /**
610
+ * Output connection: the linear blue component.
611
+ */
612
+ readonly b: FlowGraphDataConnection<number>;
613
+ constructor(config?: IFlowGraphBlockConfiguration);
614
+ _updateOutputs(context: FlowGraphContext): void;
615
+ getClassName(): string;
616
+ }
523
617
  /**
524
618
  * Register side effects for flowGraphMathBlocks.
525
619
  * Safe to call multiple times; only the first call has an effect.
@@ -1,4 +1,5 @@
1
1
  /** This file must only contain pure code and pure imports */
2
+ import { FlowGraphBlock } from "../../../flowGraphBlock.js";
2
3
  import { getRichTypeByFlowGraphType, RichTypeAny, RichTypeBoolean, RichTypeFlowGraphInteger, RichTypeNumber } from "../../../flowGraphRichTypes.pure.js";
3
4
  import { FlowGraphBinaryOperationBlock } from "../flowGraphBinaryOperationBlock.js";
4
5
  import { FlowGraphConstantOperationBlock } from "../flowGraphConstantOperationBlock.js";
@@ -246,6 +247,14 @@ export class FlowGraphPiBlock extends FlowGraphConstantOperationBlock {
246
247
  super(RichTypeNumber, () => Math.PI, "FlowGraphPIBlock" /* FlowGraphBlockNames.PI */, config);
247
248
  }
248
249
  }
250
+ /**
251
+ * Tau constant (2 * Pi), the ratio of a circle's circumference to its radius.
252
+ */
253
+ export class FlowGraphTauBlock extends FlowGraphConstantOperationBlock {
254
+ constructor(config) {
255
+ super(RichTypeNumber, () => 2 * Math.PI, "FlowGraphTauBlock" /* FlowGraphBlockNames.Tau */, config);
256
+ }
257
+ }
249
258
  /**
250
259
  * Positive inf constant.
251
260
  */
@@ -525,6 +534,25 @@ export class FlowGraphSaturateBlock extends FlowGraphUnaryOperationBlock {
525
534
  function Interpolate(a, b, c) {
526
535
  return (1 - c) * a + c * b;
527
536
  }
537
+ /**
538
+ * Smooth step (Hermite interpolation) coefficient.
539
+ * Given the edges `a`/`b` and the value `c`, computes the smooth interpolation
540
+ * coefficient `t * t * (3 - 2 * t)` where `t = saturate((c - min(a, b)) / |b - a|)`.
541
+ * Note that this returns the coefficient in [0, 1]; it does not interpolate between `a` and `b`.
542
+ * @param a first edge
543
+ * @param b second edge
544
+ * @param c value to interpolate
545
+ * @returns the smooth-step interpolation coefficient
546
+ */
547
+ function SmoothStep(a, b, c) {
548
+ // Degenerate edges: with a === b the transition is instantaneous, so return a step rather than
549
+ // dividing by zero (which would yield NaN and poison downstream math).
550
+ if (a === b) {
551
+ return c < a ? 0 : 1;
552
+ }
553
+ const t = Saturate((c - Math.min(a, b)) / Math.abs(b - a));
554
+ return t * t * (3 - 2 * t);
555
+ }
528
556
  /**
529
557
  * Interpolate block.
530
558
  */
@@ -536,6 +564,34 @@ export class FlowGraphMathInterpolationBlock extends FlowGraphTernaryOperationBl
536
564
  return ComponentWiseTernaryOperation(a, b, c, Interpolate);
537
565
  }
538
566
  }
567
+ /**
568
+ * Spherical linear interpolation between two unit quaternions, matching the
569
+ * quaternion slerp operation. The two inputs are treated as
570
+ * Babylon `Quaternion` values regardless of their concrete class (the spec
571
+ * defines them as `float4`), and the output is a `Quaternion`.
572
+ *
573
+ * The underlying implementation is `Quaternion.Slerp`, whose algorithm matches
574
+ * the spec step-for-step (dot product, conditional sign-flip on `b`, sin-based
575
+ * weighting, and a near-identity short-circuit to a linear blend).
576
+ */
577
+ export class FlowGraphMathSlerpBlock extends FlowGraphTernaryOperationBlock {
578
+ constructor(config) {
579
+ super(RichTypeAny, RichTypeAny, RichTypeNumber, RichTypeAny, (a, b, c) => Quaternion.Slerp(a, b, c), "FlowGraphMathSlerpBlock" /* FlowGraphBlockNames.MathSlerp */, config);
580
+ }
581
+ }
582
+ /**
583
+ * Smooth-step block, returning the Hermite interpolation coefficient.
584
+ * Operates component-wise over floatN inputs (the two edges `a`/`b` and the
585
+ * value `c`).
586
+ */
587
+ export class FlowGraphMathSmoothStepBlock extends FlowGraphTernaryOperationBlock {
588
+ constructor(config) {
589
+ super(RichTypeAny, RichTypeAny, RichTypeAny, RichTypeAny, (a, b, c) => this._polymorphicSmoothStep(a, b, c), "FlowGraphSmoothStepBlock" /* FlowGraphBlockNames.SmoothStep */, config);
590
+ }
591
+ _polymorphicSmoothStep(a, b, c) {
592
+ return ComponentWiseTernaryOperation(a, b, c, SmoothStep);
593
+ }
594
+ }
539
595
  /**
540
596
  * Equals block.
541
597
  */
@@ -546,15 +602,24 @@ export class FlowGraphEqualityBlock extends FlowGraphBinaryOperationBlock {
546
602
  _polymorphicEq(a, b) {
547
603
  const aClassName = _GetClassNameOf(a);
548
604
  const bClassName = _GetClassNameOf(b);
549
- if (typeof a !== typeof b) {
550
- return false;
605
+ // A rotation may arrive either as a Quaternion or as a four-component vector, so treat Quaternion and
606
+ // Vector4 (both four-component) as comparable so that, for example, a decomposed rotation can be compared
607
+ // against a float4 literal.
608
+ const isFourComponent = (className) => className === "Vector4" /* FlowGraphTypes.Vector4 */ || className === "Quaternion" /* FlowGraphTypes.Quaternion */;
609
+ if (isFourComponent(aClassName) && isFourComponent(bClassName)) {
610
+ return a.equals(b);
551
611
  }
552
612
  if (_AreSameVectorOrQuaternionClass(aClassName, bClassName) || _AreSameMatrixClass(aClassName, bClassName) || _AreSameIntegerClass(aClassName, bClassName)) {
553
613
  return a.equals(b);
554
614
  }
555
- else {
556
- return a === b;
615
+ // Handle mixed number/FlowGraphInteger comparison
616
+ if (isNumeric(a) && isNumeric(b)) {
617
+ return getNumericValue(a) === getNumericValue(b);
618
+ }
619
+ if (typeof a !== typeof b) {
620
+ return false;
557
621
  }
622
+ return a === b;
558
623
  }
559
624
  }
560
625
  function ComparisonOperators(a, b, op) {
@@ -1029,6 +1094,101 @@ export class FlowGraphOneBitsCounterBlock extends FlowGraphUnaryOperationBlock {
1029
1094
  super(RichTypeFlowGraphInteger, RichTypeFlowGraphInteger, (a) => new FlowGraphInteger(CountOnes(a.value)), "FlowGraphOneBitsCounterBlock" /* FlowGraphBlockNames.OneBitsCounter */, config);
1030
1095
  }
1031
1096
  }
1097
+ /**
1098
+ * Converts a linear sRGB color to OkLCh (the polar form of the Oklab color space).
1099
+ * Uses Ottosson's original single-precision matrices.
1100
+ * The RGB inputs are treated as linear; hue is returned in radians.
1101
+ * @param r linear red component
1102
+ * @param g linear green component
1103
+ * @param b linear blue component
1104
+ * @returns the OkLCh lightness (l), chroma (c) and hue (h, radians)
1105
+ */
1106
+ function RgbToOkLch(r, g, b) {
1107
+ // Linear sRGB -> LMS cone responses.
1108
+ const long = 0.4122214708 * r + 0.5363325363 * g + 0.0514459929 * b;
1109
+ const medium = 0.2119034982 * r + 0.6806995451 * g + 0.1073969566 * b;
1110
+ const short = 0.0883024619 * r + 0.2817188376 * g + 0.6299787005 * b;
1111
+ // Non-linearity (cube root) then LMS' -> Oklab.
1112
+ const lRoot = Math.cbrt(long);
1113
+ const mRoot = Math.cbrt(medium);
1114
+ const sRoot = Math.cbrt(short);
1115
+ const okL = 0.2104542553 * lRoot + 0.793617785 * mRoot - 0.0040720468 * sRoot;
1116
+ const okA = 1.9779984951 * lRoot - 2.428592205 * mRoot + 0.4505937099 * sRoot;
1117
+ const okB = 0.0259040371 * lRoot + 0.7827717662 * mRoot - 0.808675766 * sRoot;
1118
+ // Oklab -> OkLCh (polar form).
1119
+ return { l: okL, c: Math.hypot(okA, okB), h: Math.atan2(okB, okA) };
1120
+ }
1121
+ /**
1122
+ * Converts an OkLCh color to linear sRGB. Inverse of {@link RgbToOkLch}; hue is in radians.
1123
+ * @param l OkLCh lightness
1124
+ * @param c OkLCh chroma
1125
+ * @param h OkLCh hue in radians
1126
+ * @returns the linear sRGB red (r), green (g) and blue (b) components
1127
+ */
1128
+ function OkLchToRgb(l, c, h) {
1129
+ // OkLCh -> Oklab.
1130
+ const okA = c * Math.cos(h);
1131
+ const okB = c * Math.sin(h);
1132
+ // Oklab -> LMS' then cube to LMS.
1133
+ const lPrime = l + 0.3963377774 * okA + 0.2158037573 * okB;
1134
+ const mPrime = l - 0.1055613458 * okA - 0.0638541728 * okB;
1135
+ const sPrime = l - 0.0894841775 * okA - 1.291485548 * okB;
1136
+ const long = lPrime * lPrime * lPrime;
1137
+ const medium = mPrime * mPrime * mPrime;
1138
+ const short = sPrime * sPrime * sPrime;
1139
+ // LMS -> linear sRGB.
1140
+ return {
1141
+ r: 4.0767416621 * long - 3.3077115913 * medium + 0.2309699292 * short,
1142
+ g: -1.2684380046 * long + 2.6097574011 * medium - 0.3413193965 * short,
1143
+ b: -0.0041960863 * long - 0.7034186147 * medium + 1.707614701 * short,
1144
+ };
1145
+ }
1146
+ /**
1147
+ * Block that converts a linear sRGB color (r, g, b) to OkLCh (l, c, h). Hue is in radians.
1148
+ */
1149
+ export class FlowGraphRGBToOkLChBlock extends FlowGraphBlock {
1150
+ constructor(config) {
1151
+ super(config);
1152
+ this.r = this.registerDataInput("r", RichTypeNumber, 0);
1153
+ this.g = this.registerDataInput("g", RichTypeNumber, 0);
1154
+ this.b = this.registerDataInput("b", RichTypeNumber, 0);
1155
+ this.l = this.registerDataOutput("l", RichTypeNumber, 0);
1156
+ this.c = this.registerDataOutput("c", RichTypeNumber, 0);
1157
+ this.h = this.registerDataOutput("h", RichTypeNumber, 0);
1158
+ }
1159
+ _updateOutputs(context) {
1160
+ const { l, c, h } = RgbToOkLch(this.r.getValue(context), this.g.getValue(context), this.b.getValue(context));
1161
+ this.l.setValue(l, context);
1162
+ this.c.setValue(c, context);
1163
+ this.h.setValue(h, context);
1164
+ }
1165
+ getClassName() {
1166
+ return "FlowGraphRGBToOkLChBlock" /* FlowGraphBlockNames.RGBToOkLCh */;
1167
+ }
1168
+ }
1169
+ /**
1170
+ * Block that converts an OkLCh color (l, c, h) to linear sRGB (r, g, b). Hue is in radians.
1171
+ */
1172
+ export class FlowGraphRGBFromOkLChBlock extends FlowGraphBlock {
1173
+ constructor(config) {
1174
+ super(config);
1175
+ this.l = this.registerDataInput("l", RichTypeNumber, 0);
1176
+ this.c = this.registerDataInput("c", RichTypeNumber, 0);
1177
+ this.h = this.registerDataInput("h", RichTypeNumber, 0);
1178
+ this.r = this.registerDataOutput("r", RichTypeNumber, 0);
1179
+ this.g = this.registerDataOutput("g", RichTypeNumber, 0);
1180
+ this.b = this.registerDataOutput("b", RichTypeNumber, 0);
1181
+ }
1182
+ _updateOutputs(context) {
1183
+ const { r, g, b } = OkLchToRgb(this.l.getValue(context), this.c.getValue(context), this.h.getValue(context));
1184
+ this.r.setValue(r, context);
1185
+ this.g.setValue(g, context);
1186
+ this.b.setValue(b, context);
1187
+ }
1188
+ getClassName() {
1189
+ return "FlowGraphRGBFromOkLChBlock" /* FlowGraphBlockNames.RGBFromOkLCh */;
1190
+ }
1191
+ }
1032
1192
  let _Registered = false;
1033
1193
  /**
1034
1194
  * Register side effects for flowGraphMathBlocks.
@@ -1046,6 +1206,7 @@ export function RegisterFlowGraphMathBlocks() {
1046
1206
  RegisterClass("FlowGraphRandomBlock" /* FlowGraphBlockNames.Random */, FlowGraphRandomBlock);
1047
1207
  RegisterClass("FlowGraphEBlock" /* FlowGraphBlockNames.E */, FlowGraphEBlock);
1048
1208
  RegisterClass("FlowGraphPIBlock" /* FlowGraphBlockNames.PI */, FlowGraphPiBlock);
1209
+ RegisterClass("FlowGraphTauBlock" /* FlowGraphBlockNames.Tau */, FlowGraphTauBlock);
1049
1210
  RegisterClass("FlowGraphInfBlock" /* FlowGraphBlockNames.Inf */, FlowGraphInfBlock);
1050
1211
  RegisterClass("FlowGraphNaNBlock" /* FlowGraphBlockNames.NaN */, FlowGraphNaNBlock);
1051
1212
  RegisterClass("FlowGraphAbsBlock" /* FlowGraphBlockNames.Abs */, FlowGraphAbsBlock);
@@ -1062,6 +1223,10 @@ export function RegisterFlowGraphMathBlocks() {
1062
1223
  RegisterClass("FlowGraphClampBlock" /* FlowGraphBlockNames.Clamp */, FlowGraphClampBlock);
1063
1224
  RegisterClass("FlowGraphSaturateBlock" /* FlowGraphBlockNames.Saturate */, FlowGraphSaturateBlock);
1064
1225
  RegisterClass("FlowGraphMathInterpolationBlock" /* FlowGraphBlockNames.MathInterpolation */, FlowGraphMathInterpolationBlock);
1226
+ RegisterClass("FlowGraphMathSlerpBlock" /* FlowGraphBlockNames.MathSlerp */, FlowGraphMathSlerpBlock);
1227
+ RegisterClass("FlowGraphSmoothStepBlock" /* FlowGraphBlockNames.SmoothStep */, FlowGraphMathSmoothStepBlock);
1228
+ RegisterClass("FlowGraphRGBToOkLChBlock" /* FlowGraphBlockNames.RGBToOkLCh */, FlowGraphRGBToOkLChBlock);
1229
+ RegisterClass("FlowGraphRGBFromOkLChBlock" /* FlowGraphBlockNames.RGBFromOkLCh */, FlowGraphRGBFromOkLChBlock);
1065
1230
  RegisterClass("FlowGraphEqualityBlock" /* FlowGraphBlockNames.Equality */, FlowGraphEqualityBlock);
1066
1231
  RegisterClass("FlowGraphLessThanBlock" /* FlowGraphBlockNames.LessThan */, FlowGraphLessThanBlock);
1067
1232
  RegisterClass("FlowGraphLessThanOrEqualBlock" /* FlowGraphBlockNames.LessThanOrEqual */, FlowGraphLessThanOrEqualBlock);