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 cross product between 2 vectors\n */\nexport class CrossBlock extends NodeMaterialBlock {\n /**\n * Creates a new CrossBlock\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.Vector3);\n this._linkConnectionTypes(0, 1);\n this._inputs[0].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Float);\n this._inputs[0].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Matrix);\n this._inputs[0].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Vector2);\n this._inputs[1].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Float);\n this._inputs[1].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Matrix);\n this._inputs[1].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Vector2);\n }\n /**\n * Gets the current class name\n * @returns the class name\n */\n getClassName() {\n return \"CrossBlock\";\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) + ` = cross(${this.left.associatedVariableName}.xyz, ${this.right.associatedVariableName}.xyz);\\n`;\n return this;\n }\n}\nRegisterClass(\"BABYLON.CrossBlock\", CrossBlock);","map":{"version":3,"names":["NodeMaterialBlock","NodeMaterialBlockConnectionPointTypes","NodeMaterialBlockTargets","RegisterClass","CrossBlock","constructor","name","Neutral","registerInput","AutoDetect","registerOutput","Vector3","_linkConnectionTypes","_inputs","excludedConnectionPointTypes","push","Float","Matrix","Vector2","getClassName","left","right","output","_outputs","_buildBlock","state","compilationString","_declareOutput","associatedVariableName"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@babylonjs/core/Materials/Node/Blocks/crossBlock.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 cross product between 2 vectors\n */\nexport class CrossBlock extends NodeMaterialBlock {\n /**\n * Creates a new CrossBlock\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.Vector3);\n this._linkConnectionTypes(0, 1);\n this._inputs[0].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Float);\n this._inputs[0].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Matrix);\n this._inputs[0].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Vector2);\n this._inputs[1].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Float);\n this._inputs[1].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Matrix);\n this._inputs[1].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Vector2);\n }\n /**\n * Gets the current class name\n * @returns the class name\n */\n getClassName() {\n return \"CrossBlock\";\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) + ` = cross(${this.left.associatedVariableName}.xyz, ${this.right.associatedVariableName}.xyz);\\n`;\n return this;\n }\n}\nRegisterClass(\"BABYLON.CrossBlock\", CrossBlock);\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,UAAU,SAASJ,iBAAiB,CAAC;EAC9C;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,OAAO,CAAC;IAC5E,IAAI,CAACC,oBAAoB,CAAC,CAAC,EAAE,CAAC,CAAC;IAC/B,IAAI,CAACC,OAAO,CAAC,CAAC,CAAC,CAACC,4BAA4B,CAACC,IAAI,CAACd,qCAAqC,CAACe,KAAK,CAAC;IAC9F,IAAI,CAACH,OAAO,CAAC,CAAC,CAAC,CAACC,4BAA4B,CAACC,IAAI,CAACd,qCAAqC,CAACgB,MAAM,CAAC;IAC/F,IAAI,CAACJ,OAAO,CAAC,CAAC,CAAC,CAACC,4BAA4B,CAACC,IAAI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