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 normalize a vector\n */\nexport class NormalizeBlock extends NodeMaterialBlock {\n /**\n * Creates a new NormalizeBlock\n * @param name defines the block name\n */\n constructor(name) {\n super(name, NodeMaterialBlockTargets.Neutral);\n this.registerInput(\"input\", NodeMaterialBlockConnectionPointTypes.AutoDetect);\n this.registerOutput(\"output\", NodeMaterialBlockConnectionPointTypes.BasedOnInput);\n this._outputs[0]._typeConnectionSource = this._inputs[0];\n this._inputs[0].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Float);\n this._inputs[0].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Matrix);\n }\n /**\n * Gets the current class name\n * @returns the class name\n */\n getClassName() {\n return \"NormalizeBlock\";\n }\n /**\n * Gets the input component\n */\n get input() {\n return this._inputs[0];\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 input = this._inputs[0];\n state.compilationString += state._declareOutput(output) + ` = normalize(${input.associatedVariableName});\\n`;\n return this;\n }\n}\nRegisterClass(\"BABYLON.NormalizeBlock\", NormalizeBlock);","map":{"version":3,"names":["NodeMaterialBlock","NodeMaterialBlockConnectionPointTypes","NodeMaterialBlockTargets","RegisterClass","NormalizeBlock","constructor","name","Neutral","registerInput","AutoDetect","registerOutput","BasedOnInput","_outputs","_typeConnectionSource","_inputs","excludedConnectionPointTypes","push","Float","Matrix","getClassName","input","output","_buildBlock","state","compilationString","_declareOutput","associatedVariableName"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@babylonjs/core/Materials/Node/Blocks/normalizeBlock.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 normalize a vector\n */\nexport class NormalizeBlock extends NodeMaterialBlock {\n /**\n * Creates a new NormalizeBlock\n * @param name defines the block name\n */\n constructor(name) {\n super(name, NodeMaterialBlockTargets.Neutral);\n this.registerInput(\"input\", NodeMaterialBlockConnectionPointTypes.AutoDetect);\n this.registerOutput(\"output\", NodeMaterialBlockConnectionPointTypes.BasedOnInput);\n this._outputs[0]._typeConnectionSource = this._inputs[0];\n this._inputs[0].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Float);\n this._inputs[0].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Matrix);\n }\n /**\n * Gets the current class name\n * @returns the class name\n */\n getClassName() {\n return \"NormalizeBlock\";\n }\n /**\n * Gets the input component\n */\n get input() {\n return this._inputs[0];\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 input = this._inputs[0];\n state.compilationString += state._declareOutput(output) + ` = normalize(${input.associatedVariableName});\\n`;\n return this;\n }\n}\nRegisterClass(\"BABYLON.NormalizeBlock\", NormalizeBlock);\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,cAAc,SAASJ,iBAAiB,CAAC;EAClD;AACJ;AACA;AACA;EACIK,WAAWA,CAACC,IAAI,EAAE;IACd,KAAK,CAACA,IAAI,EAAEJ,wBAAwB,CAACK,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