958d1041bfb1b76ed1218551837bd7c58b73b49bf90fafeb8cf178256b7bda9e.json 5.2 KB

1
  1. {"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 compute arc tangent of 2 values\n */\nexport class ArcTan2Block extends NodeMaterialBlock {\n /**\n * Creates a new ArcTan2Block\n * @param name defines the block name\n */\n constructor(name) {\n super(name, NodeMaterialBlockTargets.Neutral);\n this.registerInput(\"x\", NodeMaterialBlockConnectionPointTypes.Float);\n this.registerInput(\"y\", NodeMaterialBlockConnectionPointTypes.Float);\n this.registerOutput(\"output\", NodeMaterialBlockConnectionPointTypes.Float);\n }\n /**\n * Gets the current class name\n * @returns the class name\n */\n getClassName() {\n return \"ArcTan2Block\";\n }\n /**\n * Gets the x operand input component\n */\n get x() {\n return this._inputs[0];\n }\n /**\n * Gets the y operand input component\n */\n get y() {\n return this._inputs[1];\n }\n /**\n * Gets the output component\n */\n get output() {\n return this._outputs[0];\n }\n _buildBlock(state) {\n super._buildBlock(state);\n const output = this._outputs[0];\n const func = state.shaderLanguage === 1 /* ShaderLanguage.WGSL */ ? \"atan2\" : \"atan\";\n state.compilationString += state._declareOutput(output) + ` = ${func}(${this.x.associatedVariableName}, ${this.y.associatedVariableName});\\n`;\n return this;\n }\n}\nRegisterClass(\"BABYLON.ArcTan2Block\", ArcTan2Block);","map":{"version":3,"names":["NodeMaterialBlock","NodeMaterialBlockConnectionPointTypes","NodeMaterialBlockTargets","RegisterClass","ArcTan2Block","constructor","name","Neutral","registerInput","Float","registerOutput","getClassName","x","_inputs","y","output","_outputs","_buildBlock","state","func","shaderLanguage","compilationString","_declareOutput","associatedVariableName"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@babylonjs/core/Materials/Node/Blocks/arcTan2Block.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 compute arc tangent of 2 values\n */\nexport class ArcTan2Block extends NodeMaterialBlock {\n /**\n * Creates a new ArcTan2Block\n * @param name defines the block name\n */\n constructor(name) {\n super(name, NodeMaterialBlockTargets.Neutral);\n this.registerInput(\"x\", NodeMaterialBlockConnectionPointTypes.Float);\n this.registerInput(\"y\", NodeMaterialBlockConnectionPointTypes.Float);\n this.registerOutput(\"output\", NodeMaterialBlockConnectionPointTypes.Float);\n }\n /**\n * Gets the current class name\n * @returns the class name\n */\n getClassName() {\n return \"ArcTan2Block\";\n }\n /**\n * Gets the x operand input component\n */\n get x() {\n return this._inputs[0];\n }\n /**\n * Gets the y operand input component\n */\n get y() {\n return this._inputs[1];\n }\n /**\n * Gets the output component\n */\n get output() {\n return this._outputs[0];\n }\n _buildBlock(state) {\n super._buildBlock(state);\n const output = this._outputs[0];\n const func = state.shaderLanguage === 1 /* ShaderLanguage.WGSL */ ? \"atan2\" : \"atan\";\n state.compilationString += state._declareOutput(output) + ` = ${func}(${this.x.associatedVariableName}, ${this.y.associatedVariableName});\\n`;\n return this;\n }\n}\nRegisterClass(\"BABYLON.ArcTan2Block\", ArcTan2Block);\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,YAAY,SAASJ,iBAAiB,CAAC;EAChD;AACJ;AACA;AACA;EACIK,WAAWA,CAACC,IAAI,EAAE;IACd,KA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