@babylonjs/core 7.49.0 → 7.51.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Behaviors/Cameras/framingBehavior.js +3 -0
- package/Behaviors/Cameras/framingBehavior.js.map +1 -1
- package/Behaviors/Meshes/baseSixDofDragBehavior.js +10 -9
- package/Behaviors/Meshes/baseSixDofDragBehavior.js.map +1 -1
- package/Behaviors/Meshes/pointerDragBehavior.js +4 -1
- package/Behaviors/Meshes/pointerDragBehavior.js.map +1 -1
- package/Buffers/bufferUtils.d.ts +9 -10
- package/Buffers/bufferUtils.js +16 -0
- package/Buffers/bufferUtils.js.map +1 -1
- package/Culling/Helper/transformFeedbackBoundingHelper.js +2 -1
- package/Culling/Helper/transformFeedbackBoundingHelper.js.map +1 -1
- package/Engines/AbstractEngine/abstractEngine.cubeTexture.js +2 -3
- package/Engines/AbstractEngine/abstractEngine.cubeTexture.js.map +1 -1
- package/Engines/WebGPU/webgpuBufferManager.js +23 -22
- package/Engines/WebGPU/webgpuBufferManager.js.map +1 -1
- package/Engines/abstractEngine.js +2 -2
- package/Engines/abstractEngine.js.map +1 -1
- package/Engines/thinEngine.functions.js +5 -3
- package/Engines/thinEngine.functions.js.map +1 -1
- package/FrameGraph/Node/Blocks/Rendering/utilityLayerRendererBlock.d.ts +43 -0
- package/FrameGraph/Node/Blocks/Rendering/utilityLayerRendererBlock.js +83 -0
- package/FrameGraph/Node/Blocks/Rendering/utilityLayerRendererBlock.js.map +1 -0
- package/FrameGraph/Node/Blocks/index.d.ts +1 -0
- package/FrameGraph/Node/Blocks/index.js +1 -0
- package/FrameGraph/Node/Blocks/index.js.map +1 -1
- package/FrameGraph/Tasks/Rendering/utilityLayerRendererTask.d.ts +35 -0
- package/FrameGraph/Tasks/Rendering/utilityLayerRendererTask.js +40 -0
- package/FrameGraph/Tasks/Rendering/utilityLayerRendererTask.js.map +1 -0
- package/FrameGraph/frameGraph.d.ts +4 -0
- package/FrameGraph/frameGraph.js +6 -0
- package/FrameGraph/frameGraph.js.map +1 -1
- package/FrameGraph/frameGraphRenderContext.d.ts +2 -2
- package/FrameGraph/frameGraphRenderContext.js.map +1 -1
- package/FrameGraph/index.d.ts +1 -0
- package/FrameGraph/index.js +1 -0
- package/FrameGraph/index.js.map +1 -1
- package/Layers/thinEffectLayer.js +3 -1
- package/Layers/thinEffectLayer.js.map +1 -1
- package/Lights/Shadows/shadowGenerator.js +3 -1
- package/Lights/Shadows/shadowGenerator.js.map +1 -1
- package/Loading/loadingScreen.js +4 -1
- package/Loading/loadingScreen.js.map +1 -1
- package/Materials/GreasedLine/greasedLinePluginMaterialShadersGLSL.js +9 -20
- package/Materials/GreasedLine/greasedLinePluginMaterialShadersGLSL.js.map +1 -1
- package/Materials/GreasedLine/greasedLinePluginMaterialShadersWGSL.js +8 -19
- package/Materials/GreasedLine/greasedLinePluginMaterialShadersWGSL.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/prePassOutputBlock.d.ts +8 -0
- package/Materials/Node/Blocks/Fragment/prePassOutputBlock.js +36 -0
- package/Materials/Node/Blocks/Fragment/prePassOutputBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.js +6 -3
- package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.js.map +1 -1
- package/Materials/Node/Blocks/Vertex/morphTargetsBlock.d.ts +8 -0
- package/Materials/Node/Blocks/Vertex/morphTargetsBlock.js +48 -0
- package/Materials/Node/Blocks/Vertex/morphTargetsBlock.js.map +1 -1
- package/Materials/Node/nodeMaterial.d.ts +2 -0
- package/Materials/Node/nodeMaterial.js +14 -0
- package/Materials/Node/nodeMaterial.js.map +1 -1
- package/Materials/PBR/pbrBaseMaterial.d.ts +2 -0
- package/Materials/PBR/pbrBaseMaterial.js +2 -0
- package/Materials/PBR/pbrBaseMaterial.js.map +1 -1
- package/Materials/materialHelper.functions.d.ts +2 -1
- package/Materials/materialHelper.functions.js +17 -1
- package/Materials/materialHelper.functions.js.map +1 -1
- package/Materials/shaderMaterial.js +3 -1
- package/Materials/shaderMaterial.js.map +1 -1
- package/Materials/standardMaterial.d.ts +2 -0
- package/Materials/standardMaterial.js +2 -0
- package/Materials/standardMaterial.js.map +1 -1
- package/Meshes/Compression/dracoCompressionWorker.js.map +1 -1
- package/Meshes/Node/Blocks/Instances/instantiateOnFacesBlock.d.ts +4 -0
- package/Meshes/Node/Blocks/Instances/instantiateOnFacesBlock.js +11 -2
- package/Meshes/Node/Blocks/Instances/instantiateOnFacesBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Instances/instantiateOnVerticesBlock.d.ts +4 -0
- package/Meshes/Node/Blocks/Instances/instantiateOnVerticesBlock.js +11 -2
- package/Meshes/Node/Blocks/Instances/instantiateOnVerticesBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Instances/instantiateOnVolumeBlock.d.ts +4 -0
- package/Meshes/Node/Blocks/Instances/instantiateOnVolumeBlock.js +11 -2
- package/Meshes/Node/Blocks/Instances/instantiateOnVolumeBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Sources/boxBlock.js +4 -4
- package/Meshes/Node/Blocks/Sources/boxBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Sources/gridBlock.js +3 -3
- package/Meshes/Node/Blocks/Sources/gridBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Sources/planeBlock.js +3 -3
- package/Meshes/Node/Blocks/Sources/planeBlock.js.map +1 -1
- package/Meshes/Node/Blocks/subdivideBlock.d.ts +45 -0
- package/Meshes/Node/Blocks/subdivideBlock.js +98 -0
- package/Meshes/Node/Blocks/subdivideBlock.js.map +1 -0
- package/Meshes/Node/index.d.ts +1 -0
- package/Meshes/Node/index.js +1 -0
- package/Meshes/Node/index.js.map +1 -1
- package/Meshes/abstractMesh.js +6 -0
- package/Meshes/abstractMesh.js.map +1 -1
- package/Meshes/csg2.js +18 -1
- package/Meshes/csg2.js.map +1 -1
- package/Meshes/geometry.js +1 -0
- package/Meshes/geometry.js.map +1 -1
- package/Meshes/index.d.ts +1 -0
- package/Meshes/index.js +1 -0
- package/Meshes/index.js.map +1 -1
- package/Meshes/mesh.d.ts +47 -1
- package/Meshes/mesh.js +28 -1
- package/Meshes/mesh.js.map +1 -1
- package/Meshes/mesh.vertexData.js +1 -1
- package/Meshes/mesh.vertexData.js.map +1 -1
- package/Meshes/mesh.vertexData.subdivide.d.ts +28 -0
- package/Meshes/mesh.vertexData.subdivide.js +400 -0
- package/Meshes/mesh.vertexData.subdivide.js.map +1 -0
- package/Misc/index.d.ts +1 -0
- package/Misc/index.js +1 -0
- package/Misc/index.js.map +1 -1
- package/Misc/screenshotTools.js +3 -0
- package/Misc/screenshotTools.js.map +1 -1
- package/Misc/urlTools.d.ts +6 -0
- package/Misc/urlTools.js +12 -0
- package/Misc/urlTools.js.map +1 -0
- package/Morph/morphTarget.d.ts +12 -0
- package/Morph/morphTarget.js +35 -1
- package/Morph/morphTarget.js.map +1 -1
- package/Morph/morphTargetManager.d.ts +13 -0
- package/Morph/morphTargetManager.js +30 -1
- package/Morph/morphTargetManager.js.map +1 -1
- package/PostProcesses/volumetricLightScatteringPostProcess.js +3 -1
- package/PostProcesses/volumetricLightScatteringPostProcess.js.map +1 -1
- package/Rendering/IBLShadows/iblShadowsVoxelRenderer.js +5 -3
- package/Rendering/IBLShadows/iblShadowsVoxelRenderer.js.map +1 -1
- package/Rendering/depthRenderer.js +3 -1
- package/Rendering/depthRenderer.js.map +1 -1
- package/Rendering/geometryBufferRenderer.js +3 -1
- package/Rendering/geometryBufferRenderer.js.map +1 -1
- package/Rendering/outlineRenderer.js +3 -1
- package/Rendering/outlineRenderer.js.map +1 -1
- package/Rendering/utilityLayerRenderer.d.ts +3 -1
- package/Rendering/utilityLayerRenderer.js +16 -7
- package/Rendering/utilityLayerRenderer.js.map +1 -1
- package/Shaders/ShadersInclude/lightFragment.js +1 -1
- package/Shaders/ShadersInclude/lightFragment.js.map +1 -1
- package/Shaders/ShadersInclude/morphTargetsVertex.js +9 -0
- package/Shaders/ShadersInclude/morphTargetsVertex.js.map +1 -1
- package/Shaders/ShadersInclude/morphTargetsVertexGlobalDeclaration.js +3 -0
- package/Shaders/ShadersInclude/morphTargetsVertexGlobalDeclaration.js.map +1 -1
- package/Shaders/ShadersInclude/pbrBlockFinalUnlitComponents.js +5 -1
- package/Shaders/ShadersInclude/pbrBlockFinalUnlitComponents.js.map +1 -1
- package/Shaders/ShadersInclude/pbrDirectLightingFunctions.js +2 -1
- package/Shaders/ShadersInclude/pbrDirectLightingFunctions.js.map +1 -1
- package/Shaders/ShadersInclude/vertexColorMixing.js +2 -2
- package/Shaders/ShadersInclude/vertexColorMixing.js.map +1 -1
- package/Shaders/background.vertex.js +1 -1
- package/Shaders/background.vertex.js.map +1 -1
- package/Shaders/color.vertex.js +3 -0
- package/Shaders/color.vertex.js.map +1 -1
- package/Shaders/default.vertex.js +3 -0
- package/Shaders/default.vertex.js.map +1 -1
- package/Shaders/greasedLine.vertex.js +1 -2
- package/Shaders/greasedLine.vertex.js.map +1 -1
- package/Shaders/pbr.vertex.js +3 -0
- package/Shaders/pbr.vertex.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/lightFragment.js +1 -1
- package/ShadersWGSL/ShadersInclude/lightFragment.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/morphTargetsVertex.js +6 -0
- package/ShadersWGSL/ShadersInclude/morphTargetsVertex.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/morphTargetsVertexGlobalDeclaration.js +3 -0
- package/ShadersWGSL/ShadersInclude/morphTargetsVertexGlobalDeclaration.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/pbrBlockFinalUnlitComponents.js +5 -1
- package/ShadersWGSL/ShadersInclude/pbrBlockFinalUnlitComponents.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/pbrDirectLightingFunctions.js +2 -1
- package/ShadersWGSL/ShadersInclude/pbrDirectLightingFunctions.js.map +1 -1
- package/ShadersWGSL/boundingInfo.compute.js +3 -0
- package/ShadersWGSL/boundingInfo.compute.js.map +1 -1
- package/ShadersWGSL/color.vertex.js +3 -0
- package/ShadersWGSL/color.vertex.js.map +1 -1
- package/ShadersWGSL/default.vertex.js +3 -0
- package/ShadersWGSL/default.vertex.js.map +1 -1
- package/ShadersWGSL/greasedLine.vertex.js +2 -3
- package/ShadersWGSL/greasedLine.vertex.js.map +1 -1
- package/ShadersWGSL/pbr.fragment.js +1 -1
- package/ShadersWGSL/pbr.fragment.js.map +1 -1
- package/ShadersWGSL/pbr.vertex.js +3 -0
- package/ShadersWGSL/pbr.vertex.js.map +1 -1
- package/XR/features/WebXRAnchorSystem.d.ts +4 -0
- package/XR/features/WebXRAnchorSystem.js +8 -5
- package/XR/features/WebXRAnchorSystem.js.map +1 -1
- package/XR/features/WebXRControllerPointerSelection.js +1 -0
- package/XR/features/WebXRControllerPointerSelection.js.map +1 -1
- package/package.json +1 -1
- package/scene.d.ts +2 -0
- package/scene.js +13 -9
- package/scene.js.map +1 -1
- package/types.d.ts +22 -0
- package/types.js.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instantiateOnVolumeBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/Meshes/Node/Blocks/Instances/instantiateOnVolumeBlock.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,EAA0B,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAEtG,OAAO,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAGpE;;GAEG;AACH,MAAM,OAAO,wBAAyB,SAAQ,iBA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,IAAI,EAAE,EAAE,CAAC;iEAC3F;AAMvB;IADN,sBAAsB,CAAC,WAAW,0CAAkC,OAAO,EAAE,EAAE,SAAS,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,CAAC;0DACvF;AAuT5B,aAAa,CAAC,kCAAkC,EAAE,wBAAwB,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 type { Nullable } from \"../../../../types\";\r\nimport { Ray } from \"../../../../Culling/ray\";\r\nimport { extractMinAndMax } from \"../../../../Maths/math.functions\";\r\nimport type { INodeGeometryInstancingContext } from \"../../Interfaces/nodeGeometryInstancingContext\";\r\n\r\n/**\r\n * Block used to instance geometry inside a geometry\r\n */\r\nexport class InstantiateOnVolumeBlock extends NodeGeometryBlock implements INodeGeometryExecutionContext, INodeGeometryInstancingContext {\r\n private _vertexData: VertexData;\r\n private _currentLoopIndex: number;\r\n private _currentPosition = new Vector3();\r\n private _vertex0 = new Vector3();\r\n private _vertex1 = new Vector3();\r\n private _vertex2 = new Vector3();\r\n\r\n /**\r\n * Gets or sets a boolean indicating that this block can evaluate context\r\n * Build performance is improved when this value is set to false as the system will cache values instead of reevaluating everything per context change\r\n */\r\n @editableInPropertyPage(\"Evaluate context\", PropertyTypeForEdition.Boolean, \"ADVANCED\", { notifiers: { rebuild: true } })\r\n public evaluateContext = true;\r\n\r\n /**\r\n * Gets or sets a boolean indicating that a grid pattern should be used\r\n */\r\n @editableInPropertyPage(\"Grid mode\", PropertyTypeForEdition.Boolean, \"MODES\", { notifiers: { rebuild: true } })\r\n public gridMode = false;\r\n\r\n /**\r\n * Create a new InstantiateOnVolumeBlock\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(\"count\", NodeGeometryBlockConnectionPointTypes.Int, true, 256);\r\n this.registerInput(\"matrix\", NodeGeometryBlockConnectionPointTypes.Matrix, 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(\"gridSize\", NodeGeometryBlockConnectionPointTypes.Int, true, 10);\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 instance index in the current flow\r\n * @returns the current index\r\n */\r\n public getInstanceIndex(): number {\r\n return this._currentLoopIndex;\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 0;\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 loop index in the current flow\r\n * @returns the current loop index\r\n */\r\n public getExecutionLoopIndex(): number {\r\n return this._currentLoopIndex;\r\n }\r\n\r\n /**\r\n * Gets the value associated with a contextual positions\r\n * @returns the value associated with the source\r\n */\r\n public getOverridePositionsContextualValue() {\r\n return this._currentPosition;\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public override getClassName() {\r\n return \"InstantiateOnVolumeBlock\";\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 count input component\r\n */\r\n public get count(): NodeGeometryConnectionPoint {\r\n return this._inputs[2];\r\n }\r\n\r\n /**\r\n * Gets the matrix input component\r\n */\r\n public get matrix(): NodeGeometryConnectionPoint {\r\n return this._inputs[3];\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[4];\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[5];\r\n }\r\n\r\n /**\r\n * Gets the grid size input component\r\n */\r\n public get gridSize(): 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 output(): NodeGeometryConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n private _getValueOnGrid(step: number, size: number, min: number, max: number): number {\r\n const cellSize = (max - min) / size;\r\n return min + cellSize / 2 + step * cellSize;\r\n }\r\n\r\n private _getIndexinGrid(x: number, y: number, z: number, size: number) {\r\n return x + y * size + z * size * size;\r\n }\r\n\r\n protected override _buildBlock(state: NodeGeometryBuildState) {\r\n const func = (state: NodeGeometryBuildState) => {\r\n state.pushExecutionContext(this);\r\n state.pushInstancingContext(this);\r\n\r\n this._vertexData = this.geometry.getConnectedValue(state);\r\n state.pushGeometryContext(this._vertexData);\r\n\r\n if (!this._vertexData || !this._vertexData.positions || !this._vertexData.indices || !this.instance.isConnected) {\r\n state.restoreExecutionContext();\r\n state.restoreInstancingContext();\r\n state.restoreGeometryContext();\r\n this.output._storedValue = null;\r\n return;\r\n }\r\n\r\n // Processing\r\n let instanceGeometry: Nullable<VertexData> = null;\r\n const instanceCount = this.count.getConnectedValue(state);\r\n const additionalVertexData: VertexData[] = [];\r\n const boundingInfo = extractMinAndMax(this._vertexData.positions!, 0, this._vertexData.positions!.length / 3);\r\n const min = boundingInfo.minimum;\r\n const max = boundingInfo.maximum;\r\n const direction = new Vector3(0.5, 0.8, 0.2);\r\n const faceCount = this._vertexData.indices.length / 3;\r\n const gridSize = this.gridSize.getConnectedValue(state);\r\n this._currentLoopIndex = 0;\r\n\r\n let candidatesCells: Array<boolean>;\r\n if (this.gridMode) {\r\n candidatesCells = [];\r\n // Generates the list of candidates cells\r\n for (let index = 0; index < gridSize * gridSize * gridSize; index++) {\r\n candidatesCells[index] = false;\r\n }\r\n }\r\n\r\n for (let index = 0; index < instanceCount; index++) {\r\n if (this.gridMode) {\r\n // Get a random cell\r\n let cellX = Math.floor(Math.random() * gridSize);\r\n let cellY = Math.floor(Math.random() * gridSize);\r\n let cellZ = Math.floor(Math.random() * gridSize);\r\n let cellIndex = this._getIndexinGrid(cellX, cellY, cellZ, gridSize);\r\n\r\n if (candidatesCells![cellIndex]) {\r\n // Find the first one that is free\r\n let found = false;\r\n for (let candidateIndex = 0; candidateIndex < gridSize * gridSize * gridSize; candidateIndex++) {\r\n if (!candidatesCells![candidateIndex]) {\r\n cellZ = Math.floor(candidateIndex / (gridSize * gridSize));\r\n cellY = Math.floor((candidateIndex - cellZ * gridSize * gridSize) / gridSize);\r\n cellX = candidateIndex - cellZ * gridSize * gridSize - cellY * gridSize;\r\n cellIndex = this._getIndexinGrid(cellX, cellY, cellZ, gridSize);\r\n found = true;\r\n break;\r\n }\r\n }\r\n if (!found) {\r\n // No more free cells\r\n break;\r\n }\r\n }\r\n\r\n if (!candidatesCells![cellIndex]) {\r\n // Cell is free\r\n const x = this._getValueOnGrid(cellX, gridSize, min.x, max.x);\r\n const y = this._getValueOnGrid(cellY, gridSize, min.y, max.y);\r\n const z = this._getValueOnGrid(cellZ, gridSize, min.z, max.z);\r\n this._currentPosition.set(x, y, z);\r\n candidatesCells![cellIndex] = true;\r\n }\r\n } else {\r\n this._currentPosition.set(Math.random() * (max.x - min.x) + min.x, Math.random() * (max.y - min.y) + min.y, Math.random() * (max.z - min.z) + min.z);\r\n }\r\n\r\n // Cast a ray from the random point in an arbitrary direction\r\n const ray = new Ray(this._currentPosition, direction);\r\n\r\n let intersectionCount = 0;\r\n for (let currentFaceIndex = 0; currentFaceIndex < faceCount; currentFaceIndex++) {\r\n // Extract face vertices\r\n this._vertex0.fromArray(this._vertexData.positions!, this._vertexData.indices![currentFaceIndex * 3] * 3);\r\n this._vertex1.fromArray(this._vertexData.positions!, this._vertexData.indices![currentFaceIndex * 3 + 1] * 3);\r\n this._vertex2.fromArray(this._vertexData.positions!, this._vertexData.indices![currentFaceIndex * 3 + 2] * 3);\r\n\r\n const currentIntersectInfo = ray.intersectsTriangle(this._vertex0, this._vertex1, this._vertex2);\r\n\r\n if (currentIntersectInfo && currentIntersectInfo.distance > 0) {\r\n intersectionCount++;\r\n }\r\n }\r\n\r\n if (intersectionCount % 2 === 0) {\r\n // We are outside, try again\r\n index--;\r\n continue;\r\n }\r\n\r\n // Clone the instance\r\n 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 const clone = instanceGeometry!.clone();\r\n\r\n if (this.matrix.isConnected) {\r\n const transform = this.matrix.getConnectedValue(state);\r\n state._instantiateWithPositionAndMatrix(clone, this._currentPosition, transform, additionalVertexData);\r\n } else {\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, this._currentPosition, rotation, scaling, additionalVertexData);\r\n }\r\n this._currentLoopIndex++;\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 state.restoreGeometryContext();\r\n state.restoreExecutionContext();\r\n state.restoreInstancingContext();\r\n return this._vertexData;\r\n };\r\n\r\n // Storage\r\n\r\n if (this.evaluateContext) {\r\n this.output._storedFunction = func;\r\n } else {\r\n this.output._storedFunction = null;\r\n this.output._storedValue = func(state);\r\n }\r\n }\r\n\r\n protected override _dumpPropertiesCode() {\r\n let codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.evaluateContext = ${this.evaluateContext ? \"true\" : \"false\"};\\n`;\r\n codeString += `${this._codeVariableName}.gridMode = ${this.gridMode ? \"true\" : \"false\"};\\n`;\r\n return codeString;\r\n }\r\n\r\n /**\r\n * Serializes this block in a JSON representation\r\n * @returns the serialized block object\r\n */\r\n public override serialize(): any {\r\n const serializationObject = super.serialize();\r\n\r\n serializationObject.evaluateContext = this.evaluateContext;\r\n serializationObject.gridMode = this.gridMode;\r\n\r\n return serializationObject;\r\n }\r\n\r\n public override _deserialize(serializationObject: any) {\r\n super._deserialize(serializationObject);\r\n\r\n if (serializationObject.evaluateContext !== undefined) {\r\n this.evaluateContext = serializationObject.evaluateContext;\r\n }\r\n\r\n if (serializationObject.gridMode !== undefined) {\r\n this.gridMode = serializationObject.gridMode;\r\n }\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.InstantiateOnVolumeBlock\", InstantiateOnVolumeBlock);\r\n"]}
|
|
1
|
+
{"version":3,"file":"instantiateOnVolumeBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/Meshes/Node/Blocks/Instances/instantiateOnVolumeBlock.ts"],"names":[],"mappings":";AAAA,OA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IAAI,CAAC,iBAAiB,eAAe,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,KAAK,CAAC;QAC5F,OAAO,UAAU,CAAC;IACtB,CAAC;IAED;;;OAGG;IACa,SAAS;QACrB,MAAM,mBAAmB,GAAG,KAAK,CAAC,SAAS,EAAE,CAAC;QAE9C,mBAAmB,CAAC,eAAe,GAAG,IAAI,CAAC,eAAe,CAAC;QAC3D,mBAAmB,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;QAE7C,OAAO,mBAAmB,CAAC;IAC/B,CAAC;IAEe,YAAY,CAAC,mBAAwB;QACjD,KAAK,CAAC,YAAY,CAAC,mBAAmB,CAAC,CAAC;QAExC,IAAI,mBAAmB,CAAC,eAAe,KAAK,SAAS,EAAE,CAAC;YACpD,IAAI,CAAC,eAAe,GAAG,mBAAmB,CAAC,eAAe,CAAC;QAC/D,CAAC;QAED,IAAI,mBAAmB,CAAC,QAAQ,KAAK,SAAS,EAAE,CAAC;YAC7C,IAAI,CAAC,QAAQ,GAAG,mBAAmB,CAAC,QAAQ,CAAC;QACjD,CAAC;IACL,CAAC;CACJ;AAvUU;IADN,sBAAsB,CAAC,kBAAkB,0CAAkC,UAAU,EAAE,EAAE,SAAS,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,CAAC;iEAC3F;AAMvB;IADN,sBAAsB,CAAC,WAAW,0CAAkC,OAAO,EAAE,EAAE,SAAS,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,CAAC;0DACvF;AAmU5B,aAAa,CAAC,kCAAkC,EAAE,wBAAwB,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 type { Nullable } from \"../../../../types\";\r\nimport { Ray } from \"../../../../Culling/ray\";\r\nimport { extractMinAndMax } from \"../../../../Maths/math.functions\";\r\nimport type { INodeGeometryInstancingContext } from \"../../Interfaces/nodeGeometryInstancingContext\";\r\n\r\n/**\r\n * Block used to instance geometry inside a geometry\r\n */\r\nexport class InstantiateOnVolumeBlock extends NodeGeometryBlock implements INodeGeometryExecutionContext, INodeGeometryInstancingContext {\r\n private _vertexData: VertexData;\r\n private _currentLoopIndex: number;\r\n private _currentPosition = new Vector3();\r\n private _vertex0 = new Vector3();\r\n private _vertex1 = new Vector3();\r\n private _vertex2 = new Vector3();\r\n\r\n /**\r\n * Gets or sets a boolean indicating that this block can evaluate context\r\n * Build performance is improved when this value is set to false as the system will cache values instead of reevaluating everything per context change\r\n */\r\n @editableInPropertyPage(\"Evaluate context\", PropertyTypeForEdition.Boolean, \"ADVANCED\", { notifiers: { rebuild: true } })\r\n public evaluateContext = true;\r\n\r\n /**\r\n * Gets or sets a boolean indicating that a grid pattern should be used\r\n */\r\n @editableInPropertyPage(\"Grid mode\", PropertyTypeForEdition.Boolean, \"MODES\", { notifiers: { rebuild: true } })\r\n public gridMode = false;\r\n\r\n /**\r\n * Create a new InstantiateOnVolumeBlock\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(\"count\", NodeGeometryBlockConnectionPointTypes.Int, true, 256);\r\n this.registerInput(\"matrix\", NodeGeometryBlockConnectionPointTypes.Matrix, true);\r\n this.registerInput(\"offset\", NodeGeometryBlockConnectionPointTypes.Vector3, true, Vector3.Zero());\r\n this.registerInput(\"rotation\", NodeGeometryBlockConnectionPointTypes.Vector3, true, Vector3.Zero());\r\n this.registerInput(\"scaling\", NodeGeometryBlockConnectionPointTypes.Vector3, true, Vector3.One());\r\n this.registerInput(\"gridSize\", NodeGeometryBlockConnectionPointTypes.Int, true, 10);\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 instance index in the current flow\r\n * @returns the current index\r\n */\r\n public getInstanceIndex(): number {\r\n return this._currentLoopIndex;\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 0;\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 loop index in the current flow\r\n * @returns the current loop index\r\n */\r\n public getExecutionLoopIndex(): number {\r\n return this._currentLoopIndex;\r\n }\r\n\r\n /**\r\n * Gets the value associated with a contextual positions\r\n * @returns the value associated with the source\r\n */\r\n public getOverridePositionsContextualValue() {\r\n return this._currentPosition;\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public override getClassName() {\r\n return \"InstantiateOnVolumeBlock\";\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 count input component\r\n */\r\n public get count(): NodeGeometryConnectionPoint {\r\n return this._inputs[2];\r\n }\r\n\r\n /**\r\n * Gets the matrix input component\r\n */\r\n public get matrix(): NodeGeometryConnectionPoint {\r\n return this._inputs[3];\r\n }\r\n\r\n /**\r\n * Gets the offset input component\r\n */\r\n public get offset(): NodeGeometryConnectionPoint {\r\n return this._inputs[4];\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[5];\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[6];\r\n }\r\n\r\n /**\r\n * Gets the grid size input component\r\n */\r\n public get gridSize(): 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 output(): NodeGeometryConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n private _getValueOnGrid(step: number, size: number, min: number, max: number): number {\r\n const cellSize = (max - min) / size;\r\n return min + cellSize / 2 + step * cellSize;\r\n }\r\n\r\n private _getIndexinGrid(x: number, y: number, z: number, size: number) {\r\n return x + y * size + z * size * size;\r\n }\r\n\r\n protected override _buildBlock(state: NodeGeometryBuildState) {\r\n const func = (state: NodeGeometryBuildState) => {\r\n state.pushExecutionContext(this);\r\n state.pushInstancingContext(this);\r\n\r\n this._vertexData = this.geometry.getConnectedValue(state);\r\n state.pushGeometryContext(this._vertexData);\r\n\r\n if (!this._vertexData || !this._vertexData.positions || !this._vertexData.indices || !this.instance.isConnected) {\r\n state.restoreExecutionContext();\r\n state.restoreInstancingContext();\r\n state.restoreGeometryContext();\r\n this.output._storedValue = null;\r\n return;\r\n }\r\n\r\n // Processing\r\n let instanceGeometry: Nullable<VertexData> = null;\r\n const instanceCount = this.count.getConnectedValue(state);\r\n const additionalVertexData: VertexData[] = [];\r\n const boundingInfo = extractMinAndMax(this._vertexData.positions!, 0, this._vertexData.positions!.length / 3);\r\n const min = boundingInfo.minimum;\r\n const max = boundingInfo.maximum;\r\n const direction = new Vector3(0.5, 0.8, 0.2);\r\n const faceCount = this._vertexData.indices.length / 3;\r\n const gridSize = this.gridSize.getConnectedValue(state);\r\n this._currentLoopIndex = 0;\r\n\r\n let candidatesCells: Array<boolean>;\r\n if (this.gridMode) {\r\n candidatesCells = [];\r\n // Generates the list of candidates cells\r\n for (let index = 0; index < gridSize * gridSize * gridSize; index++) {\r\n candidatesCells[index] = false;\r\n }\r\n }\r\n\r\n for (let index = 0; index < instanceCount; index++) {\r\n if (this.gridMode) {\r\n // Get a random cell\r\n let cellX = Math.floor(Math.random() * gridSize);\r\n let cellY = Math.floor(Math.random() * gridSize);\r\n let cellZ = Math.floor(Math.random() * gridSize);\r\n let cellIndex = this._getIndexinGrid(cellX, cellY, cellZ, gridSize);\r\n\r\n if (candidatesCells![cellIndex]) {\r\n // Find the first one that is free\r\n let found = false;\r\n for (let candidateIndex = 0; candidateIndex < gridSize * gridSize * gridSize; candidateIndex++) {\r\n if (!candidatesCells![candidateIndex]) {\r\n cellZ = Math.floor(candidateIndex / (gridSize * gridSize));\r\n cellY = Math.floor((candidateIndex - cellZ * gridSize * gridSize) / gridSize);\r\n cellX = candidateIndex - cellZ * gridSize * gridSize - cellY * gridSize;\r\n cellIndex = this._getIndexinGrid(cellX, cellY, cellZ, gridSize);\r\n found = true;\r\n break;\r\n }\r\n }\r\n if (!found) {\r\n // No more free cells\r\n break;\r\n }\r\n }\r\n\r\n if (!candidatesCells![cellIndex]) {\r\n // Cell is free\r\n const x = this._getValueOnGrid(cellX, gridSize, min.x, max.x);\r\n const y = this._getValueOnGrid(cellY, gridSize, min.y, max.y);\r\n const z = this._getValueOnGrid(cellZ, gridSize, min.z, max.z);\r\n this._currentPosition.set(x, y, z);\r\n candidatesCells![cellIndex] = true;\r\n }\r\n } else {\r\n this._currentPosition.set(Math.random() * (max.x - min.x) + min.x, Math.random() * (max.y - min.y) + min.y, Math.random() * (max.z - min.z) + min.z);\r\n }\r\n\r\n // Cast a ray from the random point in an arbitrary direction\r\n const ray = new Ray(this._currentPosition, direction);\r\n\r\n let intersectionCount = 0;\r\n for (let currentFaceIndex = 0; currentFaceIndex < faceCount; currentFaceIndex++) {\r\n // Extract face vertices\r\n this._vertex0.fromArray(this._vertexData.positions!, this._vertexData.indices![currentFaceIndex * 3] * 3);\r\n this._vertex1.fromArray(this._vertexData.positions!, this._vertexData.indices![currentFaceIndex * 3 + 1] * 3);\r\n this._vertex2.fromArray(this._vertexData.positions!, this._vertexData.indices![currentFaceIndex * 3 + 2] * 3);\r\n\r\n const currentIntersectInfo = ray.intersectsTriangle(this._vertex0, this._vertex1, this._vertex2);\r\n\r\n if (currentIntersectInfo && currentIntersectInfo.distance > 0) {\r\n intersectionCount++;\r\n }\r\n }\r\n\r\n if (intersectionCount % 2 === 0) {\r\n // We are outside, try again\r\n index--;\r\n continue;\r\n }\r\n\r\n // Clone the instance\r\n 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 const clone = instanceGeometry!.clone();\r\n\r\n if (this.matrix.isConnected) {\r\n const transform = this.matrix.getConnectedValue(state);\r\n state._instantiateWithPositionAndMatrix(clone, this._currentPosition, transform, additionalVertexData);\r\n } else {\r\n const offset = state.adaptInput(this.offset, NodeGeometryBlockConnectionPointTypes.Vector3, Vector3.ZeroReadOnly);\r\n const scaling = state.adaptInput(this.scaling, NodeGeometryBlockConnectionPointTypes.Vector3, Vector3.OneReadOnly);\r\n const rotation = this.rotation.getConnectedValue(state) || Vector3.ZeroReadOnly;\r\n\r\n this._currentPosition.addInPlace(offset);\r\n\r\n state._instantiate(clone, this._currentPosition, rotation, scaling, additionalVertexData);\r\n }\r\n this._currentLoopIndex++;\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 state.restoreGeometryContext();\r\n state.restoreExecutionContext();\r\n state.restoreInstancingContext();\r\n return this._vertexData;\r\n };\r\n\r\n // Storage\r\n\r\n if (this.evaluateContext) {\r\n this.output._storedFunction = func;\r\n } else {\r\n this.output._storedFunction = null;\r\n this.output._storedValue = func(state);\r\n }\r\n }\r\n\r\n protected override _dumpPropertiesCode() {\r\n let codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.evaluateContext = ${this.evaluateContext ? \"true\" : \"false\"};\\n`;\r\n codeString += `${this._codeVariableName}.gridMode = ${this.gridMode ? \"true\" : \"false\"};\\n`;\r\n return codeString;\r\n }\r\n\r\n /**\r\n * Serializes this block in a JSON representation\r\n * @returns the serialized block object\r\n */\r\n public override serialize(): any {\r\n const serializationObject = super.serialize();\r\n\r\n serializationObject.evaluateContext = this.evaluateContext;\r\n serializationObject.gridMode = this.gridMode;\r\n\r\n return serializationObject;\r\n }\r\n\r\n public override _deserialize(serializationObject: any) {\r\n super._deserialize(serializationObject);\r\n\r\n if (serializationObject.evaluateContext !== undefined) {\r\n this.evaluateContext = serializationObject.evaluateContext;\r\n }\r\n\r\n if (serializationObject.gridMode !== undefined) {\r\n this.gridMode = serializationObject.gridMode;\r\n }\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.InstantiateOnVolumeBlock\", InstantiateOnVolumeBlock);\r\n"]}
|
|
@@ -24,10 +24,10 @@ export class BoxBlock extends NodeGeometryBlock {
|
|
|
24
24
|
this.registerInput("width", NodeGeometryBlockConnectionPointTypes.Float, true, 0);
|
|
25
25
|
this.registerInput("height", NodeGeometryBlockConnectionPointTypes.Float, true, 0);
|
|
26
26
|
this.registerInput("depth", NodeGeometryBlockConnectionPointTypes.Float, true, 0);
|
|
27
|
-
this.registerInput("subdivisions", NodeGeometryBlockConnectionPointTypes.Int, true, 1);
|
|
28
|
-
this.registerInput("subdivisionsX", NodeGeometryBlockConnectionPointTypes.Int, true, 0);
|
|
29
|
-
this.registerInput("subdivisionsY", NodeGeometryBlockConnectionPointTypes.Int, true, 0);
|
|
30
|
-
this.registerInput("subdivisionsZ", NodeGeometryBlockConnectionPointTypes.Int, true, 0);
|
|
27
|
+
this.registerInput("subdivisions", NodeGeometryBlockConnectionPointTypes.Int, true, 1, 0);
|
|
28
|
+
this.registerInput("subdivisionsX", NodeGeometryBlockConnectionPointTypes.Int, true, 0, 0);
|
|
29
|
+
this.registerInput("subdivisionsY", NodeGeometryBlockConnectionPointTypes.Int, true, 0, 0);
|
|
30
|
+
this.registerInput("subdivisionsZ", NodeGeometryBlockConnectionPointTypes.Int, true, 0, 0);
|
|
31
31
|
this.registerOutput("geometry", NodeGeometryBlockConnectionPointTypes.Geometry);
|
|
32
32
|
}
|
|
33
33
|
/**
|
|
@@ -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,EAA0B,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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mBAAwB;QACjD,KAAK,CAAC,YAAY,CAAC,mBAAmB,CAAC,CAAC;QAExC,IAAI,CAAC,eAAe,GAAG,mBAAmB,CAAC,eAAe,CAAC;IAC/D,CAAC;CACJ;AAtMU;IADN,sBAAsB,CAAC,kBAAkB,0CAAkC,UAAU,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,CAAC;iDAC1G;AAwMnC,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\", { embedded: true, 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 override 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 override 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 override _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 const value = func(state);\r\n this.geometry._storedFunction = () => {\r\n this.geometry._executionCount = 1;\r\n return value.clone();\r\n };\r\n }\r\n }\r\n\r\n protected override _dumpPropertiesCode() {\r\n const codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.evaluateContext = ${this.evaluateContext ? \"true\" : \"false\"};\\n`;\r\n return codeString;\r\n }\r\n\r\n /**\r\n * Serializes this block in a JSON representation\r\n * @returns the serialized block object\r\n */\r\n public override serialize(): any {\r\n const serializationObject = super.serialize();\r\n\r\n serializationObject.evaluateContext = this.evaluateContext;\r\n\r\n return serializationObject;\r\n }\r\n\r\n public override _deserialize(serializationObject: any) {\r\n super._deserialize(serializationObject);\r\n\r\n this.evaluateContext = serializationObject.evaluateContext;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.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,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,EAA0B,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,I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AAmB,CAAC,eAAe,GAAG,IAAI,CAAC,eAAe,CAAC;QAE3D,OAAO,mBAAmB,CAAC;IAC/B,CAAC;IAEe,YAAY,CAAC,mBAAwB;QACjD,KAAK,CAAC,YAAY,CAAC,mBAAmB,CAAC,CAAC;QAExC,IAAI,CAAC,eAAe,GAAG,mBAAmB,CAAC,eAAe,CAAC;IAC/D,CAAC;CACJ;AAtMU;IADN,sBAAsB,CAAC,kBAAkB,0CAAkC,UAAU,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,CAAC;iDAC1G;AAwMnC,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\", { embedded: true, 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, 0);\r\n this.registerInput(\"subdivisionsX\", NodeGeometryBlockConnectionPointTypes.Int, true, 0, 0);\r\n this.registerInput(\"subdivisionsY\", NodeGeometryBlockConnectionPointTypes.Int, true, 0, 0);\r\n this.registerInput(\"subdivisionsZ\", NodeGeometryBlockConnectionPointTypes.Int, true, 0, 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 override 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 override 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 override _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 const value = func(state);\r\n this.geometry._storedFunction = () => {\r\n this.geometry._executionCount = 1;\r\n return value.clone();\r\n };\r\n }\r\n }\r\n\r\n protected override _dumpPropertiesCode() {\r\n const codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.evaluateContext = ${this.evaluateContext ? \"true\" : \"false\"};\\n`;\r\n return codeString;\r\n }\r\n\r\n /**\r\n * Serializes this block in a JSON representation\r\n * @returns the serialized block object\r\n */\r\n public override serialize(): any {\r\n const serializationObject = super.serialize();\r\n\r\n serializationObject.evaluateContext = this.evaluateContext;\r\n\r\n return serializationObject;\r\n }\r\n\r\n public override _deserialize(serializationObject: any) {\r\n super._deserialize(serializationObject);\r\n\r\n this.evaluateContext = serializationObject.evaluateContext;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.BoxBlock\", BoxBlock);\r\n"]}
|
|
@@ -22,9 +22,9 @@ export class GridBlock extends NodeGeometryBlock {
|
|
|
22
22
|
this.evaluateContext = false;
|
|
23
23
|
this.registerInput("width", NodeGeometryBlockConnectionPointTypes.Float, true, 1);
|
|
24
24
|
this.registerInput("height", NodeGeometryBlockConnectionPointTypes.Float, true, 1);
|
|
25
|
-
this.registerInput("subdivisions", NodeGeometryBlockConnectionPointTypes.Int, true, 1);
|
|
26
|
-
this.registerInput("subdivisionsX", NodeGeometryBlockConnectionPointTypes.Int, true, 0);
|
|
27
|
-
this.registerInput("subdivisionsY", NodeGeometryBlockConnectionPointTypes.Int, true, 0);
|
|
25
|
+
this.registerInput("subdivisions", NodeGeometryBlockConnectionPointTypes.Int, true, 1, 0);
|
|
26
|
+
this.registerInput("subdivisionsX", NodeGeometryBlockConnectionPointTypes.Int, true, 0, 0);
|
|
27
|
+
this.registerInput("subdivisionsY", NodeGeometryBlockConnectionPointTypes.Int, true, 0, 0);
|
|
28
28
|
this.registerOutput("geometry", NodeGeometryBlockConnectionPointTypes.Geometry);
|
|
29
29
|
}
|
|
30
30
|
/**
|
|
@@ -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,EAA0B,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;
|
|
1
|
+
{"version":3,"file":"gridBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/Meshes/Node/Blocks/Sources/gridBlock.ts"],"names":[],"mappings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CAAC,mBAAwB;QACjD,KAAK,CAAC,YAAY,CAAC,mBAAmB,CAAC,CAAC;QAExC,IAAI,CAAC,eAAe,GAAG,mBAAmB,CAAC,eAAe,CAAC;IAC/D,CAAC;CACJ;AAhIU;IADN,sBAAsB,CAAC,kBAAkB,0CAAkC,UAAU,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,CAAC;kDAC1G;AAkInC,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\", { embedded: true, 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, 0);\r\n this.registerInput(\"subdivisionsX\", NodeGeometryBlockConnectionPointTypes.Int, true, 0, 0);\r\n this.registerInput(\"subdivisionsY\", NodeGeometryBlockConnectionPointTypes.Int, true, 0, 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 override 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 override 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 override _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 const value = func(state);\r\n this.geometry._storedFunction = () => {\r\n this.geometry._executionCount = 1;\r\n return value.clone();\r\n };\r\n }\r\n }\r\n\r\n protected override _dumpPropertiesCode() {\r\n const codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.evaluateContext = ${this.evaluateContext ? \"true\" : \"false\"};\\n`;\r\n return codeString;\r\n }\r\n\r\n /**\r\n * Serializes this block in a JSON representation\r\n * @returns the serialized block object\r\n */\r\n public override serialize(): any {\r\n const serializationObject = super.serialize();\r\n\r\n serializationObject.evaluateContext = this.evaluateContext;\r\n\r\n return serializationObject;\r\n }\r\n\r\n public override _deserialize(serializationObject: any) {\r\n super._deserialize(serializationObject);\r\n\r\n this.evaluateContext = serializationObject.evaluateContext;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.GridBlock\", GridBlock);\r\n"]}
|
|
@@ -25,9 +25,9 @@ export class PlaneBlock extends NodeGeometryBlock {
|
|
|
25
25
|
this.registerInput("size", NodeGeometryBlockConnectionPointTypes.Float, true, 1);
|
|
26
26
|
this.registerInput("width", NodeGeometryBlockConnectionPointTypes.Float, true, 0);
|
|
27
27
|
this.registerInput("height", NodeGeometryBlockConnectionPointTypes.Float, true, 0);
|
|
28
|
-
this.registerInput("subdivisions", NodeGeometryBlockConnectionPointTypes.Int, true, 1);
|
|
29
|
-
this.registerInput("subdivisionsX", NodeGeometryBlockConnectionPointTypes.Int, true, 0);
|
|
30
|
-
this.registerInput("subdivisionsY", NodeGeometryBlockConnectionPointTypes.Int, true, 0);
|
|
28
|
+
this.registerInput("subdivisions", NodeGeometryBlockConnectionPointTypes.Int, true, 1, 0);
|
|
29
|
+
this.registerInput("subdivisionsX", NodeGeometryBlockConnectionPointTypes.Int, true, 0, 0);
|
|
30
|
+
this.registerInput("subdivisionsY", NodeGeometryBlockConnectionPointTypes.Int, true, 0, 0);
|
|
31
31
|
this.registerOutput("geometry", NodeGeometryBlockConnectionPointTypes.Geometry);
|
|
32
32
|
}
|
|
33
33
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"planeBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/Meshes/Node/Blocks/Sources/planeBlock.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,MAAM,EAAE,MAAM,+BAA+B,CAAC;AACvD,OAAO,EAA0B,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AACtG,OAAO,EAAE,sBAAsB,EAAE,2CAA2C;AAE5E;;GAEG;AACH,MAAM,OAAO,UAAW,SAAQ,iBAAiB;IAS7C;;;OAGG;IACH,YAAmB,IAAY;QAC3B,KAAK,CAAC,IAAI,CAAC,CAAC;QAbR,oBAAe,GAAG,IAAI,MAAM,EAAE,CAAC;QACvC;;;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,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AAC,iBAAiB,sBAAsB,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,KAAK,CAAC;QAC7I,OAAO,UAAU,CAAC;IACtB,CAAC;IAED;;;OAGG;IACa,SAAS;QACrB,MAAM,mBAAmB,GAAG,KAAK,CAAC,SAAS,EAAE,CAAC;QAE9C,mBAAmB,CAAC,eAAe,GAAG,IAAI,CAAC,eAAe,CAAC;QAE3D,OAAO,mBAAmB,CAAC;IAC/B,CAAC;IAEe,YAAY,CAAC,mBAAwB;QACjD,KAAK,CAAC,YAAY,CAAC,mBAAmB,CAAC,CAAC;QAExC,IAAI,CAAC,eAAe,GAAG,mBAAmB,CAAC,eAAe,CAAC;IAC/D,CAAC;CACJ;AAvKU;IADN,sBAAsB,CAAC,kBAAkB,0CAAkC,UAAU,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,CAAC;mDAC1G;AAyKnC,aAAa,CAAC,oBAAoB,EAAE,UAAU,CAAC,CAAC","sourcesContent":["import { NodeGeometryBlockConnectionPointTypes } from \"../../Enums/nodeGeometryConnectionPointTypes\";\r\nimport { NodeGeometryBlock } from \"../../nodeGeometryBlock\";\r\nimport type { NodeGeometryConnectionPoint } from \"../../nodeGeometryBlockConnectionPoint\";\r\nimport type { NodeGeometryBuildState } from \"../../nodeGeometryBuildState\";\r\nimport { GeometryInputBlock } from \"../geometryInputBlock\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\nimport { Matrix } from \"../../../../Maths/math.vector\";\r\nimport { PropertyTypeForEdition, editableInPropertyPage } from \"../../../../Decorators/nodeDecorator\";\r\nimport { CreateGroundVertexData } from \"core/Meshes/Builders/groundBuilder\";\r\n\r\n/**\r\n * Defines a block used to generate plane geometry data\r\n */\r\nexport class PlaneBlock extends NodeGeometryBlock {\r\n private _rotationMatrix = new Matrix();\r\n /**\r\n * Gets or sets a boolean indicating that this block can evaluate context\r\n * Build performance is improved when this value is set to false as the system will cache values instead of reevaluating everything per context change\r\n */\r\n @editableInPropertyPage(\"Evaluate context\", PropertyTypeForEdition.Boolean, \"ADVANCED\", { embedded: true, notifiers: { rebuild: true } })\r\n public evaluateContext = false;\r\n\r\n /**\r\n * Create a new PlaneBlock\r\n * @param name defines the block name\r\n */\r\n public constructor(name: string) {\r\n super(name);\r\n\r\n this.registerInput(\"size\", NodeGeometryBlockConnectionPointTypes.Float, true, 1);\r\n this.registerInput(\"width\", NodeGeometryBlockConnectionPointTypes.Float, true, 0);\r\n this.registerInput(\"height\", NodeGeometryBlockConnectionPointTypes.Float, true, 0);\r\n 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 override getClassName() {\r\n return \"PlaneBlock\";\r\n }\r\n\r\n /**\r\n * Gets the size input component\r\n */\r\n public get size(): NodeGeometryConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the width input component\r\n */\r\n public get width(): NodeGeometryConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the height input component\r\n */\r\n public get height(): NodeGeometryConnectionPoint {\r\n return this._inputs[2];\r\n }\r\n\r\n /**\r\n * Gets the 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 subdivisionsX input component\r\n */\r\n public get subdivisionsX(): NodeGeometryConnectionPoint {\r\n return this._inputs[4];\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[5];\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 override autoConfigure() {\r\n if (this.size.isConnected) {\r\n return;\r\n }\r\n\r\n if (!this.width.isConnected && !this.height.isConnected) {\r\n const sizeInput = new GeometryInputBlock(\"Size\");\r\n sizeInput.value = 1;\r\n sizeInput.output.connectTo(this.size);\r\n return;\r\n }\r\n\r\n if (!this.width.isConnected) {\r\n const widthInput = new GeometryInputBlock(\"Width\");\r\n widthInput.value = 1;\r\n widthInput.output.connectTo(this.width);\r\n }\r\n\r\n if (!this.height.isConnected) {\r\n const heightInput = new GeometryInputBlock(\"Height\");\r\n heightInput.value = 1;\r\n heightInput.output.connectTo(this.height);\r\n }\r\n }\r\n\r\n protected override _buildBlock(state: NodeGeometryBuildState) {\r\n const options: { size?: number; width?: number; height?: number; subdivisions?: number; subdivisionsX?: number; subdivisionsY?: number } = {};\r\n const func = (state: NodeGeometryBuildState) => {\r\n options.size = this.size.getConnectedValue(state);\r\n options.width = this.width.getConnectedValue(state);\r\n options.height = this.height.getConnectedValue(state);\r\n\r\n const subdivisions = this.subdivisions.getConnectedValue(state);\r\n const subdivisionsX = this.subdivisionsX.getConnectedValue(state);\r\n const subdivisionsY = this.subdivisionsY.getConnectedValue(state);\r\n\r\n if (subdivisions) {\r\n options.subdivisions = subdivisions;\r\n }\r\n\r\n if (subdivisionsX) {\r\n options.subdivisionsX = subdivisionsX;\r\n }\r\n\r\n if (subdivisionsY) {\r\n options.subdivisionsY = subdivisionsY;\r\n }\r\n\r\n // Append vertex data from the ground builder (to get access to subdivisions)\r\n const vertexData = CreateGroundVertexData(options);\r\n\r\n Matrix.RotationYawPitchRollToRef(-Math.PI / 2, 0, Math.PI / 2, this._rotationMatrix);\r\n\r\n vertexData.transform(this._rotationMatrix);\r\n\r\n return vertexData;\r\n };\r\n\r\n if (this.evaluateContext) {\r\n this.geometry._storedFunction = func;\r\n } else {\r\n const value = func(state);\r\n this.geometry._storedFunction = () => {\r\n this.geometry._executionCount = 1;\r\n return value.clone();\r\n };\r\n }\r\n }\r\n\r\n protected override _dumpPropertiesCode() {\r\n const codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.evaluateContext = ${this.evaluateContext ? \"true\" : \"false\"};\\n`;\r\n return codeString;\r\n }\r\n\r\n /**\r\n * Serializes this block in a JSON representation\r\n * @returns the serialized block object\r\n */\r\n public override serialize(): any {\r\n const serializationObject = super.serialize();\r\n\r\n serializationObject.evaluateContext = this.evaluateContext;\r\n\r\n return serializationObject;\r\n }\r\n\r\n public override _deserialize(serializationObject: any) {\r\n super._deserialize(serializationObject);\r\n\r\n this.evaluateContext = serializationObject.evaluateContext;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.PlaneBlock\", PlaneBlock);\r\n"]}
|
|
1
|
+
{"version":3,"file":"planeBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/Meshes/Node/Blocks/Sources/planeBlock.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,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,MAAM,EAAE,MAAM,+BAA+B,CAAC;AACvD,OAAO,EAA0B,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AACtG,OAAO,EAAE,sBAAsB,EAAE,2CAA2C;AAE5E;;GAEG;AACH,MAAM,OAAO,UAAW,SAAQ,iBAAiB;IAS7C;;;OAGG;IACH,YAAmB,IAAY;QAC3B,KAAK,CAAC,IAAI,CAAC,CAAC;QAbR,oBAAe,GAAG,IAAI,MAAM,EAAE,CAAC;QACvC;;;WAGG;QAEI,oBAAe,GAAG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J,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC;YAC1B,IAAI,CAAC,QAAQ,CAAC,eAAe,GAAG,GAAG,EAAE;gBACjC,IAAI,CAAC,QAAQ,CAAC,eAAe,GAAG,CAAC,CAAC;gBAClC,OAAO,KAAK,CAAC,KAAK,EAAE,CAAC;YACzB,CAAC,CAAC;QACN,CAAC;IACL,CAAC;IAEkB,mBAAmB;QAClC,MAAM,UAAU,GAAG,KAAK,CAAC,mBAAmB,EAAE,GAAG,GAAG,IAAI,CAAC,iBAAiB,sBAAsB,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,KAAK,CAAC;QAC7I,OAAO,UAAU,CAAC;IACtB,CAAC;IAED;;;OAGG;IACa,SAAS;QACrB,MAAM,mBAAmB,GAAG,KAAK,CAAC,SAAS,EAAE,CAAC;QAE9C,mBAAmB,CAAC,eAAe,GAAG,IAAI,CAAC,eAAe,CAAC;QAE3D,OAAO,mBAAmB,CAAC;IAC/B,CAAC;IAEe,YAAY,CAAC,mBAAwB;QACjD,KAAK,CAAC,YAAY,CAAC,mBAAmB,CAAC,CAAC;QAExC,IAAI,CAAC,eAAe,GAAG,mBAAmB,CAAC,eAAe,CAAC;IAC/D,CAAC;CACJ;AAvKU;IADN,sBAAsB,CAAC,kBAAkB,0CAAkC,UAAU,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,CAAC;mDAC1G;AAyKnC,aAAa,CAAC,oBAAoB,EAAE,UAAU,CAAC,CAAC","sourcesContent":["import { NodeGeometryBlockConnectionPointTypes } from \"../../Enums/nodeGeometryConnectionPointTypes\";\r\nimport { NodeGeometryBlock } from \"../../nodeGeometryBlock\";\r\nimport type { NodeGeometryConnectionPoint } from \"../../nodeGeometryBlockConnectionPoint\";\r\nimport type { NodeGeometryBuildState } from \"../../nodeGeometryBuildState\";\r\nimport { GeometryInputBlock } from \"../geometryInputBlock\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\nimport { Matrix } from \"../../../../Maths/math.vector\";\r\nimport { PropertyTypeForEdition, editableInPropertyPage } from \"../../../../Decorators/nodeDecorator\";\r\nimport { CreateGroundVertexData } from \"core/Meshes/Builders/groundBuilder\";\r\n\r\n/**\r\n * Defines a block used to generate plane geometry data\r\n */\r\nexport class PlaneBlock extends NodeGeometryBlock {\r\n private _rotationMatrix = new Matrix();\r\n /**\r\n * Gets or sets a boolean indicating that this block can evaluate context\r\n * Build performance is improved when this value is set to false as the system will cache values instead of reevaluating everything per context change\r\n */\r\n @editableInPropertyPage(\"Evaluate context\", PropertyTypeForEdition.Boolean, \"ADVANCED\", { embedded: true, notifiers: { rebuild: true } })\r\n public evaluateContext = false;\r\n\r\n /**\r\n * Create a new PlaneBlock\r\n * @param name defines the block name\r\n */\r\n public constructor(name: string) {\r\n super(name);\r\n\r\n this.registerInput(\"size\", NodeGeometryBlockConnectionPointTypes.Float, true, 1);\r\n this.registerInput(\"width\", NodeGeometryBlockConnectionPointTypes.Float, true, 0);\r\n this.registerInput(\"height\", NodeGeometryBlockConnectionPointTypes.Float, true, 0);\r\n this.registerInput(\"subdivisions\", NodeGeometryBlockConnectionPointTypes.Int, true, 1, 0);\r\n this.registerInput(\"subdivisionsX\", NodeGeometryBlockConnectionPointTypes.Int, true, 0, 0);\r\n this.registerInput(\"subdivisionsY\", NodeGeometryBlockConnectionPointTypes.Int, true, 0, 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 override getClassName() {\r\n return \"PlaneBlock\";\r\n }\r\n\r\n /**\r\n * Gets the size input component\r\n */\r\n public get size(): NodeGeometryConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the width input component\r\n */\r\n public get width(): NodeGeometryConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the height input component\r\n */\r\n public get height(): NodeGeometryConnectionPoint {\r\n return this._inputs[2];\r\n }\r\n\r\n /**\r\n * Gets the 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 subdivisionsX input component\r\n */\r\n public get subdivisionsX(): NodeGeometryConnectionPoint {\r\n return this._inputs[4];\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[5];\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 override autoConfigure() {\r\n if (this.size.isConnected) {\r\n return;\r\n }\r\n\r\n if (!this.width.isConnected && !this.height.isConnected) {\r\n const sizeInput = new GeometryInputBlock(\"Size\");\r\n sizeInput.value = 1;\r\n sizeInput.output.connectTo(this.size);\r\n return;\r\n }\r\n\r\n if (!this.width.isConnected) {\r\n const widthInput = new GeometryInputBlock(\"Width\");\r\n widthInput.value = 1;\r\n widthInput.output.connectTo(this.width);\r\n }\r\n\r\n if (!this.height.isConnected) {\r\n const heightInput = new GeometryInputBlock(\"Height\");\r\n heightInput.value = 1;\r\n heightInput.output.connectTo(this.height);\r\n }\r\n }\r\n\r\n protected override _buildBlock(state: NodeGeometryBuildState) {\r\n const options: { size?: number; width?: number; height?: number; subdivisions?: number; subdivisionsX?: number; subdivisionsY?: number } = {};\r\n const func = (state: NodeGeometryBuildState) => {\r\n options.size = this.size.getConnectedValue(state);\r\n options.width = this.width.getConnectedValue(state);\r\n options.height = this.height.getConnectedValue(state);\r\n\r\n const subdivisions = this.subdivisions.getConnectedValue(state);\r\n const subdivisionsX = this.subdivisionsX.getConnectedValue(state);\r\n const subdivisionsY = this.subdivisionsY.getConnectedValue(state);\r\n\r\n if (subdivisions) {\r\n options.subdivisions = subdivisions;\r\n }\r\n\r\n if (subdivisionsX) {\r\n options.subdivisionsX = subdivisionsX;\r\n }\r\n\r\n if (subdivisionsY) {\r\n options.subdivisionsY = subdivisionsY;\r\n }\r\n\r\n // Append vertex data from the ground builder (to get access to subdivisions)\r\n const vertexData = CreateGroundVertexData(options);\r\n\r\n Matrix.RotationYawPitchRollToRef(-Math.PI / 2, 0, Math.PI / 2, this._rotationMatrix);\r\n\r\n vertexData.transform(this._rotationMatrix);\r\n\r\n return vertexData;\r\n };\r\n\r\n if (this.evaluateContext) {\r\n this.geometry._storedFunction = func;\r\n } else {\r\n const value = func(state);\r\n this.geometry._storedFunction = () => {\r\n this.geometry._executionCount = 1;\r\n return value.clone();\r\n };\r\n }\r\n }\r\n\r\n protected override _dumpPropertiesCode() {\r\n const codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.evaluateContext = ${this.evaluateContext ? \"true\" : \"false\"};\\n`;\r\n return codeString;\r\n }\r\n\r\n /**\r\n * Serializes this block in a JSON representation\r\n * @returns the serialized block object\r\n */\r\n public override serialize(): any {\r\n const serializationObject = super.serialize();\r\n\r\n serializationObject.evaluateContext = this.evaluateContext;\r\n\r\n return serializationObject;\r\n }\r\n\r\n public override _deserialize(serializationObject: any) {\r\n super._deserialize(serializationObject);\r\n\r\n this.evaluateContext = serializationObject.evaluateContext;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.PlaneBlock\", PlaneBlock);\r\n"]}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { NodeGeometryBlock } from "../nodeGeometryBlock";
|
|
2
|
+
import type { NodeGeometryConnectionPoint } from "../nodeGeometryBlockConnectionPoint";
|
|
3
|
+
/**
|
|
4
|
+
* Block used to subdivide for a geometry using Catmull-Clark algorithm
|
|
5
|
+
*/
|
|
6
|
+
export declare class SubdivideBlock extends NodeGeometryBlock {
|
|
7
|
+
/**
|
|
8
|
+
* Gets or sets a boolean indicating that this block can evaluate context
|
|
9
|
+
*/
|
|
10
|
+
flatOnly: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Gets or sets a float defining the loop weight. i.e how much to weigh favoring heavy corners vs favoring Loop's formula
|
|
13
|
+
*/
|
|
14
|
+
loopWeight: number;
|
|
15
|
+
/**
|
|
16
|
+
* Creates a new ComputeNormalsBlock
|
|
17
|
+
* @param name defines the block name
|
|
18
|
+
*/
|
|
19
|
+
constructor(name: string);
|
|
20
|
+
/**
|
|
21
|
+
* Gets the current class name
|
|
22
|
+
* @returns the class name
|
|
23
|
+
*/
|
|
24
|
+
getClassName(): string;
|
|
25
|
+
/**
|
|
26
|
+
* Gets the geometry component
|
|
27
|
+
*/
|
|
28
|
+
get geometry(): NodeGeometryConnectionPoint;
|
|
29
|
+
/**
|
|
30
|
+
* Gets the level component
|
|
31
|
+
*/
|
|
32
|
+
get level(): NodeGeometryConnectionPoint;
|
|
33
|
+
/**
|
|
34
|
+
* Gets the output component
|
|
35
|
+
*/
|
|
36
|
+
get output(): NodeGeometryConnectionPoint;
|
|
37
|
+
protected _buildBlock(): void;
|
|
38
|
+
protected _dumpPropertiesCode(): string;
|
|
39
|
+
/**
|
|
40
|
+
* Serializes this block in a JSON representation
|
|
41
|
+
* @returns the serialized block object
|
|
42
|
+
*/
|
|
43
|
+
serialize(): any;
|
|
44
|
+
_deserialize(serializationObject: any): void;
|
|
45
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { __decorate } from "../../../tslib.es6.js";
|
|
2
|
+
import { Subdivide } from "../../mesh.vertexData.subdivide.js";
|
|
3
|
+
import { RegisterClass } from "../../../Misc/typeStore.js";
|
|
4
|
+
import { NodeGeometryBlockConnectionPointTypes } from "../Enums/nodeGeometryConnectionPointTypes.js";
|
|
5
|
+
import { NodeGeometryBlock } from "../nodeGeometryBlock.js";
|
|
6
|
+
import { editableInPropertyPage } from "../../../Decorators/nodeDecorator.js";
|
|
7
|
+
/**
|
|
8
|
+
* Block used to subdivide for a geometry using Catmull-Clark algorithm
|
|
9
|
+
*/
|
|
10
|
+
export class SubdivideBlock extends NodeGeometryBlock {
|
|
11
|
+
/**
|
|
12
|
+
* Creates a new ComputeNormalsBlock
|
|
13
|
+
* @param name defines the block name
|
|
14
|
+
*/
|
|
15
|
+
constructor(name) {
|
|
16
|
+
super(name);
|
|
17
|
+
/**
|
|
18
|
+
* Gets or sets a boolean indicating that this block can evaluate context
|
|
19
|
+
*/
|
|
20
|
+
this.flatOnly = false;
|
|
21
|
+
/**
|
|
22
|
+
* Gets or sets a float defining the loop weight. i.e how much to weigh favoring heavy corners vs favoring Loop's formula
|
|
23
|
+
*/
|
|
24
|
+
this.loopWeight = 1.0;
|
|
25
|
+
this.registerInput("geometry", NodeGeometryBlockConnectionPointTypes.Geometry);
|
|
26
|
+
this.registerInput("level", NodeGeometryBlockConnectionPointTypes.Int, true, 1, 0, 8);
|
|
27
|
+
this.registerOutput("output", NodeGeometryBlockConnectionPointTypes.Geometry);
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Gets the current class name
|
|
31
|
+
* @returns the class name
|
|
32
|
+
*/
|
|
33
|
+
getClassName() {
|
|
34
|
+
return "SubdivideBlock";
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Gets the geometry component
|
|
38
|
+
*/
|
|
39
|
+
get geometry() {
|
|
40
|
+
return this._inputs[0];
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Gets the level component
|
|
44
|
+
*/
|
|
45
|
+
get level() {
|
|
46
|
+
return this._inputs[1];
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Gets the output component
|
|
50
|
+
*/
|
|
51
|
+
get output() {
|
|
52
|
+
return this._outputs[0];
|
|
53
|
+
}
|
|
54
|
+
_buildBlock() {
|
|
55
|
+
this.output._storedFunction = (state) => {
|
|
56
|
+
if (!this.geometry.isConnected) {
|
|
57
|
+
return null;
|
|
58
|
+
}
|
|
59
|
+
const vertexData = this.geometry.getConnectedValue(state);
|
|
60
|
+
if (!vertexData) {
|
|
61
|
+
return null;
|
|
62
|
+
}
|
|
63
|
+
const level = this.level.getConnectedValue(state);
|
|
64
|
+
return Subdivide(vertexData, level, {
|
|
65
|
+
flatOnly: this.flatOnly,
|
|
66
|
+
weight: this.loopWeight,
|
|
67
|
+
});
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
_dumpPropertiesCode() {
|
|
71
|
+
let codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.flatOnly = ${this.flatOnly ? "true" : "false"};\n`;
|
|
72
|
+
codeString += `${this._codeVariableName}.loopWeight = ${this.loopWeight};\n`;
|
|
73
|
+
return codeString;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Serializes this block in a JSON representation
|
|
77
|
+
* @returns the serialized block object
|
|
78
|
+
*/
|
|
79
|
+
serialize() {
|
|
80
|
+
const serializationObject = super.serialize();
|
|
81
|
+
serializationObject.flatOnly = this.flatOnly;
|
|
82
|
+
serializationObject.loopWeight = this.loopWeight;
|
|
83
|
+
return serializationObject;
|
|
84
|
+
}
|
|
85
|
+
_deserialize(serializationObject) {
|
|
86
|
+
super._deserialize(serializationObject);
|
|
87
|
+
this.flatOnly = serializationObject.flatOnly;
|
|
88
|
+
this.loopWeight = serializationObject.loopWeight;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
__decorate([
|
|
92
|
+
editableInPropertyPage("Flat Only", 0 /* PropertyTypeForEdition.Boolean */, "ADVANCED", { embedded: true, notifiers: { rebuild: true } })
|
|
93
|
+
], SubdivideBlock.prototype, "flatOnly", void 0);
|
|
94
|
+
__decorate([
|
|
95
|
+
editableInPropertyPage("Loop weight", 1 /* PropertyTypeForEdition.Float */, "ADVANCED", { embedded: true, min: 0, max: 1, notifiers: { rebuild: true } })
|
|
96
|
+
], SubdivideBlock.prototype, "loopWeight", void 0);
|
|
97
|
+
RegisterClass("BABYLON.SubdivideBlock", SubdivideBlock);
|
|
98
|
+
//# sourceMappingURL=subdiv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QAAQ,GAAG,mBAAmB,CAAC,QAAQ,CAAC;QAC7C,IAAI,CAAC,UAAU,GAAG,mBAAmB,CAAC,UAAU,CAAC;IACrD,CAAC;CACJ;AA9FU;IADN,sBAAsB,CAAC,WAAW,0CAAkC,UAAU,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,CAAC;gDAC1G;AAMjB;IADN,sBAAsB,CAAC,aAAa,wCAAgC,UAAU,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,SAAS,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,CAAC;kDAC1H;AA0F5B,aAAa,CAAC,wBAAwB,EAAE,cAAc,CAAC,CAAC","sourcesContent":["import { Subdivide } from \"core/Meshes/mesh.vertexData.subdivide\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\nimport { NodeGeometryBlockConnectionPointTypes } from \"../Enums/nodeGeometryConnectionPointTypes\";\r\nimport { NodeGeometryBlock } from \"../nodeGeometryBlock\";\r\nimport type { NodeGeometryConnectionPoint } from \"../nodeGeometryBlockConnectionPoint\";\r\nimport { editableInPropertyPage, PropertyTypeForEdition } from \"core/Decorators/nodeDecorator\";\r\n/**\r\n * Block used to subdivide for a geometry using Catmull-Clark algorithm\r\n */\r\nexport class SubdivideBlock extends NodeGeometryBlock {\r\n /**\r\n * Gets or sets a boolean indicating that this block can evaluate context\r\n */\r\n @editableInPropertyPage(\"Flat Only\", PropertyTypeForEdition.Boolean, \"ADVANCED\", { embedded: true, notifiers: { rebuild: true } })\r\n public flatOnly = false;\r\n\r\n /**\r\n * Gets or sets a float defining the loop weight. i.e how much to weigh favoring heavy corners vs favoring Loop's formula\r\n */\r\n @editableInPropertyPage(\"Loop weight\", PropertyTypeForEdition.Float, \"ADVANCED\", { embedded: true, min: 0, max: 1, notifiers: { rebuild: true } })\r\n public loopWeight = 1.0;\r\n\r\n /**\r\n * Creates a new ComputeNormalsBlock\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(\"level\", NodeGeometryBlockConnectionPointTypes.Int, true, 1, 0, 8);\r\n this.registerOutput(\"output\", NodeGeometryBlockConnectionPointTypes.Geometry);\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public override getClassName() {\r\n return \"SubdivideBlock\";\r\n }\r\n\r\n /**\r\n * Gets the geometry component\r\n */\r\n public get geometry(): NodeGeometryConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the level component\r\n */\r\n public get level(): NodeGeometryConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeGeometryConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected override _buildBlock() {\r\n this.output._storedFunction = (state) => {\r\n if (!this.geometry.isConnected) {\r\n return null;\r\n }\r\n\r\n const vertexData = this.geometry.getConnectedValue(state);\r\n if (!vertexData) {\r\n return null;\r\n }\r\n\r\n const level = this.level.getConnectedValue(state);\r\n\r\n return Subdivide(vertexData, level, {\r\n flatOnly: this.flatOnly,\r\n weight: this.loopWeight,\r\n });\r\n };\r\n }\r\n\r\n protected override _dumpPropertiesCode() {\r\n let codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.flatOnly = ${this.flatOnly ? \"true\" : \"false\"};\\n`;\r\n codeString += `${this._codeVariableName}.loopWeight = ${this.loopWeight};\\n`;\r\n return codeString;\r\n }\r\n\r\n /**\r\n * Serializes this block in a JSON representation\r\n * @returns the serialized block object\r\n */\r\n public override serialize(): any {\r\n const serializationObject = super.serialize();\r\n\r\n serializationObject.flatOnly = this.flatOnly;\r\n serializationObject.loopWeight = this.loopWeight;\r\n\r\n return serializationObject;\r\n }\r\n\r\n public override _deserialize(serializationObject: any) {\r\n super._deserialize(serializationObject);\r\n\r\n this.flatOnly = serializationObject.flatOnly;\r\n this.loopWeight = serializationObject.loopWeight;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.SubdivideBlock\", SubdivideBlock);\r\n"]}
|
package/Meshes/Node/index.d.ts
CHANGED
package/Meshes/Node/index.js
CHANGED
|
@@ -83,4 +83,5 @@ export * from "./Blocks/geometryLengthBlock.js";
|
|
|
83
83
|
export * from "./Blocks/geometryRotate2dBlock.js";
|
|
84
84
|
export * from "./Blocks/geometryInterceptorBlock.js";
|
|
85
85
|
export * from "./Blocks/Set/aggregatorBlock.js";
|
|
86
|
+
export * from "./Blocks/subdivideBlock.js";
|
|
86
87
|
//# sourceMappingURL=index.js.map
|
package/Meshes/Node/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../dev/core/src/Meshes/Node/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,oCAAoC,CAAC;AACnD,cAAc,0BAA0B,CAAC;AACzC,cAAc,2CAA2C,CAAC;AAC1D,cAAc,0CAA0C,CAAC;AACzD,cAAc,uCAAuC,CAAC;AACtD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,iCAAiC,CAAC;AAChD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,iCAAiC,CAAC;AAChD,cAAc,gC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AC3C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,kCAAkC,CAAC;AACjD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,kCAAkC,CAAC;AACjD,cAAc,iCAAiC,CAAC;AAChD,cAAc,oCAAoC,CAAC;AACnD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,mCAAmC,CAAC;AAClD,cAAc,8BAA8B,CAAC","sourcesContent":["export * from \"./nodeGeometry\";\r\nexport * from \"./nodeGeometryBlock\";\r\nexport * from \"./nodeGeometryBlockConnectionPoint\";\r\nexport * from \"./nodeGeometryBuildState\";\r\nexport * from \"./Interfaces/nodeGeometryExecutionContext\";\r\nexport * from \"./Enums/nodeGeometryConnectionPointTypes\";\r\nexport * from \"./Enums/nodeGeometryContextualSources\";\r\nexport * from \"./Blocks/geometryOptimizeBlock\";\r\nexport * from \"./Blocks/geometryOutputBlock\";\r\nexport * from \"./Blocks/geometryInputBlock\";\r\nexport * from \"./Blocks/Sources/planeBlock\";\r\nexport * from \"./Blocks/Sources/boxBlock\";\r\nexport * from \"./Blocks/Sources/meshBlock\";\r\nexport * from \"./Blocks/Sources/icoSphereBlock\";\r\nexport * from \"./Blocks/Sources/sphereBlock\";\r\nexport * from \"./Blocks/Sources/gridBlock\";\r\nexport * from \"./Blocks/Sources/torusBlock\";\r\nexport * from \"./Blocks/Sources/cylinderBlock\";\r\nexport * from \"./Blocks/Sources/capsuleBlock\";\r\nexport * from \"./Blocks/Sources/discBlock\";\r\nexport * from \"./Blocks/Sources/nullBlock\";\r\nexport * from \"./Blocks/Sources/pointListBlock\";\r\nexport * from \"./Blocks/Set/setPositionsBlock\";\r\nexport * from \"./Blocks/Set/setNormalsBlock\";\r\nexport * from \"./Blocks/Set/setUVsBlock\";\r\nexport * from \"./Blocks/Set/setColorsBlock\";\r\nexport * from \"./Blocks/Set/setTangentsBlock\";\r\nexport * from \"./Blocks/mathBlock\";\r\nexport * from \"./Blocks/mapRangeBlock\";\r\nexport * from \"./Blocks/conditionBlock\";\r\nexport * from \"./Blocks/randomBlock\";\r\nexport * from \"./Blocks/noiseBlock\";\r\nexport * from \"./Blocks/mergeGeometryBlock\";\r\nexport * from \"./Blocks/geometryCollectionBlock\";\r\nexport * from \"./Blocks/cleanGeometryBlock\";\r\nexport * from \"./Blocks/geometryElbowBlock\";\r\nexport * from \"./Blocks/computeNormalsBlock\";\r\nexport * from \"./Blocks/vectorConverterBlock\";\r\nexport * from \"./Blocks/normalizeVectorBlock\";\r\nexport * from \"./Blocks/Set/setMaterialIDBlock\";\r\nexport * from \"./Blocks/Set/latticeBlock\";\r\nexport * from \"./Blocks/geometryTrigonometryBlock\";\r\nexport * from \"./Blocks/geometryTransformBlock\";\r\nexport * from \"./Blocks/Matrices/rotationXBlock\";\r\nexport * from \"./Blocks/Matrices/rotationYBlock\";\r\nexport * from \"./Blocks/Matrices/rotationZBlock\";\r\nexport * from \"./Blocks/Matrices/scalingBlock\";\r\nexport * from \"./Blocks/Matrices/alignBlock\";\r\nexport * from \"./Blocks/Matrices/translationBlock\";\r\nexport * from \"./Blocks/Instances/instantiateOnVerticesBlock\";\r\nexport * from \"./Blocks/Instances/instantiateOnFacesBlock\";\r\nexport * from \"./Blocks/Instances/instantiateOnVolumeBlock\";\r\nexport * from \"./Blocks/Instances/instantiateBlock\";\r\nexport * from \"./Blocks/Instances/instantiateLinearBlock\";\r\nexport * from \"./Blocks/Instances/instantiateRadialBlock\";\r\nexport * from \"./Blocks/intFloatConverterBlock\";\r\nexport * from \"./Blocks/debugBlock\";\r\nexport * from \"./Blocks/geometryInfoBlock\";\r\nexport * from \"./Blocks/mappingBlock\";\r\nexport * from \"./Blocks/matrixComposeBlock\";\r\nexport * from \"./Blocks/Teleport/teleportInBlock\";\r\nexport * from \"./Blocks/Teleport/teleportOutBlock\";\r\nexport * from \"./Blocks/Textures/geometryTextureBlock\";\r\nexport * from \"./Blocks/Textures/geometryTextureFetchBlock\";\r\nexport * from \"./Blocks/boundingBlock\";\r\nexport * from \"./Blocks/booleanGeometryBlock\";\r\nexport * from \"./Blocks/geometryArcTan2Block\";\r\nexport * from \"./Blocks/geometryLerpBlock\";\r\nexport * from \"./Blocks/geometryNLerpBlock\";\r\nexport * from \"./Blocks/geometryStepBlock\";\r\nexport * from \"./Blocks/geometrySmoothStepBlock\";\r\nexport * from \"./Blocks/geometryModBlock\";\r\nexport * from \"./Blocks/geometryPowBlock\";\r\nexport * from \"./Blocks/geometryClampBlock\";\r\nexport * from \"./Blocks/geometryCrossBlock\";\r\nexport * from \"./Blocks/geometryCurveBlock\";\r\nexport * from \"./Blocks/geometryDesaturateBlock\";\r\nexport * from \"./Blocks/geometryPosterizeBlock\";\r\nexport * from \"./Blocks/geometryReplaceColorBlock\";\r\nexport * from \"./Blocks/geometryDistanceBlock\";\r\nexport * from \"./Blocks/geometryDotBlock\";\r\nexport * from \"./Blocks/geometryLengthBlock\";\r\nexport * from \"./Blocks/geometryRotate2dBlock\";\r\nexport * from \"./Blocks/geometryInterceptorBlock\";\r\nexport * from \"./Blocks/Set/aggregatorBlock\";\r\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../dev/core/src/Meshes/Node/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,oCAAoC,CAAC;AACnD,cAAc,0BAA0B,CAAC;AACzC,cAAc,2CAA2C,CAAC;AAC1D,cAAc,0CAA0C,CAAC;AACzD,cAAc,uCAAuC,CAAC;AACtD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,6BAA6B,CA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1D,cAAc,iCAAiC,CAAC;AAChD,cAAc,qBAAqB,CAAC;AACpC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uBAAuB,CAAC;AACtC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,mCAAmC,CAAC;AAClD,cAAc,oCAAoC,CAAC;AACnD,cAAc,wCAAwC,CAAC;AACvD,cAAc,6CAA6C,CAAC;AAC5D,cAAc,wBAAwB,CAAC;AACvC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,kCAAkC,CAAC;AACjD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,kCAAkC,CAAC;AACjD,cAAc,iCAAiC,CAAC;AAChD,cAAc,oCAAoC,CAAC;AACnD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,mCAAmC,CAAC;AAClD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,yBAAyB,CAAC","sourcesContent":["export * from \"./nodeGeometry\";\r\nexport * from \"./nodeGeometryBlock\";\r\nexport * from \"./nodeGeometryBlockConnectionPoint\";\r\nexport * from \"./nodeGeometryBuildState\";\r\nexport * from \"./Interfaces/nodeGeometryExecutionContext\";\r\nexport * from \"./Enums/nodeGeometryConnectionPointTypes\";\r\nexport * from \"./Enums/nodeGeometryContextualSources\";\r\nexport * from \"./Blocks/geometryOptimizeBlock\";\r\nexport * from \"./Blocks/geometryOutputBlock\";\r\nexport * from \"./Blocks/geometryInputBlock\";\r\nexport * from \"./Blocks/Sources/planeBlock\";\r\nexport * from \"./Blocks/Sources/boxBlock\";\r\nexport * from \"./Blocks/Sources/meshBlock\";\r\nexport * from \"./Blocks/Sources/icoSphereBlock\";\r\nexport * from \"./Blocks/Sources/sphereBlock\";\r\nexport * from \"./Blocks/Sources/gridBlock\";\r\nexport * from \"./Blocks/Sources/torusBlock\";\r\nexport * from \"./Blocks/Sources/cylinderBlock\";\r\nexport * from \"./Blocks/Sources/capsuleBlock\";\r\nexport * from \"./Blocks/Sources/discBlock\";\r\nexport * from \"./Blocks/Sources/nullBlock\";\r\nexport * from \"./Blocks/Sources/pointListBlock\";\r\nexport * from \"./Blocks/Set/setPositionsBlock\";\r\nexport * from \"./Blocks/Set/setNormalsBlock\";\r\nexport * from \"./Blocks/Set/setUVsBlock\";\r\nexport * from \"./Blocks/Set/setColorsBlock\";\r\nexport * from \"./Blocks/Set/setTangentsBlock\";\r\nexport * from \"./Blocks/mathBlock\";\r\nexport * from \"./Blocks/mapRangeBlock\";\r\nexport * from \"./Blocks/conditionBlock\";\r\nexport * from \"./Blocks/randomBlock\";\r\nexport * from \"./Blocks/noiseBlock\";\r\nexport * from \"./Blocks/mergeGeometryBlock\";\r\nexport * from \"./Blocks/geometryCollectionBlock\";\r\nexport * from \"./Blocks/cleanGeometryBlock\";\r\nexport * from \"./Blocks/geometryElbowBlock\";\r\nexport * from \"./Blocks/computeNormalsBlock\";\r\nexport * from \"./Blocks/vectorConverterBlock\";\r\nexport * from \"./Blocks/normalizeVectorBlock\";\r\nexport * from \"./Blocks/Set/setMaterialIDBlock\";\r\nexport * from \"./Blocks/Set/latticeBlock\";\r\nexport * from \"./Blocks/geometryTrigonometryBlock\";\r\nexport * from \"./Blocks/geometryTransformBlock\";\r\nexport * from \"./Blocks/Matrices/rotationXBlock\";\r\nexport * from \"./Blocks/Matrices/rotationYBlock\";\r\nexport * from \"./Blocks/Matrices/rotationZBlock\";\r\nexport * from \"./Blocks/Matrices/scalingBlock\";\r\nexport * from \"./Blocks/Matrices/alignBlock\";\r\nexport * from \"./Blocks/Matrices/translationBlock\";\r\nexport * from \"./Blocks/Instances/instantiateOnVerticesBlock\";\r\nexport * from \"./Blocks/Instances/instantiateOnFacesBlock\";\r\nexport * from \"./Blocks/Instances/instantiateOnVolumeBlock\";\r\nexport * from \"./Blocks/Instances/instantiateBlock\";\r\nexport * from \"./Blocks/Instances/instantiateLinearBlock\";\r\nexport * from \"./Blocks/Instances/instantiateRadialBlock\";\r\nexport * from \"./Blocks/intFloatConverterBlock\";\r\nexport * from \"./Blocks/debugBlock\";\r\nexport * from \"./Blocks/geometryInfoBlock\";\r\nexport * from \"./Blocks/mappingBlock\";\r\nexport * from \"./Blocks/matrixComposeBlock\";\r\nexport * from \"./Blocks/Teleport/teleportInBlock\";\r\nexport * from \"./Blocks/Teleport/teleportOutBlock\";\r\nexport * from \"./Blocks/Textures/geometryTextureBlock\";\r\nexport * from \"./Blocks/Textures/geometryTextureFetchBlock\";\r\nexport * from \"./Blocks/boundingBlock\";\r\nexport * from \"./Blocks/booleanGeometryBlock\";\r\nexport * from \"./Blocks/geometryArcTan2Block\";\r\nexport * from \"./Blocks/geometryLerpBlock\";\r\nexport * from \"./Blocks/geometryNLerpBlock\";\r\nexport * from \"./Blocks/geometryStepBlock\";\r\nexport * from \"./Blocks/geometrySmoothStepBlock\";\r\nexport * from \"./Blocks/geometryModBlock\";\r\nexport * from \"./Blocks/geometryPowBlock\";\r\nexport * from \"./Blocks/geometryClampBlock\";\r\nexport * from \"./Blocks/geometryCrossBlock\";\r\nexport * from \"./Blocks/geometryCurveBlock\";\r\nexport * from \"./Blocks/geometryDesaturateBlock\";\r\nexport * from \"./Blocks/geometryPosterizeBlock\";\r\nexport * from \"./Blocks/geometryReplaceColorBlock\";\r\nexport * from \"./Blocks/geometryDistanceBlock\";\r\nexport * from \"./Blocks/geometryDotBlock\";\r\nexport * from \"./Blocks/geometryLengthBlock\";\r\nexport * from \"./Blocks/geometryRotate2dBlock\";\r\nexport * from \"./Blocks/geometryInterceptorBlock\";\r\nexport * from \"./Blocks/Set/aggregatorBlock\";\r\nexport * from \"./Blocks/subdivideBlock\";\r\n"]}
|
package/Meshes/abstractMesh.js
CHANGED
|
@@ -32,6 +32,12 @@ function applyMorph(data, kind, morphTargetManager) {
|
|
|
32
32
|
case VertexBuffer.UVKind:
|
|
33
33
|
getTargetData = (target) => target.getUVs();
|
|
34
34
|
break;
|
|
35
|
+
case VertexBuffer.UV2Kind:
|
|
36
|
+
getTargetData = (target) => target.getUV2s();
|
|
37
|
+
break;
|
|
38
|
+
case VertexBuffer.ColorKind:
|
|
39
|
+
getTargetData = (target) => target.getColors();
|
|
40
|
+
break;
|
|
35
41
|
default:
|
|
36
42
|
return;
|
|
37
43
|
}
|