324af417e1759c8cc56f52018a23b4bf11c0133351c753678dc1b54ad2d3ef36.json 6.5 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 get the reflected vector from a direction and a normal\n */\nexport class ReflectBlock extends NodeMaterialBlock {\n /**\n * Creates a new ReflectBlock\n * @param name defines the block name\n */\n constructor(name) {\n super(name, NodeMaterialBlockTargets.Neutral);\n this.registerInput(\"incident\", NodeMaterialBlockConnectionPointTypes.AutoDetect);\n this.registerInput(\"normal\", NodeMaterialBlockConnectionPointTypes.AutoDetect);\n this.registerOutput(\"output\", NodeMaterialBlockConnectionPointTypes.Vector3);\n this._inputs[0].addExcludedConnectionPointFromAllowedTypes(NodeMaterialBlockConnectionPointTypes.Vector3 | NodeMaterialBlockConnectionPointTypes.Vector4 | NodeMaterialBlockConnectionPointTypes.Color3 | NodeMaterialBlockConnectionPointTypes.Color4);\n this._inputs[1].addExcludedConnectionPointFromAllowedTypes(NodeMaterialBlockConnectionPointTypes.Vector3 | NodeMaterialBlockConnectionPointTypes.Vector4 | NodeMaterialBlockConnectionPointTypes.Color3 | NodeMaterialBlockConnectionPointTypes.Color4);\n }\n /**\n * Gets the current class name\n * @returns the class name\n */\n getClassName() {\n return \"ReflectBlock\";\n }\n /**\n * Gets the incident component\n */\n get incident() {\n return this._inputs[0];\n }\n /**\n * Gets the normal component\n */\n get normal() {\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) + ` = reflect(${this.incident.associatedVariableName}.xyz, ${this.normal.associatedVariableName}.xyz);\\n`;\n return this;\n }\n}\nRegisterClass(\"BABYLON.ReflectBlock\", ReflectBlock);","map":{"version":3,"names":["NodeMaterialBlock","NodeMaterialBlockConnectionPointTypes","NodeMaterialBlockTargets","RegisterClass","ReflectBlock","constructor","name","Neutral","registerInput","AutoDetect","registerOutput","Vector3","_inputs","addExcludedConnectionPointFromAllowedTypes","Vector4","Color3","Color4","getClassName","incident","normal","output","_outputs","_buildBlock","state","compilationString","_declareOutput","associatedVariableName"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@babylonjs/core/Materials/Node/Blocks/reflectBlock.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 get the reflected vector from a direction and a normal\n */\nexport class ReflectBlock extends NodeMaterialBlock {\n /**\n * Creates a new ReflectBlock\n * @param name defines the block name\n */\n constructor(name) {\n super(name, NodeMaterialBlockTargets.Neutral);\n this.registerInput(\"incident\", NodeMaterialBlockConnectionPointTypes.AutoDetect);\n this.registerInput(\"normal\", NodeMaterialBlockConnectionPointTypes.AutoDetect);\n this.registerOutput(\"output\", NodeMaterialBlockConnectionPointTypes.Vector3);\n this._inputs[0].addExcludedConnectionPointFromAllowedTypes(NodeMaterialBlockConnectionPointTypes.Vector3 |\n NodeMaterialBlockConnectionPointTypes.Vector4 |\n NodeMaterialBlockConnectionPointTypes.Color3 |\n NodeMaterialBlockConnectionPointTypes.Color4);\n this._inputs[1].addExcludedConnectionPointFromAllowedTypes(NodeMaterialBlockConnectionPointTypes.Vector3 |\n NodeMaterialBlockConnectionPointTypes.Vector4 |\n NodeMaterialBlockConnectionPointTypes.Color3 |\n NodeMaterialBlockConnectionPointTypes.Color4);\n }\n /**\n * Gets the current class name\n * @returns the class name\n */\n getClassName() {\n return \"ReflectBlock\";\n }\n /**\n * Gets the incident component\n */\n get incident() {\n return this._inputs[0];\n }\n /**\n * Gets the normal component\n */\n get normal() {\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) + ` = reflect(${this.incident.associatedVariableName}.xyz, ${this.normal.associatedVariableName}.xyz);\\n`;\n return this;\n }\n}\nRegisterClass(\"BABYLON.ReflectBlock\", ReflectBlock);\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,KAAK,CAACA,IAAI,EAAEJ,wBAAwB,CAACK,OAAO,CAAC;IAC7C,IAAI,CAACC,aAAa,CAAC,UAAU,EAAEP,qCAAqC,CAACQ,UAAU,CAAC;IAChF,IAAI,CAACD,aAAa,CAAC,QAAQ,EAAEP,qCAAqC,CAACQ,UAAU,CAAC;IAC9E,IAAI,CAACC,cAAc,CAAC,QAAQ,EAAET,qCAAqC,CAACU,OAAO,CAAC;IAC5E,IAAI,CAACC,OAAO,CAAC,CAAC,CAAC,CAACC,0CAA0C,CAACZ,qCAAqC,CAACU,OAAO,GACpGV,qCAAqC,CAACa,OAAO,GAC7Cb,qCAAqC,CAACc,MAAM,GAC5Cd,qCAAqC,CAACe,MAAM,CAAC;IACjD,IAAI,CAACJ,OAAO,CAAC,CAAC,CAAC,CAACC,0CAA0C,CAACZ,qCAAqC,CAACU,OAAO,GACpGV,qCAAqC,CAACa,OAAO,GAC7Cb,qCAAqC,CAACc,MAAM,GAC5Cd,qCAAqC,CAACe,MAAM,CAAC;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