@babylonjs/core 7.32.4 → 7.33.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (126) 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/FrameGraph/Node/nodeRenderGraph.js.map +1 -1
  6. package/Materials/Node/Blocks/Dual/sceneDepthBlock.js +1 -0
  7. package/Materials/Node/Blocks/Dual/sceneDepthBlock.js.map +1 -1
  8. package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.d.ts +16 -0
  9. package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.js +40 -7
  10. package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.js.map +1 -1
  11. package/Materials/Node/Blocks/Fragment/perturbNormalBlock.js +4 -4
  12. package/Materials/Node/Blocks/Fragment/perturbNormalBlock.js.map +1 -1
  13. package/Materials/Node/Blocks/PBR/clearCoatBlock.js +1 -1
  14. package/Materials/Node/Blocks/PBR/clearCoatBlock.js.map +1 -1
  15. package/Materials/Node/Blocks/PBR/reflectionBlock.js +2 -2
  16. package/Materials/Node/Blocks/PBR/reflectionBlock.js.map +1 -1
  17. package/Materials/Node/Blocks/PBR/refractionBlock.js +3 -3
  18. package/Materials/Node/Blocks/PBR/refractionBlock.js.map +1 -1
  19. package/Materials/Node/Blocks/PBR/sheenBlock.js +2 -2
  20. package/Materials/Node/Blocks/PBR/sheenBlock.js.map +1 -1
  21. package/Materials/Node/Blocks/clampBlock.js +2 -2
  22. package/Materials/Node/Blocks/clampBlock.js.map +1 -1
  23. package/Materials/Node/Blocks/cloudBlock.js +1 -1
  24. package/Materials/Node/Blocks/cloudBlock.js.map +1 -1
  25. package/Materials/Node/Blocks/conditionalBlock.js +19 -0
  26. package/Materials/Node/Blocks/conditionalBlock.js.map +1 -1
  27. package/Materials/Node/Blocks/curveBlock.js +37 -0
  28. package/Materials/Node/Blocks/curveBlock.js.map +1 -1
  29. package/Materials/Node/Blocks/loopBlock.js +1 -1
  30. package/Materials/Node/Blocks/loopBlock.js.map +1 -1
  31. package/Materials/Node/Blocks/meshAttributeExistsBlock.js +1 -0
  32. package/Materials/Node/Blocks/meshAttributeExistsBlock.js.map +1 -1
  33. package/Materials/Node/Blocks/transformBlock.d.ts +6 -0
  34. package/Materials/Node/Blocks/transformBlock.js +16 -1
  35. package/Materials/Node/Blocks/transformBlock.js.map +1 -1
  36. package/Materials/Node/Blocks/triPlanarBlock.js +1 -1
  37. package/Materials/Node/Blocks/triPlanarBlock.js.map +1 -1
  38. package/Materials/Node/Blocks/trigonometryBlock.js +29 -0
  39. package/Materials/Node/Blocks/trigonometryBlock.js.map +1 -1
  40. package/Materials/Node/Blocks/waveBlock.js +13 -0
  41. package/Materials/Node/Blocks/waveBlock.js.map +1 -1
  42. package/Materials/Node/Blocks/worleyNoise3DBlock.js +1 -1
  43. package/Materials/Node/Blocks/worleyNoise3DBlock.js.map +1 -1
  44. package/Materials/Node/nodeMaterial.js.map +1 -1
  45. package/Materials/effectRenderer.d.ts +1 -1
  46. package/Materials/effectRenderer.js +2 -2
  47. package/Materials/effectRenderer.js.map +1 -1
  48. package/Meshes/Node/Blocks/Instances/instantiateBaseBlock.js +1 -1
  49. package/Meshes/Node/Blocks/Instances/instantiateBaseBlock.js.map +1 -1
  50. package/Meshes/Node/Blocks/Set/aggregatorBlock.js +1 -0
  51. package/Meshes/Node/Blocks/Set/aggregatorBlock.js.map +1 -1
  52. package/Meshes/Node/Blocks/Set/latticeBlock.js +4 -4
  53. package/Meshes/Node/Blocks/Set/latticeBlock.js.map +1 -1
  54. package/Meshes/Node/Blocks/Set/setColorsBlock.js +1 -1
  55. package/Meshes/Node/Blocks/Set/setColorsBlock.js.map +1 -1
  56. package/Meshes/Node/Blocks/Set/setMaterialIDBlock.js +1 -1
  57. package/Meshes/Node/Blocks/Set/setMaterialIDBlock.js.map +1 -1
  58. package/Meshes/Node/Blocks/Set/setNormalsBlock.js +1 -1
  59. package/Meshes/Node/Blocks/Set/setNormalsBlock.js.map +1 -1
  60. package/Meshes/Node/Blocks/Set/setPositionsBlock.js +1 -1
  61. package/Meshes/Node/Blocks/Set/setPositionsBlock.js.map +1 -1
  62. package/Meshes/Node/Blocks/Set/setTangentsBlock.js +1 -1
  63. package/Meshes/Node/Blocks/Set/setTangentsBlock.js.map +1 -1
  64. package/Meshes/Node/Blocks/Set/setUVsBlock.js +2 -1
  65. package/Meshes/Node/Blocks/Set/setUVsBlock.js.map +1 -1
  66. package/Meshes/Node/Blocks/Sources/boxBlock.js +1 -1
  67. package/Meshes/Node/Blocks/Sources/boxBlock.js.map +1 -1
  68. package/Meshes/Node/Blocks/Sources/capsuleBlock.js +1 -1
  69. package/Meshes/Node/Blocks/Sources/capsuleBlock.js.map +1 -1
  70. package/Meshes/Node/Blocks/Sources/cylinderBlock.js +1 -1
  71. package/Meshes/Node/Blocks/Sources/cylinderBlock.js.map +1 -1
  72. package/Meshes/Node/Blocks/Sources/discBlock.js +1 -1
  73. package/Meshes/Node/Blocks/Sources/discBlock.js.map +1 -1
  74. package/Meshes/Node/Blocks/Sources/gridBlock.js +1 -1
  75. package/Meshes/Node/Blocks/Sources/gridBlock.js.map +1 -1
  76. package/Meshes/Node/Blocks/Sources/icoSphereBlock.js +1 -1
  77. package/Meshes/Node/Blocks/Sources/icoSphereBlock.js.map +1 -1
  78. package/Meshes/Node/Blocks/Sources/meshBlock.js +1 -1
  79. package/Meshes/Node/Blocks/Sources/meshBlock.js.map +1 -1
  80. package/Meshes/Node/Blocks/Sources/planeBlock.js +1 -1
  81. package/Meshes/Node/Blocks/Sources/planeBlock.js.map +1 -1
  82. package/Meshes/Node/Blocks/Sources/sphereBlock.js +1 -1
  83. package/Meshes/Node/Blocks/Sources/sphereBlock.js.map +1 -1
  84. package/Meshes/Node/Blocks/Sources/torusBlock.js +1 -1
  85. package/Meshes/Node/Blocks/Sources/torusBlock.js.map +1 -1
  86. package/Meshes/Node/Blocks/Textures/geometryTextureBlock.js +1 -1
  87. package/Meshes/Node/Blocks/Textures/geometryTextureBlock.js.map +1 -1
  88. package/Meshes/Node/Blocks/Textures/geometryTextureFetchBlock.js +1 -1
  89. package/Meshes/Node/Blocks/Textures/geometryTextureFetchBlock.js.map +1 -1
  90. package/Meshes/Node/Blocks/booleanGeometryBlock.d.ts +5 -0
  91. package/Meshes/Node/Blocks/booleanGeometryBlock.js +43 -13
  92. package/Meshes/Node/Blocks/booleanGeometryBlock.js.map +1 -1
  93. package/Meshes/Node/Blocks/cleanGeometryBlock.js +1 -1
  94. package/Meshes/Node/Blocks/cleanGeometryBlock.js.map +1 -1
  95. package/Meshes/Node/Blocks/conditionBlock.js +1 -0
  96. package/Meshes/Node/Blocks/conditionBlock.js.map +1 -1
  97. package/Meshes/Node/Blocks/geometryClampBlock.js +2 -2
  98. package/Meshes/Node/Blocks/geometryClampBlock.js.map +1 -1
  99. package/Meshes/Node/Blocks/geometryCollectionBlock.js +1 -1
  100. package/Meshes/Node/Blocks/geometryCollectionBlock.js.map +1 -1
  101. package/Meshes/Node/Blocks/geometryCurveBlock.js +1 -0
  102. package/Meshes/Node/Blocks/geometryCurveBlock.js.map +1 -1
  103. package/Meshes/Node/Blocks/geometryOptimizeBlock.js +3 -3
  104. package/Meshes/Node/Blocks/geometryOptimizeBlock.js.map +1 -1
  105. package/Meshes/Node/Blocks/geometryTransformBlock.js +1 -1
  106. package/Meshes/Node/Blocks/geometryTransformBlock.js.map +1 -1
  107. package/Meshes/Node/Blocks/geometryTrigonometryBlock.js +1 -0
  108. package/Meshes/Node/Blocks/geometryTrigonometryBlock.js.map +1 -1
  109. package/Meshes/Node/Blocks/mappingBlock.js +1 -0
  110. package/Meshes/Node/Blocks/mappingBlock.js.map +1 -1
  111. package/Meshes/Node/Blocks/mathBlock.js +1 -0
  112. package/Meshes/Node/Blocks/mathBlock.js.map +1 -1
  113. package/Meshes/Node/Blocks/mergeGeometryBlock.js +1 -1
  114. package/Meshes/Node/Blocks/mergeGeometryBlock.js.map +1 -1
  115. package/Meshes/Node/Blocks/randomBlock.js +1 -0
  116. package/Meshes/Node/Blocks/randomBlock.js.map +1 -1
  117. package/Meshes/Node/nodeGeometry.js.map +1 -1
  118. package/Rendering/IBLShadows/iblShadowsAccumulationPass.js +1 -1
  119. package/Rendering/IBLShadows/iblShadowsAccumulationPass.js.map +1 -1
  120. package/Rendering/IBLShadows/iblShadowsRenderPipeline.d.ts +12 -12
  121. package/Rendering/IBLShadows/iblShadowsRenderPipeline.js.map +1 -1
  122. package/Shaders/iblShadowAccumulation.fragment.js +2 -1
  123. package/Shaders/iblShadowAccumulation.fragment.js.map +1 -1
  124. package/ShadersWGSL/iblShadowAccumulation.fragment.js +2 -1
  125. package/ShadersWGSL/iblShadowAccumulation.fragment.js.map +1 -1
  126. package/package.json +1 -1
@@ -4,6 +4,7 @@ import { RegisterClass } from "../../../Misc/typeStore.js";
4
4
  import { NodeGeometryBlockConnectionPointTypes } from "../Enums/nodeGeometryConnectionPointTypes.js";
5
5
  import { editableInPropertyPage } from "../../../Decorators/nodeDecorator.js";
6
6
  import { CSG2, InitializeCSG2Async, IsCSG2Ready } from "../../csg2.js";
7
+ import { CSG } from "../../csg.js";
7
8
  /**
8
9
  * Operations supported by the boolean block
9
10
  */
@@ -47,6 +48,11 @@ export class BooleanGeometryBlock extends NodeGeometryBlock {
47
48
  * Gets or sets the operation applied by the block
48
49
  */
49
50
  this.operation = BooleanGeometryOperations.Intersect;
51
+ /**
52
+ * Gets or sets a boolean indicating that this block can evaluate context
53
+ * Build performance is improved when this value is set to false as the system will cache values instead of reevaluating everything per context change
54
+ */
55
+ this.useOldCSGEngine = false;
50
56
  this.registerInput("geometry0", NodeGeometryBlockConnectionPointTypes.Geometry);
51
57
  this.registerInput("geometry1", NodeGeometryBlockConnectionPointTypes.Geometry);
52
58
  this.registerOutput("output", NodeGeometryBlockConnectionPointTypes.Geometry);
@@ -103,19 +109,36 @@ export class BooleanGeometryBlock extends NodeGeometryBlock {
103
109
  if (!vertexData1.colors && vertexData0.colors) {
104
110
  vertexData1.colors = new Array(vertexCount * 4);
105
111
  }
106
- const CSG0 = CSG2.FromVertexData(vertexData0);
107
- const CSG1 = CSG2.FromVertexData(vertexData1);
108
112
  let boolCSG;
109
- switch (this.operation) {
110
- case BooleanGeometryOperations.Intersect:
111
- boolCSG = CSG0.intersect(CSG1);
112
- break;
113
- case BooleanGeometryOperations.Subtract:
114
- boolCSG = CSG0.subtract(CSG1);
115
- break;
116
- case BooleanGeometryOperations.Union:
117
- boolCSG = CSG0.add(CSG1);
118
- break;
113
+ if (this.useOldCSGEngine) {
114
+ const CSG0 = CSG.FromVertexData(vertexData0);
115
+ const CSG1 = CSG.FromVertexData(vertexData1);
116
+ switch (this.operation) {
117
+ case BooleanGeometryOperations.Intersect:
118
+ boolCSG = CSG0.intersect(CSG1);
119
+ break;
120
+ case BooleanGeometryOperations.Subtract:
121
+ boolCSG = CSG0.subtract(CSG1);
122
+ break;
123
+ case BooleanGeometryOperations.Union:
124
+ boolCSG = CSG0.union(CSG1);
125
+ break;
126
+ }
127
+ }
128
+ else {
129
+ const CSG0 = CSG2.FromVertexData(vertexData0);
130
+ const CSG1 = CSG2.FromVertexData(vertexData1);
131
+ switch (this.operation) {
132
+ case BooleanGeometryOperations.Intersect:
133
+ boolCSG = CSG0.intersect(CSG1);
134
+ break;
135
+ case BooleanGeometryOperations.Subtract:
136
+ boolCSG = CSG0.subtract(CSG1);
137
+ break;
138
+ case BooleanGeometryOperations.Union:
139
+ boolCSG = CSG0.add(CSG1);
140
+ break;
141
+ }
119
142
  }
120
143
  return boolCSG.toVertexData();
121
144
  };
@@ -130,6 +153,7 @@ export class BooleanGeometryBlock extends NodeGeometryBlock {
130
153
  _dumpPropertiesCode() {
131
154
  let codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.evaluateContext = ${this.evaluateContext ? "true" : "false"};\n`;
132
155
  codeString += `${this._codeVariableName}.operation = BABYLON.BooleanGeometryOperations.${BooleanGeometryOperations[this.operation]};\n`;
156
+ codeString += `${this._codeVariableName}.useOldCSGEngine = ${this.useOldCSGEngine ? "true" : "false"};\n`;
133
157
  return codeString;
134
158
  }
135
159
  /**
@@ -140,6 +164,7 @@ export class BooleanGeometryBlock extends NodeGeometryBlock {
140
164
  const serializationObject = super.serialize();
141
165
  serializationObject.evaluateContext = this.evaluateContext;
142
166
  serializationObject.operation = this.operation;
167
+ serializationObject.useOldCSGEngine = this.useOldCSGEngine;
143
168
  return serializationObject;
144
169
  }
145
170
  _deserialize(serializationObject) {
@@ -148,14 +173,16 @@ export class BooleanGeometryBlock extends NodeGeometryBlock {
148
173
  if (serializationObject.operation) {
149
174
  this.operation = serializationObject.operation;
150
175
  }
176
+ this.useOldCSGEngine = !!serializationObject.useOldCSGEngine;
151
177
  }
152
178
  }
153
179
  __decorate([
154
- editableInPropertyPage("Evaluate context", 0 /* PropertyTypeForEdition.Boolean */, "ADVANCED", { notifiers: { rebuild: true } })
180
+ editableInPropertyPage("Evaluate context", 0 /* PropertyTypeForEdition.Boolean */, "ADVANCED", { embedded: true, notifiers: { rebuild: true } })
155
181
  ], BooleanGeometryBlock.prototype, "evaluateContext", void 0);
156
182
  __decorate([
157
183
  editableInPropertyPage("Operation", 4 /* PropertyTypeForEdition.List */, "ADVANCED", {
158
184
  notifiers: { rebuild: true },
185
+ embedded: true,
159
186
  options: [
160
187
  { label: "Intersect", value: BooleanGeometryOperations.Intersect },
161
188
  { label: "Subtract", value: BooleanGeometryOperations.Subtract },
@@ -163,5 +190,8 @@ __decorate([
163
190
  ],
164
191
  })
165
192
  ], BooleanGeometryBlock.prototype, "operation", void 0);
193
+ __decorate([
194
+ editableInPropertyPage("Use old CSG engine", 0 /* PropertyTypeForEdition.Boolean */, "ADVANCED", { embedded: true, notifiers: { rebuild: true } })
195
+ ], BooleanGeometryBlock.prototype, "useOldCSGEngine", void 0);
166
196
  RegisterClass("BABYLON.BooleanGeometryBlock", BooleanGeometryBlock);
167
197
  //# sourceMappingURL=booleanGeometryBlock.js.map
@@ -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,IAAI,EAAE,mBAAmB,EAAE,WAAW,EAAE,sBAAyB;AAG1E;;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;IAsBvD;;OAEG;IACH,IAAoB,aAAa;QAC7B,IAAI,WAAW,EAAE,EAAE;YACf,OAAO,IAAI,CAAC;SACf;QAED,IAAI,CAAC,IAAI,CAAC,mBAAmB,EAAE;YAC3B,IAAI,CAAC,mBAAmB,GAAG,mBAAmB,EAAE,CAAC;SACpD;QAED,OAAO,IAAI,CAAC,mBAAmB,CAAC;IACpC,CAAC;IAED;;;OAGG;IACH,YAAmB,IAAY;QAC3B,KAAK,CAAC,IAAI,CAAC,CAAC;QAzChB;;;WAGG;QAEI,oBAAe,GAAG,KAAK,CAAC;QAE/B;;WAEG;QASI,cAAS,GAAG,yBAAyB,CAAC,SAAS,CAAC;QAyBnD,IAAI,CAAC,aAAa,CAAC,WAAW,EAAE,qCAAqC,CAAC,QAAQ,CA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AC1E,SAAS,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;QAC5B,OAAO,EAAE;YACL,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,yBAAyB,CAAC,SAAS,EAAE;YAClE,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,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"]}
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,IAAI,EAAE,mBAAmB,EAAE,WAAW,EAAE,sBAAyB;AAE1E,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;IA8BvD;;OAEG;IACH,IAAoB,aAAa;QAC7B,IAAI,WAAW,EAAE,EAAE;YACf,OAAO,IAAI,CAAC;SACf;QAED,IAAI,CAAC,IAAI,CAAC,mBAAmB,EAAE;YAC3B,IAAI,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U,EAAE;QAC1E,SAAS,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;QAC5B,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE;YACL,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,yBAAyB,CAAC,SAAS,EAAE;YAClE,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,yBAAyB,CAAC,QAAQ,EAAE;YAChE,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,yBAAyB,CAAC,KAAK,EAAE;SAC7D;KACJ,CAAC;uDACqD;AAOhD;IADN,sBAAsB,CAAC,oBAAoB,0CAAkC,UAAU,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,CAAC;6DAC5G;AAsKnC,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\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\", { embedded: true, 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 embedded: 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 * 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(\"Use old CSG engine\", PropertyTypeForEdition.Boolean, \"ADVANCED\", { embedded: true, notifiers: { rebuild: true } })\r\n public useOldCSGEngine = false;\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 let boolCSG: CSG | CSG2;\r\n\r\n if (this.useOldCSGEngine) {\r\n const CSG0 = CSG.FromVertexData(vertexData0);\r\n const CSG1 = CSG.FromVertexData(vertexData1);\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 } else {\r\n const CSG0 = CSG2.FromVertexData(vertexData0);\r\n const CSG1 = CSG2.FromVertexData(vertexData1);\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\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 codeString += `${this._codeVariableName}.useOldCSGEngine = ${this.useOldCSGEngine ? \"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 serializationObject.operation = this.operation;\r\n serializationObject.useOldCSGEngine = this.useOldCSGEngine;\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 this.useOldCSGEngine = !!serializationObject.useOldCSGEngine;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.BooleanGeometryBlock\", BooleanGeometryBlock);\r\n"]}
@@ -81,7 +81,7 @@ export class CleanGeometryBlock extends NodeGeometryBlock {
81
81
  }
82
82
  }
83
83
  __decorate([
84
- editableInPropertyPage("Evaluate context", 0 /* PropertyTypeForEdition.Boolean */, "ADVANCED", { notifiers: { rebuild: true } })
84
+ editableInPropertyPage("Evaluate context", 0 /* PropertyTypeForEdition.Boolean */, "ADVANCED", { embedded: true, notifiers: { rebuild: true } })
85
85
  ], CleanGeometryBlock.prototype, "evaluateContext", void 0);
86
86
  RegisterClass("BABYLON.CleanGeometryBlock", CleanGeometryBlock);
87
87
  //# sourceMappingURL=cleanGeometryBlock.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"cleanGeometryBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Meshes/Node/Blocks/cleanGeometryBlock.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,qCAAqC,EAAE,MAAM,2CAA2C,CAAC;AAClG,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD,OAAO,EAA0B,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAGnG,OAAO,EAAE,eAAe,EAAE,yCAAkC;AAE5D;;GAEG;AACH,MAAM,OAAO,kBAAmB,SAAQ,iBAAiB;IAQrD;;;OAGG;IACH,YAAmB,IAAY;QAC3B,KAAK,CAAC,IAAI,CAAC,CAAC;QAZhB;;;WAGG;QAEI,oBAAe,GAAG,IAAI,CAAC;QAS1B,IAAI,CAAC,aAAa,CAAC,UAAU,EAAE,qCAAqC,CAAC,QAAQ,CAAC,CAAC;QAC/E,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,qCAAqC,CAAC,QAAQ,CAAC,CAAC;IAClF,CAAC;IAED;;;OAGG;IACa,YAAY;QACxB,OAAO,oBAAoB,CAAC;IAChC,CAAC;IAED;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,MAAM,mBAAmB,GAAG,KAAK,CAAC,SAAS,EAAE,CAAC;QAE9C,mBAAmB,CAAC,eAAe,GAAG,IAAI,CAAC,eAAe,CAAC;QAE3D,OAAO,mBAAmB,CAAC;IAC/B,CAAC;IAEe,YAAY,CAAC,mBAAwB;QACjD,KAAK,CAAC,YAAY,CAAC,mBAAmB,CAAC,CAAC;QAExC,IAAI,CAAC,eAAe,GAAG,mBAAmB,CAAC,eAAe,CAAC;IAC/D,CAAC;CACJ;AApFU;IADN,sBAAsB,CAAC,kBAAkB,0CAAkC,UAAU,EAAE,EAAE,SAAS,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,CAAC;2DAC3F;AAsFlC,aAAa,CAAC,4BAA4B,EAAE,kBAAkB,CAAC,CAAC","sourcesContent":["import { RegisterClass } from \"../../../Misc/typeStore\";\r\nimport { NodeGeometryBlockConnectionPointTypes } from \"../Enums/nodeGeometryConnectionPointTypes\";\r\nimport { NodeGeometryBlock } from \"../nodeGeometryBlock\";\r\nimport type { NodeGeometryConnectionPoint } from \"../nodeGeometryBlockConnectionPoint\";\r\nimport { PropertyTypeForEdition, editableInPropertyPage } from \"../../../Decorators/nodeDecorator\";\r\nimport type { NodeGeometryBuildState } from \"../nodeGeometryBuildState\";\r\nimport type { VertexData } from \"core/Meshes/mesh.vertexData\";\r\nimport { FixFlippedFaces } from \"core/Maths/math.functions\";\r\n\r\n/**\r\n * Block used to clean a geometry\r\n */\r\nexport class CleanGeometryBlock 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 = true;\r\n\r\n /**\r\n * Creates a new CleanGeometryBlock\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(\"geometry\", NodeGeometryBlockConnectionPointTypes.Geometry);\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 \"CleanGeometryBlock\";\r\n }\r\n\r\n /**\r\n * Gets the geometry component\r\n */\r\n public get geometry(): 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 const func = (state: NodeGeometryBuildState) => {\r\n if (!this.geometry.isConnected) {\r\n return null;\r\n }\r\n\r\n const vertexData = (this.geometry.getConnectedValue(state) as VertexData).clone();\r\n\r\n if (!vertexData.positions || !vertexData.indices || !vertexData.normals) {\r\n return vertexData;\r\n }\r\n\r\n const indices = vertexData.indices;\r\n const positions = vertexData.positions;\r\n\r\n FixFlippedFaces(positions, indices);\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 return super._dumpPropertiesCode() + `${this._codeVariableName}.evaluateContext = ${this.evaluateContext ? \"true\" : \"false\"};\\n`;\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.CleanGeometryBlock\", CleanGeometryBlock);\r\n"]}
1
+ {"version":3,"file":"cleanGeometryBlock.js","source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C,CAAC","sourcesContent":["import { RegisterClass } from \"../../../Misc/typeStore\";\r\nimport { NodeGeometryBlockConnectionPointTypes } from \"../Enums/nodeGeometryConnectionPointTypes\";\r\nimport { NodeGeometryBlock } from \"../nodeGeometryBlock\";\r\nimport type { NodeGeometryConnectionPoint } from \"../nodeGeometryBlockConnectionPoint\";\r\nimport { PropertyTypeForEdition, editableInPropertyPage } from \"../../../Decorators/nodeDecorator\";\r\nimport type { NodeGeometryBuildState } from \"../nodeGeometryBuildState\";\r\nimport type { VertexData } from \"core/Meshes/mesh.vertexData\";\r\nimport { FixFlippedFaces } from \"core/Maths/math.functions\";\r\n\r\n/**\r\n * Block used to clean a geometry\r\n */\r\nexport class CleanGeometryBlock 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 = true;\r\n\r\n /**\r\n * Creates a new CleanGeometryBlock\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(\"geometry\", NodeGeometryBlockConnectionPointTypes.Geometry);\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 \"CleanGeometryBlock\";\r\n }\r\n\r\n /**\r\n * Gets the geometry component\r\n */\r\n public get geometry(): 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 const func = (state: NodeGeometryBuildState) => {\r\n if (!this.geometry.isConnected) {\r\n return null;\r\n }\r\n\r\n const vertexData = (this.geometry.getConnectedValue(state) as VertexData).clone();\r\n\r\n if (!vertexData.positions || !vertexData.indices || !vertexData.normals) {\r\n return vertexData;\r\n }\r\n\r\n const indices = vertexData.indices;\r\n const positions = vertexData.positions;\r\n\r\n FixFlippedFaces(positions, indices);\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 return super._dumpPropertiesCode() + `${this._codeVariableName}.evaluateContext = ${this.evaluateContext ? \"true\" : \"false\"};\\n`;\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.CleanGeometryBlock\", CleanGeometryBlock);\r\n"]}
@@ -160,6 +160,7 @@ export class ConditionBlock extends NodeGeometryBlock {
160
160
  __decorate([
161
161
  editableInPropertyPage("Test", 4 /* PropertyTypeForEdition.List */, "ADVANCED", {
162
162
  notifiers: { rebuild: true },
163
+ embedded: true,
163
164
  options: [
164
165
  { label: "Equal", value: ConditionBlockTests.Equal },
165
166
  { label: "NotEqual", value: ConditionBlockTests.NotEqual },
@@ -1 +1 @@
1
- {"version":3,"file":"conditionBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Meshes/Node/Blocks/conditionBlock.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,2C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AAK,EAAE,mBAAmB,CAAC,WAAW,EAAE;YAChE,EAAE,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,mBAAmB,CAAC,WAAW,EAAE;YAChE,EAAE,KAAK,EAAE,gBAAgB,EAAE,KAAK,EAAE,mBAAmB,CAAC,cAAc,EAAE;YACtE,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,mBAAmB,CAAC,GAAG,EAAE;YAChD,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,mBAAmB,CAAC,EAAE,EAAE;YAC9C,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,mBAAmB,CAAC,GAAG,EAAE;SACnD;KACJ,CAAC;4CACsC;AA+I5C,aAAa,CAAC,wBAAwB,EAAE,cAAc,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 { WithinEpsilon } from \"../../../Maths/math.scalar.functions\";\r\nimport { Epsilon } from \"../../../Maths/math.constants\";\r\n\r\n/**\r\n * Conditions supported by the condition block\r\n */\r\nexport enum ConditionBlockTests {\r\n /** Equal */\r\n Equal,\r\n /** NotEqual */\r\n NotEqual,\r\n /** LessThan */\r\n LessThan,\r\n /** GreaterThan */\r\n GreaterThan,\r\n /** LessOrEqual */\r\n LessOrEqual,\r\n /** GreaterOrEqual */\r\n GreaterOrEqual,\r\n /** Logical Exclusive OR */\r\n Xor,\r\n /** Logical Or */\r\n Or,\r\n /** Logical And */\r\n And,\r\n}\r\n\r\n/**\r\n * Block used to evaluate a condition and return a true or false value\r\n */\r\nexport class ConditionBlock extends NodeGeometryBlock {\r\n /**\r\n * Gets or sets the test used by the block\r\n */\r\n @editableInPropertyPage(\"Test\", PropertyTypeForEdition.List, \"ADVANCED\", {\r\n notifiers: { rebuild: true },\r\n options: [\r\n { label: \"Equal\", value: ConditionBlockTests.Equal },\r\n { label: \"NotEqual\", value: ConditionBlockTests.NotEqual },\r\n { label: \"LessThan\", value: ConditionBlockTests.LessThan },\r\n { label: \"GreaterThan\", value: ConditionBlockTests.GreaterThan },\r\n { label: \"LessOrEqual\", value: ConditionBlockTests.LessOrEqual },\r\n { label: \"GreaterOrEqual\", value: ConditionBlockTests.GreaterOrEqual },\r\n { label: \"Xor\", value: ConditionBlockTests.Xor },\r\n { label: \"Or\", value: ConditionBlockTests.Or },\r\n { label: \"And\", value: ConditionBlockTests.And },\r\n ],\r\n })\r\n public test = ConditionBlockTests.Equal;\r\n\r\n /**\r\n * Create a new ConditionBlock\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.Float);\r\n this.registerInput(\"right\", NodeGeometryBlockConnectionPointTypes.Float, true, 0);\r\n this.registerInput(\"ifTrue\", NodeGeometryBlockConnectionPointTypes.AutoDetect, true, 1);\r\n this.registerInput(\"ifFalse\", NodeGeometryBlockConnectionPointTypes.AutoDetect, true, 0);\r\n\r\n this.registerOutput(\"output\", NodeGeometryBlockConnectionPointTypes.BasedOnInput);\r\n\r\n this._outputs[0]._typeConnectionSource = this._inputs[2];\r\n this._outputs[0]._defaultConnectionPointType = NodeGeometryBlockConnectionPointTypes.Float;\r\n this._inputs[0].acceptedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Int);\r\n this._inputs[1].acceptedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Int);\r\n this._linkConnectionTypes(2, 3);\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 \"ConditionBlock\";\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 ifTrue input component\r\n */\r\n public get ifTrue(): NodeGeometryConnectionPoint {\r\n return this._inputs[2];\r\n }\r\n\r\n /**\r\n * Gets the ifFalse input component\r\n */\r\n public get ifFalse(): NodeGeometryConnectionPoint {\r\n return this._inputs[3];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeGeometryConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected override _buildBlock() {\r\n if (!this.left.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 left = this.left.getConnectedValue(state) as number;\r\n const right = this.right.getConnectedValue(state) as number;\r\n let condition = false;\r\n\r\n switch (this.test) {\r\n case ConditionBlockTests.Equal:\r\n condition = WithinEpsilon(left, right, Epsilon);\r\n break;\r\n case ConditionBlockTests.NotEqual:\r\n condition = left !== right;\r\n break;\r\n case ConditionBlockTests.LessThan:\r\n condition = left < right;\r\n break;\r\n case ConditionBlockTests.GreaterThan:\r\n condition = left > right;\r\n break;\r\n case ConditionBlockTests.LessOrEqual:\r\n condition = left <= right;\r\n break;\r\n case ConditionBlockTests.GreaterOrEqual:\r\n condition = left >= right;\r\n break;\r\n case ConditionBlockTests.Xor:\r\n condition = (!!left && !right) || (!left && !!right);\r\n break;\r\n case ConditionBlockTests.Or:\r\n condition = !!left || !!right;\r\n break;\r\n case ConditionBlockTests.And:\r\n condition = !!left && !!right;\r\n break;\r\n }\r\n return condition;\r\n };\r\n\r\n this.output._storedFunction = (state) => {\r\n if (func(state)) {\r\n return this.ifTrue.getConnectedValue(state);\r\n }\r\n\r\n return this.ifFalse.getConnectedValue(state);\r\n };\r\n }\r\n\r\n protected override _dumpPropertiesCode() {\r\n const codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.test = BABYLON.ConditionBlockTests.${ConditionBlockTests[this.test]};\\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.test = this.test;\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.test = serializationObject.test;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.ConditionBlock\", ConditionBlock);\r\n"]}
1
+ {"version":3,"file":"conditionBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Meshes/Node/Blocks/conditionBlock.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,aAAa,EAAE,MAAM,sCAAsC,CAAC;AACrE,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAExD;;GAEG;AACH,MAAM,CAAN,IAAY,mBAmBX;AAnBD,WAAY,mBAAmB;IAC3B,YAAY;IACZ,+DAAK,CAAA;IACL,eAAe;IACf,qEAAQ,CAAA;IACR,eAAe;IACf,qEAAQ,CAAA;IACR,kBAAkB;IAClB,2EAAW,CAAA;IACX,kBAAkB;IAClB,2EAAW,CAAA;IACX,qBAAqB;IACrB,iFAAc,CAAA;IACd,2BAA2B;IAC3B,2DAAG,CAAA;IACH,iBAAiB;IACjB,yDAAE,CAAA;IACF,kBAAkB;IAClB,2DAAG,CAAA;AACP,CAAC,EAnBW,m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} 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 { WithinEpsilon } from \"../../../Maths/math.scalar.functions\";\r\nimport { Epsilon } from \"../../../Maths/math.constants\";\r\n\r\n/**\r\n * Conditions supported by the condition block\r\n */\r\nexport enum ConditionBlockTests {\r\n /** Equal */\r\n Equal,\r\n /** NotEqual */\r\n NotEqual,\r\n /** LessThan */\r\n LessThan,\r\n /** GreaterThan */\r\n GreaterThan,\r\n /** LessOrEqual */\r\n LessOrEqual,\r\n /** GreaterOrEqual */\r\n GreaterOrEqual,\r\n /** Logical Exclusive OR */\r\n Xor,\r\n /** Logical Or */\r\n Or,\r\n /** Logical And */\r\n And,\r\n}\r\n\r\n/**\r\n * Block used to evaluate a condition and return a true or false value\r\n */\r\nexport class ConditionBlock extends NodeGeometryBlock {\r\n /**\r\n * Gets or sets the test used by the block\r\n */\r\n @editableInPropertyPage(\"Test\", PropertyTypeForEdition.List, \"ADVANCED\", {\r\n notifiers: { rebuild: true },\r\n embedded: true,\r\n options: [\r\n { label: \"Equal\", value: ConditionBlockTests.Equal },\r\n { label: \"NotEqual\", value: ConditionBlockTests.NotEqual },\r\n { label: \"LessThan\", value: ConditionBlockTests.LessThan },\r\n { label: \"GreaterThan\", value: ConditionBlockTests.GreaterThan },\r\n { label: \"LessOrEqual\", value: ConditionBlockTests.LessOrEqual },\r\n { label: \"GreaterOrEqual\", value: ConditionBlockTests.GreaterOrEqual },\r\n { label: \"Xor\", value: ConditionBlockTests.Xor },\r\n { label: \"Or\", value: ConditionBlockTests.Or },\r\n { label: \"And\", value: ConditionBlockTests.And },\r\n ],\r\n })\r\n public test = ConditionBlockTests.Equal;\r\n\r\n /**\r\n * Create a new ConditionBlock\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.Float);\r\n this.registerInput(\"right\", NodeGeometryBlockConnectionPointTypes.Float, true, 0);\r\n this.registerInput(\"ifTrue\", NodeGeometryBlockConnectionPointTypes.AutoDetect, true, 1);\r\n this.registerInput(\"ifFalse\", NodeGeometryBlockConnectionPointTypes.AutoDetect, true, 0);\r\n\r\n this.registerOutput(\"output\", NodeGeometryBlockConnectionPointTypes.BasedOnInput);\r\n\r\n this._outputs[0]._typeConnectionSource = this._inputs[2];\r\n this._outputs[0]._defaultConnectionPointType = NodeGeometryBlockConnectionPointTypes.Float;\r\n this._inputs[0].acceptedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Int);\r\n this._inputs[1].acceptedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Int);\r\n this._linkConnectionTypes(2, 3);\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 \"ConditionBlock\";\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 ifTrue input component\r\n */\r\n public get ifTrue(): NodeGeometryConnectionPoint {\r\n return this._inputs[2];\r\n }\r\n\r\n /**\r\n * Gets the ifFalse input component\r\n */\r\n public get ifFalse(): NodeGeometryConnectionPoint {\r\n return this._inputs[3];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeGeometryConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected override _buildBlock() {\r\n if (!this.left.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 left = this.left.getConnectedValue(state) as number;\r\n const right = this.right.getConnectedValue(state) as number;\r\n let condition = false;\r\n\r\n switch (this.test) {\r\n case ConditionBlockTests.Equal:\r\n condition = WithinEpsilon(left, right, Epsilon);\r\n break;\r\n case ConditionBlockTests.NotEqual:\r\n condition = left !== right;\r\n break;\r\n case ConditionBlockTests.LessThan:\r\n condition = left < right;\r\n break;\r\n case ConditionBlockTests.GreaterThan:\r\n condition = left > right;\r\n break;\r\n case ConditionBlockTests.LessOrEqual:\r\n condition = left <= right;\r\n break;\r\n case ConditionBlockTests.GreaterOrEqual:\r\n condition = left >= right;\r\n break;\r\n case ConditionBlockTests.Xor:\r\n condition = (!!left && !right) || (!left && !!right);\r\n break;\r\n case ConditionBlockTests.Or:\r\n condition = !!left || !!right;\r\n break;\r\n case ConditionBlockTests.And:\r\n condition = !!left && !!right;\r\n break;\r\n }\r\n return condition;\r\n };\r\n\r\n this.output._storedFunction = (state) => {\r\n if (func(state)) {\r\n return this.ifTrue.getConnectedValue(state);\r\n }\r\n\r\n return this.ifFalse.getConnectedValue(state);\r\n };\r\n }\r\n\r\n protected override _dumpPropertiesCode() {\r\n const codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.test = BABYLON.ConditionBlockTests.${ConditionBlockTests[this.test]};\\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.test = this.test;\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.test = serializationObject.test;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.ConditionBlock\", ConditionBlock);\r\n"]}
@@ -108,10 +108,10 @@ export class GeometryClampBlock extends NodeGeometryBlock {
108
108
  }
109
109
  }
110
110
  __decorate([
111
- editableInPropertyPage("Minimum", 1 /* PropertyTypeForEdition.Float */)
111
+ editableInPropertyPage("Minimum", 1 /* PropertyTypeForEdition.Float */, undefined, { embedded: true })
112
112
  ], GeometryClampBlock.prototype, "minimum", void 0);
113
113
  __decorate([
114
- editableInPropertyPage("Maximum", 1 /* PropertyTypeForEdition.Float */)
114
+ editableInPropertyPage("Maximum", 1 /* PropertyTypeForEdition.Float */, undefined, { embedded: true })
115
115
  ], GeometryClampBlock.prototype, "maximum", void 0);
116
116
  RegisterClass("BABYLON.GeometryClampBlock", GeometryClampBlock);
117
117
  //# sourceMappingURL=geometryClampBlock.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"geometryClampBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Meshes/Node/Blocks/geometryClampBlock.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,sBAAsB,EAA0B,MAAM,mCAAmC,CAAC;AACnG,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,qCAAqC,EAAE,MAAM,2CAA2C,CAAC;AAElG,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,sCAA+B;AAEnE;;GAEG;AACH,MAAM,OAAO,kBAAmB,SAAQ,iBAAiB;IAQrD;;;OAGG;IACH,YAAmB,IAAY;QAC3B,KAAK,CAAC,IAAI,CAAC,CAAC;QAZhB,qCAAqC;QAE9B,YAAO,GAAG,GAAG,CAAC;QACrB,qCAAqC;QAE9B,YAAO,GAAG,GAAG,CAAC;QASjB,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,qCAAqC,CAAC,UAAU,CAAC,CAAC;QAC9E,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE,qCAAqC,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;QAC7E,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE,qCAA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C;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"]}
1
+ {"version":3,"file":"geometryClampBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Meshes/Node/Blocks/geometryClampBlock.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,sBAAsB,EAA0B,MAAM,mCAAmC,CAAC;AACnG,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,qCAAqC,EAAE,MAAM,2CAA2C,CAAC;AAElG,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,sCAA+B;AAEnE;;GAEG;AACH,MAAM,OAAO,kBAAmB,SAAQ,iBAAiB;IAQrD;;;OAGG;IACH,YAAmB,IAAY;QAC3B,KAAK,CAAC,IAAI,CAAC,CAAC;QAZhB,qCAAqC;QAE9B,YAAO,GAAG,GAAG,CAAC;QACrB,qCAAqC;QAE9B,YAAO,GAAG,GAAG,CAAC;QASjB,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,qCAAqC,CAAC,UAAU,CAAC,CAAC;QAC9E,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE,qCAAqC,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;QAC7E,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE,qCAAqC,CAAC,KAAK,EAAE,IAAI,C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IADN,sBAAsB,CAAC,SAAS,wCAAgC,SAAS,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;mDAC1E;AAGd;IADN,sBAAsB,CAAC,SAAS,wCAAgC,SAAS,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;mDAC1E;AAqHzB,aAAa,CAAC,4BAA4B,EAAE,kBAAkB,CAAC,CAAC","sourcesContent":["import { RegisterClass } from \"../../../Misc/typeStore\";\r\nimport { editableInPropertyPage, PropertyTypeForEdition } from \"../../../Decorators/nodeDecorator\";\r\nimport { NodeGeometryBlock } from \"../nodeGeometryBlock\";\r\nimport { NodeGeometryBlockConnectionPointTypes } from \"../Enums/nodeGeometryConnectionPointTypes\";\r\nimport type { NodeGeometryConnectionPoint } from \"../nodeGeometryBlockConnectionPoint\";\r\nimport { Vector2, Vector3, Vector4 } from \"core/Maths/math.vector\";\r\n\r\n/**\r\n * Block used to clamp a float\r\n */\r\nexport class GeometryClampBlock extends NodeGeometryBlock {\r\n /** Gets or sets the minimum range */\r\n @editableInPropertyPage(\"Minimum\", PropertyTypeForEdition.Float, undefined, { embedded: true })\r\n public minimum = 0.0;\r\n /** Gets or sets the maximum range */\r\n @editableInPropertyPage(\"Maximum\", PropertyTypeForEdition.Float, undefined, { embedded: true })\r\n public maximum = 1.0;\r\n\r\n /**\r\n * Creates a new GeometryClampBlock\r\n * @param name defines the block name\r\n */\r\n public constructor(name: string) {\r\n super(name);\r\n\r\n this.registerInput(\"value\", NodeGeometryBlockConnectionPointTypes.AutoDetect);\r\n this.registerInput(\"min\", NodeGeometryBlockConnectionPointTypes.Float, true);\r\n this.registerInput(\"max\", NodeGeometryBlockConnectionPointTypes.Float, true);\r\n this.registerOutput(\"output\", NodeGeometryBlockConnectionPointTypes.BasedOnInput);\r\n\r\n this._outputs[0]._typeConnectionSource = this._inputs[0];\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Matrix);\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Geometry);\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Texture);\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public override getClassName() {\r\n return \"GeometryClampBlock\";\r\n }\r\n\r\n /**\r\n * Gets the value input component\r\n */\r\n public get value(): NodeGeometryConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the min input component\r\n */\r\n public get min(): NodeGeometryConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the max input component\r\n */\r\n public get max(): NodeGeometryConnectionPoint {\r\n return this._inputs[2];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeGeometryConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected override _buildBlock() {\r\n if (!this.value.isConnected) {\r\n this.output._storedFunction = null;\r\n this.output._storedValue = null;\r\n return;\r\n }\r\n\r\n const func = (value: number, min: number, max: number) => {\r\n return Math.max(min, Math.min(value, max));\r\n };\r\n\r\n this.output._storedFunction = (state) => {\r\n const value = this.value.getConnectedValue(state);\r\n const min = this.min.isConnected ? this.min.getConnectedValue(state) : this.minimum;\r\n const max = this.max.isConnected ? this.max.getConnectedValue(state) : this.maximum;\r\n\r\n switch (this.value.type) {\r\n case NodeGeometryBlockConnectionPointTypes.Int:\r\n case NodeGeometryBlockConnectionPointTypes.Float: {\r\n return func!(value, min, max);\r\n }\r\n case NodeGeometryBlockConnectionPointTypes.Vector2: {\r\n return new Vector2(func!(value.x, min, max), func!(value.y, min, max));\r\n }\r\n case NodeGeometryBlockConnectionPointTypes.Vector3: {\r\n return new Vector3(func!(value.x, min, max), func!(value.y, min, max), func!(value.z, min, max));\r\n }\r\n case NodeGeometryBlockConnectionPointTypes.Vector4: {\r\n return new Vector4(func!(value.x, min, max), func!(value.y, min, max), func!(value.z, min, max), func!(value.w, min, max));\r\n }\r\n }\r\n\r\n return 0;\r\n };\r\n\r\n return this;\r\n }\r\n\r\n protected override _dumpPropertiesCode() {\r\n let codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.minimum = ${this.minimum};\\n`;\r\n codeString += `${this._codeVariableName}.maximum = ${this.maximum};\\n`;\r\n return codeString;\r\n }\r\n\r\n public override serialize(): any {\r\n const serializationObject = super.serialize();\r\n\r\n serializationObject.minimum = this.minimum;\r\n serializationObject.maximum = this.maximum;\r\n\r\n return serializationObject;\r\n }\r\n\r\n public override _deserialize(serializationObject: any) {\r\n super._deserialize(serializationObject);\r\n\r\n this.minimum = serializationObject.minimum;\r\n this.maximum = serializationObject.maximum;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.GeometryClampBlock\", GeometryClampBlock);\r\n"]}
@@ -161,7 +161,7 @@ export class GeometryCollectionBlock extends NodeGeometryBlock {
161
161
  }
162
162
  }
163
163
  __decorate([
164
- editableInPropertyPage("Evaluate context", 0 /* PropertyTypeForEdition.Boolean */, "ADVANCED", { notifiers: { rebuild: true } })
164
+ editableInPropertyPage("Evaluate context", 0 /* PropertyTypeForEdition.Boolean */, "ADVANCED", { embedded: true, notifiers: { rebuild: true } })
165
165
  ], GeometryCollectionBlock.prototype, "evaluateContext", void 0);
166
166
  RegisterClass("BABYLON.GeometryCollectionBlock", GeometryCollectionBlock);
167
167
  //# sourceMappingURL=geometryCollectionBlock.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"geometryCollectionBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Meshes/Node/Blocks/geometryCollectionBlock.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,M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AAC;CACJ;AA9KU;IADN,sBAAsB,CAAC,kBAAkB,0CAAkC,UAAU,EAAE,EAAE,SAAS,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,CAAC;gEAC3F;AAgLlC,aAAa,CAAC,iCAAiC,EAAE,uBAAuB,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\n\r\n/**\r\n * Block used to randomly pick a geometry from a collection\r\n */\r\nexport class GeometryCollectionBlock 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 = true;\r\n\r\n /**\r\n * Create a new GeometryCollectionBlock\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, true);\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 this.registerInput(\"geometry5\", NodeGeometryBlockConnectionPointTypes.Geometry, true);\r\n this.registerInput(\"geometry6\", NodeGeometryBlockConnectionPointTypes.Geometry, true);\r\n this.registerInput(\"geometry7\", NodeGeometryBlockConnectionPointTypes.Geometry, true);\r\n this.registerInput(\"geometry8\", NodeGeometryBlockConnectionPointTypes.Geometry, true);\r\n this.registerInput(\"geometry9\", NodeGeometryBlockConnectionPointTypes.Geometry, true);\r\n\r\n this.registerOutput(\"output\", NodeGeometryBlockConnectionPointTypes.Geometry);\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 \"GeometryCollectionBlock\";\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 geometry5 input component\r\n */\r\n public get geometry5(): NodeGeometryConnectionPoint {\r\n return this._inputs[5];\r\n }\r\n\r\n /**\r\n * Gets the geometry6 input component\r\n */\r\n public get geometry6(): NodeGeometryConnectionPoint {\r\n return this._inputs[6];\r\n }\r\n\r\n /**\r\n * Gets the geometry7 input component\r\n */\r\n public get geometry7(): NodeGeometryConnectionPoint {\r\n return this._inputs[7];\r\n }\r\n\r\n /**\r\n * Gets the geometry8 input component\r\n */\r\n public get geometry8(): NodeGeometryConnectionPoint {\r\n return this._inputs[8];\r\n }\r\n\r\n /**\r\n * Gets the geometry9 input component\r\n */\r\n public get geometry9(): NodeGeometryConnectionPoint {\r\n return this._inputs[9];\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 private _storeGeometry(input: NodeGeometryConnectionPoint, state: NodeGeometryBuildState, index: number, availables: VertexData[]) {\r\n if (input.isConnected) {\r\n const vertexData = input.getConnectedValue(state) as VertexData;\r\n if (!vertexData) {\r\n return;\r\n }\r\n vertexData.metadata = vertexData.metadata || {};\r\n vertexData.metadata.collectionId = index;\r\n availables.push(vertexData);\r\n }\r\n }\r\n\r\n protected override _buildBlock(state: NodeGeometryBuildState) {\r\n const func = (state: NodeGeometryBuildState) => {\r\n const availables: VertexData[] = [];\r\n\r\n this._storeGeometry(this.geometry0, state, 0, availables);\r\n this._storeGeometry(this.geometry1, state, 1, availables);\r\n this._storeGeometry(this.geometry2, state, 2, availables);\r\n this._storeGeometry(this.geometry3, state, 3, availables);\r\n this._storeGeometry(this.geometry4, state, 4, availables);\r\n this._storeGeometry(this.geometry5, state, 5, availables);\r\n this._storeGeometry(this.geometry6, state, 6, availables);\r\n this._storeGeometry(this.geometry7, state, 7, availables);\r\n this._storeGeometry(this.geometry8, state, 8, availables);\r\n this._storeGeometry(this.geometry9, state, 9, availables);\r\n\r\n if (!availables.length) {\r\n return null;\r\n }\r\n return availables[Math.round(Math.random() * (availables.length - 1))];\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.GeometryCollectionBlock\", GeometryCollectionBlock);\r\n"]}
1
+ {"version":3,"file":"geometryCollectionBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Meshes/Node/Blocks/geometryCollectionBlock.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,uBAAwB,SAAQ,iBAAiB;IAQ1D;;;OAGG;IACH,YAAmB,IAAY;QAC3B,KAAK,CAAC,IAAI,CAAC,CAAC;QAZhB;;;WAGG;QAEI,oBAAe,GAAG,IAAI,CAAC;QAS1B,IAAI,CAAC,aAAa,CAAC,WAAW,EAAE,qCAAqC,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;QACtF,IAAI,CAAC,aAAa,CAAC,WAAW,EAAE,qCAAqC,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;QACtF,IAAI,CAAC,aAAa,CAAC,WAAW,EAAE,qCAAqC,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;QACtF,IAAI,CAAC,aAAa,CAAC,WAAW,EAAE,qCAAqC,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;QACtF,IAAI,CAAC,aAAa,CAAC,WAAW,EAAE,qCAAqC,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;QACtF,IAAI,CAAC,aAAa,CAAC,WAA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YAAY,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC;SAC1C;IACL,CAAC;IAEkB,mBAAmB;QAClC,MAAM,UAAU,GAAG,KAAK,CAAC,mBAAmB,EAAE,GAAG,GAAG,IAAI,CAAC,iBAAiB,sBAAsB,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,KAAK,CAAC;QAC7I,OAAO,UAAU,CAAC;IACtB,CAAC;IAED;;;OAGG;IACa,SAAS;QACrB,MAAM,mBAAmB,GAAG,KAAK,CAAC,SAAS,EAAE,CAAC;QAE9C,mBAAmB,CAAC,eAAe,GAAG,IAAI,CAAC,eAAe,CAAC;QAE3D,OAAO,mBAAmB,CAAC;IAC/B,CAAC;IAEe,YAAY,CAAC,mBAAwB;QACjD,KAAK,CAAC,YAAY,CAAC,mBAAmB,CAAC,CAAC;QAExC,IAAI,CAAC,eAAe,GAAG,mBAAmB,CAAC,eAAe,CAAC;IAC/D,CAAC;CACJ;AA9KU;IADN,sBAAsB,CAAC,kBAAkB,0CAAkC,UAAU,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,CAAC;gEAC3G;AAgLlC,aAAa,CAAC,iCAAiC,EAAE,uBAAuB,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\n\r\n/**\r\n * Block used to randomly pick a geometry from a collection\r\n */\r\nexport class GeometryCollectionBlock 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 = true;\r\n\r\n /**\r\n * Create a new GeometryCollectionBlock\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, true);\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 this.registerInput(\"geometry5\", NodeGeometryBlockConnectionPointTypes.Geometry, true);\r\n this.registerInput(\"geometry6\", NodeGeometryBlockConnectionPointTypes.Geometry, true);\r\n this.registerInput(\"geometry7\", NodeGeometryBlockConnectionPointTypes.Geometry, true);\r\n this.registerInput(\"geometry8\", NodeGeometryBlockConnectionPointTypes.Geometry, true);\r\n this.registerInput(\"geometry9\", NodeGeometryBlockConnectionPointTypes.Geometry, true);\r\n\r\n this.registerOutput(\"output\", NodeGeometryBlockConnectionPointTypes.Geometry);\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 \"GeometryCollectionBlock\";\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 geometry5 input component\r\n */\r\n public get geometry5(): NodeGeometryConnectionPoint {\r\n return this._inputs[5];\r\n }\r\n\r\n /**\r\n * Gets the geometry6 input component\r\n */\r\n public get geometry6(): NodeGeometryConnectionPoint {\r\n return this._inputs[6];\r\n }\r\n\r\n /**\r\n * Gets the geometry7 input component\r\n */\r\n public get geometry7(): NodeGeometryConnectionPoint {\r\n return this._inputs[7];\r\n }\r\n\r\n /**\r\n * Gets the geometry8 input component\r\n */\r\n public get geometry8(): NodeGeometryConnectionPoint {\r\n return this._inputs[8];\r\n }\r\n\r\n /**\r\n * Gets the geometry9 input component\r\n */\r\n public get geometry9(): NodeGeometryConnectionPoint {\r\n return this._inputs[9];\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 private _storeGeometry(input: NodeGeometryConnectionPoint, state: NodeGeometryBuildState, index: number, availables: VertexData[]) {\r\n if (input.isConnected) {\r\n const vertexData = input.getConnectedValue(state) as VertexData;\r\n if (!vertexData) {\r\n return;\r\n }\r\n vertexData.metadata = vertexData.metadata || {};\r\n vertexData.metadata.collectionId = index;\r\n availables.push(vertexData);\r\n }\r\n }\r\n\r\n protected override _buildBlock(state: NodeGeometryBuildState) {\r\n const func = (state: NodeGeometryBuildState) => {\r\n const availables: VertexData[] = [];\r\n\r\n this._storeGeometry(this.geometry0, state, 0, availables);\r\n this._storeGeometry(this.geometry1, state, 1, availables);\r\n this._storeGeometry(this.geometry2, state, 2, availables);\r\n this._storeGeometry(this.geometry3, state, 3, availables);\r\n this._storeGeometry(this.geometry4, state, 4, availables);\r\n this._storeGeometry(this.geometry5, state, 5, availables);\r\n this._storeGeometry(this.geometry6, state, 6, availables);\r\n this._storeGeometry(this.geometry7, state, 7, availables);\r\n this._storeGeometry(this.geometry8, state, 8, availables);\r\n this._storeGeometry(this.geometry9, state, 9, availables);\r\n\r\n if (!availables.length) {\r\n return null;\r\n }\r\n return availables[Math.round(Math.random() * (availables.length - 1))];\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.GeometryCollectionBlock\", GeometryCollectionBlock);\r\n"]}
@@ -257,6 +257,7 @@ export class GeometryCurveBlock extends NodeGeometryBlock {
257
257
  __decorate([
258
258
  editableInPropertyPage("Type", 4 /* PropertyTypeForEdition.List */, "ADVANCED", {
259
259
  notifiers: { rebuild: true },
260
+ embedded: true,
260
261
  options: [
261
262
  { label: "EaseInSine", value: GeometryCurveBlockTypes.EaseInSine },
262
263
  { label: "EaseOutSine", value: GeometryCurveBlockTypes.EaseOutSine },
@@ -1 +1 @@
1
- {"version":3,"file":"geometryCurveBlock.js","sourceRoot":"","sources":["../../../../../../d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,uBAAuB,CAAC,aAAa,EAAE;YACxE,EAAE,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,uBAAuB,CAAC,UAAU,EAAE;YAClE,EAAE,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,uBAAuB,CAAC,WAAW,EAAE;YACpE,EAAE,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE,uBAAuB,CAAC,aAAa,EAAE;YACxE,EAAE,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE,uBAAuB,CAAC,aAAa,EAAE;YACxE,EAAE,KAAK,EAAE,gBAAgB,EAAE,KAAK,EAAE,uBAAuB,CAAC,cAAc,EAAE;YAC1E,EAAE,KAAK,EAAE,kBAAkB,EAAE,KAAK,EAAE,uBAAuB,CAAC,gBAAgB,EAAE;SACjF;KACJ,CAAC;gDACkD;AA8MxD,aAAa,CAAC,4BAA4B,EAAE,kBAAkB,CAAC,CAAC","sourcesContent":["import { RegisterClass } from \"../../../Misc/typeStore\";\r\nimport { NodeGeometryBlock } from \"../nodeGeometryBlock\";\r\nimport { NodeGeometryBlockConnectionPointTypes } from \"../Enums/nodeGeometryConnectionPointTypes\";\r\nimport type { NodeGeometryConnectionPoint } from \"../nodeGeometryBlockConnectionPoint\";\r\nimport type { float } from \"core/types\";\r\nimport { Vector2, Vector3, Vector4 } from \"core/Maths/math.vector\";\r\nimport { PropertyTypeForEdition, editableInPropertyPage } from \"core/Decorators/nodeDecorator\";\r\n\r\n/**\r\n * Types of curves supported by the Curve block\r\n */\r\nexport enum GeometryCurveBlockTypes {\r\n /** EaseInSine */\r\n EaseInSine,\r\n /** EaseOutSine */\r\n EaseOutSine,\r\n /** EaseInOutSine */\r\n EaseInOutSine,\r\n /** EaseInQuad */\r\n EaseInQuad,\r\n /** EaseOutQuad */\r\n EaseOutQuad,\r\n /** EaseInOutQuad */\r\n EaseInOutQuad,\r\n /** EaseInCubic */\r\n EaseInCubic,\r\n /** EaseOutCubic */\r\n EaseOutCubic,\r\n /** EaseInOutCubic */\r\n EaseInOutCubic,\r\n /** EaseInQuart */\r\n EaseInQuart,\r\n /** EaseOutQuart */\r\n EaseOutQuart,\r\n /** EaseInOutQuart */\r\n EaseInOutQuart,\r\n /** EaseInQuint */\r\n EaseInQuint,\r\n /** EaseOutQuint */\r\n EaseOutQuint,\r\n /** EaseInOutQuint */\r\n EaseInOutQuint,\r\n /** EaseInExpo */\r\n EaseInExpo,\r\n /** EaseOutExpo */\r\n EaseOutExpo,\r\n /** EaseInOutExpo */\r\n EaseInOutExpo,\r\n /** EaseInCirc */\r\n EaseInCirc,\r\n /** EaseOutCirc */\r\n EaseOutCirc,\r\n /** EaseInOutCirc */\r\n EaseInOutCirc,\r\n /** EaseInBack */\r\n EaseInBack,\r\n /** EaseOutBack */\r\n EaseOutBack,\r\n /** EaseInOutBack */\r\n EaseInOutBack,\r\n /** EaseInElastic */\r\n EaseInElastic,\r\n /** EaseOutElastic */\r\n EaseOutElastic,\r\n /** EaseInOutElastic */\r\n EaseInOutElastic,\r\n}\r\n\r\n/**\r\n * Block used to apply curve operation\r\n */\r\nexport class GeometryCurveBlock extends NodeGeometryBlock {\r\n /**\r\n * Gets or sets the type of the curve applied by the block\r\n */\r\n @editableInPropertyPage(\"Type\", PropertyTypeForEdition.List, \"ADVANCED\", {\r\n notifiers: { rebuild: true },\r\n options: [\r\n { label: \"EaseInSine\", value: GeometryCurveBlockTypes.EaseInSine },\r\n { label: \"EaseOutSine\", value: GeometryCurveBlockTypes.EaseOutSine },\r\n { label: \"EaseInOutSine\", value: GeometryCurveBlockTypes.EaseInOutSine },\r\n { label: \"EaseInQuad\", value: GeometryCurveBlockTypes.EaseInQuad },\r\n { label: \"EaseOutQuad\", value: GeometryCurveBlockTypes.EaseOutQuad },\r\n { label: \"EaseInOutQuad\", value: GeometryCurveBlockTypes.EaseInOutQuad },\r\n { label: \"EaseInCubic\", value: GeometryCurveBlockTypes.EaseInCubic },\r\n { label: \"EaseOutCubic\", value: GeometryCurveBlockTypes.EaseOutCubic },\r\n { label: \"EaseInOutCubic\", value: GeometryCurveBlockTypes.EaseInOutCubic },\r\n { label: \"EaseInQuart\", value: GeometryCurveBlockTypes.EaseInQuart },\r\n { label: \"EaseOutQuart\", value: GeometryCurveBlockTypes.EaseOutQuart },\r\n { label: \"EaseInOutQuart\", value: GeometryCurveBlockTypes.EaseInOutQuart },\r\n { label: \"EaseInQuint\", value: GeometryCurveBlockTypes.EaseInQuint },\r\n { label: \"EaseOutQuint\", value: GeometryCurveBlockTypes.EaseOutQuint },\r\n { label: \"EaseInOutQuint\", value: GeometryCurveBlockTypes.EaseInOutQuint },\r\n { label: \"EaseInExpo\", value: GeometryCurveBlockTypes.EaseInExpo },\r\n { label: \"EaseOutExpo\", value: GeometryCurveBlockTypes.EaseOutExpo },\r\n { label: \"EaseInOutExpo\", value: GeometryCurveBlockTypes.EaseInOutExpo },\r\n { label: \"EaseInCirc\", value: GeometryCurveBlockTypes.EaseInCirc },\r\n { label: \"EaseOutCirc\", value: GeometryCurveBlockTypes.EaseOutCirc },\r\n { label: \"EaseInOutCirc\", value: GeometryCurveBlockTypes.EaseInOutCirc },\r\n { label: \"EaseInBack\", value: GeometryCurveBlockTypes.EaseInBack },\r\n { label: \"EaseOutBack\", value: GeometryCurveBlockTypes.EaseOutBack },\r\n { label: \"EaseInOutBack\", value: GeometryCurveBlockTypes.EaseInOutBack },\r\n { label: \"EaseInElastic\", value: GeometryCurveBlockTypes.EaseInElastic },\r\n { label: \"EaseOutElastic\", value: GeometryCurveBlockTypes.EaseOutElastic },\r\n { label: \"EaseInOutElastic\", value: GeometryCurveBlockTypes.EaseInOutElastic },\r\n ],\r\n })\r\n public type = GeometryCurveBlockTypes.EaseInOutSine;\r\n\r\n /**\r\n * Creates a new CurveBlock\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 this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Matrix);\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Int);\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public override getClassName() {\r\n return \"GeometryCurveBlock\";\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() {\r\n if (!this.input.isConnected) {\r\n this.output._storedFunction = null;\r\n this.output._storedValue = null;\r\n return;\r\n }\r\n\r\n let func: (v: float) => any;\r\n\r\n switch (this.type) {\r\n case GeometryCurveBlockTypes.EaseInSine:\r\n func = (v: float) => 1.0 - Math.cos((v * 3.1415) / 2.0);\r\n break;\r\n case GeometryCurveBlockTypes.EaseOutSine:\r\n func = (v: float) => Math.sin((v * 3.1415) / 2.0);\r\n break;\r\n case GeometryCurveBlockTypes.EaseInOutSine:\r\n func = (v: float) => -(Math.cos(v * 3.1415) - 1.0) / 2.0;\r\n break;\r\n case GeometryCurveBlockTypes.EaseInQuad:\r\n func = (v: float) => v * v;\r\n break;\r\n case GeometryCurveBlockTypes.EaseOutQuad:\r\n func = (v: float) => (1.0 - v) * (1.0 - v);\r\n break;\r\n case GeometryCurveBlockTypes.EaseInOutQuad: {\r\n func = (v: float) => (v < 0.5 ? 2.0 * v * v : 1.0 - Math.pow(-2.0 * v + 2.0, 2.0) / 2.0);\r\n break;\r\n }\r\n case GeometryCurveBlockTypes.EaseInCubic:\r\n func = (v: float) => v * v * v;\r\n break;\r\n case GeometryCurveBlockTypes.EaseOutCubic: {\r\n func = (v: float) => 1.0 - Math.pow(1.0 - v, 3.0);\r\n break;\r\n }\r\n case GeometryCurveBlockTypes.EaseInOutCubic: {\r\n func = (v: float) => (v < 0.5 ? 4.0 * v * v * v : 1.0 - Math.pow(-2.0 * v + 2.0, 3.0) / 2.0);\r\n break;\r\n }\r\n case GeometryCurveBlockTypes.EaseInQuart:\r\n func = (v: float) => v * v * v * v;\r\n break;\r\n case GeometryCurveBlockTypes.EaseOutQuart: {\r\n func = (v: float) => 1.0 - Math.pow(1.0 - v, 4.0);\r\n break;\r\n }\r\n case GeometryCurveBlockTypes.EaseInOutQuart: {\r\n func = (v: float) => (v < 0.5 ? 8.0 * v * v * v * v : 1.0 - Math.pow(-2.0 * v + 2.0, 4.0) / 2.0);\r\n break;\r\n }\r\n case GeometryCurveBlockTypes.EaseInQuint:\r\n func = (v: float) => v * v * v * v * v;\r\n break;\r\n case GeometryCurveBlockTypes.EaseOutQuint: {\r\n func = (v: float) => 1.0 - Math.pow(1.0 - v, 5.0);\r\n break;\r\n }\r\n case GeometryCurveBlockTypes.EaseInOutQuint: {\r\n func = (v: float) => (v < 0.5 ? 16.0 * v * v * v * v * v : 1.0 - Math.pow(-2.0 * v + 2.0, 5.0) / 2.0);\r\n break;\r\n }\r\n case GeometryCurveBlockTypes.EaseInExpo: {\r\n func = (v: float) => (v === 0.0 ? 0.0 : Math.pow(2.0, 10.0 * v - 10.0));\r\n break;\r\n }\r\n case GeometryCurveBlockTypes.EaseOutExpo: {\r\n func = (v: float) => (v === 1.0 ? 1.0 : 1.0 - Math.pow(2.0, -10.0 * v));\r\n break;\r\n }\r\n case GeometryCurveBlockTypes.EaseInOutExpo: {\r\n func = (v: float) => (v === 0.0 ? 0.0 : v === 1.0 ? 1.0 : v < 0.5 ? Math.pow(2.0, 20.0 * v - 10.0) / 2.0 : (2.0 - Math.pow(2.0, -20.0 * v + 10.0)) / 2.0);\r\n break;\r\n }\r\n case GeometryCurveBlockTypes.EaseInCirc: {\r\n func = (v: float) => 1.0 - Math.sqrt(1.0 - Math.pow(v, 2.0));\r\n break;\r\n }\r\n case GeometryCurveBlockTypes.EaseOutCirc: {\r\n func = (v: float) => Math.sqrt(1.0 - Math.pow(v - 1.0, 2.0));\r\n break;\r\n }\r\n case GeometryCurveBlockTypes.EaseInOutCirc: {\r\n func = (v: float) => (v < 0.5 ? (1.0 - Math.sqrt(1.0 - Math.pow(2.0 * v, 2.0))) / 2.0 : (Math.sqrt(1.0 - Math.pow(-2.0 * v + 2.0, 2.0)) + 1.0) / 2.0);\r\n break;\r\n }\r\n case GeometryCurveBlockTypes.EaseInBack: {\r\n func = (v: float) => 2.70158 * v * v * v - 1.70158 * v * v;\r\n break;\r\n }\r\n case GeometryCurveBlockTypes.EaseOutBack: {\r\n func = (v: float) => 2.70158 * Math.pow(v - 1.0, 3.0) + 1.70158 * Math.pow(v - 1.0, 2.0);\r\n break;\r\n }\r\n case GeometryCurveBlockTypes.EaseInOutBack: {\r\n func = (v: float) =>\r\n v < 0.5\r\n ? (Math.pow(2.0 * v, 2.0) * (3.5949095 * 2.0 * v - 2.5949095)) / 2.0\r\n : (Math.pow(2.0 * v - 2.0, 2.0) * (3.5949095 * (v * 2.0 - 2.0) + 3.5949095) + 2.0) / 2.0;\r\n break;\r\n }\r\n case GeometryCurveBlockTypes.EaseInElastic: {\r\n func = (v: float) => (v === 0.0 ? 0.0 : v === 1.0 ? 1.0 : -Math.pow(2.0, 10.0 * v - 10.0) * Math.sin((v * 10.0 - 10.75) * ((2.0 * 3.1415) / 3.0)));\r\n break;\r\n }\r\n case GeometryCurveBlockTypes.EaseOutElastic: {\r\n func = (v: float) => (v === 0.0 ? 0.0 : v === 1.0 ? 1.0 : Math.pow(2.0, -10.0 * v) * Math.sin((v * 10.0 - 0.75) * ((2.0 * 3.1415) / 3.0)) + 1.0);\r\n break;\r\n }\r\n case GeometryCurveBlockTypes.EaseInOutElastic: {\r\n func = (v: float) =>\r\n v === 0.0\r\n ? 0.0\r\n : v == 1.0\r\n ? 1.0\r\n : v < 0.5\r\n ? -(Math.pow(2.0, 20.0 * v - 10.0) * Math.sin((20.0 * v - 11.125) * ((2.0 * 3.1415) / 4.5))) / 2.0\r\n : (Math.pow(2.0, -20.0 * v + 10.0) * Math.sin((20.0 * v - 11.125) * ((2.0 * 3.1415) / 4.5))) / 2.0 + 1.0;\r\n break;\r\n }\r\n }\r\n\r\n this.output._storedFunction = (state) => {\r\n const input = this.input.getConnectedValue(state);\r\n\r\n switch (this.input.type) {\r\n case NodeGeometryBlockConnectionPointTypes.Float: {\r\n return func(input);\r\n }\r\n case NodeGeometryBlockConnectionPointTypes.Vector2: {\r\n return new Vector2(func(input.x), func(input.y));\r\n }\r\n case NodeGeometryBlockConnectionPointTypes.Vector3: {\r\n return new Vector3(func(input.x), func(input.y), func(input.z));\r\n }\r\n case NodeGeometryBlockConnectionPointTypes.Vector4: {\r\n return new Vector4(func(input.x), func(input.y), func(input.z), func(input.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 public override serialize(): any {\r\n const serializationObject = super.serialize();\r\n\r\n serializationObject.curveType = this.type;\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.curveType;\r\n }\r\n\r\n protected override _dumpPropertiesCode() {\r\n const codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.type = BABYLON.GeometryCurveBlockTypes.${GeometryCurveBlockTypes[this.type]};\\n`;\r\n return codeString;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.GeometryCurveBlock\", GeometryCurveBlock);\r\n"]}
1
+ {"version":3,"file":"geometryCurveBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Meshes/Node/Blocks/geometryCurveBlock.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,qCAAqC,EAAE,MAA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W,EAAE;YACpE,EAAE,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE,uBAAuB,CAAC,aAAa,EAAE;YACxE,EAAE,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE,uBAAuB,CAAC,aAAa,EAAE;YACxE,EAAE,KAAK,EAAE,gBAAgB,EAAE,KAAK,EAAE,uBAAuB,CAAC,cAAc,EAAE;YAC1E,EAAE,KAAK,EAAE,kBAAkB,EAAE,KAAK,EAAE,uBAAuB,CAAC,gBAAgB,EAAE;SACjF;KACJ,CAAC;gDACkD;AA8MxD,aAAa,CAAC,4BAA4B,EAAE,kBAAkB,CAAC,CAAC","sourcesContent":["import { RegisterClass } from \"../../../Misc/typeStore\";\r\nimport { NodeGeometryBlock } from \"../nodeGeometryBlock\";\r\nimport { NodeGeometryBlockConnectionPointTypes } from \"../Enums/nodeGeometryConnectionPointTypes\";\r\nimport type { NodeGeometryConnectionPoint } from \"../nodeGeometryBlockConnectionPoint\";\r\nimport type { float } from \"core/types\";\r\nimport { Vector2, Vector3, Vector4 } from \"core/Maths/math.vector\";\r\nimport { PropertyTypeForEdition, editableInPropertyPage } from \"core/Decorators/nodeDecorator\";\r\n\r\n/**\r\n * Types of curves supported by the Curve block\r\n */\r\nexport enum GeometryCurveBlockTypes {\r\n /** EaseInSine */\r\n EaseInSine,\r\n /** EaseOutSine */\r\n EaseOutSine,\r\n /** EaseInOutSine */\r\n EaseInOutSine,\r\n /** EaseInQuad */\r\n EaseInQuad,\r\n /** EaseOutQuad */\r\n EaseOutQuad,\r\n /** EaseInOutQuad */\r\n EaseInOutQuad,\r\n /** EaseInCubic */\r\n EaseInCubic,\r\n /** EaseOutCubic */\r\n EaseOutCubic,\r\n /** EaseInOutCubic */\r\n EaseInOutCubic,\r\n /** EaseInQuart */\r\n EaseInQuart,\r\n /** EaseOutQuart */\r\n EaseOutQuart,\r\n /** EaseInOutQuart */\r\n EaseInOutQuart,\r\n /** EaseInQuint */\r\n EaseInQuint,\r\n /** EaseOutQuint */\r\n EaseOutQuint,\r\n /** EaseInOutQuint */\r\n EaseInOutQuint,\r\n /** EaseInExpo */\r\n EaseInExpo,\r\n /** EaseOutExpo */\r\n EaseOutExpo,\r\n /** EaseInOutExpo */\r\n EaseInOutExpo,\r\n /** EaseInCirc */\r\n EaseInCirc,\r\n /** EaseOutCirc */\r\n EaseOutCirc,\r\n /** EaseInOutCirc */\r\n EaseInOutCirc,\r\n /** EaseInBack */\r\n EaseInBack,\r\n /** EaseOutBack */\r\n EaseOutBack,\r\n /** EaseInOutBack */\r\n EaseInOutBack,\r\n /** EaseInElastic */\r\n EaseInElastic,\r\n /** EaseOutElastic */\r\n EaseOutElastic,\r\n /** EaseInOutElastic */\r\n EaseInOutElastic,\r\n}\r\n\r\n/**\r\n * Block used to apply curve operation\r\n */\r\nexport class GeometryCurveBlock extends NodeGeometryBlock {\r\n /**\r\n * Gets or sets the type of the curve applied by the block\r\n */\r\n @editableInPropertyPage(\"Type\", PropertyTypeForEdition.List, \"ADVANCED\", {\r\n notifiers: { rebuild: true },\r\n embedded: true,\r\n options: [\r\n { label: \"EaseInSine\", value: GeometryCurveBlockTypes.EaseInSine },\r\n { label: \"EaseOutSine\", value: GeometryCurveBlockTypes.EaseOutSine },\r\n { label: \"EaseInOutSine\", value: GeometryCurveBlockTypes.EaseInOutSine },\r\n { label: \"EaseInQuad\", value: GeometryCurveBlockTypes.EaseInQuad },\r\n { label: \"EaseOutQuad\", value: GeometryCurveBlockTypes.EaseOutQuad },\r\n { label: \"EaseInOutQuad\", value: GeometryCurveBlockTypes.EaseInOutQuad },\r\n { label: \"EaseInCubic\", value: GeometryCurveBlockTypes.EaseInCubic },\r\n { label: \"EaseOutCubic\", value: GeometryCurveBlockTypes.EaseOutCubic },\r\n { label: \"EaseInOutCubic\", value: GeometryCurveBlockTypes.EaseInOutCubic },\r\n { label: \"EaseInQuart\", value: GeometryCurveBlockTypes.EaseInQuart },\r\n { label: \"EaseOutQuart\", value: GeometryCurveBlockTypes.EaseOutQuart },\r\n { label: \"EaseInOutQuart\", value: GeometryCurveBlockTypes.EaseInOutQuart },\r\n { label: \"EaseInQuint\", value: GeometryCurveBlockTypes.EaseInQuint },\r\n { label: \"EaseOutQuint\", value: GeometryCurveBlockTypes.EaseOutQuint },\r\n { label: \"EaseInOutQuint\", value: GeometryCurveBlockTypes.EaseInOutQuint },\r\n { label: \"EaseInExpo\", value: GeometryCurveBlockTypes.EaseInExpo },\r\n { label: \"EaseOutExpo\", value: GeometryCurveBlockTypes.EaseOutExpo },\r\n { label: \"EaseInOutExpo\", value: GeometryCurveBlockTypes.EaseInOutExpo },\r\n { label: \"EaseInCirc\", value: GeometryCurveBlockTypes.EaseInCirc },\r\n { label: \"EaseOutCirc\", value: GeometryCurveBlockTypes.EaseOutCirc },\r\n { label: \"EaseInOutCirc\", value: GeometryCurveBlockTypes.EaseInOutCirc },\r\n { label: \"EaseInBack\", value: GeometryCurveBlockTypes.EaseInBack },\r\n { label: \"EaseOutBack\", value: GeometryCurveBlockTypes.EaseOutBack },\r\n { label: \"EaseInOutBack\", value: GeometryCurveBlockTypes.EaseInOutBack },\r\n { label: \"EaseInElastic\", value: GeometryCurveBlockTypes.EaseInElastic },\r\n { label: \"EaseOutElastic\", value: GeometryCurveBlockTypes.EaseOutElastic },\r\n { label: \"EaseInOutElastic\", value: GeometryCurveBlockTypes.EaseInOutElastic },\r\n ],\r\n })\r\n public type = GeometryCurveBlockTypes.EaseInOutSine;\r\n\r\n /**\r\n * Creates a new CurveBlock\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 this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Matrix);\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Int);\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public override getClassName() {\r\n return \"GeometryCurveBlock\";\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() {\r\n if (!this.input.isConnected) {\r\n this.output._storedFunction = null;\r\n this.output._storedValue = null;\r\n return;\r\n }\r\n\r\n let func: (v: float) => any;\r\n\r\n switch (this.type) {\r\n case GeometryCurveBlockTypes.EaseInSine:\r\n func = (v: float) => 1.0 - Math.cos((v * 3.1415) / 2.0);\r\n break;\r\n case GeometryCurveBlockTypes.EaseOutSine:\r\n func = (v: float) => Math.sin((v * 3.1415) / 2.0);\r\n break;\r\n case GeometryCurveBlockTypes.EaseInOutSine:\r\n func = (v: float) => -(Math.cos(v * 3.1415) - 1.0) / 2.0;\r\n break;\r\n case GeometryCurveBlockTypes.EaseInQuad:\r\n func = (v: float) => v * v;\r\n break;\r\n case GeometryCurveBlockTypes.EaseOutQuad:\r\n func = (v: float) => (1.0 - v) * (1.0 - v);\r\n break;\r\n case GeometryCurveBlockTypes.EaseInOutQuad: {\r\n func = (v: float) => (v < 0.5 ? 2.0 * v * v : 1.0 - Math.pow(-2.0 * v + 2.0, 2.0) / 2.0);\r\n break;\r\n }\r\n case GeometryCurveBlockTypes.EaseInCubic:\r\n func = (v: float) => v * v * v;\r\n break;\r\n case GeometryCurveBlockTypes.EaseOutCubic: {\r\n func = (v: float) => 1.0 - Math.pow(1.0 - v, 3.0);\r\n break;\r\n }\r\n case GeometryCurveBlockTypes.EaseInOutCubic: {\r\n func = (v: float) => (v < 0.5 ? 4.0 * v * v * v : 1.0 - Math.pow(-2.0 * v + 2.0, 3.0) / 2.0);\r\n break;\r\n }\r\n case GeometryCurveBlockTypes.EaseInQuart:\r\n func = (v: float) => v * v * v * v;\r\n break;\r\n case GeometryCurveBlockTypes.EaseOutQuart: {\r\n func = (v: float) => 1.0 - Math.pow(1.0 - v, 4.0);\r\n break;\r\n }\r\n case GeometryCurveBlockTypes.EaseInOutQuart: {\r\n func = (v: float) => (v < 0.5 ? 8.0 * v * v * v * v : 1.0 - Math.pow(-2.0 * v + 2.0, 4.0) / 2.0);\r\n break;\r\n }\r\n case GeometryCurveBlockTypes.EaseInQuint:\r\n func = (v: float) => v * v * v * v * v;\r\n break;\r\n case GeometryCurveBlockTypes.EaseOutQuint: {\r\n func = (v: float) => 1.0 - Math.pow(1.0 - v, 5.0);\r\n break;\r\n }\r\n case GeometryCurveBlockTypes.EaseInOutQuint: {\r\n func = (v: float) => (v < 0.5 ? 16.0 * v * v * v * v * v : 1.0 - Math.pow(-2.0 * v + 2.0, 5.0) / 2.0);\r\n break;\r\n }\r\n case GeometryCurveBlockTypes.EaseInExpo: {\r\n func = (v: float) => (v === 0.0 ? 0.0 : Math.pow(2.0, 10.0 * v - 10.0));\r\n break;\r\n }\r\n case GeometryCurveBlockTypes.EaseOutExpo: {\r\n func = (v: float) => (v === 1.0 ? 1.0 : 1.0 - Math.pow(2.0, -10.0 * v));\r\n break;\r\n }\r\n case GeometryCurveBlockTypes.EaseInOutExpo: {\r\n func = (v: float) => (v === 0.0 ? 0.0 : v === 1.0 ? 1.0 : v < 0.5 ? Math.pow(2.0, 20.0 * v - 10.0) / 2.0 : (2.0 - Math.pow(2.0, -20.0 * v + 10.0)) / 2.0);\r\n break;\r\n }\r\n case GeometryCurveBlockTypes.EaseInCirc: {\r\n func = (v: float) => 1.0 - Math.sqrt(1.0 - Math.pow(v, 2.0));\r\n break;\r\n }\r\n case GeometryCurveBlockTypes.EaseOutCirc: {\r\n func = (v: float) => Math.sqrt(1.0 - Math.pow(v - 1.0, 2.0));\r\n break;\r\n }\r\n case GeometryCurveBlockTypes.EaseInOutCirc: {\r\n func = (v: float) => (v < 0.5 ? (1.0 - Math.sqrt(1.0 - Math.pow(2.0 * v, 2.0))) / 2.0 : (Math.sqrt(1.0 - Math.pow(-2.0 * v + 2.0, 2.0)) + 1.0) / 2.0);\r\n break;\r\n }\r\n case GeometryCurveBlockTypes.EaseInBack: {\r\n func = (v: float) => 2.70158 * v * v * v - 1.70158 * v * v;\r\n break;\r\n }\r\n case GeometryCurveBlockTypes.EaseOutBack: {\r\n func = (v: float) => 2.70158 * Math.pow(v - 1.0, 3.0) + 1.70158 * Math.pow(v - 1.0, 2.0);\r\n break;\r\n }\r\n case GeometryCurveBlockTypes.EaseInOutBack: {\r\n func = (v: float) =>\r\n v < 0.5\r\n ? (Math.pow(2.0 * v, 2.0) * (3.5949095 * 2.0 * v - 2.5949095)) / 2.0\r\n : (Math.pow(2.0 * v - 2.0, 2.0) * (3.5949095 * (v * 2.0 - 2.0) + 3.5949095) + 2.0) / 2.0;\r\n break;\r\n }\r\n case GeometryCurveBlockTypes.EaseInElastic: {\r\n func = (v: float) => (v === 0.0 ? 0.0 : v === 1.0 ? 1.0 : -Math.pow(2.0, 10.0 * v - 10.0) * Math.sin((v * 10.0 - 10.75) * ((2.0 * 3.1415) / 3.0)));\r\n break;\r\n }\r\n case GeometryCurveBlockTypes.EaseOutElastic: {\r\n func = (v: float) => (v === 0.0 ? 0.0 : v === 1.0 ? 1.0 : Math.pow(2.0, -10.0 * v) * Math.sin((v * 10.0 - 0.75) * ((2.0 * 3.1415) / 3.0)) + 1.0);\r\n break;\r\n }\r\n case GeometryCurveBlockTypes.EaseInOutElastic: {\r\n func = (v: float) =>\r\n v === 0.0\r\n ? 0.0\r\n : v == 1.0\r\n ? 1.0\r\n : v < 0.5\r\n ? -(Math.pow(2.0, 20.0 * v - 10.0) * Math.sin((20.0 * v - 11.125) * ((2.0 * 3.1415) / 4.5))) / 2.0\r\n : (Math.pow(2.0, -20.0 * v + 10.0) * Math.sin((20.0 * v - 11.125) * ((2.0 * 3.1415) / 4.5))) / 2.0 + 1.0;\r\n break;\r\n }\r\n }\r\n\r\n this.output._storedFunction = (state) => {\r\n const input = this.input.getConnectedValue(state);\r\n\r\n switch (this.input.type) {\r\n case NodeGeometryBlockConnectionPointTypes.Float: {\r\n return func(input);\r\n }\r\n case NodeGeometryBlockConnectionPointTypes.Vector2: {\r\n return new Vector2(func(input.x), func(input.y));\r\n }\r\n case NodeGeometryBlockConnectionPointTypes.Vector3: {\r\n return new Vector3(func(input.x), func(input.y), func(input.z));\r\n }\r\n case NodeGeometryBlockConnectionPointTypes.Vector4: {\r\n return new Vector4(func(input.x), func(input.y), func(input.z), func(input.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 public override serialize(): any {\r\n const serializationObject = super.serialize();\r\n\r\n serializationObject.curveType = this.type;\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.curveType;\r\n }\r\n\r\n protected override _dumpPropertiesCode() {\r\n const codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.type = BABYLON.GeometryCurveBlockTypes.${GeometryCurveBlockTypes[this.type]};\\n`;\r\n return codeString;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.GeometryCurveBlock\", GeometryCurveBlock);\r\n"]}
@@ -192,13 +192,13 @@ export class GeometryOptimizeBlock extends NodeGeometryBlock {
192
192
  }
193
193
  }
194
194
  __decorate([
195
- editableInPropertyPage("Evaluate context", 0 /* PropertyTypeForEdition.Boolean */, "ADVANCED", { notifiers: { rebuild: true } })
195
+ editableInPropertyPage("Evaluate context", 0 /* PropertyTypeForEdition.Boolean */, "ADVANCED", { embedded: true, notifiers: { rebuild: true } })
196
196
  ], GeometryOptimizeBlock.prototype, "evaluateContext", void 0);
197
197
  __decorate([
198
- editableInPropertyPage("Epsilon", 1 /* PropertyTypeForEdition.Float */, "ADVANCED", { notifiers: { rebuild: true } })
198
+ editableInPropertyPage("Epsilon", 1 /* PropertyTypeForEdition.Float */, "ADVANCED", { embedded: true, notifiers: { rebuild: true } })
199
199
  ], GeometryOptimizeBlock.prototype, "epsilon", void 0);
200
200
  __decorate([
201
- editableInPropertyPage("Optimize faces", 0 /* PropertyTypeForEdition.Boolean */, "ADVANCED", { notifiers: { rebuild: true } })
201
+ editableInPropertyPage("Optimize faces", 0 /* PropertyTypeForEdition.Boolean */, "ADVANCED", { embedded: true, notifiers: { rebuild: true } })
202
202
  ], GeometryOptimizeBlock.prototype, "optimizeFaces", void 0);
203
203
  RegisterClass("BABYLON.GeometryOptimizeBlock", GeometryOptimizeBlock);
204
204
  //# sourceMappingURL=geometryOptimizeBlock.js.map