@babylonjs/core 7.32.4 → 7.32.5

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 (109) hide show
  1. package/Decorators/nodeDecorator.d.ts +4 -0
  2. package/Decorators/nodeDecorator.js.map +1 -1
  3. package/Engines/abstractEngine.js +2 -2
  4. package/Engines/abstractEngine.js.map +1 -1
  5. package/Materials/Node/Blocks/Dual/sceneDepthBlock.js +1 -0
  6. package/Materials/Node/Blocks/Dual/sceneDepthBlock.js.map +1 -1
  7. package/Materials/Node/Blocks/Fragment/perturbNormalBlock.js +4 -4
  8. package/Materials/Node/Blocks/Fragment/perturbNormalBlock.js.map +1 -1
  9. package/Materials/Node/Blocks/PBR/clearCoatBlock.js +1 -1
  10. package/Materials/Node/Blocks/PBR/clearCoatBlock.js.map +1 -1
  11. package/Materials/Node/Blocks/PBR/reflectionBlock.js +2 -2
  12. package/Materials/Node/Blocks/PBR/reflectionBlock.js.map +1 -1
  13. package/Materials/Node/Blocks/PBR/refractionBlock.js +3 -3
  14. package/Materials/Node/Blocks/PBR/refractionBlock.js.map +1 -1
  15. package/Materials/Node/Blocks/PBR/sheenBlock.js +2 -2
  16. package/Materials/Node/Blocks/PBR/sheenBlock.js.map +1 -1
  17. package/Materials/Node/Blocks/clampBlock.js +2 -2
  18. package/Materials/Node/Blocks/clampBlock.js.map +1 -1
  19. package/Materials/Node/Blocks/cloudBlock.js +1 -1
  20. package/Materials/Node/Blocks/cloudBlock.js.map +1 -1
  21. package/Materials/Node/Blocks/conditionalBlock.js +19 -0
  22. package/Materials/Node/Blocks/conditionalBlock.js.map +1 -1
  23. package/Materials/Node/Blocks/curveBlock.js +37 -0
  24. package/Materials/Node/Blocks/curveBlock.js.map +1 -1
  25. package/Materials/Node/Blocks/loopBlock.js +1 -1
  26. package/Materials/Node/Blocks/loopBlock.js.map +1 -1
  27. package/Materials/Node/Blocks/meshAttributeExistsBlock.js +1 -0
  28. package/Materials/Node/Blocks/meshAttributeExistsBlock.js.map +1 -1
  29. package/Materials/Node/Blocks/transformBlock.d.ts +6 -0
  30. package/Materials/Node/Blocks/transformBlock.js +16 -1
  31. package/Materials/Node/Blocks/transformBlock.js.map +1 -1
  32. package/Materials/Node/Blocks/triPlanarBlock.js +1 -1
  33. package/Materials/Node/Blocks/triPlanarBlock.js.map +1 -1
  34. package/Materials/Node/Blocks/trigonometryBlock.js +29 -0
  35. package/Materials/Node/Blocks/trigonometryBlock.js.map +1 -1
  36. package/Materials/Node/Blocks/waveBlock.js +13 -0
  37. package/Materials/Node/Blocks/waveBlock.js.map +1 -1
  38. package/Materials/Node/Blocks/worleyNoise3DBlock.js +1 -1
  39. package/Materials/Node/Blocks/worleyNoise3DBlock.js.map +1 -1
  40. package/Meshes/Node/Blocks/Instances/instantiateBaseBlock.js +1 -1
  41. package/Meshes/Node/Blocks/Instances/instantiateBaseBlock.js.map +1 -1
  42. package/Meshes/Node/Blocks/Set/aggregatorBlock.js +1 -0
  43. package/Meshes/Node/Blocks/Set/aggregatorBlock.js.map +1 -1
  44. package/Meshes/Node/Blocks/Set/latticeBlock.js +4 -4
  45. package/Meshes/Node/Blocks/Set/latticeBlock.js.map +1 -1
  46. package/Meshes/Node/Blocks/Set/setColorsBlock.js +1 -1
  47. package/Meshes/Node/Blocks/Set/setColorsBlock.js.map +1 -1
  48. package/Meshes/Node/Blocks/Set/setMaterialIDBlock.js +1 -1
  49. package/Meshes/Node/Blocks/Set/setMaterialIDBlock.js.map +1 -1
  50. package/Meshes/Node/Blocks/Set/setNormalsBlock.js +1 -1
  51. package/Meshes/Node/Blocks/Set/setNormalsBlock.js.map +1 -1
  52. package/Meshes/Node/Blocks/Set/setPositionsBlock.js +1 -1
  53. package/Meshes/Node/Blocks/Set/setPositionsBlock.js.map +1 -1
  54. package/Meshes/Node/Blocks/Set/setTangentsBlock.js +1 -1
  55. package/Meshes/Node/Blocks/Set/setTangentsBlock.js.map +1 -1
  56. package/Meshes/Node/Blocks/Set/setUVsBlock.js +2 -1
  57. package/Meshes/Node/Blocks/Set/setUVsBlock.js.map +1 -1
  58. package/Meshes/Node/Blocks/Sources/boxBlock.js +1 -1
  59. package/Meshes/Node/Blocks/Sources/boxBlock.js.map +1 -1
  60. package/Meshes/Node/Blocks/Sources/capsuleBlock.js +1 -1
  61. package/Meshes/Node/Blocks/Sources/capsuleBlock.js.map +1 -1
  62. package/Meshes/Node/Blocks/Sources/cylinderBlock.js +1 -1
  63. package/Meshes/Node/Blocks/Sources/cylinderBlock.js.map +1 -1
  64. package/Meshes/Node/Blocks/Sources/discBlock.js +1 -1
  65. package/Meshes/Node/Blocks/Sources/discBlock.js.map +1 -1
  66. package/Meshes/Node/Blocks/Sources/gridBlock.js +1 -1
  67. package/Meshes/Node/Blocks/Sources/gridBlock.js.map +1 -1
  68. package/Meshes/Node/Blocks/Sources/icoSphereBlock.js +1 -1
  69. package/Meshes/Node/Blocks/Sources/icoSphereBlock.js.map +1 -1
  70. package/Meshes/Node/Blocks/Sources/meshBlock.js +1 -1
  71. package/Meshes/Node/Blocks/Sources/meshBlock.js.map +1 -1
  72. package/Meshes/Node/Blocks/Sources/planeBlock.js +1 -1
  73. package/Meshes/Node/Blocks/Sources/planeBlock.js.map +1 -1
  74. package/Meshes/Node/Blocks/Sources/sphereBlock.js +1 -1
  75. package/Meshes/Node/Blocks/Sources/sphereBlock.js.map +1 -1
  76. package/Meshes/Node/Blocks/Sources/torusBlock.js +1 -1
  77. package/Meshes/Node/Blocks/Sources/torusBlock.js.map +1 -1
  78. package/Meshes/Node/Blocks/Textures/geometryTextureBlock.js +1 -1
  79. package/Meshes/Node/Blocks/Textures/geometryTextureBlock.js.map +1 -1
  80. package/Meshes/Node/Blocks/Textures/geometryTextureFetchBlock.js +1 -1
  81. package/Meshes/Node/Blocks/Textures/geometryTextureFetchBlock.js.map +1 -1
  82. package/Meshes/Node/Blocks/booleanGeometryBlock.d.ts +5 -0
  83. package/Meshes/Node/Blocks/booleanGeometryBlock.js +43 -13
  84. package/Meshes/Node/Blocks/booleanGeometryBlock.js.map +1 -1
  85. package/Meshes/Node/Blocks/cleanGeometryBlock.js +1 -1
  86. package/Meshes/Node/Blocks/cleanGeometryBlock.js.map +1 -1
  87. package/Meshes/Node/Blocks/conditionBlock.js +1 -0
  88. package/Meshes/Node/Blocks/conditionBlock.js.map +1 -1
  89. package/Meshes/Node/Blocks/geometryClampBlock.js +2 -2
  90. package/Meshes/Node/Blocks/geometryClampBlock.js.map +1 -1
  91. package/Meshes/Node/Blocks/geometryCollectionBlock.js +1 -1
  92. package/Meshes/Node/Blocks/geometryCollectionBlock.js.map +1 -1
  93. package/Meshes/Node/Blocks/geometryCurveBlock.js +1 -0
  94. package/Meshes/Node/Blocks/geometryCurveBlock.js.map +1 -1
  95. package/Meshes/Node/Blocks/geometryOptimizeBlock.js +3 -3
  96. package/Meshes/Node/Blocks/geometryOptimizeBlock.js.map +1 -1
  97. package/Meshes/Node/Blocks/geometryTransformBlock.js +1 -1
  98. package/Meshes/Node/Blocks/geometryTransformBlock.js.map +1 -1
  99. package/Meshes/Node/Blocks/geometryTrigonometryBlock.js +1 -0
  100. package/Meshes/Node/Blocks/geometryTrigonometryBlock.js.map +1 -1
  101. package/Meshes/Node/Blocks/mappingBlock.js +1 -0
  102. package/Meshes/Node/Blocks/mappingBlock.js.map +1 -1
  103. package/Meshes/Node/Blocks/mathBlock.js +1 -0
  104. package/Meshes/Node/Blocks/mathBlock.js.map +1 -1
  105. package/Meshes/Node/Blocks/mergeGeometryBlock.js +1 -1
  106. package/Meshes/Node/Blocks/mergeGeometryBlock.js.map +1 -1
  107. package/Meshes/Node/Blocks/randomBlock.js +1 -0
  108. package/Meshes/Node/Blocks/randomBlock.js.map +1 -1
  109. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"mappingBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Meshes/Node/Blocks/mappingBlock.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,iBAAiB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KAAK,CAAC;QAC7I,OAAO,UAAU,CAAC;IACtB,CAAC;IAED;;;OAGG;IACa,SAAS;QACrB,MAAM,mBAAmB,GAAG,KAAK,CAAC,SAAS,EAAE,CAAC;QAE9C,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;IAC/C,CAAC;CACJ;AA7IU;IARN,sBAAsB,CAAC,SAAS,uCAA+B,UAAU,EAAE;QACxE,SAAS,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;QAC5B,OAAO,EAAE;YACL,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,YAAY,CAAC,SAAS,EAAE;YACrD,EAAE,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,YAAY,CAAC,WAAW,EAAE;YACzD,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,YAAY,CAAC,KAAK,EAAE;SAChD;KACJ,CAAC;6CACsC;AA+I5C,aAAa,CAAC,sBAAsB,EAAE,YAAY,CAAC,CAAC","sourcesContent":["import { NodeGeometryBlock } from \"../nodeGeometryBlock\";\r\nimport type { NodeGeometryConnectionPoint } from \"../nodeGeometryBlockConnectionPoint\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\nimport { NodeGeometryBlockConnectionPointTypes } from \"../Enums/nodeGeometryConnectionPointTypes\";\r\nimport type { NodeGeometryBuildState } from \"../nodeGeometryBuildState\";\r\nimport { PropertyTypeForEdition, editableInPropertyPage } from \"../../../Decorators/nodeDecorator\";\r\nimport { Vector2, Vector3 } from \"../../../Maths/math.vector\";\r\n\r\n/**\r\n * Type of mappings supported by the mapping block\r\n */\r\nexport enum MappingTypes {\r\n /** Spherical */\r\n Spherical,\r\n /** Cylindrical */\r\n Cylindrical,\r\n /** Cubic */\r\n Cubic,\r\n}\r\n\r\n/**\r\n * Block used to generate UV coordinates\r\n */\r\nexport class MappingBlock extends NodeGeometryBlock {\r\n /**\r\n * Gets or sets the mapping type used by the block\r\n */\r\n @editableInPropertyPage(\"Mapping\", PropertyTypeForEdition.List, \"ADVANCED\", {\r\n notifiers: { rebuild: true },\r\n options: [\r\n { label: \"Spherical\", value: MappingTypes.Spherical },\r\n { label: \"Cylindrical\", value: MappingTypes.Cylindrical },\r\n { label: \"Cubic\", value: MappingTypes.Cubic },\r\n ],\r\n })\r\n public mapping = MappingTypes.Spherical;\r\n\r\n /**\r\n * Create a new MappingBlock\r\n * @param name defines the block name\r\n */\r\n public constructor(name: string) {\r\n super(name);\r\n\r\n this.registerInput(\"position\", NodeGeometryBlockConnectionPointTypes.Vector3);\r\n this.registerInput(\"normal\", NodeGeometryBlockConnectionPointTypes.Vector3);\r\n this.registerInput(\"center\", NodeGeometryBlockConnectionPointTypes.Vector3, true, Vector3.Zero());\r\n this.registerOutput(\"uv\", NodeGeometryBlockConnectionPointTypes.Vector2);\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public override getClassName() {\r\n return \"MappingBlock\";\r\n }\r\n\r\n /**\r\n * Gets the position input component\r\n */\r\n public get position(): NodeGeometryConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the normal input component\r\n */\r\n public get normal(): NodeGeometryConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the center input component\r\n */\r\n public get center(): NodeGeometryConnectionPoint {\r\n return this._inputs[2];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get uv(): NodeGeometryConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected override _buildBlock() {\r\n if (!this.position.isConnected) {\r\n this.uv._storedFunction = null;\r\n this.uv._storedValue = null;\r\n return;\r\n }\r\n const tempDirection = Vector3.Zero();\r\n\r\n const func = (state: NodeGeometryBuildState) => {\r\n const position = (this.position.getConnectedValue(state) as Vector3) || Vector3.Zero();\r\n const normal = (this.normal.getConnectedValue(state) as Vector3) || Vector3.Zero();\r\n const center = this.center.getConnectedValue(state) as Vector3;\r\n const uv = Vector2.Zero();\r\n\r\n switch (this.mapping) {\r\n case MappingTypes.Spherical: {\r\n position.subtractToRef(center, tempDirection);\r\n const len = tempDirection.length();\r\n if (len > 0) {\r\n uv.x = Math.acos(tempDirection.y / len) / Math.PI;\r\n if (tempDirection.x !== 0 || tempDirection.z !== 0) {\r\n uv.y = Math.atan2(tempDirection.x, tempDirection.z) / (Math.PI * 2);\r\n }\r\n }\r\n break;\r\n }\r\n case MappingTypes.Cylindrical: {\r\n position.subtractToRef(center, tempDirection);\r\n const len = tempDirection.length();\r\n if (len > 0) {\r\n uv.x = Math.atan2(tempDirection.x / len, tempDirection.z / len) / (Math.PI * 2);\r\n uv.y = (tempDirection.y + 1.0) / 2.0;\r\n }\r\n break;\r\n }\r\n case MappingTypes.Cubic: {\r\n // Find the largest component of the normal vector\r\n const absX = Math.abs(normal.x);\r\n const absY = Math.abs(normal.y);\r\n const absZ = Math.abs(normal.z);\r\n const maxDim = Math.max(Math.abs(position.x), Math.abs(position.y), Math.abs(position.z));\r\n\r\n let u = 0,\r\n v = 0;\r\n\r\n if (absX >= absY && absX >= absZ) {\r\n u = position.y / maxDim - center.y;\r\n v = position.z / maxDim - center.z;\r\n } else if (absY >= absX && absY >= absZ) {\r\n u = position.x / maxDim - center.x;\r\n v = position.z / maxDim - center.z;\r\n } else {\r\n u = position.x / maxDim - center.x;\r\n v = position.y / maxDim - center.y;\r\n }\r\n\r\n uv.x = (u + 1) / 2;\r\n uv.y = (v + 1) / 2;\r\n }\r\n }\r\n return uv;\r\n };\r\n\r\n this.uv._storedFunction = (state) => {\r\n return func(state);\r\n };\r\n }\r\n\r\n protected override _dumpPropertiesCode() {\r\n const codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.mapping = BABYLON.MappingTypes.${MappingTypes[this.mapping]};\\n`;\r\n return codeString;\r\n }\r\n\r\n /**\r\n * Serializes this block in a JSON representation\r\n * @returns the serialized block object\r\n */\r\n public override serialize(): any {\r\n const serializationObject = super.serialize();\r\n\r\n serializationObject.mapping = this.mapping;\r\n\r\n return serializationObject;\r\n }\r\n\r\n public override _deserialize(serializationObject: any) {\r\n super._deserialize(serializationObject);\r\n\r\n this.mapping = serializationObject.mapping;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.MappingBlock\", MappingBlock);\r\n"]}
1
+ {"version":3,"file":"mappingBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Meshes/Node/Blocks/mappingBlock.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,qCAAqC,EAAE,MAAM,2CAA2C,CAAC;AAElG,OAAO,EAA0B,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AACnG,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAE9D;;GAEG;AACH,MAAM,CAAN,IAAY,YAOX;AAPD,WAAY,YAAY;IACpB,gBAAgB;IAChB,yDAAS,CAAA;IACT,kBAAkB;IAClB,6DAAW,CAAA;IACX,YAAY;IACZ,iDAAK,CAAA;AACT,CAAC,EAPW,YAAY,KAAZ,YAAY,QAOvB;AAED;;GAEG;AACH,MAAM,OAAO,YAAa,SAAQ,iBAAiB;IAe/C;;;OAGG;IACH,YAAmB,IAAY;QAC3B,KAAK,CAAC,IAAI,CAAC,CAAC;QAnBhB;;WAEG;QAUI,YAAO,GAAG,YAAY,CAAC,SAAS,CAAC;QASpC,IAAI,CAAC,aAAa,CAAC,UAAU,EAAE,qCAAqC,CAAC,OAAO,CAAC,CAAC;QAC9E,IAAI,CAAC,aAAa,CAAC,QAAQ,EAAE,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KACJ,CAAC;6CACsC;AA+I5C,aAAa,CAAC,sBAAsB,EAAE,YAAY,CAAC,CAAC","sourcesContent":["import { NodeGeometryBlock } from \"../nodeGeometryBlock\";\r\nimport type { NodeGeometryConnectionPoint } from \"../nodeGeometryBlockConnectionPoint\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\nimport { NodeGeometryBlockConnectionPointTypes } from \"../Enums/nodeGeometryConnectionPointTypes\";\r\nimport type { NodeGeometryBuildState } from \"../nodeGeometryBuildState\";\r\nimport { PropertyTypeForEdition, editableInPropertyPage } from \"../../../Decorators/nodeDecorator\";\r\nimport { Vector2, Vector3 } from \"../../../Maths/math.vector\";\r\n\r\n/**\r\n * Type of mappings supported by the mapping block\r\n */\r\nexport enum MappingTypes {\r\n /** Spherical */\r\n Spherical,\r\n /** Cylindrical */\r\n Cylindrical,\r\n /** Cubic */\r\n Cubic,\r\n}\r\n\r\n/**\r\n * Block used to generate UV coordinates\r\n */\r\nexport class MappingBlock extends NodeGeometryBlock {\r\n /**\r\n * Gets or sets the mapping type used by the block\r\n */\r\n @editableInPropertyPage(\"Mapping\", PropertyTypeForEdition.List, \"ADVANCED\", {\r\n notifiers: { rebuild: true },\r\n embedded: true,\r\n options: [\r\n { label: \"Spherical\", value: MappingTypes.Spherical },\r\n { label: \"Cylindrical\", value: MappingTypes.Cylindrical },\r\n { label: \"Cubic\", value: MappingTypes.Cubic },\r\n ],\r\n })\r\n public mapping = MappingTypes.Spherical;\r\n\r\n /**\r\n * Create a new MappingBlock\r\n * @param name defines the block name\r\n */\r\n public constructor(name: string) {\r\n super(name);\r\n\r\n this.registerInput(\"position\", NodeGeometryBlockConnectionPointTypes.Vector3);\r\n this.registerInput(\"normal\", NodeGeometryBlockConnectionPointTypes.Vector3);\r\n this.registerInput(\"center\", NodeGeometryBlockConnectionPointTypes.Vector3, true, Vector3.Zero());\r\n this.registerOutput(\"uv\", NodeGeometryBlockConnectionPointTypes.Vector2);\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public override getClassName() {\r\n return \"MappingBlock\";\r\n }\r\n\r\n /**\r\n * Gets the position input component\r\n */\r\n public get position(): NodeGeometryConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the normal input component\r\n */\r\n public get normal(): NodeGeometryConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the center input component\r\n */\r\n public get center(): NodeGeometryConnectionPoint {\r\n return this._inputs[2];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get uv(): NodeGeometryConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected override _buildBlock() {\r\n if (!this.position.isConnected) {\r\n this.uv._storedFunction = null;\r\n this.uv._storedValue = null;\r\n return;\r\n }\r\n const tempDirection = Vector3.Zero();\r\n\r\n const func = (state: NodeGeometryBuildState) => {\r\n const position = (this.position.getConnectedValue(state) as Vector3) || Vector3.Zero();\r\n const normal = (this.normal.getConnectedValue(state) as Vector3) || Vector3.Zero();\r\n const center = this.center.getConnectedValue(state) as Vector3;\r\n const uv = Vector2.Zero();\r\n\r\n switch (this.mapping) {\r\n case MappingTypes.Spherical: {\r\n position.subtractToRef(center, tempDirection);\r\n const len = tempDirection.length();\r\n if (len > 0) {\r\n uv.x = Math.acos(tempDirection.y / len) / Math.PI;\r\n if (tempDirection.x !== 0 || tempDirection.z !== 0) {\r\n uv.y = Math.atan2(tempDirection.x, tempDirection.z) / (Math.PI * 2);\r\n }\r\n }\r\n break;\r\n }\r\n case MappingTypes.Cylindrical: {\r\n position.subtractToRef(center, tempDirection);\r\n const len = tempDirection.length();\r\n if (len > 0) {\r\n uv.x = Math.atan2(tempDirection.x / len, tempDirection.z / len) / (Math.PI * 2);\r\n uv.y = (tempDirection.y + 1.0) / 2.0;\r\n }\r\n break;\r\n }\r\n case MappingTypes.Cubic: {\r\n // Find the largest component of the normal vector\r\n const absX = Math.abs(normal.x);\r\n const absY = Math.abs(normal.y);\r\n const absZ = Math.abs(normal.z);\r\n const maxDim = Math.max(Math.abs(position.x), Math.abs(position.y), Math.abs(position.z));\r\n\r\n let u = 0,\r\n v = 0;\r\n\r\n if (absX >= absY && absX >= absZ) {\r\n u = position.y / maxDim - center.y;\r\n v = position.z / maxDim - center.z;\r\n } else if (absY >= absX && absY >= absZ) {\r\n u = position.x / maxDim - center.x;\r\n v = position.z / maxDim - center.z;\r\n } else {\r\n u = position.x / maxDim - center.x;\r\n v = position.y / maxDim - center.y;\r\n }\r\n\r\n uv.x = (u + 1) / 2;\r\n uv.y = (v + 1) / 2;\r\n }\r\n }\r\n return uv;\r\n };\r\n\r\n this.uv._storedFunction = (state) => {\r\n return func(state);\r\n };\r\n }\r\n\r\n protected override _dumpPropertiesCode() {\r\n const codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.mapping = BABYLON.MappingTypes.${MappingTypes[this.mapping]};\\n`;\r\n return codeString;\r\n }\r\n\r\n /**\r\n * Serializes this block in a JSON representation\r\n * @returns the serialized block object\r\n */\r\n public override serialize(): any {\r\n const serializationObject = super.serialize();\r\n\r\n serializationObject.mapping = this.mapping;\r\n\r\n return serializationObject;\r\n }\r\n\r\n public override _deserialize(serializationObject: any) {\r\n super._deserialize(serializationObject);\r\n\r\n this.mapping = serializationObject.mapping;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.MappingBlock\", MappingBlock);\r\n"]}
@@ -298,6 +298,7 @@ export class MathBlock extends NodeGeometryBlock {
298
298
  __decorate([
299
299
  editableInPropertyPage("Operation", 4 /* PropertyTypeForEdition.List */, "ADVANCED", {
300
300
  notifiers: { rebuild: true },
301
+ embedded: true,
301
302
  options: [
302
303
  { label: "Add", value: MathBlockOperations.Add },
303
304
  { label: "Subtract", value: MathBlockOperations.Subtract },
@@ -1 +1 @@
1
- {"version":3,"file":"mathBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Meshes/Node/Blocks/mathBlock.ts"],"names":[],"mappings":";AAAA,OA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,CAAC,WAAW,uCAA+B,UAAU,EAAE;QAC1E,SAAS,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;QAC5B,OAAO,EAAE;YACL,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,mBAAmB,CAAC,GAAG,EAAE;YAChD,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,mBAAmB,CAAC,QAAQ,EAAE;YAC1D,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,mBAAmB,CAAC,QAAQ,EAAE;YAC1D,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,mBAAmB,CAAC,MAAM,EAAE;YACtD,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,mBAAmB,CAAC,GAAG,EAAE;YAChD,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,mBAAmB,CAAC,GAAG,EAAE;SACnD;KACJ,CAAC;4CACyC;AAwS/C,aAAa,CAAC,mBAAmB,EAAE,SAAS,CAAC,CAAC","sourcesContent":["import { NodeGeometryBlock } from \"../nodeGeometryBlock\";\r\nimport type { NodeGeometryConnectionPoint } from \"../nodeGeometryBlockConnectionPoint\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\nimport { NodeGeometryBlockConnectionPointTypes } from \"../Enums/nodeGeometryConnectionPointTypes\";\r\nimport type { NodeGeometryBuildState } from \"../nodeGeometryBuildState\";\r\nimport { Vector2, Vector3, Vector4 } from \"core/Maths/math.vector\";\r\nimport { PropertyTypeForEdition, editableInPropertyPage } from \"../../../Decorators/nodeDecorator\";\r\nimport type { Observer } from \"core/Misc/observable\";\r\n\r\n/**\r\n * Operations supported by the Math block\r\n */\r\nexport enum MathBlockOperations {\r\n /** Add */\r\n Add,\r\n /** Subtract */\r\n Subtract,\r\n /** Multiply */\r\n Multiply,\r\n /** Divide */\r\n Divide,\r\n /** Max */\r\n Max,\r\n /** Min */\r\n Min,\r\n}\r\n\r\n/**\r\n * Block used to apply math functions\r\n */\r\nexport class MathBlock extends NodeGeometryBlock {\r\n /**\r\n * Gets or sets the operation applied by the block\r\n */\r\n @editableInPropertyPage(\"Operation\", PropertyTypeForEdition.List, \"ADVANCED\", {\r\n notifiers: { rebuild: true },\r\n options: [\r\n { label: \"Add\", value: MathBlockOperations.Add },\r\n { label: \"Subtract\", value: MathBlockOperations.Subtract },\r\n { label: \"Multiply\", value: MathBlockOperations.Multiply },\r\n { label: \"Divide\", value: MathBlockOperations.Divide },\r\n { label: \"Max\", value: MathBlockOperations.Max },\r\n { label: \"Min\", value: MathBlockOperations.Min },\r\n ],\r\n })\r\n public operation = MathBlockOperations.Add;\r\n\r\n private readonly _connectionObservers: Observer<NodeGeometryConnectionPoint>[];\r\n\r\n /**\r\n * Create a new MathBlock\r\n * @param name defines the block name\r\n */\r\n public constructor(name: string) {\r\n super(name);\r\n\r\n this.registerInput(\"left\", NodeGeometryBlockConnectionPointTypes.AutoDetect);\r\n this.registerInput(\"right\", NodeGeometryBlockConnectionPointTypes.AutoDetect);\r\n\r\n this.registerOutput(\"output\", NodeGeometryBlockConnectionPointTypes.BasedOnInput);\r\n\r\n this.output._typeConnectionSource = this.left;\r\n\r\n const excludedConnectionPointTypes = [\r\n NodeGeometryBlockConnectionPointTypes.Matrix,\r\n NodeGeometryBlockConnectionPointTypes.Geometry,\r\n NodeGeometryBlockConnectionPointTypes.Texture,\r\n ] as const;\r\n\r\n this.left.excludedConnectionPointTypes.push(...excludedConnectionPointTypes);\r\n this.right.excludedConnectionPointTypes.push(...excludedConnectionPointTypes);\r\n\r\n this._linkConnectionTypes(0, 1);\r\n\r\n this._connectionObservers = [\r\n this.left.onConnectionObservable.add(() => this._updateInputOutputTypes()),\r\n this.left.onDisconnectionObservable.add(() => this._updateInputOutputTypes()),\r\n this.right.onConnectionObservable.add(() => this._updateInputOutputTypes()),\r\n this.right.onDisconnectionObservable.add(() => this._updateInputOutputTypes()),\r\n ];\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 \"MathBlock\";\r\n }\r\n\r\n /**\r\n * Gets the left input component\r\n */\r\n public get left(): NodeGeometryConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the right input component\r\n */\r\n public get right(): NodeGeometryConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the 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() {\r\n let func: (state: NodeGeometryBuildState) => any;\r\n const left = this.left;\r\n const right = this.right;\r\n\r\n if (!left.isConnected || !right.isConnected) {\r\n this.output._storedFunction = null;\r\n this.output._storedValue = null;\r\n return;\r\n }\r\n\r\n const leftIsScalar = left.type === NodeGeometryBlockConnectionPointTypes.Float || left.type === NodeGeometryBlockConnectionPointTypes.Int;\r\n const rightIsScalar = right.type === NodeGeometryBlockConnectionPointTypes.Float || right.type === NodeGeometryBlockConnectionPointTypes.Int;\r\n\r\n // If both input types are scalars, then this is a scalar operation.\r\n const isScalar = leftIsScalar && rightIsScalar;\r\n\r\n switch (this.operation) {\r\n case MathBlockOperations.Add: {\r\n if (isScalar) {\r\n func = (state) => {\r\n return left.getConnectedValue(state) + right.getConnectedValue(state);\r\n };\r\n } else if (leftIsScalar) {\r\n func = (state) => {\r\n return state.adapt(left, right.type).add(right.getConnectedValue(state));\r\n };\r\n } else {\r\n func = (state) => {\r\n return left.getConnectedValue(state).add(state.adapt(right, left.type));\r\n };\r\n }\r\n break;\r\n }\r\n case MathBlockOperations.Subtract: {\r\n if (isScalar) {\r\n func = (state) => {\r\n return left.getConnectedValue(state) - right.getConnectedValue(state);\r\n };\r\n } else if (leftIsScalar) {\r\n func = (state) => {\r\n return state.adapt(left, right.type).subtract(right.getConnectedValue(state));\r\n };\r\n } else {\r\n func = (state) => {\r\n return left.getConnectedValue(state).subtract(state.adapt(right, left.type));\r\n };\r\n }\r\n break;\r\n }\r\n case MathBlockOperations.Multiply: {\r\n if (isScalar) {\r\n func = (state) => {\r\n return left.getConnectedValue(state) * right.getConnectedValue(state);\r\n };\r\n } else if (leftIsScalar) {\r\n func = (state) => {\r\n return state.adapt(left, right.type).multiply(right.getConnectedValue(state));\r\n };\r\n } else {\r\n func = (state) => {\r\n return left.getConnectedValue(state).multiply(state.adapt(right, left.type));\r\n };\r\n }\r\n break;\r\n }\r\n case MathBlockOperations.Divide: {\r\n if (isScalar) {\r\n func = (state) => {\r\n return left.getConnectedValue(state) / right.getConnectedValue(state);\r\n };\r\n } else if (leftIsScalar) {\r\n func = (state) => {\r\n return state.adapt(left, right.type).divide(right.getConnectedValue(state));\r\n };\r\n } else {\r\n func = (state) => {\r\n return left.getConnectedValue(state).divide(state.adapt(right, left.type));\r\n };\r\n }\r\n break;\r\n }\r\n case MathBlockOperations.Min: {\r\n if (isScalar) {\r\n func = (state) => {\r\n return Math.min(left.getConnectedValue(state), right.getConnectedValue(state));\r\n };\r\n } else {\r\n const [vector, scalar] = leftIsScalar ? [right, left] : [left, right];\r\n\r\n switch (vector.type) {\r\n case NodeGeometryBlockConnectionPointTypes.Vector2: {\r\n func = (state) => {\r\n return Vector2.Minimize(vector.getConnectedValue(state), state.adapt(scalar, vector.type));\r\n };\r\n break;\r\n }\r\n case NodeGeometryBlockConnectionPointTypes.Vector3: {\r\n func = (state) => {\r\n return Vector3.Minimize(vector.getConnectedValue(state), state.adapt(scalar, vector.type));\r\n };\r\n break;\r\n }\r\n case NodeGeometryBlockConnectionPointTypes.Vector4: {\r\n func = (state) => {\r\n return Vector4.Minimize(vector.getConnectedValue(state), state.adapt(scalar, vector.type));\r\n };\r\n break;\r\n }\r\n }\r\n }\r\n break;\r\n }\r\n case MathBlockOperations.Max: {\r\n if (isScalar) {\r\n func = (state) => {\r\n return Math.max(left.getConnectedValue(state), right.getConnectedValue(state));\r\n };\r\n } else {\r\n const [vector, scalar] = leftIsScalar ? [right, left] : [left, right];\r\n\r\n switch (vector.type) {\r\n case NodeGeometryBlockConnectionPointTypes.Vector2: {\r\n func = (state) => {\r\n return Vector2.Maximize(vector.getConnectedValue(state), state.adapt(scalar, vector.type));\r\n };\r\n break;\r\n }\r\n case NodeGeometryBlockConnectionPointTypes.Vector3: {\r\n func = (state) => {\r\n return Vector3.Maximize(vector.getConnectedValue(state), state.adapt(scalar, vector.type));\r\n };\r\n break;\r\n }\r\n case NodeGeometryBlockConnectionPointTypes.Vector4: {\r\n func = (state) => {\r\n return Vector4.Maximize(vector.getConnectedValue(state), state.adapt(scalar, vector.type));\r\n };\r\n break;\r\n }\r\n }\r\n break;\r\n }\r\n }\r\n }\r\n\r\n this.output._storedFunction = (state) => {\r\n if (left.type === NodeGeometryBlockConnectionPointTypes.Int) {\r\n return func(state) | 0;\r\n }\r\n return func(state);\r\n };\r\n }\r\n\r\n protected override _dumpPropertiesCode() {\r\n const codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.operation = BABYLON.MathBlockOperations.${MathBlockOperations[this.operation]};\\n`;\r\n return codeString;\r\n }\r\n\r\n private _updateInputOutputTypes() {\r\n // First update the output type with the initial assumption that we'll base it on the left input.\r\n this.output._typeConnectionSource = this.left;\r\n\r\n if (this.left.isConnected && this.right.isConnected) {\r\n // Both inputs are connected, so we need to determine the output type based on the input types.\r\n if (\r\n this.left.type === NodeGeometryBlockConnectionPointTypes.Int ||\r\n (this.left.type === NodeGeometryBlockConnectionPointTypes.Float && this.right.type !== NodeGeometryBlockConnectionPointTypes.Int)\r\n ) {\r\n this.output._typeConnectionSource = this.right;\r\n }\r\n } else if (this.left.isConnected !== this.right.isConnected) {\r\n // Only one input is connected, so we need to determine the output type based on the connected input.\r\n this.output._typeConnectionSource = this.left.isConnected ? this.left : this.right;\r\n }\r\n\r\n // Next update the accepted connection point types for the inputs based on the current input connection state.\r\n if (this.left.isConnected || this.right.isConnected) {\r\n for (const [first, second] of [\r\n [this.left, this.right],\r\n [this.right, this.left],\r\n ]) {\r\n // Always allow Ints and Floats.\r\n first.acceptedConnectionPointTypes = [NodeGeometryBlockConnectionPointTypes.Int, NodeGeometryBlockConnectionPointTypes.Float];\r\n\r\n if (second.isConnected) {\r\n // The same types as the connected input are always allowed.\r\n first.acceptedConnectionPointTypes.push(second.type);\r\n\r\n // If the other input is a scalar, then we also allow Vector types.\r\n if (second.type === NodeGeometryBlockConnectionPointTypes.Int || second.type === NodeGeometryBlockConnectionPointTypes.Float) {\r\n first.acceptedConnectionPointTypes.push(\r\n NodeGeometryBlockConnectionPointTypes.Vector2,\r\n NodeGeometryBlockConnectionPointTypes.Vector3,\r\n NodeGeometryBlockConnectionPointTypes.Vector4\r\n );\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Release resources\r\n */\r\n public override dispose() {\r\n super.dispose();\r\n this._connectionObservers.forEach((observer) => observer.remove());\r\n this._connectionObservers.length = 0;\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.operation = this.operation;\r\n\r\n return serializationObject;\r\n }\r\n\r\n public override _deserialize(serializationObject: any) {\r\n super._deserialize(serializationObject);\r\n\r\n this.operation = serializationObject.operation;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.MathBlock\", MathBlock);\r\n"]}
1
+ {"version":3,"file":"mathBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Meshes/Node/Blocks/mathBlock.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,qCAAqC,EAAE,MAAM,2CAA2C,CAAC;AAElG,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,sCAA+B;AACnE,OAAO,EAA0B,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAGnG;;GAEG;AACH,MAAM,CAAN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AAE,UAAU,EAAE,KAAK,EAAE,mBAAmB,CAAC,QAAQ,EAAE;YAC1D,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,mBAAmB,CAAC,MAAM,EAAE;YACtD,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,mBAAmB,CAAC,GAAG,EAAE;YAChD,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,mBAAmB,CAAC,GAAG,EAAE;SACnD;KACJ,CAAC;4CACyC;AAwS/C,aAAa,CAAC,mBAAmB,EAAE,SAAS,CAAC,CAAC","sourcesContent":["import { NodeGeometryBlock } from \"../nodeGeometryBlock\";\r\nimport type { NodeGeometryConnectionPoint } from \"../nodeGeometryBlockConnectionPoint\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\nimport { NodeGeometryBlockConnectionPointTypes } from \"../Enums/nodeGeometryConnectionPointTypes\";\r\nimport type { NodeGeometryBuildState } from \"../nodeGeometryBuildState\";\r\nimport { Vector2, Vector3, Vector4 } from \"core/Maths/math.vector\";\r\nimport { PropertyTypeForEdition, editableInPropertyPage } from \"../../../Decorators/nodeDecorator\";\r\nimport type { Observer } from \"core/Misc/observable\";\r\n\r\n/**\r\n * Operations supported by the Math block\r\n */\r\nexport enum MathBlockOperations {\r\n /** Add */\r\n Add,\r\n /** Subtract */\r\n Subtract,\r\n /** Multiply */\r\n Multiply,\r\n /** Divide */\r\n Divide,\r\n /** Max */\r\n Max,\r\n /** Min */\r\n Min,\r\n}\r\n\r\n/**\r\n * Block used to apply math functions\r\n */\r\nexport class MathBlock extends NodeGeometryBlock {\r\n /**\r\n * Gets or sets the operation applied by the block\r\n */\r\n @editableInPropertyPage(\"Operation\", PropertyTypeForEdition.List, \"ADVANCED\", {\r\n notifiers: { rebuild: true },\r\n embedded: true,\r\n options: [\r\n { label: \"Add\", value: MathBlockOperations.Add },\r\n { label: \"Subtract\", value: MathBlockOperations.Subtract },\r\n { label: \"Multiply\", value: MathBlockOperations.Multiply },\r\n { label: \"Divide\", value: MathBlockOperations.Divide },\r\n { label: \"Max\", value: MathBlockOperations.Max },\r\n { label: \"Min\", value: MathBlockOperations.Min },\r\n ],\r\n })\r\n public operation = MathBlockOperations.Add;\r\n\r\n private readonly _connectionObservers: Observer<NodeGeometryConnectionPoint>[];\r\n\r\n /**\r\n * Create a new MathBlock\r\n * @param name defines the block name\r\n */\r\n public constructor(name: string) {\r\n super(name);\r\n\r\n this.registerInput(\"left\", NodeGeometryBlockConnectionPointTypes.AutoDetect);\r\n this.registerInput(\"right\", NodeGeometryBlockConnectionPointTypes.AutoDetect);\r\n\r\n this.registerOutput(\"output\", NodeGeometryBlockConnectionPointTypes.BasedOnInput);\r\n\r\n this.output._typeConnectionSource = this.left;\r\n\r\n const excludedConnectionPointTypes = [\r\n NodeGeometryBlockConnectionPointTypes.Matrix,\r\n NodeGeometryBlockConnectionPointTypes.Geometry,\r\n NodeGeometryBlockConnectionPointTypes.Texture,\r\n ] as const;\r\n\r\n this.left.excludedConnectionPointTypes.push(...excludedConnectionPointTypes);\r\n this.right.excludedConnectionPointTypes.push(...excludedConnectionPointTypes);\r\n\r\n this._linkConnectionTypes(0, 1);\r\n\r\n this._connectionObservers = [\r\n this.left.onConnectionObservable.add(() => this._updateInputOutputTypes()),\r\n this.left.onDisconnectionObservable.add(() => this._updateInputOutputTypes()),\r\n this.right.onConnectionObservable.add(() => this._updateInputOutputTypes()),\r\n this.right.onDisconnectionObservable.add(() => this._updateInputOutputTypes()),\r\n ];\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 \"MathBlock\";\r\n }\r\n\r\n /**\r\n * Gets the left input component\r\n */\r\n public get left(): NodeGeometryConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the right input component\r\n */\r\n public get right(): NodeGeometryConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the 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() {\r\n let func: (state: NodeGeometryBuildState) => any;\r\n const left = this.left;\r\n const right = this.right;\r\n\r\n if (!left.isConnected || !right.isConnected) {\r\n this.output._storedFunction = null;\r\n this.output._storedValue = null;\r\n return;\r\n }\r\n\r\n const leftIsScalar = left.type === NodeGeometryBlockConnectionPointTypes.Float || left.type === NodeGeometryBlockConnectionPointTypes.Int;\r\n const rightIsScalar = right.type === NodeGeometryBlockConnectionPointTypes.Float || right.type === NodeGeometryBlockConnectionPointTypes.Int;\r\n\r\n // If both input types are scalars, then this is a scalar operation.\r\n const isScalar = leftIsScalar && rightIsScalar;\r\n\r\n switch (this.operation) {\r\n case MathBlockOperations.Add: {\r\n if (isScalar) {\r\n func = (state) => {\r\n return left.getConnectedValue(state) + right.getConnectedValue(state);\r\n };\r\n } else if (leftIsScalar) {\r\n func = (state) => {\r\n return state.adapt(left, right.type).add(right.getConnectedValue(state));\r\n };\r\n } else {\r\n func = (state) => {\r\n return left.getConnectedValue(state).add(state.adapt(right, left.type));\r\n };\r\n }\r\n break;\r\n }\r\n case MathBlockOperations.Subtract: {\r\n if (isScalar) {\r\n func = (state) => {\r\n return left.getConnectedValue(state) - right.getConnectedValue(state);\r\n };\r\n } else if (leftIsScalar) {\r\n func = (state) => {\r\n return state.adapt(left, right.type).subtract(right.getConnectedValue(state));\r\n };\r\n } else {\r\n func = (state) => {\r\n return left.getConnectedValue(state).subtract(state.adapt(right, left.type));\r\n };\r\n }\r\n break;\r\n }\r\n case MathBlockOperations.Multiply: {\r\n if (isScalar) {\r\n func = (state) => {\r\n return left.getConnectedValue(state) * right.getConnectedValue(state);\r\n };\r\n } else if (leftIsScalar) {\r\n func = (state) => {\r\n return state.adapt(left, right.type).multiply(right.getConnectedValue(state));\r\n };\r\n } else {\r\n func = (state) => {\r\n return left.getConnectedValue(state).multiply(state.adapt(right, left.type));\r\n };\r\n }\r\n break;\r\n }\r\n case MathBlockOperations.Divide: {\r\n if (isScalar) {\r\n func = (state) => {\r\n return left.getConnectedValue(state) / right.getConnectedValue(state);\r\n };\r\n } else if (leftIsScalar) {\r\n func = (state) => {\r\n return state.adapt(left, right.type).divide(right.getConnectedValue(state));\r\n };\r\n } else {\r\n func = (state) => {\r\n return left.getConnectedValue(state).divide(state.adapt(right, left.type));\r\n };\r\n }\r\n break;\r\n }\r\n case MathBlockOperations.Min: {\r\n if (isScalar) {\r\n func = (state) => {\r\n return Math.min(left.getConnectedValue(state), right.getConnectedValue(state));\r\n };\r\n } else {\r\n const [vector, scalar] = leftIsScalar ? [right, left] : [left, right];\r\n\r\n switch (vector.type) {\r\n case NodeGeometryBlockConnectionPointTypes.Vector2: {\r\n func = (state) => {\r\n return Vector2.Minimize(vector.getConnectedValue(state), state.adapt(scalar, vector.type));\r\n };\r\n break;\r\n }\r\n case NodeGeometryBlockConnectionPointTypes.Vector3: {\r\n func = (state) => {\r\n return Vector3.Minimize(vector.getConnectedValue(state), state.adapt(scalar, vector.type));\r\n };\r\n break;\r\n }\r\n case NodeGeometryBlockConnectionPointTypes.Vector4: {\r\n func = (state) => {\r\n return Vector4.Minimize(vector.getConnectedValue(state), state.adapt(scalar, vector.type));\r\n };\r\n break;\r\n }\r\n }\r\n }\r\n break;\r\n }\r\n case MathBlockOperations.Max: {\r\n if (isScalar) {\r\n func = (state) => {\r\n return Math.max(left.getConnectedValue(state), right.getConnectedValue(state));\r\n };\r\n } else {\r\n const [vector, scalar] = leftIsScalar ? [right, left] : [left, right];\r\n\r\n switch (vector.type) {\r\n case NodeGeometryBlockConnectionPointTypes.Vector2: {\r\n func = (state) => {\r\n return Vector2.Maximize(vector.getConnectedValue(state), state.adapt(scalar, vector.type));\r\n };\r\n break;\r\n }\r\n case NodeGeometryBlockConnectionPointTypes.Vector3: {\r\n func = (state) => {\r\n return Vector3.Maximize(vector.getConnectedValue(state), state.adapt(scalar, vector.type));\r\n };\r\n break;\r\n }\r\n case NodeGeometryBlockConnectionPointTypes.Vector4: {\r\n func = (state) => {\r\n return Vector4.Maximize(vector.getConnectedValue(state), state.adapt(scalar, vector.type));\r\n };\r\n break;\r\n }\r\n }\r\n break;\r\n }\r\n }\r\n }\r\n\r\n this.output._storedFunction = (state) => {\r\n if (left.type === NodeGeometryBlockConnectionPointTypes.Int) {\r\n return func(state) | 0;\r\n }\r\n return func(state);\r\n };\r\n }\r\n\r\n protected override _dumpPropertiesCode() {\r\n const codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.operation = BABYLON.MathBlockOperations.${MathBlockOperations[this.operation]};\\n`;\r\n return codeString;\r\n }\r\n\r\n private _updateInputOutputTypes() {\r\n // First update the output type with the initial assumption that we'll base it on the left input.\r\n this.output._typeConnectionSource = this.left;\r\n\r\n if (this.left.isConnected && this.right.isConnected) {\r\n // Both inputs are connected, so we need to determine the output type based on the input types.\r\n if (\r\n this.left.type === NodeGeometryBlockConnectionPointTypes.Int ||\r\n (this.left.type === NodeGeometryBlockConnectionPointTypes.Float && this.right.type !== NodeGeometryBlockConnectionPointTypes.Int)\r\n ) {\r\n this.output._typeConnectionSource = this.right;\r\n }\r\n } else if (this.left.isConnected !== this.right.isConnected) {\r\n // Only one input is connected, so we need to determine the output type based on the connected input.\r\n this.output._typeConnectionSource = this.left.isConnected ? this.left : this.right;\r\n }\r\n\r\n // Next update the accepted connection point types for the inputs based on the current input connection state.\r\n if (this.left.isConnected || this.right.isConnected) {\r\n for (const [first, second] of [\r\n [this.left, this.right],\r\n [this.right, this.left],\r\n ]) {\r\n // Always allow Ints and Floats.\r\n first.acceptedConnectionPointTypes = [NodeGeometryBlockConnectionPointTypes.Int, NodeGeometryBlockConnectionPointTypes.Float];\r\n\r\n if (second.isConnected) {\r\n // The same types as the connected input are always allowed.\r\n first.acceptedConnectionPointTypes.push(second.type);\r\n\r\n // If the other input is a scalar, then we also allow Vector types.\r\n if (second.type === NodeGeometryBlockConnectionPointTypes.Int || second.type === NodeGeometryBlockConnectionPointTypes.Float) {\r\n first.acceptedConnectionPointTypes.push(\r\n NodeGeometryBlockConnectionPointTypes.Vector2,\r\n NodeGeometryBlockConnectionPointTypes.Vector3,\r\n NodeGeometryBlockConnectionPointTypes.Vector4\r\n );\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Release resources\r\n */\r\n public override dispose() {\r\n super.dispose();\r\n this._connectionObservers.forEach((observer) => observer.remove());\r\n this._connectionObservers.length = 0;\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.operation = this.operation;\r\n\r\n return serializationObject;\r\n }\r\n\r\n public override _deserialize(serializationObject: any) {\r\n super._deserialize(serializationObject);\r\n\r\n this.operation = serializationObject.operation;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.MathBlock\", MathBlock);\r\n"]}
@@ -138,7 +138,7 @@ export class MergeGeometryBlock extends NodeGeometryBlock {
138
138
  }
139
139
  }
140
140
  __decorate([
141
- editableInPropertyPage("Evaluate context", 0 /* PropertyTypeForEdition.Boolean */, "ADVANCED", { notifiers: { rebuild: true } })
141
+ editableInPropertyPage("Evaluate context", 0 /* PropertyTypeForEdition.Boolean */, "ADVANCED", { embedded: true, notifiers: { rebuild: true } })
142
142
  ], MergeGeometryBlock.prototype, "evaluateContext", void 0);
143
143
  RegisterClass("BABYLON.MergeGeometryBlock", MergeGeometryBlock);
144
144
  //# sourceMappingURL=mergeGeometryBlock.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"mergeGeometryBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Meshes/Node/Blocks/mergeGeometryBlock.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;AA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,CAAC;IAEe,YAAY,CAAC,mBAAwB;QACjD,KAAK,CAAC,YAAY,CAAC,mBAAmB,CAAC,CAAC;QAExC,IAAI,CAAC,eAAe,GAAG,mBAAmB,CAAC,eAAe,CAAC;IAC/D,CAAC;CACJ;AAlJU;IADN,sBAAsB,CAAC,kBAAkB,0CAAkC,UAAU,EAAE,EAAE,SAAS,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,CAAC;2DAC1F;AAoJnC,aAAa,CAAC,4BAA4B,EAAE,kBAAkB,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 \"../../../Meshes/mesh.vertexData\";\r\nimport type { NodeGeometryBuildState } from \"../nodeGeometryBuildState\";\r\nimport { PropertyTypeForEdition, editableInPropertyPage } from \"../../../Decorators/nodeDecorator\";\r\n\r\n/**\r\n * Block used to merge several geometries\r\n */\r\nexport class MergeGeometryBlock 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 * Create a new MergeGeometryBlock\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, true);\r\n this.registerInput(\"geometry2\", NodeGeometryBlockConnectionPointTypes.Geometry, true);\r\n this.registerInput(\"geometry3\", NodeGeometryBlockConnectionPointTypes.Geometry, true);\r\n this.registerInput(\"geometry4\", NodeGeometryBlockConnectionPointTypes.Geometry, true);\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 \"MergeGeometryBlock\";\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 geometry2 input component\r\n */\r\n public get geometry2(): NodeGeometryConnectionPoint {\r\n return this._inputs[2];\r\n }\r\n\r\n /**\r\n * Gets the geometry3 input component\r\n */\r\n public get geometry3(): NodeGeometryConnectionPoint {\r\n return this._inputs[3];\r\n }\r\n\r\n /**\r\n * Gets the geometry4 input component\r\n */\r\n public get geometry4(): NodeGeometryConnectionPoint {\r\n return this._inputs[4];\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 vertexDataSource: VertexData[] = [];\r\n\r\n if (this.geometry0.isConnected) {\r\n const data = this.geometry0.getConnectedValue(state);\r\n if (data) {\r\n vertexDataSource.push(data);\r\n }\r\n }\r\n if (this.geometry1.isConnected) {\r\n const data = this.geometry1.getConnectedValue(state);\r\n if (data) {\r\n vertexDataSource.push(data);\r\n }\r\n }\r\n if (this.geometry2.isConnected) {\r\n const data = this.geometry2.getConnectedValue(state);\r\n if (data) {\r\n vertexDataSource.push(data);\r\n }\r\n }\r\n if (this.geometry3.isConnected) {\r\n const data = this.geometry3.getConnectedValue(state);\r\n if (data) {\r\n vertexDataSource.push(data);\r\n }\r\n }\r\n if (this.geometry4.isConnected) {\r\n const data = this.geometry4.getConnectedValue(state);\r\n if (data) {\r\n vertexDataSource.push(data);\r\n }\r\n }\r\n\r\n if (vertexDataSource.length === 0) {\r\n return null;\r\n }\r\n\r\n let vertexData = vertexDataSource[0].clone(); // Preserve source data\r\n const additionalVertexData: VertexData[] = vertexDataSource.slice(1);\r\n\r\n if (additionalVertexData.length && vertexData) {\r\n vertexData = vertexData.merge(additionalVertexData, true, false, true, true);\r\n }\r\n return vertexData;\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 this.evaluateContext = serializationObject.evaluateContext;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.MergeGeometryBlock\", MergeGeometryBlock);\r\n"]}
1
+ {"version":3,"file":"mergeGeometryBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Meshes/Node/Blocks/mergeGeometryBlock.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;AAEnG;;GAEG;AACH,MAAM,OAAO,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QAExC,IAAI,CAAC,eAAe,GAAG,mBAAmB,CAAC,eAAe,CAAC;IAC/D,CAAC;CACJ;AAlJU;IADN,sBAAsB,CAAC,kBAAkB,0CAAkC,UAAU,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,CAAC;2DAC1G;AAoJnC,aAAa,CAAC,4BAA4B,EAAE,kBAAkB,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 \"../../../Meshes/mesh.vertexData\";\r\nimport type { NodeGeometryBuildState } from \"../nodeGeometryBuildState\";\r\nimport { PropertyTypeForEdition, editableInPropertyPage } from \"../../../Decorators/nodeDecorator\";\r\n\r\n/**\r\n * Block used to merge several geometries\r\n */\r\nexport class MergeGeometryBlock 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\", { embedded: true, notifiers: { rebuild: true } })\r\n public evaluateContext = false;\r\n\r\n /**\r\n * Create a new MergeGeometryBlock\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, true);\r\n this.registerInput(\"geometry2\", NodeGeometryBlockConnectionPointTypes.Geometry, true);\r\n this.registerInput(\"geometry3\", NodeGeometryBlockConnectionPointTypes.Geometry, true);\r\n this.registerInput(\"geometry4\", NodeGeometryBlockConnectionPointTypes.Geometry, true);\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 \"MergeGeometryBlock\";\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 geometry2 input component\r\n */\r\n public get geometry2(): NodeGeometryConnectionPoint {\r\n return this._inputs[2];\r\n }\r\n\r\n /**\r\n * Gets the geometry3 input component\r\n */\r\n public get geometry3(): NodeGeometryConnectionPoint {\r\n return this._inputs[3];\r\n }\r\n\r\n /**\r\n * Gets the geometry4 input component\r\n */\r\n public get geometry4(): NodeGeometryConnectionPoint {\r\n return this._inputs[4];\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 vertexDataSource: VertexData[] = [];\r\n\r\n if (this.geometry0.isConnected) {\r\n const data = this.geometry0.getConnectedValue(state);\r\n if (data) {\r\n vertexDataSource.push(data);\r\n }\r\n }\r\n if (this.geometry1.isConnected) {\r\n const data = this.geometry1.getConnectedValue(state);\r\n if (data) {\r\n vertexDataSource.push(data);\r\n }\r\n }\r\n if (this.geometry2.isConnected) {\r\n const data = this.geometry2.getConnectedValue(state);\r\n if (data) {\r\n vertexDataSource.push(data);\r\n }\r\n }\r\n if (this.geometry3.isConnected) {\r\n const data = this.geometry3.getConnectedValue(state);\r\n if (data) {\r\n vertexDataSource.push(data);\r\n }\r\n }\r\n if (this.geometry4.isConnected) {\r\n const data = this.geometry4.getConnectedValue(state);\r\n if (data) {\r\n vertexDataSource.push(data);\r\n }\r\n }\r\n\r\n if (vertexDataSource.length === 0) {\r\n return null;\r\n }\r\n\r\n let vertexData = vertexDataSource[0].clone(); // Preserve source data\r\n const additionalVertexData: VertexData[] = vertexDataSource.slice(1);\r\n\r\n if (additionalVertexData.length && vertexData) {\r\n vertexData = vertexData.merge(additionalVertexData, true, false, true, true);\r\n }\r\n return vertexData;\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 this.evaluateContext = serializationObject.evaluateContext;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.MergeGeometryBlock\", MergeGeometryBlock);\r\n"]}
@@ -168,6 +168,7 @@ export class RandomBlock extends NodeGeometryBlock {
168
168
  __decorate([
169
169
  editableInPropertyPage("LockMode", 4 /* PropertyTypeForEdition.List */, "ADVANCED", {
170
170
  notifiers: { rebuild: true },
171
+ embedded: true,
171
172
  options: [
172
173
  { label: "None", value: RandomBlockLocks.None },
173
174
  { label: "LoopID", value: RandomBlockLocks.LoopID },
@@ -1 +1 @@
1
- {"version":3,"file":"randomBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Meshes/Node/Blocks/randomBlock.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD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AAgB,CAAC,IAAI,EAAE;SAClD;KACJ,CAAC;6CACsC;AAoK5C,aAAa,CAAC,qBAAqB,EAAE,WAAW,CAAC,CAAC","sourcesContent":["import { NodeGeometryBlock } from \"../nodeGeometryBlock\";\r\nimport type { NodeGeometryConnectionPoint } from \"../nodeGeometryBlockConnectionPoint\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\nimport { NodeGeometryBlockConnectionPointTypes } from \"../Enums/nodeGeometryConnectionPointTypes\";\r\nimport type { NodeGeometryBuildState } from \"../nodeGeometryBuildState\";\r\nimport { GeometryInputBlock } from \"./geometryInputBlock\";\r\nimport { Vector2, Vector3, Vector4 } from \"../../../Maths/math.vector\";\r\nimport type { Nullable } from \"../../../types\";\r\nimport { PropertyTypeForEdition, editableInPropertyPage } from \"core/Decorators/nodeDecorator\";\r\nimport { NodeGeometryContextualSources } from \"../Enums/nodeGeometryContextualSources\";\r\n\r\n/**\r\n * Locks supported by the random block\r\n */\r\nexport enum RandomBlockLocks {\r\n /** None */\r\n None,\r\n /** LoopID */\r\n LoopID,\r\n /** InstanceID */\r\n InstanceID,\r\n /** Once */\r\n Once,\r\n}\r\n\r\n/**\r\n * Block used to get a random number\r\n */\r\nexport class RandomBlock extends NodeGeometryBlock {\r\n private _currentLockId = -1;\r\n /**\r\n * Gets or sets a value indicating if that block will lock its value for a specific duration\r\n */\r\n @editableInPropertyPage(\"LockMode\", PropertyTypeForEdition.List, \"ADVANCED\", {\r\n notifiers: { rebuild: true },\r\n options: [\r\n { label: \"None\", value: RandomBlockLocks.None },\r\n { label: \"LoopID\", value: RandomBlockLocks.LoopID },\r\n { label: \"InstanceID\", value: RandomBlockLocks.InstanceID },\r\n { label: \"Once\", value: RandomBlockLocks.Once },\r\n ],\r\n })\r\n public lockMode = RandomBlockLocks.None;\r\n\r\n /**\r\n * Create a new RandomBlock\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(\"min\", NodeGeometryBlockConnectionPointTypes.AutoDetect);\r\n this.registerInput(\"max\", NodeGeometryBlockConnectionPointTypes.AutoDetect);\r\n\r\n this.registerOutput(\"output\", NodeGeometryBlockConnectionPointTypes.BasedOnInput);\r\n\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Matrix);\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Geometry);\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Texture);\r\n this._inputs[1].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Matrix);\r\n this._inputs[1].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Geometry);\r\n this._inputs[1].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Texture);\r\n\r\n this._outputs[0]._typeConnectionSource = this._inputs[0];\r\n this._linkConnectionTypes(0, 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 \"RandomBlock\";\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[0];\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[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 public override autoConfigure() {\r\n if (!this.min.isConnected) {\r\n const minInput = new GeometryInputBlock(\"Min\");\r\n minInput.value = 0;\r\n minInput.output.connectTo(this.min);\r\n }\r\n\r\n if (!this.max.isConnected) {\r\n const maxInput = new GeometryInputBlock(\"Max\");\r\n maxInput.value = 1;\r\n maxInput.output.connectTo(this.max);\r\n }\r\n }\r\n\r\n protected override _buildBlock() {\r\n let func: Nullable<(state: NodeGeometryBuildState) => any> = null;\r\n this._currentLockId = -1;\r\n\r\n switch (this.min.type) {\r\n case NodeGeometryBlockConnectionPointTypes.Int:\r\n case NodeGeometryBlockConnectionPointTypes.Float: {\r\n func = (state) => {\r\n const min = this.min.getConnectedValue(state) || 0;\r\n const max = this.max.getConnectedValue(state) || 0;\r\n return min + Math.random() * (max - min);\r\n };\r\n break;\r\n }\r\n case NodeGeometryBlockConnectionPointTypes.Vector2: {\r\n func = (state) => {\r\n const min = this.min.getConnectedValue(state) || Vector2.Zero();\r\n const max = this.max.getConnectedValue(state) || Vector2.Zero();\r\n return new Vector2(min.x + Math.random() * (max.x - min.x), min.y + Math.random() * (max.y - min.y));\r\n };\r\n break;\r\n }\r\n case NodeGeometryBlockConnectionPointTypes.Vector3: {\r\n func = (state) => {\r\n const min = this.min.getConnectedValue(state) || Vector3.Zero();\r\n const max = this.max.getConnectedValue(state) || Vector3.Zero();\r\n return new Vector3(min.x + Math.random() * (max.x - min.x), min.y + Math.random() * (max.y - min.y), min.z + Math.random() * (max.z - min.z));\r\n };\r\n break;\r\n }\r\n case NodeGeometryBlockConnectionPointTypes.Vector4: {\r\n func = (state) => {\r\n const min = this.min.getConnectedValue(state) || Vector4.Zero();\r\n const max = this.max.getConnectedValue(state) || Vector4.Zero();\r\n return new Vector4(\r\n min.x + Math.random() * (max.x - min.x),\r\n min.y + Math.random() * (max.y - min.y),\r\n min.z + Math.random() * (max.z - min.z),\r\n min.w + Math.random() * (max.w - min.w)\r\n );\r\n };\r\n break;\r\n }\r\n }\r\n\r\n if (this.lockMode === RandomBlockLocks.None || !func) {\r\n this.output._storedFunction = func;\r\n } else {\r\n this.output._storedFunction = (state) => {\r\n let lockId = 0;\r\n\r\n switch (this.lockMode) {\r\n case RandomBlockLocks.InstanceID:\r\n lockId = state.getContextualValue(NodeGeometryContextualSources.InstanceID, true) || 0;\r\n break;\r\n case RandomBlockLocks.LoopID:\r\n lockId = state.getContextualValue(NodeGeometryContextualSources.LoopID, true) || 0;\r\n break;\r\n case RandomBlockLocks.Once:\r\n lockId = state.buildId || 0;\r\n break;\r\n }\r\n\r\n if (this._currentLockId !== lockId || this.lockMode === RandomBlockLocks.None) {\r\n this._currentLockId = lockId;\r\n this.output._storedValue = func!(state);\r\n }\r\n return this.output._storedValue;\r\n };\r\n }\r\n }\r\n\r\n protected override _dumpPropertiesCode() {\r\n const codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.lockMode = BABYLON.RandomBlockLocks.${RandomBlockLocks[this.lockMode]};\\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.lockMode = this.lockMode;\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.lockMode = serializationObject.lockMode;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.RandomBlock\", RandomBlock);\r\n"]}
1
+ {"version":3,"file":"randomBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Meshes/Node/Blocks/randomBlock.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,qCAAqC,EAAE,MAAM,2CAA2C,CAAC;AAElG,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAEvE,OAAO,EAA0B,sBAAsB,EAAE,6CAAsC;AAC/F,OAAO,EAAE,6BAA6B,EAAE,MAAM,wCAAwC,CAAC;AAEvF;;GAEG;AACH,MAAM,CAAN,IAAY,gBASX;AATD,WAAY,gBAAgB;IACxB,WAAW;IACX,uDAAI,CAAA;IACJ,aAAa;IACb,2DAAM,CAAA;IACN,iBAAiB;IACjB,mEAAU,CAAA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U,CAAC;IACtB,CAAC;IAED;;;OAGG;IACa,SAAS;QACrB,MAAM,mBAAmB,GAAG,KAAK,CAAC,SAAS,EAAE,CAAC;QAE9C,mBAAmB,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;QAE7C,OAAO,mBAAmB,CAAC;IAC/B,CAAC;IAEe,YAAY,CAAC,mBAAwB;QACjD,KAAK,CAAC,YAAY,CAAC,mBAAmB,CAAC,CAAC;QAExC,IAAI,CAAC,QAAQ,GAAG,mBAAmB,CAAC,QAAQ,CAAC;IACjD,CAAC;CACJ;AAlKU;IAVN,sBAAsB,CAAC,UAAU,uCAA+B,UAAU,EAAE;QACzE,SAAS,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;QAC5B,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE;YACL,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,gBAAgB,CAAC,IAAI,EAAE;YAC/C,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,gBAAgB,CAAC,MAAM,EAAE;YACnD,EAAE,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,gBAAgB,CAAC,UAAU,EAAE;YAC3D,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,gBAAgB,CAAC,IAAI,EAAE;SAClD;KACJ,CAAC;6CACsC;AAoK5C,aAAa,CAAC,qBAAqB,EAAE,WAAW,CAAC,CAAC","sourcesContent":["import { NodeGeometryBlock } from \"../nodeGeometryBlock\";\r\nimport type { NodeGeometryConnectionPoint } from \"../nodeGeometryBlockConnectionPoint\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\nimport { NodeGeometryBlockConnectionPointTypes } from \"../Enums/nodeGeometryConnectionPointTypes\";\r\nimport type { NodeGeometryBuildState } from \"../nodeGeometryBuildState\";\r\nimport { GeometryInputBlock } from \"./geometryInputBlock\";\r\nimport { Vector2, Vector3, Vector4 } from \"../../../Maths/math.vector\";\r\nimport type { Nullable } from \"../../../types\";\r\nimport { PropertyTypeForEdition, editableInPropertyPage } from \"core/Decorators/nodeDecorator\";\r\nimport { NodeGeometryContextualSources } from \"../Enums/nodeGeometryContextualSources\";\r\n\r\n/**\r\n * Locks supported by the random block\r\n */\r\nexport enum RandomBlockLocks {\r\n /** None */\r\n None,\r\n /** LoopID */\r\n LoopID,\r\n /** InstanceID */\r\n InstanceID,\r\n /** Once */\r\n Once,\r\n}\r\n\r\n/**\r\n * Block used to get a random number\r\n */\r\nexport class RandomBlock extends NodeGeometryBlock {\r\n private _currentLockId = -1;\r\n /**\r\n * Gets or sets a value indicating if that block will lock its value for a specific duration\r\n */\r\n @editableInPropertyPage(\"LockMode\", PropertyTypeForEdition.List, \"ADVANCED\", {\r\n notifiers: { rebuild: true },\r\n embedded: true,\r\n options: [\r\n { label: \"None\", value: RandomBlockLocks.None },\r\n { label: \"LoopID\", value: RandomBlockLocks.LoopID },\r\n { label: \"InstanceID\", value: RandomBlockLocks.InstanceID },\r\n { label: \"Once\", value: RandomBlockLocks.Once },\r\n ],\r\n })\r\n public lockMode = RandomBlockLocks.None;\r\n\r\n /**\r\n * Create a new RandomBlock\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(\"min\", NodeGeometryBlockConnectionPointTypes.AutoDetect);\r\n this.registerInput(\"max\", NodeGeometryBlockConnectionPointTypes.AutoDetect);\r\n\r\n this.registerOutput(\"output\", NodeGeometryBlockConnectionPointTypes.BasedOnInput);\r\n\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Matrix);\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Geometry);\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Texture);\r\n this._inputs[1].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Matrix);\r\n this._inputs[1].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Geometry);\r\n this._inputs[1].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Texture);\r\n\r\n this._outputs[0]._typeConnectionSource = this._inputs[0];\r\n this._linkConnectionTypes(0, 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 \"RandomBlock\";\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[0];\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[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 public override autoConfigure() {\r\n if (!this.min.isConnected) {\r\n const minInput = new GeometryInputBlock(\"Min\");\r\n minInput.value = 0;\r\n minInput.output.connectTo(this.min);\r\n }\r\n\r\n if (!this.max.isConnected) {\r\n const maxInput = new GeometryInputBlock(\"Max\");\r\n maxInput.value = 1;\r\n maxInput.output.connectTo(this.max);\r\n }\r\n }\r\n\r\n protected override _buildBlock() {\r\n let func: Nullable<(state: NodeGeometryBuildState) => any> = null;\r\n this._currentLockId = -1;\r\n\r\n switch (this.min.type) {\r\n case NodeGeometryBlockConnectionPointTypes.Int:\r\n case NodeGeometryBlockConnectionPointTypes.Float: {\r\n func = (state) => {\r\n const min = this.min.getConnectedValue(state) || 0;\r\n const max = this.max.getConnectedValue(state) || 0;\r\n return min + Math.random() * (max - min);\r\n };\r\n break;\r\n }\r\n case NodeGeometryBlockConnectionPointTypes.Vector2: {\r\n func = (state) => {\r\n const min = this.min.getConnectedValue(state) || Vector2.Zero();\r\n const max = this.max.getConnectedValue(state) || Vector2.Zero();\r\n return new Vector2(min.x + Math.random() * (max.x - min.x), min.y + Math.random() * (max.y - min.y));\r\n };\r\n break;\r\n }\r\n case NodeGeometryBlockConnectionPointTypes.Vector3: {\r\n func = (state) => {\r\n const min = this.min.getConnectedValue(state) || Vector3.Zero();\r\n const max = this.max.getConnectedValue(state) || Vector3.Zero();\r\n return new Vector3(min.x + Math.random() * (max.x - min.x), min.y + Math.random() * (max.y - min.y), min.z + Math.random() * (max.z - min.z));\r\n };\r\n break;\r\n }\r\n case NodeGeometryBlockConnectionPointTypes.Vector4: {\r\n func = (state) => {\r\n const min = this.min.getConnectedValue(state) || Vector4.Zero();\r\n const max = this.max.getConnectedValue(state) || Vector4.Zero();\r\n return new Vector4(\r\n min.x + Math.random() * (max.x - min.x),\r\n min.y + Math.random() * (max.y - min.y),\r\n min.z + Math.random() * (max.z - min.z),\r\n min.w + Math.random() * (max.w - min.w)\r\n );\r\n };\r\n break;\r\n }\r\n }\r\n\r\n if (this.lockMode === RandomBlockLocks.None || !func) {\r\n this.output._storedFunction = func;\r\n } else {\r\n this.output._storedFunction = (state) => {\r\n let lockId = 0;\r\n\r\n switch (this.lockMode) {\r\n case RandomBlockLocks.InstanceID:\r\n lockId = state.getContextualValue(NodeGeometryContextualSources.InstanceID, true) || 0;\r\n break;\r\n case RandomBlockLocks.LoopID:\r\n lockId = state.getContextualValue(NodeGeometryContextualSources.LoopID, true) || 0;\r\n break;\r\n case RandomBlockLocks.Once:\r\n lockId = state.buildId || 0;\r\n break;\r\n }\r\n\r\n if (this._currentLockId !== lockId || this.lockMode === RandomBlockLocks.None) {\r\n this._currentLockId = lockId;\r\n this.output._storedValue = func!(state);\r\n }\r\n return this.output._storedValue;\r\n };\r\n }\r\n }\r\n\r\n protected override _dumpPropertiesCode() {\r\n const codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.lockMode = BABYLON.RandomBlockLocks.${RandomBlockLocks[this.lockMode]};\\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.lockMode = this.lockMode;\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.lockMode = serializationObject.lockMode;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.RandomBlock\", RandomBlock);\r\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@babylonjs/core",
3
- "version": "7.32.4",
3
+ "version": "7.32.5",
4
4
  "main": "index.js",
5
5
  "module": "index.js",
6
6
  "types": "index.d.ts",