@babylonjs/core 6.16.0 → 6.16.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (145) hide show
  1. package/Bones/boneIKController.js +1 -0
  2. package/Bones/boneIKController.js.map +1 -1
  3. package/Debug/axesViewer.js +3 -3
  4. package/Debug/axesViewer.js.map +1 -1
  5. package/Decorators/nodeDecorator.d.ts +2 -1
  6. package/Decorators/nodeDecorator.js.map +1 -1
  7. package/Engines/thinEngine.js +2 -2
  8. package/Engines/thinEngine.js.map +1 -1
  9. package/Gizmos/planeDragGizmo.js +13 -5
  10. package/Gizmos/planeDragGizmo.js.map +1 -1
  11. package/Materials/Node/Blocks/Dual/sceneDepthBlock.js +7 -3
  12. package/Materials/Node/Blocks/Dual/sceneDepthBlock.js.map +1 -1
  13. package/Materials/Node/nodeMaterial.d.ts +1 -1
  14. package/Materials/Node/nodeMaterial.js +6 -2
  15. package/Materials/Node/nodeMaterial.js.map +1 -1
  16. package/Materials/greasedLinePluginMaterial.d.ts +96 -4
  17. package/Materials/greasedLinePluginMaterial.js +15 -6
  18. package/Materials/greasedLinePluginMaterial.js.map +1 -1
  19. package/Materials/greasedLineSimpleMaterial.d.ts +228 -0
  20. package/Materials/greasedLineSimpleMaterial.js +435 -0
  21. package/Materials/greasedLineSimpleMaterial.js.map +1 -0
  22. package/Materials/material.decalMapConfiguration.js +2 -0
  23. package/Materials/material.decalMapConfiguration.js.map +1 -1
  24. package/Materials/meshDebugPluginMaterial.d.ts +66 -17
  25. package/Materials/meshDebugPluginMaterial.js +65 -75
  26. package/Materials/meshDebugPluginMaterial.js.map +1 -1
  27. package/Maths/math.vector.js.map +1 -1
  28. package/Meshes/Builders/greasedLineBuilder.d.ts +3 -2
  29. package/Meshes/Builders/greasedLineBuilder.js +26 -15
  30. package/Meshes/Builders/greasedLineBuilder.js.map +1 -1
  31. package/Meshes/Builders/textBuilder.d.ts +6 -0
  32. package/Meshes/Builders/textBuilder.js +5 -0
  33. package/Meshes/Builders/textBuilder.js.map +1 -1
  34. package/Meshes/Node/Blocks/Instances/instantiateOnFacesBlock.d.ts +2 -2
  35. package/Meshes/Node/Blocks/Instances/instantiateOnFacesBlock.js +9 -3
  36. package/Meshes/Node/Blocks/Instances/instantiateOnFacesBlock.js.map +1 -1
  37. package/Meshes/Node/Blocks/Instances/instantiateOnVerticesBlock.js +1 -1
  38. package/Meshes/Node/Blocks/Instances/instantiateOnVerticesBlock.js.map +1 -1
  39. package/Meshes/Node/Blocks/Set/setNormalsBlock.d.ts +1 -1
  40. package/Meshes/Node/Blocks/Set/setNormalsBlock.js +1 -1
  41. package/Meshes/Node/Blocks/Set/setNormalsBlock.js.map +1 -1
  42. package/Meshes/Node/Blocks/Set/setUVsBlock.js +1 -1
  43. package/Meshes/Node/Blocks/Set/setUVsBlock.js.map +1 -1
  44. package/Meshes/Node/Blocks/Sources/boxBlock.js +1 -1
  45. package/Meshes/Node/Blocks/Sources/boxBlock.js.map +1 -1
  46. package/Meshes/Node/Blocks/Sources/capsuleBlock.js +1 -1
  47. package/Meshes/Node/Blocks/Sources/capsuleBlock.js.map +1 -1
  48. package/Meshes/Node/Blocks/Sources/cylinderBlock.js +1 -1
  49. package/Meshes/Node/Blocks/Sources/cylinderBlock.js.map +1 -1
  50. package/Meshes/Node/Blocks/Sources/discBlock.d.ts +1 -1
  51. package/Meshes/Node/Blocks/Sources/discBlock.js +2 -2
  52. package/Meshes/Node/Blocks/Sources/discBlock.js.map +1 -1
  53. package/Meshes/Node/Blocks/Sources/gridBlock.js +1 -1
  54. package/Meshes/Node/Blocks/Sources/gridBlock.js.map +1 -1
  55. package/Meshes/Node/Blocks/Sources/icoSphereBlock.d.ts +3 -3
  56. package/Meshes/Node/Blocks/Sources/icoSphereBlock.js +4 -4
  57. package/Meshes/Node/Blocks/Sources/icoSphereBlock.js.map +1 -1
  58. package/Meshes/Node/Blocks/Sources/meshBlock.d.ts +1 -1
  59. package/Meshes/Node/Blocks/Sources/meshBlock.js +1 -1
  60. package/Meshes/Node/Blocks/Sources/meshBlock.js.map +1 -1
  61. package/Meshes/Node/Blocks/Sources/nullBlock.d.ts +22 -0
  62. package/Meshes/Node/Blocks/Sources/nullBlock.js +34 -0
  63. package/Meshes/Node/Blocks/Sources/nullBlock.js.map +1 -0
  64. package/Meshes/Node/Blocks/Sources/planeBlock.js +1 -1
  65. package/Meshes/Node/Blocks/Sources/planeBlock.js.map +1 -1
  66. package/Meshes/Node/Blocks/Sources/sphereBlock.js +1 -1
  67. package/Meshes/Node/Blocks/Sources/sphereBlock.js.map +1 -1
  68. package/Meshes/Node/Blocks/Sources/torusBlock.d.ts +1 -1
  69. package/Meshes/Node/Blocks/Sources/torusBlock.js +2 -2
  70. package/Meshes/Node/Blocks/Sources/torusBlock.js.map +1 -1
  71. package/Meshes/Node/Blocks/Teleport/teleportOutBlock.js +1 -1
  72. package/Meshes/Node/Blocks/Teleport/teleportOutBlock.js.map +1 -1
  73. package/Meshes/Node/Blocks/conditionBlock.d.ts +1 -1
  74. package/Meshes/Node/Blocks/conditionBlock.js +9 -6
  75. package/Meshes/Node/Blocks/conditionBlock.js.map +1 -1
  76. package/Meshes/Node/Blocks/debugBlock.js +1 -1
  77. package/Meshes/Node/Blocks/debugBlock.js.map +1 -1
  78. package/Meshes/Node/Blocks/geometryInputBlock.d.ts +1 -0
  79. package/Meshes/Node/Blocks/geometryInputBlock.js +33 -1
  80. package/Meshes/Node/Blocks/geometryInputBlock.js.map +1 -1
  81. package/Meshes/Node/Blocks/geometryOptimizeBlock.d.ts +43 -0
  82. package/Meshes/Node/Blocks/geometryOptimizeBlock.js +118 -0
  83. package/Meshes/Node/Blocks/geometryOptimizeBlock.js.map +1 -0
  84. package/Meshes/Node/Blocks/geometryOutputBlock.js +1 -0
  85. package/Meshes/Node/Blocks/geometryOutputBlock.js.map +1 -1
  86. package/Meshes/Node/Blocks/geometryTransformBlock.d.ts +8 -1
  87. package/Meshes/Node/Blocks/geometryTransformBlock.js +20 -1
  88. package/Meshes/Node/Blocks/geometryTransformBlock.js.map +1 -1
  89. package/Meshes/Node/Blocks/geometryTrigonometryBlock.js +4 -1
  90. package/Meshes/Node/Blocks/geometryTrigonometryBlock.js.map +1 -1
  91. package/Meshes/Node/Blocks/{IntFloatConverterBlock.js → intFloatConverterBlock.js} +1 -1
  92. package/Meshes/Node/Blocks/{IntFloatConverterBlock.js.map → intFloatConverterBlock.js.map} +1 -1
  93. package/Meshes/Node/Blocks/mathBlock.d.ts +1 -1
  94. package/Meshes/Node/Blocks/mathBlock.js +6 -2
  95. package/Meshes/Node/Blocks/mathBlock.js.map +1 -1
  96. package/Meshes/Node/Blocks/mergeGeometryBlock.js +1 -1
  97. package/Meshes/Node/Blocks/mergeGeometryBlock.js.map +1 -1
  98. package/Meshes/Node/Blocks/noiseBlock.js +2 -2
  99. package/Meshes/Node/Blocks/noiseBlock.js.map +1 -1
  100. package/Meshes/Node/Blocks/normalizeVectorBlock.d.ts +1 -1
  101. package/Meshes/Node/Blocks/normalizeVectorBlock.js +1 -1
  102. package/Meshes/Node/Blocks/normalizeVectorBlock.js.map +1 -1
  103. package/Meshes/Node/Blocks/randomBlock.d.ts +2 -2
  104. package/Meshes/Node/Blocks/randomBlock.js +7 -2
  105. package/Meshes/Node/Blocks/randomBlock.js.map +1 -1
  106. package/Meshes/Node/Blocks/vectorConverterBlock.d.ts +1 -0
  107. package/Meshes/Node/Blocks/vectorConverterBlock.js +35 -7
  108. package/Meshes/Node/Blocks/vectorConverterBlock.js.map +1 -1
  109. package/Meshes/Node/Enums/nodeGeometryConnectionPointTypes.d.ts +5 -5
  110. package/Meshes/Node/Enums/nodeGeometryConnectionPointTypes.js +5 -5
  111. package/Meshes/Node/Enums/nodeGeometryConnectionPointTypes.js.map +1 -1
  112. package/Meshes/Node/Enums/nodeGeometryContextualSources.d.ts +1 -3
  113. package/Meshes/Node/Enums/nodeGeometryContextualSources.js +0 -2
  114. package/Meshes/Node/Enums/nodeGeometryContextualSources.js.map +1 -1
  115. package/Meshes/Node/Interfaces/nodeGeometryExecutionContext.d.ts +1 -1
  116. package/Meshes/Node/Interfaces/nodeGeometryExecutionContext.js.map +1 -1
  117. package/Meshes/Node/index.d.ts +3 -1
  118. package/Meshes/Node/index.js +3 -1
  119. package/Meshes/Node/index.js.map +1 -1
  120. package/Meshes/Node/nodeGeometry.d.ts +3 -2
  121. package/Meshes/Node/nodeGeometry.js +10 -9
  122. package/Meshes/Node/nodeGeometry.js.map +1 -1
  123. package/Meshes/Node/nodeGeometryBlock.d.ts +7 -1
  124. package/Meshes/Node/nodeGeometryBlock.js +26 -6
  125. package/Meshes/Node/nodeGeometryBlock.js.map +1 -1
  126. package/Meshes/Node/nodeGeometryBlockConnectionPoint.d.ts +1 -1
  127. package/Meshes/Node/nodeGeometryBlockConnectionPoint.js.map +1 -1
  128. package/Meshes/Node/nodeGeometryBuildState.d.ts +1 -1
  129. package/Meshes/Node/nodeGeometryBuildState.js +3 -3
  130. package/Meshes/Node/nodeGeometryBuildState.js.map +1 -1
  131. package/Meshes/greasedLineMesh.d.ts +4 -2
  132. package/Meshes/greasedLineMesh.js +26 -2
  133. package/Meshes/greasedLineMesh.js.map +1 -1
  134. package/Meshes/mesh.vertexData.js.map +1 -1
  135. package/Misc/greasedLineTools.d.ts +1 -1
  136. package/Misc/greasedLineTools.js +1 -1
  137. package/Misc/greasedLineTools.js.map +1 -1
  138. package/Shaders/greasedLine.fragment.d.ts +5 -0
  139. package/Shaders/greasedLine.fragment.js +16 -0
  140. package/Shaders/greasedLine.fragment.js.map +1 -0
  141. package/Shaders/greasedLine.vertex.d.ts +5 -0
  142. package/Shaders/greasedLine.vertex.js +19 -0
  143. package/Shaders/greasedLine.vertex.js.map +1 -0
  144. package/package.json +1 -1
  145. /package/Meshes/Node/Blocks/{IntFloatConverterBlock.d.ts → intFloatConverterBlock.d.ts} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"icoSphereBlock.js","sourceRoot":"","sources":["../../../../../../../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\"../../nodeGeometryBlock\";\r\nimport type { NodeGeometryConnectionPoint } from \"../../nodeGeometryBlockConnectionPoint\";\r\nimport type { NodeGeometryBuildState } from \"../../nodeGeometryBuildState\";\r\nimport { GeometryInputBlock } from \"../geometryInputBlock\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\nimport type { Vector4 } from \"../../../../Maths/math.vector\";\r\nimport { CreateIcoSphereVertexData } from \"core/Meshes/Builders/icoSphereBuilder\";\r\nimport { PropertyTypeForEdition, editableInPropertyPage } from \"../../../../Decorators/nodeDecorator\";\r\n\r\n/**\r\n * Defines a block used to generate icosphere geometry data\r\n */\r\nexport class IcoSphereBlock extends NodeGeometryBlock {\r\n /**\r\n * Gets or sets a boolean indicating that this block can evaluate context\r\n * Build performance is improved when this value is set to false as the system will cache values instead of reevaluating everything per context change\r\n */\r\n @editableInPropertyPage(\"Evaluate context\", PropertyTypeForEdition.Boolean, \"ADVANCED\", { notifiers: { rebuild: true } })\r\n public evaluateContext = false;\r\n\r\n /**\r\n * Create a new IcoSphereBlock\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(\"radius\", NodeGeometryBlockConnectionPointTypes.Float, true, 1);\r\n this.registerInput(\"radiusX\", NodeGeometryBlockConnectionPointTypes.Float, true, 0);\r\n this.registerInput(\"radiusY\", NodeGeometryBlockConnectionPointTypes.Float, true, 0);\r\n this.registerInput(\"radiusZ\", NodeGeometryBlockConnectionPointTypes.Float, true, 0);\r\n this.registerInput(\"subdivisions\", NodeGeometryBlockConnectionPointTypes.Int, true, 4);\r\n\r\n this.registerOutput(\"geometry\", 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 getClassName() {\r\n return \"IcoSphereBlock\";\r\n }\r\n\r\n /**\r\n * Gets the radius input component\r\n */\r\n public get radius(): NodeGeometryConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the radius input component\r\n */\r\n public get radiusX(): NodeGeometryConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the radius input component\r\n */\r\n public get radiusY(): NodeGeometryConnectionPoint {\r\n return this._inputs[2];\r\n }\r\n\r\n /**\r\n * Gets the radius input component\r\n */\r\n public get radiusZ(): NodeGeometryConnectionPoint {\r\n return this._inputs[3];\r\n }\r\n\r\n /**\r\n * Gets the subdivisions input component\r\n */\r\n public get subdivisions(): NodeGeometryConnectionPoint {\r\n return this._inputs[4];\r\n }\r\n\r\n /**\r\n * Gets the geometry output component\r\n */\r\n public get geometry(): NodeGeometryConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n public autoConfigure() {\r\n if (!this.radius.isConnected) {\r\n const radiusInput = new GeometryInputBlock(\"Radius\");\r\n radiusInput.value = 0.2;\r\n radiusInput.output.connectTo(this.radius);\r\n }\r\n }\r\n\r\n protected _buildBlock(state: NodeGeometryBuildState) {\r\n const options: {\r\n radius?: number;\r\n radiusX?: number;\r\n radiusY?: number;\r\n radiusZ?: number;\r\n flat?: boolean;\r\n subdivisions?: number;\r\n sideOrientation?: number;\r\n frontUVs?: Vector4;\r\n backUVs?: Vector4;\r\n } = {};\r\n\r\n const func = (state: NodeGeometryBuildState) => {\r\n options.radius = this.radius.getConnectedValue(state);\r\n options.subdivisions = this.subdivisions.getConnectedValue(state);\r\n options.radiusX = this.radiusX.getConnectedValue(state);\r\n options.radiusY = this.radiusY.getConnectedValue(state);\r\n options.radiusZ = this.radiusZ.getConnectedValue(state);\r\n\r\n // Append vertex data from the plane builder\r\n return CreateIcoSphereVertexData(options);\r\n };\r\n\r\n if (this.evaluateContext) {\r\n this.geometry._storedFunction = func;\r\n } else {\r\n this.geometry._storedValue = func(state);\r\n }\r\n }\r\n\r\n protected _dumpPropertiesCode() {\r\n const codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.evaluateContext = ${this.evaluateContext ? \"true\" : \"false\"};\\r\\n`;\r\n return codeString;\r\n }\r\n\r\n /**\r\n * Serializes this block in a JSON representation\r\n * @returns the serialized block object\r\n */\r\n public serialize(): any {\r\n const serializationObject = super.serialize();\r\n\r\n serializationObject.evaluateContext = this.evaluateContext;\r\n\r\n return serializationObject;\r\n }\r\n\r\n public _deserialize(serializationObject: any) {\r\n super._deserialize(serializationObject);\r\n\r\n this.evaluateContext = serializationObject.evaluateContext;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.IcoSphereBlock\", IcoSphereBlock);\r\n"]}
1
+ {"version":3,"file":"icoSphereBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/Meshes/Node/Blocks/Sources/icoSphereBlock.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,qCAAqC,EAAE,MAAM,8CAA8C,CAAC;AACrG,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAG5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAE3D,OAAO,EAAE,yBAAyB,EAAE,8CAA8C;AAClF,OAAO,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAEtG;;GAEG;AACH,MAAM,OAAO,cAAe,SAAQ,iBAAiB;IAQjD;;;OAGG;IACH,YAAmB,IAAY;QAC3B,KAAK,CAAC,IAAI,CAAC,CAAC;QAZhB;;;WAGG;QAEI,oBAAe,GAAG,KAAK,CAAC;QAS3B,IAAI,CAAC,aAAa,CAAC,QAAQ,EAAE,qCAAqC,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QACnF,IAAI,CAAC,aAAa,CAAC,SAAS,EAAE,qCAAqC,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QACpF,IAAI,CAAC,aAAa,CAAC,SAAS,EAAE,qCAAqC,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAA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BAAmB,CAAC,CAAC;QAExC,IAAI,CAAC,eAAe,GAAG,mBAAmB,CAAC,eAAe,CAAC;IAC/D,CAAC;CACJ;AAjIU;IADN,sBAAsB,CAAC,kBAAkB,EAAE,sBAAsB,CAAC,OAAO,EAAE,UAAU,EAAE,EAAE,SAAS,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,CAAC;uDAC1F;AAmInC,aAAa,CAAC,wBAAwB,EAAE,cAAc,CAAC,CAAC","sourcesContent":["import { NodeGeometryBlockConnectionPointTypes } from \"../../Enums/nodeGeometryConnectionPointTypes\";\r\nimport { NodeGeometryBlock } from \"../../nodeGeometryBlock\";\r\nimport type { NodeGeometryConnectionPoint } from \"../../nodeGeometryBlockConnectionPoint\";\r\nimport type { NodeGeometryBuildState } from \"../../nodeGeometryBuildState\";\r\nimport { GeometryInputBlock } from \"../geometryInputBlock\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\nimport type { Vector4 } from \"../../../../Maths/math.vector\";\r\nimport { CreateIcoSphereVertexData } from \"core/Meshes/Builders/icoSphereBuilder\";\r\nimport { PropertyTypeForEdition, editableInPropertyPage } from \"../../../../Decorators/nodeDecorator\";\r\n\r\n/**\r\n * Defines a block used to generate icosphere geometry data\r\n */\r\nexport class IcoSphereBlock extends NodeGeometryBlock {\r\n /**\r\n * Gets or sets a boolean indicating that this block can evaluate context\r\n * Build performance is improved when this value is set to false as the system will cache values instead of reevaluating everything per context change\r\n */\r\n @editableInPropertyPage(\"Evaluate context\", PropertyTypeForEdition.Boolean, \"ADVANCED\", { notifiers: { rebuild: true } })\r\n public evaluateContext = false;\r\n\r\n /**\r\n * Create a new IcoSphereBlock\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(\"radius\", NodeGeometryBlockConnectionPointTypes.Float, true, 1);\r\n this.registerInput(\"radiusX\", NodeGeometryBlockConnectionPointTypes.Float, true, 0);\r\n this.registerInput(\"radiusY\", NodeGeometryBlockConnectionPointTypes.Float, true, 0);\r\n this.registerInput(\"radiusZ\", NodeGeometryBlockConnectionPointTypes.Float, true, 0);\r\n this.registerInput(\"subdivisions\", NodeGeometryBlockConnectionPointTypes.Int, true, 4);\r\n\r\n this.registerOutput(\"geometry\", 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 getClassName() {\r\n return \"IcoSphereBlock\";\r\n }\r\n\r\n /**\r\n * Gets the radius input component\r\n */\r\n public get radius(): NodeGeometryConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the radiusX input component\r\n */\r\n public get radiusX(): NodeGeometryConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the radiusY input component\r\n */\r\n public get radiusY(): NodeGeometryConnectionPoint {\r\n return this._inputs[2];\r\n }\r\n\r\n /**\r\n * Gets the radiusZ input component\r\n */\r\n public get radiusZ(): NodeGeometryConnectionPoint {\r\n return this._inputs[3];\r\n }\r\n\r\n /**\r\n * Gets the subdivisions input component\r\n */\r\n public get subdivisions(): NodeGeometryConnectionPoint {\r\n return this._inputs[4];\r\n }\r\n\r\n /**\r\n * Gets the geometry output component\r\n */\r\n public get geometry(): NodeGeometryConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n public autoConfigure() {\r\n if (!this.radius.isConnected) {\r\n const radiusInput = new GeometryInputBlock(\"Radius\");\r\n radiusInput.value = 0.2;\r\n radiusInput.output.connectTo(this.radius);\r\n }\r\n }\r\n\r\n protected _buildBlock(state: NodeGeometryBuildState) {\r\n const options: {\r\n radius?: number;\r\n radiusX?: number;\r\n radiusY?: number;\r\n radiusZ?: number;\r\n flat?: boolean;\r\n subdivisions?: number;\r\n sideOrientation?: number;\r\n frontUVs?: Vector4;\r\n backUVs?: Vector4;\r\n } = {};\r\n\r\n const func = (state: NodeGeometryBuildState) => {\r\n options.radius = this.radius.getConnectedValue(state);\r\n options.subdivisions = this.subdivisions.getConnectedValue(state);\r\n options.radiusX = this.radiusX.getConnectedValue(state);\r\n options.radiusY = this.radiusY.getConnectedValue(state);\r\n options.radiusZ = this.radiusZ.getConnectedValue(state);\r\n\r\n // Append vertex data from the plane builder\r\n return CreateIcoSphereVertexData(options);\r\n };\r\n\r\n if (this.evaluateContext) {\r\n this.geometry._storedFunction = func;\r\n } else {\r\n this.geometry._storedValue = func(state);\r\n }\r\n }\r\n\r\n protected _dumpPropertiesCode() {\r\n const codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.evaluateContext = ${this.evaluateContext ? \"true\" : \"false\"};\\n`;\r\n return codeString;\r\n }\r\n\r\n /**\r\n * Serializes this block in a JSON representation\r\n * @returns the serialized block object\r\n */\r\n public serialize(): any {\r\n const serializationObject = super.serialize();\r\n\r\n serializationObject.evaluateContext = this.evaluateContext;\r\n\r\n return serializationObject;\r\n }\r\n\r\n public _deserialize(serializationObject: any) {\r\n super._deserialize(serializationObject);\r\n\r\n this.evaluateContext = serializationObject.evaluateContext;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.IcoSphereBlock\", IcoSphereBlock);\r\n"]}
@@ -29,7 +29,7 @@ export declare class MeshBlock extends NodeGeometryBlock {
29
29
  get geometry(): NodeGeometryConnectionPoint;
30
30
  protected _buildBlock(): void;
31
31
  /**
32
- * Serializes this block in a JSON representation *
32
+ * Serializes this block in a JSON representation
33
33
  * @param saveMeshData defines a boolean indicating that mesh data must be saved as well
34
34
  * @returns the serialized block object
35
35
  */
@@ -51,7 +51,7 @@ export class MeshBlock extends NodeGeometryBlock {
51
51
  this._cachedVertexData = null;
52
52
  }
53
53
  /**
54
- * Serializes this block in a JSON representation *
54
+ * Serializes this block in a JSON representation
55
55
  * @param saveMeshData defines a boolean indicating that mesh data must be saved as well
56
56
  * @returns the serialized block object
57
57
  */
@@ -1 +1 @@
1
- {"version":3,"file":"meshBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/Meshes/Node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AG,IAAI,CAAC;IAClC,CAAC;IAED;;;;OAIG;IACI,SAAS,CAAC,YAAsB;QACnC,MAAM,mBAAmB,GAAG,KAAK,CAAC,SAAS,EAAE,CAAC;QAE9C,IAAI,YAAY,EAAE;YACd,IAAI,IAAI,CAAC,KAAK,EAAE;gBACZ,mBAAmB,CAAC,gBAAgB,GAAG,UAAU,CAAC,eAAe,CAAC,IAAI,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC,SAAS,EAAE,CAAC;aAC1G;iBAAM,IAAI,IAAI,CAAC,iBAAiB,EAAE;gBAC/B,mBAAmB,CAAC,gBAAgB,GAAG,IAAI,CAAC,iBAAiB,CAAC,SAAS,EAAE,CAAC;aAC7E;SACJ;QAED,OAAO,mBAAmB,CAAC;IAC/B,CAAC;IAEM,YAAY,CAAC,mBAAwB;QACxC,KAAK,CAAC,YAAY,CAAC,mBAAmB,CAAC,CAAC;QAExC,IAAI,mBAAmB,CAAC,gBAAgB,EAAE;YACtC,IAAI,CAAC,iBAAiB,GAAG,UAAU,CAAC,KAAK,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,CAAC;SACnF;IACL,CAAC;CACJ;AAED,aAAa,CAAC,mBAAmB,EAAE,SAAS,CAAC,CAAC","sourcesContent":["import { NodeGeometryBlockConnectionPointTypes } from \"../../Enums/nodeGeometryConnectionPointTypes\";\r\nimport { NodeGeometryBlock } from \"../../nodeGeometryBlock\";\r\nimport type { NodeGeometryConnectionPoint } from \"../../nodeGeometryBlockConnectionPoint\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\nimport type { Mesh } from \"../../../../Meshes/mesh\";\r\nimport { VertexData } from \"../../../../Meshes/mesh.vertexData\";\r\nimport type { Nullable } from \"../../../../types\";\r\n\r\n/**\r\n * Defines a block used to generate a user defined mesh geometry data\r\n */\r\nexport class MeshBlock extends NodeGeometryBlock {\r\n private _mesh: Nullable<Mesh>;\r\n private _cachedVertexData: Nullable<VertexData> = null;\r\n\r\n /**\r\n * Gets or sets the mesh to use to get vertex data\r\n */\r\n public get mesh() {\r\n return this._mesh;\r\n }\r\n\r\n public set mesh(value: Nullable<Mesh>) {\r\n this._mesh = value;\r\n }\r\n\r\n /**\r\n * Create a new MeshBlock\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.registerOutput(\"geometry\", 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 getClassName() {\r\n return \"MeshBlock\";\r\n }\r\n\r\n /**\r\n * Gets the geometry output component\r\n */\r\n public get geometry(): NodeGeometryConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected _buildBlock() {\r\n if (!this._mesh) {\r\n if (this._cachedVertexData) {\r\n this.geometry._storedValue = this._cachedVertexData.clone();\r\n } else {\r\n this.geometry._storedValue = null;\r\n }\r\n return;\r\n }\r\n\r\n this.geometry._storedValue = VertexData.ExtractFromMesh(this._mesh, false, true);\r\n this._cachedVertexData = null;\r\n }\r\n\r\n /**\r\n * Serializes this block in a JSON representation *\r\n * @param saveMeshData defines a boolean indicating that mesh data must be saved as well\r\n * @returns the serialized block object\r\n */\r\n public serialize(saveMeshData?: boolean): any {\r\n const serializationObject = super.serialize();\r\n\r\n if (saveMeshData) {\r\n if (this._mesh) {\r\n serializationObject.cachedVertexData = VertexData.ExtractFromMesh(this._mesh, false, true).serialize();\r\n } else if (this._cachedVertexData) {\r\n serializationObject.cachedVertexData = this._cachedVertexData.serialize();\r\n }\r\n }\r\n\r\n return serializationObject;\r\n }\r\n\r\n public _deserialize(serializationObject: any) {\r\n super._deserialize(serializationObject);\r\n\r\n if (serializationObject.cachedVertexData) {\r\n this._cachedVertexData = VertexData.Parse(serializationObject.cachedVertexData);\r\n }\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.MeshBlock\", MeshBlock);\r\n"]}
1
+ {"version":3,"file":"meshBlock.js","sourceRoot":"","sources":["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F,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC;IAClC,CAAC;IAED;;;;OAIG;IACI,SAAS,CAAC,YAAsB;QACnC,MAAM,mBAAmB,GAAG,KAAK,CAAC,SAAS,EAAE,CAAC;QAE9C,IAAI,YAAY,EAAE;YACd,IAAI,IAAI,CAAC,KAAK,EAAE;gBACZ,mBAAmB,CAAC,gBAAgB,GAAG,UAAU,CAAC,eAAe,CAAC,IAAI,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC,SAAS,EAAE,CAAC;aAC1G;iBAAM,IAAI,IAAI,CAAC,iBAAiB,EAAE;gBAC/B,mBAAmB,CAAC,gBAAgB,GAAG,IAAI,CAAC,iBAAiB,CAAC,SAAS,EAAE,CAAC;aAC7E;SACJ;QAED,OAAO,mBAAmB,CAAC;IAC/B,CAAC;IAEM,YAAY,CAAC,mBAAwB;QACxC,KAAK,CAAC,YAAY,CAAC,mBAAmB,CAAC,CAAC;QAExC,IAAI,mBAAmB,CAAC,gBAAgB,EAAE;YACtC,IAAI,CAAC,iBAAiB,GAAG,UAAU,CAAC,KAAK,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,CAAC;SACnF;IACL,CAAC;CACJ;AAED,aAAa,CAAC,mBAAmB,EAAE,SAAS,CAAC,CAAC","sourcesContent":["import { NodeGeometryBlockConnectionPointTypes } from \"../../Enums/nodeGeometryConnectionPointTypes\";\r\nimport { NodeGeometryBlock } from \"../../nodeGeometryBlock\";\r\nimport type { NodeGeometryConnectionPoint } from \"../../nodeGeometryBlockConnectionPoint\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\nimport type { Mesh } from \"../../../../Meshes/mesh\";\r\nimport { VertexData } from \"../../../../Meshes/mesh.vertexData\";\r\nimport type { Nullable } from \"../../../../types\";\r\n\r\n/**\r\n * Defines a block used to generate a user defined mesh geometry data\r\n */\r\nexport class MeshBlock extends NodeGeometryBlock {\r\n private _mesh: Nullable<Mesh>;\r\n private _cachedVertexData: Nullable<VertexData> = null;\r\n\r\n /**\r\n * Gets or sets the mesh to use to get vertex data\r\n */\r\n public get mesh() {\r\n return this._mesh;\r\n }\r\n\r\n public set mesh(value: Nullable<Mesh>) {\r\n this._mesh = value;\r\n }\r\n\r\n /**\r\n * Create a new MeshBlock\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.registerOutput(\"geometry\", 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 getClassName() {\r\n return \"MeshBlock\";\r\n }\r\n\r\n /**\r\n * Gets the geometry output component\r\n */\r\n public get geometry(): NodeGeometryConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected _buildBlock() {\r\n if (!this._mesh) {\r\n if (this._cachedVertexData) {\r\n this.geometry._storedValue = this._cachedVertexData.clone();\r\n } else {\r\n this.geometry._storedValue = null;\r\n }\r\n return;\r\n }\r\n\r\n this.geometry._storedValue = VertexData.ExtractFromMesh(this._mesh, false, true);\r\n this._cachedVertexData = null;\r\n }\r\n\r\n /**\r\n * Serializes this block in a JSON representation\r\n * @param saveMeshData defines a boolean indicating that mesh data must be saved as well\r\n * @returns the serialized block object\r\n */\r\n public serialize(saveMeshData?: boolean): any {\r\n const serializationObject = super.serialize();\r\n\r\n if (saveMeshData) {\r\n if (this._mesh) {\r\n serializationObject.cachedVertexData = VertexData.ExtractFromMesh(this._mesh, false, true).serialize();\r\n } else if (this._cachedVertexData) {\r\n serializationObject.cachedVertexData = this._cachedVertexData.serialize();\r\n }\r\n }\r\n\r\n return serializationObject;\r\n }\r\n\r\n public _deserialize(serializationObject: any) {\r\n super._deserialize(serializationObject);\r\n\r\n if (serializationObject.cachedVertexData) {\r\n this._cachedVertexData = VertexData.Parse(serializationObject.cachedVertexData);\r\n }\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.MeshBlock\", MeshBlock);\r\n"]}
@@ -0,0 +1,22 @@
1
+ import { NodeGeometryBlock } from "../../nodeGeometryBlock";
2
+ import type { NodeGeometryConnectionPoint } from "../../nodeGeometryBlockConnectionPoint";
3
+ /**
4
+ * Defines a block used to generate a null geometry data
5
+ */
6
+ export declare class NullBlock extends NodeGeometryBlock {
7
+ /**
8
+ * Create a new NullBlock
9
+ * @param name defines the block name
10
+ */
11
+ constructor(name: string);
12
+ /**
13
+ * Gets the current class name
14
+ * @returns the class name
15
+ */
16
+ getClassName(): string;
17
+ /**
18
+ * Gets the geometry output component
19
+ */
20
+ get geometry(): NodeGeometryConnectionPoint;
21
+ protected _buildBlock(): void;
22
+ }
@@ -0,0 +1,34 @@
1
+ import { NodeGeometryBlockConnectionPointTypes } from "../../Enums/nodeGeometryConnectionPointTypes.js";
2
+ import { NodeGeometryBlock } from "../../nodeGeometryBlock.js";
3
+ import { RegisterClass } from "../../../../Misc/typeStore.js";
4
+ /**
5
+ * Defines a block used to generate a null geometry data
6
+ */
7
+ export class NullBlock extends NodeGeometryBlock {
8
+ /**
9
+ * Create a new NullBlock
10
+ * @param name defines the block name
11
+ */
12
+ constructor(name) {
13
+ super(name);
14
+ this.registerOutput("geometry", NodeGeometryBlockConnectionPointTypes.Geometry);
15
+ }
16
+ /**
17
+ * Gets the current class name
18
+ * @returns the class name
19
+ */
20
+ getClassName() {
21
+ return "NullBlock";
22
+ }
23
+ /**
24
+ * Gets the geometry output component
25
+ */
26
+ get geometry() {
27
+ return this._outputs[0];
28
+ }
29
+ _buildBlock() {
30
+ this.geometry._storedValue = null;
31
+ }
32
+ }
33
+ RegisterClass("BABYLON.NullBlock", NullBlock);
34
+ //# sourceMappingURL=nullBlock.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nullBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/Meshes/Node/Blocks/Sources/nullBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qCAAqC,EAAE,MAAM,8CAA8C,CAAC;AACrG,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAE5D,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAE3D;;GAEG;AACH,MAAM,OAAO,SAAU,SAAQ,iBAAiB;IAC5C;;;OAGG;IACH,YAAmB,IAAY;QAC3B,KAAK,CAAC,IAAI,CAAC,CAAC;QACZ,IAAI,CAAC,cAAc,CAAC,UAAU,EAAE,qCAAqC,CAAC,QAAQ,CAAC,CAAC;IACpF,CAAC;IAED;;;OAGG;IACI,YAAY;QACf,OAAO,WAAW,CAAC;IACvB,CAAC;IAED;;OAEG;IACH,IAAW,QAAQ;QACf,OAAO,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IAC5B,CAAC;IAES,WAAW;QACjB,IAAI,CAAC,QAAQ,CAAC,YAAY,GAAG,IAAI,CAAC;IACtC,CAAC;CACJ;AAED,aAAa,CAAC,mBAAmB,EAAE,SAAS,CAAC,CAAC","sourcesContent":["import { NodeGeometryBlockConnectionPointTypes } from \"../../Enums/nodeGeometryConnectionPointTypes\";\r\nimport { NodeGeometryBlock } from \"../../nodeGeometryBlock\";\r\nimport type { NodeGeometryConnectionPoint } from \"../../nodeGeometryBlockConnectionPoint\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\n\r\n/**\r\n * Defines a block used to generate a null geometry data\r\n */\r\nexport class NullBlock extends NodeGeometryBlock {\r\n /**\r\n * Create a new NullBlock\r\n * @param name defines the block name\r\n */\r\n public constructor(name: string) {\r\n super(name);\r\n this.registerOutput(\"geometry\", 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 getClassName() {\r\n return \"NullBlock\";\r\n }\r\n\r\n /**\r\n * Gets the geometry output component\r\n */\r\n public get geometry(): NodeGeometryConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected _buildBlock() {\r\n this.geometry._storedValue = null;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.NullBlock\", NullBlock);\r\n"]}
@@ -94,7 +94,7 @@ export class PlaneBlock extends NodeGeometryBlock {
94
94
  }
95
95
  }
96
96
  _dumpPropertiesCode() {
97
- const codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.evaluateContext = ${this.evaluateContext ? "true" : "false"};\r\n`;
97
+ const codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.evaluateContext = ${this.evaluateContext ? "true" : "false"};\n`;
98
98
  return codeString;
99
99
  }
100
100
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"planeBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/Meshes/Node/Blocks/Sources/planeBlock.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,0CAA0C,CAAC;AACjF,OAAO,EAAE,qCAAqC,EAAE,MAAM,8CAA8C,CAAC;AACrG,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAG5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAE3D,OAAO,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAEtG;;GAEG;AACH,MAAM,OAAO,UAAW,SAAQ,iBAAiB;IAQ7C;;;OAGG;IACH,YAAmB,IAAY;QAC3B,KAAK,CAAC,IAAI,CAAC,CAAC;QAZhB;;;WAGG;QAEI,oBAAe,GAAG,KAAK,CAAC;QAS3B,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE,qCAAqC,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QACjF,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,qCAAqC,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QAClF,IAAI,CAAC,aAAa,CAAC,QAAQ,EAAE,qCAAqC,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;Q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AAK,CAAC,YAAY,CAAC,mBAAmB,CAAC,CAAC;QAExC,IAAI,CAAC,eAAe,GAAG,mBAAmB,CAAC,eAAe,CAAC;IAC/D,CAAC;CACJ;AArHU;IADN,sBAAsB,CAAC,kBAAkB,EAAE,sBAAsB,CAAC,OAAO,EAAE,UAAU,EAAE,EAAE,SAAS,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,CAAC;mDAC1F;AAuHnC,aAAa,CAAC,oBAAoB,EAAE,UAAU,CAAC,CAAC","sourcesContent":["import { CreatePlaneVertexData } from \"../../../../Meshes/Builders/planeBuilder\";\r\nimport { NodeGeometryBlockConnectionPointTypes } from \"../../Enums/nodeGeometryConnectionPointTypes\";\r\nimport { NodeGeometryBlock } from \"../../nodeGeometryBlock\";\r\nimport type { NodeGeometryConnectionPoint } from \"../../nodeGeometryBlockConnectionPoint\";\r\nimport type { NodeGeometryBuildState } from \"../../nodeGeometryBuildState\";\r\nimport { GeometryInputBlock } from \"../geometryInputBlock\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\nimport type { Vector4 } from \"../../../../Maths/math.vector\";\r\nimport { PropertyTypeForEdition, editableInPropertyPage } from \"../../../../Decorators/nodeDecorator\";\r\n\r\n/**\r\n * Defines a block used to generate plane geometry data\r\n */\r\nexport class PlaneBlock extends NodeGeometryBlock {\r\n /**\r\n * Gets or sets a boolean indicating that this block can evaluate context\r\n * Build performance is improved when this value is set to false as the system will cache values instead of reevaluating everything per context change\r\n */\r\n @editableInPropertyPage(\"Evaluate context\", PropertyTypeForEdition.Boolean, \"ADVANCED\", { notifiers: { rebuild: true } })\r\n public evaluateContext = false;\r\n\r\n /**\r\n * Create a new PlaneBlock\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(\"size\", NodeGeometryBlockConnectionPointTypes.Float, true, 1);\r\n this.registerInput(\"width\", NodeGeometryBlockConnectionPointTypes.Float, true, 0);\r\n this.registerInput(\"height\", NodeGeometryBlockConnectionPointTypes.Float, true, 0);\r\n\r\n this.registerOutput(\"geometry\", 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 getClassName() {\r\n return \"PlaneBlock\";\r\n }\r\n\r\n /**\r\n * Gets the size input component\r\n */\r\n public get size(): NodeGeometryConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the width input component\r\n */\r\n public get width(): NodeGeometryConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the height input component\r\n */\r\n public get height(): NodeGeometryConnectionPoint {\r\n return this._inputs[2];\r\n }\r\n\r\n /**\r\n * Gets the geometry output component\r\n */\r\n public get geometry(): NodeGeometryConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n public autoConfigure() {\r\n if (this.size.isConnected) {\r\n return;\r\n }\r\n\r\n if (!this.width.isConnected && !this.height.isConnected) {\r\n const sizeInput = new GeometryInputBlock(\"Size\");\r\n sizeInput.value = 1;\r\n sizeInput.output.connectTo(this.size);\r\n return;\r\n }\r\n\r\n if (!this.width.isConnected) {\r\n const widthInput = new GeometryInputBlock(\"Width\");\r\n widthInput.value = 1;\r\n widthInput.output.connectTo(this.width);\r\n }\r\n\r\n if (!this.height.isConnected) {\r\n const heightInput = new GeometryInputBlock(\"Height\");\r\n heightInput.value = 1;\r\n heightInput.output.connectTo(this.height);\r\n }\r\n }\r\n\r\n protected _buildBlock(state: NodeGeometryBuildState) {\r\n const options: { size?: number; width?: number; height?: number; sideOrientation?: number; frontUVs?: Vector4; backUVs?: Vector4 } = {};\r\n const func = (state: NodeGeometryBuildState) => {\r\n options.size = this.size.getConnectedValue(state);\r\n options.width = this.width.getConnectedValue(state);\r\n options.height = this.height.getConnectedValue(state);\r\n\r\n // Append vertex data from the plane builder\r\n return CreatePlaneVertexData(options);\r\n };\r\n\r\n if (this.evaluateContext) {\r\n this.geometry._storedFunction = func;\r\n } else {\r\n this.geometry._storedValue = func(state);\r\n }\r\n }\r\n\r\n protected _dumpPropertiesCode() {\r\n const codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.evaluateContext = ${this.evaluateContext ? \"true\" : \"false\"};\\r\\n`;\r\n return codeString;\r\n }\r\n\r\n /**\r\n * Serializes this block in a JSON representation\r\n * @returns the serialized block object\r\n */\r\n public serialize(): any {\r\n const serializationObject = super.serialize();\r\n\r\n serializationObject.evaluateContext = this.evaluateContext;\r\n\r\n return serializationObject;\r\n }\r\n\r\n public _deserialize(serializationObject: any) {\r\n super._deserialize(serializationObject);\r\n\r\n this.evaluateContext = serializationObject.evaluateContext;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.PlaneBlock\", PlaneBlock);\r\n"]}
1
+ {"version":3,"file":"planeBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/Meshes/Node/Blocks/Sources/planeBlock.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,0CAA0C,CAAC;AACjF,OAAO,EAAE,qCAAqC,EAAE,MAAM,8CAA8C,CAAC;AACrG,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAG5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAE3D,OAAO,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAEtG;;GAEG;AACH,MAAM,OAAO,UAAW,SAAQ,iBAAiB;IAQ7C;;;OAGG;IACH,YAAmB,IAAY;QAC3B,KAAK,CAAC,IAAI,CAAC,CAAC;QAZhB;;;WAGG;QAEI,oBAAe,GAAG,KAAK,CAAC;QAS3B,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE,qCAAqC,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QACjF,IAAI,CAAC,aAAa,CAAC,OAAO,EAA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AK,CAAC,SAAS,EAAE,CAAC;QAE9C,mBAAmB,CAAC,eAAe,GAAG,IAAI,CAAC,eAAe,CAAC;QAE3D,OAAO,mBAAmB,CAAC;IAC/B,CAAC;IAEM,YAAY,CAAC,mBAAwB;QACxC,KAAK,CAAC,YAAY,CAAC,mBAAmB,CAAC,CAAC;QAExC,IAAI,CAAC,eAAe,GAAG,mBAAmB,CAAC,eAAe,CAAC;IAC/D,CAAC;CACJ;AArHU;IADN,sBAAsB,CAAC,kBAAkB,EAAE,sBAAsB,CAAC,OAAO,EAAE,UAAU,EAAE,EAAE,SAAS,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,CAAC;mDAC1F;AAuHnC,aAAa,CAAC,oBAAoB,EAAE,UAAU,CAAC,CAAC","sourcesContent":["import { CreatePlaneVertexData } from \"../../../../Meshes/Builders/planeBuilder\";\r\nimport { NodeGeometryBlockConnectionPointTypes } from \"../../Enums/nodeGeometryConnectionPointTypes\";\r\nimport { NodeGeometryBlock } from \"../../nodeGeometryBlock\";\r\nimport type { NodeGeometryConnectionPoint } from \"../../nodeGeometryBlockConnectionPoint\";\r\nimport type { NodeGeometryBuildState } from \"../../nodeGeometryBuildState\";\r\nimport { GeometryInputBlock } from \"../geometryInputBlock\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\nimport type { Vector4 } from \"../../../../Maths/math.vector\";\r\nimport { PropertyTypeForEdition, editableInPropertyPage } from \"../../../../Decorators/nodeDecorator\";\r\n\r\n/**\r\n * Defines a block used to generate plane geometry data\r\n */\r\nexport class PlaneBlock extends NodeGeometryBlock {\r\n /**\r\n * Gets or sets a boolean indicating that this block can evaluate context\r\n * Build performance is improved when this value is set to false as the system will cache values instead of reevaluating everything per context change\r\n */\r\n @editableInPropertyPage(\"Evaluate context\", PropertyTypeForEdition.Boolean, \"ADVANCED\", { notifiers: { rebuild: true } })\r\n public evaluateContext = false;\r\n\r\n /**\r\n * Create a new PlaneBlock\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(\"size\", NodeGeometryBlockConnectionPointTypes.Float, true, 1);\r\n this.registerInput(\"width\", NodeGeometryBlockConnectionPointTypes.Float, true, 0);\r\n this.registerInput(\"height\", NodeGeometryBlockConnectionPointTypes.Float, true, 0);\r\n\r\n this.registerOutput(\"geometry\", 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 getClassName() {\r\n return \"PlaneBlock\";\r\n }\r\n\r\n /**\r\n * Gets the size input component\r\n */\r\n public get size(): NodeGeometryConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the width input component\r\n */\r\n public get width(): NodeGeometryConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the height input component\r\n */\r\n public get height(): NodeGeometryConnectionPoint {\r\n return this._inputs[2];\r\n }\r\n\r\n /**\r\n * Gets the geometry output component\r\n */\r\n public get geometry(): NodeGeometryConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n public autoConfigure() {\r\n if (this.size.isConnected) {\r\n return;\r\n }\r\n\r\n if (!this.width.isConnected && !this.height.isConnected) {\r\n const sizeInput = new GeometryInputBlock(\"Size\");\r\n sizeInput.value = 1;\r\n sizeInput.output.connectTo(this.size);\r\n return;\r\n }\r\n\r\n if (!this.width.isConnected) {\r\n const widthInput = new GeometryInputBlock(\"Width\");\r\n widthInput.value = 1;\r\n widthInput.output.connectTo(this.width);\r\n }\r\n\r\n if (!this.height.isConnected) {\r\n const heightInput = new GeometryInputBlock(\"Height\");\r\n heightInput.value = 1;\r\n heightInput.output.connectTo(this.height);\r\n }\r\n }\r\n\r\n protected _buildBlock(state: NodeGeometryBuildState) {\r\n const options: { size?: number; width?: number; height?: number; sideOrientation?: number; frontUVs?: Vector4; backUVs?: Vector4 } = {};\r\n const func = (state: NodeGeometryBuildState) => {\r\n options.size = this.size.getConnectedValue(state);\r\n options.width = this.width.getConnectedValue(state);\r\n options.height = this.height.getConnectedValue(state);\r\n\r\n // Append vertex data from the plane builder\r\n return CreatePlaneVertexData(options);\r\n };\r\n\r\n if (this.evaluateContext) {\r\n this.geometry._storedFunction = func;\r\n } else {\r\n this.geometry._storedValue = func(state);\r\n }\r\n }\r\n\r\n protected _dumpPropertiesCode() {\r\n const codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.evaluateContext = ${this.evaluateContext ? \"true\" : \"false\"};\\n`;\r\n return codeString;\r\n }\r\n\r\n /**\r\n * Serializes this block in a JSON representation\r\n * @returns the serialized block object\r\n */\r\n public serialize(): any {\r\n const serializationObject = super.serialize();\r\n\r\n serializationObject.evaluateContext = this.evaluateContext;\r\n\r\n return serializationObject;\r\n }\r\n\r\n public _deserialize(serializationObject: any) {\r\n super._deserialize(serializationObject);\r\n\r\n this.evaluateContext = serializationObject.evaluateContext;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.PlaneBlock\", PlaneBlock);\r\n"]}
@@ -112,7 +112,7 @@ export class SphereBlock extends NodeGeometryBlock {
112
112
  }
113
113
  }
114
114
  _dumpPropertiesCode() {
115
- const codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.evaluateContext = ${this.evaluateContext ? "true" : "false"};\r\n`;
115
+ const codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.evaluateContext = ${this.evaluateContext ? "true" : "false"};\n`;
116
116
  return codeString;
117
117
  }
118
118
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"sphereBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/Meshes/Node/Blocks/Sources/sphereBlock.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,qCAAqC,EAAE,MAAM,8CAA8C,CAAC;AACrG,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAG5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MA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eAAe,CAAC;IAC/D,CAAC;CACJ;AApJU;IADN,sBAAsB,CAAC,kBAAkB,EAAE,sBAAsB,CAAC,OAAO,EAAE,UAAU,EAAE,EAAE,SAAS,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,CAAC;oDAC1F;AAsJnC,aAAa,CAAC,qBAAqB,EAAE,WAAW,CAAC,CAAC","sourcesContent":["import { NodeGeometryBlockConnectionPointTypes } from \"../../Enums/nodeGeometryConnectionPointTypes\";\r\nimport { NodeGeometryBlock } from \"../../nodeGeometryBlock\";\r\nimport type { NodeGeometryConnectionPoint } from \"../../nodeGeometryBlockConnectionPoint\";\r\nimport type { NodeGeometryBuildState } from \"../../nodeGeometryBuildState\";\r\nimport { GeometryInputBlock } from \"../geometryInputBlock\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\nimport type { Vector4 } from \"../../../../Maths/math.vector\";\r\nimport { CreateSphereVertexData } from \"core/Meshes/Builders/sphereBuilder\";\r\nimport { PropertyTypeForEdition, editableInPropertyPage } from \"../../../../Decorators/nodeDecorator\";\r\n\r\n/**\r\n * Defines a block used to generate sphere geometry data\r\n */\r\nexport class SphereBlock extends NodeGeometryBlock {\r\n /**\r\n * Gets or sets a boolean indicating that this block can evaluate context\r\n * Build performance is improved when this value is set to false as the system will cache values instead of reevaluating everything per context change\r\n */\r\n @editableInPropertyPage(\"Evaluate context\", PropertyTypeForEdition.Boolean, \"ADVANCED\", { notifiers: { rebuild: true } })\r\n public evaluateContext = false;\r\n\r\n /**\r\n * Create a new SphereBlock\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(\"segments\", NodeGeometryBlockConnectionPointTypes.Int, true, 32);\r\n this.registerInput(\"diameter\", NodeGeometryBlockConnectionPointTypes.Float, true, 1);\r\n this.registerInput(\"diameterX\", NodeGeometryBlockConnectionPointTypes.Float, true, 0);\r\n this.registerInput(\"diameterY\", NodeGeometryBlockConnectionPointTypes.Float, true, 0);\r\n this.registerInput(\"diameterZ\", NodeGeometryBlockConnectionPointTypes.Float, true, 0);\r\n this.registerInput(\"arc\", NodeGeometryBlockConnectionPointTypes.Float, true, 1);\r\n this.registerInput(\"slice\", NodeGeometryBlockConnectionPointTypes.Float, true, 1);\r\n\r\n this.registerOutput(\"geometry\", 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 getClassName() {\r\n return \"SphereBlock\";\r\n }\r\n\r\n /**\r\n * Gets the segments input component\r\n */\r\n public get segments(): NodeGeometryConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the diameter input component\r\n */\r\n public get diameter(): NodeGeometryConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the diameterX input component\r\n */\r\n public get diameterX(): NodeGeometryConnectionPoint {\r\n return this._inputs[2];\r\n }\r\n\r\n /**\r\n * Gets the diameterY input component\r\n */\r\n public get diameterY(): NodeGeometryConnectionPoint {\r\n return this._inputs[3];\r\n }\r\n\r\n /**\r\n * Gets the diameterZ input component\r\n */\r\n public get diameterZ(): NodeGeometryConnectionPoint {\r\n return this._inputs[4];\r\n }\r\n\r\n /**\r\n * Gets the arc input component\r\n */\r\n public get arc(): NodeGeometryConnectionPoint {\r\n return this._inputs[5];\r\n }\r\n\r\n /**\r\n * Gets the slice input component\r\n */\r\n public get slice(): NodeGeometryConnectionPoint {\r\n return this._inputs[6];\r\n }\r\n\r\n /**\r\n * Gets the geometry output component\r\n */\r\n public get geometry(): NodeGeometryConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n public autoConfigure() {\r\n if (!this.diameter.isConnected) {\r\n const diameterInput = new GeometryInputBlock(\"Diameter\");\r\n diameterInput.value = 1;\r\n diameterInput.output.connectTo(this.diameter);\r\n }\r\n }\r\n\r\n protected _buildBlock(state: NodeGeometryBuildState) {\r\n const options: {\r\n segments?: number;\r\n diameter?: number;\r\n diameterX?: number;\r\n diameterY?: number;\r\n diameterZ?: number;\r\n arc?: number;\r\n slice?: number;\r\n sideOrientation?: number;\r\n frontUVs?: Vector4;\r\n backUVs?: Vector4;\r\n dedupTopBottomIndices?: boolean;\r\n } = {};\r\n const func = (state: NodeGeometryBuildState) => {\r\n options.segments = this.segments.getConnectedValue(state);\r\n options.diameter = this.diameter.getConnectedValue(state);\r\n options.diameterX = this.diameterX.getConnectedValue(state);\r\n options.diameterY = this.diameterY.getConnectedValue(state);\r\n options.diameterZ = this.diameterZ.getConnectedValue(state);\r\n options.arc = this.arc.getConnectedValue(state);\r\n options.slice = this.slice.getConnectedValue(state);\r\n\r\n // Append vertex data from the plane builder\r\n return CreateSphereVertexData(options);\r\n };\r\n\r\n if (this.evaluateContext) {\r\n this.geometry._storedFunction = func;\r\n } else {\r\n this.geometry._storedValue = func(state);\r\n }\r\n }\r\n\r\n protected _dumpPropertiesCode() {\r\n const codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.evaluateContext = ${this.evaluateContext ? \"true\" : \"false\"};\\r\\n`;\r\n return codeString;\r\n }\r\n\r\n /**\r\n * Serializes this block in a JSON representation\r\n * @returns the serialized block object\r\n */\r\n public serialize(): any {\r\n const serializationObject = super.serialize();\r\n\r\n serializationObject.evaluateContext = this.evaluateContext;\r\n\r\n return serializationObject;\r\n }\r\n\r\n public _deserialize(serializationObject: any) {\r\n super._deserialize(serializationObject);\r\n\r\n this.evaluateContext = serializationObject.evaluateContext;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.SphereBlock\", SphereBlock);\r\n"]}
1
+ {"version":3,"file":"sphereBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/Meshes/Node/Blocks/Sources/sphereBlock.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,qCAAqC,EAAE,MAAM,8CAA8C,CAAC;AACrG,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAG5D,OAAO,EAAE,kBAAkB,EAA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CAAC,CAAC;QAExC,IAAI,CAAC,eAAe,GAAG,mBAAmB,CAAC,eAAe,CAAC;IAC/D,CAAC;CACJ;AApJU;IADN,sBAAsB,CAAC,kBAAkB,EAAE,sBAAsB,CAAC,OAAO,EAAE,UAAU,EAAE,EAAE,SAAS,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,CAAC;oDAC1F;AAsJnC,aAAa,CAAC,qBAAqB,EAAE,WAAW,CAAC,CAAC","sourcesContent":["import { NodeGeometryBlockConnectionPointTypes } from \"../../Enums/nodeGeometryConnectionPointTypes\";\r\nimport { NodeGeometryBlock } from \"../../nodeGeometryBlock\";\r\nimport type { NodeGeometryConnectionPoint } from \"../../nodeGeometryBlockConnectionPoint\";\r\nimport type { NodeGeometryBuildState } from \"../../nodeGeometryBuildState\";\r\nimport { GeometryInputBlock } from \"../geometryInputBlock\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\nimport type { Vector4 } from \"../../../../Maths/math.vector\";\r\nimport { CreateSphereVertexData } from \"core/Meshes/Builders/sphereBuilder\";\r\nimport { PropertyTypeForEdition, editableInPropertyPage } from \"../../../../Decorators/nodeDecorator\";\r\n\r\n/**\r\n * Defines a block used to generate sphere geometry data\r\n */\r\nexport class SphereBlock extends NodeGeometryBlock {\r\n /**\r\n * Gets or sets a boolean indicating that this block can evaluate context\r\n * Build performance is improved when this value is set to false as the system will cache values instead of reevaluating everything per context change\r\n */\r\n @editableInPropertyPage(\"Evaluate context\", PropertyTypeForEdition.Boolean, \"ADVANCED\", { notifiers: { rebuild: true } })\r\n public evaluateContext = false;\r\n\r\n /**\r\n * Create a new SphereBlock\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(\"segments\", NodeGeometryBlockConnectionPointTypes.Int, true, 32);\r\n this.registerInput(\"diameter\", NodeGeometryBlockConnectionPointTypes.Float, true, 1);\r\n this.registerInput(\"diameterX\", NodeGeometryBlockConnectionPointTypes.Float, true, 0);\r\n this.registerInput(\"diameterY\", NodeGeometryBlockConnectionPointTypes.Float, true, 0);\r\n this.registerInput(\"diameterZ\", NodeGeometryBlockConnectionPointTypes.Float, true, 0);\r\n this.registerInput(\"arc\", NodeGeometryBlockConnectionPointTypes.Float, true, 1);\r\n this.registerInput(\"slice\", NodeGeometryBlockConnectionPointTypes.Float, true, 1);\r\n\r\n this.registerOutput(\"geometry\", 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 getClassName() {\r\n return \"SphereBlock\";\r\n }\r\n\r\n /**\r\n * Gets the segments input component\r\n */\r\n public get segments(): NodeGeometryConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the diameter input component\r\n */\r\n public get diameter(): NodeGeometryConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the diameterX input component\r\n */\r\n public get diameterX(): NodeGeometryConnectionPoint {\r\n return this._inputs[2];\r\n }\r\n\r\n /**\r\n * Gets the diameterY input component\r\n */\r\n public get diameterY(): NodeGeometryConnectionPoint {\r\n return this._inputs[3];\r\n }\r\n\r\n /**\r\n * Gets the diameterZ input component\r\n */\r\n public get diameterZ(): NodeGeometryConnectionPoint {\r\n return this._inputs[4];\r\n }\r\n\r\n /**\r\n * Gets the arc input component\r\n */\r\n public get arc(): NodeGeometryConnectionPoint {\r\n return this._inputs[5];\r\n }\r\n\r\n /**\r\n * Gets the slice input component\r\n */\r\n public get slice(): NodeGeometryConnectionPoint {\r\n return this._inputs[6];\r\n }\r\n\r\n /**\r\n * Gets the geometry output component\r\n */\r\n public get geometry(): NodeGeometryConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n public autoConfigure() {\r\n if (!this.diameter.isConnected) {\r\n const diameterInput = new GeometryInputBlock(\"Diameter\");\r\n diameterInput.value = 1;\r\n diameterInput.output.connectTo(this.diameter);\r\n }\r\n }\r\n\r\n protected _buildBlock(state: NodeGeometryBuildState) {\r\n const options: {\r\n segments?: number;\r\n diameter?: number;\r\n diameterX?: number;\r\n diameterY?: number;\r\n diameterZ?: number;\r\n arc?: number;\r\n slice?: number;\r\n sideOrientation?: number;\r\n frontUVs?: Vector4;\r\n backUVs?: Vector4;\r\n dedupTopBottomIndices?: boolean;\r\n } = {};\r\n const func = (state: NodeGeometryBuildState) => {\r\n options.segments = this.segments.getConnectedValue(state);\r\n options.diameter = this.diameter.getConnectedValue(state);\r\n options.diameterX = this.diameterX.getConnectedValue(state);\r\n options.diameterY = this.diameterY.getConnectedValue(state);\r\n options.diameterZ = this.diameterZ.getConnectedValue(state);\r\n options.arc = this.arc.getConnectedValue(state);\r\n options.slice = this.slice.getConnectedValue(state);\r\n\r\n // Append vertex data from the plane builder\r\n return CreateSphereVertexData(options);\r\n };\r\n\r\n if (this.evaluateContext) {\r\n this.geometry._storedFunction = func;\r\n } else {\r\n this.geometry._storedValue = func(state);\r\n }\r\n }\r\n\r\n protected _dumpPropertiesCode() {\r\n const codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.evaluateContext = ${this.evaluateContext ? \"true\" : \"false\"};\\n`;\r\n return codeString;\r\n }\r\n\r\n /**\r\n * Serializes this block in a JSON representation\r\n * @returns the serialized block object\r\n */\r\n public serialize(): any {\r\n const serializationObject = super.serialize();\r\n\r\n serializationObject.evaluateContext = this.evaluateContext;\r\n\r\n return serializationObject;\r\n }\r\n\r\n public _deserialize(serializationObject: any) {\r\n super._deserialize(serializationObject);\r\n\r\n this.evaluateContext = serializationObject.evaluateContext;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.SphereBlock\", SphereBlock);\r\n"]}
@@ -11,7 +11,7 @@ export declare class TorusBlock extends NodeGeometryBlock {
11
11
  */
12
12
  evaluateContext: boolean;
13
13
  /**
14
- * Create a new SphereBlock
14
+ * Create a new TorusBlock
15
15
  * @param name defines the block name
16
16
  */
17
17
  constructor(name: string);
@@ -10,7 +10,7 @@ import { PropertyTypeForEdition, editableInPropertyPage } from "../../../../Deco
10
10
  */
11
11
  export class TorusBlock extends NodeGeometryBlock {
12
12
  /**
13
- * Create a new SphereBlock
13
+ * Create a new TorusBlock
14
14
  * @param name defines the block name
15
15
  */
16
16
  constructor(name) {
@@ -80,7 +80,7 @@ export class TorusBlock extends NodeGeometryBlock {
80
80
  }
81
81
  }
82
82
  _dumpPropertiesCode() {
83
- const codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.evaluateContext = ${this.evaluateContext ? "true" : "false"};\r\n`;
83
+ const codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.evaluateContext = ${this.evaluateContext ? "true" : "false"};\n`;
84
84
  return codeString;
85
85
  }
86
86
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"torusBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/Meshes/Node/Blocks/Sources/torusBlock.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,qCAAqC,EAAE,MAAM,8CAA8C,CAAC;AACrG,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAG5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAE3D,OAAO,EAAE,qBAAqB,EAAE,0CAA0C;AAC1E,OAAO,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAEtG;;GAEG;AACH,MAAM,OAAO,UAAW,SAAQ,iBAAiB;IAQ7C;;;OAGG;IACH,YAAmB,IAAY;QAC3B,KAAK,CAAC,IAAI,CAAC,CAAC;QAZhB;;;WAGG;QAEI,oBAAe,GAAG,KAAK,CAAC;QAS3B,IAAI,CAAC,aAAa,CAAC,UAAU,EAAE,qCAAqC,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QACrF,IAAI,CAAC,aAAa,CAAC,WAAW,EAAE,qCAAqC,CAAC,KAAK,EAAE,IAAI,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GAAG,IAAI,CAAC,YAAY,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;YAElE,4CAA4C;YAC5C,OAAO,qBAAqB,CAAC,OAAO,CAAC,CAAC;QAC1C,CAAC,CAAC;QAEF,IAAI,IAAI,CAAC,eAAe,EAAE;YACtB,IAAI,CAAC,QAAQ,CAAC,eAAe,GAAG,IAAI,CAAC;SACxC;aAAM;YACH,IAAI,CAAC,QAAQ,CAAC,YAAY,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC;SAC5C;IACL,CAAC;IAES,mBAAmB;QACzB,MAAM,UAAU,GAAG,KAAK,CAAC,mBAAmB,EAAE,GAAG,GAAG,IAAI,CAAC,iBAAiB,sBAAsB,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,OAAO,CAAC;QAC/I,OAAO,UAAU,CAAC;IACtB,CAAC;IAED;;;OAGG;IACI,SAAS;QACZ,MAAM,mBAAmB,GAAG,KAAK,CAAC,SAAS,EAAE,CAAC;QAE9C,mBAAmB,CAAC,eAAe,GAAG,IAAI,CAAC,eAAe,CAAC;QAE3D,OAAO,mBAAmB,CAAC;IAC/B,CAAC;IAEM,YAAY,CAAC,mBAAwB;QACxC,KAAK,CAAC,YAAY,CAAC,mBAAmB,CAAC,CAAC;QAExC,IAAI,CAAC,eAAe,GAAG,mBAAmB,CAAC,eAAe,CAAC;IAC/D,CAAC;CACJ;AA3GU;IADN,sBAAsB,CAAC,kBAAkB,EAAE,sBAAsB,CAAC,OAAO,EAAE,UAAU,EAAE,EAAE,SAAS,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,CAAC;mDAC1F;AA6GnC,aAAa,CAAC,oBAAoB,EAAE,UAAU,CAAC,CAAC","sourcesContent":["import { NodeGeometryBlockConnectionPointTypes } from \"../../Enums/nodeGeometryConnectionPointTypes\";\r\nimport { NodeGeometryBlock } from \"../../nodeGeometryBlock\";\r\nimport type { NodeGeometryConnectionPoint } from \"../../nodeGeometryBlockConnectionPoint\";\r\nimport type { NodeGeometryBuildState } from \"../../nodeGeometryBuildState\";\r\nimport { GeometryInputBlock } from \"../geometryInputBlock\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\nimport type { Vector4 } from \"../../../../Maths/math.vector\";\r\nimport { CreateTorusVertexData } from \"core/Meshes/Builders/torusBuilder\";\r\nimport { PropertyTypeForEdition, editableInPropertyPage } from \"../../../../Decorators/nodeDecorator\";\r\n\r\n/**\r\n * Defines a block used to generate torus geometry data\r\n */\r\nexport class TorusBlock extends NodeGeometryBlock {\r\n /**\r\n * Gets or sets a boolean indicating that this block can evaluate context\r\n * Build performance is improved when this value is set to false as the system will cache values instead of reevaluating everything per context change\r\n */\r\n @editableInPropertyPage(\"Evaluate context\", PropertyTypeForEdition.Boolean, \"ADVANCED\", { notifiers: { rebuild: true } })\r\n public evaluateContext = false;\r\n\r\n /**\r\n * Create a new SphereBlock\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(\"diameter\", NodeGeometryBlockConnectionPointTypes.Float, true, 1);\r\n this.registerInput(\"thickness\", NodeGeometryBlockConnectionPointTypes.Float, true, 0.5);\r\n this.registerInput(\"tessellation\", NodeGeometryBlockConnectionPointTypes.Int, true, 16);\r\n\r\n this.registerOutput(\"geometry\", 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 getClassName() {\r\n return \"TorusBlock\";\r\n }\r\n\r\n /**\r\n * Gets the diameter input component\r\n */\r\n public get diameter(): NodeGeometryConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the thickness input component\r\n */\r\n public get thickness(): NodeGeometryConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the tessellation input component\r\n */\r\n public get tessellation(): NodeGeometryConnectionPoint {\r\n return this._inputs[2];\r\n }\r\n\r\n /**\r\n * Gets the geometry output component\r\n */\r\n public get geometry(): NodeGeometryConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n public autoConfigure() {\r\n if (!this.diameter.isConnected) {\r\n const diameterInput = new GeometryInputBlock(\"Diameter\");\r\n diameterInput.value = 1;\r\n diameterInput.output.connectTo(this.diameter);\r\n }\r\n }\r\n\r\n protected _buildBlock(state: NodeGeometryBuildState) {\r\n const options: {\r\n diameter?: number;\r\n thickness?: number;\r\n tessellation?: number;\r\n sideOrientation?: number;\r\n frontUVs?: Vector4;\r\n backUVs?: Vector4;\r\n } = {};\r\n const func = (state: NodeGeometryBuildState) => {\r\n options.thickness = this.thickness.getConnectedValue(state);\r\n options.diameter = this.diameter.getConnectedValue(state);\r\n options.tessellation = this.tessellation.getConnectedValue(state);\r\n\r\n // Append vertex data from the plane builder\r\n return CreateTorusVertexData(options);\r\n };\r\n\r\n if (this.evaluateContext) {\r\n this.geometry._storedFunction = func;\r\n } else {\r\n this.geometry._storedValue = func(state);\r\n }\r\n }\r\n\r\n protected _dumpPropertiesCode() {\r\n const codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.evaluateContext = ${this.evaluateContext ? \"true\" : \"false\"};\\r\\n`;\r\n return codeString;\r\n }\r\n\r\n /**\r\n * Serializes this block in a JSON representation\r\n * @returns the serialized block object\r\n */\r\n public serialize(): any {\r\n const serializationObject = super.serialize();\r\n\r\n serializationObject.evaluateContext = this.evaluateContext;\r\n\r\n return serializationObject;\r\n }\r\n\r\n public _deserialize(serializationObject: any) {\r\n super._deserialize(serializationObject);\r\n\r\n this.evaluateContext = serializationObject.evaluateContext;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.TorusBlock\", TorusBlock);\r\n"]}
1
+ {"version":3,"file":"torusBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/Meshes/Node/Blocks/Sources/torusBlock.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,qCAAqC,EAAE,MAAM,8CAA8C,CAAC;AACrG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AS,EAAE,CAAC;QAE9C,mBAAmB,CAAC,eAAe,GAAG,IAAI,CAAC,eAAe,CAAC;QAE3D,OAAO,mBAAmB,CAAC;IAC/B,CAAC;IAEM,YAAY,CAAC,mBAAwB;QACxC,KAAK,CAAC,YAAY,CAAC,mBAAmB,CAAC,CAAC;QAExC,IAAI,CAAC,eAAe,GAAG,mBAAmB,CAAC,eAAe,CAAC;IAC/D,CAAC;CACJ;AA3GU;IADN,sBAAsB,CAAC,kBAAkB,EAAE,sBAAsB,CAAC,OAAO,EAAE,UAAU,EAAE,EAAE,SAAS,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,CAAC;mDAC1F;AA6GnC,aAAa,CAAC,oBAAoB,EAAE,UAAU,CAAC,CAAC","sourcesContent":["import { NodeGeometryBlockConnectionPointTypes } from \"../../Enums/nodeGeometryConnectionPointTypes\";\r\nimport { NodeGeometryBlock } from \"../../nodeGeometryBlock\";\r\nimport type { NodeGeometryConnectionPoint } from \"../../nodeGeometryBlockConnectionPoint\";\r\nimport type { NodeGeometryBuildState } from \"../../nodeGeometryBuildState\";\r\nimport { GeometryInputBlock } from \"../geometryInputBlock\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\nimport type { Vector4 } from \"../../../../Maths/math.vector\";\r\nimport { CreateTorusVertexData } from \"core/Meshes/Builders/torusBuilder\";\r\nimport { PropertyTypeForEdition, editableInPropertyPage } from \"../../../../Decorators/nodeDecorator\";\r\n\r\n/**\r\n * Defines a block used to generate torus geometry data\r\n */\r\nexport class TorusBlock extends NodeGeometryBlock {\r\n /**\r\n * Gets or sets a boolean indicating that this block can evaluate context\r\n * Build performance is improved when this value is set to false as the system will cache values instead of reevaluating everything per context change\r\n */\r\n @editableInPropertyPage(\"Evaluate context\", PropertyTypeForEdition.Boolean, \"ADVANCED\", { notifiers: { rebuild: true } })\r\n public evaluateContext = false;\r\n\r\n /**\r\n * Create a new TorusBlock\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(\"diameter\", NodeGeometryBlockConnectionPointTypes.Float, true, 1);\r\n this.registerInput(\"thickness\", NodeGeometryBlockConnectionPointTypes.Float, true, 0.5);\r\n this.registerInput(\"tessellation\", NodeGeometryBlockConnectionPointTypes.Int, true, 16);\r\n\r\n this.registerOutput(\"geometry\", 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 getClassName() {\r\n return \"TorusBlock\";\r\n }\r\n\r\n /**\r\n * Gets the diameter input component\r\n */\r\n public get diameter(): NodeGeometryConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the thickness input component\r\n */\r\n public get thickness(): NodeGeometryConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the tessellation input component\r\n */\r\n public get tessellation(): NodeGeometryConnectionPoint {\r\n return this._inputs[2];\r\n }\r\n\r\n /**\r\n * Gets the geometry output component\r\n */\r\n public get geometry(): NodeGeometryConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n public autoConfigure() {\r\n if (!this.diameter.isConnected) {\r\n const diameterInput = new GeometryInputBlock(\"Diameter\");\r\n diameterInput.value = 1;\r\n diameterInput.output.connectTo(this.diameter);\r\n }\r\n }\r\n\r\n protected _buildBlock(state: NodeGeometryBuildState) {\r\n const options: {\r\n diameter?: number;\r\n thickness?: number;\r\n tessellation?: number;\r\n sideOrientation?: number;\r\n frontUVs?: Vector4;\r\n backUVs?: Vector4;\r\n } = {};\r\n const func = (state: NodeGeometryBuildState) => {\r\n options.thickness = this.thickness.getConnectedValue(state);\r\n options.diameter = this.diameter.getConnectedValue(state);\r\n options.tessellation = this.tessellation.getConnectedValue(state);\r\n\r\n // Append vertex data from the plane builder\r\n return CreateTorusVertexData(options);\r\n };\r\n\r\n if (this.evaluateContext) {\r\n this.geometry._storedFunction = func;\r\n } else {\r\n this.geometry._storedValue = func(state);\r\n }\r\n }\r\n\r\n protected _dumpPropertiesCode() {\r\n const codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.evaluateContext = ${this.evaluateContext ? \"true\" : \"false\"};\\n`;\r\n return codeString;\r\n }\r\n\r\n /**\r\n * Serializes this block in a JSON representation\r\n * @returns the serialized block object\r\n */\r\n public serialize(): any {\r\n const serializationObject = super.serialize();\r\n\r\n serializationObject.evaluateContext = this.evaluateContext;\r\n\r\n return serializationObject;\r\n }\r\n\r\n public _deserialize(serializationObject: any) {\r\n super._deserialize(serializationObject);\r\n\r\n this.evaluateContext = serializationObject.evaluateContext;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.TorusBlock\", TorusBlock);\r\n"]}
@@ -82,7 +82,7 @@ export class TeleportOutBlock extends NodeGeometryBlock {
82
82
  _dumpPropertiesCode() {
83
83
  let codeString = super._dumpPropertiesCode();
84
84
  if (this.entryPoint) {
85
- codeString += `${this.entryPoint._codeVariableName}.attachToEndpoint(${this._codeVariableName});\r\n`;
85
+ codeString += `${this.entryPoint._codeVariableName}.attachToEndpoint(${this._codeVariableName});\n`;
86
86
  }
87
87
  return codeString;
88
88
  }
@@ -1 +1 @@
1
- {"version":3,"file":"teleportOutBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/Meshes/Node/Blocks/Teleport/teleportOutBlock.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,qCAAqC,EAAE,MAAM,8CAA8C,CAAC;AACrG,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAK5D;;GAEG;AACH,MAAM,OAAO,gBAAiB,SAAQ,iBAAiB;IAMnD;;;OAGG;IACH,YAAmB,IAAY;QAC3B,KAAK,CAAC,IAAI,CAAC,CAAC;QAVhB,gBAAgB;QACT,gBAAW,GAA8B,IAAI,CAAC;QACrD,gBAAgB;QACT,4BAAuB,GAAqB,IAAI,CAAC;QASpD,IAAI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,aAAa,CAAC,CAAC;SAC9E;QAED,OAAO,UAAU,CAAC;IACtB,CAAC;IAED;;;OAGG;IACI,KAAK;QACR,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,EAAE,CAAC;QAE5B,IAAI,IAAI,CAAC,UAAU,EAAE;YACjB,IAAI,CAAC,UAAU,CAAC,gBAAgB,CAAC,KAAyB,CAAC,CAAC;SAC/D;QAED,OAAO,KAAK,CAAC;IACjB,CAAC;IAES,mBAAmB;QACzB,IAAI,UAAU,GAAG,KAAK,CAAC,mBAAmB,EAAE,CAAC;QAE7C,IAAI,IAAI,CAAC,UAAU,EAAE;YACjB,UAAU,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,iBAAiB,qBAAqB,IAAI,CAAC,iBAAiB,QAAQ,CAAC;SACzG;QACD,OAAO,UAAU,CAAC;IACtB,CAAC;IAED;;;OAGG;IACI,SAAS;;QACZ,MAAM,mBAAmB,GAAG,KAAK,CAAC,SAAS,EAAE,CAAC;QAE9C,mBAAmB,CAAC,UAAU,GAAG,MAAA,MAAA,IAAI,CAAC,UAAU,0CAAE,QAAQ,mCAAI,EAAE,CAAC;QAEjE,OAAO,mBAAmB,CAAC;IAC/B,CAAC;IAEM,YAAY,CAAC,mBAAwB;QACxC,KAAK,CAAC,YAAY,CAAC,mBAAmB,CAAC,CAAC;QAExC,IAAI,CAAC,uBAAuB,GAAG,mBAAmB,CAAC,UAAU,CAAC;IAClE,CAAC;CACJ;AAED,aAAa,CAAC,0BAA0B,EAAE,gBAAgB,CAAC,CAAC","sourcesContent":["import type { Nullable } from \"../../../../types\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\nimport { NodeGeometryBlockConnectionPointTypes } from \"../../Enums/nodeGeometryConnectionPointTypes\";\r\nimport { NodeGeometryBlock } from \"../../nodeGeometryBlock\";\r\nimport type { NodeGeometryConnectionPoint } from \"../../nodeGeometryBlockConnectionPoint\";\r\nimport type { TeleportInBlock } from \"./teleportInBlock\";\r\nimport type { NodeGeometryBuildState } from \"../../nodeGeometryBuildState\";\r\n\r\n/**\r\n * Defines a block used to receive a value from a teleport entry point\r\n */\r\nexport class TeleportOutBlock extends NodeGeometryBlock {\r\n /** @internal */\r\n public _entryPoint: Nullable<TeleportInBlock> = null;\r\n /** @internal */\r\n public _tempEntryPointUniqueId: Nullable<number> = null;\r\n\r\n /**\r\n * Create a new TeleportOutBlock\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.registerOutput(\"output\", NodeGeometryBlockConnectionPointTypes.BasedOnInput);\r\n }\r\n\r\n /**\r\n * Gets the entry point\r\n */\r\n public get entryPoint() {\r\n return this._entryPoint;\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public getClassName() {\r\n return \"TeleportOutBlock\";\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 /** Detach from entry point */\r\n public detach() {\r\n if (!this._entryPoint) {\r\n return;\r\n }\r\n\r\n this._entryPoint.detachFromEndpoint(this);\r\n }\r\n\r\n protected _buildBlock() {\r\n // Do nothing\r\n // All work done by the emitter\r\n }\r\n\r\n protected _customBuildStep(state: NodeGeometryBuildState): void {\r\n if (this.entryPoint) {\r\n this.entryPoint.build(state);\r\n }\r\n }\r\n\r\n public _dumpCode(uniqueNames: string[], alreadyDumped: NodeGeometryBlock[]) {\r\n let codeString: string = \"\";\r\n if (this.entryPoint) {\r\n if (alreadyDumped.indexOf(this.entryPoint) === -1) {\r\n codeString += this.entryPoint._dumpCode(uniqueNames, alreadyDumped);\r\n }\r\n }\r\n\r\n return codeString + super._dumpCode(uniqueNames, alreadyDumped);\r\n }\r\n\r\n public _dumpCodeForOutputConnections(alreadyDumped: NodeGeometryBlock[]) {\r\n let codeString = super._dumpCodeForOutputConnections(alreadyDumped);\r\n\r\n if (this.entryPoint) {\r\n codeString += this.entryPoint._dumpCodeForOutputConnections(alreadyDumped);\r\n }\r\n\r\n return codeString;\r\n }\r\n\r\n /**\r\n * Clone the current block to a new identical block\r\n * @returns a copy of the current block\r\n */\r\n public clone() {\r\n const clone = super.clone();\r\n\r\n if (this.entryPoint) {\r\n this.entryPoint.attachToEndpoint(clone as TeleportOutBlock);\r\n }\r\n\r\n return clone;\r\n }\r\n\r\n protected _dumpPropertiesCode() {\r\n let codeString = super._dumpPropertiesCode();\r\n\r\n if (this.entryPoint) {\r\n codeString += `${this.entryPoint._codeVariableName}.attachToEndpoint(${this._codeVariableName});\\r\\n`;\r\n }\r\n return codeString;\r\n }\r\n\r\n /**\r\n * Serializes this block in a JSON representation\r\n * @returns the serialized block object\r\n */\r\n public serialize(): any {\r\n const serializationObject = super.serialize();\r\n\r\n serializationObject.entryPoint = this.entryPoint?.uniqueId ?? \"\";\r\n\r\n return serializationObject;\r\n }\r\n\r\n public _deserialize(serializationObject: any) {\r\n super._deserialize(serializationObject);\r\n\r\n this._tempEntryPointUniqueId = serializationObject.entryPoint;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.TeleportOutBlock\", TeleportOutBlock);\r\n"]}
1
+ {"version":3,"file":"teleportOutBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/Meshes/Node/Blocks/Teleport/teleportOutBlock.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,qCAAqC,EAAE,MAAM,8CAA8C,CAAC;AACrG,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAK5D;;GAEG;AACH,MAAM,OAAO,gBAAiB,SAAQ,iBAAiB;IAMnD;;;OAGG;IACH,YAAmB,IAAY;QAC3B,KAAK,CAAC,IAAI,CAAC,CAAC;QAVhB,gBAAgB;QACT,gBAAW,GAA8B,IAAI,CAAC;QACrD,gBAAgB;QACT,4BAAuB,GAAqB,IAAI,CAAC;QASpD,IAAI,CAAC,cAAc,CAAC,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SAC9E;QAED,OAAO,UAAU,CAAC;IACtB,CAAC;IAED;;;OAGG;IACI,KAAK;QACR,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,EAAE,CAAC;QAE5B,IAAI,IAAI,CAAC,UAAU,EAAE;YACjB,IAAI,CAAC,UAAU,CAAC,gBAAgB,CAAC,KAAyB,CAAC,CAAC;SAC/D;QAED,OAAO,KAAK,CAAC;IACjB,CAAC;IAES,mBAAmB;QACzB,IAAI,UAAU,GAAG,KAAK,CAAC,mBAAmB,EAAE,CAAC;QAC7C,IAAI,IAAI,CAAC,UAAU,EAAE;YACjB,UAAU,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,iBAAiB,qBAAqB,IAAI,CAAC,iBAAiB,MAAM,CAAC;SACvG;QACD,OAAO,UAAU,CAAC;IACtB,CAAC;IAED;;;OAGG;IACI,SAAS;;QACZ,MAAM,mBAAmB,GAAG,KAAK,CAAC,SAAS,EAAE,CAAC;QAE9C,mBAAmB,CAAC,UAAU,GAAG,MAAA,MAAA,IAAI,CAAC,UAAU,0CAAE,QAAQ,mCAAI,EAAE,CAAC;QAEjE,OAAO,mBAAmB,CAAC;IAC/B,CAAC;IAEM,YAAY,CAAC,mBAAwB;QACxC,KAAK,CAAC,YAAY,CAAC,mBAAmB,CAAC,CAAC;QAExC,IAAI,CAAC,uBAAuB,GAAG,mBAAmB,CAAC,UAAU,CAAC;IAClE,CAAC;CACJ;AAED,aAAa,CAAC,0BAA0B,EAAE,gBAAgB,CAAC,CAAC","sourcesContent":["import type { Nullable } from \"../../../../types\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\nimport { NodeGeometryBlockConnectionPointTypes } from \"../../Enums/nodeGeometryConnectionPointTypes\";\r\nimport { NodeGeometryBlock } from \"../../nodeGeometryBlock\";\r\nimport type { NodeGeometryConnectionPoint } from \"../../nodeGeometryBlockConnectionPoint\";\r\nimport type { TeleportInBlock } from \"./teleportInBlock\";\r\nimport type { NodeGeometryBuildState } from \"../../nodeGeometryBuildState\";\r\n\r\n/**\r\n * Defines a block used to receive a value from a teleport entry point\r\n */\r\nexport class TeleportOutBlock extends NodeGeometryBlock {\r\n /** @internal */\r\n public _entryPoint: Nullable<TeleportInBlock> = null;\r\n /** @internal */\r\n public _tempEntryPointUniqueId: Nullable<number> = null;\r\n\r\n /**\r\n * Create a new TeleportOutBlock\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.registerOutput(\"output\", NodeGeometryBlockConnectionPointTypes.BasedOnInput);\r\n }\r\n\r\n /**\r\n * Gets the entry point\r\n */\r\n public get entryPoint() {\r\n return this._entryPoint;\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public getClassName() {\r\n return \"TeleportOutBlock\";\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 /** Detach from entry point */\r\n public detach() {\r\n if (!this._entryPoint) {\r\n return;\r\n }\r\n this._entryPoint.detachFromEndpoint(this);\r\n }\r\n\r\n protected _buildBlock() {\r\n // Do nothing\r\n // All work done by the emitter\r\n }\r\n\r\n protected _customBuildStep(state: NodeGeometryBuildState): void {\r\n if (this.entryPoint) {\r\n this.entryPoint.build(state);\r\n }\r\n }\r\n\r\n public _dumpCode(uniqueNames: string[], alreadyDumped: NodeGeometryBlock[]) {\r\n let codeString: string = \"\";\r\n if (this.entryPoint) {\r\n if (alreadyDumped.indexOf(this.entryPoint) === -1) {\r\n codeString += this.entryPoint._dumpCode(uniqueNames, alreadyDumped);\r\n }\r\n }\r\n\r\n return codeString + super._dumpCode(uniqueNames, alreadyDumped);\r\n }\r\n\r\n public _dumpCodeForOutputConnections(alreadyDumped: NodeGeometryBlock[]) {\r\n let codeString = super._dumpCodeForOutputConnections(alreadyDumped);\r\n\r\n if (this.entryPoint) {\r\n codeString += this.entryPoint._dumpCodeForOutputConnections(alreadyDumped);\r\n }\r\n\r\n return codeString;\r\n }\r\n\r\n /**\r\n * Clone the current block to a new identical block\r\n * @returns a copy of the current block\r\n */\r\n public clone() {\r\n const clone = super.clone();\r\n\r\n if (this.entryPoint) {\r\n this.entryPoint.attachToEndpoint(clone as TeleportOutBlock);\r\n }\r\n\r\n return clone;\r\n }\r\n\r\n protected _dumpPropertiesCode() {\r\n let codeString = super._dumpPropertiesCode();\r\n if (this.entryPoint) {\r\n codeString += `${this.entryPoint._codeVariableName}.attachToEndpoint(${this._codeVariableName});\\n`;\r\n }\r\n return codeString;\r\n }\r\n\r\n /**\r\n * Serializes this block in a JSON representation\r\n * @returns the serialized block object\r\n */\r\n public serialize(): any {\r\n const serializationObject = super.serialize();\r\n\r\n serializationObject.entryPoint = this.entryPoint?.uniqueId ?? \"\";\r\n\r\n return serializationObject;\r\n }\r\n\r\n public _deserialize(serializationObject: any) {\r\n super._deserialize(serializationObject);\r\n\r\n this._tempEntryPointUniqueId = serializationObject.entryPoint;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.TeleportOutBlock\", TeleportOutBlock);\r\n"]}
@@ -46,7 +46,7 @@ export declare class ConditionBlock extends NodeGeometryBlock {
46
46
  */
47
47
  get left(): NodeGeometryConnectionPoint;
48
48
  /**
49
- * Gets the positions input component
49
+ * Gets the right input component
50
50
  */
51
51
  get right(): NodeGeometryConnectionPoint;
52
52
  /**
@@ -3,6 +3,8 @@ import { NodeGeometryBlock } from "../nodeGeometryBlock.js";
3
3
  import { RegisterClass } from "../../../Misc/typeStore.js";
4
4
  import { NodeGeometryBlockConnectionPointTypes } from "../Enums/nodeGeometryConnectionPointTypes.js";
5
5
  import { PropertyTypeForEdition, editableInPropertyPage } from "../../../Decorators/nodeDecorator.js";
6
+ import { Scalar } from "../../../Maths/math.scalar.js";
7
+ import { Epsilon } from "../../../Maths/math.constants.js";
6
8
  /**
7
9
  * Conditions supported by the condition block
8
10
  */
@@ -43,10 +45,11 @@ export class ConditionBlock extends NodeGeometryBlock {
43
45
  this.test = ConditionBlockTests.Equal;
44
46
  this.registerInput("left", NodeGeometryBlockConnectionPointTypes.Float);
45
47
  this.registerInput("right", NodeGeometryBlockConnectionPointTypes.Float, true, 0);
46
- this.registerInput("ifTrue", NodeGeometryBlockConnectionPointTypes.AutoDetect);
47
- this.registerInput("ifFalse", NodeGeometryBlockConnectionPointTypes.AutoDetect);
48
+ this.registerInput("ifTrue", NodeGeometryBlockConnectionPointTypes.AutoDetect, true, 1);
49
+ this.registerInput("ifFalse", NodeGeometryBlockConnectionPointTypes.AutoDetect, true, 0);
48
50
  this.registerOutput("output", NodeGeometryBlockConnectionPointTypes.BasedOnInput);
49
51
  this._outputs[0]._typeConnectionSource = this._inputs[2];
52
+ this._outputs[0]._defaultConnectionPointType = NodeGeometryBlockConnectionPointTypes.Float;
50
53
  this._inputs[0].acceptedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Int);
51
54
  this._inputs[1].acceptedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Int);
52
55
  this._linkConnectionTypes(2, 3);
@@ -65,7 +68,7 @@ export class ConditionBlock extends NodeGeometryBlock {
65
68
  return this._inputs[0];
66
69
  }
67
70
  /**
68
- * Gets the positions input component
71
+ * Gets the right input component
69
72
  */
70
73
  get right() {
71
74
  return this._inputs[1];
@@ -89,7 +92,7 @@ export class ConditionBlock extends NodeGeometryBlock {
89
92
  return this._outputs[0];
90
93
  }
91
94
  _buildBlock() {
92
- if (!this.left.isConnected || !this.ifTrue.isConnected || !this.ifFalse.isConnected) {
95
+ if (!this.left.isConnected) {
93
96
  this.output._storedFunction = null;
94
97
  this.output._storedValue = null;
95
98
  return;
@@ -100,7 +103,7 @@ export class ConditionBlock extends NodeGeometryBlock {
100
103
  let condition = false;
101
104
  switch (this.test) {
102
105
  case ConditionBlockTests.Equal:
103
- condition = left === right;
106
+ condition = Scalar.WithinEpsilon(left, right, Epsilon);
104
107
  break;
105
108
  case ConditionBlockTests.NotEqual:
106
109
  condition = left !== right;
@@ -137,7 +140,7 @@ export class ConditionBlock extends NodeGeometryBlock {
137
140
  };
138
141
  }
139
142
  _dumpPropertiesCode() {
140
- const codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.test = BABYLON.ConditionBlockTests.${ConditionBlockTests[this.test]};\r\n`;
143
+ const codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.test = BABYLON.ConditionBlockTests.${ConditionBlockTests[this.test]};\n`;
141
144
  return codeString;
142
145
  }
143
146
  /**
@@ -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,2CAA2C,CAAC;AAElG,OAAO,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAEnG;;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,mBAAmB,KAAnB,mBAAmB,QAmB9B;AAED;;GAEG;AACH,MAAM,OAAO,cAAe,SAAQ,iBAAiB;IAoBjD;;;OAGG;IACH,YAAmB,IAAY;QAC3B,KAAK,CAAC,IAAI,CAAC,CAAC;QAxBhB;;WAEG;QAeI,SAAI,GAAG,mBAAmB,CAAC,KAAK,CAAC;QASp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IU;IAdN,sBAAsB,CAAC,MAAM,EAAE,sBAAsB,CAAC,IAAI,EAAE,UAAU,EAAE;QACrE,SAAS,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;QAC5B,OAAO,EAAE;YACL,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,mBAAmB,CAAC,KAAK,EAAE;YACpD,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,mBAAmB,CAAC,QAAQ,EAAE;YAC1D,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,mBAAmB,CAAC,QAAQ,EAAE;YAC1D,EAAE,KAAK,EAAE,aAAa,EAAE,KAAK,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;AA8I5C,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\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);\r\n this.registerInput(\"ifFalse\", NodeGeometryBlockConnectionPointTypes.AutoDetect);\r\n\r\n this.registerOutput(\"output\", NodeGeometryBlockConnectionPointTypes.BasedOnInput);\r\n\r\n this._outputs[0]._typeConnectionSource = this._inputs[2];\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 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 positions 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 _buildBlock() {\r\n if (!this.left.isConnected || !this.ifTrue.isConnected || !this.ifFalse.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 = left === right;\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 _dumpPropertiesCode() {\r\n const codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.test = BABYLON.ConditionBlockTests.${ConditionBlockTests[this.test]};\\r\\n`;\r\n return codeString;\r\n }\r\n\r\n /**\r\n * Serializes this block in a JSON representation\r\n * @returns the serialized block object\r\n */\r\n public serialize(): any {\r\n const serializationObject = super.serialize();\r\n\r\n serializationObject.test = this.test;\r\n\r\n return serializationObject;\r\n }\r\n\r\n public _deserialize(serializationObject: any) {\r\n super._deserialize(serializationObject);\r\n\r\n this.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,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AACnG,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAExD;;GAEG;AACH,MAAM,CAAN,IAAY,mBAmBX;AAnBD,WAAY,mBAAmB;IAC3B,YAAY;IACZ,+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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 { Scalar } from \"../../../Maths/math.scalar\";\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 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 _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 = Scalar.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 _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 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 _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"]}
@@ -54,7 +54,7 @@ export class DebugBlock extends NodeGeometryBlock {
54
54
  this.log = [];
55
55
  this.output._storedFunction = (state) => {
56
56
  const input = this.input.getConnectedValue(state);
57
- this.log.push(input ? input.toString() : "null");
57
+ this.log.push(input !== undefined && input !== null ? input.toString() : "null");
58
58
  return input;
59
59
  };
60
60
  }
@@ -1 +1 @@
1
- {"version":3,"file":"debugBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Meshes/Node/Blocks/debugBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,qCAAqC,EAAE,MAAM,2CAA2C,CAAC;AAClG,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAGzD;;GAEG;AACH,MAAM,OAAO,UAAW,SAAQ,iBAAiB;IAM7C;;;OAGG;IACH,YAAmB,IAAY;QAC3B,KAAK,CAAC,IAAI,CAAC,CAAC;QAVhB;;WAEG;QACI,QAAG,GAAa,EAAE,CAAC;QAStB,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,qCAAqC,CAAC,UAAU,CAAC,CAAC;QAC9E,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,qCAAqC,CAAC,YAAY,CAAC,CAAC;QAElF,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,qBAAqB,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QACzD,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,4BAA4B,CAAC,IAAI,CAAC,qCAAqC,CAAC,QAAQ,CAAC,CAAC;IACtG,CAAC;IAED;;OAEG;IACH,IAAW,kBAAkB;QACzB,OAAO,CAAC,CAAC;IACb,CAAC;IAED;;;OAGG;IACI,YAAY;QACf,OAAO,YAAY,CAAC;IACxB,CAAC;IAED;;OAEG;IACH,IAAW,KAAK;QACZ,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAC3B,CAAC;IAED;;OAEG;IACH,IAAW,MAAM;QACb,OAAO,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IAC5B,CAAC;IAES,WAAW;QACjB,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE;YACzB,IAAI,CAAC,MAAM,CAAC,eAAe,GAAG,IAAI,CAAC;YACnC,IAAI,CAAC,MAAM,CAAC,YAAY,GAAG,IAAI,CAAC;YAChC,OAAO;SACV;QAED,IAAI,CAAC,GAAG,GAAG,EAAE,CAAC;QACd,IAAI,CAAC,MAAM,CAAC,eAAe,GAAG,CAAC,KAAK,EAAE,EAAE;YACpC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;YAElD,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;YAEjD,OAAO,KAAK,CAAC;QACjB,CAAC,CAAC;IACN,CAAC;CACJ;AAED,aAAa,CAAC,oBAAoB,EAAE,UAAU,CAAC,CAAC","sourcesContent":["import { RegisterClass } from \"../../../Misc/typeStore\";\r\nimport { NodeGeometryBlockConnectionPointTypes } from \"../Enums/nodeGeometryConnectionPointTypes\";\r\nimport { NodeGeometryBlock } from \"../nodeGeometryBlock\";\r\nimport type { NodeGeometryConnectionPoint } from \"../nodeGeometryBlockConnectionPoint\";\r\n\r\n/**\r\n * Defines a block used to debug values going through it\r\n */\r\nexport class DebugBlock extends NodeGeometryBlock {\r\n /**\r\n * Gets the log entries\r\n */\r\n public log: string[] = [];\r\n\r\n /**\r\n * Create a new DebugBlock\r\n * @param name defines the block name\r\n */\r\n public constructor(name: string) {\r\n super(name);\r\n\r\n this.registerInput(\"input\", NodeGeometryBlockConnectionPointTypes.AutoDetect);\r\n this.registerOutput(\"output\", NodeGeometryBlockConnectionPointTypes.BasedOnInput);\r\n\r\n this._outputs[0]._typeConnectionSource = this._inputs[0];\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Geometry);\r\n }\r\n\r\n /**\r\n * Gets the time spent to build this block (in ms)\r\n */\r\n public get buildExecutionTime() {\r\n return 0;\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public getClassName() {\r\n return \"DebugBlock\";\r\n }\r\n\r\n /**\r\n * Gets the input component\r\n */\r\n public get input(): NodeGeometryConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeGeometryConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected _buildBlock() {\r\n if (!this.input.isConnected) {\r\n this.output._storedFunction = null;\r\n this.output._storedValue = null;\r\n return;\r\n }\r\n\r\n this.log = [];\r\n this.output._storedFunction = (state) => {\r\n const input = this.input.getConnectedValue(state);\r\n\r\n this.log.push(input ? input.toString() : \"null\");\r\n\r\n return input;\r\n };\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.DebugBlock\", DebugBlock);\r\n"]}
1
+ {"version":3,"file":"debugBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Meshes/Node/Blocks/debugBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,qCAAqC,EAAE,MAAM,2CAA2C,CAAC;AAClG,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAGzD;;GAEG;AACH,MAAM,OAAO,UAAW,SAAQ,iBAAiB;IAM7C;;;O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AS,IAAI,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;YAEjF,OAAO,KAAK,CAAC;QACjB,CAAC,CAAC;IACN,CAAC;CACJ;AAED,aAAa,CAAC,oBAAoB,EAAE,UAAU,CAAC,CAAC","sourcesContent":["import { RegisterClass } from \"../../../Misc/typeStore\";\r\nimport { NodeGeometryBlockConnectionPointTypes } from \"../Enums/nodeGeometryConnectionPointTypes\";\r\nimport { NodeGeometryBlock } from \"../nodeGeometryBlock\";\r\nimport type { NodeGeometryConnectionPoint } from \"../nodeGeometryBlockConnectionPoint\";\r\n\r\n/**\r\n * Defines a block used to debug values going through it\r\n */\r\nexport class DebugBlock extends NodeGeometryBlock {\r\n /**\r\n * Gets the log entries\r\n */\r\n public log: string[] = [];\r\n\r\n /**\r\n * Create a new DebugBlock\r\n * @param name defines the block name\r\n */\r\n public constructor(name: string) {\r\n super(name);\r\n\r\n this.registerInput(\"input\", NodeGeometryBlockConnectionPointTypes.AutoDetect);\r\n this.registerOutput(\"output\", NodeGeometryBlockConnectionPointTypes.BasedOnInput);\r\n\r\n this._outputs[0]._typeConnectionSource = this._inputs[0];\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Geometry);\r\n }\r\n\r\n /**\r\n * Gets the time spent to build this block (in ms)\r\n */\r\n public get buildExecutionTime() {\r\n return 0;\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public getClassName() {\r\n return \"DebugBlock\";\r\n }\r\n\r\n /**\r\n * Gets the input component\r\n */\r\n public get input(): NodeGeometryConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeGeometryConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected _buildBlock() {\r\n if (!this.input.isConnected) {\r\n this.output._storedFunction = null;\r\n this.output._storedValue = null;\r\n return;\r\n }\r\n\r\n this.log = [];\r\n this.output._storedFunction = (state) => {\r\n const input = this.input.getConnectedValue(state);\r\n\r\n this.log.push(input !== undefined && input !== null ? input.toString() : \"null\");\r\n\r\n return input;\r\n };\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.DebugBlock\", DebugBlock);\r\n"]}
@@ -66,6 +66,7 @@ export declare class GeometryInputBlock extends NodeGeometryBlock {
66
66
  setDefaultValue(): void;
67
67
  protected _buildBlock(state: NodeGeometryBuildState): void;
68
68
  dispose(): void;
69
+ protected _dumpPropertiesCode(): string;
69
70
  serialize(): any;
70
71
  _deserialize(serializationObject: any): void;
71
72
  }