@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":"instantiateOnVerticesBlock.js","sourceRoot":"","sources":["../../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,CAAC;IACtB,CAAC;IAED;;;OAGG;IACI,SAAS;QACZ,MAAM,mBAAmB,GAAG,KAAK,CAAC,SAAS,EAAE,CAAC;QAE9C,mBAAmB,CAAC,yBAAyB,GAAG,IAAI,CAAC,yBAAyB,CAAC;QAE/E,OAAO,mBAAmB,CAAC;IAC/B,CAAC;IAEM,YAAY,CAAC,mBAAwB;QACxC,KAAK,CAAC,YAAY,CAAC,mBAAmB,CAAC,CAAC;QAExC,IAAI,CAAC,yBAAyB,GAAG,mBAAmB,CAAC,yBAAyB,CAAC;IACnF,CAAC;CACJ;AArMU;IADN,sBAAsB,CAAC,6BAA6B,EAAE,sBAAsB,CAAC,OAAO,EAAE,UAAU,EAAE,EAAE,SAAS,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,CAAC;6EAC3F;AAuM5C,aAAa,CAAC,oCAAoC,EAAE,0BAA0B,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 type { INodeGeometryExecutionContext } from \"../../Interfaces/nodeGeometryExecutionContext\";\r\nimport type { VertexData } from \"../../../mesh.vertexData\";\r\nimport { Vector3 } from \"../../../../Maths/math.vector\";\r\nimport { PropertyTypeForEdition, editableInPropertyPage } from \"../../../../Decorators/nodeDecorator\";\r\nimport { Epsilon } from \"../../../../Maths/math.constants\";\r\nimport type { Nullable } from \"../../../../types\";\r\n\r\n/**\r\n * Block used to instance geometry on every vertex of a geometry\r\n */\r\nexport class InstantiateOnVerticesBlock extends NodeGeometryBlock implements INodeGeometryExecutionContext {\r\n private _vertexData: VertexData;\r\n private _currentIndex: number;\r\n private _indexTranslation: Nullable<{ [key: number]: number }> = null;\r\n\r\n /**\r\n * Gets or sets a boolean indicating if the block should remove duplicated positions\r\n */\r\n @editableInPropertyPage(\"Remove duplicated positions\", PropertyTypeForEdition.Boolean, \"ADVANCED\", { notifiers: { update: true } })\r\n public removeDuplicatedPositions = true;\r\n\r\n /**\r\n * Create a new InstantiateOnVerticesBlock\r\n * @param name defines the block name\r\n */\r\n public constructor(name: string) {\r\n super(name);\r\n\r\n this.registerInput(\"geometry\", NodeGeometryBlockConnectionPointTypes.Geometry);\r\n this.registerInput(\"instance\", NodeGeometryBlockConnectionPointTypes.Geometry, true);\r\n this.registerInput(\"rotation\", NodeGeometryBlockConnectionPointTypes.Vector3, true, Vector3.Zero());\r\n this.registerInput(\"scaling\", NodeGeometryBlockConnectionPointTypes.Vector3, true, Vector3.One());\r\n this.registerInput(\"density\", NodeGeometryBlockConnectionPointTypes.Float, true, 1, 0, 1);\r\n\r\n this.scaling.acceptedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Float);\r\n this.registerOutput(\"output\", NodeGeometryBlockConnectionPointTypes.Geometry);\r\n }\r\n\r\n /**\r\n * Gets the current index in the current flow\r\n * @returns the current index\r\n */\r\n public getExecutionIndex(): number {\r\n return this._indexTranslation ? this._indexTranslation[this._currentIndex] : this._currentIndex;\r\n }\r\n\r\n /**\r\n * Gets the current face index in the current flow\r\n * @returns the current face index\r\n */\r\n public getExecutionFaceIndex(): number {\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 \"InstantiateOnVerticesBlock\";\r\n }\r\n\r\n /**\r\n * Gets the geometry input component\r\n */\r\n public get geometry(): NodeGeometryConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the instance input component\r\n */\r\n public get instance(): NodeGeometryConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the rotation input component\r\n */\r\n public get rotation(): NodeGeometryConnectionPoint {\r\n return this._inputs[2];\r\n }\r\n\r\n /**\r\n * Gets the scaling input component\r\n */\r\n public get scaling(): NodeGeometryConnectionPoint {\r\n return this._inputs[3];\r\n }\r\n\r\n /**\r\n * Gets the density input component\r\n */\r\n public get density(): NodeGeometryConnectionPoint {\r\n return this._inputs[4];\r\n }\r\n\r\n /**\r\n * Gets the geometry output component\r\n */\r\n public get output(): NodeGeometryConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected _buildBlock(state: NodeGeometryBuildState) {\r\n state.executionContext = this;\r\n\r\n this._vertexData = this.geometry.getConnectedValue(state);\r\n state.geometryContext = this._vertexData;\r\n\r\n if (!this._vertexData || !this._vertexData.positions || !this.instance.isConnected) {\r\n state.executionContext = null;\r\n state.geometryContext = null;\r\n this.output._storedValue = null;\r\n return;\r\n }\r\n\r\n // Processing\r\n let vertexCount = this._vertexData.positions.length / 3;\r\n const additionalVertexData: VertexData[] = [];\r\n const currentPosition = new Vector3();\r\n const alreadyDone = new Array<number>();\r\n let vertices = this._vertexData.positions;\r\n\r\n if (this.removeDuplicatedPositions) {\r\n this._indexTranslation = {};\r\n for (this._currentIndex = 0; this._currentIndex < vertexCount; this._currentIndex++) {\r\n const x = vertices[this._currentIndex * 3];\r\n const y = vertices[this._currentIndex * 3 + 1];\r\n const z = vertices[this._currentIndex * 3 + 2];\r\n let found = false;\r\n for (let index = 0; index < alreadyDone.length; index += 3) {\r\n if (Math.abs(alreadyDone[index] - x) < Epsilon && Math.abs(alreadyDone[index + 1] - y) < Epsilon && Math.abs(alreadyDone[index + 2] - z) < Epsilon) {\r\n found = true;\r\n break;\r\n }\r\n }\r\n\r\n if (found) {\r\n continue;\r\n }\r\n this._indexTranslation[alreadyDone.length / 3] = this._currentIndex;\r\n alreadyDone.push(x, y, z);\r\n }\r\n\r\n vertices = alreadyDone;\r\n vertexCount = vertices.length / 3;\r\n } else {\r\n this._indexTranslation = null;\r\n }\r\n\r\n for (this._currentIndex = 0; this._currentIndex < vertexCount; this._currentIndex++) {\r\n const instanceGeometry = this.instance.getConnectedValue(state) as VertexData;\r\n\r\n if (!instanceGeometry || !instanceGeometry.positions || instanceGeometry.positions.length === 0) {\r\n continue;\r\n }\r\n\r\n const density = this.density.getConnectedValue(state);\r\n\r\n if (density < 1) {\r\n if (Math.random() > density) {\r\n continue;\r\n }\r\n }\r\n\r\n currentPosition.fromArray(vertices, this._currentIndex * 3);\r\n\r\n // Clone the instance\r\n const clone = instanceGeometry.clone();\r\n\r\n // Transform\r\n const scaling = state.adaptInput(this.scaling, NodeGeometryBlockConnectionPointTypes.Vector3, Vector3.OneReadOnly);\r\n const rotation = this.rotation.getConnectedValue(state) || Vector3.ZeroReadOnly;\r\n state._instantiate(clone, currentPosition, rotation, scaling, additionalVertexData);\r\n }\r\n\r\n // Merge\r\n if (additionalVertexData.length) {\r\n if (additionalVertexData.length === 1) {\r\n this._vertexData = additionalVertexData[0];\r\n } else {\r\n // We do not merge the main one as user can use a merge node if wanted\r\n const main = additionalVertexData.splice(0, 1)[0];\r\n this._vertexData = main.merge(additionalVertexData, true, false, true, true);\r\n }\r\n }\r\n\r\n // Storage\r\n this.output._storedValue = this._vertexData;\r\n state.executionContext = null;\r\n state.geometryContext = null;\r\n }\r\n\r\n protected _dumpPropertiesCode() {\r\n const codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.removeDuplicatedPositions = ${this.removeDuplicatedPositions ? \"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.removeDuplicatedPositions = this.removeDuplicatedPositions;\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.removeDuplicatedPositions = serializationObject.removeDuplicatedPositions;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.InstantiateOnVerticesBlock\", InstantiateOnVerticesBlock);\r\n"]}
1
+ {"version":3,"file":"instantiateOnVerticesBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/Meshes/Node/Blocks/Instances/instantiateOnVerticesBlock.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAE5D,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,qCAAqC,EAAE,MAAM,8CAA8C,CAAC;AAIrG,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AACxD,OAAO,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AACtG,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAG3D;;GAEG;AACH,MAAM,OAAO,0BAA2B,SAAQ,iBAAiB;IAW7D;;;OAGG;IACH,YAAmB,IAAY;QAC3B,KAAK,CAAC,IAAI,CAAC,CAAC;QAbR,sBAAiB,GAAwC,IAAI,CAAC;QAEtE;;WAEG;QAEI,8BAAyB,GAAG,IAAI,CAAC;QASpC,IAAI,CAAC,aAAa,CAAC,UAAU,EAAE,qCAAqC,CAAC,QAAQ,CAAC,CAAC;QAC/E,IAAI,CAAC,aAAa,CAAC,UAAU,EAAE,qCAAqC,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;QACrF,IAAI,CAAC,aAAa,CAAC,UAAU,EAAE,qCAAqC,CAAC,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;QACpG,IAAI,CAAC,aAAa,CAAC,SAAS,EAAE,qCAAqC,CAAC,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;QAClG,IAAI,CAAC,aAAa,CAAC,SAAS,EAAE,qCAAqC,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;QAE1F,IAAI,CAAC,OAAO,CAAC,4B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,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,KAAK,CAAC;QACjK,OAAO,UAAU,CAAC;IACtB,CAAC;IAED;;;OAGG;IACI,SAAS;QACZ,MAAM,mBAAmB,GAAG,KAAK,CAAC,SAAS,EAAE,CAAC;QAE9C,mBAAmB,CAAC,yBAAyB,GAAG,IAAI,CAAC,yBAAyB,CAAC;QAE/E,OAAO,mBAAmB,CAAC;IAC/B,CAAC;IAEM,YAAY,CAAC,mBAAwB;QACxC,KAAK,CAAC,YAAY,CAAC,mBAAmB,CAAC,CAAC;QAExC,IAAI,CAAC,yBAAyB,GAAG,mBAAmB,CAAC,yBAAyB,CAAC;IACnF,CAAC;CACJ;AArMU;IADN,sBAAsB,CAAC,6BAA6B,EAAE,sBAAsB,CAAC,OAAO,EAAE,UAAU,EAAE,EAAE,SAAS,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,CAAC;6EAC3F;AAuM5C,aAAa,CAAC,oCAAoC,EAAE,0BAA0B,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 type { INodeGeometryExecutionContext } from \"../../Interfaces/nodeGeometryExecutionContext\";\r\nimport type { VertexData } from \"../../../mesh.vertexData\";\r\nimport { Vector3 } from \"../../../../Maths/math.vector\";\r\nimport { PropertyTypeForEdition, editableInPropertyPage } from \"../../../../Decorators/nodeDecorator\";\r\nimport { Epsilon } from \"../../../../Maths/math.constants\";\r\nimport type { Nullable } from \"../../../../types\";\r\n\r\n/**\r\n * Block used to instance geometry on every vertex of a geometry\r\n */\r\nexport class InstantiateOnVerticesBlock extends NodeGeometryBlock implements INodeGeometryExecutionContext {\r\n private _vertexData: VertexData;\r\n private _currentIndex: number;\r\n private _indexTranslation: Nullable<{ [key: number]: number }> = null;\r\n\r\n /**\r\n * Gets or sets a boolean indicating if the block should remove duplicated positions\r\n */\r\n @editableInPropertyPage(\"Remove duplicated positions\", PropertyTypeForEdition.Boolean, \"ADVANCED\", { notifiers: { update: true } })\r\n public removeDuplicatedPositions = true;\r\n\r\n /**\r\n * Create a new InstantiateOnVerticesBlock\r\n * @param name defines the block name\r\n */\r\n public constructor(name: string) {\r\n super(name);\r\n\r\n this.registerInput(\"geometry\", NodeGeometryBlockConnectionPointTypes.Geometry);\r\n this.registerInput(\"instance\", NodeGeometryBlockConnectionPointTypes.Geometry, true);\r\n this.registerInput(\"rotation\", NodeGeometryBlockConnectionPointTypes.Vector3, true, Vector3.Zero());\r\n this.registerInput(\"scaling\", NodeGeometryBlockConnectionPointTypes.Vector3, true, Vector3.One());\r\n this.registerInput(\"density\", NodeGeometryBlockConnectionPointTypes.Float, true, 1, 0, 1);\r\n\r\n this.scaling.acceptedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Float);\r\n this.registerOutput(\"output\", NodeGeometryBlockConnectionPointTypes.Geometry);\r\n }\r\n\r\n /**\r\n * Gets the current index in the current flow\r\n * @returns the current index\r\n */\r\n public getExecutionIndex(): number {\r\n return this._indexTranslation ? this._indexTranslation[this._currentIndex] : this._currentIndex;\r\n }\r\n\r\n /**\r\n * Gets the current face index in the current flow\r\n * @returns the current face index\r\n */\r\n public getExecutionFaceIndex(): number {\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 \"InstantiateOnVerticesBlock\";\r\n }\r\n\r\n /**\r\n * Gets the geometry input component\r\n */\r\n public get geometry(): NodeGeometryConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the instance input component\r\n */\r\n public get instance(): NodeGeometryConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the rotation input component\r\n */\r\n public get rotation(): NodeGeometryConnectionPoint {\r\n return this._inputs[2];\r\n }\r\n\r\n /**\r\n * Gets the scaling input component\r\n */\r\n public get scaling(): NodeGeometryConnectionPoint {\r\n return this._inputs[3];\r\n }\r\n\r\n /**\r\n * Gets the density input component\r\n */\r\n public get density(): NodeGeometryConnectionPoint {\r\n return this._inputs[4];\r\n }\r\n\r\n /**\r\n * Gets the geometry output component\r\n */\r\n public get output(): NodeGeometryConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected _buildBlock(state: NodeGeometryBuildState) {\r\n state.executionContext = this;\r\n\r\n this._vertexData = this.geometry.getConnectedValue(state);\r\n state.geometryContext = this._vertexData;\r\n\r\n if (!this._vertexData || !this._vertexData.positions || !this.instance.isConnected) {\r\n state.executionContext = null;\r\n state.geometryContext = null;\r\n this.output._storedValue = null;\r\n return;\r\n }\r\n\r\n // Processing\r\n let vertexCount = this._vertexData.positions.length / 3;\r\n const additionalVertexData: VertexData[] = [];\r\n const currentPosition = new Vector3();\r\n const alreadyDone = new Array<number>();\r\n let vertices = this._vertexData.positions;\r\n\r\n if (this.removeDuplicatedPositions) {\r\n this._indexTranslation = {};\r\n for (this._currentIndex = 0; this._currentIndex < vertexCount; this._currentIndex++) {\r\n const x = vertices[this._currentIndex * 3];\r\n const y = vertices[this._currentIndex * 3 + 1];\r\n const z = vertices[this._currentIndex * 3 + 2];\r\n let found = false;\r\n for (let index = 0; index < alreadyDone.length; index += 3) {\r\n if (Math.abs(alreadyDone[index] - x) < Epsilon && Math.abs(alreadyDone[index + 1] - y) < Epsilon && Math.abs(alreadyDone[index + 2] - z) < Epsilon) {\r\n found = true;\r\n break;\r\n }\r\n }\r\n\r\n if (found) {\r\n continue;\r\n }\r\n this._indexTranslation[alreadyDone.length / 3] = this._currentIndex;\r\n alreadyDone.push(x, y, z);\r\n }\r\n\r\n vertices = alreadyDone;\r\n vertexCount = vertices.length / 3;\r\n } else {\r\n this._indexTranslation = null;\r\n }\r\n\r\n for (this._currentIndex = 0; this._currentIndex < vertexCount; this._currentIndex++) {\r\n const instanceGeometry = this.instance.getConnectedValue(state) as VertexData;\r\n\r\n if (!instanceGeometry || !instanceGeometry.positions || instanceGeometry.positions.length === 0) {\r\n continue;\r\n }\r\n\r\n const density = this.density.getConnectedValue(state);\r\n\r\n if (density < 1) {\r\n if (Math.random() > density) {\r\n continue;\r\n }\r\n }\r\n\r\n currentPosition.fromArray(vertices, this._currentIndex * 3);\r\n\r\n // Clone the instance\r\n const clone = instanceGeometry.clone();\r\n\r\n // Transform\r\n const scaling = state.adaptInput(this.scaling, NodeGeometryBlockConnectionPointTypes.Vector3, Vector3.OneReadOnly);\r\n const rotation = this.rotation.getConnectedValue(state) || Vector3.ZeroReadOnly;\r\n state._instantiate(clone, currentPosition, rotation, scaling, additionalVertexData);\r\n }\r\n\r\n // Merge\r\n if (additionalVertexData.length) {\r\n if (additionalVertexData.length === 1) {\r\n this._vertexData = additionalVertexData[0];\r\n } else {\r\n // We do not merge the main one as user can use a merge node if wanted\r\n const main = additionalVertexData.splice(0, 1)[0];\r\n this._vertexData = main.merge(additionalVertexData, true, false, true, true);\r\n }\r\n }\r\n\r\n // Storage\r\n this.output._storedValue = this._vertexData;\r\n state.executionContext = null;\r\n state.geometryContext = null;\r\n }\r\n\r\n protected _dumpPropertiesCode() {\r\n const codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.removeDuplicatedPositions = ${this.removeDuplicatedPositions ? \"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.removeDuplicatedPositions = this.removeDuplicatedPositions;\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.removeDuplicatedPositions = serializationObject.removeDuplicatedPositions;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.InstantiateOnVerticesBlock\", InstantiateOnVerticesBlock);\r\n"]}
@@ -3,7 +3,7 @@ import type { NodeGeometryConnectionPoint } from "../../nodeGeometryBlockConnect
3
3
  import type { NodeGeometryBuildState } from "../../nodeGeometryBuildState";
4
4
  import type { INodeGeometryExecutionContext } from "../../Interfaces/nodeGeometryExecutionContext";
5
5
  /**
6
- * Block used to set positions for a geometry
6
+ * Block used to set normals for a geometry
7
7
  */
8
8
  export declare class SetNormalsBlock extends NodeGeometryBlock implements INodeGeometryExecutionContext {
9
9
  private _vertexData;
@@ -2,7 +2,7 @@ import { NodeGeometryBlock } from "../../nodeGeometryBlock.js";
2
2
  import { RegisterClass } from "../../../../Misc/typeStore.js";
3
3
  import { NodeGeometryBlockConnectionPointTypes } from "../../Enums/nodeGeometryConnectionPointTypes.js";
4
4
  /**
5
- * Block used to set positions for a geometry
5
+ * Block used to set normals for a geometry
6
6
  */
7
7
  export class SetNormalsBlock extends NodeGeometryBlock {
8
8
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"setNormalsBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/Meshes/Node/Blocks/Set/setNormalsBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAE5D,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,qCAAqC,EAAE,MAAM,8CAA8C,CAAC;AAMrG;;GAEG;AACH,MAAM,OAAO,eAAgB,SAAQ,iBAAiB;IAIlD;;;OAGG;IACH,YAAmB,IAAY;QAC3B,KAAK,CAAC,IAAI,CAAC,CAAC;QAEZ,IAAI,CAAC,aAAa,CAAC,UAAU,EAAE,qCAAqC,CAAC,QAAQ,CAAC,CAAC;QAC/E,IAAI,CAAC,aAAa,CAAC,SAAS,EAAE,qCAAqC,CAAC,OAAO,CAAC,CAAC;QAE7E,IAAI,CAAC,cA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OAAO;SACV;QAED,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE;YAC3B,IAAI,CAAC,WAAW,CAAC,OAAO,GAAG,EAAE,CAAC;SACjC;QAED,aAAa;QACb,MAAM,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC;QAC1D,KAAK,IAAI,CAAC,aAAa,GAAG,CAAC,EAAE,IAAI,CAAC,aAAa,GAAG,WAAW,EAAE,IAAI,CAAC,aAAa,EAAE,EAAE;YACjF,MAAM,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAAC,KAAK,CAAY,CAAC;YACrE,IAAI,WAAW,EAAE;gBACb,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE,IAAI,CAAC,aAAa,GAAG,CAAC,CAAC,CAAC;aACzE;SACJ;QAED,UAAU;QACV,IAAI,CAAC,MAAM,CAAC,YAAY,GAAG,IAAI,CAAC,WAAW,CAAC;QAC5C,KAAK,CAAC,gBAAgB,GAAG,IAAI,CAAC;QAC9B,KAAK,CAAC,eAAe,GAAG,IAAI,CAAC;IACjC,CAAC;CACJ;AAED,aAAa,CAAC,yBAAyB,EAAE,eAAe,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 type { INodeGeometryExecutionContext } from \"../../Interfaces/nodeGeometryExecutionContext\";\r\nimport type { VertexData } from \"../../../mesh.vertexData\";\r\nimport type { Vector3 } from \"../../../../Maths/math.vector\";\r\n\r\n/**\r\n * Block used to set positions for a geometry\r\n */\r\nexport class SetNormalsBlock extends NodeGeometryBlock implements INodeGeometryExecutionContext {\r\n private _vertexData: VertexData;\r\n private _currentIndex: number;\r\n\r\n /**\r\n * Create a new SetNormalsBlock\r\n * @param name defines the block name\r\n */\r\n public constructor(name: string) {\r\n super(name);\r\n\r\n this.registerInput(\"geometry\", NodeGeometryBlockConnectionPointTypes.Geometry);\r\n this.registerInput(\"normals\", NodeGeometryBlockConnectionPointTypes.Vector3);\r\n\r\n this.registerOutput(\"output\", NodeGeometryBlockConnectionPointTypes.Geometry);\r\n }\r\n\r\n /**\r\n * Gets the current index in the current flow\r\n * @returns the current index\r\n */\r\n public getExecutionIndex(): number {\r\n return this._currentIndex;\r\n }\r\n\r\n /**\r\n * Gets the current face index in the current flow\r\n * @returns the current face index\r\n */\r\n public getExecutionFaceIndex(): number {\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 \"SetNormalsBlock\";\r\n }\r\n\r\n /**\r\n * Gets the geometry input component\r\n */\r\n public get geometry(): NodeGeometryConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the normals input component\r\n */\r\n public get normals(): NodeGeometryConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the geometry output component\r\n */\r\n public get output(): NodeGeometryConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected _buildBlock(state: NodeGeometryBuildState) {\r\n state.executionContext = this;\r\n\r\n this._vertexData = this.geometry.getConnectedValue(state);\r\n state.geometryContext = this._vertexData;\r\n\r\n if (!this._vertexData || !this._vertexData.positions) {\r\n state.executionContext = null;\r\n state.geometryContext = null;\r\n this.output._storedValue = null;\r\n return;\r\n }\r\n\r\n if (!this.normals.isConnected) {\r\n state.executionContext = null;\r\n state.geometryContext = null;\r\n this.output._storedValue = this._vertexData;\r\n return;\r\n }\r\n\r\n if (!this._vertexData.normals) {\r\n this._vertexData.normals = [];\r\n }\r\n\r\n // Processing\r\n const vertexCount = this._vertexData.positions.length / 3;\r\n for (this._currentIndex = 0; this._currentIndex < vertexCount; this._currentIndex++) {\r\n const tempVector3 = this.normals.getConnectedValue(state) as Vector3;\r\n if (tempVector3) {\r\n tempVector3.toArray(this._vertexData.normals, this._currentIndex * 3);\r\n }\r\n }\r\n\r\n // Storage\r\n this.output._storedValue = this._vertexData;\r\n state.executionContext = null;\r\n state.geometryContext = null;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.SetNormalsBlock\", SetNormalsBlock);\r\n"]}
1
+ {"version":3,"file":"setNormalsBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/Meshes/Node/Blocks/Set/setNormalsBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAE5D,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,qCAAqC,EAAE,MAAM,8CAA8C,CAAC;AAMrG;;GAEG;AACH,MAAM,OAAO,eAAgB,SAAQ,iBAAiB;IAIlD;;;OAGG;IACH,YAAmB,IAAY;QAC3B,KAAK,CAAC,IAAI,CAAC,CAAC;QAEZ,IAAI,CAAC,aAAa,CAAC,UAAU,EAAE,qCAAqC,CAAC,QAAQ,CAAC,CAAC;QAC/E,IAAI,CAAC,aAAa,CAAC,SAAS,EAAE,qCAAqC,CAAC,OAAO,CAAC,CAAC;QAE7E,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,qCAAqC,CAAC,QAAQ,CAAC,CAAC;IAClF,CAAC;IAED;;;OAGG;IACI,iBAAiB;QACpB,OAAO,IAAI,CAAC,aAAa,CAAC;IAC9B,CAAC;IAED;;;OAGG;IACI,qBAAqB;QACxB,OAAO,CAAC,CAAC;IACb,CAAC;IAED;;;OAGG;IACI,YAAY;QACf,OAAO,iBAAiB,CAAC;IAC7B,CAAC;IAED;;OAEG;IACH,IAAW,QAAQ;QACf,OAAO,IAAI,CAAC,OAAO,CAAC,C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YACjF,MAAM,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAAC,KAAK,CAAY,CAAC;YACrE,IAAI,WAAW,EAAE;gBACb,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE,IAAI,CAAC,aAAa,GAAG,CAAC,CAAC,CAAC;aACzE;SACJ;QAED,UAAU;QACV,IAAI,CAAC,MAAM,CAAC,YAAY,GAAG,IAAI,CAAC,WAAW,CAAC;QAC5C,KAAK,CAAC,gBAAgB,GAAG,IAAI,CAAC;QAC9B,KAAK,CAAC,eAAe,GAAG,IAAI,CAAC;IACjC,CAAC;CACJ;AAED,aAAa,CAAC,yBAAyB,EAAE,eAAe,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 type { INodeGeometryExecutionContext } from \"../../Interfaces/nodeGeometryExecutionContext\";\r\nimport type { VertexData } from \"../../../mesh.vertexData\";\r\nimport type { Vector3 } from \"../../../../Maths/math.vector\";\r\n\r\n/**\r\n * Block used to set normals for a geometry\r\n */\r\nexport class SetNormalsBlock extends NodeGeometryBlock implements INodeGeometryExecutionContext {\r\n private _vertexData: VertexData;\r\n private _currentIndex: number;\r\n\r\n /**\r\n * Create a new SetNormalsBlock\r\n * @param name defines the block name\r\n */\r\n public constructor(name: string) {\r\n super(name);\r\n\r\n this.registerInput(\"geometry\", NodeGeometryBlockConnectionPointTypes.Geometry);\r\n this.registerInput(\"normals\", NodeGeometryBlockConnectionPointTypes.Vector3);\r\n\r\n this.registerOutput(\"output\", NodeGeometryBlockConnectionPointTypes.Geometry);\r\n }\r\n\r\n /**\r\n * Gets the current index in the current flow\r\n * @returns the current index\r\n */\r\n public getExecutionIndex(): number {\r\n return this._currentIndex;\r\n }\r\n\r\n /**\r\n * Gets the current face index in the current flow\r\n * @returns the current face index\r\n */\r\n public getExecutionFaceIndex(): number {\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 \"SetNormalsBlock\";\r\n }\r\n\r\n /**\r\n * Gets the geometry input component\r\n */\r\n public get geometry(): NodeGeometryConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the normals input component\r\n */\r\n public get normals(): NodeGeometryConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the geometry output component\r\n */\r\n public get output(): NodeGeometryConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected _buildBlock(state: NodeGeometryBuildState) {\r\n state.executionContext = this;\r\n\r\n this._vertexData = this.geometry.getConnectedValue(state);\r\n state.geometryContext = this._vertexData;\r\n\r\n if (!this._vertexData || !this._vertexData.positions) {\r\n state.executionContext = null;\r\n state.geometryContext = null;\r\n this.output._storedValue = null;\r\n return;\r\n }\r\n\r\n if (!this.normals.isConnected) {\r\n state.executionContext = null;\r\n state.geometryContext = null;\r\n this.output._storedValue = this._vertexData;\r\n return;\r\n }\r\n\r\n if (!this._vertexData.normals) {\r\n this._vertexData.normals = [];\r\n }\r\n\r\n // Processing\r\n const vertexCount = this._vertexData.positions.length / 3;\r\n for (this._currentIndex = 0; this._currentIndex < vertexCount; this._currentIndex++) {\r\n const tempVector3 = this.normals.getConnectedValue(state) as Vector3;\r\n if (tempVector3) {\r\n tempVector3.toArray(this._vertexData.normals, this._currentIndex * 3);\r\n }\r\n }\r\n\r\n // Storage\r\n this.output._storedValue = this._vertexData;\r\n state.executionContext = null;\r\n state.geometryContext = null;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.SetNormalsBlock\", SetNormalsBlock);\r\n"]}
@@ -111,7 +111,7 @@ export class SetUVsBlock extends NodeGeometryBlock {
111
111
  state.geometryContext = null;
112
112
  }
113
113
  _dumpPropertiesCode() {
114
- const codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.textureCoordinateIndex};\r\n`;
114
+ const codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.textureCoordinateIndex};\n`;
115
115
  return codeString;
116
116
  }
117
117
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"setUVsBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/Meshes/Node/Blocks/Set/setUVsBlock.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAE5D,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,qCAAqC,EAAE,MAAM,8CAA8C,CAAC;AAKrG,OAAO,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAEtG;;GAEG;AACH,MAAM,OAAO,WAAY,SAAQ,iBAAiB;IAoB9C;;;OAGG;IACH,YAAmB,IAAY;QAC3B,KAAK,CAAC,IAAI,CAAC,CAAC;QArBhB;;WAEG;QAYI,2BAAsB,GAAG,CAAC,CAAC;QAS9B,IAAI,CAAC,aAAa,CAAC,UAAU,EAAE,qCAAqC,CAAC,QAAQ,CAAC,CAAC;QAC/E,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE,qCAAqC,CAAC,OAAO,CAAC,CAAC;QAEzE,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,qCAAqC,CAAC,QAAQ,CAAC,CAAC;IAClF,CAAC;IAED;;;OAGG;IACI,iBAAiB;QACpB,OAAO,IAAI,CAAC,aAAa,CAAC;IAC9B,CAAC;IAED;;;OAGG;IACI,qBAAqB;QACxB,OAAO,CAAC,CAAC;IACb,CAAC;IAED;;;OAGG;IACI,YAAY;QACf,OAAO,aAAa,CAAC;IACzB,CAAC;IAED;;OAEG;IACH,IAAW,Q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AEM,YAAY,CAAC,mBAAwB;QACxC,KAAK,CAAC,YAAY,CAAC,mBAAmB,CAAC,CAAC;QAExC,IAAI,CAAC,sBAAsB,GAAG,mBAAmB,CAAC,sBAAsB,CAAC;IAC7E,CAAC;CACJ;AA5IU;IAXN,sBAAsB,CAAC,2BAA2B,EAAE,sBAAsB,CAAC,IAAI,EAAE,UAAU,EAAE;QAC1F,SAAS,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE;QAC3B,OAAO,EAAE;YACL,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,EAAE;YAC1B,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,EAAE;YAC1B,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,EAAE;YAC1B,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,EAAE;YAC1B,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,EAAE;YAC1B,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,EAAE;SAC7B;KACJ,CAAC;2DACgC;AA8ItC,aAAa,CAAC,qBAAqB,EAAE,WAAW,CAAC,CAAC","sourcesContent":["import { NodeGeometryBlock } from \"../../nodeGeometryBlock\";\r\nimport type { NodeGeometryConnectionPoint } from \"../../nodeGeometryBlockConnectionPoint\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\nimport { NodeGeometryBlockConnectionPointTypes } from \"../../Enums/nodeGeometryConnectionPointTypes\";\r\nimport type { NodeGeometryBuildState } from \"../../nodeGeometryBuildState\";\r\nimport type { INodeGeometryExecutionContext } from \"../../Interfaces/nodeGeometryExecutionContext\";\r\nimport type { VertexData } from \"../../../mesh.vertexData\";\r\nimport type { Vector2 } from \"../../../../Maths/math.vector\";\r\nimport { PropertyTypeForEdition, editableInPropertyPage } from \"../../../../Decorators/nodeDecorator\";\r\n\r\n/**\r\n * Block used to set texture coordinates for a geometry\r\n */\r\nexport class SetUVsBlock extends NodeGeometryBlock implements INodeGeometryExecutionContext {\r\n private _vertexData: VertexData;\r\n private _currentIndex: number;\r\n\r\n /**\r\n * Gets or sets a value indicating which UV to set\r\n */\r\n @editableInPropertyPage(\"Texture coordinates index\", PropertyTypeForEdition.List, \"ADVANCED\", {\r\n notifiers: { update: true },\r\n options: [\r\n { label: \"UV1\", value: 0 },\r\n { label: \"UV2\", value: 1 },\r\n { label: \"UV3\", value: 2 },\r\n { label: \"UV4\", value: 3 },\r\n { label: \"UV5\", value: 4 },\r\n { label: \"UV6\", value: 5 },\r\n ],\r\n })\r\n public textureCoordinateIndex = 0;\r\n\r\n /**\r\n * Create a new SetUVsBlock\r\n * @param name defines the block name\r\n */\r\n public constructor(name: string) {\r\n super(name);\r\n\r\n this.registerInput(\"geometry\", NodeGeometryBlockConnectionPointTypes.Geometry);\r\n this.registerInput(\"uvs\", NodeGeometryBlockConnectionPointTypes.Vector2);\r\n\r\n this.registerOutput(\"output\", NodeGeometryBlockConnectionPointTypes.Geometry);\r\n }\r\n\r\n /**\r\n * Gets the current index in the current flow\r\n * @returns the current index\r\n */\r\n public getExecutionIndex(): number {\r\n return this._currentIndex;\r\n }\r\n\r\n /**\r\n * Gets the current face index in the current flow\r\n * @returns the current face index\r\n */\r\n public getExecutionFaceIndex(): number {\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 \"SetUVsBlock\";\r\n }\r\n\r\n /**\r\n * Gets the geometry input component\r\n */\r\n public get geometry(): NodeGeometryConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the uvs input component\r\n */\r\n public get uvs(): NodeGeometryConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the geometry output component\r\n */\r\n public get output(): NodeGeometryConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected _buildBlock(state: NodeGeometryBuildState) {\r\n state.executionContext = this;\r\n\r\n this._vertexData = this.geometry.getConnectedValue(state);\r\n state.geometryContext = this._vertexData;\r\n\r\n if (!this._vertexData || !this._vertexData.positions) {\r\n state.executionContext = null;\r\n state.geometryContext = null;\r\n this.output._storedValue = null;\r\n return;\r\n }\r\n\r\n if (!this.uvs.isConnected) {\r\n state.executionContext = null;\r\n state.geometryContext = null;\r\n this.output._storedValue = this._vertexData;\r\n return;\r\n }\r\n\r\n const uvs: number[] = [];\r\n\r\n // Processing\r\n const vertexCount = this._vertexData.positions.length / 3;\r\n for (this._currentIndex = 0; this._currentIndex < vertexCount; this._currentIndex++) {\r\n const tempVector2 = this.uvs.getConnectedValue(state) as Vector2;\r\n if (tempVector2) {\r\n tempVector2.toArray(uvs, this._currentIndex * 2);\r\n }\r\n }\r\n\r\n switch (this.textureCoordinateIndex) {\r\n case 0:\r\n this._vertexData.uvs = uvs;\r\n break;\r\n case 1:\r\n this._vertexData.uvs2 = uvs;\r\n break;\r\n case 2:\r\n this._vertexData.uvs3 = uvs;\r\n break;\r\n case 3:\r\n this._vertexData.uvs4 = uvs;\r\n break;\r\n case 4:\r\n this._vertexData.uvs5 = uvs;\r\n break;\r\n case 5:\r\n this._vertexData.uvs6 = uvs;\r\n break;\r\n }\r\n\r\n // Storage\r\n this.output._storedValue = this._vertexData;\r\n state.executionContext = null;\r\n state.geometryContext = null;\r\n }\r\n\r\n protected _dumpPropertiesCode() {\r\n const codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.textureCoordinateIndex};\\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.textureCoordinateIndex = this.textureCoordinateIndex;\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.textureCoordinateIndex = serializationObject.textureCoordinateIndex;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.SetUVsBlock\", SetUVsBlock);\r\n"]}
1
+ {"version":3,"file":"setUVsBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/Meshes/Node/Blocks/Set/setUVsBlock.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAE5D,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,qCAAqC,EAAE,MAAM,8CAA8C,CAAC;AAKrG,OAAO,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAEtG;;GAEG;AACH,MAAM,OAAO,WAAY,SAAQ,iBAAiB;IAoB9C;;;OAGG;IACH,YAAmB,IAAY;QAC3B,KAAK,CAAC,IAAI,CAAC,CAAC;QArBhB;;WAEG;QAYI,2BAAsB,GAAG,CAAC,CAAC;QAS9B,IAAI,CAAC,aAAa,CAAC,UAAU,EAAE,qCAAqC,CAAC,QAAQ,CAAC,CAAC;QAC/E,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE,qCAAqC,CAAC,OAAO,CAAC,CAAC;QAEzE,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,qCAAqC,CAAC,QAAQ,CAAC,CAAC;IAClF,CAAC;IAED;;;OAGG;IACI,iBAAiB;QACpB,OAAO,IAAI,CAAC,aAAa,CAAC;IAC9B,CAAC;IAED;;;OAGG;IACI,qBAAqB;QACxB,OAAO,CAAC,CAAC;IACb,CAAC;IAED;;;OAGG;IACI,YAAY;QACf,OAAO,aAAa,CAAC;IACzB,CAAC;IAED;;OAEG;IACH,IAAW,QAAQ;QACf,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAC3B,CAAC;IAED;;OAEG;IACH,IAAW,GAAG;QACV,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAC3B,CAAC;IAED;;OAEG;IACH,IAAW,MAAM;QACb,OAAO,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AAC,IAAI,EAAE,UAAU,EAAE;QAC1F,SAAS,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE;QAC3B,OAAO,EAAE;YACL,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,EAAE;YAC1B,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,EAAE;YAC1B,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,EAAE;YAC1B,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,EAAE;YAC1B,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,EAAE;YAC1B,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,EAAE;SAC7B;KACJ,CAAC;2DACgC;AA8ItC,aAAa,CAAC,qBAAqB,EAAE,WAAW,CAAC,CAAC","sourcesContent":["import { NodeGeometryBlock } from \"../../nodeGeometryBlock\";\r\nimport type { NodeGeometryConnectionPoint } from \"../../nodeGeometryBlockConnectionPoint\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\nimport { NodeGeometryBlockConnectionPointTypes } from \"../../Enums/nodeGeometryConnectionPointTypes\";\r\nimport type { NodeGeometryBuildState } from \"../../nodeGeometryBuildState\";\r\nimport type { INodeGeometryExecutionContext } from \"../../Interfaces/nodeGeometryExecutionContext\";\r\nimport type { VertexData } from \"../../../mesh.vertexData\";\r\nimport type { Vector2 } from \"../../../../Maths/math.vector\";\r\nimport { PropertyTypeForEdition, editableInPropertyPage } from \"../../../../Decorators/nodeDecorator\";\r\n\r\n/**\r\n * Block used to set texture coordinates for a geometry\r\n */\r\nexport class SetUVsBlock extends NodeGeometryBlock implements INodeGeometryExecutionContext {\r\n private _vertexData: VertexData;\r\n private _currentIndex: number;\r\n\r\n /**\r\n * Gets or sets a value indicating which UV to set\r\n */\r\n @editableInPropertyPage(\"Texture coordinates index\", PropertyTypeForEdition.List, \"ADVANCED\", {\r\n notifiers: { update: true },\r\n options: [\r\n { label: \"UV1\", value: 0 },\r\n { label: \"UV2\", value: 1 },\r\n { label: \"UV3\", value: 2 },\r\n { label: \"UV4\", value: 3 },\r\n { label: \"UV5\", value: 4 },\r\n { label: \"UV6\", value: 5 },\r\n ],\r\n })\r\n public textureCoordinateIndex = 0;\r\n\r\n /**\r\n * Create a new SetUVsBlock\r\n * @param name defines the block name\r\n */\r\n public constructor(name: string) {\r\n super(name);\r\n\r\n this.registerInput(\"geometry\", NodeGeometryBlockConnectionPointTypes.Geometry);\r\n this.registerInput(\"uvs\", NodeGeometryBlockConnectionPointTypes.Vector2);\r\n\r\n this.registerOutput(\"output\", NodeGeometryBlockConnectionPointTypes.Geometry);\r\n }\r\n\r\n /**\r\n * Gets the current index in the current flow\r\n * @returns the current index\r\n */\r\n public getExecutionIndex(): number {\r\n return this._currentIndex;\r\n }\r\n\r\n /**\r\n * Gets the current face index in the current flow\r\n * @returns the current face index\r\n */\r\n public getExecutionFaceIndex(): number {\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 \"SetUVsBlock\";\r\n }\r\n\r\n /**\r\n * Gets the geometry input component\r\n */\r\n public get geometry(): NodeGeometryConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the uvs input component\r\n */\r\n public get uvs(): NodeGeometryConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the geometry output component\r\n */\r\n public get output(): NodeGeometryConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected _buildBlock(state: NodeGeometryBuildState) {\r\n state.executionContext = this;\r\n\r\n this._vertexData = this.geometry.getConnectedValue(state);\r\n state.geometryContext = this._vertexData;\r\n\r\n if (!this._vertexData || !this._vertexData.positions) {\r\n state.executionContext = null;\r\n state.geometryContext = null;\r\n this.output._storedValue = null;\r\n return;\r\n }\r\n\r\n if (!this.uvs.isConnected) {\r\n state.executionContext = null;\r\n state.geometryContext = null;\r\n this.output._storedValue = this._vertexData;\r\n return;\r\n }\r\n\r\n const uvs: number[] = [];\r\n\r\n // Processing\r\n const vertexCount = this._vertexData.positions.length / 3;\r\n for (this._currentIndex = 0; this._currentIndex < vertexCount; this._currentIndex++) {\r\n const tempVector2 = this.uvs.getConnectedValue(state) as Vector2;\r\n if (tempVector2) {\r\n tempVector2.toArray(uvs, this._currentIndex * 2);\r\n }\r\n }\r\n\r\n switch (this.textureCoordinateIndex) {\r\n case 0:\r\n this._vertexData.uvs = uvs;\r\n break;\r\n case 1:\r\n this._vertexData.uvs2 = uvs;\r\n break;\r\n case 2:\r\n this._vertexData.uvs3 = uvs;\r\n break;\r\n case 3:\r\n this._vertexData.uvs4 = uvs;\r\n break;\r\n case 4:\r\n this._vertexData.uvs5 = uvs;\r\n break;\r\n case 5:\r\n this._vertexData.uvs6 = uvs;\r\n break;\r\n }\r\n\r\n // Storage\r\n this.output._storedValue = this._vertexData;\r\n state.executionContext = null;\r\n state.geometryContext = null;\r\n }\r\n\r\n protected _dumpPropertiesCode() {\r\n const codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.textureCoordinateIndex};\\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.textureCoordinateIndex = this.textureCoordinateIndex;\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.textureCoordinateIndex = serializationObject.textureCoordinateIndex;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.SetUVsBlock\", SetUVsBlock);\r\n"]}
@@ -151,7 +151,7 @@ export class BoxBlock extends NodeGeometryBlock {
151
151
  }
152
152
  }
153
153
  _dumpPropertiesCode() {
154
- const codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.evaluateContext = ${this.evaluateContext ? "true" : "false"};\r\n`;
154
+ const codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.evaluateContext = ${this.evaluateContext ? "true" : "false"};\n`;
155
155
  return codeString;
156
156
  }
157
157
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"boxBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/Meshes/Node/Blocks/Sources/boxBlock.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;AAC3D,OAAO,EAAE,4BAA4B,EAAE,wCAAwC;AAC/E,OAAO,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAEtG;;GAEG;AACH,MAAM,OAAO,QAAS,SAAQ,iBAAiB;IAQ3C;;;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;QACnF,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,qCAAqC,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QAClF,IAAI,CAAC,aAAa,CAAC,cAAc,EAAE,qCAAqC,CAAC,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QAC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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;AAlMU;IADN,sBAAsB,CAAC,kBAAkB,EAAE,sBAAsB,CAAC,OAAO,EAAE,UAAU,EAAE,EAAE,SAAS,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,CAAC;iDAC1F;AAoMnC,aAAa,CAAC,kBAAkB,EAAE,QAAQ,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 { CreateSegmentedBoxVertexData } from \"core/Meshes/Builders/boxBuilder\";\r\nimport { PropertyTypeForEdition, editableInPropertyPage } from \"../../../../Decorators/nodeDecorator\";\r\n\r\n/**\r\n * Defines a block used to generate box geometry data\r\n */\r\nexport class BoxBlock 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 BoxBlock\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 this.registerInput(\"depth\", NodeGeometryBlockConnectionPointTypes.Float, true, 0);\r\n this.registerInput(\"subdivisions\", NodeGeometryBlockConnectionPointTypes.Int, true, 1);\r\n this.registerInput(\"subdivisionsX\", NodeGeometryBlockConnectionPointTypes.Int, true, 0);\r\n this.registerInput(\"subdivisionsY\", NodeGeometryBlockConnectionPointTypes.Int, true, 0);\r\n this.registerInput(\"subdivisionsZ\", NodeGeometryBlockConnectionPointTypes.Int, 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 \"BoxBlock\";\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 depth input component\r\n */\r\n public get depth(): 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 subdivisionsX input component\r\n */\r\n public get subdivisionsX(): NodeGeometryConnectionPoint {\r\n return this._inputs[5];\r\n }\r\n\r\n /**\r\n * Gets the subdivisionsY input component\r\n */\r\n public get subdivisionsY(): NodeGeometryConnectionPoint {\r\n return this._inputs[6];\r\n }\r\n\r\n /**\r\n * Gets the subdivisionsZ input component\r\n */\r\n public get subdivisionsZ(): NodeGeometryConnectionPoint {\r\n return this._inputs[7];\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 && !this.depth.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 if (!this.depth.isConnected) {\r\n const depthInput = new GeometryInputBlock(\"Depth\");\r\n depthInput.value = 1;\r\n depthInput.output.connectTo(this.depth);\r\n }\r\n }\r\n\r\n protected _buildBlock(state: NodeGeometryBuildState) {\r\n const options: {\r\n size?: number;\r\n width?: number;\r\n height?: number;\r\n depth?: number;\r\n segments?: number;\r\n widthSegments?: number;\r\n heightSegments?: number;\r\n depthSegments?: number;\r\n } = {};\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 options.depth = this.depth.getConnectedValue(state);\r\n\r\n const subdivisions = this.subdivisions.getConnectedValue(state);\r\n const subdivisionsX = this.subdivisionsX.getConnectedValue(state);\r\n const subdivisionsY = this.subdivisionsY.getConnectedValue(state);\r\n const subdivisionsZ = this.subdivisionsZ.getConnectedValue(state);\r\n\r\n if (subdivisions) {\r\n options.segments = subdivisions;\r\n }\r\n\r\n if (subdivisionsX) {\r\n options.widthSegments = subdivisionsX;\r\n }\r\n\r\n if (subdivisionsY) {\r\n options.heightSegments = subdivisionsY;\r\n }\r\n\r\n if (subdivisionsZ) {\r\n options.depthSegments = subdivisionsZ;\r\n }\r\n\r\n // Append vertex data from the plane builder\r\n return CreateSegmentedBoxVertexData(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.BoxBlock\", BoxBlock);\r\n"]}
1
+ {"version":3,"file":"boxBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/Meshes/Node/Blocks/Sources/boxBlock.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,qCAAqC,EAAE,MAAM,8CAA8C,CAAC;AACrG,OAAO,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;;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;AAlMU;IADN,sBAAsB,CAAC,kBAAkB,EAAE,sBAAsB,CAAC,OAAO,EAAE,UAAU,EAAE,EAAE,SAAS,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,CAAC;iDAC1F;AAoMnC,aAAa,CAAC,kBAAkB,EAAE,QAAQ,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 { CreateSegmentedBoxVertexData } from \"core/Meshes/Builders/boxBuilder\";\r\nimport { PropertyTypeForEdition, editableInPropertyPage } from \"../../../../Decorators/nodeDecorator\";\r\n\r\n/**\r\n * Defines a block used to generate box geometry data\r\n */\r\nexport class BoxBlock 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 BoxBlock\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 this.registerInput(\"depth\", NodeGeometryBlockConnectionPointTypes.Float, true, 0);\r\n this.registerInput(\"subdivisions\", NodeGeometryBlockConnectionPointTypes.Int, true, 1);\r\n this.registerInput(\"subdivisionsX\", NodeGeometryBlockConnectionPointTypes.Int, true, 0);\r\n this.registerInput(\"subdivisionsY\", NodeGeometryBlockConnectionPointTypes.Int, true, 0);\r\n this.registerInput(\"subdivisionsZ\", NodeGeometryBlockConnectionPointTypes.Int, 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 \"BoxBlock\";\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 depth input component\r\n */\r\n public get depth(): 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 subdivisionsX input component\r\n */\r\n public get subdivisionsX(): NodeGeometryConnectionPoint {\r\n return this._inputs[5];\r\n }\r\n\r\n /**\r\n * Gets the subdivisionsY input component\r\n */\r\n public get subdivisionsY(): NodeGeometryConnectionPoint {\r\n return this._inputs[6];\r\n }\r\n\r\n /**\r\n * Gets the subdivisionsZ input component\r\n */\r\n public get subdivisionsZ(): NodeGeometryConnectionPoint {\r\n return this._inputs[7];\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 && !this.depth.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 if (!this.depth.isConnected) {\r\n const depthInput = new GeometryInputBlock(\"Depth\");\r\n depthInput.value = 1;\r\n depthInput.output.connectTo(this.depth);\r\n }\r\n }\r\n\r\n protected _buildBlock(state: NodeGeometryBuildState) {\r\n const options: {\r\n size?: number;\r\n width?: number;\r\n height?: number;\r\n depth?: number;\r\n segments?: number;\r\n widthSegments?: number;\r\n heightSegments?: number;\r\n depthSegments?: number;\r\n } = {};\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 options.depth = this.depth.getConnectedValue(state);\r\n\r\n const subdivisions = this.subdivisions.getConnectedValue(state);\r\n const subdivisionsX = this.subdivisionsX.getConnectedValue(state);\r\n const subdivisionsY = this.subdivisionsY.getConnectedValue(state);\r\n const subdivisionsZ = this.subdivisionsZ.getConnectedValue(state);\r\n\r\n if (subdivisions) {\r\n options.segments = subdivisions;\r\n }\r\n\r\n if (subdivisionsX) {\r\n options.widthSegments = subdivisionsX;\r\n }\r\n\r\n if (subdivisionsY) {\r\n options.heightSegments = subdivisionsY;\r\n }\r\n\r\n if (subdivisionsZ) {\r\n options.depthSegments = subdivisionsZ;\r\n }\r\n\r\n // Append vertex data from the plane builder\r\n return CreateSegmentedBoxVertexData(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.BoxBlock\", BoxBlock);\r\n"]}
@@ -93,7 +93,7 @@ export class CapsuleBlock extends NodeGeometryBlock {
93
93
  }
94
94
  }
95
95
  _dumpPropertiesCode() {
96
- const codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.evaluateContext = ${this.evaluateContext ? "true" : "false"};\r\n`;
96
+ const codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.evaluateContext = ${this.evaluateContext ? "true" : "false"};\n`;
97
97
  return codeString;
98
98
  }
99
99
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"capsuleBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/Meshes/Node/Blocks/Sources/capsuleBlock.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,qCAAqC,EAAE,MAAM,8CAA8C,CAAC;AACrG,OAAO,EAAE,iB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CAAC;QAC5C,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;AA/HU;IADN,sBAAsB,CAAC,kBAAkB,EAAE,sBAAsB,CAAC,OAAO,EAAE,UAAU,EAAE,EAAE,SAAS,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,CAAC;qDAC1F;AAiInC,aAAa,CAAC,sBAAsB,EAAE,YAAY,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 { Vector3 } from \"../../../../Maths/math.vector\";\r\nimport { CreateCapsuleVertexData } from \"core/Meshes/Builders/capsuleBuilder\";\r\nimport { PropertyTypeForEdition, editableInPropertyPage } from \"../../../../Decorators/nodeDecorator\";\r\n\r\n/**\r\n * Defines a block used to generate capsule geometry data\r\n */\r\nexport class CapsuleBlock 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 CapsuleBlock\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(\"height\", NodeGeometryBlockConnectionPointTypes.Float, true, 1);\r\n this.registerInput(\"radius\", NodeGeometryBlockConnectionPointTypes.Float, true, 0.25);\r\n this.registerInput(\"tessellation\", NodeGeometryBlockConnectionPointTypes.Int, true, 16);\r\n this.registerInput(\"subdivisions\", NodeGeometryBlockConnectionPointTypes.Int, true, 2);\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 \"CapsuleBlock\";\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[0];\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[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 subdivisions input component\r\n */\r\n public get subdivisions(): NodeGeometryConnectionPoint {\r\n return this._inputs[3];\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.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 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 orientation?: Vector3;\r\n subdivisions?: number;\r\n tessellation?: number;\r\n height?: number;\r\n radius?: number;\r\n capSubdivisions?: number;\r\n radiusTop?: number;\r\n radiusBottom?: number;\r\n topCapSubdivisions?: number;\r\n bottomCapSubdivisions?: number;\r\n updatable?: boolean;\r\n } = {};\r\n\r\n const func = (state: NodeGeometryBuildState) => {\r\n options.height = this.height.getConnectedValue(state);\r\n options.radius = this.radius.getConnectedValue(state);\r\n options.tessellation = this.tessellation.getConnectedValue(state);\r\n options.subdivisions = this.subdivisions.getConnectedValue(state);\r\n\r\n // Append vertex data from the plane builder\r\n return CreateCapsuleVertexData(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.CapsuleBlock\", CapsuleBlock);\r\n"]}
1
+ {"version":3,"file":"capsuleBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/Meshes/Node/Blocks/Sources/capsuleBlock.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,uBAAuB,EAAE,4CAA4C;AAC9E,OAAO,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAEtG;;GAEG;AACH,MAAM,OAAO,YAAa,SAAQ,iBAAiB;IAQ/C;;;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,QAAQ,EAAE,qCAAqC,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;QACtF,IAAI,CAAC,aAAa,CAAC,cAAc,EAAE,qCAAqC,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;QACxF,IAAI,CAAC,aAAa,CAAC,cAAc,EAAE,qCAAqC,CAAC,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QAEvF,IAAI,CAAC,cAAc,CAAC,UAAU,EAAE,qCAAqC,CAAC,QAAQ,CAAC,CAAC;IACpF,CAAC;IAED;;;OAGG;IACI,YAAY;QACf,OAAO,cAAc,CAA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YAAY,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 { Vector3 } from \"../../../../Maths/math.vector\";\r\nimport { CreateCapsuleVertexData } from \"core/Meshes/Builders/capsuleBuilder\";\r\nimport { PropertyTypeForEdition, editableInPropertyPage } from \"../../../../Decorators/nodeDecorator\";\r\n\r\n/**\r\n * Defines a block used to generate capsule geometry data\r\n */\r\nexport class CapsuleBlock 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 CapsuleBlock\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(\"height\", NodeGeometryBlockConnectionPointTypes.Float, true, 1);\r\n this.registerInput(\"radius\", NodeGeometryBlockConnectionPointTypes.Float, true, 0.25);\r\n this.registerInput(\"tessellation\", NodeGeometryBlockConnectionPointTypes.Int, true, 16);\r\n this.registerInput(\"subdivisions\", NodeGeometryBlockConnectionPointTypes.Int, true, 2);\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 \"CapsuleBlock\";\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[0];\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[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 subdivisions input component\r\n */\r\n public get subdivisions(): NodeGeometryConnectionPoint {\r\n return this._inputs[3];\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.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 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 orientation?: Vector3;\r\n subdivisions?: number;\r\n tessellation?: number;\r\n height?: number;\r\n radius?: number;\r\n capSubdivisions?: number;\r\n radiusTop?: number;\r\n radiusBottom?: number;\r\n topCapSubdivisions?: number;\r\n bottomCapSubdivisions?: number;\r\n updatable?: boolean;\r\n } = {};\r\n\r\n const func = (state: NodeGeometryBuildState) => {\r\n options.height = this.height.getConnectedValue(state);\r\n options.radius = this.radius.getConnectedValue(state);\r\n options.tessellation = this.tessellation.getConnectedValue(state);\r\n options.subdivisions = this.subdivisions.getConnectedValue(state);\r\n\r\n // Append vertex data from the plane builder\r\n return CreateCapsuleVertexData(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.CapsuleBlock\", CapsuleBlock);\r\n"]}
@@ -119,7 +119,7 @@ export class CylinderBlock extends NodeGeometryBlock {
119
119
  }
120
120
  }
121
121
  _dumpPropertiesCode() {
122
- const codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.evaluateContext = ${this.evaluateContext ? "true" : "false"};\r\n`;
122
+ const codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.evaluateContext = ${this.evaluateContext ? "true" : "false"};\n`;
123
123
  return codeString;
124
124
  }
125
125
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"cylinderBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/Meshes/Node/Blocks/Sources/cylinderBlock.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,wBAAwB,EAAE,6CAA6C;AAEhF,OAAO,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAEtG;;GAEG;AACH,MAAM,OAAO,aAAc,SAAQ,iBAAiB;IAQhD;;;OAGG;IACH,YAAmB,IAAY;QAC3B,KAAK,CAAC,IAAI,CAAC,CAAC;QAZhB;;;W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AAe,GAAG,mBAAmB,CAAC,eAAe,CAAC;IAC/D,CAAC;CACJ;AAjKU;IADN,sBAAsB,CAAC,kBAAkB,EAAE,sBAAsB,CAAC,OAAO,EAAE,UAAU,EAAE,EAAE,SAAS,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,CAAC;sDAC1F;AAmKnC,aAAa,CAAC,uBAAuB,EAAE,aAAa,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 { CreateCylinderVertexData } from \"core/Meshes/Builders/cylinderBuilder\";\r\nimport type { Color4 } from \"../../../../Maths/math.color\";\r\nimport { PropertyTypeForEdition, editableInPropertyPage } from \"../../../../Decorators/nodeDecorator\";\r\n\r\n/**\r\n * Defines a block used to generate cylinder geometry data\r\n */\r\nexport class CylinderBlock 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(\"height\", NodeGeometryBlockConnectionPointTypes.Float, true, 25);\r\n this.registerInput(\"diameter\", NodeGeometryBlockConnectionPointTypes.Float, true, 1);\r\n this.registerInput(\"diameterTop\", NodeGeometryBlockConnectionPointTypes.Float, true, 0);\r\n this.registerInput(\"diameterBottom\", NodeGeometryBlockConnectionPointTypes.Float, true, 0);\r\n this.registerInput(\"subdivisions\", NodeGeometryBlockConnectionPointTypes.Int, true, 1);\r\n this.registerInput(\"tessellation\", NodeGeometryBlockConnectionPointTypes.Int, true, 24);\r\n this.registerInput(\"arc\", NodeGeometryBlockConnectionPointTypes.Float, true, 1.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 \"CylinderBlock\";\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[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 diameterTop input component\r\n */\r\n public get diameterTop(): NodeGeometryConnectionPoint {\r\n return this._inputs[2];\r\n }\r\n\r\n /**\r\n * Gets the diameterBottom input component\r\n */\r\n public get diameterBottom(): 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 tessellation input component\r\n */\r\n public get tessellation(): NodeGeometryConnectionPoint {\r\n return this._inputs[5];\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[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 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: {\r\n height?: number;\r\n diameterTop?: number;\r\n diameterBottom?: number;\r\n diameter?: number;\r\n tessellation?: number;\r\n subdivisions?: number;\r\n arc?: number;\r\n faceColors?: Color4[];\r\n faceUV?: Vector4[];\r\n hasRings?: boolean;\r\n enclose?: boolean;\r\n cap?: 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.height = this.height.getConnectedValue(state);\r\n options.diameter = this.diameter.getConnectedValue(state);\r\n if (!options.diameter) {\r\n options.diameterTop = this.diameterTop.getConnectedValue(state);\r\n options.diameterBottom = this.diameterBottom.getConnectedValue(state);\r\n }\r\n options.tessellation = this.tessellation.getConnectedValue(state);\r\n options.subdivisions = this.subdivisions.getConnectedValue(state);\r\n options.arc = this.arc.getConnectedValue(state);\r\n\r\n // Append vertex data from the plane builder\r\n return CreateCylinderVertexData(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.CylinderBlock\", CylinderBlock);\r\n"]}
1
+ {"version":3,"file":"cylinderBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/Meshes/Node/Blocks/Sources/cylinderBlock.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,wBAAwB,EAAE,6CAA6C;AAEhF,OAAO,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAEtG;;GAEG;AACH,MAAM,OAAO,aAAc,SAAQ,iBAAiB;IAQhD;;;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,EAAE,CAAC,CAAC;QACpF,IAAI,CAAC,aAAa,CAAC,UAAU,EAAE,qCAAqC,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QACrF,IAAI,CAAC,aAAa,CAAC,aAAa,EAAE,qCAAqC,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QACxF,IAAI,CAAC,aAAa,CAAC,gBAAgB,EAAE,qCAAqC,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QAC3F,IAAI,CAAC,aAAa,CAAC,cAAc,EAAE,qCAAqC,CAAC,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QACvF,IAAI,CAAC,aAAa,CAAC,cAAc,EAAE,qCAAqC,CAAC,GAAG,EAAE,IAAI,EAAE,EA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AG,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,KAAK,CAAC;QAC7I,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;AAjKU;IADN,sBAAsB,CAAC,kBAAkB,EAAE,sBAAsB,CAAC,OAAO,EAAE,UAAU,EAAE,EAAE,SAAS,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,CAAC;sDAC1F;AAmKnC,aAAa,CAAC,uBAAuB,EAAE,aAAa,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 { CreateCylinderVertexData } from \"core/Meshes/Builders/cylinderBuilder\";\r\nimport type { Color4 } from \"../../../../Maths/math.color\";\r\nimport { PropertyTypeForEdition, editableInPropertyPage } from \"../../../../Decorators/nodeDecorator\";\r\n\r\n/**\r\n * Defines a block used to generate cylinder geometry data\r\n */\r\nexport class CylinderBlock 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(\"height\", NodeGeometryBlockConnectionPointTypes.Float, true, 25);\r\n this.registerInput(\"diameter\", NodeGeometryBlockConnectionPointTypes.Float, true, 1);\r\n this.registerInput(\"diameterTop\", NodeGeometryBlockConnectionPointTypes.Float, true, 0);\r\n this.registerInput(\"diameterBottom\", NodeGeometryBlockConnectionPointTypes.Float, true, 0);\r\n this.registerInput(\"subdivisions\", NodeGeometryBlockConnectionPointTypes.Int, true, 1);\r\n this.registerInput(\"tessellation\", NodeGeometryBlockConnectionPointTypes.Int, true, 24);\r\n this.registerInput(\"arc\", NodeGeometryBlockConnectionPointTypes.Float, true, 1.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 \"CylinderBlock\";\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[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 diameterTop input component\r\n */\r\n public get diameterTop(): NodeGeometryConnectionPoint {\r\n return this._inputs[2];\r\n }\r\n\r\n /**\r\n * Gets the diameterBottom input component\r\n */\r\n public get diameterBottom(): 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 tessellation input component\r\n */\r\n public get tessellation(): NodeGeometryConnectionPoint {\r\n return this._inputs[5];\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[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 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: {\r\n height?: number;\r\n diameterTop?: number;\r\n diameterBottom?: number;\r\n diameter?: number;\r\n tessellation?: number;\r\n subdivisions?: number;\r\n arc?: number;\r\n faceColors?: Color4[];\r\n faceUV?: Vector4[];\r\n hasRings?: boolean;\r\n enclose?: boolean;\r\n cap?: 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.height = this.height.getConnectedValue(state);\r\n options.diameter = this.diameter.getConnectedValue(state);\r\n if (!options.diameter) {\r\n options.diameterTop = this.diameterTop.getConnectedValue(state);\r\n options.diameterBottom = this.diameterBottom.getConnectedValue(state);\r\n }\r\n options.tessellation = this.tessellation.getConnectedValue(state);\r\n options.subdivisions = this.subdivisions.getConnectedValue(state);\r\n options.arc = this.arc.getConnectedValue(state);\r\n\r\n // Append vertex data from the plane builder\r\n return CreateCylinderVertexData(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.CylinderBlock\", CylinderBlock);\r\n"]}
@@ -29,7 +29,7 @@ export declare class DiscBlock extends NodeGeometryBlock {
29
29
  */
30
30
  get tessellation(): NodeGeometryConnectionPoint;
31
31
  /**
32
- * Gets the subdivisions input component
32
+ * Gets the arc input component
33
33
  */
34
34
  get arc(): NodeGeometryConnectionPoint;
35
35
  /**
@@ -45,7 +45,7 @@ export class DiscBlock extends NodeGeometryBlock {
45
45
  return this._inputs[1];
46
46
  }
47
47
  /**
48
- * Gets the subdivisions input component
48
+ * Gets the arc input component
49
49
  */
50
50
  get arc() {
51
51
  return this._inputs[2];
@@ -80,7 +80,7 @@ export class DiscBlock 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":"discBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/Meshes/Node/Blocks/Sources/discBlock.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,oBAAoB,EAAE,yCAAyC;AACxE,OAAO,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAEtG;;GAEG;AACH,MAAM,OAAO,SAAU,SAAQ,iBAAiB;IAQ5C;;;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,GAAG,CAAC,CAAC;QACrF,IAAI,CAAC,aAAa,CAAC,cAAc,EAAE,qCAAqC,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;QACxF,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE,qCAAqC,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,CAAC,CAAC;QAElF,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,MAAM;QACb,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAC3B,CAAC;IAED;;OAEG;IACH,IAAW,YAAY;QACnB,O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AG,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;kDAC1F;AA6GnC,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 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 { CreateDiscVertexData } from \"core/Meshes/Builders/discBuilder\";\r\nimport { PropertyTypeForEdition, editableInPropertyPage } from \"../../../../Decorators/nodeDecorator\";\r\n\r\n/**\r\n * Defines a block used to generate disc geometry data\r\n */\r\nexport class DiscBlock 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 DiscBlock\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, 0.5);\r\n this.registerInput(\"tessellation\", NodeGeometryBlockConnectionPointTypes.Int, true, 64);\r\n this.registerInput(\"arc\", NodeGeometryBlockConnectionPointTypes.Float, true, 1.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 \"DiscBlock\";\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 tessellation input component\r\n */\r\n public get tessellation(): NodeGeometryConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the subdivisions input component\r\n */\r\n public get arc(): 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.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 tessellation?: number;\r\n arc?: number;\r\n sideOrientation?: number;\r\n frontUVs?: Vector4;\r\n backUVs?: Vector4;\r\n } = {};\r\n const func = (state: NodeGeometryBuildState) => {\r\n options.radius = this.radius.getConnectedValue(state);\r\n options.tessellation = this.tessellation.getConnectedValue(state);\r\n options.arc = this.arc.getConnectedValue(state);\r\n\r\n // Append vertex data from the plane builder\r\n return CreateDiscVertexData(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.DiscBlock\", DiscBlock);\r\n"]}
1
+ {"version":3,"file":"discBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/Meshes/Node/Blocks/Sources/discBlock.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,oBAAoB,EAAE,yCAAyC;AACxE,OAAO,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAEtG;;GAEG;AACH,MAAM,OAAO,SAAU,SAAQ,iBAAiB;IAQ5C;;;OAGG;IACH,YAAmB,IAAY;QAC3B,KAAK,CAAC,IAAI,CAAC,CAAC;QAZhB;;;WAGG;QAEI,oBAAe,GAA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,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 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 { CreateDiscVertexData } from \"core/Meshes/Builders/discBuilder\";\r\nimport { PropertyTypeForEdition, editableInPropertyPage } from \"../../../../Decorators/nodeDecorator\";\r\n\r\n/**\r\n * Defines a block used to generate disc geometry data\r\n */\r\nexport class DiscBlock 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 DiscBlock\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, 0.5);\r\n this.registerInput(\"tessellation\", NodeGeometryBlockConnectionPointTypes.Int, true, 64);\r\n this.registerInput(\"arc\", NodeGeometryBlockConnectionPointTypes.Float, true, 1.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 \"DiscBlock\";\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 tessellation input component\r\n */\r\n public get tessellation(): NodeGeometryConnectionPoint {\r\n return this._inputs[1];\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[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.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 tessellation?: number;\r\n arc?: number;\r\n sideOrientation?: number;\r\n frontUVs?: Vector4;\r\n backUVs?: Vector4;\r\n } = {};\r\n const func = (state: NodeGeometryBuildState) => {\r\n options.radius = this.radius.getConnectedValue(state);\r\n options.tessellation = this.tessellation.getConnectedValue(state);\r\n options.arc = this.arc.getConnectedValue(state);\r\n\r\n // Append vertex data from the plane builder\r\n return CreateDiscVertexData(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.DiscBlock\", DiscBlock);\r\n"]}
@@ -101,7 +101,7 @@ export class GridBlock extends NodeGeometryBlock {
101
101
  }
102
102
  }
103
103
  _dumpPropertiesCode() {
104
- const codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.evaluateContext = ${this.evaluateContext ? "true" : "false"};\r\n`;
104
+ const codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.evaluateContext = ${this.evaluateContext ? "true" : "false"};\n`;
105
105
  return codeString;
106
106
  }
107
107
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"gridBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/Meshes/Node/Blocks/Sources/gridBlock.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;AAC3D,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AACzE,OAAO,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAEtG;;GAEG;AACH,MAAM,OAAO,SAAU,SAAQ,iBAAiB;IAQ5C;;;OAGG;IACH,YAAmB,IAAY;QAC3B,KAAK,CAAC,IAAI,CAAC,CAAC;QAZhB;;;WAGG;QAEI,oBAAe,GAAG,KAAK,CAAC;QAS3B,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;QACnF,IAAI,CAAC,aAAa,CAAC,cAAc,EAAE,qCAAqC,CAAC,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QACvF,IAAI,CAAC,aAAa,CAAC,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MAAM,mBAAmB,GAAG,KAAK,CAAC,SAAS,EAAE,CAAC;QAE9C,mBAAmB,CAAC,eAAe,GAAG,IAAI,CAAC,eAAe,CAAC;QAE3D,OAAO,mBAAmB,CAAC;IAC/B,CAAC;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;AA5HU;IADN,sBAAsB,CAAC,kBAAkB,EAAE,sBAAsB,CAAC,OAAO,EAAE,UAAU,EAAE,EAAE,SAAS,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,CAAC;kDAC1F;AA8HnC,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 type { NodeGeometryBuildState } from \"../../nodeGeometryBuildState\";\r\nimport { GeometryInputBlock } from \"../geometryInputBlock\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\nimport { CreateGroundVertexData } from \"../../../Builders/groundBuilder\";\r\nimport { PropertyTypeForEdition, editableInPropertyPage } from \"../../../../Decorators/nodeDecorator\";\r\n\r\n/**\r\n * Defines a block used to generate grid geometry data\r\n */\r\nexport class GridBlock 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 GridBlock\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(\"width\", NodeGeometryBlockConnectionPointTypes.Float, true, 1);\r\n this.registerInput(\"height\", NodeGeometryBlockConnectionPointTypes.Float, true, 1);\r\n this.registerInput(\"subdivisions\", NodeGeometryBlockConnectionPointTypes.Int, true, 1);\r\n this.registerInput(\"subdivisionsX\", NodeGeometryBlockConnectionPointTypes.Int, true, 0);\r\n this.registerInput(\"subdivisionsY\", NodeGeometryBlockConnectionPointTypes.Int, 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 \"GridBlock\";\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[0];\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[1];\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[2];\r\n }\r\n\r\n /**\r\n * Gets the subdivisionsX input component\r\n */\r\n public get subdivisionsX(): NodeGeometryConnectionPoint {\r\n return this._inputs[3];\r\n }\r\n\r\n /**\r\n * Gets the subdivisionsY input component\r\n */\r\n public get subdivisionsY(): 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.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: { width?: number; height?: number; subdivisions?: number; subdivisionsX?: number; subdivisionsY?: number } = {};\r\n const func = (state: NodeGeometryBuildState) => {\r\n options.width = this.width.getConnectedValue(state);\r\n options.height = this.height.getConnectedValue(state);\r\n options.subdivisions = this.subdivisions.getConnectedValue(state);\r\n options.subdivisionsX = this.subdivisionsX.getConnectedValue(state);\r\n options.subdivisionsY = this.subdivisionsY.getConnectedValue(state);\r\n\r\n // Append vertex data from the plane builder\r\n return CreateGroundVertexData(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.GridBlock\", GridBlock);\r\n"]}
1
+ {"version":3,"file":"gridBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/Meshes/Node/Blocks/Sources/gridBlock.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;AAC3D,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AACzE,O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AC,iBAAiB,CAAC,KAAK,CAAC,CAAC;YAEpE,4CAA4C;YAC5C,OAAO,sBAAsB,CAAC,OAAO,CAAC,CAAC;QAC3C,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,KAAK,CAAC;QAC7I,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;AA5HU;IADN,sBAAsB,CAAC,kBAAkB,EAAE,sBAAsB,CAAC,OAAO,EAAE,UAAU,EAAE,EAAE,SAAS,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,CAAC;kDAC1F;AA8HnC,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 type { NodeGeometryBuildState } from \"../../nodeGeometryBuildState\";\r\nimport { GeometryInputBlock } from \"../geometryInputBlock\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\nimport { CreateGroundVertexData } from \"../../../Builders/groundBuilder\";\r\nimport { PropertyTypeForEdition, editableInPropertyPage } from \"../../../../Decorators/nodeDecorator\";\r\n\r\n/**\r\n * Defines a block used to generate grid geometry data\r\n */\r\nexport class GridBlock 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 GridBlock\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(\"width\", NodeGeometryBlockConnectionPointTypes.Float, true, 1);\r\n this.registerInput(\"height\", NodeGeometryBlockConnectionPointTypes.Float, true, 1);\r\n this.registerInput(\"subdivisions\", NodeGeometryBlockConnectionPointTypes.Int, true, 1);\r\n this.registerInput(\"subdivisionsX\", NodeGeometryBlockConnectionPointTypes.Int, true, 0);\r\n this.registerInput(\"subdivisionsY\", NodeGeometryBlockConnectionPointTypes.Int, 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 \"GridBlock\";\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[0];\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[1];\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[2];\r\n }\r\n\r\n /**\r\n * Gets the subdivisionsX input component\r\n */\r\n public get subdivisionsX(): NodeGeometryConnectionPoint {\r\n return this._inputs[3];\r\n }\r\n\r\n /**\r\n * Gets the subdivisionsY input component\r\n */\r\n public get subdivisionsY(): 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.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: { width?: number; height?: number; subdivisions?: number; subdivisionsX?: number; subdivisionsY?: number } = {};\r\n const func = (state: NodeGeometryBuildState) => {\r\n options.width = this.width.getConnectedValue(state);\r\n options.height = this.height.getConnectedValue(state);\r\n options.subdivisions = this.subdivisions.getConnectedValue(state);\r\n options.subdivisionsX = this.subdivisionsX.getConnectedValue(state);\r\n options.subdivisionsY = this.subdivisionsY.getConnectedValue(state);\r\n\r\n // Append vertex data from the plane builder\r\n return CreateGroundVertexData(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.GridBlock\", GridBlock);\r\n"]}
@@ -25,15 +25,15 @@ export declare class IcoSphereBlock extends NodeGeometryBlock {
25
25
  */
26
26
  get radius(): NodeGeometryConnectionPoint;
27
27
  /**
28
- * Gets the radius input component
28
+ * Gets the radiusX input component
29
29
  */
30
30
  get radiusX(): NodeGeometryConnectionPoint;
31
31
  /**
32
- * Gets the radius input component
32
+ * Gets the radiusY input component
33
33
  */
34
34
  get radiusY(): NodeGeometryConnectionPoint;
35
35
  /**
36
- * Gets the radius input component
36
+ * Gets the radiusZ input component
37
37
  */
38
38
  get radiusZ(): NodeGeometryConnectionPoint;
39
39
  /**
@@ -41,19 +41,19 @@ export class IcoSphereBlock extends NodeGeometryBlock {
41
41
  return this._inputs[0];
42
42
  }
43
43
  /**
44
- * Gets the radius input component
44
+ * Gets the radiusX input component
45
45
  */
46
46
  get radiusX() {
47
47
  return this._inputs[1];
48
48
  }
49
49
  /**
50
- * Gets the radius input component
50
+ * Gets the radiusY input component
51
51
  */
52
52
  get radiusY() {
53
53
  return this._inputs[2];
54
54
  }
55
55
  /**
56
- * Gets the radius input component
56
+ * Gets the radiusZ input component
57
57
  */
58
58
  get radiusZ() {
59
59
  return this._inputs[3];
@@ -96,7 +96,7 @@ export class IcoSphereBlock extends NodeGeometryBlock {
96
96
  }
97
97
  }
98
98
  _dumpPropertiesCode() {
99
- const codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.evaluateContext = ${this.evaluateContext ? "true" : "false"};\r\n`;
99
+ const codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.evaluateContext = ${this.evaluateContext ? "true" : "false"};\n`;
100
100
  return codeString;
101
101
  }
102
102
  /**