{"ast":null,"code":"import { NodeMaterialBlock } from \"../nodeMaterialBlock.js\";\nimport { NodeMaterialBlockConnectionPointTypes } from \"../Enums/nodeMaterialBlockConnectionPointTypes.js\";\nimport { NodeMaterialBlockTargets } from \"../Enums/nodeMaterialBlockTargets.js\";\nimport { RegisterClass } from \"../../../Misc/typeStore.js\";\n/**\n * Block used to expand a Vector3/4 into 4 outputs (one for each component)\n */\nexport class VectorSplitterBlock extends NodeMaterialBlock {\n /**\n * Create a new VectorSplitterBlock\n * @param name defines the block name\n */\n constructor(name) {\n super(name, NodeMaterialBlockTargets.Neutral);\n this.registerInput(\"xyzw\", NodeMaterialBlockConnectionPointTypes.Vector4, true);\n this.registerInput(\"xyz \", NodeMaterialBlockConnectionPointTypes.Vector3, true);\n this.registerInput(\"xy \", NodeMaterialBlockConnectionPointTypes.Vector2, true);\n this.registerOutput(\"xyz\", NodeMaterialBlockConnectionPointTypes.Vector3);\n this.registerOutput(\"xy\", NodeMaterialBlockConnectionPointTypes.Vector2);\n this.registerOutput(\"zw\", NodeMaterialBlockConnectionPointTypes.Vector2);\n this.registerOutput(\"x\", NodeMaterialBlockConnectionPointTypes.Float);\n this.registerOutput(\"y\", NodeMaterialBlockConnectionPointTypes.Float);\n this.registerOutput(\"z\", NodeMaterialBlockConnectionPointTypes.Float);\n this.registerOutput(\"w\", NodeMaterialBlockConnectionPointTypes.Float);\n this.inputsAreExclusive = true;\n }\n /**\n * Gets the current class name\n * @returns the class name\n */\n getClassName() {\n return \"VectorSplitterBlock\";\n }\n /**\n * Gets the xyzw component (input)\n */\n get xyzw() {\n return this._inputs[0];\n }\n /**\n * Gets the xyz component (input)\n */\n get xyzIn() {\n return this._inputs[1];\n }\n /**\n * Gets the xy component (input)\n */\n get xyIn() {\n return this._inputs[2];\n }\n /**\n * Gets the xyz component (output)\n */\n get xyzOut() {\n return this._outputs[0];\n }\n /**\n * Gets the xy component (output)\n */\n get xyOut() {\n return this._outputs[1];\n }\n /**\n * Gets the zw component (output)\n */\n get zw() {\n return this._outputs[2];\n }\n /**\n * Gets the x component (output)\n */\n get x() {\n return this._outputs[3];\n }\n /**\n * Gets the y component (output)\n */\n get y() {\n return this._outputs[4];\n }\n /**\n * Gets the z component (output)\n */\n get z() {\n return this._outputs[5];\n }\n /**\n * Gets the w component (output)\n */\n get w() {\n return this._outputs[6];\n }\n _inputRename(name) {\n switch (name) {\n case \"xy \":\n return \"xyIn\";\n case \"xyz \":\n return \"xyzIn\";\n default:\n return name;\n }\n }\n _outputRename(name) {\n switch (name) {\n case \"xy\":\n return \"xyOut\";\n case \"xyz\":\n return \"xyzOut\";\n default:\n return name;\n }\n }\n _buildBlock(state) {\n super._buildBlock(state);\n const input = this.xyzw.isConnected ? this.xyzw : this.xyzIn.isConnected ? this.xyzIn : this.xyIn;\n const xyzOutput = this._outputs[0];\n const xyOutput = this._outputs[1];\n const zwOutput = this._outputs[2];\n const xOutput = this._outputs[3];\n const yOutput = this._outputs[4];\n const zOutput = this._outputs[5];\n const wOutput = this._outputs[6];\n const vec3 = state._getShaderType(NodeMaterialBlockConnectionPointTypes.Vector3);\n if (xyzOutput.hasEndpoints) {\n if (input === this.xyIn) {\n state.compilationString += state._declareOutput(xyzOutput) + ` = ${vec3}(${input.associatedVariableName}, 0.0);\\n`;\n } else {\n state.compilationString += state._declareOutput(xyzOutput) + ` = ${input.associatedVariableName}.xyz;\\n`;\n }\n }\n if (zwOutput.hasEndpoints && this.xyzw.isConnected) {\n state.compilationString += state._declareOutput(zwOutput) + ` = ${this.xyzw.associatedVariableName}.zw;\\n`;\n }\n if (xyOutput.hasEndpoints) {\n state.compilationString += state._declareOutput(xyOutput) + ` = ${input.associatedVariableName}.xy;\\n`;\n }\n if (xOutput.hasEndpoints) {\n state.compilationString += state._declareOutput(xOutput) + ` = ${input.associatedVariableName}.x;\\n`;\n }\n if (yOutput.hasEndpoints) {\n state.compilationString += state._declareOutput(yOutput) + ` = ${input.associatedVariableName}.y;\\n`;\n }\n if (zOutput.hasEndpoints) {\n state.compilationString += state._declareOutput(zOutput) + ` = ${input.associatedVariableName}.z;\\n`;\n }\n if (wOutput.hasEndpoints) {\n state.compilationString += state._declareOutput(wOutput) + ` = ${input.associatedVariableName}.w;\\n`;\n }\n return this;\n }\n}\nRegisterClass(\"BABYLON.VectorSplitterBlock\", VectorSplitterBlock);","map":{"version":3,"names":["NodeMaterialBlock","NodeMaterialBlockConnectionPointTypes","NodeMaterialBlockTargets","RegisterClass","VectorSplitterBlock","constructor","name","Neutral","registerInput","Vector4","Vector3","Vector2","registerOutput","Float","inputsAreExclusive","getClassName","xyzw","_inputs","xyzIn","xyIn","xyzOut","_outputs","xyOut","zw","x","y","z","w","_inputRename","_outputRename","_buildBlock","state","input","isConnected","xyzOutput","xyOutput","zwOutput","xOutput","yOutput","zOutput","wOutput","vec3","_getShaderType","hasEndpoints","compilationString","_declareOutput","associatedVariableName"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@babylonjs/core/Materials/Node/Blocks/vectorSplitterBlock.js"],"sourcesContent":["import { NodeMaterialBlock } from \"../nodeMaterialBlock.js\";\nimport { NodeMaterialBlockConnectionPointTypes } from \"../Enums/nodeMaterialBlockConnectionPointTypes.js\";\nimport { NodeMaterialBlockTargets } from \"../Enums/nodeMaterialBlockTargets.js\";\nimport { RegisterClass } from \"../../../Misc/typeStore.js\";\n/**\n * Block used to expand a Vector3/4 into 4 outputs (one for each component)\n */\nexport class VectorSplitterBlock extends NodeMaterialBlock {\n /**\n * Create a new VectorSplitterBlock\n * @param name defines the block name\n */\n constructor(name) {\n super(name, NodeMaterialBlockTargets.Neutral);\n this.registerInput(\"xyzw\", NodeMaterialBlockConnectionPointTypes.Vector4, true);\n this.registerInput(\"xyz \", NodeMaterialBlockConnectionPointTypes.Vector3, true);\n this.registerInput(\"xy \", NodeMaterialBlockConnectionPointTypes.Vector2, true);\n this.registerOutput(\"xyz\", NodeMaterialBlockConnectionPointTypes.Vector3);\n this.registerOutput(\"xy\", NodeMaterialBlockConnectionPointTypes.Vector2);\n this.registerOutput(\"zw\", NodeMaterialBlockConnectionPointTypes.Vector2);\n this.registerOutput(\"x\", NodeMaterialBlockConnectionPointTypes.Float);\n this.registerOutput(\"y\", NodeMaterialBlockConnectionPointTypes.Float);\n this.registerOutput(\"z\", NodeMaterialBlockConnectionPointTypes.Float);\n this.registerOutput(\"w\", NodeMaterialBlockConnectionPointTypes.Float);\n this.inputsAreExclusive = true;\n }\n /**\n * Gets the current class name\n * @returns the class name\n */\n getClassName() {\n return \"VectorSplitterBlock\";\n }\n /**\n * Gets the xyzw component (input)\n */\n get xyzw() {\n return this._inputs[0];\n }\n /**\n * Gets the xyz component (input)\n */\n get xyzIn() {\n return this._inputs[1];\n }\n /**\n * Gets the xy component (input)\n */\n get xyIn() {\n return this._inputs[2];\n }\n /**\n * Gets the xyz component (output)\n */\n get xyzOut() {\n return this._outputs[0];\n }\n /**\n * Gets the xy component (output)\n */\n get xyOut() {\n return this._outputs[1];\n }\n /**\n * Gets the zw component (output)\n */\n get zw() {\n return this._outputs[2];\n }\n /**\n * Gets the x component (output)\n */\n get x() {\n return this._outputs[3];\n }\n /**\n * Gets the y component (output)\n */\n get y() {\n return this._outputs[4];\n }\n /**\n * Gets the z component (output)\n */\n get z() {\n return this._outputs[5];\n }\n /**\n * Gets the w component (output)\n */\n get w() {\n return this._outputs[6];\n }\n _inputRename(name) {\n switch (name) {\n case \"xy \":\n return \"xyIn\";\n case \"xyz \":\n return \"xyzIn\";\n default:\n return name;\n }\n }\n _outputRename(name) {\n switch (name) {\n case \"xy\":\n return \"xyOut\";\n case \"xyz\":\n return \"xyzOut\";\n default:\n return name;\n }\n }\n _buildBlock(state) {\n super._buildBlock(state);\n const input = this.xyzw.isConnected ? this.xyzw : this.xyzIn.isConnected ? this.xyzIn : this.xyIn;\n const xyzOutput = this._outputs[0];\n const xyOutput = this._outputs[1];\n const zwOutput = this._outputs[2];\n const xOutput = this._outputs[3];\n const yOutput = this._outputs[4];\n const zOutput = this._outputs[5];\n const wOutput = this._outputs[6];\n const vec3 = state._getShaderType(NodeMaterialBlockConnectionPointTypes.Vector3);\n if (xyzOutput.hasEndpoints) {\n if (input === this.xyIn) {\n state.compilationString += state._declareOutput(xyzOutput) + ` = ${vec3}(${input.associatedVariableName}, 0.0);\\n`;\n }\n else {\n state.compilationString += state._declareOutput(xyzOutput) + ` = ${input.associatedVariableName}.xyz;\\n`;\n }\n }\n if (zwOutput.hasEndpoints && this.xyzw.isConnected) {\n state.compilationString += state._declareOutput(zwOutput) + ` = ${this.xyzw.associatedVariableName}.zw;\\n`;\n }\n if (xyOutput.hasEndpoints) {\n state.compilationString += state._declareOutput(xyOutput) + ` = ${input.associatedVariableName}.xy;\\n`;\n }\n if (xOutput.hasEndpoints) {\n state.compilationString += state._declareOutput(xOutput) + ` = ${input.associatedVariableName}.x;\\n`;\n }\n if (yOutput.hasEndpoints) {\n state.compilationString += state._declareOutput(yOutput) + ` = ${input.associatedVariableName}.y;\\n`;\n }\n if (zOutput.hasEndpoints) {\n state.compilationString += state._declareOutput(zOutput) + ` = ${input.associatedVariableName}.z;\\n`;\n }\n if (wOutput.hasEndpoints) {\n state.compilationString += state._declareOutput(wOutput) + ` = ${input.associatedVariableName}.w;\\n`;\n }\n return this;\n }\n}\nRegisterClass(\"BABYLON.VectorSplitterBlock\", VectorSplitterBlock);\n"],"mappings":"AAAA,SAASA,iBAAiB,QAAQ,yBAAyB;AAC3D,SAASC,qCAAqC,QAAQ,mDAAmD;AACzG,SAASC,wBAAwB,QAAQ,sCAAsC;AAC/E,SAASC,aAAa,QAAQ,4BAA4B;AAC1D;AACA;AACA;AACA,OAAO,MAAMC,mBAAmB,SAASJ,iBAAiB,CAAC;EACvD;AACJ;AACA;AACA;EACIK,WAAWA,CAACC,IAAI,EAAE;IACd,KAAK,CAACA,IAAI,EAAEJ,wBAAwB,CAACK,OAAO,CAAC;IAC7C,IAAI,CAACC,aAAa,CAAC,MAAM,EAAEP,qCAAqC,CAACQ,OAAO,EAAE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