b29b5ae9409afaadba42e24fc0edd70dd7a2c3518d9667d50ccded1d4f77d320.json 6.3 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 apply a dot product between 2 vectors\n */\nexport class DotBlock extends NodeMaterialBlock {\n /**\n * Creates a new DotBlock\n * @param name defines the block name\n */\n constructor(name) {\n super(name, NodeMaterialBlockTargets.Neutral);\n this.registerInput(\"left\", NodeMaterialBlockConnectionPointTypes.AutoDetect);\n this.registerInput(\"right\", NodeMaterialBlockConnectionPointTypes.AutoDetect);\n this.registerOutput(\"output\", NodeMaterialBlockConnectionPointTypes.Float);\n this._linkConnectionTypes(0, 1);\n this._inputs[0].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Float);\n this._inputs[0].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Matrix);\n this._inputs[1].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Float);\n this._inputs[1].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Matrix);\n }\n /**\n * Gets the current class name\n * @returns the class name\n */\n getClassName() {\n return \"DotBlock\";\n }\n /**\n * Gets the left operand input component\n */\n get left() {\n return this._inputs[0];\n }\n /**\n * Gets the right operand input component\n */\n get right() {\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 state.compilationString += state._declareOutput(output) + ` = dot(${this.left.associatedVariableName}, ${this.right.associatedVariableName});\\n`;\n return this;\n }\n}\nRegisterClass(\"BABYLON.DotBlock\", DotBlock);","map":{"version":3,"names":["NodeMaterialBlock","NodeMaterialBlockConnectionPointTypes","NodeMaterialBlockTargets","RegisterClass","DotBlock","constructor","name","Neutral","registerInput","AutoDetect","registerOutput","Float","_linkConnectionTypes","_inputs","excludedConnectionPointTypes","push","Matrix","getClassName","left","right","output","_outputs","_buildBlock","state","compilationString","_declareOutput","associatedVariableName"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@babylonjs/core/Materials/Node/Blocks/dotBlock.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 apply a dot product between 2 vectors\n */\nexport class DotBlock extends NodeMaterialBlock {\n /**\n * Creates a new DotBlock\n * @param name defines the block name\n */\n constructor(name) {\n super(name, NodeMaterialBlockTargets.Neutral);\n this.registerInput(\"left\", NodeMaterialBlockConnectionPointTypes.AutoDetect);\n this.registerInput(\"right\", NodeMaterialBlockConnectionPointTypes.AutoDetect);\n this.registerOutput(\"output\", NodeMaterialBlockConnectionPointTypes.Float);\n this._linkConnectionTypes(0, 1);\n this._inputs[0].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Float);\n this._inputs[0].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Matrix);\n this._inputs[1].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Float);\n this._inputs[1].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Matrix);\n }\n /**\n * Gets the current class name\n * @returns the class name\n */\n getClassName() {\n return \"DotBlock\";\n }\n /**\n * Gets the left operand input component\n */\n get left() {\n return this._inputs[0];\n }\n /**\n * Gets the right operand input component\n */\n get right() {\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 state.compilationString += state._declareOutput(output) + ` = dot(${this.left.associatedVariableName}, ${this.right.associatedVariableName});\\n`;\n return this;\n }\n}\nRegisterClass(\"BABYLON.DotBlock\", DotBlock);\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,QAAQ,SAASJ,iBAAiB,CAAC;EAC5C;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,UAAU,CAAC;IAC5E,IAAI,CAACD,aAAa,CAAC,OAAO,EAAEP,qCAAqC,CAACQ,UAAU,CAAC;IAC7E,IAAI,CAACC,cAAc,CAAC,QAAQ,EAAET,qCAAqC,CAACU,KAAK,CAAC;IAC1E,IAAI,CAACC,oBAAoB,CAAC,CAAC,EAAE,CAAC,CAAC;IAC/B,IAAI,CAACC,OAAO,CAAC,CAAC,CAAC,CAACC,4BAA4B,CAACC,IAAI,CAACd,qCAAqC,CAACU,KAAK,CAAC;IAC9F,IAAI,CAACE,OAAO,CAAC,CAAC,CAAC,CAACC,4BAA4B,CAACC,IAAI,CAACd,qCAAqC,CAACe,MAAM,CAAC;IAC/F,IAAI,CAACH,OAAO,CAAC,CAAC,CAAC,CAACC,4BAA4B,CAACC,IAAI,CAACd,qCAAqC,CAACU,KAAK,CAAC;IAC9F,IAAI,CAACE,OAAO,CAAC,CAAC,CAAC,CAACC,4BAA4B,CAACC,IAAI,CAACd,qCAAqC,CAACe,MAAM,CAAC;EACnG;EACA;AACJ;AACA;AACA;EACIC,YAAYA,CAAA,EAAG;IACX,OAAO,UAAU;EACrB;EACA;AACJ;AACA;EAC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