@babylonjs/core 7.29.0 → 7.30.1

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 (169) hide show
  1. package/Engines/WebGPU/webgpuCacheBindGroups.js +13 -2
  2. package/Engines/WebGPU/webgpuCacheBindGroups.js.map +1 -1
  3. package/Engines/WebGPU/webgpuCacheSampler.js +2 -3
  4. package/Engines/WebGPU/webgpuCacheSampler.js.map +1 -1
  5. package/Engines/WebGPU/webgpuShaderProcessorsWGSL.js +4 -1
  6. package/Engines/WebGPU/webgpuShaderProcessorsWGSL.js.map +1 -1
  7. package/Engines/abstractEngine.js +2 -2
  8. package/Engines/abstractEngine.js.map +1 -1
  9. package/Engines/engine.d.ts +2 -1
  10. package/Engines/nullEngine.d.ts +1 -0
  11. package/Engines/nullEngine.js +1 -0
  12. package/Engines/nullEngine.js.map +1 -1
  13. package/Engines/webgpuEngine.d.ts +4 -0
  14. package/Engines/webgpuEngine.js +1 -3
  15. package/Engines/webgpuEngine.js.map +1 -1
  16. package/Materials/Background/backgroundMaterial.js +1 -11
  17. package/Materials/Background/backgroundMaterial.js.map +1 -1
  18. package/Materials/GaussianSplatting/gaussianSplattingMaterial.d.ts +8 -0
  19. package/Materials/GaussianSplatting/gaussianSplattingMaterial.js +43 -34
  20. package/Materials/GaussianSplatting/gaussianSplattingMaterial.js.map +1 -1
  21. package/Materials/Node/Blocks/GaussianSplatting/gaussianBlock.d.ts +32 -0
  22. package/Materials/Node/Blocks/GaussianSplatting/gaussianBlock.js +64 -0
  23. package/Materials/Node/Blocks/GaussianSplatting/gaussianBlock.js.map +1 -0
  24. package/Materials/Node/Blocks/GaussianSplatting/gaussianSplattingBlock.d.ts +48 -0
  25. package/Materials/Node/Blocks/GaussianSplatting/gaussianSplattingBlock.js +102 -0
  26. package/Materials/Node/Blocks/GaussianSplatting/gaussianSplattingBlock.js.map +1 -0
  27. package/Materials/Node/Blocks/GaussianSplatting/index.d.ts +3 -0
  28. package/Materials/Node/Blocks/GaussianSplatting/index.js +4 -0
  29. package/Materials/Node/Blocks/GaussianSplatting/index.js.map +1 -0
  30. package/Materials/Node/Blocks/GaussianSplatting/splatReaderBlock.d.ts +40 -0
  31. package/Materials/Node/Blocks/GaussianSplatting/splatReaderBlock.js +96 -0
  32. package/Materials/Node/Blocks/GaussianSplatting/splatReaderBlock.js.map +1 -0
  33. package/Materials/Node/Blocks/Input/inputBlock.js +6 -0
  34. package/Materials/Node/Blocks/Input/inputBlock.js.map +1 -1
  35. package/Materials/Node/Blocks/index.d.ts +1 -0
  36. package/Materials/Node/Blocks/index.js +1 -0
  37. package/Materials/Node/Blocks/index.js.map +1 -1
  38. package/Materials/Node/Enums/nodeMaterialModes.d.ts +3 -1
  39. package/Materials/Node/Enums/nodeMaterialModes.js +2 -0
  40. package/Materials/Node/Enums/nodeMaterialModes.js.map +1 -1
  41. package/Materials/Node/index.d.ts +1 -0
  42. package/Materials/Node/index.js +1 -0
  43. package/Materials/Node/index.js.map +1 -1
  44. package/Materials/Node/nodeMaterialDefault.d.ts +6 -0
  45. package/Materials/Node/nodeMaterialDefault.js +53 -0
  46. package/Materials/Node/nodeMaterialDefault.js.map +1 -0
  47. package/Materials/PBR/pbrBaseMaterial.js +1 -11
  48. package/Materials/PBR/pbrBaseMaterial.js.map +1 -1
  49. package/Materials/Textures/rawTexture3D.d.ts +12 -0
  50. package/Materials/Textures/rawTexture3D.js +18 -0
  51. package/Materials/Textures/rawTexture3D.js.map +1 -1
  52. package/Materials/Textures/texture.js +7 -3
  53. package/Materials/Textures/texture.js.map +1 -1
  54. package/Materials/Textures/textureSampler.d.ts +1 -1
  55. package/Materials/Textures/textureSampler.js.map +1 -1
  56. package/Materials/effect.d.ts +11 -0
  57. package/Materials/effect.js +20 -0
  58. package/Materials/effect.js.map +1 -1
  59. package/Materials/material.d.ts +5 -1
  60. package/Materials/material.js +19 -1
  61. package/Materials/material.js.map +1 -1
  62. package/Materials/materialPluginBase.d.ts +46 -46
  63. package/Materials/materialPluginBase.js +46 -60
  64. package/Materials/materialPluginBase.js.map +1 -1
  65. package/Materials/materialPluginManager.js +2 -2
  66. package/Materials/materialPluginManager.js.map +1 -1
  67. package/Materials/pushMaterial.d.ts +1 -1
  68. package/Materials/pushMaterial.js +2 -2
  69. package/Materials/pushMaterial.js.map +1 -1
  70. package/Materials/standardMaterial.js +1 -11
  71. package/Materials/standardMaterial.js.map +1 -1
  72. package/Meshes/GaussianSplatting/gaussianSplattingMesh.d.ts +11 -0
  73. package/Meshes/GaussianSplatting/gaussianSplattingMesh.js +72 -37
  74. package/Meshes/GaussianSplatting/gaussianSplattingMesh.js.map +1 -1
  75. package/Meshes/Node/Blocks/Set/aggregatorBlock.d.ts +76 -0
  76. package/Meshes/Node/Blocks/Set/aggregatorBlock.js +210 -0
  77. package/Meshes/Node/Blocks/Set/aggregatorBlock.js.map +1 -0
  78. package/Meshes/Node/Blocks/Set/latticeBlock.d.ts +91 -0
  79. package/Meshes/Node/Blocks/Set/latticeBlock.js +194 -0
  80. package/Meshes/Node/Blocks/Set/latticeBlock.js.map +1 -0
  81. package/Meshes/Node/Blocks/booleanGeometryBlock.d.ts +6 -0
  82. package/Meshes/Node/Blocks/booleanGeometryBlock.js +16 -4
  83. package/Meshes/Node/Blocks/booleanGeometryBlock.js.map +1 -1
  84. package/Meshes/Node/Blocks/geometryClampBlock.d.ts +8 -0
  85. package/Meshes/Node/Blocks/geometryClampBlock.js +22 -6
  86. package/Meshes/Node/Blocks/geometryClampBlock.js.map +1 -1
  87. package/Meshes/Node/Blocks/geometryInputBlock.js +2 -0
  88. package/Meshes/Node/Blocks/geometryInputBlock.js.map +1 -1
  89. package/Meshes/Node/Blocks/geometryInterceptorBlock.d.ts +5 -0
  90. package/Meshes/Node/Blocks/geometryInterceptorBlock.js +5 -1
  91. package/Meshes/Node/Blocks/geometryInterceptorBlock.js.map +1 -1
  92. package/Meshes/Node/Blocks/geometryTransformBlock.d.ts +6 -0
  93. package/Meshes/Node/Blocks/geometryTransformBlock.js +14 -2
  94. package/Meshes/Node/Blocks/geometryTransformBlock.js.map +1 -1
  95. package/Meshes/Node/Enums/nodeGeometryContextualSources.d.ts +5 -1
  96. package/Meshes/Node/Enums/nodeGeometryContextualSources.js +4 -0
  97. package/Meshes/Node/Enums/nodeGeometryContextualSources.js.map +1 -1
  98. package/Meshes/Node/index.d.ts +2 -0
  99. package/Meshes/Node/index.js +2 -0
  100. package/Meshes/Node/index.js.map +1 -1
  101. package/Meshes/Node/nodeGeometry.d.ts +1 -1
  102. package/Meshes/Node/nodeGeometry.js +14 -1
  103. package/Meshes/Node/nodeGeometry.js.map +1 -1
  104. package/Meshes/Node/nodeGeometryBlock.d.ts +4 -0
  105. package/Meshes/Node/nodeGeometryBlock.js +6 -0
  106. package/Meshes/Node/nodeGeometryBlock.js.map +1 -1
  107. package/Meshes/Node/nodeGeometryBuildState.js +12 -0
  108. package/Meshes/Node/nodeGeometryBuildState.js.map +1 -1
  109. package/Meshes/csg.d.ts +1 -0
  110. package/Meshes/csg.js +1 -0
  111. package/Meshes/csg.js.map +1 -1
  112. package/Meshes/csg2.d.ts +126 -0
  113. package/Meshes/csg2.js +350 -0
  114. package/Meshes/csg2.js.map +1 -0
  115. package/Meshes/index.d.ts +2 -0
  116. package/Meshes/index.js +2 -0
  117. package/Meshes/index.js.map +1 -1
  118. package/Meshes/lattice.d.ts +18 -1
  119. package/Meshes/lattice.js +34 -6
  120. package/Meshes/lattice.js.map +1 -1
  121. package/Meshes/lattice.material.d.ts +82 -0
  122. package/Meshes/lattice.material.js +259 -0
  123. package/Meshes/lattice.material.js.map +1 -0
  124. package/Meshes/mesh.js +3 -1
  125. package/Meshes/mesh.js.map +1 -1
  126. package/Meshes/mesh.vertexData.d.ts +66 -1
  127. package/Meshes/mesh.vertexData.js.map +1 -1
  128. package/Misc/dumpTools.js +1 -0
  129. package/Misc/dumpTools.js.map +1 -1
  130. package/Misc/screenshotTools.js +0 -3
  131. package/Misc/screenshotTools.js.map +1 -1
  132. package/Misc/tools.d.ts +2 -1
  133. package/Misc/tools.internals.d.ts +13 -0
  134. package/Misc/tools.internals.js +48 -0
  135. package/Misc/tools.internals.js.map +1 -0
  136. package/Misc/tools.js +13 -4
  137. package/Misc/tools.js.map +1 -1
  138. package/Morph/morphTarget.js +1 -0
  139. package/Morph/morphTarget.js.map +1 -1
  140. package/Shaders/ShadersInclude/gaussianSplatting.d.ts +5 -0
  141. package/Shaders/ShadersInclude/gaussianSplatting.js +33 -0
  142. package/Shaders/ShadersInclude/gaussianSplatting.js.map +1 -0
  143. package/Shaders/ShadersInclude/gaussianSplattingFragmentDeclaration.d.ts +7 -0
  144. package/Shaders/ShadersInclude/gaussianSplattingFragmentDeclaration.js +19 -0
  145. package/Shaders/ShadersInclude/gaussianSplattingFragmentDeclaration.js.map +1 -0
  146. package/Shaders/ShadersInclude/gaussianSplattingUboDeclaration.js +1 -1
  147. package/Shaders/ShadersInclude/gaussianSplattingUboDeclaration.js.map +1 -1
  148. package/Shaders/ShadersInclude/gaussianSplattingVertexDeclaration.js +1 -2
  149. package/Shaders/ShadersInclude/gaussianSplattingVertexDeclaration.js.map +1 -1
  150. package/Shaders/gaussianSplatting.fragment.d.ts +1 -2
  151. package/Shaders/gaussianSplatting.fragment.js +5 -10
  152. package/Shaders/gaussianSplatting.fragment.js.map +1 -1
  153. package/Shaders/gaussianSplatting.vertex.d.ts +1 -0
  154. package/Shaders/gaussianSplatting.vertex.js +4 -21
  155. package/Shaders/gaussianSplatting.vertex.js.map +1 -1
  156. package/ShadersWGSL/default.fragment.js +1 -1
  157. package/ShadersWGSL/default.fragment.js.map +1 -1
  158. package/ShadersWGSL/pbr.fragment.js +1 -1
  159. package/ShadersWGSL/pbr.fragment.js.map +1 -1
  160. package/Sprites/spriteManager.d.ts +10 -1
  161. package/Sprites/spriteManager.js +3 -2
  162. package/Sprites/spriteManager.js.map +1 -1
  163. package/Sprites/spritePackedManager.d.ts +6 -1
  164. package/Sprites/spritePackedManager.js +6 -2
  165. package/Sprites/spritePackedManager.js.map +1 -1
  166. package/Sprites/spriteRenderer.d.ts +16 -3
  167. package/Sprites/spriteRenderer.js +5 -3
  168. package/Sprites/spriteRenderer.js.map +1 -1
  169. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"booleanGeometryBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Meshes/Node/Blocks/booleanGeometryBlock.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;AAGlG,OAAO,EAA0B,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AACnG,OAAO,EAAE,GAAG,EAAE,qBAAwB;AAEtC;;GAEG;AACH,MAAM,CAAN,IAAY,yBAOX;AAPD,WAAY,yBAAyB;IACjC,gBAAgB;IAChB,mFAAS,CAAA;IACT,eAAe;IACf,iFAAQ,CAAA;IACR,YAAY;IACZ,2EAAK,CAAA;AACT,CAAC,EAPW,yBAAyB,KAAzB,yBAAyB,QAOpC;AAED;;GAEG;AACH,MAAM,OAAO,oBAAqB,SAAQ,iBAAiB;IAqBvD;;;OAGG;IACH,YAAmB,IAAY;QAC3B,KAAK,CAAC,IAAI,CAAC,CAAC;QAzBhB;;;WAGG;QAEI,oBAAe,GAAG,KAAK,CAAC;QAE/B;;WAEG;QASI,cAAS,GAAG,yBAAyB,CAAC,SAAS,CAAC;QASnD,IAAI,CAAC,aAAa,CAAC,WAAW,EAAE,qCAAqC,CAAC,QAAQ,CAAC,CAAC;QAChF,IAAI,CAAC,aAAa,CAAC,WAAW,EAAE,qCAAqC,CAAC,QAAQ,CAAC,CAAC;QAEhF,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,qCAAqC,CAAC,QAAQ,CAAC,CAAC;IAClF,CAAC;IAED;;;OAGG;IACa,YA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yB,CAAC,QAAQ,EAAE;YAChE,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,yBAAyB,CAAC,KAAK,EAAE;SAC7D;KACJ,CAAC;uDACqD;AAmI3D,aAAa,CAAC,8BAA8B,EAAE,oBAAoB,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 { VertexData } from \"../../mesh.vertexData\";\r\nimport type { NodeGeometryBuildState } from \"../nodeGeometryBuildState\";\r\nimport { PropertyTypeForEdition, editableInPropertyPage } from \"../../../Decorators/nodeDecorator\";\r\nimport { CSG } from \"core/Meshes/csg\";\r\n\r\n/**\r\n * Operations supported by the boolean block\r\n */\r\nexport enum BooleanGeometryOperations {\r\n /** Intersect */\r\n Intersect,\r\n /** Subtract */\r\n Subtract,\r\n /** Union */\r\n Union,\r\n}\r\n\r\n/**\r\n * Block used to apply a boolean operation between 2 geometries\r\n */\r\nexport class BooleanGeometryBlock extends NodeGeometryBlock {\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 = false;\r\n\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: \"Intersect\", value: BooleanGeometryOperations.Intersect },\r\n { label: \"Subtract\", value: BooleanGeometryOperations.Subtract },\r\n { label: \"Union\", value: BooleanGeometryOperations.Union },\r\n ],\r\n })\r\n public operation = BooleanGeometryOperations.Intersect;\r\n\r\n /**\r\n * Create a new BooleanGeometryBlock\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(\"geometry0\", NodeGeometryBlockConnectionPointTypes.Geometry);\r\n this.registerInput(\"geometry1\", NodeGeometryBlockConnectionPointTypes.Geometry);\r\n\r\n this.registerOutput(\"output\", NodeGeometryBlockConnectionPointTypes.Geometry);\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 \"BooleanGeometryBlock\";\r\n }\r\n\r\n /**\r\n * Gets the geometry0 input component\r\n */\r\n public get geometry0(): NodeGeometryConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the geometry1 input component\r\n */\r\n public get geometry1(): NodeGeometryConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the geometry 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 const func = (state: NodeGeometryBuildState) => {\r\n const vertexData0 = this.geometry0.getConnectedValue(state) as VertexData;\r\n const vertexData1 = this.geometry1.getConnectedValue(state) as VertexData;\r\n\r\n if (!vertexData0 || !vertexData1) {\r\n return null;\r\n }\r\n\r\n const vertexCount = vertexData0.positions!.length / 3;\r\n // Ensure that all the fields are filled to avoid problems later on in the graph\r\n if (!vertexData0.normals && vertexData1.normals) {\r\n vertexData0.normals = new Array<number>(vertexData0.positions!.length);\r\n }\r\n if (!vertexData1.normals && vertexData0.normals) {\r\n vertexData1.normals = new Array<number>(vertexData1.positions!.length);\r\n }\r\n if (!vertexData0.uvs && vertexData1.uvs) {\r\n vertexData0.uvs = new Array<number>(vertexCount * 2);\r\n }\r\n if (!vertexData1.uvs && vertexData0.uvs) {\r\n vertexData1.uvs = new Array<number>(vertexCount * 2);\r\n }\r\n if (!vertexData0.colors && vertexData1.colors) {\r\n vertexData0.colors = new Array<number>(vertexCount * 4);\r\n }\r\n if (!vertexData1.colors && vertexData0.colors) {\r\n vertexData1.colors = new Array<number>(vertexCount * 4);\r\n }\r\n\r\n const CSG0 = CSG.FromVertexData(vertexData0);\r\n const CSG1 = CSG.FromVertexData(vertexData1);\r\n\r\n let boolCSG: CSG;\r\n\r\n switch (this.operation) {\r\n case BooleanGeometryOperations.Intersect:\r\n boolCSG = CSG0.intersect(CSG1);\r\n break;\r\n case BooleanGeometryOperations.Subtract:\r\n boolCSG = CSG0.subtract(CSG1);\r\n break;\r\n case BooleanGeometryOperations.Union:\r\n boolCSG = CSG0.union(CSG1);\r\n break;\r\n }\r\n\r\n return boolCSG.toVertexData();\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 let codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.evaluateContext = ${this.evaluateContext ? \"true\" : \"false\"};\\n`;\r\n codeString += `${this._codeVariableName}.operation = BABYLON.BooleanGeometryOperations.${BooleanGeometryOperations[this.operation]};\\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 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.evaluateContext = serializationObject.evaluateContext;\r\n if (serializationObject.operation) {\r\n this.operation = serializationObject.operation;\r\n }\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.BooleanGeometryBlock\", BooleanGeometryBlock);\r\n"]}
1
+ {"version":3,"file":"booleanGeometryBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Meshes/Node/Blocks/booleanGe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,EAAE,yBAAyB,CAAC,QAAQ,EAAE;YAChE,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,yBAAyB,CAAC,KAAK,EAAE;SAC7D;KACJ,CAAC;uDACqD;AAmJ3D,aAAa,CAAC,8BAA8B,EAAE,oBAAoB,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 { VertexData } from \"../../mesh.vertexData\";\r\nimport type { NodeGeometryBuildState } from \"../nodeGeometryBuildState\";\r\nimport { PropertyTypeForEdition, editableInPropertyPage } from \"../../../Decorators/nodeDecorator\";\r\nimport { CSG2, InitializeCSG2Async, IsCSG2Ready } from \"core/Meshes/csg2\";\r\nimport type { Nullable } from \"core/types\";\r\n\r\n/**\r\n * Operations supported by the boolean block\r\n */\r\nexport enum BooleanGeometryOperations {\r\n /** Intersect */\r\n Intersect,\r\n /** Subtract */\r\n Subtract,\r\n /** Union */\r\n Union,\r\n}\r\n\r\n/**\r\n * Block used to apply a boolean operation between 2 geometries\r\n */\r\nexport class BooleanGeometryBlock extends NodeGeometryBlock {\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 = false;\r\n\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: \"Intersect\", value: BooleanGeometryOperations.Intersect },\r\n { label: \"Subtract\", value: BooleanGeometryOperations.Subtract },\r\n { label: \"Union\", value: BooleanGeometryOperations.Union },\r\n ],\r\n })\r\n public operation = BooleanGeometryOperations.Intersect;\r\n\r\n private _csg2LoadingPromise: Promise<void>;\r\n /**\r\n * @internal\r\n */\r\n public override get _isReadyState(): Nullable<Promise<void>> {\r\n if (IsCSG2Ready()) {\r\n return null;\r\n }\r\n\r\n if (!this._csg2LoadingPromise) {\r\n this._csg2LoadingPromise = InitializeCSG2Async();\r\n }\r\n\r\n return this._csg2LoadingPromise;\r\n }\r\n\r\n /**\r\n * Create a new BooleanGeometryBlock\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(\"geometry0\", NodeGeometryBlockConnectionPointTypes.Geometry);\r\n this.registerInput(\"geometry1\", NodeGeometryBlockConnectionPointTypes.Geometry);\r\n\r\n this.registerOutput(\"output\", NodeGeometryBlockConnectionPointTypes.Geometry);\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 \"BooleanGeometryBlock\";\r\n }\r\n\r\n /**\r\n * Gets the geometry0 input component\r\n */\r\n public get geometry0(): NodeGeometryConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the geometry1 input component\r\n */\r\n public get geometry1(): NodeGeometryConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the geometry 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 const func = (state: NodeGeometryBuildState) => {\r\n const vertexData0 = this.geometry0.getConnectedValue(state) as VertexData;\r\n const vertexData1 = this.geometry1.getConnectedValue(state) as VertexData;\r\n\r\n if (!vertexData0 || !vertexData1) {\r\n return null;\r\n }\r\n\r\n const vertexCount = vertexData0.positions!.length / 3;\r\n // Ensure that all the fields are filled to avoid problems later on in the graph\r\n if (!vertexData0.normals && vertexData1.normals) {\r\n vertexData0.normals = new Array<number>(vertexData0.positions!.length);\r\n }\r\n if (!vertexData1.normals && vertexData0.normals) {\r\n vertexData1.normals = new Array<number>(vertexData1.positions!.length);\r\n }\r\n if (!vertexData0.uvs && vertexData1.uvs) {\r\n vertexData0.uvs = new Array<number>(vertexCount * 2);\r\n }\r\n if (!vertexData1.uvs && vertexData0.uvs) {\r\n vertexData1.uvs = new Array<number>(vertexCount * 2);\r\n }\r\n if (!vertexData0.colors && vertexData1.colors) {\r\n vertexData0.colors = new Array<number>(vertexCount * 4);\r\n }\r\n if (!vertexData1.colors && vertexData0.colors) {\r\n vertexData1.colors = new Array<number>(vertexCount * 4);\r\n }\r\n\r\n const CSG0 = CSG2.FromVertexData(vertexData0);\r\n const CSG1 = CSG2.FromVertexData(vertexData1);\r\n\r\n let boolCSG: CSG2;\r\n\r\n switch (this.operation) {\r\n case BooleanGeometryOperations.Intersect:\r\n boolCSG = CSG0.intersect(CSG1);\r\n break;\r\n case BooleanGeometryOperations.Subtract:\r\n boolCSG = CSG0.subtract(CSG1);\r\n break;\r\n case BooleanGeometryOperations.Union:\r\n boolCSG = CSG0.add(CSG1);\r\n break;\r\n }\r\n\r\n return boolCSG.toVertexData();\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 let codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.evaluateContext = ${this.evaluateContext ? \"true\" : \"false\"};\\n`;\r\n codeString += `${this._codeVariableName}.operation = BABYLON.BooleanGeometryOperations.${BooleanGeometryOperations[this.operation]};\\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 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.evaluateContext = serializationObject.evaluateContext;\r\n if (serializationObject.operation) {\r\n this.operation = serializationObject.operation;\r\n }\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.BooleanGeometryBlock\", BooleanGeometryBlock);\r\n"]}
@@ -22,6 +22,14 @@ export declare class GeometryClampBlock extends NodeGeometryBlock {
22
22
  * Gets the value input component
23
23
  */
24
24
  get value(): NodeGeometryConnectionPoint;
25
+ /**
26
+ * Gets the min input component
27
+ */
28
+ get min(): NodeGeometryConnectionPoint;
29
+ /**
30
+ * Gets the max input component
31
+ */
32
+ get max(): NodeGeometryConnectionPoint;
25
33
  /**
26
34
  * Gets the output component
27
35
  */
@@ -19,6 +19,8 @@ export class GeometryClampBlock extends NodeGeometryBlock {
19
19
  /** Gets or sets the maximum range */
20
20
  this.maximum = 1.0;
21
21
  this.registerInput("value", NodeGeometryBlockConnectionPointTypes.AutoDetect);
22
+ this.registerInput("min", NodeGeometryBlockConnectionPointTypes.Float, true);
23
+ this.registerInput("max", NodeGeometryBlockConnectionPointTypes.Float, true);
22
24
  this.registerOutput("output", NodeGeometryBlockConnectionPointTypes.BasedOnInput);
23
25
  this._outputs[0]._typeConnectionSource = this._inputs[0];
24
26
  this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Matrix);
@@ -38,6 +40,18 @@ export class GeometryClampBlock extends NodeGeometryBlock {
38
40
  get value() {
39
41
  return this._inputs[0];
40
42
  }
43
+ /**
44
+ * Gets the min input component
45
+ */
46
+ get min() {
47
+ return this._inputs[1];
48
+ }
49
+ /**
50
+ * Gets the max input component
51
+ */
52
+ get max() {
53
+ return this._inputs[2];
54
+ }
41
55
  /**
42
56
  * Gets the output component
43
57
  */
@@ -50,24 +64,26 @@ export class GeometryClampBlock extends NodeGeometryBlock {
50
64
  this.output._storedValue = null;
51
65
  return;
52
66
  }
53
- const func = (value) => {
54
- return Math.max(this.minimum, Math.min(value, this.maximum));
67
+ const func = (value, min, max) => {
68
+ return Math.max(min, Math.min(value, max));
55
69
  };
56
70
  this.output._storedFunction = (state) => {
57
71
  const value = this.value.getConnectedValue(state);
72
+ const min = this.min.isConnected ? this.min.getConnectedValue(state) : this.minimum;
73
+ const max = this.max.isConnected ? this.max.getConnectedValue(state) : this.maximum;
58
74
  switch (this.value.type) {
59
75
  case NodeGeometryBlockConnectionPointTypes.Int:
60
76
  case NodeGeometryBlockConnectionPointTypes.Float: {
61
- return func(value);
77
+ return func(value, min, max);
62
78
  }
63
79
  case NodeGeometryBlockConnectionPointTypes.Vector2: {
64
- return new Vector2(func(value.x), func(value.y));
80
+ return new Vector2(func(value.x, min, max), func(value.y, min, max));
65
81
  }
66
82
  case NodeGeometryBlockConnectionPointTypes.Vector3: {
67
- return new Vector3(func(value.x), func(value.y), func(value.z));
83
+ return new Vector3(func(value.x, min, max), func(value.y, min, max), func(value.z, min, max));
68
84
  }
69
85
  case NodeGeometryBlockConnectionPointTypes.Vector4: {
70
- return new Vector4(func(value.x), func(value.y), func(value.z), func(value.w));
86
+ return new Vector4(func(value.x, min, max), func(value.y, min, max), func(value.z, min, max), func(value.w, min, max));
71
87
  }
72
88
  }
73
89
  return 0;
@@ -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;IAQr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kB,mBAAmB;QAClC,IAAI,UAAU,GAAG,KAAK,CAAC,mBAAmB,EAAE,GAAG,GAAG,IAAI,CAAC,iBAAiB,cAAc,IAAI,CAAC,OAAO,KAAK,CAAC;QACxG,UAAU,IAAI,GAAG,IAAI,CAAC,iBAAiB,cAAc,IAAI,CAAC,OAAO,KAAK,CAAC;QACvE,OAAO,UAAU,CAAC;IACtB,CAAC;IAEe,SAAS;QACrB,MAAM,mBAAmB,GAAG,KAAK,CAAC,SAAS,EAAE,CAAC;QAE9C,mBAAmB,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;QAC3C,mBAAmB,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;QAE3C,OAAO,mBAAmB,CAAC;IAC/B,CAAC;IAEe,YAAY,CAAC,mBAAwB;QACjD,KAAK,CAAC,YAAY,CAAC,mBAAmB,CAAC,CAAC;QAExC,IAAI,CAAC,OAAO,GAAG,mBAAmB,CAAC,OAAO,CAAC;QAC3C,IAAI,CAAC,OAAO,GAAG,mBAAmB,CAAC,OAAO,CAAC;IAC/C,CAAC;CACJ;AAnGU;IADN,sBAAsB,CAAC,SAAS,uCAA+B;mDAC3C;AAGd;IADN,sBAAsB,CAAC,SAAS,uCAA+B;mDAC3C;AAkGzB,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)\r\n public minimum = 0.0;\r\n /** Gets or sets the maximum range */\r\n @editableInPropertyPage(\"Maximum\", PropertyTypeForEdition.Float)\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.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 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) => {\r\n return Math.max(this.minimum, Math.min(value, this.maximum));\r\n };\r\n\r\n this.output._storedFunction = (state) => {\r\n const value = this.value.getConnectedValue(state);\r\n switch (this.value.type) {\r\n case NodeGeometryBlockConnectionPointTypes.Int:\r\n case NodeGeometryBlockConnectionPointTypes.Float: {\r\n return func!(value);\r\n }\r\n case NodeGeometryBlockConnectionPointTypes.Vector2: {\r\n return new Vector2(func!(value.x), func!(value.y));\r\n }\r\n case NodeGeometryBlockConnectionPointTypes.Vector3: {\r\n return new Vector3(func!(value.x), func!(value.y), func!(value.z));\r\n }\r\n case NodeGeometryBlockConnectionPointTypes.Vector4: {\r\n return new Vector4(func!(value.x), func!(value.y), func!(value.z), func!(value.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 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,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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,OAAO,mBAAmB,CAAC;IAC/B,CAAC;IAEe,YAAY,CAAC,mBAAwB;QACjD,KAAK,CAAC,YAAY,CAAC,mBAAmB,CAAC,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,uCAA+B;mDAC3C;AAGd;IADN,sBAAsB,CAAC,SAAS,uCAA+B;mDAC3C;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)\r\n public minimum = 0.0;\r\n /** Gets or sets the maximum range */\r\n @editableInPropertyPage(\"Maximum\", PropertyTypeForEdition.Float)\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"]}
@@ -53,6 +53,8 @@ export class GeometryInputBlock extends NodeGeometryBlock {
53
53
  switch (value) {
54
54
  case NodeGeometryContextualSources.Positions:
55
55
  case NodeGeometryContextualSources.Normals:
56
+ case NodeGeometryContextualSources.LatticeID:
57
+ case NodeGeometryContextualSources.LatticeControl:
56
58
  this._type = NodeGeometryBlockConnectionPointTypes.Vector3;
57
59
  break;
58
60
  case NodeGeometryContextualSources.Colors:
@@ -1 +1 @@
1
- {"version":3,"file":"geometryInputBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Meshes/Node/Blocks/geometryInputBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,qCAAqC,EAAE,MAAM,2CAA2C,CAAC;AAClG,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAA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GAAG,IAAI,CAAC,YAAY,CAAC;aACjD;SACJ;QAED,OAAO,mBAAmB,CAAC;IAC/B,CAAC;IAEe,YAAY,CAAC,mBAAwB;QACjD,KAAK,CAAC,YAAY,CAAC,mBAAmB,CAAC,CAAC;QAExC,IAAI,CAAC,KAAK,GAAG,mBAAmB,CAAC,IAAI,CAAC;QAEtC,IAAI,CAAC,eAAe,GAAG,mBAAmB,CAAC,eAAe,CAAC;QAC3D,IAAI,CAAC,GAAG,GAAG,mBAAmB,CAAC,GAAG,IAAI,CAAC,CAAC;QACxC,IAAI,CAAC,GAAG,GAAG,mBAAmB,CAAC,GAAG,IAAI,CAAC,CAAC;QACxC,IAAI,CAAC,gBAAgB,GAAG,mBAAmB,CAAC,gBAAgB,IAAI,EAAE,CAAC;QAEnE,IAAI,CAAC,mBAAmB,CAAC,SAAS,EAAE;YAChC,OAAO;SACV;QAED,IAAI,mBAAmB,CAAC,SAAS,KAAK,QAAQ,EAAE;YAC5C,IAAI,CAAC,YAAY,GAAG,mBAAmB,CAAC,KAAK,CAAC;SACjD;aAAM;YACH,MAAM,SAAS,GAAG,QAAQ,CAAC,mBAAmB,CAAC,SAAS,CAAC,CAAC;YAE1D,IAAI,SAAS,EAAE;gBACX,IAAI,CAAC,YAAY,GAAG,SAAS,CAAC,SAAS,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAAC;aACtE;SACJ;IACL,CAAC;CACJ;AAED,aAAa,CAAC,4BAA4B,EAAE,kBAAkB,CAAC,CAAC","sourcesContent":["import { Observable } from \"../../../Misc/observable\";\r\nimport { NodeGeometryBlockConnectionPointTypes } from \"../Enums/nodeGeometryConnectionPointTypes\";\r\nimport { NodeGeometryBlock } from \"../nodeGeometryBlock\";\r\nimport type { NodeGeometryConnectionPoint } from \"../nodeGeometryBlockConnectionPoint\";\r\nimport { GetClass, RegisterClass } from \"../../../Misc/typeStore\";\r\nimport { Matrix, Vector2, Vector3, Vector4 } from \"../../../Maths/math.vector\";\r\nimport type { NodeGeometryBuildState } from \"../nodeGeometryBuildState\";\r\nimport { NodeGeometryContextualSources } from \"../Enums/nodeGeometryContextualSources\";\r\n\r\n/**\r\n * Block used to expose an input value\r\n */\r\nexport class GeometryInputBlock extends NodeGeometryBlock {\r\n private _storedValue: any;\r\n private _valueCallback: () => any;\r\n private _type: NodeGeometryBlockConnectionPointTypes = NodeGeometryBlockConnectionPointTypes.Undefined;\r\n private _contextualSource = NodeGeometryContextualSources.None;\r\n\r\n /** Gets or set a value used to limit the range of float values */\r\n public min: number = 0;\r\n\r\n /** Gets or set a value used to limit the range of float values */\r\n public max: number = 0;\r\n\r\n /** Gets or sets the group to use to display this block in the Inspector */\r\n public groupInInspector = \"\";\r\n\r\n /** Gets an observable raised when the value is changed */\r\n public onValueChangedObservable = new Observable<GeometryInputBlock>();\r\n\r\n /**\r\n * Gets or sets the connection point type (default is float)\r\n */\r\n public get type(): NodeGeometryBlockConnectionPointTypes {\r\n if (this._type === NodeGeometryBlockConnectionPointTypes.AutoDetect) {\r\n if (this.value != null) {\r\n if (!isNaN(this.value)) {\r\n this._type = NodeGeometryBlockConnectionPointTypes.Float;\r\n return this._type;\r\n }\r\n\r\n switch (this.value.getClassName()) {\r\n case \"Vector2\":\r\n this._type = NodeGeometryBlockConnectionPointTypes.Vector2;\r\n return this._type;\r\n case \"Vector3\":\r\n this._type = NodeGeometryBlockConnectionPointTypes.Vector3;\r\n return this._type;\r\n case \"Vector4\":\r\n this._type = NodeGeometryBlockConnectionPointTypes.Vector4;\r\n return this._type;\r\n case \"Matrix\":\r\n this._type = NodeGeometryBlockConnectionPointTypes.Matrix;\r\n return this._type;\r\n }\r\n }\r\n }\r\n\r\n return this._type;\r\n }\r\n\r\n /**\r\n * Gets a boolean indicating that the current connection point is a contextual value\r\n */\r\n public get isContextual(): boolean {\r\n return this._contextualSource !== NodeGeometryContextualSources.None;\r\n }\r\n\r\n /**\r\n * Gets or sets the current contextual value\r\n */\r\n public get contextualValue(): NodeGeometryContextualSources {\r\n return this._contextualSource;\r\n }\r\n\r\n public set contextualValue(value: NodeGeometryContextualSources) {\r\n this._contextualSource = value;\r\n\r\n switch (value) {\r\n case NodeGeometryContextualSources.Positions:\r\n case NodeGeometryContextualSources.Normals:\r\n this._type = NodeGeometryBlockConnectionPointTypes.Vector3;\r\n break;\r\n case NodeGeometryContextualSources.Colors:\r\n case NodeGeometryContextualSources.Tangents:\r\n this._type = NodeGeometryBlockConnectionPointTypes.Vector4;\r\n break;\r\n case NodeGeometryContextualSources.UV:\r\n case NodeGeometryContextualSources.UV2:\r\n case NodeGeometryContextualSources.UV3:\r\n case NodeGeometryContextualSources.UV4:\r\n case NodeGeometryContextualSources.UV5:\r\n case NodeGeometryContextualSources.UV6:\r\n this._type = NodeGeometryBlockConnectionPointTypes.Vector2;\r\n break;\r\n case NodeGeometryContextualSources.VertexID:\r\n case NodeGeometryContextualSources.GeometryID:\r\n case NodeGeometryContextualSources.CollectionID:\r\n case NodeGeometryContextualSources.FaceID:\r\n case NodeGeometryContextualSources.LoopID:\r\n case NodeGeometryContextualSources.InstanceID:\r\n this._type = NodeGeometryBlockConnectionPointTypes.Int;\r\n break;\r\n }\r\n\r\n if (this.output) {\r\n this.output.type = this._type;\r\n }\r\n }\r\n\r\n /**\r\n * Creates a new InputBlock\r\n * @param name defines the block name\r\n * @param type defines the type of the input (can be set to NodeGeometryBlockConnectionPointTypes.AutoDetect)\r\n */\r\n public constructor(name: string, type: NodeGeometryBlockConnectionPointTypes = NodeGeometryBlockConnectionPointTypes.AutoDetect) {\r\n super(name);\r\n\r\n this._type = type;\r\n this._isInput = true;\r\n\r\n this.setDefaultValue();\r\n\r\n this.registerOutput(\"output\", type);\r\n }\r\n\r\n /**\r\n * Gets or sets the value of that point.\r\n * Please note that this value will be ignored if valueCallback is defined\r\n */\r\n public get value(): any {\r\n return this._storedValue;\r\n }\r\n\r\n public set value(value: any) {\r\n if (this.type === NodeGeometryBlockConnectionPointTypes.Float) {\r\n if (this.min !== this.max) {\r\n value = Math.max(this.min, value);\r\n value = Math.min(this.max, value);\r\n }\r\n }\r\n\r\n this._storedValue = value;\r\n\r\n this.onValueChangedObservable.notifyObservers(this);\r\n }\r\n\r\n /**\r\n * Gets or sets a callback used to get the value of that point.\r\n * Please note that setting this value will force the connection point to ignore the value property\r\n */\r\n public get valueCallback(): () => any {\r\n return this._valueCallback;\r\n }\r\n\r\n public set valueCallback(value: () => any) {\r\n this._valueCallback = value;\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 \"GeometryInputBlock\";\r\n }\r\n\r\n /**\r\n * Gets the geometry output component\r\n */\r\n public get output(): NodeGeometryConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n /**\r\n * Set the input block to its default value (based on its type)\r\n */\r\n public setDefaultValue() {\r\n this.contextualValue = NodeGeometryContextualSources.None;\r\n switch (this.type) {\r\n case NodeGeometryBlockConnectionPointTypes.Int:\r\n case NodeGeometryBlockConnectionPointTypes.Float:\r\n this.value = 0;\r\n break;\r\n case NodeGeometryBlockConnectionPointTypes.Vector2:\r\n this.value = Vector2.Zero();\r\n break;\r\n case NodeGeometryBlockConnectionPointTypes.Vector3:\r\n this.value = Vector3.Zero();\r\n break;\r\n case NodeGeometryBlockConnectionPointTypes.Vector4:\r\n this.value = Vector4.Zero();\r\n break;\r\n case NodeGeometryBlockConnectionPointTypes.Matrix:\r\n this.value = Matrix.Identity();\r\n break;\r\n }\r\n }\r\n\r\n protected override _buildBlock(state: NodeGeometryBuildState) {\r\n super._buildBlock(state);\r\n\r\n if (this.isContextual) {\r\n this.output._storedValue = null;\r\n this.output._storedFunction = (state) => {\r\n return state.getContextualValue(this._contextualSource);\r\n };\r\n } else {\r\n this.output._storedFunction = null;\r\n this.output._storedValue = this.value;\r\n }\r\n }\r\n\r\n public override dispose() {\r\n this.onValueChangedObservable.clear();\r\n\r\n super.dispose();\r\n }\r\n\r\n protected override _dumpPropertiesCode() {\r\n const variableName = this._codeVariableName;\r\n\r\n if (this.isContextual) {\r\n return (\r\n super._dumpPropertiesCode() + `${variableName}.contextualValue = BABYLON.NodeGeometryContextualSources.${NodeGeometryContextualSources[this._contextualSource]};\\n`\r\n );\r\n }\r\n const codes: string[] = [];\r\n\r\n let valueString = \"\";\r\n\r\n switch (this.type) {\r\n case NodeGeometryBlockConnectionPointTypes.Float:\r\n case NodeGeometryBlockConnectionPointTypes.Int:\r\n valueString = `${this.value}`;\r\n break;\r\n case NodeGeometryBlockConnectionPointTypes.Vector2:\r\n valueString = `new BABYLON.Vector2(${this.value.x}, ${this.value.y})`;\r\n break;\r\n case NodeGeometryBlockConnectionPointTypes.Vector3:\r\n valueString = `new BABYLON.Vector3(${this.value.x}, ${this.value.y}, ${this.value.z})`;\r\n break;\r\n case NodeGeometryBlockConnectionPointTypes.Vector4:\r\n valueString = `new BABYLON.Vector4(${this.value.x}, ${this.value.y}, ${this.value.z}, ${this.value.w})`;\r\n break;\r\n }\r\n\r\n // Common Property \"Value\"\r\n codes.push(`${variableName}.value = ${valueString}`);\r\n\r\n // Float-Value-Specific Properties\r\n if (this.type === NodeGeometryBlockConnectionPointTypes.Float || this.type === NodeGeometryBlockConnectionPointTypes.Int) {\r\n codes.push(`${variableName}.min = ${this.min}`, `${variableName}.max = ${this.max}`);\r\n }\r\n\r\n codes.push(\"\");\r\n\r\n return super._dumpPropertiesCode() + codes.join(\";\\n\");\r\n }\r\n\r\n public override serialize(): any {\r\n const serializationObject = super.serialize();\r\n\r\n serializationObject.type = this.type;\r\n serializationObject.contextualValue = this.contextualValue;\r\n serializationObject.min = this.min;\r\n serializationObject.max = this.max;\r\n serializationObject.groupInInspector = this.groupInInspector;\r\n\r\n if (this._storedValue !== null && !this.isContextual) {\r\n if (this._storedValue.asArray) {\r\n serializationObject.valueType = \"BABYLON.\" + this._storedValue.getClassName();\r\n serializationObject.value = this._storedValue.asArray();\r\n } else {\r\n serializationObject.valueType = \"number\";\r\n serializationObject.value = this._storedValue;\r\n }\r\n }\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._type = serializationObject.type;\r\n\r\n this.contextualValue = serializationObject.contextualValue;\r\n this.min = serializationObject.min || 0;\r\n this.max = serializationObject.max || 0;\r\n this.groupInInspector = serializationObject.groupInInspector || \"\";\r\n\r\n if (!serializationObject.valueType) {\r\n return;\r\n }\r\n\r\n if (serializationObject.valueType === \"number\") {\r\n this._storedValue = serializationObject.value;\r\n } else {\r\n const valueType = GetClass(serializationObject.valueType);\r\n\r\n if (valueType) {\r\n this._storedValue = valueType.FromArray(serializationObject.value);\r\n }\r\n }\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.GeometryInputBlock\", GeometryInputBlock);\r\n"]}
1
+ {"version":3,"file":"geometryInputBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Meshes/Node/Blocks/geometryInputBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,qCAAqC,EAAE,MAAM,2CAA2C,CAAC;AAClG,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAE/E,OAAO,EAAE,6BAA6B,EAAE,MAAM,wCAAwC,CAAC;AAEvF;;GAEG;AACH,MAAM,OAAO,kBAAmB,SAAQ,iBAAiB;IAkBrD;;OAEG;IACH,IAAW,IAAI;QACX,IAAI,IAAI,CAAC,KAAK,KAAK,qCAAqC,CAAC,UAAU,EAAE;YACjE,IAAI,IAAI,CAAC,KAAK,IAAI,IAAI,EAAE;gBACpB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE;oBACpB,IAAI,CAAC,K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,CAAC,CAAC;QACxC,IAAI,CAAC,GAAG,GAAG,mBAAmB,CAAC,GAAG,IAAI,CAAC,CAAC;QACxC,IAAI,CAAC,gBAAgB,GAAG,mBAAmB,CAAC,gBAAgB,IAAI,EAAE,CAAC;QAEnE,IAAI,CAAC,mBAAmB,CAAC,SAAS,EAAE;YAChC,OAAO;SACV;QAED,IAAI,mBAAmB,CAAC,SAAS,KAAK,QAAQ,EAAE;YAC5C,IAAI,CAAC,YAAY,GAAG,mBAAmB,CAAC,KAAK,CAAC;SACjD;aAAM;YACH,MAAM,SAAS,GAAG,QAAQ,CAAC,mBAAmB,CAAC,SAAS,CAAC,CAAC;YAE1D,IAAI,SAAS,EAAE;gBACX,IAAI,CAAC,YAAY,GAAG,SAAS,CAAC,SAAS,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAAC;aACtE;SACJ;IACL,CAAC;CACJ;AAED,aAAa,CAAC,4BAA4B,EAAE,kBAAkB,CAAC,CAAC","sourcesContent":["import { Observable } from \"../../../Misc/observable\";\r\nimport { NodeGeometryBlockConnectionPointTypes } from \"../Enums/nodeGeometryConnectionPointTypes\";\r\nimport { NodeGeometryBlock } from \"../nodeGeometryBlock\";\r\nimport type { NodeGeometryConnectionPoint } from \"../nodeGeometryBlockConnectionPoint\";\r\nimport { GetClass, RegisterClass } from \"../../../Misc/typeStore\";\r\nimport { Matrix, Vector2, Vector3, Vector4 } from \"../../../Maths/math.vector\";\r\nimport type { NodeGeometryBuildState } from \"../nodeGeometryBuildState\";\r\nimport { NodeGeometryContextualSources } from \"../Enums/nodeGeometryContextualSources\";\r\n\r\n/**\r\n * Block used to expose an input value\r\n */\r\nexport class GeometryInputBlock extends NodeGeometryBlock {\r\n private _storedValue: any;\r\n private _valueCallback: () => any;\r\n private _type: NodeGeometryBlockConnectionPointTypes = NodeGeometryBlockConnectionPointTypes.Undefined;\r\n private _contextualSource = NodeGeometryContextualSources.None;\r\n\r\n /** Gets or set a value used to limit the range of float values */\r\n public min: number = 0;\r\n\r\n /** Gets or set a value used to limit the range of float values */\r\n public max: number = 0;\r\n\r\n /** Gets or sets the group to use to display this block in the Inspector */\r\n public groupInInspector = \"\";\r\n\r\n /** Gets an observable raised when the value is changed */\r\n public onValueChangedObservable = new Observable<GeometryInputBlock>();\r\n\r\n /**\r\n * Gets or sets the connection point type (default is float)\r\n */\r\n public get type(): NodeGeometryBlockConnectionPointTypes {\r\n if (this._type === NodeGeometryBlockConnectionPointTypes.AutoDetect) {\r\n if (this.value != null) {\r\n if (!isNaN(this.value)) {\r\n this._type = NodeGeometryBlockConnectionPointTypes.Float;\r\n return this._type;\r\n }\r\n\r\n switch (this.value.getClassName()) {\r\n case \"Vector2\":\r\n this._type = NodeGeometryBlockConnectionPointTypes.Vector2;\r\n return this._type;\r\n case \"Vector3\":\r\n this._type = NodeGeometryBlockConnectionPointTypes.Vector3;\r\n return this._type;\r\n case \"Vector4\":\r\n this._type = NodeGeometryBlockConnectionPointTypes.Vector4;\r\n return this._type;\r\n case \"Matrix\":\r\n this._type = NodeGeometryBlockConnectionPointTypes.Matrix;\r\n return this._type;\r\n }\r\n }\r\n }\r\n\r\n return this._type;\r\n }\r\n\r\n /**\r\n * Gets a boolean indicating that the current connection point is a contextual value\r\n */\r\n public get isContextual(): boolean {\r\n return this._contextualSource !== NodeGeometryContextualSources.None;\r\n }\r\n\r\n /**\r\n * Gets or sets the current contextual value\r\n */\r\n public get contextualValue(): NodeGeometryContextualSources {\r\n return this._contextualSource;\r\n }\r\n\r\n public set contextualValue(value: NodeGeometryContextualSources) {\r\n this._contextualSource = value;\r\n\r\n switch (value) {\r\n case NodeGeometryContextualSources.Positions:\r\n case NodeGeometryContextualSources.Normals:\r\n case NodeGeometryContextualSources.LatticeID:\r\n case NodeGeometryContextualSources.LatticeControl:\r\n this._type = NodeGeometryBlockConnectionPointTypes.Vector3;\r\n break;\r\n case NodeGeometryContextualSources.Colors:\r\n case NodeGeometryContextualSources.Tangents:\r\n this._type = NodeGeometryBlockConnectionPointTypes.Vector4;\r\n break;\r\n case NodeGeometryContextualSources.UV:\r\n case NodeGeometryContextualSources.UV2:\r\n case NodeGeometryContextualSources.UV3:\r\n case NodeGeometryContextualSources.UV4:\r\n case NodeGeometryContextualSources.UV5:\r\n case NodeGeometryContextualSources.UV6:\r\n this._type = NodeGeometryBlockConnectionPointTypes.Vector2;\r\n break;\r\n case NodeGeometryContextualSources.VertexID:\r\n case NodeGeometryContextualSources.GeometryID:\r\n case NodeGeometryContextualSources.CollectionID:\r\n case NodeGeometryContextualSources.FaceID:\r\n case NodeGeometryContextualSources.LoopID:\r\n case NodeGeometryContextualSources.InstanceID:\r\n this._type = NodeGeometryBlockConnectionPointTypes.Int;\r\n break;\r\n }\r\n\r\n if (this.output) {\r\n this.output.type = this._type;\r\n }\r\n }\r\n\r\n /**\r\n * Creates a new InputBlock\r\n * @param name defines the block name\r\n * @param type defines the type of the input (can be set to NodeGeometryBlockConnectionPointTypes.AutoDetect)\r\n */\r\n public constructor(name: string, type: NodeGeometryBlockConnectionPointTypes = NodeGeometryBlockConnectionPointTypes.AutoDetect) {\r\n super(name);\r\n\r\n this._type = type;\r\n this._isInput = true;\r\n\r\n this.setDefaultValue();\r\n\r\n this.registerOutput(\"output\", type);\r\n }\r\n\r\n /**\r\n * Gets or sets the value of that point.\r\n * Please note that this value will be ignored if valueCallback is defined\r\n */\r\n public get value(): any {\r\n return this._storedValue;\r\n }\r\n\r\n public set value(value: any) {\r\n if (this.type === NodeGeometryBlockConnectionPointTypes.Float) {\r\n if (this.min !== this.max) {\r\n value = Math.max(this.min, value);\r\n value = Math.min(this.max, value);\r\n }\r\n }\r\n\r\n this._storedValue = value;\r\n\r\n this.onValueChangedObservable.notifyObservers(this);\r\n }\r\n\r\n /**\r\n * Gets or sets a callback used to get the value of that point.\r\n * Please note that setting this value will force the connection point to ignore the value property\r\n */\r\n public get valueCallback(): () => any {\r\n return this._valueCallback;\r\n }\r\n\r\n public set valueCallback(value: () => any) {\r\n this._valueCallback = value;\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 \"GeometryInputBlock\";\r\n }\r\n\r\n /**\r\n * Gets the geometry output component\r\n */\r\n public get output(): NodeGeometryConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n /**\r\n * Set the input block to its default value (based on its type)\r\n */\r\n public setDefaultValue() {\r\n this.contextualValue = NodeGeometryContextualSources.None;\r\n switch (this.type) {\r\n case NodeGeometryBlockConnectionPointTypes.Int:\r\n case NodeGeometryBlockConnectionPointTypes.Float:\r\n this.value = 0;\r\n break;\r\n case NodeGeometryBlockConnectionPointTypes.Vector2:\r\n this.value = Vector2.Zero();\r\n break;\r\n case NodeGeometryBlockConnectionPointTypes.Vector3:\r\n this.value = Vector3.Zero();\r\n break;\r\n case NodeGeometryBlockConnectionPointTypes.Vector4:\r\n this.value = Vector4.Zero();\r\n break;\r\n case NodeGeometryBlockConnectionPointTypes.Matrix:\r\n this.value = Matrix.Identity();\r\n break;\r\n }\r\n }\r\n\r\n protected override _buildBlock(state: NodeGeometryBuildState) {\r\n super._buildBlock(state);\r\n\r\n if (this.isContextual) {\r\n this.output._storedValue = null;\r\n this.output._storedFunction = (state) => {\r\n return state.getContextualValue(this._contextualSource);\r\n };\r\n } else {\r\n this.output._storedFunction = null;\r\n this.output._storedValue = this.value;\r\n }\r\n }\r\n\r\n public override dispose() {\r\n this.onValueChangedObservable.clear();\r\n\r\n super.dispose();\r\n }\r\n\r\n protected override _dumpPropertiesCode() {\r\n const variableName = this._codeVariableName;\r\n\r\n if (this.isContextual) {\r\n return (\r\n super._dumpPropertiesCode() + `${variableName}.contextualValue = BABYLON.NodeGeometryContextualSources.${NodeGeometryContextualSources[this._contextualSource]};\\n`\r\n );\r\n }\r\n const codes: string[] = [];\r\n\r\n let valueString = \"\";\r\n\r\n switch (this.type) {\r\n case NodeGeometryBlockConnectionPointTypes.Float:\r\n case NodeGeometryBlockConnectionPointTypes.Int:\r\n valueString = `${this.value}`;\r\n break;\r\n case NodeGeometryBlockConnectionPointTypes.Vector2:\r\n valueString = `new BABYLON.Vector2(${this.value.x}, ${this.value.y})`;\r\n break;\r\n case NodeGeometryBlockConnectionPointTypes.Vector3:\r\n valueString = `new BABYLON.Vector3(${this.value.x}, ${this.value.y}, ${this.value.z})`;\r\n break;\r\n case NodeGeometryBlockConnectionPointTypes.Vector4:\r\n valueString = `new BABYLON.Vector4(${this.value.x}, ${this.value.y}, ${this.value.z}, ${this.value.w})`;\r\n break;\r\n }\r\n\r\n // Common Property \"Value\"\r\n codes.push(`${variableName}.value = ${valueString}`);\r\n\r\n // Float-Value-Specific Properties\r\n if (this.type === NodeGeometryBlockConnectionPointTypes.Float || this.type === NodeGeometryBlockConnectionPointTypes.Int) {\r\n codes.push(`${variableName}.min = ${this.min}`, `${variableName}.max = ${this.max}`);\r\n }\r\n\r\n codes.push(\"\");\r\n\r\n return super._dumpPropertiesCode() + codes.join(\";\\n\");\r\n }\r\n\r\n public override serialize(): any {\r\n const serializationObject = super.serialize();\r\n\r\n serializationObject.type = this.type;\r\n serializationObject.contextualValue = this.contextualValue;\r\n serializationObject.min = this.min;\r\n serializationObject.max = this.max;\r\n serializationObject.groupInInspector = this.groupInInspector;\r\n\r\n if (this._storedValue !== null && !this.isContextual) {\r\n if (this._storedValue.asArray) {\r\n serializationObject.valueType = \"BABYLON.\" + this._storedValue.getClassName();\r\n serializationObject.value = this._storedValue.asArray();\r\n } else {\r\n serializationObject.valueType = \"number\";\r\n serializationObject.value = this._storedValue;\r\n }\r\n }\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._type = serializationObject.type;\r\n\r\n this.contextualValue = serializationObject.contextualValue;\r\n this.min = serializationObject.min || 0;\r\n this.max = serializationObject.max || 0;\r\n this.groupInInspector = serializationObject.groupInInspector || \"\";\r\n\r\n if (!serializationObject.valueType) {\r\n return;\r\n }\r\n\r\n if (serializationObject.valueType === \"number\") {\r\n this._storedValue = serializationObject.value;\r\n } else {\r\n const valueType = GetClass(serializationObject.valueType);\r\n\r\n if (valueType) {\r\n this._storedValue = valueType.FromArray(serializationObject.value);\r\n }\r\n }\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.GeometryInputBlock\", GeometryInputBlock);\r\n"]}
@@ -4,12 +4,17 @@ import type { NodeGeometryConnectionPoint } from "../nodeGeometryBlockConnection
4
4
  import type { NodeGeometryBuildState } from "../nodeGeometryBuildState";
5
5
  /**
6
6
  * Block used to trigger an observable when traversed
7
+ * It can also be used to execute a function when traversed
7
8
  */
8
9
  export declare class GeometryInterceptorBlock extends NodeGeometryBlock {
9
10
  /**
10
11
  * Observable triggered when the block is traversed
11
12
  */
12
13
  onInterceptionObservable: Observable<any>;
14
+ /**
15
+ * Custom function to execute when traversed
16
+ */
17
+ customFunction?: (value: any, state: NodeGeometryBuildState) => any;
13
18
  /**
14
19
  * Creates a new GeometryInterceptorBlock
15
20
  * @param name defines the block name
@@ -4,6 +4,7 @@ import { NodeGeometryBlockConnectionPointTypes } from "../Enums/nodeGeometryConn
4
4
  import { NodeGeometryBlock } from "../nodeGeometryBlock.js";
5
5
  /**
6
6
  * Block used to trigger an observable when traversed
7
+ * It can also be used to execute a function when traversed
7
8
  */
8
9
  export class GeometryInterceptorBlock extends NodeGeometryBlock {
9
10
  /**
@@ -50,7 +51,10 @@ export class GeometryInterceptorBlock extends NodeGeometryBlock {
50
51
  const output = this._outputs[0];
51
52
  const input = this._inputs[0];
52
53
  output._storedFunction = (state) => {
53
- const value = input.getConnectedValue(state);
54
+ let value = input.getConnectedValue(state);
55
+ if (this.customFunction) {
56
+ value = this.customFunction(value, state);
57
+ }
54
58
  this.onInterceptionObservable.notifyObservers(value);
55
59
  return value;
56
60
  };
@@ -1 +1 @@
1
- {"version":3,"file":"geometryInterceptorBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Meshes/Node/Blocks/geometryInterceptorBlock.ts"],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MAAM,CAAC,eAAe,GAAG,CAAC,KAAK,EAAE,EAAE;YAC/B,MAAM,KAAK,GAAG,KAAK,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;YAE7C,IAAI,CAAC,wBAAwB,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;YAErD,OAAO,KAAK,CAAC;QACjB,CAAC,CAAC;IACN,CAAC;CACJ;AAED,aAAa,CAAC,kCAAkC,EAAE,wBAAwB,CAAC,CAAC","sourcesContent":["import { Observable } from \"core/Misc/observable\";\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\n/**\r\n * Block used to trigger an observable when traversed\r\n */\r\nexport class GeometryInterceptorBlock extends NodeGeometryBlock {\r\n /**\r\n * Observable triggered when the block is traversed\r\n */\r\n public onInterceptionObservable = new Observable<any>(undefined, true);\r\n\r\n /**\r\n * Creates a new GeometryInterceptorBlock\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 }\r\n\r\n /**\r\n * Gets the time spent to build this block (in ms)\r\n */\r\n public override get buildExecutionTime() {\r\n return -1;\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 \"GeometryInterceptorBlock\";\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\r\n const output = this._outputs[0];\r\n const input = this._inputs[0];\r\n\r\n output._storedFunction = (state) => {\r\n const value = input.getConnectedValue(state);\r\n\r\n this.onInterceptionObservable.notifyObservers(value);\r\n\r\n return value;\r\n };\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.GeometryInterceptorBlock\", GeometryInterceptorBlock);\r\n"]}
1
+ {"version":3,"file":"geometryInterceptorBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Meshes/Node/Blocks/geometryInterceptorBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,oCAA6B;AAClD,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,wBAAyB,SAAQ,iBAAiB;IAW3D;;;OAGG;IACH,YAAmB,IAAY;QAC3B,KAAK,CAAC,IAAI,CAAC,CAAC;QAfhB;;WAEG;QACI,6BAAwB,GAAG,IAAI,UAAU,CAAM,SAAS,EAAE,IAAI,CAAC,CAAC;QAcnE,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;IAC7D,CAAC;IAED;;OAEG;IACH,IAAoB,kBAAkB;QAClC,OAAO,CAAC,CAAC,CAAC;IACd,CAAC;IAED;;;OAGG;IACa,YAAY;QACxB,OAAO,0BAA0B,CAAC;IACtC,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;IAEkB,WAAW,CAAC,KAA6B;QACxD,KAAK,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;QAEzB,MAAM,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;QAChC,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QAE9B,MAAM,CAAC,eAAe,GAAG,CAAC,KAAK,EAAE,EAAE;YAC/B,IAAI,KAAK,GAAG,KAAK,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;YAE3C,IAAI,IAAI,CAAC,cAAc,EAAE;gBACrB,KAAK,GAAG,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;aAC7C;YAED,IAAI,CAAC,wBAAwB,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;YAErD,OAAO,KAAK,CAAC;QACjB,CAAC,CAAC;IACN,CAAC;CACJ;AAED,aAAa,CAAC,kCAAkC,EAAE,wBAAwB,CAAC,CAAC","sourcesContent":["import { Observable } from \"core/Misc/observable\";\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\n/**\r\n * Block used to trigger an observable when traversed\r\n * It can also be used to execute a function when traversed\r\n */\r\nexport class GeometryInterceptorBlock extends NodeGeometryBlock {\r\n /**\r\n * Observable triggered when the block is traversed\r\n */\r\n public onInterceptionObservable = new Observable<any>(undefined, true);\r\n\r\n /**\r\n * Custom function to execute when traversed\r\n */\r\n public customFunction?: (value: any, state: NodeGeometryBuildState) => any;\r\n\r\n /**\r\n * Creates a new GeometryInterceptorBlock\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 }\r\n\r\n /**\r\n * Gets the time spent to build this block (in ms)\r\n */\r\n public override get buildExecutionTime() {\r\n return -1;\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 \"GeometryInterceptorBlock\";\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\r\n const output = this._outputs[0];\r\n const input = this._inputs[0];\r\n\r\n output._storedFunction = (state) => {\r\n let value = input.getConnectedValue(state);\r\n\r\n if (this.customFunction) {\r\n value = this.customFunction(value, state);\r\n }\r\n\r\n this.onInterceptionObservable.notifyObservers(value);\r\n\r\n return value;\r\n };\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.GeometryInterceptorBlock\", GeometryInterceptorBlock);\r\n"]}
@@ -9,6 +9,8 @@ export declare class GeometryTransformBlock extends NodeGeometryBlock {
9
9
  private _scalingMatrix;
10
10
  private _translationMatrix;
11
11
  private _scalingRotationMatrix;
12
+ private _pivotMatrix;
13
+ private _backPivotMatrix;
12
14
  private _transformMatrix;
13
15
  /**
14
16
  * Gets or sets a boolean indicating that this block can evaluate context
@@ -45,6 +47,10 @@ export declare class GeometryTransformBlock extends NodeGeometryBlock {
45
47
  * Gets the scaling input component
46
48
  */
47
49
  get scaling(): NodeGeometryConnectionPoint;
50
+ /**
51
+ * Gets the pivot input component
52
+ */
53
+ get pivot(): NodeGeometryConnectionPoint;
48
54
  /**
49
55
  * Gets the output component
50
56
  */
@@ -18,6 +18,8 @@ export class GeometryTransformBlock extends NodeGeometryBlock {
18
18
  this._scalingMatrix = new Matrix();
19
19
  this._translationMatrix = new Matrix();
20
20
  this._scalingRotationMatrix = new Matrix();
21
+ this._pivotMatrix = new Matrix();
22
+ this._backPivotMatrix = new Matrix();
21
23
  this._transformMatrix = new Matrix();
22
24
  /**
23
25
  * Gets or sets a boolean indicating that this block can evaluate context
@@ -29,6 +31,7 @@ export class GeometryTransformBlock extends NodeGeometryBlock {
29
31
  this.registerInput("translation", NodeGeometryBlockConnectionPointTypes.Vector3, true, Vector3.Zero());
30
32
  this.registerInput("rotation", NodeGeometryBlockConnectionPointTypes.Vector3, true, Vector3.Zero());
31
33
  this.registerInput("scaling", NodeGeometryBlockConnectionPointTypes.Vector3, true, Vector3.One());
34
+ this.registerInput("pivot", NodeGeometryBlockConnectionPointTypes.Vector3, true, Vector3.Zero());
32
35
  this.registerOutput("output", NodeGeometryBlockConnectionPointTypes.BasedOnInput);
33
36
  this._outputs[0]._typeConnectionSource = this._inputs[0];
34
37
  this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Float);
@@ -72,6 +75,12 @@ export class GeometryTransformBlock extends NodeGeometryBlock {
72
75
  get scaling() {
73
76
  return this._inputs[4];
74
77
  }
78
+ /**
79
+ * Gets the pivot input component
80
+ */
81
+ get pivot() {
82
+ return this._inputs[5];
83
+ }
75
84
  /**
76
85
  * Gets the output component
77
86
  */
@@ -97,11 +106,14 @@ export class GeometryTransformBlock extends NodeGeometryBlock {
97
106
  const scaling = this.scaling.getConnectedValue(state);
98
107
  const rotation = this.rotation.getConnectedValue(state);
99
108
  const translation = this.translation.getConnectedValue(state);
109
+ const pivot = this.pivot.getConnectedValue(state);
100
110
  // Transform
111
+ Matrix.TranslationToRef(-pivot.x, -pivot.y, -pivot.z, this._pivotMatrix);
101
112
  Matrix.ScalingToRef(scaling.x, scaling.y, scaling.z, this._scalingMatrix);
102
113
  Matrix.RotationYawPitchRollToRef(rotation.y, rotation.x, rotation.z, this._rotationMatrix);
103
- Matrix.TranslationToRef(translation.x, translation.y, translation.z, this._translationMatrix);
104
- this._scalingMatrix.multiplyToRef(this._rotationMatrix, this._scalingRotationMatrix);
114
+ Matrix.TranslationToRef(translation.x + pivot.x, translation.y + pivot.y, translation.z + pivot.z, this._translationMatrix);
115
+ this._pivotMatrix.multiplyToRef(this._scalingMatrix, this._backPivotMatrix);
116
+ this._backPivotMatrix.multiplyToRef(this._rotationMatrix, this._scalingRotationMatrix);
105
117
  this._scalingRotationMatrix.multiplyToRef(this._translationMatrix, this._transformMatrix);
106
118
  matrix = this._transformMatrix;
107
119
  }
@@ -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,EAA0B,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,C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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
+ {"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,EAA0B,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAGnG;;GAEG;AACH,MAAM,OAAO,sBAAuB,SAAQ,iBAAiB;IAgBzD;;;OAGG;IACH,YAAmB,IAAY;QAC3B,KAAK,CAAC,IAAI,CAAC,CAAC;QApBR,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,iBAAY,GAAG,IAAI,MAAM,EAAE,CAAC;QAC5B,qBAAgB,GAAG,IAAI,MAAM,EAAE,CAAC;QAChC,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,IAAI,EAAE,OAAO,CAAC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AG,mBAAmB,CAAC,eAAe,CAAC;SAC9D;IACL,CAAC;CACJ;AAtKU;IADN,sBAAsB,CAAC,kBAAkB,0CAAkC,UAAU,EAAE,EAAE,SAAS,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,CAAC;+DAC3F;AAwKlC,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 _pivotMatrix = new Matrix();\r\n private _backPivotMatrix = 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 this.registerInput(\"pivot\", NodeGeometryBlockConnectionPointTypes.Vector3, true, Vector3.Zero());\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 pivot input component\r\n */\r\n public get pivot(): NodeGeometryConnectionPoint {\r\n return this._inputs[5];\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 const pivot = this.pivot.getConnectedValue(state);\r\n\r\n // Transform\r\n Matrix.TranslationToRef(-pivot.x, -pivot.y, -pivot.z, this._pivotMatrix);\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 + pivot.x, translation.y + pivot.y, translation.z + pivot.z, this._translationMatrix);\r\n\r\n this._pivotMatrix.multiplyToRef(this._scalingMatrix, this._backPivotMatrix);\r\n this._backPivotMatrix.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"]}
@@ -35,5 +35,9 @@ export declare enum NodeGeometryContextualSources {
35
35
  /** LoopID */
36
36
  LoopID = 15,
37
37
  /** InstanceID */
38
- InstanceID = 16
38
+ InstanceID = 16,
39
+ /** LatticeID */
40
+ LatticeID = 17,
41
+ /** LatticeControl */
42
+ LatticeControl = 18
39
43
  }
@@ -37,5 +37,9 @@ export var NodeGeometryContextualSources;
37
37
  NodeGeometryContextualSources[NodeGeometryContextualSources["LoopID"] = 15] = "LoopID";
38
38
  /** InstanceID */
39
39
  NodeGeometryContextualSources[NodeGeometryContextualSources["InstanceID"] = 16] = "InstanceID";
40
+ /** LatticeID */
41
+ NodeGeometryContextualSources[NodeGeometryContextualSources["LatticeID"] = 17] = "LatticeID";
42
+ /** LatticeControl */
43
+ NodeGeometryContextualSources[NodeGeometryContextualSources["LatticeControl"] = 18] = "LatticeControl";
40
44
  })(NodeGeometryContextualSources || (NodeGeometryContextualSources = {}));
41
45
  //# sourceMappingURL=nodeGeometryContextualSources.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"nodeGeometryContextualSources.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Meshes/Node/Enums/nodeGeometryContextualSources.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAN,IAAY,6BAmCX;AAnCD,WAAY,6BAA6B;IACrC,WAAW;IACX,iFAAa,CAAA;IACb,gBAAgB;IAChB,2FAAkB,CAAA;IAClB,cAAc;IACd,uFAAgB,CAAA;IAChB,eAAe;IACf,yFAAiB,CAAA;IACjB,SAAS;IACT,6EAAW,CAAA;IACX,UAAU;IACV,+EAAY,CAAA;IACZ,UAAU;IACV,+EAAY,CAAA;IACZ,UAAU;IACV,+EAAY,CAAA;IACZ,UAAU;IACV,+EAAY,CAAA;IACZ,UAAU;IACV,+EAAY,CAAA;IACZ,aAAa;IACb,sFAAe,CAAA;IACf,eAAe;IACf,0FAAiB,CAAA;IACjB,aAAa;IACb,sFAAe,CAAA;IACf,iBAAiB;IACjB,8FAAmB,CAAA;IACnB,mBAAmB;IACnB,kGAAqB,CAAA;IACrB,aAAa;IACb,sFAAe,CAAA;IACf,iBAAiB;IACjB,8FAAmB,CAAA;AACvB,CAAC,EAnCW,6BAA6B,KAA7B,6BAA6B,QAmCxC","sourcesContent":["/**\r\n * Defines the kind of contextual sources for node geometry\r\n */\r\nexport enum NodeGeometryContextualSources {\r\n /** None */\r\n None = 0x0000,\r\n /** Positions */\r\n Positions = 0x0001,\r\n /** Normals */\r\n Normals = 0x0002,\r\n /** Tangents */\r\n Tangents = 0x0003,\r\n /** UV */\r\n UV = 0x0004,\r\n /** UV2 */\r\n UV2 = 0x0005,\r\n /** UV3 */\r\n UV3 = 0x0006,\r\n /** UV4 */\r\n UV4 = 0x0007,\r\n /** UV5 */\r\n UV5 = 0x0008,\r\n /** UV6 */\r\n UV6 = 0x0009,\r\n /** Colors */\r\n Colors = 0x000a,\r\n /** VertexID */\r\n VertexID = 0x000b,\r\n /** FaceID */\r\n FaceID = 0x000c,\r\n /** GeometryID */\r\n GeometryID = 0x000d,\r\n /** CollectionID */\r\n CollectionID = 0x000e,\r\n /** LoopID */\r\n LoopID = 0x000f,\r\n /** InstanceID */\r\n InstanceID = 0x0010,\r\n}\r\n"]}
1
+ {"version":3,"file":"nodeGeometryContextualSources.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Meshes/Node/Enums/nodeGeometryContextualSources.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAN,IAAY,6BAuCX;AAvCD,WAAY,6BAA6B;IACrC,WAAW;IACX,iFAAa,CAAA;IACb,gBAAgB;IAChB,2FAAkB,CAAA;IAClB,cAAc;IACd,uFAAgB,CAAA;IAChB,eAAe;IACf,yFAAiB,CAAA;IACjB,SAAS;IACT,6EAAW,CAAA;IACX,UAAU;IACV,+EAAY,CAAA;IACZ,UAAU;IACV,+EAAY,CAAA;IACZ,UAAU;IACV,+EAAY,CAAA;IACZ,UAAU;IACV,+EAAY,CAAA;IACZ,UAAU;IACV,+EAAY,CAAA;IACZ,aAAa;IACb,sFAAe,CAAA;IACf,eAAe;IACf,0FAAiB,CAAA;IACjB,aAAa;IACb,sFAAe,CAAA;IACf,iBAAiB;IACjB,8FAAmB,CAAA;IACnB,mBAAmB;IACnB,kGAAqB,CAAA;IACrB,aAAa;IACb,sFAAe,CAAA;IACf,iBAAiB;IACjB,8FAAmB,CAAA;IACnB,gBAAgB;IAChB,4FAAkB,CAAA;IAClB,qBAAqB;IACrB,sGAAuB,CAAA;AAC3B,CAAC,EAvCW,6BAA6B,KAA7B,6BAA6B,QAuCxC","sourcesContent":["/**\r\n * Defines the kind of contextual sources for node geometry\r\n */\r\nexport enum NodeGeometryContextualSources {\r\n /** None */\r\n None = 0x0000,\r\n /** Positions */\r\n Positions = 0x0001,\r\n /** Normals */\r\n Normals = 0x0002,\r\n /** Tangents */\r\n Tangents = 0x0003,\r\n /** UV */\r\n UV = 0x0004,\r\n /** UV2 */\r\n UV2 = 0x0005,\r\n /** UV3 */\r\n UV3 = 0x0006,\r\n /** UV4 */\r\n UV4 = 0x0007,\r\n /** UV5 */\r\n UV5 = 0x0008,\r\n /** UV6 */\r\n UV6 = 0x0009,\r\n /** Colors */\r\n Colors = 0x000a,\r\n /** VertexID */\r\n VertexID = 0x000b,\r\n /** FaceID */\r\n FaceID = 0x000c,\r\n /** GeometryID */\r\n GeometryID = 0x000d,\r\n /** CollectionID */\r\n CollectionID = 0x000e,\r\n /** LoopID */\r\n LoopID = 0x000f,\r\n /** InstanceID */\r\n InstanceID = 0x0010,\r\n /** LatticeID */\r\n LatticeID = 0x0011,\r\n /** LatticeControl */\r\n LatticeControl = 0x0012,\r\n}\r\n"]}
@@ -36,6 +36,7 @@ export * from "./Blocks/computeNormalsBlock";
36
36
  export * from "./Blocks/vectorConverterBlock";
37
37
  export * from "./Blocks/normalizeVectorBlock";
38
38
  export * from "./Blocks/Set/setMaterialIDBlock";
39
+ export * from "./Blocks/Set/latticeBlock";
39
40
  export * from "./Blocks/geometryTrigonometryBlock";
40
41
  export * from "./Blocks/geometryTransformBlock";
41
42
  export * from "./Blocks/Matrices/rotationXBlock";
@@ -79,3 +80,4 @@ export * from "./Blocks/geometryDotBlock";
79
80
  export * from "./Blocks/geometryLengthBlock";
80
81
  export * from "./Blocks/geometryRotate2dBlock";
81
82
  export * from "./Blocks/geometryInterceptorBlock";
83
+ export * from "./Blocks/Set/aggregatorBlock";
@@ -36,6 +36,7 @@ export * from "./Blocks/computeNormalsBlock.js";
36
36
  export * from "./Blocks/vectorConverterBlock.js";
37
37
  export * from "./Blocks/normalizeVectorBlock.js";
38
38
  export * from "./Blocks/Set/setMaterialIDBlock.js";
39
+ export * from "./Blocks/Set/latticeBlock.js";
39
40
  export * from "./Blocks/geometryTrigonometryBlock.js";
40
41
  export * from "./Blocks/geometryTransformBlock.js";
41
42
  export * from "./Blocks/Matrices/rotationXBlock.js";
@@ -79,4 +80,5 @@ export * from "./Blocks/geometryDotBlock.js";
79
80
  export * from "./Blocks/geometryLengthBlock.js";
80
81
  export * from "./Blocks/geometryRotate2dBlock.js";
81
82
  export * from "./Blocks/geometryInterceptorBlock.js";
83
+ export * from "./Blocks/Set/aggregatorBlock.js";
82
84
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../dev/core/src/Meshes/Node/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,oCAAoC,CAAC;AACnD,cAAc,0BAA0B,CAAC;AACzC,cAAc,2CAA2C,CAAC;AAC1D,cAAc,0CAA0C,CAAC;AACzD,cAAc,uCAAuC,CAAC;AACtD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,iCAAiC,CAAC;AAChD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,0BAA0B,CAAC;AACzC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,kCAAkC,CAAC;AACjD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,i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ock\";\r\nexport * from \"./nodeGeometryBlockConnectionPoint\";\r\nexport * from \"./nodeGeometryBuildState\";\r\nexport * from \"./Interfaces/nodeGeometryExecutionContext\";\r\nexport * from \"./Enums/nodeGeometryConnectionPointTypes\";\r\nexport * from \"./Enums/nodeGeometryContextualSources\";\r\nexport * from \"./Blocks/geometryOptimizeBlock\";\r\nexport * from \"./Blocks/geometryOutputBlock\";\r\nexport * from \"./Blocks/geometryInputBlock\";\r\nexport * from \"./Blocks/Sources/planeBlock\";\r\nexport * from \"./Blocks/Sources/boxBlock\";\r\nexport * from \"./Blocks/Sources/meshBlock\";\r\nexport * from \"./Blocks/Sources/icoSphereBlock\";\r\nexport * from \"./Blocks/Sources/sphereBlock\";\r\nexport * from \"./Blocks/Sources/gridBlock\";\r\nexport * from \"./Blocks/Sources/torusBlock\";\r\nexport * from \"./Blocks/Sources/cylinderBlock\";\r\nexport * from \"./Blocks/Sources/capsuleBlock\";\r\nexport * from \"./Blocks/Sources/discBlock\";\r\nexport * from \"./Blocks/Sources/nullBlock\";\r\nexport * from \"./Blocks/Set/setPositionsBlock\";\r\nexport * from \"./Blocks/Set/setNormalsBlock\";\r\nexport * from \"./Blocks/Set/setUVsBlock\";\r\nexport * from \"./Blocks/Set/setColorsBlock\";\r\nexport * from \"./Blocks/Set/setTangentsBlock\";\r\nexport * from \"./Blocks/mathBlock\";\r\nexport * from \"./Blocks/mapRangeBlock\";\r\nexport * from \"./Blocks/conditionBlock\";\r\nexport * from \"./Blocks/randomBlock\";\r\nexport * from \"./Blocks/noiseBlock\";\r\nexport * from \"./Blocks/mergeGeometryBlock\";\r\nexport * from \"./Blocks/geometryCollectionBlock\";\r\nexport * from \"./Blocks/geometryElbowBlock\";\r\nexport * from \"./Blocks/computeNormalsBlock\";\r\nexport * from \"./Blocks/vectorConverterBlock\";\r\nexport * from \"./Blocks/normalizeVectorBlock\";\r\nexport * from \"./Blocks/Set/setMaterialIDBlock\";\r\nexport * from \"./Blocks/geometryTrigonometryBlock\";\r\nexport * from \"./Blocks/geometryTransformBlock\";\r\nexport * from \"./Blocks/Matrices/rotationXBlock\";\r\nexport * from \"./Blocks/Matrices/rotationYBlock\";\r\nexport * from \"./Blocks/Matrices/rotationZBlock\";\r\nexport * from \"./Blocks/Matrices/scalingBlock\";\r\nexport * from \"./Blocks/Matrices/alignBlock\";\r\nexport * from \"./Blocks/Matrices/translationBlock\";\r\nexport * from \"./Blocks/Instances/instantiateOnVerticesBlock\";\r\nexport * from \"./Blocks/Instances/instantiateOnFacesBlock\";\r\nexport * from \"./Blocks/Instances/instantiateOnVolumeBlock\";\r\nexport * from \"./Blocks/Instances/instantiateBlock\";\r\nexport * from \"./Blocks/Instances/instantiateLinearBlock\";\r\nexport * from \"./Blocks/Instances/instantiateRadialBlock\";\r\nexport * from \"./Blocks/intFloatConverterBlock\";\r\nexport * from \"./Blocks/debugBlock\";\r\nexport * from \"./Blocks/geometryInfoBlock\";\r\nexport * from \"./Blocks/mappingBlock\";\r\nexport * from \"./Blocks/matrixComposeBlock\";\r\nexport * from \"./Blocks/Teleport/teleportInBlock\";\r\nexport * from \"./Blocks/Teleport/teleportOutBlock\";\r\nexport * from \"./Blocks/Textures/geometryTextureBlock\";\r\nexport * from \"./Blocks/Textures/geometryTextureFetchBlock\";\r\nexport * from \"./Blocks/boundingBlock\";\r\nexport * from \"./Blocks/booleanGeometryBlock\";\r\nexport * from \"./Blocks/geometryArcTan2Block\";\r\nexport * from \"./Blocks/geometryLerpBlock\";\r\nexport * from \"./Blocks/geometryNLerpBlock\";\r\nexport * from \"./Blocks/geometryStepBlock\";\r\nexport * from \"./Blocks/geometrySmoothStepBlock\";\r\nexport * from \"./Blocks/geometryModBlock\";\r\nexport * from \"./Blocks/geometryPowBlock\";\r\nexport * from \"./Blocks/geometryClampBlock\";\r\nexport * from \"./Blocks/geometryCrossBlock\";\r\nexport * from \"./Blocks/geometryCurveBlock\";\r\nexport * from \"./Blocks/geometryDesaturateBlock\";\r\nexport * from \"./Blocks/geometryPosterizeBlock\";\r\nexport * from \"./Blocks/geometryReplaceColorBlock\";\r\nexport * from \"./Blocks/geometryDistanceBlock\";\r\nexport * from \"./Blocks/geometryDotBlock\";\r\nexport * from \"./Blocks/geometryLengthBlock\";\r\nexport * from \"./Blocks/geometryRotate2dBlock\";\r\nexport * from \"./Blocks/geometryInterceptorBlock\";\r\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../dev/core/src/Meshes/Node/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,oCAAoC,CAAC;AACnD,cAAc,0BAA0B,CAAC;AACzC,cAAc,2CAA2C,CAAC;AAC1D,cAAc,0CAA0C,CAAC;AACzD,cAAc,uCAAuC,CAAC;AACtD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,iCAAiC,CAAC;AAChD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,0BAA0B,CAAC;AACzC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,kCAAkC,CAAC;AACjD,cAAc,6BAA6B,CAAC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AAc,8BAA8B,CAAC;AAC7C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,mCAAmC,CAAC;AAClD,cAAc,8BAA8B,CAAC","sourcesContent":["export * from \"./nodeGeometry\";\r\nexport * from \"./nodeGeometryBlock\";\r\nexport * from \"./nodeGeometryBlockConnectionPoint\";\r\nexport * from \"./nodeGeometryBuildState\";\r\nexport * from \"./Interfaces/nodeGeometryExecutionContext\";\r\nexport * from \"./Enums/nodeGeometryConnectionPointTypes\";\r\nexport * from \"./Enums/nodeGeometryContextualSources\";\r\nexport * from \"./Blocks/geometryOptimizeBlock\";\r\nexport * from \"./Blocks/geometryOutputBlock\";\r\nexport * from \"./Blocks/geometryInputBlock\";\r\nexport * from \"./Blocks/Sources/planeBlock\";\r\nexport * from \"./Blocks/Sources/boxBlock\";\r\nexport * from \"./Blocks/Sources/meshBlock\";\r\nexport * from \"./Blocks/Sources/icoSphereBlock\";\r\nexport * from \"./Blocks/Sources/sphereBlock\";\r\nexport * from \"./Blocks/Sources/gridBlock\";\r\nexport * from \"./Blocks/Sources/torusBlock\";\r\nexport * from \"./Blocks/Sources/cylinderBlock\";\r\nexport * from \"./Blocks/Sources/capsuleBlock\";\r\nexport * from \"./Blocks/Sources/discBlock\";\r\nexport * from \"./Blocks/Sources/nullBlock\";\r\nexport * from \"./Blocks/Set/setPositionsBlock\";\r\nexport * from \"./Blocks/Set/setNormalsBlock\";\r\nexport * from \"./Blocks/Set/setUVsBlock\";\r\nexport * from \"./Blocks/Set/setColorsBlock\";\r\nexport * from \"./Blocks/Set/setTangentsBlock\";\r\nexport * from \"./Blocks/mathBlock\";\r\nexport * from \"./Blocks/mapRangeBlock\";\r\nexport * from \"./Blocks/conditionBlock\";\r\nexport * from \"./Blocks/randomBlock\";\r\nexport * from \"./Blocks/noiseBlock\";\r\nexport * from \"./Blocks/mergeGeometryBlock\";\r\nexport * from \"./Blocks/geometryCollectionBlock\";\r\nexport * from \"./Blocks/geometryElbowBlock\";\r\nexport * from \"./Blocks/computeNormalsBlock\";\r\nexport * from \"./Blocks/vectorConverterBlock\";\r\nexport * from \"./Blocks/normalizeVectorBlock\";\r\nexport * from \"./Blocks/Set/setMaterialIDBlock\";\r\nexport * from \"./Blocks/Set/latticeBlock\";\r\nexport * from \"./Blocks/geometryTrigonometryBlock\";\r\nexport * from \"./Blocks/geometryTransformBlock\";\r\nexport * from \"./Blocks/Matrices/rotationXBlock\";\r\nexport * from \"./Blocks/Matrices/rotationYBlock\";\r\nexport * from \"./Blocks/Matrices/rotationZBlock\";\r\nexport * from \"./Blocks/Matrices/scalingBlock\";\r\nexport * from \"./Blocks/Matrices/alignBlock\";\r\nexport * from \"./Blocks/Matrices/translationBlock\";\r\nexport * from \"./Blocks/Instances/instantiateOnVerticesBlock\";\r\nexport * from \"./Blocks/Instances/instantiateOnFacesBlock\";\r\nexport * from \"./Blocks/Instances/instantiateOnVolumeBlock\";\r\nexport * from \"./Blocks/Instances/instantiateBlock\";\r\nexport * from \"./Blocks/Instances/instantiateLinearBlock\";\r\nexport * from \"./Blocks/Instances/instantiateRadialBlock\";\r\nexport * from \"./Blocks/intFloatConverterBlock\";\r\nexport * from \"./Blocks/debugBlock\";\r\nexport * from \"./Blocks/geometryInfoBlock\";\r\nexport * from \"./Blocks/mappingBlock\";\r\nexport * from \"./Blocks/matrixComposeBlock\";\r\nexport * from \"./Blocks/Teleport/teleportInBlock\";\r\nexport * from \"./Blocks/Teleport/teleportOutBlock\";\r\nexport * from \"./Blocks/Textures/geometryTextureBlock\";\r\nexport * from \"./Blocks/Textures/geometryTextureFetchBlock\";\r\nexport * from \"./Blocks/boundingBlock\";\r\nexport * from \"./Blocks/booleanGeometryBlock\";\r\nexport * from \"./Blocks/geometryArcTan2Block\";\r\nexport * from \"./Blocks/geometryLerpBlock\";\r\nexport * from \"./Blocks/geometryNLerpBlock\";\r\nexport * from \"./Blocks/geometryStepBlock\";\r\nexport * from \"./Blocks/geometrySmoothStepBlock\";\r\nexport * from \"./Blocks/geometryModBlock\";\r\nexport * from \"./Blocks/geometryPowBlock\";\r\nexport * from \"./Blocks/geometryClampBlock\";\r\nexport * from \"./Blocks/geometryCrossBlock\";\r\nexport * from \"./Blocks/geometryCurveBlock\";\r\nexport * from \"./Blocks/geometryDesaturateBlock\";\r\nexport * from \"./Blocks/geometryPosterizeBlock\";\r\nexport * from \"./Blocks/geometryReplaceColorBlock\";\r\nexport * from \"./Blocks/geometryDistanceBlock\";\r\nexport * from \"./Blocks/geometryDotBlock\";\r\nexport * from \"./Blocks/geometryLengthBlock\";\r\nexport * from \"./Blocks/geometryRotate2dBlock\";\r\nexport * from \"./Blocks/geometryInterceptorBlock\";\r\nexport * from \"./Blocks/Set/aggregatorBlock\";\r\n"]}
@@ -112,7 +112,7 @@ export declare class NodeGeometry {
112
112
  */
113
113
  private _createNodeEditor;
114
114
  /**
115
- * Build the final geometry
115
+ * Build the final geometry. Please note that the geometry MAY not be ready until the onBuildObservable is raised.
116
116
  * @param verbose defines if the build should log activity
117
117
  * @param updateBuildId defines if the internal build Id should be updated (default is true)
118
118
  * @param autoConfigure defines if the autoConfigure method should be called when initializing blocks (default is false)