@babylonjs/core 7.3.0 → 7.3.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.
Files changed (454) hide show
  1. package/Actions/condition.js.map +1 -1
  2. package/Actions/directActions.js.map +1 -1
  3. package/Actions/directAudioActions.js.map +1 -1
  4. package/Actions/interpolateValueAction.js.map +1 -1
  5. package/Animations/easing.js.map +1 -1
  6. package/Behaviors/Meshes/sixDofDragBehavior.js.map +1 -1
  7. package/Bones/bone.js.map +1 -1
  8. package/Cameras/Inputs/arcRotateCameraPointersInput.js.map +1 -1
  9. package/Cameras/Inputs/followCameraPointersInput.js.map +1 -1
  10. package/Cameras/Inputs/freeCameraMouseWheelInput.js.map +1 -1
  11. package/Cameras/Stereoscopic/anaglyphArcRotateCamera.js.map +1 -1
  12. package/Cameras/Stereoscopic/anaglyphFreeCamera.js.map +1 -1
  13. package/Cameras/Stereoscopic/anaglyphGamepadCamera.js.map +1 -1
  14. package/Cameras/Stereoscopic/anaglyphUniversalCamera.js.map +1 -1
  15. package/Cameras/Stereoscopic/stereoscopicArcRotateCamera.js.map +1 -1
  16. package/Cameras/Stereoscopic/stereoscopicFreeCamera.js.map +1 -1
  17. package/Cameras/Stereoscopic/stereoscopicGamepadCamera.js.map +1 -1
  18. package/Cameras/Stereoscopic/stereoscopicScreenUniversalCamera.js.map +1 -1
  19. package/Cameras/Stereoscopic/stereoscopicUniversalCamera.js.map +1 -1
  20. package/Cameras/VR/vrDeviceOrientationArcRotateCamera.js.map +1 -1
  21. package/Cameras/VR/vrDeviceOrientationFreeCamera.js.map +1 -1
  22. package/Cameras/VR/vrDeviceOrientationGamepadCamera.js.map +1 -1
  23. package/Cameras/VR/vrExperienceHelper.js.map +1 -1
  24. package/Cameras/arcRotateCamera.js.map +1 -1
  25. package/Cameras/camera.js.map +1 -1
  26. package/Cameras/deviceOrientationCamera.js.map +1 -1
  27. package/Cameras/flyCamera.js.map +1 -1
  28. package/Cameras/followCamera.js.map +1 -1
  29. package/Cameras/freeCamera.js.map +1 -1
  30. package/Cameras/freeCameraInputsManager.js.map +1 -1
  31. package/Cameras/gamepadCamera.js.map +1 -1
  32. package/Cameras/targetCamera.js.map +1 -1
  33. package/Cameras/touchCamera.js.map +1 -1
  34. package/Cameras/universalCamera.js.map +1 -1
  35. package/Cameras/virtualJoysticksCamera.js.map +1 -1
  36. package/Debug/boneAxesViewer.js.map +1 -1
  37. package/Engines/Native/nativeRenderTargetWrapper.js.map +1 -1
  38. package/Engines/Processors/Expressions/Operators/shaderDefineAndOperator.js.map +1 -1
  39. package/Engines/Processors/Expressions/Operators/shaderDefineArithmeticOperator.js.map +1 -1
  40. package/Engines/Processors/Expressions/Operators/shaderDefineIsDefinedOperator.js.map +1 -1
  41. package/Engines/Processors/Expressions/Operators/shaderDefineOrOperator.js.map +1 -1
  42. package/Engines/Processors/shaderCodeConditionNode.js.map +1 -1
  43. package/Engines/Processors/shaderCodeTestNode.js.map +1 -1
  44. package/Engines/WebGL/webGLRenderTargetWrapper.js.map +1 -1
  45. package/Engines/WebGPU/Extensions/engine.rawTexture.js +10 -10
  46. package/Engines/WebGPU/Extensions/engine.rawTexture.js.map +1 -1
  47. package/Engines/WebGPU/webgpuCacheRenderPipelineTree.js.map +1 -1
  48. package/Engines/WebGPU/webgpuDepthCullingState.js.map +1 -1
  49. package/Engines/WebGPU/webgpuHardwareTexture.d.ts +2 -0
  50. package/Engines/WebGPU/webgpuHardwareTexture.js +2 -0
  51. package/Engines/WebGPU/webgpuHardwareTexture.js.map +1 -1
  52. package/Engines/WebGPU/webgpuShaderProcessorsGLSL.js.map +1 -1
  53. package/Engines/WebGPU/webgpuShaderProcessorsWGSL.js.map +1 -1
  54. package/Engines/WebGPU/webgpuStencilStateComposer.js.map +1 -1
  55. package/Engines/abstractEngine.js +14 -2
  56. package/Engines/abstractEngine.js.map +1 -1
  57. package/Engines/engine.d.ts +0 -8
  58. package/Engines/engine.js +0 -28
  59. package/Engines/engine.js.map +1 -1
  60. package/Engines/nativeEngine.js.map +1 -1
  61. package/Engines/nullEngine.js.map +1 -1
  62. package/Engines/thinEngine.js.map +1 -1
  63. package/Engines/webgpuEngine.d.ts +4 -0
  64. package/Engines/webgpuEngine.js +4 -0
  65. package/Engines/webgpuEngine.js.map +1 -1
  66. package/Events/keyboardEvents.js.map +1 -1
  67. package/FlowGraph/Blocks/Data/flowGraphBinaryOperationBlock.js.map +1 -1
  68. package/FlowGraph/Blocks/Data/flowGraphCachedOperationBlock.js.map +1 -1
  69. package/FlowGraph/Blocks/Data/flowGraphConditionalDataBlock.js.map +1 -1
  70. package/FlowGraph/Blocks/Data/flowGraphConstantBlock.js.map +1 -1
  71. package/FlowGraph/Blocks/Data/flowGraphConstantOperationBlock.js.map +1 -1
  72. package/FlowGraph/Blocks/Data/flowGraphCoordinateTransformBlock.js.map +1 -1
  73. package/FlowGraph/Blocks/Data/flowGraphGetPropertyBlock.js.map +1 -1
  74. package/FlowGraph/Blocks/Data/flowGraphGetVariableBlock.js.map +1 -1
  75. package/FlowGraph/Blocks/Data/flowGraphTernaryOperationBlock.js.map +1 -1
  76. package/FlowGraph/Blocks/Data/flowGraphUnaryOperationBlock.js.map +1 -1
  77. package/FlowGraph/Blocks/Event/flowGraphMeshPickEventBlock.js.map +1 -1
  78. package/FlowGraph/Blocks/Event/flowGraphReceiveCustomEventBlock.js.map +1 -1
  79. package/FlowGraph/Blocks/Event/flowGraphSceneReadyEventBlock.js.map +1 -1
  80. package/FlowGraph/Blocks/Event/flowGraphSceneTickEventBlock.js.map +1 -1
  81. package/FlowGraph/Blocks/Execution/Animation/flowGraphPauseAnimationBlock.js.map +1 -1
  82. package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.js.map +1 -1
  83. package/FlowGraph/Blocks/Execution/Animation/flowGraphStopAnimationBlock.js.map +1 -1
  84. package/FlowGraph/Blocks/Execution/Audio/flowGraphPlayAudioBlock.js.map +1 -1
  85. package/FlowGraph/Blocks/Execution/Audio/flowGraphStopAudioBlock.js.map +1 -1
  86. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphBranchBlock.js.map +1 -1
  87. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCounterBlock.js.map +1 -1
  88. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDebounceBlock.js.map +1 -1
  89. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDoNBlock.js.map +1 -1
  90. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphFlipFlopBlock.js.map +1 -1
  91. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphForLoopBlock.js.map +1 -1
  92. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphMultiGateBlock.js.map +1 -1
  93. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSequenceBlock.js.map +1 -1
  94. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSwitchBlock.js.map +1 -1
  95. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphThrottleBlock.js.map +1 -1
  96. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphTimerBlock.js.map +1 -1
  97. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWaitAllBlock.js.map +1 -1
  98. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWhileLoopBlock.js.map +1 -1
  99. package/FlowGraph/Blocks/Execution/flowGraphConsoleLogBlock.js.map +1 -1
  100. package/FlowGraph/Blocks/Execution/flowGraphSendCustomEventBlock.js.map +1 -1
  101. package/FlowGraph/Blocks/Execution/flowGraphSetPropertyBlock.js.map +1 -1
  102. package/FlowGraph/Blocks/Execution/flowGraphSetVariableBlock.js.map +1 -1
  103. package/FlowGraph/flowGraphDataConnection.js.map +1 -1
  104. package/FlowGraph/flowGraphExecutionBlock.js.map +1 -1
  105. package/FlowGraph/flowGraphSignalConnection.js.map +1 -1
  106. package/Gamepads/dualShockGamepad.js.map +1 -1
  107. package/Gamepads/gamepad.js.map +1 -1
  108. package/Gamepads/xboxGamepad.js.map +1 -1
  109. package/Gizmos/axisDragGizmo.js.map +1 -1
  110. package/Gizmos/axisScaleGizmo.js.map +1 -1
  111. package/Gizmos/boundingBoxGizmo.js.map +1 -1
  112. package/Gizmos/cameraGizmo.js.map +1 -1
  113. package/Gizmos/lightGizmo.js.map +1 -1
  114. package/Gizmos/planeDragGizmo.js.map +1 -1
  115. package/Gizmos/planeRotationGizmo.js.map +1 -1
  116. package/Gizmos/positionGizmo.js.map +1 -1
  117. package/Gizmos/rotationGizmo.js.map +1 -1
  118. package/Gizmos/scaleGizmo.js.map +1 -1
  119. package/Helpers/photoDome.js.map +1 -1
  120. package/Helpers/textureDome.js.map +1 -1
  121. package/Helpers/videoDome.js.map +1 -1
  122. package/Layers/glowLayer.js.map +1 -1
  123. package/Layers/highlightLayer.js.map +1 -1
  124. package/Lights/Shadows/cascadedShadowGenerator.js.map +1 -1
  125. package/Lights/directionalLight.js.map +1 -1
  126. package/Lights/hemisphericLight.js.map +1 -1
  127. package/Lights/light.js.map +1 -1
  128. package/Lights/pointLight.js.map +1 -1
  129. package/Lights/shadowLight.js.map +1 -1
  130. package/Lights/spotLight.js.map +1 -1
  131. package/Materials/Background/backgroundMaterial.js.map +1 -1
  132. package/Materials/GaussianSplatting/gaussianSplattingMaterial.js.map +1 -1
  133. package/Materials/GreasedLine/greasedLinePluginMaterial.js.map +1 -1
  134. package/Materials/GreasedLine/greasedLineSimpleMaterial.js.map +1 -1
  135. package/Materials/Node/Blocks/Dual/clipPlanesBlock.js.map +1 -1
  136. package/Materials/Node/Blocks/Dual/currentScreenBlock.js.map +1 -1
  137. package/Materials/Node/Blocks/Dual/fogBlock.js.map +1 -1
  138. package/Materials/Node/Blocks/Dual/imageSourceBlock.js.map +1 -1
  139. package/Materials/Node/Blocks/Dual/lightBlock.js.map +1 -1
  140. package/Materials/Node/Blocks/Dual/reflectionTextureBaseBlock.js.map +1 -1
  141. package/Materials/Node/Blocks/Dual/reflectionTextureBlock.js.map +1 -1
  142. package/Materials/Node/Blocks/Dual/sceneDepthBlock.js.map +1 -1
  143. package/Materials/Node/Blocks/Dual/textureBlock.js.map +1 -1
  144. package/Materials/Node/Blocks/Fragment/TBNBlock.js.map +1 -1
  145. package/Materials/Node/Blocks/Fragment/derivativeBlock.js.map +1 -1
  146. package/Materials/Node/Blocks/Fragment/discardBlock.js.map +1 -1
  147. package/Materials/Node/Blocks/Fragment/fragCoordBlock.js.map +1 -1
  148. package/Materials/Node/Blocks/Fragment/fragDepthBlock.js.map +1 -1
  149. package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.js.map +1 -1
  150. package/Materials/Node/Blocks/Fragment/frontFacingBlock.js.map +1 -1
  151. package/Materials/Node/Blocks/Fragment/heightToNormalBlock.js.map +1 -1
  152. package/Materials/Node/Blocks/Fragment/imageProcessingBlock.js.map +1 -1
  153. package/Materials/Node/Blocks/Fragment/perturbNormalBlock.js.map +1 -1
  154. package/Materials/Node/Blocks/Fragment/prePassOutputBlock.js.map +1 -1
  155. package/Materials/Node/Blocks/Fragment/screenSizeBlock.js.map +1 -1
  156. package/Materials/Node/Blocks/Fragment/screenSpaceBlock.js.map +1 -1
  157. package/Materials/Node/Blocks/Fragment/shadowMapBlock.js.map +1 -1
  158. package/Materials/Node/Blocks/Fragment/twirlBlock.js.map +1 -1
  159. package/Materials/Node/Blocks/Input/inputBlock.js.map +1 -1
  160. package/Materials/Node/Blocks/Input/prePassTextureBlock.js.map +1 -1
  161. package/Materials/Node/Blocks/PBR/anisotropyBlock.js.map +1 -1
  162. package/Materials/Node/Blocks/PBR/clearCoatBlock.js.map +1 -1
  163. package/Materials/Node/Blocks/PBR/iridescenceBlock.js.map +1 -1
  164. package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.js.map +1 -1
  165. package/Materials/Node/Blocks/PBR/reflectionBlock.js.map +1 -1
  166. package/Materials/Node/Blocks/PBR/refractionBlock.js.map +1 -1
  167. package/Materials/Node/Blocks/PBR/sheenBlock.js.map +1 -1
  168. package/Materials/Node/Blocks/PBR/subSurfaceBlock.js.map +1 -1
  169. package/Materials/Node/Blocks/Particle/particleBlendMultiplyBlock.js.map +1 -1
  170. package/Materials/Node/Blocks/Particle/particleRampGradientBlock.js.map +1 -1
  171. package/Materials/Node/Blocks/Particle/particleTextureBlock.js.map +1 -1
  172. package/Materials/Node/Blocks/Teleport/teleportInBlock.js.map +1 -1
  173. package/Materials/Node/Blocks/Teleport/teleportOutBlock.js.map +1 -1
  174. package/Materials/Node/Blocks/Vertex/bonesBlock.js.map +1 -1
  175. package/Materials/Node/Blocks/Vertex/instancesBlock.js.map +1 -1
  176. package/Materials/Node/Blocks/Vertex/lightInformationBlock.js.map +1 -1
  177. package/Materials/Node/Blocks/Vertex/morphTargetsBlock.js.map +1 -1
  178. package/Materials/Node/Blocks/Vertex/vertexOutputBlock.js.map +1 -1
  179. package/Materials/Node/Blocks/addBlock.js.map +1 -1
  180. package/Materials/Node/Blocks/arcTan2Block.js.map +1 -1
  181. package/Materials/Node/Blocks/biPlanarBlock.js.map +1 -1
  182. package/Materials/Node/Blocks/clampBlock.js.map +1 -1
  183. package/Materials/Node/Blocks/cloudBlock.js.map +1 -1
  184. package/Materials/Node/Blocks/colorMergerBlock.js.map +1 -1
  185. package/Materials/Node/Blocks/colorSplitterBlock.js.map +1 -1
  186. package/Materials/Node/Blocks/conditionalBlock.js.map +1 -1
  187. package/Materials/Node/Blocks/crossBlock.js.map +1 -1
  188. package/Materials/Node/Blocks/curveBlock.js.map +1 -1
  189. package/Materials/Node/Blocks/customBlock.js.map +1 -1
  190. package/Materials/Node/Blocks/desaturateBlock.js.map +1 -1
  191. package/Materials/Node/Blocks/distanceBlock.js.map +1 -1
  192. package/Materials/Node/Blocks/divideBlock.js.map +1 -1
  193. package/Materials/Node/Blocks/dotBlock.js.map +1 -1
  194. package/Materials/Node/Blocks/elbowBlock.js.map +1 -1
  195. package/Materials/Node/Blocks/fresnelBlock.js.map +1 -1
  196. package/Materials/Node/Blocks/gradientBlock.js.map +1 -1
  197. package/Materials/Node/Blocks/lengthBlock.js.map +1 -1
  198. package/Materials/Node/Blocks/lerpBlock.js.map +1 -1
  199. package/Materials/Node/Blocks/matrixBuilderBlock.js.map +1 -1
  200. package/Materials/Node/Blocks/matrixDeterminantBlock.js.map +1 -1
  201. package/Materials/Node/Blocks/matrixTransposeBlock.js.map +1 -1
  202. package/Materials/Node/Blocks/maxBlock.js.map +1 -1
  203. package/Materials/Node/Blocks/meshAttributeExistsBlock.js.map +1 -1
  204. package/Materials/Node/Blocks/minBlock.js.map +1 -1
  205. package/Materials/Node/Blocks/modBlock.js.map +1 -1
  206. package/Materials/Node/Blocks/multiplyBlock.js.map +1 -1
  207. package/Materials/Node/Blocks/nLerpBlock.js.map +1 -1
  208. package/Materials/Node/Blocks/negateBlock.js.map +1 -1
  209. package/Materials/Node/Blocks/normalBlendBlock.js.map +1 -1
  210. package/Materials/Node/Blocks/normalizeBlock.js.map +1 -1
  211. package/Materials/Node/Blocks/oneMinusBlock.js.map +1 -1
  212. package/Materials/Node/Blocks/posterizeBlock.js.map +1 -1
  213. package/Materials/Node/Blocks/powBlock.js.map +1 -1
  214. package/Materials/Node/Blocks/randomNumberBlock.js.map +1 -1
  215. package/Materials/Node/Blocks/reciprocalBlock.js.map +1 -1
  216. package/Materials/Node/Blocks/reflectBlock.js.map +1 -1
  217. package/Materials/Node/Blocks/refractBlock.js.map +1 -1
  218. package/Materials/Node/Blocks/remapBlock.js.map +1 -1
  219. package/Materials/Node/Blocks/replaceColorBlock.js.map +1 -1
  220. package/Materials/Node/Blocks/rotate2dBlock.js.map +1 -1
  221. package/Materials/Node/Blocks/scaleBlock.js.map +1 -1
  222. package/Materials/Node/Blocks/simplexPerlin3DBlock.js.map +1 -1
  223. package/Materials/Node/Blocks/smoothStepBlock.js.map +1 -1
  224. package/Materials/Node/Blocks/stepBlock.js.map +1 -1
  225. package/Materials/Node/Blocks/subtractBlock.js.map +1 -1
  226. package/Materials/Node/Blocks/transformBlock.js.map +1 -1
  227. package/Materials/Node/Blocks/triPlanarBlock.js.map +1 -1
  228. package/Materials/Node/Blocks/trigonometryBlock.js.map +1 -1
  229. package/Materials/Node/Blocks/vectorMergerBlock.js.map +1 -1
  230. package/Materials/Node/Blocks/vectorSplitterBlock.js.map +1 -1
  231. package/Materials/Node/Blocks/viewDirectionBlock.js.map +1 -1
  232. package/Materials/Node/Blocks/voronoiNoiseBlock.js.map +1 -1
  233. package/Materials/Node/Blocks/waveBlock.js.map +1 -1
  234. package/Materials/Node/Blocks/worleyNoise3DBlock.js.map +1 -1
  235. package/Materials/Node/nodeMaterial.js.map +1 -1
  236. package/Materials/Node/nodeMaterialConnectionPointCustomObject.js.map +1 -1
  237. package/Materials/PBR/pbrAnisotropicConfiguration.js.map +1 -1
  238. package/Materials/PBR/pbrBRDFConfiguration.js.map +1 -1
  239. package/Materials/PBR/pbrBaseMaterial.js.map +1 -1
  240. package/Materials/PBR/pbrBaseSimpleMaterial.js.map +1 -1
  241. package/Materials/PBR/pbrClearCoatConfiguration.js.map +1 -1
  242. package/Materials/PBR/pbrIridescenceConfiguration.js.map +1 -1
  243. package/Materials/PBR/pbrMaterial.js.map +1 -1
  244. package/Materials/PBR/pbrMetallicRoughnessMaterial.js.map +1 -1
  245. package/Materials/PBR/pbrSheenConfiguration.js.map +1 -1
  246. package/Materials/PBR/pbrSpecularGlossinessMaterial.js.map +1 -1
  247. package/Materials/PBR/pbrSubSurfaceConfiguration.js.map +1 -1
  248. package/Materials/Textures/MultiviewRenderTarget.js.map +1 -1
  249. package/Materials/Textures/Procedurals/customProceduralTexture.js.map +1 -1
  250. package/Materials/Textures/Procedurals/noiseProceduralTexture.js.map +1 -1
  251. package/Materials/Textures/Procedurals/proceduralTexture.js.map +1 -1
  252. package/Materials/Textures/baseTexture.js.map +1 -1
  253. package/Materials/Textures/colorGradingTexture.js.map +1 -1
  254. package/Materials/Textures/cubeTexture.js.map +1 -1
  255. package/Materials/Textures/dynamicTexture.js.map +1 -1
  256. package/Materials/Textures/equiRectangularCubeTexture.js +1 -1
  257. package/Materials/Textures/equiRectangularCubeTexture.js.map +1 -1
  258. package/Materials/Textures/hdrCubeTexture.js.map +1 -1
  259. package/Materials/Textures/htmlElementTexture.js.map +1 -1
  260. package/Materials/Textures/internalTexture.js.map +1 -1
  261. package/Materials/Textures/mirrorTexture.js.map +1 -1
  262. package/Materials/Textures/multiRenderTarget.js.map +1 -1
  263. package/Materials/Textures/prePassRenderTarget.js.map +1 -1
  264. package/Materials/Textures/rawCubeTexture.js.map +1 -1
  265. package/Materials/Textures/refractionTexture.js.map +1 -1
  266. package/Materials/Textures/renderTargetTexture.js.map +1 -1
  267. package/Materials/Textures/texture.js.map +1 -1
  268. package/Materials/Textures/thinRenderTargetTexture.js.map +1 -1
  269. package/Materials/Textures/videoTexture.js.map +1 -1
  270. package/Materials/material.decalMapConfiguration.js.map +1 -1
  271. package/Materials/material.detailMapConfiguration.js.map +1 -1
  272. package/Materials/materialHelper.d.ts +2 -2
  273. package/Materials/materialHelper.js.map +1 -1
  274. package/Materials/meshDebugPluginMaterial.js.map +1 -1
  275. package/Materials/multiMaterial.js.map +1 -1
  276. package/Materials/pushMaterial.js.map +1 -1
  277. package/Materials/shaderMaterial.js.map +1 -1
  278. package/Materials/standardMaterial.js.map +1 -1
  279. package/Meshes/GaussianSplatting/gaussianSplattingMesh.js.map +1 -1
  280. package/Meshes/GreasedLine/greasedLineBaseMesh.js.map +1 -1
  281. package/Meshes/GreasedLine/greasedLineMesh.js.map +1 -1
  282. package/Meshes/GreasedLine/greasedLineRibbonMesh.js.map +1 -1
  283. package/Meshes/Node/Blocks/Instances/instantiateBaseBlock.js.map +1 -1
  284. package/Meshes/Node/Blocks/Instances/instantiateBlock.js.map +1 -1
  285. package/Meshes/Node/Blocks/Instances/instantiateLinearBlock.js.map +1 -1
  286. package/Meshes/Node/Blocks/Instances/instantiateOnFacesBlock.js.map +1 -1
  287. package/Meshes/Node/Blocks/Instances/instantiateOnVerticesBlock.js.map +1 -1
  288. package/Meshes/Node/Blocks/Instances/instantiateOnVolumeBlock.js.map +1 -1
  289. package/Meshes/Node/Blocks/Instances/instantiateRadialBlock.js.map +1 -1
  290. package/Meshes/Node/Blocks/Matrices/alignBlock.js.map +1 -1
  291. package/Meshes/Node/Blocks/Matrices/rotationXBlock.js.map +1 -1
  292. package/Meshes/Node/Blocks/Matrices/rotationYBlock.js.map +1 -1
  293. package/Meshes/Node/Blocks/Matrices/rotationZBlock.js.map +1 -1
  294. package/Meshes/Node/Blocks/Matrices/scalingBlock.js.map +1 -1
  295. package/Meshes/Node/Blocks/Matrices/translationBlock.js.map +1 -1
  296. package/Meshes/Node/Blocks/Set/setColorsBlock.js.map +1 -1
  297. package/Meshes/Node/Blocks/Set/setMaterialIDBlock.js.map +1 -1
  298. package/Meshes/Node/Blocks/Set/setNormalsBlock.js.map +1 -1
  299. package/Meshes/Node/Blocks/Set/setPositionsBlock.js.map +1 -1
  300. package/Meshes/Node/Blocks/Set/setTangentsBlock.js.map +1 -1
  301. package/Meshes/Node/Blocks/Set/setUVsBlock.js.map +1 -1
  302. package/Meshes/Node/Blocks/Sources/boxBlock.js.map +1 -1
  303. package/Meshes/Node/Blocks/Sources/capsuleBlock.js.map +1 -1
  304. package/Meshes/Node/Blocks/Sources/cylinderBlock.js.map +1 -1
  305. package/Meshes/Node/Blocks/Sources/discBlock.js.map +1 -1
  306. package/Meshes/Node/Blocks/Sources/gridBlock.js.map +1 -1
  307. package/Meshes/Node/Blocks/Sources/icoSphereBlock.js.map +1 -1
  308. package/Meshes/Node/Blocks/Sources/meshBlock.js.map +1 -1
  309. package/Meshes/Node/Blocks/Sources/nullBlock.js.map +1 -1
  310. package/Meshes/Node/Blocks/Sources/planeBlock.js.map +1 -1
  311. package/Meshes/Node/Blocks/Sources/sphereBlock.js.map +1 -1
  312. package/Meshes/Node/Blocks/Sources/torusBlock.js.map +1 -1
  313. package/Meshes/Node/Blocks/Teleport/teleportInBlock.js.map +1 -1
  314. package/Meshes/Node/Blocks/Teleport/teleportOutBlock.js.map +1 -1
  315. package/Meshes/Node/Blocks/Textures/geometryTextureBlock.js.map +1 -1
  316. package/Meshes/Node/Blocks/Textures/geometryTextureFetchBlock.js.map +1 -1
  317. package/Meshes/Node/Blocks/booleanGeometryBlock.js.map +1 -1
  318. package/Meshes/Node/Blocks/boundingBlock.js.map +1 -1
  319. package/Meshes/Node/Blocks/computeNormalsBlock.js.map +1 -1
  320. package/Meshes/Node/Blocks/conditionBlock.js.map +1 -1
  321. package/Meshes/Node/Blocks/debugBlock.js.map +1 -1
  322. package/Meshes/Node/Blocks/geometryArcTan2Block.js.map +1 -1
  323. package/Meshes/Node/Blocks/geometryClampBlock.js.map +1 -1
  324. package/Meshes/Node/Blocks/geometryCollectionBlock.js.map +1 -1
  325. package/Meshes/Node/Blocks/geometryCrossBlock.js.map +1 -1
  326. package/Meshes/Node/Blocks/geometryCurveBlock.js.map +1 -1
  327. package/Meshes/Node/Blocks/geometryDesaturateBlock.js.map +1 -1
  328. package/Meshes/Node/Blocks/geometryDistanceBlock.js.map +1 -1
  329. package/Meshes/Node/Blocks/geometryDotBlock.js.map +1 -1
  330. package/Meshes/Node/Blocks/geometryElbowBlock.js.map +1 -1
  331. package/Meshes/Node/Blocks/geometryInfoBlock.js.map +1 -1
  332. package/Meshes/Node/Blocks/geometryInputBlock.js.map +1 -1
  333. package/Meshes/Node/Blocks/geometryLengthBlock.js.map +1 -1
  334. package/Meshes/Node/Blocks/geometryLerpBlock.js.map +1 -1
  335. package/Meshes/Node/Blocks/geometryModBlock.js.map +1 -1
  336. package/Meshes/Node/Blocks/geometryNLerpBlock.js.map +1 -1
  337. package/Meshes/Node/Blocks/geometryOptimizeBlock.js.map +1 -1
  338. package/Meshes/Node/Blocks/geometryOutputBlock.js.map +1 -1
  339. package/Meshes/Node/Blocks/geometryPosterizeBlock.js.map +1 -1
  340. package/Meshes/Node/Blocks/geometryPowBlock.js.map +1 -1
  341. package/Meshes/Node/Blocks/geometryReplaceColorBlock.js.map +1 -1
  342. package/Meshes/Node/Blocks/geometryRotate2dBlock.js.map +1 -1
  343. package/Meshes/Node/Blocks/geometrySmoothStepBlock.js.map +1 -1
  344. package/Meshes/Node/Blocks/geometryStepBlock.js.map +1 -1
  345. package/Meshes/Node/Blocks/geometryTransformBlock.js.map +1 -1
  346. package/Meshes/Node/Blocks/geometryTrigonometryBlock.js.map +1 -1
  347. package/Meshes/Node/Blocks/intFloatConverterBlock.js.map +1 -1
  348. package/Meshes/Node/Blocks/mapRangeBlock.js.map +1 -1
  349. package/Meshes/Node/Blocks/mappingBlock.js.map +1 -1
  350. package/Meshes/Node/Blocks/mathBlock.js.map +1 -1
  351. package/Meshes/Node/Blocks/matrixComposeBlock.js.map +1 -1
  352. package/Meshes/Node/Blocks/mergeGeometryBlock.js.map +1 -1
  353. package/Meshes/Node/Blocks/noiseBlock.js.map +1 -1
  354. package/Meshes/Node/Blocks/normalizeVectorBlock.js.map +1 -1
  355. package/Meshes/Node/Blocks/randomBlock.js.map +1 -1
  356. package/Meshes/Node/Blocks/vectorConverterBlock.js.map +1 -1
  357. package/Meshes/WebGL/webGLDataBuffer.js.map +1 -1
  358. package/Meshes/WebGPU/webgpuDataBuffer.js.map +1 -1
  359. package/Meshes/abstractMesh.js.map +1 -1
  360. package/Meshes/geodesicMesh.js.map +1 -1
  361. package/Meshes/goldbergMesh.js.map +1 -1
  362. package/Meshes/groundMesh.js.map +1 -1
  363. package/Meshes/instancedMesh.js.map +1 -1
  364. package/Meshes/linesMesh.js.map +1 -1
  365. package/Meshes/mesh.js.map +1 -1
  366. package/Meshes/trailMesh.js.map +1 -1
  367. package/Meshes/transformNode.js.map +1 -1
  368. package/Misc/assetsManager.js.map +1 -1
  369. package/Misc/depthReducer.js.map +1 -1
  370. package/Misc/sceneOptimizer.js.map +1 -1
  371. package/Misc/smartArray.js.map +1 -1
  372. package/Misc/workerPool.js.map +1 -1
  373. package/Particles/EmitterTypes/cylinderParticleEmitter.js.map +1 -1
  374. package/Particles/EmitterTypes/sphereParticleEmitter.js.map +1 -1
  375. package/Particles/gpuParticleSystem.js.map +1 -1
  376. package/Particles/particleSystem.js.map +1 -1
  377. package/Particles/thinParticleSystem.js.map +1 -1
  378. package/Physics/physicsRaycastResult.js.map +1 -1
  379. package/Physics/proximityCastResult.js.map +1 -1
  380. package/Physics/v1/physicsJoint.js.map +1 -1
  381. package/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.js.map +1 -1
  382. package/PostProcesses/RenderPipeline/Pipelines/lensRenderingPipeline.js.map +1 -1
  383. package/PostProcesses/RenderPipeline/Pipelines/ssao2RenderingPipeline.js.map +1 -1
  384. package/PostProcesses/RenderPipeline/Pipelines/ssaoRenderingPipeline.js.map +1 -1
  385. package/PostProcesses/RenderPipeline/Pipelines/ssrRenderingPipeline.js.map +1 -1
  386. package/PostProcesses/RenderPipeline/Pipelines/standardRenderingPipeline.js.map +1 -1
  387. package/PostProcesses/RenderPipeline/Pipelines/taaRenderingPipeline.js.map +1 -1
  388. package/PostProcesses/anaglyphPostProcess.js.map +1 -1
  389. package/PostProcesses/blackAndWhitePostProcess.js.map +1 -1
  390. package/PostProcesses/bloomMergePostProcess.js.map +1 -1
  391. package/PostProcesses/blurPostProcess.js.map +1 -1
  392. package/PostProcesses/chromaticAberrationPostProcess.js.map +1 -1
  393. package/PostProcesses/circleOfConfusionPostProcess.js.map +1 -1
  394. package/PostProcesses/colorCorrectionPostProcess.js.map +1 -1
  395. package/PostProcesses/convolutionPostProcess.js.map +1 -1
  396. package/PostProcesses/depthOfFieldBlurPostProcess.js.map +1 -1
  397. package/PostProcesses/depthOfFieldMergePostProcess.js.map +1 -1
  398. package/PostProcesses/displayPassPostProcess.js.map +1 -1
  399. package/PostProcesses/extractHighlightsPostProcess.js.map +1 -1
  400. package/PostProcesses/filterPostProcess.js.map +1 -1
  401. package/PostProcesses/fxaaPostProcess.js.map +1 -1
  402. package/PostProcesses/grainPostProcess.js.map +1 -1
  403. package/PostProcesses/highlightsPostProcess.js.map +1 -1
  404. package/PostProcesses/imageProcessingPostProcess.js.map +1 -1
  405. package/PostProcesses/motionBlurPostProcess.js.map +1 -1
  406. package/PostProcesses/passPostProcess.js.map +1 -1
  407. package/PostProcesses/refractionPostProcess.js.map +1 -1
  408. package/PostProcesses/screenSpaceCurvaturePostProcess.js.map +1 -1
  409. package/PostProcesses/screenSpaceReflectionPostProcess.js.map +1 -1
  410. package/PostProcesses/sharpenPostProcess.js.map +1 -1
  411. package/PostProcesses/stereoscopicInterlacePostProcess.js.map +1 -1
  412. package/PostProcesses/subSurfaceScatteringPostProcess.js.map +1 -1
  413. package/PostProcesses/tonemapPostProcess.js.map +1 -1
  414. package/PostProcesses/volumetricLightScatteringPostProcess.js.map +1 -1
  415. package/PostProcesses/vrDistortionCorrectionPostProcess.js.map +1 -1
  416. package/PostProcesses/vrMultiviewToSingleviewPostProcess.js.map +1 -1
  417. package/Rendering/GlobalIllumination/giRSMManager.js.map +1 -1
  418. package/Rendering/edgesRenderer.js.map +1 -1
  419. package/Rendering/fluidRenderer/fluidRenderingObjectCustomParticles.js.map +1 -1
  420. package/Rendering/fluidRenderer/fluidRenderingObjectParticleSystem.js.map +1 -1
  421. package/Rendering/reflectiveShadowMap.js.map +1 -1
  422. package/Sprites/sprite.js.map +1 -1
  423. package/Sprites/spritePackedManager.js.map +1 -1
  424. package/XR/features/Layers/WebXRCompositionLayer.js.map +1 -1
  425. package/XR/features/Layers/WebXRProjectionLayer.js.map +1 -1
  426. package/XR/features/WebXRAnchorSystem.js.map +1 -1
  427. package/XR/features/WebXRBackgroundRemover.js.map +1 -1
  428. package/XR/features/WebXRControllerMovement.js.map +1 -1
  429. package/XR/features/WebXRControllerPhysics.js.map +1 -1
  430. package/XR/features/WebXRControllerPointerSelection.js.map +1 -1
  431. package/XR/features/WebXRControllerTeleportation.js.map +1 -1
  432. package/XR/features/WebXRDOMOverlay.js.map +1 -1
  433. package/XR/features/WebXRDepthSensing.js.map +1 -1
  434. package/XR/features/WebXREyeTracking.js.map +1 -1
  435. package/XR/features/WebXRFeaturePointSystem.js.map +1 -1
  436. package/XR/features/WebXRHandTracking.js.map +1 -1
  437. package/XR/features/WebXRHitTest.js.map +1 -1
  438. package/XR/features/WebXRHitTestLegacy.js.map +1 -1
  439. package/XR/features/WebXRImageTracking.js.map +1 -1
  440. package/XR/features/WebXRLayers.js.map +1 -1
  441. package/XR/features/WebXRLightEstimation.js.map +1 -1
  442. package/XR/features/WebXRMeshDetector.js.map +1 -1
  443. package/XR/features/WebXRNearInteraction.js.map +1 -1
  444. package/XR/features/WebXRPlaneDetector.js.map +1 -1
  445. package/XR/features/WebXRRawCameraAccess.js.map +1 -1
  446. package/XR/features/WebXRSpaceWarp.js.map +1 -1
  447. package/XR/features/WebXRWalkingLocomotion.js.map +1 -1
  448. package/XR/motionController/webXRProfiledMotionController.js.map +1 -1
  449. package/XR/native/nativeXRRenderTarget.js.map +1 -1
  450. package/XR/webXRCamera.js.map +1 -1
  451. package/XR/webXRWebGLLayer.js.map +1 -1
  452. package/assets/Draco/draco_wasm_wrapper.js +115 -115
  453. package/package.json +1 -1
  454. package/scene.js.map +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"geometryPosterizeBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Meshes/Node/Blocks/geometryPosterizeBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,qCAAqC,EAAE,MAAM,2CAA2C,CAAC;AAClG,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAGzD;;;GAGG;AACH,MAAM,OAAO,sBAAuB,SAAQ,iBAAiB;IACzD;;;OAGG;IACH,YAAmB,IAAY;QAC3B,KAAK,CAAC,IAAI,CAAC,CAAC;QAEZ,IAAI,CAAC,aAAa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AEF,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ;AAED,aAAa,CAAC,gCAAgC,EAAE,sBAAsB,CAAC,CAAC","sourcesContent":["import { Vector2, Vector3, Vector4 } from \"../../../Maths/math.vector\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\nimport { NodeGeometryBlockConnectionPointTypes } from \"../Enums/nodeGeometryConnectionPointTypes\";\r\nimport { NodeGeometryBlock } from \"../nodeGeometryBlock\";\r\nimport type { NodeGeometryConnectionPoint } from \"../nodeGeometryBlockConnectionPoint\";\r\n\r\n/**\r\n * Block used to posterize a value\r\n * @see https://en.wikipedia.org/wiki/Posterization\r\n */\r\nexport class GeometryPosterizeBlock extends NodeGeometryBlock {\r\n /**\r\n * Creates a new GeometryPosterizeBlock\r\n * @param name defines the block name\r\n */\r\n public constructor(name: string) {\r\n super(name);\r\n\r\n this.registerInput(\"value\", NodeGeometryBlockConnectionPointTypes.AutoDetect);\r\n this.registerInput(\"steps\", NodeGeometryBlockConnectionPointTypes.AutoDetect);\r\n this.registerOutput(\"output\", NodeGeometryBlockConnectionPointTypes.BasedOnInput);\r\n\r\n this._outputs[0]._typeConnectionSource = this._inputs[0];\r\n this._linkConnectionTypes(0, 1);\r\n\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Matrix);\r\n this._inputs[1].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Matrix);\r\n this._inputs[1].acceptedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Float);\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public getClassName() {\r\n return \"GeometryPosterizeBlock\";\r\n }\r\n\r\n /**\r\n * Gets the value input component\r\n */\r\n public get value(): NodeGeometryConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the steps input component\r\n */\r\n public get steps(): NodeGeometryConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeGeometryConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected _buildBlock() {\r\n if (!this.value.isConnected || !this.steps.isConnected) {\r\n this.output._storedFunction = null;\r\n this.output._storedValue = null;\r\n return;\r\n }\r\n\r\n this.output._storedFunction = (state) => {\r\n const source = this.value.getConnectedValue(state);\r\n const steps = this.steps.getConnectedValue(state);\r\n let stepVector = steps;\r\n\r\n if (this.steps.type === NodeGeometryBlockConnectionPointTypes.Float) {\r\n switch (this.value.type) {\r\n case NodeGeometryBlockConnectionPointTypes.Vector2:\r\n stepVector = new Vector2(steps, steps);\r\n break;\r\n case NodeGeometryBlockConnectionPointTypes.Vector3:\r\n stepVector = new Vector3(steps, steps, steps);\r\n break;\r\n case NodeGeometryBlockConnectionPointTypes.Vector4:\r\n stepVector = new Vector4(steps, steps, steps, steps);\r\n break;\r\n }\r\n }\r\n\r\n switch (this.value.type) {\r\n case NodeGeometryBlockConnectionPointTypes.Vector2:\r\n return new Vector2((source.x / (1.0 / stepVector.x)) * (1.0 / stepVector.x), (source.y / (1.0 / stepVector.y)) * (1.0 / stepVector.y));\r\n case NodeGeometryBlockConnectionPointTypes.Vector3:\r\n return new Vector3(\r\n (source.x / (1.0 / stepVector.x)) * (1.0 / stepVector.x),\r\n (source.y / (1.0 / stepVector.y)) * (1.0 / stepVector.y),\r\n (source.z / (1.0 / stepVector.z)) * (1.0 / stepVector.z)\r\n );\r\n case NodeGeometryBlockConnectionPointTypes.Vector4:\r\n return new Vector4(\r\n (source.x / (1.0 / stepVector.x)) * (1.0 / stepVector.x),\r\n (source.y / (1.0 / stepVector.y)) * (1.0 / stepVector.y),\r\n (source.z / (1.0 / stepVector.z)) * (1.0 / stepVector.z),\r\n (source.w / (1.0 / stepVector.w)) * (1.0 / stepVector.w)\r\n );\r\n default:\r\n return Math.floor((source / (1.0 / steps)) * (1.0 / steps));\r\n }\r\n };\r\n\r\n return this;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.GeometryPosterizeBlock\", GeometryPosterizeBlock);\r\n"]}
1
+ {"version":3,"file":"geometryPosterizeBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Meshes/Node/Blocks/geometryPosterizeBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,qCAAqC,EAAE,MAAM,2CAA2C,CAAC;AAClG,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAGzD;;;GAGG;AACH,MAAM,OAAO,sBAAuB,SAAQ,iBAAiB;IACzD;;;OAGG;IACH,YAAmB,IAAY;QAC3B,KAAK,CAAC,IAAI,CAAC,CAAC;QAEZ,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,qCAAqC,CAAC,UAAU,CAAC,CAAC;QAC9E,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,qCAAqC,CAAC,UAAU,CAAC,CAAC;QAC9E,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,qCAAqC,CAAC,YAAY,CAAC,CAAC;QAElF,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,qBAAqB,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QACzD,IAAI,CAAC,oBAAoB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QAEhC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,4BAA4B,CAAC,IAAI,CAAC,qCAAqC,CAAC,MAAM,CAAC,CAAC;QAChG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,4BAA4B,CAAC,IAAI,CAAC,qCAAqC,CAAC,MAAM,CAAC,CAAC;QAChG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,4BAA4B,CAAC,IAAI,CAAC,qCAAqC,CAAC,KAAK,C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AC,GAAG,CAAC,GAAG,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,GAAG,UAAU,CAAC,CAAC,CAAC,EACxD,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,GAAG,UAAU,CAAC,CAAC,CAAC,EACxD,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,GAAG,UAAU,CAAC,CAAC,CAAC,CAC3D,CAAC;gBACN;oBACI,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,GAAG,CAAC,GAAG,GAAG,KAAK,CAAC,CAAC,GAAG,CAAC,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC;aACnE;QACL,CAAC,CAAC;QAEF,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ;AAED,aAAa,CAAC,gCAAgC,EAAE,sBAAsB,CAAC,CAAC","sourcesContent":["import { Vector2, Vector3, Vector4 } from \"../../../Maths/math.vector\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\nimport { NodeGeometryBlockConnectionPointTypes } from \"../Enums/nodeGeometryConnectionPointTypes\";\r\nimport { NodeGeometryBlock } from \"../nodeGeometryBlock\";\r\nimport type { NodeGeometryConnectionPoint } from \"../nodeGeometryBlockConnectionPoint\";\r\n\r\n/**\r\n * Block used to posterize a value\r\n * @see https://en.wikipedia.org/wiki/Posterization\r\n */\r\nexport class GeometryPosterizeBlock extends NodeGeometryBlock {\r\n /**\r\n * Creates a new GeometryPosterizeBlock\r\n * @param name defines the block name\r\n */\r\n public constructor(name: string) {\r\n super(name);\r\n\r\n this.registerInput(\"value\", NodeGeometryBlockConnectionPointTypes.AutoDetect);\r\n this.registerInput(\"steps\", NodeGeometryBlockConnectionPointTypes.AutoDetect);\r\n this.registerOutput(\"output\", NodeGeometryBlockConnectionPointTypes.BasedOnInput);\r\n\r\n this._outputs[0]._typeConnectionSource = this._inputs[0];\r\n this._linkConnectionTypes(0, 1);\r\n\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Matrix);\r\n this._inputs[1].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Matrix);\r\n this._inputs[1].acceptedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Float);\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public override getClassName() {\r\n return \"GeometryPosterizeBlock\";\r\n }\r\n\r\n /**\r\n * Gets the value input component\r\n */\r\n public get value(): NodeGeometryConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the steps input component\r\n */\r\n public get steps(): NodeGeometryConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeGeometryConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected override _buildBlock() {\r\n if (!this.value.isConnected || !this.steps.isConnected) {\r\n this.output._storedFunction = null;\r\n this.output._storedValue = null;\r\n return;\r\n }\r\n\r\n this.output._storedFunction = (state) => {\r\n const source = this.value.getConnectedValue(state);\r\n const steps = this.steps.getConnectedValue(state);\r\n let stepVector = steps;\r\n\r\n if (this.steps.type === NodeGeometryBlockConnectionPointTypes.Float) {\r\n switch (this.value.type) {\r\n case NodeGeometryBlockConnectionPointTypes.Vector2:\r\n stepVector = new Vector2(steps, steps);\r\n break;\r\n case NodeGeometryBlockConnectionPointTypes.Vector3:\r\n stepVector = new Vector3(steps, steps, steps);\r\n break;\r\n case NodeGeometryBlockConnectionPointTypes.Vector4:\r\n stepVector = new Vector4(steps, steps, steps, steps);\r\n break;\r\n }\r\n }\r\n\r\n switch (this.value.type) {\r\n case NodeGeometryBlockConnectionPointTypes.Vector2:\r\n return new Vector2((source.x / (1.0 / stepVector.x)) * (1.0 / stepVector.x), (source.y / (1.0 / stepVector.y)) * (1.0 / stepVector.y));\r\n case NodeGeometryBlockConnectionPointTypes.Vector3:\r\n return new Vector3(\r\n (source.x / (1.0 / stepVector.x)) * (1.0 / stepVector.x),\r\n (source.y / (1.0 / stepVector.y)) * (1.0 / stepVector.y),\r\n (source.z / (1.0 / stepVector.z)) * (1.0 / stepVector.z)\r\n );\r\n case NodeGeometryBlockConnectionPointTypes.Vector4:\r\n return new Vector4(\r\n (source.x / (1.0 / stepVector.x)) * (1.0 / stepVector.x),\r\n (source.y / (1.0 / stepVector.y)) * (1.0 / stepVector.y),\r\n (source.z / (1.0 / stepVector.z)) * (1.0 / stepVector.z),\r\n (source.w / (1.0 / stepVector.w)) * (1.0 / stepVector.w)\r\n );\r\n default:\r\n return Math.floor((source / (1.0 / steps)) * (1.0 / steps));\r\n }\r\n };\r\n\r\n return this;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.GeometryPosterizeBlock\", GeometryPosterizeBlock);\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"geometryPowBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Meshes/Node/Blocks/geometryPowBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,sCAA+B;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,qCAAqC,EAAE,MAAM,2CAA2C,CAAC;AAClG,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD;;GAEG;AACH,MAAM,OAAO,gBAAiB,SAAQ,iBAAiB;IACnD;;;OAGG;IACH,YAAmB,IAAY;QAC3B,KAAK,CAAC,IAAI,CAAC,CAAC;QAEZ,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,qCAAqC,CAAC,UAAU,CAAC,CAAC;QAC9E,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,qCAAqC,CAAC,UAAU,CAAC,CAAC;QAC9E,IA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CAAC,CAAC;iBACtH;aACJ;YAED,OAAO,CAAC,CAAC;QACb,CAAC,CAAC;QAEF,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ;AAED,aAAa,CAAC,0BAA0B,EAAE,gBAAgB,CAAC,CAAC","sourcesContent":["import { Vector2, Vector3, Vector4 } from \"core/Maths/math.vector\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\nimport { NodeGeometryBlockConnectionPointTypes } from \"../Enums/nodeGeometryConnectionPointTypes\";\r\nimport { NodeGeometryBlock } from \"../nodeGeometryBlock\";\r\nimport type { NodeGeometryConnectionPoint } from \"../nodeGeometryBlockConnectionPoint\";\r\n/**\r\n * Block used to get the value of the first parameter raised to the power of the second\r\n */\r\nexport class GeometryPowBlock extends NodeGeometryBlock {\r\n /**\r\n * Creates a new GeometryPowBlock\r\n * @param name defines the block name\r\n */\r\n public constructor(name: string) {\r\n super(name);\r\n\r\n this.registerInput(\"value\", NodeGeometryBlockConnectionPointTypes.AutoDetect);\r\n this.registerInput(\"power\", NodeGeometryBlockConnectionPointTypes.AutoDetect);\r\n this.registerOutput(\"output\", NodeGeometryBlockConnectionPointTypes.BasedOnInput);\r\n\r\n this._outputs[0]._typeConnectionSource = this._inputs[0];\r\n this._linkConnectionTypes(0, 1);\r\n\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Matrix);\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Geometry);\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Texture);\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public getClassName() {\r\n return \"GeometryPowBlock\";\r\n }\r\n\r\n /**\r\n * Gets the value operand input component\r\n */\r\n public get value(): NodeGeometryConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the power operand input component\r\n */\r\n public get power(): NodeGeometryConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeGeometryConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected _buildBlock() {\r\n if (!this.value.isConnected || !this.power.isConnected) {\r\n this.output._storedFunction = null;\r\n this.output._storedValue = null;\r\n return;\r\n }\r\n const func = (value: number, power: number) => {\r\n return Math.pow(value, power);\r\n };\r\n\r\n this.output._storedFunction = (state) => {\r\n const source = this.value.getConnectedValue(state);\r\n const power = this.power.getConnectedValue(state);\r\n switch (this.value.type) {\r\n case NodeGeometryBlockConnectionPointTypes.Int:\r\n case NodeGeometryBlockConnectionPointTypes.Float: {\r\n return func!(source, power);\r\n }\r\n case NodeGeometryBlockConnectionPointTypes.Vector2: {\r\n return new Vector2(func!(source.x, power), func!(source.y, power));\r\n }\r\n case NodeGeometryBlockConnectionPointTypes.Vector3: {\r\n return new Vector3(func!(source.x, power), func!(source.y, power), func!(source.z, power));\r\n }\r\n case NodeGeometryBlockConnectionPointTypes.Vector4: {\r\n return new Vector4(func!(source.x, power), func!(source.y, power), func!(source.z, power), func!(source.w, power));\r\n }\r\n }\r\n\r\n return 0;\r\n };\r\n\r\n return this;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.GeometryPowBlock\", GeometryPowBlock);\r\n"]}
1
+ {"version":3,"file":"geometryPowBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Meshes/Node/Blocks/geometryPowBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,sCAA+B;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,qCAAqC,EAAE,MAAM,2CAA2C,CAAC;AAClG,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD;;GAEG;AACH,MAAM,OAAO,gBAAiB,SAAQ,iBAAiB;IACnD;;;OAGG;IACH,YAAmB,IAAY;QAC3B,K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M,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,IAAK,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,IAAK,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,IAAK,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC;iBACtH;aACJ;YAED,OAAO,CAAC,CAAC;QACb,CAAC,CAAC;QAEF,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ;AAED,aAAa,CAAC,0BAA0B,EAAE,gBAAgB,CAAC,CAAC","sourcesContent":["import { Vector2, Vector3, Vector4 } from \"core/Maths/math.vector\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\nimport { NodeGeometryBlockConnectionPointTypes } from \"../Enums/nodeGeometryConnectionPointTypes\";\r\nimport { NodeGeometryBlock } from \"../nodeGeometryBlock\";\r\nimport type { NodeGeometryConnectionPoint } from \"../nodeGeometryBlockConnectionPoint\";\r\n/**\r\n * Block used to get the value of the first parameter raised to the power of the second\r\n */\r\nexport class GeometryPowBlock extends NodeGeometryBlock {\r\n /**\r\n * Creates a new GeometryPowBlock\r\n * @param name defines the block name\r\n */\r\n public constructor(name: string) {\r\n super(name);\r\n\r\n this.registerInput(\"value\", NodeGeometryBlockConnectionPointTypes.AutoDetect);\r\n this.registerInput(\"power\", NodeGeometryBlockConnectionPointTypes.AutoDetect);\r\n this.registerOutput(\"output\", NodeGeometryBlockConnectionPointTypes.BasedOnInput);\r\n\r\n this._outputs[0]._typeConnectionSource = this._inputs[0];\r\n this._linkConnectionTypes(0, 1);\r\n\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Matrix);\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Geometry);\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Texture);\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public override getClassName() {\r\n return \"GeometryPowBlock\";\r\n }\r\n\r\n /**\r\n * Gets the value operand input component\r\n */\r\n public get value(): NodeGeometryConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the power operand input component\r\n */\r\n public get power(): NodeGeometryConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeGeometryConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected override _buildBlock() {\r\n if (!this.value.isConnected || !this.power.isConnected) {\r\n this.output._storedFunction = null;\r\n this.output._storedValue = null;\r\n return;\r\n }\r\n const func = (value: number, power: number) => {\r\n return Math.pow(value, power);\r\n };\r\n\r\n this.output._storedFunction = (state) => {\r\n const source = this.value.getConnectedValue(state);\r\n const power = this.power.getConnectedValue(state);\r\n switch (this.value.type) {\r\n case NodeGeometryBlockConnectionPointTypes.Int:\r\n case NodeGeometryBlockConnectionPointTypes.Float: {\r\n return func!(source, power);\r\n }\r\n case NodeGeometryBlockConnectionPointTypes.Vector2: {\r\n return new Vector2(func!(source.x, power), func!(source.y, power));\r\n }\r\n case NodeGeometryBlockConnectionPointTypes.Vector3: {\r\n return new Vector3(func!(source.x, power), func!(source.y, power), func!(source.z, power));\r\n }\r\n case NodeGeometryBlockConnectionPointTypes.Vector4: {\r\n return new Vector4(func!(source.x, power), func!(source.y, power), func!(source.z, power), func!(source.w, power));\r\n }\r\n }\r\n\r\n return 0;\r\n };\r\n\r\n return this;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.GeometryPowBlock\", GeometryPowBlock);\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"geometryReplaceColorBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Meshes/Node/Blocks/geometryReplaceColorBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,qCAAqC,EAAE,MAAM,2CAA2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ClD,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;YAC1D,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;YACxD,MAAM,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;YAE9D,IAAI,KAAK,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,MAAM,EAAE,GAAG,QAAQ,EAAE;gBAC/C,OAAO,WAAW,CAAC;aACtB;iBAAM;gBACH,OAAO,KAAK,CAAC;aAChB;QACL,CAAC,CAAC;QAEF,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ;AAED,aAAa,CAAC,mCAAmC,EAAE,yBAAyB,CAAC,CAAC","sourcesContent":["import { RegisterClass } from \"../../../Misc/typeStore\";\r\nimport { NodeGeometryBlockConnectionPointTypes } from \"../Enums/nodeGeometryConnectionPointTypes\";\r\nimport { NodeGeometryBlock } from \"../nodeGeometryBlock\";\r\nimport type { NodeGeometryConnectionPoint } from \"../nodeGeometryBlockConnectionPoint\";\r\n/**\r\n * Block used to replace a color by another one\r\n */\r\nexport class GeometryReplaceColorBlock extends NodeGeometryBlock {\r\n /**\r\n * Creates a new GeometryReplaceColorBlock\r\n * @param name defines the block name\r\n */\r\n public constructor(name: string) {\r\n super(name);\r\n\r\n this.registerInput(\"value\", NodeGeometryBlockConnectionPointTypes.AutoDetect);\r\n this.registerInput(\"reference\", NodeGeometryBlockConnectionPointTypes.AutoDetect);\r\n this.registerInput(\"distance\", NodeGeometryBlockConnectionPointTypes.Float);\r\n this.registerInput(\"replacement\", NodeGeometryBlockConnectionPointTypes.AutoDetect);\r\n this.registerOutput(\"output\", NodeGeometryBlockConnectionPointTypes.BasedOnInput);\r\n\r\n this._outputs[0]._typeConnectionSource = this._inputs[0];\r\n this._linkConnectionTypes(0, 1);\r\n this._linkConnectionTypes(0, 3);\r\n\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Float);\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Matrix);\r\n this._inputs[1].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Float);\r\n this._inputs[1].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Matrix);\r\n this._inputs[3].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Float);\r\n this._inputs[3].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Matrix);\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public getClassName() {\r\n return \"GeometryReplaceColorBlock\";\r\n }\r\n\r\n /**\r\n * Gets the value input component\r\n */\r\n public get value(): NodeGeometryConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the reference input component\r\n */\r\n public get reference(): NodeGeometryConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the distance input component\r\n */\r\n public get distance(): NodeGeometryConnectionPoint {\r\n return this._inputs[2];\r\n }\r\n\r\n /**\r\n * Gets the replacement input component\r\n */\r\n public get replacement(): NodeGeometryConnectionPoint {\r\n return this._inputs[3];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeGeometryConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected _buildBlock() {\r\n if (!this.value.isConnected || !this.reference.isConnected || !this.distance.isConnected || !this.replacement.isConnected) {\r\n this.output._storedFunction = null;\r\n this.output._storedValue = null;\r\n return;\r\n }\r\n\r\n this.output._storedFunction = (state) => {\r\n const value = this.value.getConnectedValue(state);\r\n const reference = this.reference.getConnectedValue(state);\r\n const distance = this.distance.getConnectedValue(state);\r\n const replacement = this.replacement.getConnectedValue(state);\r\n\r\n if (value.subtract(reference).length() < distance) {\r\n return replacement;\r\n } else {\r\n return value;\r\n }\r\n };\r\n\r\n return this;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.GeometryReplaceColorBlock\", GeometryReplaceColorBlock);\r\n"]}
1
+ {"version":3,"file":"geometryReplaceColorBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Meshes/Node/Blocks/geometryReplaceColorBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,qCAAqC,EAAE,MAAM,2CAA2C,CAAC;AAClG,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD;;GAEG;AACH,MAAM,OAAO,yBAA0B,SAAQ,iBAAiB;IAC5D;;;OAGG;IACH,YAAmB,IAAY;QAC3B,KAAK,CAAC,IAAI,CAAC,CAAC;QAEZ,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,qCAAqC,CAAC,UAAU,CAAC,CAAC;QAC9E,IAAI,CAAC,aAAa,CAAC,WAAW,EAAE,qCAAqC,CAAC,UAAU,CAAC,CAAC;QAClF,IAAI,CAAC,aAAa,CAAC,UAAU,EAAE,qCAAqC,CAAC,KAAK,CAAC,CAAC;QAC5E,IAAI,CAAC,aAAa,CAAC,aAAa,EAAE,qCAAqC,CAAC,UAAU,CAAC,CAAC;QACpF,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,qCAAqC,CAAC,YAAY,CAAC,CAAC;QAElF,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,qBAAqB,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QACzD,IAAI,CAAC,oBAAoB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QAChC,IAAI,CAAC,oBAAoB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QAEhC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,4BAA4B,CAAC,IAAI,CAAC,qCAAqC,CAAC,KAAK,CAAC,CAAC;QAC/F,IAAI,CAAC,OAA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IAAI,CAAC,WAAW,CAAC,WAAW,EAAE;YACvH,IAAI,CAAC,MAAM,CAAC,eAAe,GAAG,IAAI,CAAC;YACnC,IAAI,CAAC,MAAM,CAAC,YAAY,GAAG,IAAI,CAAC;YAChC,OAAO;SACV;QAED,IAAI,CAAC,MAAM,CAAC,eAAe,GAAG,CAAC,KAAK,EAAE,EAAE;YACpC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;YAClD,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;YAC1D,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;YACxD,MAAM,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;YAE9D,IAAI,KAAK,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,MAAM,EAAE,GAAG,QAAQ,EAAE;gBAC/C,OAAO,WAAW,CAAC;aACtB;iBAAM;gBACH,OAAO,KAAK,CAAC;aAChB;QACL,CAAC,CAAC;QAEF,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ;AAED,aAAa,CAAC,mCAAmC,EAAE,yBAAyB,CAAC,CAAC","sourcesContent":["import { RegisterClass } from \"../../../Misc/typeStore\";\r\nimport { NodeGeometryBlockConnectionPointTypes } from \"../Enums/nodeGeometryConnectionPointTypes\";\r\nimport { NodeGeometryBlock } from \"../nodeGeometryBlock\";\r\nimport type { NodeGeometryConnectionPoint } from \"../nodeGeometryBlockConnectionPoint\";\r\n/**\r\n * Block used to replace a color by another one\r\n */\r\nexport class GeometryReplaceColorBlock extends NodeGeometryBlock {\r\n /**\r\n * Creates a new GeometryReplaceColorBlock\r\n * @param name defines the block name\r\n */\r\n public constructor(name: string) {\r\n super(name);\r\n\r\n this.registerInput(\"value\", NodeGeometryBlockConnectionPointTypes.AutoDetect);\r\n this.registerInput(\"reference\", NodeGeometryBlockConnectionPointTypes.AutoDetect);\r\n this.registerInput(\"distance\", NodeGeometryBlockConnectionPointTypes.Float);\r\n this.registerInput(\"replacement\", NodeGeometryBlockConnectionPointTypes.AutoDetect);\r\n this.registerOutput(\"output\", NodeGeometryBlockConnectionPointTypes.BasedOnInput);\r\n\r\n this._outputs[0]._typeConnectionSource = this._inputs[0];\r\n this._linkConnectionTypes(0, 1);\r\n this._linkConnectionTypes(0, 3);\r\n\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Float);\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Matrix);\r\n this._inputs[1].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Float);\r\n this._inputs[1].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Matrix);\r\n this._inputs[3].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Float);\r\n this._inputs[3].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Matrix);\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public override getClassName() {\r\n return \"GeometryReplaceColorBlock\";\r\n }\r\n\r\n /**\r\n * Gets the value input component\r\n */\r\n public get value(): NodeGeometryConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the reference input component\r\n */\r\n public get reference(): NodeGeometryConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the distance input component\r\n */\r\n public get distance(): NodeGeometryConnectionPoint {\r\n return this._inputs[2];\r\n }\r\n\r\n /**\r\n * Gets the replacement input component\r\n */\r\n public get replacement(): NodeGeometryConnectionPoint {\r\n return this._inputs[3];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeGeometryConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected override _buildBlock() {\r\n if (!this.value.isConnected || !this.reference.isConnected || !this.distance.isConnected || !this.replacement.isConnected) {\r\n this.output._storedFunction = null;\r\n this.output._storedValue = null;\r\n return;\r\n }\r\n\r\n this.output._storedFunction = (state) => {\r\n const value = this.value.getConnectedValue(state);\r\n const reference = this.reference.getConnectedValue(state);\r\n const distance = this.distance.getConnectedValue(state);\r\n const replacement = this.replacement.getConnectedValue(state);\r\n\r\n if (value.subtract(reference).length() < distance) {\r\n return replacement;\r\n } else {\r\n return value;\r\n }\r\n };\r\n\r\n return this;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.GeometryReplaceColorBlock\", GeometryReplaceColorBlock);\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"geometryRotate2dBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Meshes/Node/Blocks/geometryRotate2dBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,sCAA+B;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,qCAAqC,EAAE,MAAM,2CAA2C,CAAC;AAClG,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAGzD;;GAEG;AACH,MAAM,OAAO,qBAAsB,SAAQ,iBAAiB;IACxD;;;OAGG;IACH,YAAmB,IAAY;QAC3B,KAAK,CAAC,IAAI,CAAC,CAAC;QAEZ,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,qCAAqC,CAAC,OAAO,CAAC,CAAC;QAC3E,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,qCAAqC,CAAC,KAAK,CAAC,CAAC;QACzE,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,qCAAqC,CAAC,OAAO,CAAC,CAAC;IACjF,CAAC;IAED;;;OAGG;IACI,YAAY;QACf,OAAO,uBAAuB,CAAC;IACnC,CAAC;IAED;;OAEG;IACH,IAAW,KAAK;QACZ,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAC3B,CAAC;IAED;;OAEG;IACH,IAAW,KAAK;QACZ,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAC3B,CAAC;IAED;;OAEG;IACH,IAAW,MAAM;QACb,OAAO,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IAC5B,CAAC;IAES,WAAW;QACjB,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,WAAW,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE;YACpD,IAAI,CAAC,MAAM,CAAC,eAAe,GAAG,IAAI,CAAC;YACnC,IAAI,CAAC,MAAM,CAAC,YAAY,GAAG,IAAI,CAAC;YAChC,OAAO;SACV;QAED,IAAI,CAAC,MAAM,CAAC,eAAe,GAAG,CAAC,KAAK,EAAE,EAAE;YACpC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,KAAK,CAAY,CAAC;YAC7D,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;YAClD,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;QACrI,CAAC,CAAC;QAEF,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ;AAED,aAAa,CAAC,+BAA+B,EAAE,qBAAqB,CAAC,CAAC","sourcesContent":["import { Vector2 } from \"core/Maths/math.vector\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\nimport { NodeGeometryBlockConnectionPointTypes } from \"../Enums/nodeGeometryConnectionPointTypes\";\r\nimport { NodeGeometryBlock } from \"../nodeGeometryBlock\";\r\nimport type { NodeGeometryConnectionPoint } from \"../nodeGeometryBlockConnectionPoint\";\r\n\r\n/**\r\n * Block used to rotate a 2d vector by a given angle\r\n */\r\nexport class GeometryRotate2dBlock extends NodeGeometryBlock {\r\n /**\r\n * Creates a new GeometryRotate2dBlock\r\n * @param name defines the block name\r\n */\r\n public constructor(name: string) {\r\n super(name);\r\n\r\n this.registerInput(\"input\", NodeGeometryBlockConnectionPointTypes.Vector2);\r\n this.registerInput(\"angle\", NodeGeometryBlockConnectionPointTypes.Float);\r\n this.registerOutput(\"output\", NodeGeometryBlockConnectionPointTypes.Vector2);\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public getClassName() {\r\n return \"GeometryRotate2dBlock\";\r\n }\r\n\r\n /**\r\n * Gets the input vector\r\n */\r\n public get input(): NodeGeometryConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the input angle\r\n */\r\n public get angle(): NodeGeometryConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeGeometryConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected _buildBlock() {\r\n if (!this.angle.isConnected || !this.input.isConnected) {\r\n this.output._storedFunction = null;\r\n this.output._storedValue = null;\r\n return;\r\n }\r\n\r\n this.output._storedFunction = (state) => {\r\n const input = this.input.getConnectedValue(state) as Vector2;\r\n const angle = this.angle.getConnectedValue(state);\r\n return new Vector2(Math.cos(angle) * input.x - Math.sin(angle) * input.y, Math.sin(angle) * input.x + Math.cos(angle) * input.y);\r\n };\r\n\r\n return this;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.GeometryRotate2dBlock\", GeometryRotate2dBlock);\r\n"]}
1
+ {"version":3,"file":"geometryRotate2dBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Meshes/Node/Blocks/geometryRotate2dBlock.ts"],"names":[],"mapp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,GAAG,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,KAAK,CAAY,CAAC;YAC7D,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;YAClD,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;QACrI,CAAC,CAAC;QAEF,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ;AAED,aAAa,CAAC,+BAA+B,EAAE,qBAAqB,CAAC,CAAC","sourcesContent":["import { Vector2 } from \"core/Maths/math.vector\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\nimport { NodeGeometryBlockConnectionPointTypes } from \"../Enums/nodeGeometryConnectionPointTypes\";\r\nimport { NodeGeometryBlock } from \"../nodeGeometryBlock\";\r\nimport type { NodeGeometryConnectionPoint } from \"../nodeGeometryBlockConnectionPoint\";\r\n\r\n/**\r\n * Block used to rotate a 2d vector by a given angle\r\n */\r\nexport class GeometryRotate2dBlock extends NodeGeometryBlock {\r\n /**\r\n * Creates a new GeometryRotate2dBlock\r\n * @param name defines the block name\r\n */\r\n public constructor(name: string) {\r\n super(name);\r\n\r\n this.registerInput(\"input\", NodeGeometryBlockConnectionPointTypes.Vector2);\r\n this.registerInput(\"angle\", NodeGeometryBlockConnectionPointTypes.Float);\r\n this.registerOutput(\"output\", NodeGeometryBlockConnectionPointTypes.Vector2);\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public override getClassName() {\r\n return \"GeometryRotate2dBlock\";\r\n }\r\n\r\n /**\r\n * Gets the input vector\r\n */\r\n public get input(): NodeGeometryConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the input angle\r\n */\r\n public get angle(): NodeGeometryConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeGeometryConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected override _buildBlock() {\r\n if (!this.angle.isConnected || !this.input.isConnected) {\r\n this.output._storedFunction = null;\r\n this.output._storedValue = null;\r\n return;\r\n }\r\n\r\n this.output._storedFunction = (state) => {\r\n const input = this.input.getConnectedValue(state) as Vector2;\r\n const angle = this.angle.getConnectedValue(state);\r\n return new Vector2(Math.cos(angle) * input.x - Math.sin(angle) * input.y, Math.sin(angle) * input.x + Math.cos(angle) * input.y);\r\n };\r\n\r\n return this;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.GeometryRotate2dBlock\", GeometryRotate2dBlock);\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"geometrySmoothStepBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Meshes/Node/Blocks/geometrySmoothStepBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,sCAA+B;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,qCAAqC,EAAE,MAAM,2CAA2C,CAAC;AAClG,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD;;GAEG;AACH,MAAM,OAAO,uBAAwB,SAAQ,iBAAiB;IAC1D;;;OAGG;IACH,YAAmB,IAAY;QAC3B,KAAK,CAAC,IAAI,CAAC,CAAC;QAEZ,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,qCAAqC,CAAC,UAAU,CAAC,CAAC;QAC9E,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,qCAAqC,CAAC,KAAK,CAAC,CAAC;QACzE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oBAChD,OAAO,IAAI,OAAO,CAAC,IAAK,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,EAAE,IAAK,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,EAAE,IAAK,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;iBACnH;gBACD,KAAK,qCAAqC,CAAC,OAAO,CAAC,CAAC;oBAChD,OAAO,IAAI,OAAO,CAAC,IAAK,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,EAAE,IAAK,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,EAAE,IAAK,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,EAAE,IAAK,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;iBAClJ;aACJ;YAED,OAAO,CAAC,CAAC;QACb,CAAC,CAAC;QAEF,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ;AAED,aAAa,CAAC,iCAAiC,EAAE,uBAAuB,CAAC,CAAC","sourcesContent":["import { Vector2, Vector3, Vector4 } from \"core/Maths/math.vector\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\nimport { NodeGeometryBlockConnectionPointTypes } from \"../Enums/nodeGeometryConnectionPointTypes\";\r\nimport { NodeGeometryBlock } from \"../nodeGeometryBlock\";\r\nimport type { NodeGeometryConnectionPoint } from \"../nodeGeometryBlockConnectionPoint\";\r\n/**\r\n * Block used to smooth step a value\r\n */\r\nexport class GeometrySmoothStepBlock extends NodeGeometryBlock {\r\n /**\r\n * Creates a new GeometrySmoothStepBlock\r\n * @param name defines the block name\r\n */\r\n public constructor(name: string) {\r\n super(name);\r\n\r\n this.registerInput(\"value\", NodeGeometryBlockConnectionPointTypes.AutoDetect);\r\n this.registerInput(\"edge0\", NodeGeometryBlockConnectionPointTypes.Float);\r\n this.registerInput(\"edge1\", NodeGeometryBlockConnectionPointTypes.Float);\r\n this.registerOutput(\"output\", NodeGeometryBlockConnectionPointTypes.BasedOnInput);\r\n\r\n this._outputs[0]._typeConnectionSource = this._inputs[0];\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Matrix);\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Geometry);\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Texture);\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public getClassName() {\r\n return \"GeometrySmoothStepBlock\";\r\n }\r\n\r\n /**\r\n * Gets the value operand input component\r\n */\r\n public get value(): NodeGeometryConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the first edge operand input component\r\n */\r\n public get edge0(): NodeGeometryConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the second edge operand input component\r\n */\r\n public get edge1(): NodeGeometryConnectionPoint {\r\n return this._inputs[2];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeGeometryConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected _buildBlock() {\r\n if (!this.value.isConnected || !this.edge0.isConnected || !this.edge1.isConnected) {\r\n this.output._storedFunction = null;\r\n this.output._storedValue = null;\r\n return;\r\n }\r\n\r\n const func = (value: number, edge0: number, edge1: number) => {\r\n const x = Math.max(0, Math.min((value - edge0) / (edge1 - edge0), 1));\r\n\r\n // Smoothstep formula: 3x^2 - 2x^3\r\n return x * x * (3 - 2 * x);\r\n };\r\n\r\n this.output._storedFunction = (state) => {\r\n const source = this.value.getConnectedValue(state);\r\n const edge0 = this.edge0.getConnectedValue(state);\r\n const edge1 = this.edge1.getConnectedValue(state);\r\n switch (this.value.type) {\r\n case NodeGeometryBlockConnectionPointTypes.Int:\r\n case NodeGeometryBlockConnectionPointTypes.Float: {\r\n return func!(source, edge0, edge1);\r\n }\r\n case NodeGeometryBlockConnectionPointTypes.Vector2: {\r\n return new Vector2(func!(source.x, edge0, edge1), func!(source.y, edge0, edge1));\r\n }\r\n case NodeGeometryBlockConnectionPointTypes.Vector3: {\r\n return new Vector3(func!(source.x, edge0, edge1), func!(source.y, edge0, edge1), func!(source.z, edge0, edge1));\r\n }\r\n case NodeGeometryBlockConnectionPointTypes.Vector4: {\r\n return new Vector4(func!(source.x, edge0, edge1), func!(source.y, edge0, edge1), func!(source.z, edge0, edge1), func!(source.w, edge0, edge1));\r\n }\r\n }\r\n\r\n return 0;\r\n };\r\n\r\n return this;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.GeometrySmoothStepBlock\", GeometrySmoothStepBlock);\r\n"]}
1
+ {"version":3,"file":"geometrySmoothStepBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Meshes/Node/Blocks/geometrySmoothStepBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,sCAA+B;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,qCAAqC,EAAE,MAAM,2CAA2C,CAAC;AAClG,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD;;GAEG;AACH,MAAM,OAAO,uBAAwB,SAAQ,iBAAiB;IAC1D;;;OAGG;IACH,YAAmB,IAAY;QAC3B,KAAK,CAAC,IAAI,CAAC,CAAC;QAEZ,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,qCAAqC,CAAC,UAAU,CAAC,CAAC;QAC9E,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,qCAAqC,CAAC,KAAK,CAAC,CAAC;QACzE,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,qCAAqC,CAAC,KAAK,CAAC,CAAC;QACzE,IAAI,CAAC,cAAc,CAAC,QAAQ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K,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,EAAE,IAAK,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;iBACnH;gBACD,KAAK,qCAAqC,CAAC,OAAO,CAAC,CAAC;oBAChD,OAAO,IAAI,OAAO,CAAC,IAAK,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,EAAE,IAAK,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,EAAE,IAAK,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,EAAE,IAAK,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;iBAClJ;aACJ;YAED,OAAO,CAAC,CAAC;QACb,CAAC,CAAC;QAEF,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ;AAED,aAAa,CAAC,iCAAiC,EAAE,uBAAuB,CAAC,CAAC","sourcesContent":["import { Vector2, Vector3, Vector4 } from \"core/Maths/math.vector\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\nimport { NodeGeometryBlockConnectionPointTypes } from \"../Enums/nodeGeometryConnectionPointTypes\";\r\nimport { NodeGeometryBlock } from \"../nodeGeometryBlock\";\r\nimport type { NodeGeometryConnectionPoint } from \"../nodeGeometryBlockConnectionPoint\";\r\n/**\r\n * Block used to smooth step a value\r\n */\r\nexport class GeometrySmoothStepBlock extends NodeGeometryBlock {\r\n /**\r\n * Creates a new GeometrySmoothStepBlock\r\n * @param name defines the block name\r\n */\r\n public constructor(name: string) {\r\n super(name);\r\n\r\n this.registerInput(\"value\", NodeGeometryBlockConnectionPointTypes.AutoDetect);\r\n this.registerInput(\"edge0\", NodeGeometryBlockConnectionPointTypes.Float);\r\n this.registerInput(\"edge1\", NodeGeometryBlockConnectionPointTypes.Float);\r\n this.registerOutput(\"output\", NodeGeometryBlockConnectionPointTypes.BasedOnInput);\r\n\r\n this._outputs[0]._typeConnectionSource = this._inputs[0];\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Matrix);\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Geometry);\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Texture);\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public override getClassName() {\r\n return \"GeometrySmoothStepBlock\";\r\n }\r\n\r\n /**\r\n * Gets the value operand input component\r\n */\r\n public get value(): NodeGeometryConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the first edge operand input component\r\n */\r\n public get edge0(): NodeGeometryConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the second edge operand input component\r\n */\r\n public get edge1(): NodeGeometryConnectionPoint {\r\n return this._inputs[2];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeGeometryConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected override _buildBlock() {\r\n if (!this.value.isConnected || !this.edge0.isConnected || !this.edge1.isConnected) {\r\n this.output._storedFunction = null;\r\n this.output._storedValue = null;\r\n return;\r\n }\r\n\r\n const func = (value: number, edge0: number, edge1: number) => {\r\n const x = Math.max(0, Math.min((value - edge0) / (edge1 - edge0), 1));\r\n\r\n // Smoothstep formula: 3x^2 - 2x^3\r\n return x * x * (3 - 2 * x);\r\n };\r\n\r\n this.output._storedFunction = (state) => {\r\n const source = this.value.getConnectedValue(state);\r\n const edge0 = this.edge0.getConnectedValue(state);\r\n const edge1 = this.edge1.getConnectedValue(state);\r\n switch (this.value.type) {\r\n case NodeGeometryBlockConnectionPointTypes.Int:\r\n case NodeGeometryBlockConnectionPointTypes.Float: {\r\n return func!(source, edge0, edge1);\r\n }\r\n case NodeGeometryBlockConnectionPointTypes.Vector2: {\r\n return new Vector2(func!(source.x, edge0, edge1), func!(source.y, edge0, edge1));\r\n }\r\n case NodeGeometryBlockConnectionPointTypes.Vector3: {\r\n return new Vector3(func!(source.x, edge0, edge1), func!(source.y, edge0, edge1), func!(source.z, edge0, edge1));\r\n }\r\n case NodeGeometryBlockConnectionPointTypes.Vector4: {\r\n return new Vector4(func!(source.x, edge0, edge1), func!(source.y, edge0, edge1), func!(source.z, edge0, edge1), func!(source.w, edge0, edge1));\r\n }\r\n }\r\n\r\n return 0;\r\n };\r\n\r\n return this;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.GeometrySmoothStepBlock\", GeometrySmoothStepBlock);\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"geometryStepBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Meshes/Node/Blocks/geometryStepBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,sCAA+B;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,qCAAqC,EAAE,MAAM,2CAA2C,CAAC;AAClG,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAGzD;;GAEG;AACH,MAAM,OAAO,iBAAkB,SAAQ,iBAAiB;IACpD;;;OAGG;IACH,YAAmB,IAAY;QAC3B,KAAK,CAAC,IAAI,CAAC,CAAC;QAEZ,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,qCAAqC,CAAC,UAAU,CAAC,CAAC;QAC9E,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE,qCAAqC,CAAC,KAAK,CAAC,CAAC;QACxE,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,qCAAqC,CAAC,YAAY,CAAC,CAAC;QAElF,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,qBAAqB,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QACzD,IAAI,CAAC,OAAO,C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";\r\nimport { NodeGeometryBlockConnectionPointTypes } from \"../Enums/nodeGeometryConnectionPointTypes\";\r\nimport { NodeGeometryBlock } from \"../nodeGeometryBlock\";\r\nimport type { NodeGeometryConnectionPoint } from \"../nodeGeometryBlockConnectionPoint\";\r\n\r\n/**\r\n * Block used to step a value\r\n */\r\nexport class GeometryStepBlock extends NodeGeometryBlock {\r\n /**\r\n * Creates a new GeometryStepBlock\r\n * @param name defines the block name\r\n */\r\n public constructor(name: string) {\r\n super(name);\r\n\r\n this.registerInput(\"value\", NodeGeometryBlockConnectionPointTypes.AutoDetect);\r\n this.registerInput(\"edge\", NodeGeometryBlockConnectionPointTypes.Float);\r\n this.registerOutput(\"output\", NodeGeometryBlockConnectionPointTypes.BasedOnInput);\r\n\r\n this._outputs[0]._typeConnectionSource = this._inputs[0];\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Matrix);\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Geometry);\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Texture);\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public getClassName() {\r\n return \"GeometryStepBlock\";\r\n }\r\n\r\n /**\r\n * Gets the value operand input component\r\n */\r\n public get value(): NodeGeometryConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the edge operand input component\r\n */\r\n public get edge(): NodeGeometryConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeGeometryConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected _buildBlock() {\r\n if (!this.value.isConnected || !this.edge.isConnected) {\r\n this.output._storedFunction = null;\r\n this.output._storedValue = null;\r\n return;\r\n }\r\n const func = (value: number, edge: number) => {\r\n if (value < edge) {\r\n return 0;\r\n }\r\n\r\n return 1;\r\n };\r\n\r\n this.output._storedFunction = (state) => {\r\n const source = this.value.getConnectedValue(state);\r\n const edge = this.edge.getConnectedValue(state);\r\n switch (this.value.type) {\r\n case NodeGeometryBlockConnectionPointTypes.Int:\r\n case NodeGeometryBlockConnectionPointTypes.Float: {\r\n return func!(source, edge);\r\n }\r\n case NodeGeometryBlockConnectionPointTypes.Vector2: {\r\n return new Vector2(func!(source.x, edge), func!(source.y, edge));\r\n }\r\n case NodeGeometryBlockConnectionPointTypes.Vector3: {\r\n return new Vector3(func!(source.x, edge), func!(source.y, edge), func!(source.z, edge));\r\n }\r\n case NodeGeometryBlockConnectionPointTypes.Vector4: {\r\n return new Vector4(func!(source.x, edge), func!(source.y, edge), func!(source.z, edge), func!(source.w, edge));\r\n }\r\n }\r\n\r\n return 0;\r\n };\r\n\r\n return this;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.GeometryStepBlock\", GeometryStepBlock);\r\n"]}
1
+ {"version":3,"file":"geometryStepBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Meshes/Node/Blocks/geometryStepBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,sCAA+B;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,qCAAqC,EAAE,MAAM,2CAA2C,CAAC;AAClG,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAGzD;;GAEG;AACH,MAAM,OAAO,iBAAkB,SAAQ,iBAAiB;IACpD;;;OAGG;IACH,YAAmB,IAAY;QAC3B,KAAK,CAAC,IAAI,CAAC,CAAC;QAEZ,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,qCAAqC,CAAC,UAAU,CAAC,CAAC;QAC9E,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE,qCAAqC,CAAC,KAAK,CAAC,CAAC;QACxE,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,qCAAqC,CAAC,YAAY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,CAAC;CACJ;AAED,aAAa,CAAC,2BAA2B,EAAE,iBAAiB,CAAC,CAAC","sourcesContent":["import { Vector2, Vector3, Vector4 } from \"core/Maths/math.vector\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\nimport { NodeGeometryBlockConnectionPointTypes } from \"../Enums/nodeGeometryConnectionPointTypes\";\r\nimport { NodeGeometryBlock } from \"../nodeGeometryBlock\";\r\nimport type { NodeGeometryConnectionPoint } from \"../nodeGeometryBlockConnectionPoint\";\r\n\r\n/**\r\n * Block used to step a value\r\n */\r\nexport class GeometryStepBlock extends NodeGeometryBlock {\r\n /**\r\n * Creates a new GeometryStepBlock\r\n * @param name defines the block name\r\n */\r\n public constructor(name: string) {\r\n super(name);\r\n\r\n this.registerInput(\"value\", NodeGeometryBlockConnectionPointTypes.AutoDetect);\r\n this.registerInput(\"edge\", NodeGeometryBlockConnectionPointTypes.Float);\r\n this.registerOutput(\"output\", NodeGeometryBlockConnectionPointTypes.BasedOnInput);\r\n\r\n this._outputs[0]._typeConnectionSource = this._inputs[0];\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Matrix);\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Geometry);\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Texture);\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public override getClassName() {\r\n return \"GeometryStepBlock\";\r\n }\r\n\r\n /**\r\n * Gets the value operand input component\r\n */\r\n public get value(): NodeGeometryConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the edge operand input component\r\n */\r\n public get edge(): NodeGeometryConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeGeometryConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected override _buildBlock() {\r\n if (!this.value.isConnected || !this.edge.isConnected) {\r\n this.output._storedFunction = null;\r\n this.output._storedValue = null;\r\n return;\r\n }\r\n const func = (value: number, edge: number) => {\r\n if (value < edge) {\r\n return 0;\r\n }\r\n\r\n return 1;\r\n };\r\n\r\n this.output._storedFunction = (state) => {\r\n const source = this.value.getConnectedValue(state);\r\n const edge = this.edge.getConnectedValue(state);\r\n switch (this.value.type) {\r\n case NodeGeometryBlockConnectionPointTypes.Int:\r\n case NodeGeometryBlockConnectionPointTypes.Float: {\r\n return func!(source, edge);\r\n }\r\n case NodeGeometryBlockConnectionPointTypes.Vector2: {\r\n return new Vector2(func!(source.x, edge), func!(source.y, edge));\r\n }\r\n case NodeGeometryBlockConnectionPointTypes.Vector3: {\r\n return new Vector3(func!(source.x, edge), func!(source.y, edge), func!(source.z, edge));\r\n }\r\n case NodeGeometryBlockConnectionPointTypes.Vector4: {\r\n return new Vector4(func!(source.x, edge), func!(source.y, edge), func!(source.z, edge), func!(source.w, edge));\r\n }\r\n }\r\n\r\n return 0;\r\n };\r\n\r\n return this;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.GeometryStepBlock\", GeometryStepBlock);\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"geometryTransformBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Meshes/Node/Blocks/geometryTransformBlock.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,qCAAqC,EAAE,MAAM,2CAA2C,CAAC;AAClG,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAE/E,OAAO,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAGnG;;GAEG;AACH,MAAM,OAAO,sBAAuB,SAAQ,iBAAiB;IAczD;;;OAGG;IACH,YAA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JU;IADN,sBAAsB,CAAC,kBAAkB,EAAE,sBAAsB,CAAC,OAAO,EAAE,UAAU,EAAE,EAAE,SAAS,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,CAAC;+DAC3F;AA6JlC,aAAa,CAAC,gCAAgC,EAAE,sBAAsB,CAAC,CAAC","sourcesContent":["import { NodeGeometryBlock } from \"../nodeGeometryBlock\";\r\nimport type { NodeGeometryConnectionPoint } from \"../nodeGeometryBlockConnectionPoint\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\nimport { NodeGeometryBlockConnectionPointTypes } from \"../Enums/nodeGeometryConnectionPointTypes\";\r\nimport { Matrix, Vector2, Vector3, Vector4 } from \"../../../Maths/math.vector\";\r\nimport type { VertexData } from \"../../../Meshes/mesh.vertexData\";\r\nimport { PropertyTypeForEdition, editableInPropertyPage } from \"../../../Decorators/nodeDecorator\";\r\nimport type { NodeGeometryBuildState } from \"../nodeGeometryBuildState\";\r\n\r\n/**\r\n * Block used to apply a transform to a vector / geometry\r\n */\r\nexport class GeometryTransformBlock extends NodeGeometryBlock {\r\n private _rotationMatrix = new Matrix();\r\n private _scalingMatrix = new Matrix();\r\n private _translationMatrix = new Matrix();\r\n private _scalingRotationMatrix = new Matrix();\r\n private _transformMatrix = new Matrix();\r\n\r\n /**\r\n * Gets or sets a boolean indicating that this block can evaluate context\r\n * Build performance is improved when this value is set to false as the system will cache values instead of reevaluating everything per context change\r\n */\r\n @editableInPropertyPage(\"Evaluate context\", PropertyTypeForEdition.Boolean, \"ADVANCED\", { notifiers: { rebuild: true } })\r\n public evaluateContext = true;\r\n\r\n /**\r\n * Create a new GeometryTransformBlock\r\n * @param name defines the block name\r\n */\r\n public constructor(name: string) {\r\n super(name);\r\n\r\n this.registerInput(\"value\", NodeGeometryBlockConnectionPointTypes.AutoDetect);\r\n this.registerInput(\"matrix\", NodeGeometryBlockConnectionPointTypes.Matrix, true);\r\n this.registerInput(\"translation\", NodeGeometryBlockConnectionPointTypes.Vector3, true, Vector3.Zero());\r\n this.registerInput(\"rotation\", NodeGeometryBlockConnectionPointTypes.Vector3, true, Vector3.Zero());\r\n this.registerInput(\"scaling\", NodeGeometryBlockConnectionPointTypes.Vector3, true, Vector3.One());\r\n\r\n this.registerOutput(\"output\", NodeGeometryBlockConnectionPointTypes.BasedOnInput);\r\n\r\n this._outputs[0]._typeConnectionSource = this._inputs[0];\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Float);\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Matrix);\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Texture);\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public getClassName() {\r\n return \"GeometryTransformBlock\";\r\n }\r\n\r\n /**\r\n * Gets the value input component\r\n */\r\n public get value(): NodeGeometryConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the matrix input component\r\n */\r\n public get matrix(): NodeGeometryConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the translation input component\r\n */\r\n public get translation(): NodeGeometryConnectionPoint {\r\n return this._inputs[2];\r\n }\r\n\r\n /**\r\n * Gets the rotation input component\r\n */\r\n public get rotation(): NodeGeometryConnectionPoint {\r\n return this._inputs[3];\r\n }\r\n\r\n /**\r\n * Gets the scaling input component\r\n */\r\n public get scaling(): NodeGeometryConnectionPoint {\r\n return this._inputs[4];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeGeometryConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected _buildBlock(state: NodeGeometryBuildState) {\r\n if (!this.value.isConnected) {\r\n this.output._storedFunction = null;\r\n this.output._storedValue = null;\r\n return;\r\n }\r\n\r\n const func = (state: NodeGeometryBuildState) => {\r\n const value = this.value.getConnectedValue(state);\r\n\r\n if (!value) {\r\n return null;\r\n }\r\n\r\n let matrix: Matrix;\r\n\r\n if (this.matrix.isConnected) {\r\n matrix = this.matrix.getConnectedValue(state);\r\n } else {\r\n const scaling = this.scaling.getConnectedValue(state);\r\n const rotation = this.rotation.getConnectedValue(state);\r\n const translation = this.translation.getConnectedValue(state);\r\n\r\n // Transform\r\n Matrix.ScalingToRef(scaling.x, scaling.y, scaling.z, this._scalingMatrix);\r\n Matrix.RotationYawPitchRollToRef(rotation.y, rotation.x, rotation.z, this._rotationMatrix);\r\n Matrix.TranslationToRef(translation.x, translation.y, translation.z, this._translationMatrix);\r\n\r\n this._scalingMatrix.multiplyToRef(this._rotationMatrix, this._scalingRotationMatrix);\r\n this._scalingRotationMatrix.multiplyToRef(this._translationMatrix, this._transformMatrix);\r\n matrix = this._transformMatrix;\r\n }\r\n\r\n switch (this.value.type) {\r\n case NodeGeometryBlockConnectionPointTypes.Geometry: {\r\n const geometry = (value as VertexData).clone();\r\n geometry.transform(matrix);\r\n return geometry;\r\n }\r\n case NodeGeometryBlockConnectionPointTypes.Vector2:\r\n return Vector2.Transform(value, matrix);\r\n case NodeGeometryBlockConnectionPointTypes.Vector3:\r\n return Vector3.TransformCoordinates(value, matrix);\r\n case NodeGeometryBlockConnectionPointTypes.Vector4:\r\n return Vector4.TransformCoordinates(value, matrix);\r\n }\r\n\r\n return null;\r\n };\r\n\r\n if (this.evaluateContext) {\r\n this.output._storedFunction = func;\r\n } else {\r\n this.output._storedFunction = null;\r\n this.output._storedValue = func(state);\r\n }\r\n }\r\n\r\n protected _dumpPropertiesCode() {\r\n const codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.evaluateContext = ${this.evaluateContext ? \"true\" : \"false\"};\\n`;\r\n return codeString;\r\n }\r\n\r\n /**\r\n * Serializes this block in a JSON representation\r\n * @returns the serialized block object\r\n */\r\n public serialize(): any {\r\n const serializationObject = super.serialize();\r\n\r\n serializationObject.evaluateContext = this.evaluateContext;\r\n\r\n return serializationObject;\r\n }\r\n\r\n public _deserialize(serializationObject: any) {\r\n super._deserialize(serializationObject);\r\n\r\n if (serializationObject.evaluateContext !== undefined) {\r\n this.evaluateContext = serializationObject.evaluateContext;\r\n }\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.GeometryTransformBlock\", GeometryTransformBlock);\r\n"]}
1
+ {"version":3,"file":"geometryTransformBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Meshes/Node/Blocks/geometryTransformBlock.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,qCAAqC,EAAE,MAAM,2CAA2C,CAAC;AAClG,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAE/E,OAAO,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAGnG;;GAEG;AACH,MAAM,OAAO,sBAAuB,SAAQ,iBAAiB;IAczD;;;OAGG;IACH,YAAmB,IAAY;QAC3B,KAAK,CAAC,IAAI,CAAC,CAAC;QAlBR,oBAAe,GAAG,IAAI,MAAM,EAAE,CAAC;QAC/B,mBAAc,GAAG,IAAI,MAAM,EAAE,CAAC;QAC9B,uBAAkB,GAAG,IAAI,MAAM,EAAE,CAAC;QAClC,2BAAsB,GAAG,IAAI,MAAM,EAAE,CAAC;QACtC,qBAAgB,GAAG,IAAI,MAAM,EAAE,CAAC;QAExC;;;WAGG;QAEI,oBAAe,GAAG,IAAI,CAAC;QAS1B,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,qCAAqC,CAAC,UAAU,CAAC,CAAC;QAC9E,IAAI,CAAC,aAAa,CAAC,QAAQ,EAAE,qCAAqC,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QACjF,IAAI,CAAC,aAAa,CAAC,aAAa,EAAE,qCAAqC,CAAC,OAAO,EAAE,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,MAAM,CAAC,YAAY,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC;SAC1C;IACL,CAAC;IAEkB,mBAAmB;QAClC,MAAM,UAAU,GAAG,KAAK,CAAC,mBAAmB,EAAE,GAAG,GAAG,IAAI,CAAC,iBAAiB,sBAAsB,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,KAAK,CAAC;QAC7I,OAAO,UAAU,CAAC;IACtB,CAAC;IAED;;;OAGG;IACa,SAAS;QACrB,MAAM,mBAAmB,GAAG,KAAK,CAAC,SAAS,EAAE,CAAC;QAE9C,mBAAmB,CAAC,eAAe,GAAG,IAAI,CAAC,eAAe,CAAC;QAE3D,OAAO,mBAAmB,CAAC;IAC/B,CAAC;IAEe,YAAY,CAAC,mBAAwB;QACjD,KAAK,CAAC,YAAY,CAAC,mBAAmB,CAAC,CAAC;QAExC,IAAI,mBAAmB,CAAC,eAAe,KAAK,SAAS,EAAE;YACnD,IAAI,CAAC,eAAe,GAAG,mBAAmB,CAAC,eAAe,CAAC;SAC9D;IACL,CAAC;CACJ;AA3JU;IADN,sBAAsB,CAAC,kBAAkB,EAAE,sBAAsB,CAAC,OAAO,EAAE,UAAU,EAAE,EAAE,SAAS,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,CAAC;+DAC3F;AA6JlC,aAAa,CAAC,gCAAgC,EAAE,sBAAsB,CAAC,CAAC","sourcesContent":["import { NodeGeometryBlock } from \"../nodeGeometryBlock\";\r\nimport type { NodeGeometryConnectionPoint } from \"../nodeGeometryBlockConnectionPoint\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\nimport { NodeGeometryBlockConnectionPointTypes } from \"../Enums/nodeGeometryConnectionPointTypes\";\r\nimport { Matrix, Vector2, Vector3, Vector4 } from \"../../../Maths/math.vector\";\r\nimport type { VertexData } from \"../../../Meshes/mesh.vertexData\";\r\nimport { PropertyTypeForEdition, editableInPropertyPage } from \"../../../Decorators/nodeDecorator\";\r\nimport type { NodeGeometryBuildState } from \"../nodeGeometryBuildState\";\r\n\r\n/**\r\n * Block used to apply a transform to a vector / geometry\r\n */\r\nexport class GeometryTransformBlock extends NodeGeometryBlock {\r\n private _rotationMatrix = new Matrix();\r\n private _scalingMatrix = new Matrix();\r\n private _translationMatrix = new Matrix();\r\n private _scalingRotationMatrix = new Matrix();\r\n private _transformMatrix = new Matrix();\r\n\r\n /**\r\n * Gets or sets a boolean indicating that this block can evaluate context\r\n * Build performance is improved when this value is set to false as the system will cache values instead of reevaluating everything per context change\r\n */\r\n @editableInPropertyPage(\"Evaluate context\", PropertyTypeForEdition.Boolean, \"ADVANCED\", { notifiers: { rebuild: true } })\r\n public evaluateContext = true;\r\n\r\n /**\r\n * Create a new GeometryTransformBlock\r\n * @param name defines the block name\r\n */\r\n public constructor(name: string) {\r\n super(name);\r\n\r\n this.registerInput(\"value\", NodeGeometryBlockConnectionPointTypes.AutoDetect);\r\n this.registerInput(\"matrix\", NodeGeometryBlockConnectionPointTypes.Matrix, true);\r\n this.registerInput(\"translation\", NodeGeometryBlockConnectionPointTypes.Vector3, true, Vector3.Zero());\r\n this.registerInput(\"rotation\", NodeGeometryBlockConnectionPointTypes.Vector3, true, Vector3.Zero());\r\n this.registerInput(\"scaling\", NodeGeometryBlockConnectionPointTypes.Vector3, true, Vector3.One());\r\n\r\n this.registerOutput(\"output\", NodeGeometryBlockConnectionPointTypes.BasedOnInput);\r\n\r\n this._outputs[0]._typeConnectionSource = this._inputs[0];\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Float);\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Matrix);\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Texture);\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public override getClassName() {\r\n return \"GeometryTransformBlock\";\r\n }\r\n\r\n /**\r\n * Gets the value input component\r\n */\r\n public get value(): NodeGeometryConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the matrix input component\r\n */\r\n public get matrix(): NodeGeometryConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the translation input component\r\n */\r\n public get translation(): NodeGeometryConnectionPoint {\r\n return this._inputs[2];\r\n }\r\n\r\n /**\r\n * Gets the rotation input component\r\n */\r\n public get rotation(): NodeGeometryConnectionPoint {\r\n return this._inputs[3];\r\n }\r\n\r\n /**\r\n * Gets the scaling input component\r\n */\r\n public get scaling(): NodeGeometryConnectionPoint {\r\n return this._inputs[4];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeGeometryConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected override _buildBlock(state: NodeGeometryBuildState) {\r\n if (!this.value.isConnected) {\r\n this.output._storedFunction = null;\r\n this.output._storedValue = null;\r\n return;\r\n }\r\n\r\n const func = (state: NodeGeometryBuildState) => {\r\n const value = this.value.getConnectedValue(state);\r\n\r\n if (!value) {\r\n return null;\r\n }\r\n\r\n let matrix: Matrix;\r\n\r\n if (this.matrix.isConnected) {\r\n matrix = this.matrix.getConnectedValue(state);\r\n } else {\r\n const scaling = this.scaling.getConnectedValue(state);\r\n const rotation = this.rotation.getConnectedValue(state);\r\n const translation = this.translation.getConnectedValue(state);\r\n\r\n // Transform\r\n Matrix.ScalingToRef(scaling.x, scaling.y, scaling.z, this._scalingMatrix);\r\n Matrix.RotationYawPitchRollToRef(rotation.y, rotation.x, rotation.z, this._rotationMatrix);\r\n Matrix.TranslationToRef(translation.x, translation.y, translation.z, this._translationMatrix);\r\n\r\n this._scalingMatrix.multiplyToRef(this._rotationMatrix, this._scalingRotationMatrix);\r\n this._scalingRotationMatrix.multiplyToRef(this._translationMatrix, this._transformMatrix);\r\n matrix = this._transformMatrix;\r\n }\r\n\r\n switch (this.value.type) {\r\n case NodeGeometryBlockConnectionPointTypes.Geometry: {\r\n const geometry = (value as VertexData).clone();\r\n geometry.transform(matrix);\r\n return geometry;\r\n }\r\n case NodeGeometryBlockConnectionPointTypes.Vector2:\r\n return Vector2.Transform(value, matrix);\r\n case NodeGeometryBlockConnectionPointTypes.Vector3:\r\n return Vector3.TransformCoordinates(value, matrix);\r\n case NodeGeometryBlockConnectionPointTypes.Vector4:\r\n return Vector4.TransformCoordinates(value, matrix);\r\n }\r\n\r\n return null;\r\n };\r\n\r\n if (this.evaluateContext) {\r\n this.output._storedFunction = func;\r\n } else {\r\n this.output._storedFunction = null;\r\n this.output._storedValue = func(state);\r\n }\r\n }\r\n\r\n protected override _dumpPropertiesCode() {\r\n const codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.evaluateContext = ${this.evaluateContext ? \"true\" : \"false\"};\\n`;\r\n return codeString;\r\n }\r\n\r\n /**\r\n * Serializes this block in a JSON representation\r\n * @returns the serialized block object\r\n */\r\n public override serialize(): any {\r\n const serializationObject = super.serialize();\r\n\r\n serializationObject.evaluateContext = this.evaluateContext;\r\n\r\n return serializationObject;\r\n }\r\n\r\n public override _deserialize(serializationObject: any) {\r\n super._deserialize(serializationObject);\r\n\r\n if (serializationObject.evaluateContext !== undefined) {\r\n this.evaluateContext = serializationObject.evaluateContext;\r\n }\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.GeometryTransformBlock\", GeometryTransformBlock);\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"geometryTrigonometryBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Meshes/Node/Blocks/geometryTrigonometryBlock.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,qCAAqC,EAAE,MAAM,2CAA2C,CAAC;AAClG,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAGzD,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CA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AE;YAChE,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,mCAAmC,CAAC,MAAM,EAAE;YACtE,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,mCAAmC,CAAC,MAAM,EAAE;YACtE,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,mCAAmC,CAAC,MAAM,EAAE;YACtE,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,mCAAmC,CAAC,IAAI,EAAE;YAClE,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,mCAAmC,CAAC,MAAM,EAAE;YACtE,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,mCAAmC,CAAC,QAAQ,EAAE;YAC1E,EAAE,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,mCAAmC,CAAC,UAAU,EAAE;YAC9E,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,mCAAmC,CAAC,SAAS,EAAE;YAC5E,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,mCAAmC,CAAC,SAAS,EAAE;YAC5E,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,mCAAmC,CAAC,KAAK,EAAE;SACvE;KACJ,CAAC;4DACyD;AAuM/D,aAAa,CAAC,mCAAmC,EAAE,yBAAyB,CAAC,CAAC","sourcesContent":["import type { Nullable } from \"../../../types\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\nimport { NodeGeometryBlockConnectionPointTypes } from \"../Enums/nodeGeometryConnectionPointTypes\";\r\nimport { NodeGeometryBlock } from \"../nodeGeometryBlock\";\r\nimport type { NodeGeometryConnectionPoint } from \"../nodeGeometryBlockConnectionPoint\";\r\nimport type { NodeGeometryBuildState } from \"../nodeGeometryBuildState\";\r\nimport { Vector2, Vector3, Vector4 } from \"../../../Maths/math.vector\";\r\nimport { PropertyTypeForEdition, editableInPropertyPage } from \"../../../Decorators/nodeDecorator\";\r\n\r\n/**\r\n * Operations supported by the Trigonometry block\r\n */\r\nexport enum GeometryTrigonometryBlockOperations {\r\n /** Cos */\r\n Cos,\r\n /** Sin */\r\n Sin,\r\n /** Abs */\r\n Abs,\r\n /** Exp */\r\n Exp,\r\n /** Round */\r\n Round,\r\n /** Floor */\r\n Floor,\r\n /** Ceiling */\r\n Ceiling,\r\n /** Square root */\r\n Sqrt,\r\n /** Log */\r\n Log,\r\n /** Tangent */\r\n Tan,\r\n /** Arc tangent */\r\n ArcTan,\r\n /** Arc cosinus */\r\n ArcCos,\r\n /** Arc sinus */\r\n ArcSin,\r\n /** Sign */\r\n Sign,\r\n /** Negate */\r\n Negate,\r\n /** OneMinus */\r\n OneMinus,\r\n /** Reciprocal */\r\n Reciprocal,\r\n /** ToDegrees */\r\n ToDegrees,\r\n /** ToRadians */\r\n ToRadians,\r\n /** Fract */\r\n Fract,\r\n /** Exp2 */\r\n Exp2,\r\n}\r\n\r\n/**\r\n * Block used to apply trigonometry operation to floats\r\n */\r\nexport class GeometryTrigonometryBlock extends NodeGeometryBlock {\r\n /**\r\n * Gets or sets the operation applied by the block\r\n */\r\n @editableInPropertyPage(\"Operation\", PropertyTypeForEdition.List, \"ADVANCED\", {\r\n notifiers: { rebuild: true },\r\n options: [\r\n { label: \"Cos\", value: GeometryTrigonometryBlockOperations.Cos },\r\n { label: \"Sin\", value: GeometryTrigonometryBlockOperations.Sin },\r\n { label: \"Abs\", value: GeometryTrigonometryBlockOperations.Abs },\r\n { label: \"Exp\", value: GeometryTrigonometryBlockOperations.Exp },\r\n { label: \"Exp2\", value: GeometryTrigonometryBlockOperations.Exp2 },\r\n { label: \"Round\", value: GeometryTrigonometryBlockOperations.Round },\r\n { label: \"Floor\", value: GeometryTrigonometryBlockOperations.Floor },\r\n { label: \"Ceiling\", value: GeometryTrigonometryBlockOperations.Ceiling },\r\n { label: \"Sqrt\", value: GeometryTrigonometryBlockOperations.Sqrt },\r\n { label: \"Log\", value: GeometryTrigonometryBlockOperations.Log },\r\n { label: \"Tan\", value: GeometryTrigonometryBlockOperations.Tan },\r\n { label: \"ArcTan\", value: GeometryTrigonometryBlockOperations.ArcTan },\r\n { label: \"ArcCos\", value: GeometryTrigonometryBlockOperations.ArcCos },\r\n { label: \"ArcSin\", value: GeometryTrigonometryBlockOperations.ArcSin },\r\n { label: \"Sign\", value: GeometryTrigonometryBlockOperations.Sign },\r\n { label: \"Negate\", value: GeometryTrigonometryBlockOperations.Negate },\r\n { label: \"OneMinus\", value: GeometryTrigonometryBlockOperations.OneMinus },\r\n { label: \"Reciprocal\", value: GeometryTrigonometryBlockOperations.Reciprocal },\r\n { label: \"ToDegrees\", value: GeometryTrigonometryBlockOperations.ToDegrees },\r\n { label: \"ToRadians\", value: GeometryTrigonometryBlockOperations.ToRadians },\r\n { label: \"Fract\", value: GeometryTrigonometryBlockOperations.Fract },\r\n ],\r\n })\r\n public operation = GeometryTrigonometryBlockOperations.Cos;\r\n\r\n /**\r\n * Creates a new GeometryTrigonometryBlock\r\n * @param name defines the block name\r\n */\r\n public constructor(name: string) {\r\n super(name);\r\n\r\n this.registerInput(\"input\", NodeGeometryBlockConnectionPointTypes.AutoDetect);\r\n this.registerOutput(\"output\", NodeGeometryBlockConnectionPointTypes.BasedOnInput);\r\n\r\n this._outputs[0]._typeConnectionSource = this._inputs[0];\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Matrix);\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Geometry);\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Texture);\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public getClassName() {\r\n return \"GeometryTrigonometryBlock\";\r\n }\r\n\r\n /**\r\n * Gets the input component\r\n */\r\n public get input(): NodeGeometryConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeGeometryConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected _buildBlock(state: NodeGeometryBuildState) {\r\n super._buildBlock(state);\r\n let func: Nullable<(value: number) => number> = null;\r\n\r\n switch (this.operation) {\r\n case GeometryTrigonometryBlockOperations.Cos: {\r\n func = (value: number) => Math.cos(value);\r\n break;\r\n }\r\n case GeometryTrigonometryBlockOperations.Sin: {\r\n func = (value: number) => Math.sin(value);\r\n break;\r\n }\r\n case GeometryTrigonometryBlockOperations.Abs: {\r\n func = (value: number) => Math.abs(value);\r\n break;\r\n }\r\n case GeometryTrigonometryBlockOperations.Exp: {\r\n func = (value: number) => Math.exp(value);\r\n break;\r\n }\r\n case GeometryTrigonometryBlockOperations.Exp2: {\r\n func = (value: number) => Math.pow(2, value);\r\n break;\r\n }\r\n case GeometryTrigonometryBlockOperations.Round: {\r\n func = (value: number) => Math.round(value);\r\n break;\r\n }\r\n case GeometryTrigonometryBlockOperations.Floor: {\r\n func = (value: number) => Math.floor(value);\r\n break;\r\n }\r\n case GeometryTrigonometryBlockOperations.Ceiling: {\r\n func = (value: number) => Math.ceil(value);\r\n break;\r\n }\r\n case GeometryTrigonometryBlockOperations.Sqrt: {\r\n func = (value: number) => Math.sqrt(value);\r\n break;\r\n }\r\n case GeometryTrigonometryBlockOperations.Log: {\r\n func = (value: number) => Math.log(value);\r\n break;\r\n }\r\n case GeometryTrigonometryBlockOperations.Tan: {\r\n func = (value: number) => Math.tan(value);\r\n break;\r\n }\r\n case GeometryTrigonometryBlockOperations.ArcTan: {\r\n func = (value: number) => Math.atan(value);\r\n break;\r\n }\r\n case GeometryTrigonometryBlockOperations.ArcCos: {\r\n func = (value: number) => Math.acos(value);\r\n break;\r\n }\r\n case GeometryTrigonometryBlockOperations.ArcSin: {\r\n func = (value: number) => Math.asin(value);\r\n break;\r\n }\r\n case GeometryTrigonometryBlockOperations.Sign: {\r\n func = (value: number) => Math.sign(value);\r\n break;\r\n }\r\n case GeometryTrigonometryBlockOperations.Negate: {\r\n func = (value: number) => -value;\r\n break;\r\n }\r\n case GeometryTrigonometryBlockOperations.OneMinus: {\r\n func = (value: number) => 1 - value;\r\n break;\r\n }\r\n case GeometryTrigonometryBlockOperations.Reciprocal: {\r\n func = (value: number) => 1 / value;\r\n break;\r\n }\r\n case GeometryTrigonometryBlockOperations.ToRadians: {\r\n func = (value: number) => (value * Math.PI) / 180;\r\n break;\r\n }\r\n case GeometryTrigonometryBlockOperations.ToDegrees: {\r\n func = (value: number) => (value * 180) / Math.PI;\r\n break;\r\n }\r\n case GeometryTrigonometryBlockOperations.Fract: {\r\n func = (value: number) => {\r\n if (value >= 0) {\r\n return value - Math.floor(value);\r\n } else {\r\n return value - Math.ceil(value);\r\n }\r\n };\r\n break;\r\n }\r\n }\r\n if (!func) {\r\n this.output._storedFunction = null;\r\n this.output._storedValue = null;\r\n return;\r\n }\r\n\r\n switch (this.input.type) {\r\n case NodeGeometryBlockConnectionPointTypes.Int:\r\n case NodeGeometryBlockConnectionPointTypes.Float: {\r\n this.output._storedFunction = (state) => {\r\n const source = this.input.getConnectedValue(state);\r\n return func!(source);\r\n };\r\n break;\r\n }\r\n case NodeGeometryBlockConnectionPointTypes.Vector2: {\r\n this.output._storedFunction = (state) => {\r\n const source = this.input.getConnectedValue(state);\r\n return new Vector2(func!(source.x), func!(source.y));\r\n };\r\n break;\r\n }\r\n case NodeGeometryBlockConnectionPointTypes.Vector3: {\r\n this.output._storedFunction = (state) => {\r\n const source = this.input.getConnectedValue(state);\r\n return new Vector3(func!(source.x), func!(source.y), func!(source.z));\r\n };\r\n break;\r\n }\r\n case NodeGeometryBlockConnectionPointTypes.Vector4: {\r\n this.output._storedFunction = (state) => {\r\n const source = this.input.getConnectedValue(state);\r\n return new Vector4(func!(source.x), func!(source.y), func!(source.z), func!(source.w));\r\n };\r\n break;\r\n }\r\n }\r\n\r\n return this;\r\n }\r\n\r\n public serialize(): any {\r\n const serializationObject = super.serialize();\r\n\r\n serializationObject.operation = this.operation;\r\n\r\n return serializationObject;\r\n }\r\n\r\n public _deserialize(serializationObject: any) {\r\n super._deserialize(serializationObject);\r\n\r\n this.operation = serializationObject.operation;\r\n }\r\n\r\n protected _dumpPropertiesCode() {\r\n const codeString =\r\n super._dumpPropertiesCode() +\r\n `${this._codeVariableName}.operation = BABYLON.GeometryTrigonometryBlockOperations.${GeometryTrigonometryBlockOperations[this.operation]};\\n`;\r\n return codeString;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.GeometryTrigonometryBlock\", GeometryTrigonometryBlock);\r\n"]}
1
+ {"version":3,"file":"geometryTrigonometryBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Meshes/Node/Blocks/geometryTrigonometryBlock.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,qCAAqC,EAAE,MAAM,2CAA2C,CAAC;AAClG,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAGzD,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AACvE,OAAO,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAEnG;;GAEG;AACH,MAAM,CAAN,IAAY,mCA2CX;AA3CD,WAAY,mCAAmC;IAC3C,UAAU;IACV,2FAAG,CAAA;IACH,UAAU;IACV,2FAAG,CAAA;IACH,UAAU;IACV,2FAAG,CAAA;IACH,UAAU;IACV,2FAAG,CAAA;IACH,YAAY;IACZ,+FAAK,CAAA;IACL,YAAY;IACZ,+FAAK,CAAA;IACL,cAAc;IACd,mGAAO,CAAA;IACP,kBAAkB;IAClB,6FAAI,CAAA;IACJ,UAAU;IACV,2FAAG,CAAA;IACH,cAAc;IACd,2FAAG,CAAA;IACH,kBAAkB;IAClB,kGAAM,CAAA;IACN,kBAAkB;IAClB,kGAAM,CAAA;IACN,gBAAgB;IAChB,kGAAM,CAAA;IACN,WAAW;IACX,8FAAI,CAA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E,WAAW,EAAE,KAAK,EAAE,mCAAmC,CAAC,SAAS,EAAE;YAC5E,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,mCAAmC,CAAC,SAAS,EAAE;YAC5E,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,mCAAmC,CAAC,KAAK,EAAE;SACvE;KACJ,CAAC;4DACyD;AAuM/D,aAAa,CAAC,mCAAmC,EAAE,yBAAyB,CAAC,CAAC","sourcesContent":["import type { Nullable } from \"../../../types\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\nimport { NodeGeometryBlockConnectionPointTypes } from \"../Enums/nodeGeometryConnectionPointTypes\";\r\nimport { NodeGeometryBlock } from \"../nodeGeometryBlock\";\r\nimport type { NodeGeometryConnectionPoint } from \"../nodeGeometryBlockConnectionPoint\";\r\nimport type { NodeGeometryBuildState } from \"../nodeGeometryBuildState\";\r\nimport { Vector2, Vector3, Vector4 } from \"../../../Maths/math.vector\";\r\nimport { PropertyTypeForEdition, editableInPropertyPage } from \"../../../Decorators/nodeDecorator\";\r\n\r\n/**\r\n * Operations supported by the Trigonometry block\r\n */\r\nexport enum GeometryTrigonometryBlockOperations {\r\n /** Cos */\r\n Cos,\r\n /** Sin */\r\n Sin,\r\n /** Abs */\r\n Abs,\r\n /** Exp */\r\n Exp,\r\n /** Round */\r\n Round,\r\n /** Floor */\r\n Floor,\r\n /** Ceiling */\r\n Ceiling,\r\n /** Square root */\r\n Sqrt,\r\n /** Log */\r\n Log,\r\n /** Tangent */\r\n Tan,\r\n /** Arc tangent */\r\n ArcTan,\r\n /** Arc cosinus */\r\n ArcCos,\r\n /** Arc sinus */\r\n ArcSin,\r\n /** Sign */\r\n Sign,\r\n /** Negate */\r\n Negate,\r\n /** OneMinus */\r\n OneMinus,\r\n /** Reciprocal */\r\n Reciprocal,\r\n /** ToDegrees */\r\n ToDegrees,\r\n /** ToRadians */\r\n ToRadians,\r\n /** Fract */\r\n Fract,\r\n /** Exp2 */\r\n Exp2,\r\n}\r\n\r\n/**\r\n * Block used to apply trigonometry operation to floats\r\n */\r\nexport class GeometryTrigonometryBlock extends NodeGeometryBlock {\r\n /**\r\n * Gets or sets the operation applied by the block\r\n */\r\n @editableInPropertyPage(\"Operation\", PropertyTypeForEdition.List, \"ADVANCED\", {\r\n notifiers: { rebuild: true },\r\n options: [\r\n { label: \"Cos\", value: GeometryTrigonometryBlockOperations.Cos },\r\n { label: \"Sin\", value: GeometryTrigonometryBlockOperations.Sin },\r\n { label: \"Abs\", value: GeometryTrigonometryBlockOperations.Abs },\r\n { label: \"Exp\", value: GeometryTrigonometryBlockOperations.Exp },\r\n { label: \"Exp2\", value: GeometryTrigonometryBlockOperations.Exp2 },\r\n { label: \"Round\", value: GeometryTrigonometryBlockOperations.Round },\r\n { label: \"Floor\", value: GeometryTrigonometryBlockOperations.Floor },\r\n { label: \"Ceiling\", value: GeometryTrigonometryBlockOperations.Ceiling },\r\n { label: \"Sqrt\", value: GeometryTrigonometryBlockOperations.Sqrt },\r\n { label: \"Log\", value: GeometryTrigonometryBlockOperations.Log },\r\n { label: \"Tan\", value: GeometryTrigonometryBlockOperations.Tan },\r\n { label: \"ArcTan\", value: GeometryTrigonometryBlockOperations.ArcTan },\r\n { label: \"ArcCos\", value: GeometryTrigonometryBlockOperations.ArcCos },\r\n { label: \"ArcSin\", value: GeometryTrigonometryBlockOperations.ArcSin },\r\n { label: \"Sign\", value: GeometryTrigonometryBlockOperations.Sign },\r\n { label: \"Negate\", value: GeometryTrigonometryBlockOperations.Negate },\r\n { label: \"OneMinus\", value: GeometryTrigonometryBlockOperations.OneMinus },\r\n { label: \"Reciprocal\", value: GeometryTrigonometryBlockOperations.Reciprocal },\r\n { label: \"ToDegrees\", value: GeometryTrigonometryBlockOperations.ToDegrees },\r\n { label: \"ToRadians\", value: GeometryTrigonometryBlockOperations.ToRadians },\r\n { label: \"Fract\", value: GeometryTrigonometryBlockOperations.Fract },\r\n ],\r\n })\r\n public operation = GeometryTrigonometryBlockOperations.Cos;\r\n\r\n /**\r\n * Creates a new GeometryTrigonometryBlock\r\n * @param name defines the block name\r\n */\r\n public constructor(name: string) {\r\n super(name);\r\n\r\n this.registerInput(\"input\", NodeGeometryBlockConnectionPointTypes.AutoDetect);\r\n this.registerOutput(\"output\", NodeGeometryBlockConnectionPointTypes.BasedOnInput);\r\n\r\n this._outputs[0]._typeConnectionSource = this._inputs[0];\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Matrix);\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Geometry);\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Texture);\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public override getClassName() {\r\n return \"GeometryTrigonometryBlock\";\r\n }\r\n\r\n /**\r\n * Gets the input component\r\n */\r\n public get input(): NodeGeometryConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeGeometryConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected override _buildBlock(state: NodeGeometryBuildState) {\r\n super._buildBlock(state);\r\n let func: Nullable<(value: number) => number> = null;\r\n\r\n switch (this.operation) {\r\n case GeometryTrigonometryBlockOperations.Cos: {\r\n func = (value: number) => Math.cos(value);\r\n break;\r\n }\r\n case GeometryTrigonometryBlockOperations.Sin: {\r\n func = (value: number) => Math.sin(value);\r\n break;\r\n }\r\n case GeometryTrigonometryBlockOperations.Abs: {\r\n func = (value: number) => Math.abs(value);\r\n break;\r\n }\r\n case GeometryTrigonometryBlockOperations.Exp: {\r\n func = (value: number) => Math.exp(value);\r\n break;\r\n }\r\n case GeometryTrigonometryBlockOperations.Exp2: {\r\n func = (value: number) => Math.pow(2, value);\r\n break;\r\n }\r\n case GeometryTrigonometryBlockOperations.Round: {\r\n func = (value: number) => Math.round(value);\r\n break;\r\n }\r\n case GeometryTrigonometryBlockOperations.Floor: {\r\n func = (value: number) => Math.floor(value);\r\n break;\r\n }\r\n case GeometryTrigonometryBlockOperations.Ceiling: {\r\n func = (value: number) => Math.ceil(value);\r\n break;\r\n }\r\n case GeometryTrigonometryBlockOperations.Sqrt: {\r\n func = (value: number) => Math.sqrt(value);\r\n break;\r\n }\r\n case GeometryTrigonometryBlockOperations.Log: {\r\n func = (value: number) => Math.log(value);\r\n break;\r\n }\r\n case GeometryTrigonometryBlockOperations.Tan: {\r\n func = (value: number) => Math.tan(value);\r\n break;\r\n }\r\n case GeometryTrigonometryBlockOperations.ArcTan: {\r\n func = (value: number) => Math.atan(value);\r\n break;\r\n }\r\n case GeometryTrigonometryBlockOperations.ArcCos: {\r\n func = (value: number) => Math.acos(value);\r\n break;\r\n }\r\n case GeometryTrigonometryBlockOperations.ArcSin: {\r\n func = (value: number) => Math.asin(value);\r\n break;\r\n }\r\n case GeometryTrigonometryBlockOperations.Sign: {\r\n func = (value: number) => Math.sign(value);\r\n break;\r\n }\r\n case GeometryTrigonometryBlockOperations.Negate: {\r\n func = (value: number) => -value;\r\n break;\r\n }\r\n case GeometryTrigonometryBlockOperations.OneMinus: {\r\n func = (value: number) => 1 - value;\r\n break;\r\n }\r\n case GeometryTrigonometryBlockOperations.Reciprocal: {\r\n func = (value: number) => 1 / value;\r\n break;\r\n }\r\n case GeometryTrigonometryBlockOperations.ToRadians: {\r\n func = (value: number) => (value * Math.PI) / 180;\r\n break;\r\n }\r\n case GeometryTrigonometryBlockOperations.ToDegrees: {\r\n func = (value: number) => (value * 180) / Math.PI;\r\n break;\r\n }\r\n case GeometryTrigonometryBlockOperations.Fract: {\r\n func = (value: number) => {\r\n if (value >= 0) {\r\n return value - Math.floor(value);\r\n } else {\r\n return value - Math.ceil(value);\r\n }\r\n };\r\n break;\r\n }\r\n }\r\n if (!func) {\r\n this.output._storedFunction = null;\r\n this.output._storedValue = null;\r\n return;\r\n }\r\n\r\n switch (this.input.type) {\r\n case NodeGeometryBlockConnectionPointTypes.Int:\r\n case NodeGeometryBlockConnectionPointTypes.Float: {\r\n this.output._storedFunction = (state) => {\r\n const source = this.input.getConnectedValue(state);\r\n return func!(source);\r\n };\r\n break;\r\n }\r\n case NodeGeometryBlockConnectionPointTypes.Vector2: {\r\n this.output._storedFunction = (state) => {\r\n const source = this.input.getConnectedValue(state);\r\n return new Vector2(func!(source.x), func!(source.y));\r\n };\r\n break;\r\n }\r\n case NodeGeometryBlockConnectionPointTypes.Vector3: {\r\n this.output._storedFunction = (state) => {\r\n const source = this.input.getConnectedValue(state);\r\n return new Vector3(func!(source.x), func!(source.y), func!(source.z));\r\n };\r\n break;\r\n }\r\n case NodeGeometryBlockConnectionPointTypes.Vector4: {\r\n this.output._storedFunction = (state) => {\r\n const source = this.input.getConnectedValue(state);\r\n return new Vector4(func!(source.x), func!(source.y), func!(source.z), func!(source.w));\r\n };\r\n break;\r\n }\r\n }\r\n\r\n return this;\r\n }\r\n\r\n public override serialize(): any {\r\n const serializationObject = super.serialize();\r\n\r\n serializationObject.operation = this.operation;\r\n\r\n return serializationObject;\r\n }\r\n\r\n public override _deserialize(serializationObject: any) {\r\n super._deserialize(serializationObject);\r\n\r\n this.operation = serializationObject.operation;\r\n }\r\n\r\n protected override _dumpPropertiesCode() {\r\n const codeString =\r\n super._dumpPropertiesCode() +\r\n `${this._codeVariableName}.operation = BABYLON.GeometryTrigonometryBlockOperations.${GeometryTrigonometryBlockOperations[this.operation]};\\n`;\r\n return codeString;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.GeometryTrigonometryBlock\", GeometryTrigonometryBlock);\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"intFloatConverterBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Meshes/Node/Blocks/intFloatConverterBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,qCAAqC,EAAE,MAAM,2CAA2C,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E,EAAE;YACtC,IAAI,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE;gBAC1B,OAAO,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;aAChD;YACD,IAAI,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE;gBACxB,OAAO,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;aAC9C;YAED,OAAO,CAAC,CAAC;QACb,CAAC,CAAC;QAEF,IAAI,CAAC,MAAM,CAAC,eAAe,GAAG,CAAC,KAAK,EAAE,EAAE;YACpC,IAAI,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE;gBAC1B,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC,CAAC;aAC5D;YACD,IAAI,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE;gBACxB,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC,CAAC;aAC1D;YAED,OAAO,CAAC,CAAC;QACb,CAAC,CAAC;IACN,CAAC;CACJ;AAED,aAAa,CAAC,gCAAgC,EAAE,sBAAsB,CAAC,CAAC","sourcesContent":["import { RegisterClass } from \"../../../Misc/typeStore\";\r\nimport { NodeGeometryBlockConnectionPointTypes } from \"../Enums/nodeGeometryConnectionPointTypes\";\r\nimport { NodeGeometryBlock } from \"../nodeGeometryBlock\";\r\nimport type { NodeGeometryConnectionPoint } from \"../nodeGeometryBlockConnectionPoint\";\r\n\r\n/**\r\n * Defines a block used to convert from int to float\r\n */\r\nexport class IntFloatConverterBlock extends NodeGeometryBlock {\r\n /**\r\n * Create a new IntFloatConverterBlock\r\n * @param name defines the block name\r\n */\r\n public constructor(name: string) {\r\n super(name);\r\n\r\n this.registerInput(\"float \", NodeGeometryBlockConnectionPointTypes.Float, true);\r\n this.registerInput(\"int \", NodeGeometryBlockConnectionPointTypes.Int, true);\r\n\r\n this.registerOutput(\"float\", NodeGeometryBlockConnectionPointTypes.Float);\r\n this.registerOutput(\"int\", NodeGeometryBlockConnectionPointTypes.Int);\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public getClassName() {\r\n return \"IntFloatConverterBlock\";\r\n }\r\n\r\n /**\r\n * Gets the float input component\r\n */\r\n public get floatIn(): NodeGeometryConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the int input component\r\n */\r\n public get intIn(): NodeGeometryConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the float output component\r\n */\r\n public get floatOut(): NodeGeometryConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n /**\r\n * Gets the int output component\r\n */\r\n public get intOut(): NodeGeometryConnectionPoint {\r\n return this._outputs[1];\r\n }\r\n\r\n protected _inputRename(name: string) {\r\n if (name === \"float \") {\r\n return \"floatIn\";\r\n }\r\n if (name === \"int \") {\r\n return \"intIn\";\r\n }\r\n return name;\r\n }\r\n\r\n protected _buildBlock() {\r\n this.floatOut._storedFunction = (state) => {\r\n if (this.floatIn.isConnected) {\r\n return this.floatIn.getConnectedValue(state);\r\n }\r\n if (this.intIn.isConnected) {\r\n return this.intIn.getConnectedValue(state);\r\n }\r\n\r\n return 0;\r\n };\r\n\r\n this.intOut._storedFunction = (state) => {\r\n if (this.floatIn.isConnected) {\r\n return Math.floor(this.floatIn.getConnectedValue(state));\r\n }\r\n if (this.intIn.isConnected) {\r\n return Math.floor(this.intIn.getConnectedValue(state));\r\n }\r\n\r\n return 0;\r\n };\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.IntFloatConverterBlock\", IntFloatConverterBlock);\r\n"]}
1
+ {"version":3,"file":"intFloatConverterBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Meshes/Node/Blocks/intFloatConverterBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EA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AC;IAEkB,WAAW;QAC1B,IAAI,CAAC,QAAQ,CAAC,eAAe,GAAG,CAAC,KAAK,EAAE,EAAE;YACtC,IAAI,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE;gBAC1B,OAAO,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;aAChD;YACD,IAAI,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE;gBACxB,OAAO,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;aAC9C;YAED,OAAO,CAAC,CAAC;QACb,CAAC,CAAC;QAEF,IAAI,CAAC,MAAM,CAAC,eAAe,GAAG,CAAC,KAAK,EAAE,EAAE;YACpC,IAAI,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE;gBAC1B,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC,CAAC;aAC5D;YACD,IAAI,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE;gBACxB,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC,CAAC;aAC1D;YAED,OAAO,CAAC,CAAC;QACb,CAAC,CAAC;IACN,CAAC;CACJ;AAED,aAAa,CAAC,gCAAgC,EAAE,sBAAsB,CAAC,CAAC","sourcesContent":["import { RegisterClass } from \"../../../Misc/typeStore\";\r\nimport { NodeGeometryBlockConnectionPointTypes } from \"../Enums/nodeGeometryConnectionPointTypes\";\r\nimport { NodeGeometryBlock } from \"../nodeGeometryBlock\";\r\nimport type { NodeGeometryConnectionPoint } from \"../nodeGeometryBlockConnectionPoint\";\r\n\r\n/**\r\n * Defines a block used to convert from int to float\r\n */\r\nexport class IntFloatConverterBlock extends NodeGeometryBlock {\r\n /**\r\n * Create a new IntFloatConverterBlock\r\n * @param name defines the block name\r\n */\r\n public constructor(name: string) {\r\n super(name);\r\n\r\n this.registerInput(\"float \", NodeGeometryBlockConnectionPointTypes.Float, true);\r\n this.registerInput(\"int \", NodeGeometryBlockConnectionPointTypes.Int, true);\r\n\r\n this.registerOutput(\"float\", NodeGeometryBlockConnectionPointTypes.Float);\r\n this.registerOutput(\"int\", NodeGeometryBlockConnectionPointTypes.Int);\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public override getClassName() {\r\n return \"IntFloatConverterBlock\";\r\n }\r\n\r\n /**\r\n * Gets the float input component\r\n */\r\n public get floatIn(): NodeGeometryConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the int input component\r\n */\r\n public get intIn(): NodeGeometryConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the float output component\r\n */\r\n public get floatOut(): NodeGeometryConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n /**\r\n * Gets the int output component\r\n */\r\n public get intOut(): NodeGeometryConnectionPoint {\r\n return this._outputs[1];\r\n }\r\n\r\n protected override _inputRename(name: string) {\r\n if (name === \"float \") {\r\n return \"floatIn\";\r\n }\r\n if (name === \"int \") {\r\n return \"intIn\";\r\n }\r\n return name;\r\n }\r\n\r\n protected override _buildBlock() {\r\n this.floatOut._storedFunction = (state) => {\r\n if (this.floatIn.isConnected) {\r\n return this.floatIn.getConnectedValue(state);\r\n }\r\n if (this.intIn.isConnected) {\r\n return this.intIn.getConnectedValue(state);\r\n }\r\n\r\n return 0;\r\n };\r\n\r\n this.intOut._storedFunction = (state) => {\r\n if (this.floatIn.isConnected) {\r\n return Math.floor(this.floatIn.getConnectedValue(state));\r\n }\r\n if (this.intIn.isConnected) {\r\n return Math.floor(this.intIn.getConnectedValue(state));\r\n }\r\n\r\n return 0;\r\n };\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.IntFloatConverterBlock\", IntFloatConverterBlock);\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"mapRangeBlock.js","sourceRoot":"","sources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C,OAAO;SACV;QAED,IAAI,CAAC,MAAM,CAAC,eAAe,GAAG,CAAC,KAAK,EAAE,EAAE;YACpC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;YAClD,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;YACtD,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;YACtD,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;YAClD,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;YAElD,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,OAAO,GAAG,OAAO,CAAC,CAAC,GAAG,CAAC,KAAK,GAAG,KAAK,CAAC,GAAG,KAAK,CAAC;YAEnF,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,KAAK,qCAAqC,CAAC,GAAG,EAAE;gBAChE,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;aAC7B;YAED,OAAO,MAAM,CAAC;QAClB,CAAC,CAAC;IACN,CAAC;CACJ;AAED,aAAa,CAAC,uBAAuB,EAAE,aAAa,CAAC,CAAC","sourcesContent":["import { RegisterClass } from \"../../../Misc/typeStore\";\r\nimport { NodeGeometryBlockConnectionPointTypes } from \"../Enums/nodeGeometryConnectionPointTypes\";\r\nimport { NodeGeometryBlock } from \"../nodeGeometryBlock\";\r\nimport type { NodeGeometryConnectionPoint } from \"../nodeGeometryBlockConnectionPoint\";\r\n\r\n/**\r\n * Defines a block used to move a value from a range to another\r\n */\r\nexport class MapRangeBlock extends NodeGeometryBlock {\r\n /**\r\n * Create a new MapRangeBlock\r\n * @param name defines the block name\r\n */\r\n public constructor(name: string) {\r\n super(name);\r\n\r\n this.registerInput(\"value\", NodeGeometryBlockConnectionPointTypes.AutoDetect);\r\n this.registerInput(\"fromMin\", NodeGeometryBlockConnectionPointTypes.Float, true, 0);\r\n this.registerInput(\"fromMax\", NodeGeometryBlockConnectionPointTypes.Float, true, 1);\r\n this.registerInput(\"toMin\", NodeGeometryBlockConnectionPointTypes.Float, true, 0);\r\n this.registerInput(\"toMax\", NodeGeometryBlockConnectionPointTypes.Float, true, 1);\r\n\r\n this.registerOutput(\"output\", NodeGeometryBlockConnectionPointTypes.BasedOnInput);\r\n\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Vector2);\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Vector3);\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Vector4);\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Matrix);\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Geometry);\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Texture);\r\n this._outputs[0]._typeConnectionSource = this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public getClassName() {\r\n return \"MapRangeBlock\";\r\n }\r\n\r\n /**\r\n * Gets the value input component\r\n */\r\n public get value(): NodeGeometryConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the fromMin input component\r\n */\r\n public get fromMin(): NodeGeometryConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the fromMax input component\r\n */\r\n public get fromMax(): NodeGeometryConnectionPoint {\r\n return this._inputs[2];\r\n }\r\n\r\n /**\r\n * Gets the toMin input component\r\n */\r\n public get toMin(): NodeGeometryConnectionPoint {\r\n return this._inputs[3];\r\n }\r\n\r\n /**\r\n * Gets the toMax input component\r\n */\r\n public get toMax(): NodeGeometryConnectionPoint {\r\n return this._inputs[4];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeGeometryConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected _buildBlock() {\r\n if (!this.value.isConnected) {\r\n this.output._storedFunction = null;\r\n this.output._storedValue = null;\r\n return;\r\n }\r\n\r\n this.output._storedFunction = (state) => {\r\n const value = this.value.getConnectedValue(state);\r\n const fromMin = this.fromMin.getConnectedValue(state);\r\n const fromMax = this.fromMax.getConnectedValue(state);\r\n const toMin = this.toMin.getConnectedValue(state);\r\n const toMax = this.toMax.getConnectedValue(state);\r\n\r\n const result = ((value - fromMin) / (fromMax - fromMin)) * (toMax - toMin) + toMin;\r\n\r\n if (this.output.type === NodeGeometryBlockConnectionPointTypes.Int) {\r\n return Math.floor(result);\r\n }\r\n\r\n return result;\r\n };\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.MapRangeBlock\", MapRangeBlock);\r\n"]}
1
+ {"version":3,"file":"mapRangeBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Meshes/Node/Blocks/mapRangeBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,qCAAqC,EAAE,MAAM,2CAA2C,CAAC;AAClG,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAGzD;;GAEG;AACH,MAAM,OAAO,aAAc,SAAQ,iBAAiB;IAChD;;;OAGG;IACH,YAAmB,IAAY;QAC3B,KAAK,CAAC,IAAI,CAAC,CAAC;QAEZ,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,qCAAqC,CAAC,UAAU,CAAC,CAAC;QAC9E,IAAI,CAAC,aAAa,CAAC,SAAS,EAAE,qCAAqC,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QACpF,IAAI,CAAC,aAAa,CAAC,SAAS,EAAE,qC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O,GAAG,OAAO,CAAC,CAAC,GAAG,CAAC,KAAK,GAAG,KAAK,CAAC,GAAG,KAAK,CAAC;YAEnF,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,KAAK,qCAAqC,CAAC,GAAG,EAAE;gBAChE,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;aAC7B;YAED,OAAO,MAAM,CAAC;QAClB,CAAC,CAAC;IACN,CAAC;CACJ;AAED,aAAa,CAAC,uBAAuB,EAAE,aAAa,CAAC,CAAC","sourcesContent":["import { RegisterClass } from \"../../../Misc/typeStore\";\r\nimport { NodeGeometryBlockConnectionPointTypes } from \"../Enums/nodeGeometryConnectionPointTypes\";\r\nimport { NodeGeometryBlock } from \"../nodeGeometryBlock\";\r\nimport type { NodeGeometryConnectionPoint } from \"../nodeGeometryBlockConnectionPoint\";\r\n\r\n/**\r\n * Defines a block used to move a value from a range to another\r\n */\r\nexport class MapRangeBlock extends NodeGeometryBlock {\r\n /**\r\n * Create a new MapRangeBlock\r\n * @param name defines the block name\r\n */\r\n public constructor(name: string) {\r\n super(name);\r\n\r\n this.registerInput(\"value\", NodeGeometryBlockConnectionPointTypes.AutoDetect);\r\n this.registerInput(\"fromMin\", NodeGeometryBlockConnectionPointTypes.Float, true, 0);\r\n this.registerInput(\"fromMax\", NodeGeometryBlockConnectionPointTypes.Float, true, 1);\r\n this.registerInput(\"toMin\", NodeGeometryBlockConnectionPointTypes.Float, true, 0);\r\n this.registerInput(\"toMax\", NodeGeometryBlockConnectionPointTypes.Float, true, 1);\r\n\r\n this.registerOutput(\"output\", NodeGeometryBlockConnectionPointTypes.BasedOnInput);\r\n\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Vector2);\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Vector3);\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Vector4);\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Matrix);\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Geometry);\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Texture);\r\n this._outputs[0]._typeConnectionSource = this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public override getClassName() {\r\n return \"MapRangeBlock\";\r\n }\r\n\r\n /**\r\n * Gets the value input component\r\n */\r\n public get value(): NodeGeometryConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the fromMin input component\r\n */\r\n public get fromMin(): NodeGeometryConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the fromMax input component\r\n */\r\n public get fromMax(): NodeGeometryConnectionPoint {\r\n return this._inputs[2];\r\n }\r\n\r\n /**\r\n * Gets the toMin input component\r\n */\r\n public get toMin(): NodeGeometryConnectionPoint {\r\n return this._inputs[3];\r\n }\r\n\r\n /**\r\n * Gets the toMax input component\r\n */\r\n public get toMax(): NodeGeometryConnectionPoint {\r\n return this._inputs[4];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeGeometryConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected override _buildBlock() {\r\n if (!this.value.isConnected) {\r\n this.output._storedFunction = null;\r\n this.output._storedValue = null;\r\n return;\r\n }\r\n\r\n this.output._storedFunction = (state) => {\r\n const value = this.value.getConnectedValue(state);\r\n const fromMin = this.fromMin.getConnectedValue(state);\r\n const fromMax = this.fromMax.getConnectedValue(state);\r\n const toMin = this.toMin.getConnectedValue(state);\r\n const toMax = this.toMax.getConnectedValue(state);\r\n\r\n const result = ((value - fromMin) / (fromMax - fromMin)) * (toMax - toMin) + toMin;\r\n\r\n if (this.output.type === NodeGeometryBlockConnectionPointTypes.Int) {\r\n return Math.floor(result);\r\n }\r\n\r\n return result;\r\n };\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.MapRangeBlock\", MapRangeBlock);\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"mappingBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Meshes/Node/Blocks/mappingBlock.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,qCAAqC,EAAE,MAAM,2CAA2C,CAAC;AAElG,OAAO,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AACnG,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAE9D;;GAEG;AACH,MAAM,CAAN,IAAY,YAOX;AAPD,WAAY,YAAY;IACpB,gBAAgB;IAChB,yDAAS,CAAA;IACT,kBAAkB;IAClB,6DAAW,CAAA;IACX,YAAY;IACZ,iDAAK,CAAA;AACT,CAAC,EAPW,YAAY,KAAZ,YAAY,QAOvB;AAED;;GAEG;AACH,MAAM,OAAO,YAAa,SAAQ,iBAAiB;IAc/C;;;OAGG;IACH,YAAmB,IAAY;QAC3B,KAAK,CAAC,IAAI,CAAC,CAAC;QAlBhB;;WAEG;QASI,YAAO,GAAG,YAAY,CAAC,SAAS,CAAC;QASpC,IAAI,CAAC,aAAa,CAAC,UAAU,EAAE,qCAAqC,CAAC,OAAO,CAAC,CAAC;QAC9E,IAAI,CAAC,aAAa,CAAC,QAAQ,EAAE,qCAAqC,CAAC,OAAO,CAAC,CAAC;QAC5E,IAAI,CAAC,aAAa,CAAC,QAAQ,EAAE,qCAAqC,CAAC,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;QAClG,IAAI,CAAC,cAAc,CAAC,IAAI,EAAE,qCAAqC,CAAC,OAAO,CAAC,CAAC;IAC7E,CAAC;IAED;;;OAGG;IACI,YA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EAAE;YAChC,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC;QACvB,CAAC,CAAC;IACN,CAAC;IAES,mBAAmB;QACzB,MAAM,UAAU,GAAG,KAAK,CAAC,mBAAmB,EAAE,GAAG,GAAG,IAAI,CAAC,iBAAiB,mCAAmC,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC;QAC7I,OAAO,UAAU,CAAC;IACtB,CAAC;IAED;;;OAGG;IACI,SAAS;QACZ,MAAM,mBAAmB,GAAG,KAAK,CAAC,SAAS,EAAE,CAAC;QAE9C,mBAAmB,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;QAE3C,OAAO,mBAAmB,CAAC;IAC/B,CAAC;IAEM,YAAY,CAAC,mBAAwB;QACxC,KAAK,CAAC,YAAY,CAAC,mBAAmB,CAAC,CAAC;QAExC,IAAI,CAAC,OAAO,GAAG,mBAAmB,CAAC,OAAO,CAAC;IAC/C,CAAC;CACJ;AA7IU;IARN,sBAAsB,CAAC,SAAS,EAAE,sBAAsB,CAAC,IAAI,EAAE,UAAU,EAAE;QACxE,SAAS,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;QAC5B,OAAO,EAAE;YACL,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,YAAY,CAAC,SAAS,EAAE;YACrD,EAAE,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,YAAY,CAAC,WAAW,EAAE;YACzD,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,YAAY,CAAC,KAAK,EAAE;SAChD;KACJ,CAAC;6CACsC;AA+I5C,aAAa,CAAC,sBAAsB,EAAE,YAAY,CAAC,CAAC","sourcesContent":["import { NodeGeometryBlock } from \"../nodeGeometryBlock\";\r\nimport type { NodeGeometryConnectionPoint } from \"../nodeGeometryBlockConnectionPoint\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\nimport { NodeGeometryBlockConnectionPointTypes } from \"../Enums/nodeGeometryConnectionPointTypes\";\r\nimport type { NodeGeometryBuildState } from \"../nodeGeometryBuildState\";\r\nimport { PropertyTypeForEdition, editableInPropertyPage } from \"../../../Decorators/nodeDecorator\";\r\nimport { Vector2, Vector3 } from \"../../../Maths/math.vector\";\r\n\r\n/**\r\n * Type of mappings supported by the mapping block\r\n */\r\nexport enum MappingTypes {\r\n /** Spherical */\r\n Spherical,\r\n /** Cylindrical */\r\n Cylindrical,\r\n /** Cubic */\r\n Cubic,\r\n}\r\n\r\n/**\r\n * Block used to generate UV coordinates\r\n */\r\nexport class MappingBlock extends NodeGeometryBlock {\r\n /**\r\n * Gets or sets the mapping type used by the block\r\n */\r\n @editableInPropertyPage(\"Mapping\", PropertyTypeForEdition.List, \"ADVANCED\", {\r\n notifiers: { rebuild: true },\r\n options: [\r\n { label: \"Spherical\", value: MappingTypes.Spherical },\r\n { label: \"Cylindrical\", value: MappingTypes.Cylindrical },\r\n { label: \"Cubic\", value: MappingTypes.Cubic },\r\n ],\r\n })\r\n public mapping = MappingTypes.Spherical;\r\n\r\n /**\r\n * Create a new MappingBlock\r\n * @param name defines the block name\r\n */\r\n public constructor(name: string) {\r\n super(name);\r\n\r\n this.registerInput(\"position\", NodeGeometryBlockConnectionPointTypes.Vector3);\r\n this.registerInput(\"normal\", NodeGeometryBlockConnectionPointTypes.Vector3);\r\n this.registerInput(\"center\", NodeGeometryBlockConnectionPointTypes.Vector3, true, Vector3.Zero());\r\n this.registerOutput(\"uv\", NodeGeometryBlockConnectionPointTypes.Vector2);\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public getClassName() {\r\n return \"MappingBlock\";\r\n }\r\n\r\n /**\r\n * Gets the position input component\r\n */\r\n public get position(): NodeGeometryConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the normal input component\r\n */\r\n public get normal(): NodeGeometryConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the center input component\r\n */\r\n public get center(): NodeGeometryConnectionPoint {\r\n return this._inputs[2];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get uv(): NodeGeometryConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected _buildBlock() {\r\n if (!this.position.isConnected) {\r\n this.uv._storedFunction = null;\r\n this.uv._storedValue = null;\r\n return;\r\n }\r\n const tempDirection = Vector3.Zero();\r\n\r\n const func = (state: NodeGeometryBuildState) => {\r\n const position = (this.position.getConnectedValue(state) as Vector3) || Vector3.Zero();\r\n const normal = (this.normal.getConnectedValue(state) as Vector3) || Vector3.Zero();\r\n const center = this.center.getConnectedValue(state) as Vector3;\r\n const uv = Vector2.Zero();\r\n\r\n switch (this.mapping) {\r\n case MappingTypes.Spherical: {\r\n position.subtractToRef(center, tempDirection);\r\n const len = tempDirection.length();\r\n if (len > 0) {\r\n uv.x = Math.acos(tempDirection.y / len) / Math.PI;\r\n if (tempDirection.x !== 0 || tempDirection.z !== 0) {\r\n uv.y = Math.atan2(tempDirection.x, tempDirection.z) / (Math.PI * 2);\r\n }\r\n }\r\n break;\r\n }\r\n case MappingTypes.Cylindrical: {\r\n position.subtractToRef(center, tempDirection);\r\n const len = tempDirection.length();\r\n if (len > 0) {\r\n uv.x = Math.atan2(tempDirection.x / len, tempDirection.z / len) / (Math.PI * 2);\r\n uv.y = (tempDirection.y + 1.0) / 2.0;\r\n }\r\n break;\r\n }\r\n case MappingTypes.Cubic: {\r\n // Find the largest component of the normal vector\r\n const absX = Math.abs(normal.x);\r\n const absY = Math.abs(normal.y);\r\n const absZ = Math.abs(normal.z);\r\n const maxDim = Math.max(Math.abs(position.x), Math.abs(position.y), Math.abs(position.z));\r\n\r\n let u = 0,\r\n v = 0;\r\n\r\n if (absX >= absY && absX >= absZ) {\r\n u = position.y / maxDim - center.y;\r\n v = position.z / maxDim - center.z;\r\n } else if (absY >= absX && absY >= absZ) {\r\n u = position.x / maxDim - center.x;\r\n v = position.z / maxDim - center.z;\r\n } else {\r\n u = position.x / maxDim - center.x;\r\n v = position.y / maxDim - center.y;\r\n }\r\n\r\n uv.x = (u + 1) / 2;\r\n uv.y = (v + 1) / 2;\r\n }\r\n }\r\n return uv;\r\n };\r\n\r\n this.uv._storedFunction = (state) => {\r\n return func(state);\r\n };\r\n }\r\n\r\n protected _dumpPropertiesCode() {\r\n const codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.mapping = BABYLON.MappingTypes.${MappingTypes[this.mapping]};\\n`;\r\n return codeString;\r\n }\r\n\r\n /**\r\n * Serializes this block in a JSON representation\r\n * @returns the serialized block object\r\n */\r\n public serialize(): any {\r\n const serializationObject = super.serialize();\r\n\r\n serializationObject.mapping = this.mapping;\r\n\r\n return serializationObject;\r\n }\r\n\r\n public _deserialize(serializationObject: any) {\r\n super._deserialize(serializationObject);\r\n\r\n this.mapping = serializationObject.mapping;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.MappingBlock\", MappingBlock);\r\n"]}
1
+ {"version":3,"file":"mappingBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Meshes/Node/Blocks/mappingBlock.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,qCAAqC,EAAE,MAAM,2CAA2C,CAAC;AAElG,OAAO,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AACnG,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAE9D;;GAEG;AACH,MAAM,CAAN,IAAY,YAOX;AAPD,WAAY,YAAY;IACpB,gBAAgB;IAChB,yDAAS,CAAA;IACT,kBAAkB;IAClB,6DAAW,CAAA;IACX,YAAY;IACZ,iDAAK,CAAA;AACT,CAAC,EAPW,YAAY,KAAZ,YAAY,QAOvB;AAED;;GAEG;AACH,MAAM,OAAO,YAAa,SAAQ,iBAAiB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,EAAE;QAC5B,OAAO,EAAE;YACL,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,YAAY,CAAC,SAAS,EAAE;YACrD,EAAE,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,YAAY,CAAC,WAAW,EAAE;YACzD,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,YAAY,CAAC,KAAK,EAAE;SAChD;KACJ,CAAC;6CACsC;AA+I5C,aAAa,CAAC,sBAAsB,EAAE,YAAY,CAAC,CAAC","sourcesContent":["import { NodeGeometryBlock } from \"../nodeGeometryBlock\";\r\nimport type { NodeGeometryConnectionPoint } from \"../nodeGeometryBlockConnectionPoint\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\nimport { NodeGeometryBlockConnectionPointTypes } from \"../Enums/nodeGeometryConnectionPointTypes\";\r\nimport type { NodeGeometryBuildState } from \"../nodeGeometryBuildState\";\r\nimport { PropertyTypeForEdition, editableInPropertyPage } from \"../../../Decorators/nodeDecorator\";\r\nimport { Vector2, Vector3 } from \"../../../Maths/math.vector\";\r\n\r\n/**\r\n * Type of mappings supported by the mapping block\r\n */\r\nexport enum MappingTypes {\r\n /** Spherical */\r\n Spherical,\r\n /** Cylindrical */\r\n Cylindrical,\r\n /** Cubic */\r\n Cubic,\r\n}\r\n\r\n/**\r\n * Block used to generate UV coordinates\r\n */\r\nexport class MappingBlock extends NodeGeometryBlock {\r\n /**\r\n * Gets or sets the mapping type used by the block\r\n */\r\n @editableInPropertyPage(\"Mapping\", PropertyTypeForEdition.List, \"ADVANCED\", {\r\n notifiers: { rebuild: true },\r\n options: [\r\n { label: \"Spherical\", value: MappingTypes.Spherical },\r\n { label: \"Cylindrical\", value: MappingTypes.Cylindrical },\r\n { label: \"Cubic\", value: MappingTypes.Cubic },\r\n ],\r\n })\r\n public mapping = MappingTypes.Spherical;\r\n\r\n /**\r\n * Create a new MappingBlock\r\n * @param name defines the block name\r\n */\r\n public constructor(name: string) {\r\n super(name);\r\n\r\n this.registerInput(\"position\", NodeGeometryBlockConnectionPointTypes.Vector3);\r\n this.registerInput(\"normal\", NodeGeometryBlockConnectionPointTypes.Vector3);\r\n this.registerInput(\"center\", NodeGeometryBlockConnectionPointTypes.Vector3, true, Vector3.Zero());\r\n this.registerOutput(\"uv\", NodeGeometryBlockConnectionPointTypes.Vector2);\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public override getClassName() {\r\n return \"MappingBlock\";\r\n }\r\n\r\n /**\r\n * Gets the position input component\r\n */\r\n public get position(): NodeGeometryConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the normal input component\r\n */\r\n public get normal(): NodeGeometryConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the center input component\r\n */\r\n public get center(): NodeGeometryConnectionPoint {\r\n return this._inputs[2];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get uv(): NodeGeometryConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected override _buildBlock() {\r\n if (!this.position.isConnected) {\r\n this.uv._storedFunction = null;\r\n this.uv._storedValue = null;\r\n return;\r\n }\r\n const tempDirection = Vector3.Zero();\r\n\r\n const func = (state: NodeGeometryBuildState) => {\r\n const position = (this.position.getConnectedValue(state) as Vector3) || Vector3.Zero();\r\n const normal = (this.normal.getConnectedValue(state) as Vector3) || Vector3.Zero();\r\n const center = this.center.getConnectedValue(state) as Vector3;\r\n const uv = Vector2.Zero();\r\n\r\n switch (this.mapping) {\r\n case MappingTypes.Spherical: {\r\n position.subtractToRef(center, tempDirection);\r\n const len = tempDirection.length();\r\n if (len > 0) {\r\n uv.x = Math.acos(tempDirection.y / len) / Math.PI;\r\n if (tempDirection.x !== 0 || tempDirection.z !== 0) {\r\n uv.y = Math.atan2(tempDirection.x, tempDirection.z) / (Math.PI * 2);\r\n }\r\n }\r\n break;\r\n }\r\n case MappingTypes.Cylindrical: {\r\n position.subtractToRef(center, tempDirection);\r\n const len = tempDirection.length();\r\n if (len > 0) {\r\n uv.x = Math.atan2(tempDirection.x / len, tempDirection.z / len) / (Math.PI * 2);\r\n uv.y = (tempDirection.y + 1.0) / 2.0;\r\n }\r\n break;\r\n }\r\n case MappingTypes.Cubic: {\r\n // Find the largest component of the normal vector\r\n const absX = Math.abs(normal.x);\r\n const absY = Math.abs(normal.y);\r\n const absZ = Math.abs(normal.z);\r\n const maxDim = Math.max(Math.abs(position.x), Math.abs(position.y), Math.abs(position.z));\r\n\r\n let u = 0,\r\n v = 0;\r\n\r\n if (absX >= absY && absX >= absZ) {\r\n u = position.y / maxDim - center.y;\r\n v = position.z / maxDim - center.z;\r\n } else if (absY >= absX && absY >= absZ) {\r\n u = position.x / maxDim - center.x;\r\n v = position.z / maxDim - center.z;\r\n } else {\r\n u = position.x / maxDim - center.x;\r\n v = position.y / maxDim - center.y;\r\n }\r\n\r\n uv.x = (u + 1) / 2;\r\n uv.y = (v + 1) / 2;\r\n }\r\n }\r\n return uv;\r\n };\r\n\r\n this.uv._storedFunction = (state) => {\r\n return func(state);\r\n };\r\n }\r\n\r\n protected override _dumpPropertiesCode() {\r\n const codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.mapping = BABYLON.MappingTypes.${MappingTypes[this.mapping]};\\n`;\r\n return codeString;\r\n }\r\n\r\n /**\r\n * Serializes this block in a JSON representation\r\n * @returns the serialized block object\r\n */\r\n public override serialize(): any {\r\n const serializationObject = super.serialize();\r\n\r\n serializationObject.mapping = this.mapping;\r\n\r\n return serializationObject;\r\n }\r\n\r\n public override _deserialize(serializationObject: any) {\r\n super._deserialize(serializationObject);\r\n\r\n this.mapping = serializationObject.mapping;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.MappingBlock\", MappingBlock);\r\n"]}