@babylonjs/core 7.35.1 → 7.36.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (180) hide show
  1. package/Engines/Extensions/engine.multiRender.d.ts +11 -0
  2. package/Engines/Extensions/engine.multiRender.js +71 -32
  3. package/Engines/Extensions/engine.multiRender.js.map +1 -1
  4. package/Engines/Extensions/engine.prefilteredCubeTexture.js +3 -2
  5. package/Engines/Extensions/engine.prefilteredCubeTexture.js.map +1 -1
  6. package/Engines/Extensions/engine.renderTarget.js +1 -13
  7. package/Engines/Extensions/engine.renderTarget.js.map +1 -1
  8. package/Engines/WebGL/webGLRenderTargetWrapper.d.ts +2 -0
  9. package/Engines/WebGL/webGLRenderTargetWrapper.js +37 -7
  10. package/Engines/WebGL/webGLRenderTargetWrapper.js.map +1 -1
  11. package/Engines/WebGPU/Extensions/engine.multiRender.d.ts +11 -0
  12. package/Engines/WebGPU/Extensions/engine.multiRender.js +30 -11
  13. package/Engines/WebGPU/Extensions/engine.multiRender.js.map +1 -1
  14. package/Engines/WebGPU/Extensions/engine.renderTarget.js +2 -5
  15. package/Engines/WebGPU/Extensions/engine.renderTarget.js.map +1 -1
  16. package/Engines/WebGPU/webgpuCacheRenderPipeline.js +3 -2
  17. package/Engines/WebGPU/webgpuCacheRenderPipeline.js.map +1 -1
  18. package/Engines/WebGPU/webgpuHardwareTexture.d.ts +3 -1
  19. package/Engines/WebGPU/webgpuHardwareTexture.js +5 -4
  20. package/Engines/WebGPU/webgpuHardwareTexture.js.map +1 -1
  21. package/Engines/WebGPU/webgpuTextureManager.js +2 -2
  22. package/Engines/WebGPU/webgpuTextureManager.js.map +1 -1
  23. package/Engines/abstractEngine.d.ts +11 -0
  24. package/Engines/abstractEngine.js +2 -2
  25. package/Engines/abstractEngine.js.map +1 -1
  26. package/Engines/renderTargetWrapper.d.ts +33 -1
  27. package/Engines/renderTargetWrapper.js +64 -4
  28. package/Engines/renderTargetWrapper.js.map +1 -1
  29. package/Engines/thinEngine.d.ts +13 -1
  30. package/Engines/thinEngine.js +115 -24
  31. package/Engines/thinEngine.js.map +1 -1
  32. package/Engines/thinWebGPUEngine.d.ts +2 -0
  33. package/Engines/thinWebGPUEngine.js +7 -0
  34. package/Engines/thinWebGPUEngine.js.map +1 -1
  35. package/Engines/webgpuEngine.d.ts +12 -3
  36. package/Engines/webgpuEngine.js +39 -9
  37. package/Engines/webgpuEngine.js.map +1 -1
  38. package/FrameGraph/Node/Blocks/Textures/clearBlock.d.ts +8 -0
  39. package/FrameGraph/Node/Blocks/Textures/clearBlock.js +22 -1
  40. package/FrameGraph/Node/Blocks/Textures/clearBlock.js.map +1 -1
  41. package/FrameGraph/Node/Blocks/inputBlock.d.ts +4 -9
  42. package/FrameGraph/Node/Blocks/inputBlock.js +15 -25
  43. package/FrameGraph/Node/Blocks/inputBlock.js.map +1 -1
  44. package/FrameGraph/Node/nodeRenderGraphBlockConnectionPoint.js +10 -2
  45. package/FrameGraph/Node/nodeRenderGraphBlockConnectionPoint.js.map +1 -1
  46. package/FrameGraph/Passes/renderPass.d.ts +10 -10
  47. package/FrameGraph/Passes/renderPass.js +10 -10
  48. package/FrameGraph/Passes/renderPass.js.map +1 -1
  49. package/FrameGraph/Tasks/PostProcesses/bloomTask.d.ts +10 -5
  50. package/FrameGraph/Tasks/PostProcesses/bloomTask.js +29 -14
  51. package/FrameGraph/Tasks/PostProcesses/bloomTask.js.map +1 -1
  52. package/FrameGraph/Tasks/PostProcesses/depthOfFieldMergeTask.js +4 -0
  53. package/FrameGraph/Tasks/PostProcesses/depthOfFieldMergeTask.js.map +1 -1
  54. package/FrameGraph/Tasks/PostProcesses/depthOfFieldTask.d.ts +11 -6
  55. package/FrameGraph/Tasks/PostProcesses/depthOfFieldTask.js +30 -13
  56. package/FrameGraph/Tasks/PostProcesses/depthOfFieldTask.js.map +1 -1
  57. package/FrameGraph/Tasks/PostProcesses/postProcessTask.js +4 -6
  58. package/FrameGraph/Tasks/PostProcesses/postProcessTask.js.map +1 -1
  59. package/FrameGraph/Tasks/Rendering/cullObjectsTask.d.ts +1 -1
  60. package/FrameGraph/Tasks/Rendering/cullObjectsTask.js.map +1 -1
  61. package/FrameGraph/Tasks/Rendering/geometryRendererTask.d.ts +3 -3
  62. package/FrameGraph/Tasks/Rendering/geometryRendererTask.js +33 -32
  63. package/FrameGraph/Tasks/Rendering/geometryRendererTask.js.map +1 -1
  64. package/FrameGraph/Tasks/Rendering/objectRendererTask.d.ts +4 -2
  65. package/FrameGraph/Tasks/Rendering/objectRendererTask.js +8 -12
  66. package/FrameGraph/Tasks/Rendering/objectRendererTask.js.map +1 -1
  67. package/FrameGraph/Tasks/Rendering/taaObjectRendererTask.js +13 -18
  68. package/FrameGraph/Tasks/Rendering/taaObjectRendererTask.js.map +1 -1
  69. package/FrameGraph/Tasks/Texture/clearTextureTask.d.ts +15 -2
  70. package/FrameGraph/Tasks/Texture/clearTextureTask.js +17 -4
  71. package/FrameGraph/Tasks/Texture/clearTextureTask.js.map +1 -1
  72. package/FrameGraph/Tasks/Texture/copyToTextureTask.js +2 -2
  73. package/FrameGraph/Tasks/Texture/copyToTextureTask.js.map +1 -1
  74. package/FrameGraph/Tasks/Texture/generateMipMapsTask.js +3 -3
  75. package/FrameGraph/Tasks/Texture/generateMipMapsTask.js.map +1 -1
  76. package/FrameGraph/frameGraph.d.ts +11 -74
  77. package/FrameGraph/frameGraph.js +12 -126
  78. package/FrameGraph/frameGraph.js.map +1 -1
  79. package/FrameGraph/frameGraphRenderContext.d.ts +17 -8
  80. package/FrameGraph/frameGraphRenderContext.js +55 -43
  81. package/FrameGraph/frameGraphRenderContext.js.map +1 -1
  82. package/FrameGraph/frameGraphRenderTarget.d.ts +16 -0
  83. package/FrameGraph/frameGraphRenderTarget.js +67 -0
  84. package/FrameGraph/frameGraphRenderTarget.js.map +1 -0
  85. package/FrameGraph/frameGraphTask.d.ts +4 -3
  86. package/FrameGraph/frameGraphTask.js +41 -8
  87. package/FrameGraph/frameGraphTask.js.map +1 -1
  88. package/FrameGraph/frameGraphTextureManager.d.ts +130 -22
  89. package/FrameGraph/frameGraphTextureManager.js +312 -130
  90. package/FrameGraph/frameGraphTextureManager.js.map +1 -1
  91. package/FrameGraph/frameGraphTypes.d.ts +28 -13
  92. package/FrameGraph/frameGraphTypes.js.map +1 -1
  93. package/FrameGraph/index.d.ts +1 -0
  94. package/FrameGraph/index.js +1 -0
  95. package/FrameGraph/index.js.map +1 -1
  96. package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.js +3 -2
  97. package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.js.map +1 -1
  98. package/Materials/Node/Blocks/conditionalBlock.d.ts +2 -0
  99. package/Materials/Node/Blocks/conditionalBlock.js +13 -0
  100. package/Materials/Node/Blocks/conditionalBlock.js.map +1 -1
  101. package/Materials/Node/nodeMaterialBlock.js +4 -1
  102. package/Materials/Node/nodeMaterialBlock.js.map +1 -1
  103. package/Materials/Node/nodeMaterialBlockConnectionPoint.js +12 -4
  104. package/Materials/Node/nodeMaterialBlockConnectionPoint.js.map +1 -1
  105. package/Materials/Textures/equiRectangularCubeTexture.js +14 -4
  106. package/Materials/Textures/equiRectangularCubeTexture.js.map +1 -1
  107. package/Materials/Textures/internalTexture.d.ts +20 -0
  108. package/Materials/Textures/internalTexture.js +48 -0
  109. package/Materials/Textures/internalTexture.js.map +1 -1
  110. package/Materials/Textures/multiRenderTarget.d.ts +5 -0
  111. package/Materials/Textures/multiRenderTarget.js.map +1 -1
  112. package/Materials/Textures/textureCreationOptions.d.ts +6 -6
  113. package/Materials/Textures/textureCreationOptions.js.map +1 -1
  114. package/Materials/drawWrapper.js +4 -0
  115. package/Materials/drawWrapper.js.map +1 -1
  116. package/Materials/effect.js +2 -2
  117. package/Materials/effect.js.map +1 -1
  118. package/Materials/material.d.ts +2 -2
  119. package/Materials/material.js +5 -5
  120. package/Materials/material.js.map +1 -1
  121. package/Maths/math.color.d.ts +16 -0
  122. package/Maths/math.color.js +16 -0
  123. package/Maths/math.color.js.map +1 -1
  124. package/Maths/math.vector.d.ts +32 -0
  125. package/Maths/math.vector.js +32 -0
  126. package/Maths/math.vector.js.map +1 -1
  127. package/Meshes/Compression/dracoCompression.d.ts +3 -1
  128. package/Meshes/Compression/dracoCompression.js +5 -2
  129. package/Meshes/Compression/dracoCompression.js.map +1 -1
  130. package/Meshes/Node/Blocks/Matrices/rotationXBlock.d.ts +0 -1
  131. package/Meshes/Node/Blocks/Matrices/rotationXBlock.js +1 -9
  132. package/Meshes/Node/Blocks/Matrices/rotationXBlock.js.map +1 -1
  133. package/Meshes/Node/Blocks/Matrices/rotationYBlock.d.ts +0 -1
  134. package/Meshes/Node/Blocks/Matrices/rotationYBlock.js +1 -9
  135. package/Meshes/Node/Blocks/Matrices/rotationYBlock.js.map +1 -1
  136. package/Meshes/Node/Blocks/Matrices/rotationZBlock.d.ts +0 -1
  137. package/Meshes/Node/Blocks/Matrices/rotationZBlock.js +1 -9
  138. package/Meshes/Node/Blocks/Matrices/rotationZBlock.js.map +1 -1
  139. package/Meshes/Node/Blocks/Set/latticeBlock.js +3 -1
  140. package/Meshes/Node/Blocks/Set/latticeBlock.js.map +1 -1
  141. package/Meshes/Node/Blocks/conditionBlock.d.ts +2 -0
  142. package/Meshes/Node/Blocks/conditionBlock.js +15 -0
  143. package/Meshes/Node/Blocks/conditionBlock.js.map +1 -1
  144. package/Meshes/Node/Blocks/geometryClampBlock.d.ts +4 -4
  145. package/Meshes/Node/Blocks/geometryClampBlock.js +16 -25
  146. package/Meshes/Node/Blocks/geometryClampBlock.js.map +1 -1
  147. package/Meshes/Node/Blocks/geometryLerpBlock.js +2 -2
  148. package/Meshes/Node/Blocks/geometryLerpBlock.js.map +1 -1
  149. package/Meshes/Node/Blocks/geometryNLerpBlock.js +2 -2
  150. package/Meshes/Node/Blocks/geometryNLerpBlock.js.map +1 -1
  151. package/Meshes/Node/Blocks/geometryReplaceColorBlock.js +2 -2
  152. package/Meshes/Node/Blocks/geometryReplaceColorBlock.js.map +1 -1
  153. package/Meshes/Node/Blocks/geometryRotate2dBlock.js +2 -2
  154. package/Meshes/Node/Blocks/geometryRotate2dBlock.js.map +1 -1
  155. package/Meshes/Node/Blocks/geometrySmoothStepBlock.js +3 -3
  156. package/Meshes/Node/Blocks/geometrySmoothStepBlock.js.map +1 -1
  157. package/Meshes/Node/Blocks/geometryStepBlock.js +2 -2
  158. package/Meshes/Node/Blocks/geometryStepBlock.js.map +1 -1
  159. package/Meshes/Node/nodeGeometry.js +1 -1
  160. package/Meshes/Node/nodeGeometry.js.map +1 -1
  161. package/Meshes/Node/nodeGeometryBlock.d.ts +3 -1
  162. package/Meshes/Node/nodeGeometryBlock.js +2 -1
  163. package/Meshes/Node/nodeGeometryBlock.js.map +1 -1
  164. package/Meshes/Node/nodeGeometryBlockConnectionPoint.js +10 -2
  165. package/Meshes/Node/nodeGeometryBlockConnectionPoint.js.map +1 -1
  166. package/Meshes/abstractMesh.js +1 -1
  167. package/Meshes/abstractMesh.js.map +1 -1
  168. package/Meshes/lattice.material.d.ts +1 -1
  169. package/Meshes/lattice.material.js +3 -3
  170. package/Meshes/lattice.material.js.map +1 -1
  171. package/Misc/observable.d.ts +3 -1
  172. package/Misc/observable.js +7 -2
  173. package/Misc/observable.js.map +1 -1
  174. package/ShadersWGSL/glowMapGeneration.fragment.js +4 -3
  175. package/ShadersWGSL/glowMapGeneration.fragment.js.map +1 -1
  176. package/ShadersWGSL/pbr.fragment.js +4 -3
  177. package/ShadersWGSL/pbr.fragment.js.map +1 -1
  178. package/package.json +1 -1
  179. package/scene.js +6 -6
  180. package/scene.js.map +1 -1
@@ -1,6 +1,4 @@
1
- import { __decorate } from "../../../tslib.es6.js";
2
1
  import { RegisterClass } from "../../../Misc/typeStore.js";
3
- import { editableInPropertyPage } from "../../../Decorators/nodeDecorator.js";
4
2
  import { NodeGeometryBlock } from "../nodeGeometryBlock.js";
5
3
  import { NodeGeometryBlockConnectionPointTypes } from "../Enums/nodeGeometryConnectionPointTypes.js";
6
4
  import { Vector2, Vector3, Vector4 } from "../../../Maths/math.vector.js";
@@ -8,19 +6,29 @@ import { Vector2, Vector3, Vector4 } from "../../../Maths/math.vector.js";
8
6
  * Block used to clamp a float
9
7
  */
10
8
  export class GeometryClampBlock extends NodeGeometryBlock {
9
+ /** Gets or sets the minimum range */
10
+ get minimum() {
11
+ return this.min.value;
12
+ }
13
+ set minimum(value) {
14
+ this.min.value = value;
15
+ }
16
+ /** Gets or sets the maximum range */
17
+ get maximum() {
18
+ return this.max.value;
19
+ }
20
+ set maximum(value) {
21
+ this.max.value = value;
22
+ }
11
23
  /**
12
24
  * Creates a new GeometryClampBlock
13
25
  * @param name defines the block name
14
26
  */
15
27
  constructor(name) {
16
28
  super(name);
17
- /** Gets or sets the minimum range */
18
- this.minimum = 0.0;
19
- /** Gets or sets the maximum range */
20
- this.maximum = 1.0;
21
29
  this.registerInput("value", NodeGeometryBlockConnectionPointTypes.AutoDetect);
22
- this.registerInput("min", NodeGeometryBlockConnectionPointTypes.Float, true);
23
- this.registerInput("max", NodeGeometryBlockConnectionPointTypes.Float, true);
30
+ this.registerInput("min", NodeGeometryBlockConnectionPointTypes.Float, true, 0);
31
+ this.registerInput("max", NodeGeometryBlockConnectionPointTypes.Float, true, 1);
24
32
  this.registerOutput("output", NodeGeometryBlockConnectionPointTypes.BasedOnInput);
25
33
  this._outputs[0]._typeConnectionSource = this._inputs[0];
26
34
  this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Matrix);
@@ -90,28 +98,11 @@ export class GeometryClampBlock extends NodeGeometryBlock {
90
98
  };
91
99
  return this;
92
100
  }
93
- _dumpPropertiesCode() {
94
- let codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.minimum = ${this.minimum};\n`;
95
- codeString += `${this._codeVariableName}.maximum = ${this.maximum};\n`;
96
- return codeString;
97
- }
98
- serialize() {
99
- const serializationObject = super.serialize();
100
- serializationObject.minimum = this.minimum;
101
- serializationObject.maximum = this.maximum;
102
- return serializationObject;
103
- }
104
101
  _deserialize(serializationObject) {
105
102
  super._deserialize(serializationObject);
106
103
  this.minimum = serializationObject.minimum;
107
104
  this.maximum = serializationObject.maximum;
108
105
  }
109
106
  }
110
- __decorate([
111
- editableInPropertyPage("Minimum", 1 /* PropertyTypeForEdition.Float */, undefined, { embedded: true })
112
- ], GeometryClampBlock.prototype, "minimum", void 0);
113
- __decorate([
114
- editableInPropertyPage("Maximum", 1 /* PropertyTypeForEdition.Float */, undefined, { embedded: true })
115
- ], GeometryClampBlock.prototype, "maximum", void 0);
116
107
  RegisterClass("BABYLON.GeometryClampBlock", GeometryClampBlock);
117
108
  //# sourceMappingURL=geometryClampBlock.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"geometryClampBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Meshes/Node/Blocks/geometryClampBlock.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,sBAAsB,EAA0B,MAAM,mCAAmC,CAAC;AACnG,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,qCAAqC,EAAE,MAAM,2CAA2C,CAAC;AAElG,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,sCAA+B;AAEnE;;GAEG;AACH,MAAM,OAAO,kBAAmB,SAAQ,iBAAiB;IAQrD;;;OAGG;IACH,YAAmB,IAAY;QAC3B,KAAK,CAAC,IAAI,CAAC,CAAC;QAZhB,qCAAqC;QAE9B,YAAO,GAAG,GAAG,CAAC;QACrB,qCAAqC;QAE9B,YAAO,GAAG,GAAG,CAAC;QASjB,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,qCAAqC,CAAC,UAAU,CAAC,CAAC;QAC9E,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE,qCAAqC,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;QA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CAAC;QAExC,IAAI,CAAC,OAAO,GAAG,mBAAmB,CAAC,OAAO,CAAC;QAC3C,IAAI,CAAC,OAAO,GAAG,mBAAmB,CAAC,OAAO,CAAC;IAC/C,CAAC;CACJ;AAtHU;IADN,sBAAsB,CAAC,SAAS,wCAAgC,SAAS,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;mDAC1E;AAGd;IADN,sBAAsB,CAAC,SAAS,wCAAgC,SAAS,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;mDAC1E;AAqHzB,aAAa,CAAC,4BAA4B,EAAE,kBAAkB,CAAC,CAAC","sourcesContent":["import { RegisterClass } from \"../../../Misc/typeStore\";\r\nimport { editableInPropertyPage, PropertyTypeForEdition } from \"../../../Decorators/nodeDecorator\";\r\nimport { NodeGeometryBlock } from \"../nodeGeometryBlock\";\r\nimport { NodeGeometryBlockConnectionPointTypes } from \"../Enums/nodeGeometryConnectionPointTypes\";\r\nimport type { NodeGeometryConnectionPoint } from \"../nodeGeometryBlockConnectionPoint\";\r\nimport { Vector2, Vector3, Vector4 } from \"core/Maths/math.vector\";\r\n\r\n/**\r\n * Block used to clamp a float\r\n */\r\nexport class GeometryClampBlock extends NodeGeometryBlock {\r\n /** Gets or sets the minimum range */\r\n @editableInPropertyPage(\"Minimum\", PropertyTypeForEdition.Float, undefined, { embedded: true })\r\n public minimum = 0.0;\r\n /** Gets or sets the maximum range */\r\n @editableInPropertyPage(\"Maximum\", PropertyTypeForEdition.Float, undefined, { embedded: true })\r\n public maximum = 1.0;\r\n\r\n /**\r\n * Creates a new GeometryClampBlock\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(\"min\", NodeGeometryBlockConnectionPointTypes.Float, true);\r\n this.registerInput(\"max\", NodeGeometryBlockConnectionPointTypes.Float, true);\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 \"GeometryClampBlock\";\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 min input component\r\n */\r\n public get min(): NodeGeometryConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the max input component\r\n */\r\n public get max(): 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) {\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, min: number, max: number) => {\r\n return Math.max(min, Math.min(value, max));\r\n };\r\n\r\n this.output._storedFunction = (state) => {\r\n const value = this.value.getConnectedValue(state);\r\n const min = this.min.isConnected ? this.min.getConnectedValue(state) : this.minimum;\r\n const max = this.max.isConnected ? this.max.getConnectedValue(state) : this.maximum;\r\n\r\n switch (this.value.type) {\r\n case NodeGeometryBlockConnectionPointTypes.Int:\r\n case NodeGeometryBlockConnectionPointTypes.Float: {\r\n return func!(value, min, max);\r\n }\r\n case NodeGeometryBlockConnectionPointTypes.Vector2: {\r\n return new Vector2(func!(value.x, min, max), func!(value.y, min, max));\r\n }\r\n case NodeGeometryBlockConnectionPointTypes.Vector3: {\r\n return new Vector3(func!(value.x, min, max), func!(value.y, min, max), func!(value.z, min, max));\r\n }\r\n case NodeGeometryBlockConnectionPointTypes.Vector4: {\r\n return new Vector4(func!(value.x, min, max), func!(value.y, min, max), func!(value.z, min, max), func!(value.w, min, max));\r\n }\r\n }\r\n\r\n return 0;\r\n };\r\n\r\n return this;\r\n }\r\n\r\n protected override _dumpPropertiesCode() {\r\n let codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.minimum = ${this.minimum};\\n`;\r\n codeString += `${this._codeVariableName}.maximum = ${this.maximum};\\n`;\r\n return codeString;\r\n }\r\n\r\n public override serialize(): any {\r\n const serializationObject = super.serialize();\r\n\r\n serializationObject.minimum = this.minimum;\r\n serializationObject.maximum = this.maximum;\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.minimum = serializationObject.minimum;\r\n this.maximum = serializationObject.maximum;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.GeometryClampBlock\", GeometryClampBlock);\r\n"]}
1
+ {"version":3,"file":"geometryClampBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Meshes/Node/Blocks/geometryClampBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,qCAAqC,EAAE,MAAM,2CAA2C,CAAC;AAElG,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,sCAA+B;AAEnE;;GAEG;AACH,MAAM,OAAO,kBAAmB,SAAQ,iBAAiB;IACrD,qCAAqC;IACrC,IAAW,OAAO;QACd,OAAO,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC;IAC1B,CAAC;IAED,IAAW,OAAO,CAAC,KAAa;QAC5B,IAAI,CAAC,GAAG,CAAC,KAAK,GAAG,KAAK,CAAC;IAC3B,CAAC;IAED,qCAAqC;IACrC,IAAW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,CAAC;QAC3C,IAAI,CAAC,OAAO,GAAG,mBAAmB,CAAC,OAAO,CAAC;IAC/C,CAAC;CACJ;AAED,aAAa,CAAC,4BAA4B,EAAE,kBAAkB,CAAC,CAAC","sourcesContent":["import { RegisterClass } from \"../../../Misc/typeStore\";\r\nimport { NodeGeometryBlock } from \"../nodeGeometryBlock\";\r\nimport { NodeGeometryBlockConnectionPointTypes } from \"../Enums/nodeGeometryConnectionPointTypes\";\r\nimport type { NodeGeometryConnectionPoint } from \"../nodeGeometryBlockConnectionPoint\";\r\nimport { Vector2, Vector3, Vector4 } from \"core/Maths/math.vector\";\r\n\r\n/**\r\n * Block used to clamp a float\r\n */\r\nexport class GeometryClampBlock extends NodeGeometryBlock {\r\n /** Gets or sets the minimum range */\r\n public get minimum() {\r\n return this.min.value;\r\n }\r\n\r\n public set minimum(value: number) {\r\n this.min.value = value;\r\n }\r\n\r\n /** Gets or sets the maximum range */\r\n public get maximum() {\r\n return this.max.value;\r\n }\r\n\r\n public set maximum(value: number) {\r\n this.max.value = value;\r\n }\r\n\r\n /**\r\n * Creates a new GeometryClampBlock\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(\"min\", NodeGeometryBlockConnectionPointTypes.Float, true, 0);\r\n this.registerInput(\"max\", NodeGeometryBlockConnectionPointTypes.Float, true, 1);\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 \"GeometryClampBlock\";\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 min input component\r\n */\r\n public get min(): NodeGeometryConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the max input component\r\n */\r\n public get max(): 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) {\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, min: number, max: number) => {\r\n return Math.max(min, Math.min(value, max));\r\n };\r\n\r\n this.output._storedFunction = (state) => {\r\n const value = this.value.getConnectedValue(state);\r\n const min = this.min.isConnected ? this.min.getConnectedValue(state) : this.minimum;\r\n const max = this.max.isConnected ? this.max.getConnectedValue(state) : this.maximum;\r\n\r\n switch (this.value.type) {\r\n case NodeGeometryBlockConnectionPointTypes.Int:\r\n case NodeGeometryBlockConnectionPointTypes.Float: {\r\n return func!(value, min, max);\r\n }\r\n case NodeGeometryBlockConnectionPointTypes.Vector2: {\r\n return new Vector2(func!(value.x, min, max), func!(value.y, min, max));\r\n }\r\n case NodeGeometryBlockConnectionPointTypes.Vector3: {\r\n return new Vector3(func!(value.x, min, max), func!(value.y, min, max), func!(value.z, min, max));\r\n }\r\n case NodeGeometryBlockConnectionPointTypes.Vector4: {\r\n return new Vector4(func!(value.x, min, max), func!(value.y, min, max), func!(value.z, min, max), func!(value.w, min, max));\r\n }\r\n }\r\n\r\n return 0;\r\n };\r\n\r\n return this;\r\n }\r\n\r\n public override _deserialize(serializationObject: any) {\r\n super._deserialize(serializationObject);\r\n\r\n this.minimum = serializationObject.minimum;\r\n this.maximum = serializationObject.maximum;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.GeometryClampBlock\", GeometryClampBlock);\r\n"]}
@@ -14,7 +14,7 @@ export class GeometryLerpBlock extends NodeGeometryBlock {
14
14
  super(name);
15
15
  this.registerInput("left", NodeGeometryBlockConnectionPointTypes.AutoDetect);
16
16
  this.registerInput("right", NodeGeometryBlockConnectionPointTypes.AutoDetect);
17
- this.registerInput("gradient", NodeGeometryBlockConnectionPointTypes.Float);
17
+ this.registerInput("gradient", NodeGeometryBlockConnectionPointTypes.Float, true, 0, 0, 1);
18
18
  this.registerOutput("output", NodeGeometryBlockConnectionPointTypes.BasedOnInput);
19
19
  this._outputs[0]._typeConnectionSource = this._inputs[0];
20
20
  this._linkConnectionTypes(0, 1);
@@ -54,7 +54,7 @@ export class GeometryLerpBlock extends NodeGeometryBlock {
54
54
  return this._outputs[0];
55
55
  }
56
56
  _buildBlock() {
57
- if (!this.left.isConnected || !this.right.isConnected || !this.gradient.isConnected) {
57
+ if (!this.left.isConnected || !this.right.isConnected) {
58
58
  this.output._storedFunction = null;
59
59
  this.output._storedValue = null;
60
60
  return;
@@ -1 +1 @@
1
- {"version":3,"file":"geometryLerpBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Meshes/Node/Blocks/geometryLerpBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD,OAAO,EAAE,qCAAqC,EAAE,MAAM,2CAA2C,CAAC;AAClG,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,sCAA+B;AACnE;;GAEG;AACH,MAAM,OAAO,iBAAkB,SAAQ,iBAAiB;IACpD;;;OAGG;IACH,YAAmB,IAAY;QAC3B,KAAK,CAAC,IAAI,CAAC,CAAC;QAEZ,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE,qCAAqC,CAAC,UAAU,CAAC,CAAC;QAC7E,IAA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AC,OAAO,CAAC,CAAC,CAAC;oBACjD,OAAO,IAAI,OAAO,CAAC,IAAK,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,IAAK,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,IAAK,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;gBAC7H,CAAC;gBACD,KAAK,qCAAqC,CAAC,OAAO,CAAC,CAAC,CAAC;oBACjD,OAAO,IAAI,OAAO,CAAC,IAAK,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,IAAK,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,IAAK,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,IAAK,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;gBAC/J,CAAC;YACL,CAAC;YAED,OAAO,CAAC,CAAC;QACb,CAAC,CAAC;QAEF,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ;AAED,aAAa,CAAC,2BAA2B,EAAE,iBAAiB,CAAC,CAAC","sourcesContent":["import { RegisterClass } from \"../../../Misc/typeStore\";\r\nimport { NodeGeometryBlock } from \"../nodeGeometryBlock\";\r\nimport type { NodeGeometryConnectionPoint } from \"../nodeGeometryBlockConnectionPoint\";\r\nimport { NodeGeometryBlockConnectionPointTypes } from \"../Enums/nodeGeometryConnectionPointTypes\";\r\nimport { Vector2, Vector3, Vector4 } from \"core/Maths/math.vector\";\r\n/**\r\n * Block used to lerp between 2 values\r\n */\r\nexport class GeometryLerpBlock extends NodeGeometryBlock {\r\n /**\r\n * Creates a new GeometryLerpBlock\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(\"left\", NodeGeometryBlockConnectionPointTypes.AutoDetect);\r\n this.registerInput(\"right\", NodeGeometryBlockConnectionPointTypes.AutoDetect);\r\n this.registerInput(\"gradient\", NodeGeometryBlockConnectionPointTypes.Float);\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 \"GeometryLerpBlock\";\r\n }\r\n\r\n /**\r\n * Gets the left operand input component\r\n */\r\n public get left(): NodeGeometryConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the right operand input component\r\n */\r\n public get right(): NodeGeometryConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the gradient operand input component\r\n */\r\n public get gradient(): 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.left.isConnected || !this.right.isConnected || !this.gradient.isConnected) {\r\n this.output._storedFunction = null;\r\n this.output._storedValue = null;\r\n return;\r\n }\r\n\r\n const func = (gradient: number, left: number, right: number) => {\r\n return (1 - gradient) * left + gradient * right;\r\n };\r\n\r\n this.output._storedFunction = (state) => {\r\n const left = this.left.getConnectedValue(state);\r\n const right = this.right.getConnectedValue(state);\r\n const gradient = this.gradient.getConnectedValue(state);\r\n switch (this.left.type) {\r\n case NodeGeometryBlockConnectionPointTypes.Int:\r\n case NodeGeometryBlockConnectionPointTypes.Float: {\r\n return func!(gradient, left, right);\r\n }\r\n case NodeGeometryBlockConnectionPointTypes.Vector2: {\r\n return new Vector2(func!(gradient, left.x, right.x), func!(gradient, left.y, right.y));\r\n }\r\n case NodeGeometryBlockConnectionPointTypes.Vector3: {\r\n return new Vector3(func!(gradient, left.x, right.x), func!(gradient, left.y, right.y), func!(gradient, left.z, right.z));\r\n }\r\n case NodeGeometryBlockConnectionPointTypes.Vector4: {\r\n return new Vector4(func!(gradient, left.x, right.x), func!(gradient, left.y, right.y), func!(gradient, left.z, right.z), func!(gradient, left.w, right.w));\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.GeometryLerpBlock\", GeometryLerpBlock);\r\n"]}
1
+ {"version":3,"file":"geometryLerpBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Meshes/Node/Blocks/geometryLerpBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD,OAAO,EAAE,qCAAqC,EAAE,MAAM,2CAA2C,CAAC;AAClG,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,sCAA+B;AACnE;;GAEG;AACH,MAAM,OAAO,iBAAkB,SAAQ,iBAAiB;IACpD;;;OAGG;IACH,YAAmB,IAAY;QAC3B,KAAK,CAAC,IAAI,CAAC,CAAC;QAEZ,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE,qCAAqC,CAAC,UAAU,CAAC,CAAC;QAC7E,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,qCAAqC,CAAC,UAAU,CAAC,CAAC;QAC9E,IAAI,CAAC,aAAa,CAAC,UAAU,EAAE,qCAAqC,CA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CAAC,CAAC,CAAC,EAAE,IAAK,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,IAAK,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;gBAC7H,CAAC;gBACD,KAAK,qCAAqC,CAAC,OAAO,CAAC,CAAC,CAAC;oBACjD,OAAO,IAAI,OAAO,CAAC,IAAK,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,IAAK,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,IAAK,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,IAAK,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;gBAC/J,CAAC;YACL,CAAC;YAED,OAAO,CAAC,CAAC;QACb,CAAC,CAAC;QAEF,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ;AAED,aAAa,CAAC,2BAA2B,EAAE,iBAAiB,CAAC,CAAC","sourcesContent":["import { RegisterClass } from \"../../../Misc/typeStore\";\r\nimport { NodeGeometryBlock } from \"../nodeGeometryBlock\";\r\nimport type { NodeGeometryConnectionPoint } from \"../nodeGeometryBlockConnectionPoint\";\r\nimport { NodeGeometryBlockConnectionPointTypes } from \"../Enums/nodeGeometryConnectionPointTypes\";\r\nimport { Vector2, Vector3, Vector4 } from \"core/Maths/math.vector\";\r\n/**\r\n * Block used to lerp between 2 values\r\n */\r\nexport class GeometryLerpBlock extends NodeGeometryBlock {\r\n /**\r\n * Creates a new GeometryLerpBlock\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(\"left\", NodeGeometryBlockConnectionPointTypes.AutoDetect);\r\n this.registerInput(\"right\", NodeGeometryBlockConnectionPointTypes.AutoDetect);\r\n this.registerInput(\"gradient\", NodeGeometryBlockConnectionPointTypes.Float, true, 0, 0, 1);\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 \"GeometryLerpBlock\";\r\n }\r\n\r\n /**\r\n * Gets the left operand input component\r\n */\r\n public get left(): NodeGeometryConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the right operand input component\r\n */\r\n public get right(): NodeGeometryConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the gradient operand input component\r\n */\r\n public get gradient(): 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.left.isConnected || !this.right.isConnected) {\r\n this.output._storedFunction = null;\r\n this.output._storedValue = null;\r\n return;\r\n }\r\n\r\n const func = (gradient: number, left: number, right: number) => {\r\n return (1 - gradient) * left + gradient * right;\r\n };\r\n\r\n this.output._storedFunction = (state) => {\r\n const left = this.left.getConnectedValue(state);\r\n const right = this.right.getConnectedValue(state);\r\n const gradient = this.gradient.getConnectedValue(state);\r\n switch (this.left.type) {\r\n case NodeGeometryBlockConnectionPointTypes.Int:\r\n case NodeGeometryBlockConnectionPointTypes.Float: {\r\n return func!(gradient, left, right);\r\n }\r\n case NodeGeometryBlockConnectionPointTypes.Vector2: {\r\n return new Vector2(func!(gradient, left.x, right.x), func!(gradient, left.y, right.y));\r\n }\r\n case NodeGeometryBlockConnectionPointTypes.Vector3: {\r\n return new Vector3(func!(gradient, left.x, right.x), func!(gradient, left.y, right.y), func!(gradient, left.z, right.z));\r\n }\r\n case NodeGeometryBlockConnectionPointTypes.Vector4: {\r\n return new Vector4(func!(gradient, left.x, right.x), func!(gradient, left.y, right.y), func!(gradient, left.z, right.z), func!(gradient, left.w, right.w));\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.GeometryLerpBlock\", GeometryLerpBlock);\r\n"]}
@@ -14,7 +14,7 @@ export class GeometryNLerpBlock extends NodeGeometryBlock {
14
14
  super(name);
15
15
  this.registerInput("left", NodeGeometryBlockConnectionPointTypes.AutoDetect);
16
16
  this.registerInput("right", NodeGeometryBlockConnectionPointTypes.AutoDetect);
17
- this.registerInput("gradient", NodeGeometryBlockConnectionPointTypes.Float);
17
+ this.registerInput("gradient", NodeGeometryBlockConnectionPointTypes.Float, true, 0, 0, 1);
18
18
  this.registerOutput("output", NodeGeometryBlockConnectionPointTypes.BasedOnInput);
19
19
  this._outputs[0]._typeConnectionSource = this._inputs[0];
20
20
  this._linkConnectionTypes(0, 1);
@@ -54,7 +54,7 @@ export class GeometryNLerpBlock extends NodeGeometryBlock {
54
54
  return this._outputs[0];
55
55
  }
56
56
  _buildBlock() {
57
- if (!this.left.isConnected || !this.right.isConnected || !this.gradient.isConnected) {
57
+ if (!this.left.isConnected || !this.right.isConnected) {
58
58
  this.output._storedFunction = null;
59
59
  this.output._storedValue = null;
60
60
  return;
@@ -1 +1 @@
1
- {"version":3,"file":"geometryNLerpBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Meshes/Node/Blocks/geometryNLerpBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,OA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EAAE,IAAI,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CACnC,CAAC;oBACF,MAAM,CAAC,SAAS,EAAE,CAAC;oBAEnB,OAAO,MAAM,CAAC;gBAClB,CAAC;YACL,CAAC;YAED,OAAO,CAAC,CAAC;QACb,CAAC,CAAC;QAEF,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ;AAED,aAAa,CAAC,4BAA4B,EAAE,kBAAkB,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 normalize lerp between 2 values\r\n */\r\nexport class GeometryNLerpBlock extends NodeGeometryBlock {\r\n /**\r\n * Creates a new GeometryNLerpBlock\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(\"left\", NodeGeometryBlockConnectionPointTypes.AutoDetect);\r\n this.registerInput(\"right\", NodeGeometryBlockConnectionPointTypes.AutoDetect);\r\n this.registerInput(\"gradient\", NodeGeometryBlockConnectionPointTypes.Float);\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 \"GeometryNLerpBlock\";\r\n }\r\n\r\n /**\r\n * Gets the left operand input component\r\n */\r\n public get left(): NodeGeometryConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the right operand input component\r\n */\r\n public get right(): NodeGeometryConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the gradient operand input component\r\n */\r\n public get gradient(): 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.left.isConnected || !this.right.isConnected || !this.gradient.isConnected) {\r\n this.output._storedFunction = null;\r\n this.output._storedValue = null;\r\n return;\r\n }\r\n\r\n const func = (gradient: number, left: number, right: number) => {\r\n return (1 - gradient) * left + gradient * right;\r\n };\r\n\r\n this.output._storedFunction = (state) => {\r\n const left = this.left.getConnectedValue(state);\r\n const right = this.right.getConnectedValue(state);\r\n const gradient = this.gradient.getConnectedValue(state);\r\n switch (this.left.type) {\r\n case NodeGeometryBlockConnectionPointTypes.Int:\r\n case NodeGeometryBlockConnectionPointTypes.Float: {\r\n return func!(gradient, left, right); // NLerp is really lerp in that case\r\n }\r\n case NodeGeometryBlockConnectionPointTypes.Vector2: {\r\n const result = new Vector2(func!(gradient, left.x, right.x), func!(gradient, left.y, right.y));\r\n result.normalize();\r\n\r\n return result;\r\n }\r\n case NodeGeometryBlockConnectionPointTypes.Vector3: {\r\n const result = new Vector3(func!(gradient, left.x, right.x), func!(gradient, left.y, right.y), func!(gradient, left.z, right.z));\r\n result.normalize();\r\n\r\n return result;\r\n }\r\n case NodeGeometryBlockConnectionPointTypes.Vector4: {\r\n const result = new Vector4(\r\n func!(gradient, left.x, right.x),\r\n func!(gradient, left.y, right.y),\r\n func!(gradient, left.z, right.z),\r\n func!(gradient, left.w, right.w)\r\n );\r\n result.normalize();\r\n\r\n return result;\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.GeometryNLerpBlock\", GeometryNLerpBlock);\r\n"]}
1
+ {"version":3,"file":"geometryNLerpBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Meshes/Node/Blocks/geometryNLerpBlock.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,kBAAmB,SAAQ,iBAAiB;IACrD;;;OAGG;IACH,YAAmB,IAAY;QAC3B,KAAK,CAAC,IAAI,CAAC,CAAC;QAEZ,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE,qCAAqC,CAAC,UAAU,CAAC,CAAC;QAC7E,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,qCAAqC,CAAC,UAAU,CAAC,CAAC;QAC9E,IAAI,CAAC,aAAa,CAAC,UAAU,EAAE,qCAAqC,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;QAC3F,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,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B,IAAK,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,EAChC,IAAK,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,EAChC,IAAK,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,EAChC,IAAK,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CACnC,CAAC;oBACF,MAAM,CAAC,SAAS,EAAE,CAAC;oBAEnB,OAAO,MAAM,CAAC;gBAClB,CAAC;YACL,CAAC;YAED,OAAO,CAAC,CAAC;QACb,CAAC,CAAC;QAEF,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ;AAED,aAAa,CAAC,4BAA4B,EAAE,kBAAkB,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 normalize lerp between 2 values\r\n */\r\nexport class GeometryNLerpBlock extends NodeGeometryBlock {\r\n /**\r\n * Creates a new GeometryNLerpBlock\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(\"left\", NodeGeometryBlockConnectionPointTypes.AutoDetect);\r\n this.registerInput(\"right\", NodeGeometryBlockConnectionPointTypes.AutoDetect);\r\n this.registerInput(\"gradient\", NodeGeometryBlockConnectionPointTypes.Float, true, 0, 0, 1);\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 \"GeometryNLerpBlock\";\r\n }\r\n\r\n /**\r\n * Gets the left operand input component\r\n */\r\n public get left(): NodeGeometryConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the right operand input component\r\n */\r\n public get right(): NodeGeometryConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the gradient operand input component\r\n */\r\n public get gradient(): 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.left.isConnected || !this.right.isConnected) {\r\n this.output._storedFunction = null;\r\n this.output._storedValue = null;\r\n return;\r\n }\r\n\r\n const func = (gradient: number, left: number, right: number) => {\r\n return (1 - gradient) * left + gradient * right;\r\n };\r\n\r\n this.output._storedFunction = (state) => {\r\n const left = this.left.getConnectedValue(state);\r\n const right = this.right.getConnectedValue(state);\r\n const gradient = this.gradient.getConnectedValue(state);\r\n switch (this.left.type) {\r\n case NodeGeometryBlockConnectionPointTypes.Int:\r\n case NodeGeometryBlockConnectionPointTypes.Float: {\r\n return func!(gradient, left, right); // NLerp is really lerp in that case\r\n }\r\n case NodeGeometryBlockConnectionPointTypes.Vector2: {\r\n const result = new Vector2(func!(gradient, left.x, right.x), func!(gradient, left.y, right.y));\r\n result.normalize();\r\n\r\n return result;\r\n }\r\n case NodeGeometryBlockConnectionPointTypes.Vector3: {\r\n const result = new Vector3(func!(gradient, left.x, right.x), func!(gradient, left.y, right.y), func!(gradient, left.z, right.z));\r\n result.normalize();\r\n\r\n return result;\r\n }\r\n case NodeGeometryBlockConnectionPointTypes.Vector4: {\r\n const result = new Vector4(\r\n func!(gradient, left.x, right.x),\r\n func!(gradient, left.y, right.y),\r\n func!(gradient, left.z, right.z),\r\n func!(gradient, left.w, right.w)\r\n );\r\n result.normalize();\r\n\r\n return result;\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.GeometryNLerpBlock\", GeometryNLerpBlock);\r\n"]}
@@ -13,7 +13,7 @@ export class GeometryReplaceColorBlock extends NodeGeometryBlock {
13
13
  super(name);
14
14
  this.registerInput("value", NodeGeometryBlockConnectionPointTypes.AutoDetect);
15
15
  this.registerInput("reference", NodeGeometryBlockConnectionPointTypes.AutoDetect);
16
- this.registerInput("distance", NodeGeometryBlockConnectionPointTypes.Float);
16
+ this.registerInput("distance", NodeGeometryBlockConnectionPointTypes.Float, true, 0);
17
17
  this.registerInput("replacement", NodeGeometryBlockConnectionPointTypes.AutoDetect);
18
18
  this.registerOutput("output", NodeGeometryBlockConnectionPointTypes.BasedOnInput);
19
19
  this._outputs[0]._typeConnectionSource = this._inputs[0];
@@ -64,7 +64,7 @@ export class GeometryReplaceColorBlock extends NodeGeometryBlock {
64
64
  return this._outputs[0];
65
65
  }
66
66
  _buildBlock() {
67
- if (!this.value.isConnected || !this.reference.isConnected || !this.distance.isConnected || !this.replacement.isConnected) {
67
+ if (!this.value.isConnected || !this.reference.isConnected || !this.replacement.isConnected) {
68
68
  this.output._storedFunction = null;
69
69
  this.output._storedValue = null;
70
70
  return;
@@ -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,E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,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,CAAC;gBAChD,OAAO,WAAW,CAAC;YACvB,CAAC;iBAAM,CAAC;gBACJ,OAAO,KAAK,CAAC;YACjB,CAAC;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
+ {"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,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QACrF,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,CA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IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,WAAW,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,WAAW,EAAE,CAAC;YAC1F,IAAI,CAAC,MAAM,CAAC,eAAe,GAAG,IAAI,CAAC;YACnC,IAAI,CAAC,MAAM,CAAC,YAAY,GAAG,IAAI,CAAC;YAChC,OAAO;QACX,CAAC;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,CAAC;gBAChD,OAAO,WAAW,CAAC;YACvB,CAAC;iBAAM,CAAC;gBACJ,OAAO,KAAK,CAAC;YACjB,CAAC;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, true, 0);\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.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"]}
@@ -13,7 +13,7 @@ export class GeometryRotate2dBlock extends NodeGeometryBlock {
13
13
  constructor(name) {
14
14
  super(name);
15
15
  this.registerInput("input", NodeGeometryBlockConnectionPointTypes.Vector2);
16
- this.registerInput("angle", NodeGeometryBlockConnectionPointTypes.Float);
16
+ this.registerInput("angle", NodeGeometryBlockConnectionPointTypes.Float, true, 0);
17
17
  this.registerOutput("output", NodeGeometryBlockConnectionPointTypes.Vector2);
18
18
  }
19
19
  /**
@@ -42,7 +42,7 @@ export class GeometryRotate2dBlock extends NodeGeometryBlock {
42
42
  return this._outputs[0];
43
43
  }
44
44
  _buildBlock() {
45
- if (!this.angle.isConnected || !this.input.isConnected) {
45
+ if (!this.input.isConnected) {
46
46
  this.output._storedFunction = null;
47
47
  this.output._storedValue = null;
48
48
  return;
@@ -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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,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
+ {"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,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QAClF,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,qCAAqC,CAAC,OAAO,CAAC,CAAC;IACjF,CAAC;IAED;;;OAGG;IACa,YAAY;QACxB,OAAO,uBAAuB,C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port { 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, true, 0);\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.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"]}
@@ -13,8 +13,8 @@ export class GeometrySmoothStepBlock extends NodeGeometryBlock {
13
13
  constructor(name) {
14
14
  super(name);
15
15
  this.registerInput("value", NodeGeometryBlockConnectionPointTypes.AutoDetect);
16
- this.registerInput("edge0", NodeGeometryBlockConnectionPointTypes.Float);
17
- this.registerInput("edge1", NodeGeometryBlockConnectionPointTypes.Float);
16
+ this.registerInput("edge0", NodeGeometryBlockConnectionPointTypes.Float, true, 0);
17
+ this.registerInput("edge1", NodeGeometryBlockConnectionPointTypes.Float, true, 1);
18
18
  this.registerOutput("output", NodeGeometryBlockConnectionPointTypes.BasedOnInput);
19
19
  this._outputs[0]._typeConnectionSource = this._inputs[0];
20
20
  this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Matrix);
@@ -53,7 +53,7 @@ export class GeometrySmoothStepBlock extends NodeGeometryBlock {
53
53
  return this._outputs[0];
54
54
  }
55
55
  _buildBlock() {
56
- if (!this.value.isConnected || !this.edge0.isConnected || !this.edge1.isConnected) {
56
+ if (!this.value.isConnected) {
57
57
  this.output._storedFunction = null;
58
58
  this.output._storedValue = null;
59
59
  return;
@@ -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,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,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;gBACrF,CAAC;gBACD,KAAK,qCAAqC,CAAC,OAAO,CAAC,CAAC,CAAC;oBACjD,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;gBACpH,CAAC;gBACD,KAAK,qCAAqC,CAAC,OAAO,CAAC,CAAC,CAAC;oBACjD,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;gBACnJ,CAAC;YACL,CAAC;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
+ {"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,qCAA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BACD,KAAK,qCAAqC,CAAC,OAAO,CAAC,CAAC,CAAC;oBACjD,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;gBACpH,CAAC;gBACD,KAAK,qCAAqC,CAAC,OAAO,CAAC,CAAC,CAAC;oBACjD,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;gBACnJ,CAAC;YACL,CAAC;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, true, 0);\r\n this.registerInput(\"edge1\", NodeGeometryBlockConnectionPointTypes.Float, true, 1);\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) {\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"]}
@@ -13,7 +13,7 @@ export class GeometryStepBlock extends NodeGeometryBlock {
13
13
  constructor(name) {
14
14
  super(name);
15
15
  this.registerInput("value", NodeGeometryBlockConnectionPointTypes.AutoDetect);
16
- this.registerInput("edge", NodeGeometryBlockConnectionPointTypes.Float);
16
+ this.registerInput("edge", NodeGeometryBlockConnectionPointTypes.Float, true, 0);
17
17
  this.registerOutput("output", NodeGeometryBlockConnectionPointTypes.BasedOnInput);
18
18
  this._outputs[0]._typeConnectionSource = this._inputs[0];
19
19
  this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Matrix);
@@ -46,7 +46,7 @@ export class GeometryStepBlock extends NodeGeometryBlock {
46
46
  return this._outputs[0];
47
47
  }
48
48
  _buildBlock() {
49
- if (!this.value.isConnected || !this.edge.isConnected) {
49
+ if (!this.value.isConnected) {
50
50
  this.output._storedFunction = null;
51
51
  this.output._storedValue = null;
52
52
  return;
@@ -1 +1 @@
1
- {"version":3,"file":"geometryStepBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Meshes/Node/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BACrE,CAAC;gBACD,KAAK,qCAAqC,CAAC,OAAO,CAAC,CAAC,CAAC;oBACjD,OAAO,IAAI,OAAO,CAAC,IAAK,CAAC,MAAM,CAAC,CAAC,EAAE,IAAI,CAAC,EAAE,IAAK,CAAC,MAAM,CAAC,CAAC,EAAE,IAAI,CAAC,EAAE,IAAK,CAAC,MAAM,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;gBAC5F,CAAC;gBACD,KAAK,qCAAqC,CAAC,OAAO,CAAC,CAAC,CAAC;oBACjD,OAAO,IAAI,OAAO,CAAC,IAAK,CAAC,MAAM,CAAC,CAAC,EAAE,IAAI,CAAC,EAAE,IAAK,CAAC,MAAM,CAAC,CAAC,EAAE,IAAI,CAAC,EAAE,IAAK,CAAC,MAAM,CAAC,CAAC,EAAE,IAAI,CAAC,EAAE,IAAK,CAAC,MAAM,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;gBACnH,CAAC;YACL,CAAC;YAED,OAAO,CAAC,CAAC;QACb,CAAC,CAAC;QAEF,OAAO,IAAI,CAAC;IAChB,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
+ {"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,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QACjF,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,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,QAAQ,CAAC,CAAC;QAClG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,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AAC;gBAC/B,CAAC;gBACD,KAAK,qCAAqC,CAAC,OAAO,CAAC,CAAC,CAAC;oBACjD,OAAO,IAAI,OAAO,CAAC,IAAK,CAAC,MAAM,CAAC,CAAC,EAAE,IAAI,CAAC,EAAE,IAAK,CAAC,MAAM,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;gBACrE,CAAC;gBACD,KAAK,qCAAqC,CAAC,OAAO,CAAC,CAAC,CAAC;oBACjD,OAAO,IAAI,OAAO,CAAC,IAAK,CAAC,MAAM,CAAC,CAAC,EAAE,IAAI,CAAC,EAAE,IAAK,CAAC,MAAM,CAAC,CAAC,EAAE,IAAI,CAAC,EAAE,IAAK,CAAC,MAAM,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;gBAC5F,CAAC;gBACD,KAAK,qCAAqC,CAAC,OAAO,CAAC,CAAC,CAAC;oBACjD,OAAO,IAAI,OAAO,CAAC,IAAK,CAAC,MAAM,CAAC,CAAC,EAAE,IAAI,CAAC,EAAE,IAAK,CAAC,MAAM,CAAC,CAAC,EAAE,IAAI,CAAC,EAAE,IAAK,CAAC,MAAM,CAAC,CAAC,EAAE,IAAI,CAAC,EAAE,IAAK,CAAC,MAAM,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;gBACnH,CAAC;YACL,CAAC;YAED,OAAO,CAAC,CAAC;QACb,CAAC,CAAC;QAEF,OAAO,IAAI,CAAC;IAChB,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, true, 0);\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) {\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"]}
@@ -244,7 +244,7 @@ export class NodeGeometry {
244
244
  _initializeBlock(node, autoConfigure = true) {
245
245
  node.initialize();
246
246
  if (autoConfigure) {
247
- node.autoConfigure();
247
+ node.autoConfigure(this);
248
248
  }
249
249
  node._preparationId = this._buildId;
250
250
  if (this.attachedBlocks.indexOf(node) === -1) {