a21d7a97e60b21c001baf1cffd3c7b26d36cbd9e40ff8b71824281f1038ae798.json 5.8 KB

1
  1. {"ast":null,"code":"import { RegisterClass } from \"../../../Misc/typeStore.js\";\nimport { NodeGeometryBlockConnectionPointTypes } from \"../Enums/nodeGeometryConnectionPointTypes.js\";\nimport { NodeGeometryBlock } from \"../nodeGeometryBlock.js\";\n/**\n * Block used to normalize vectors\n */\nexport class NormalizeVectorBlock extends NodeGeometryBlock {\n /**\n * Creates a new NormalizeVectorBlock\n * @param name defines the block name\n */\n constructor(name) {\n super(name);\n this.registerInput(\"input\", NodeGeometryBlockConnectionPointTypes.AutoDetect);\n this.registerOutput(\"output\", NodeGeometryBlockConnectionPointTypes.BasedOnInput);\n this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Float);\n this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Matrix);\n this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Geometry);\n this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Texture);\n this._outputs[0]._typeConnectionSource = this._inputs[0];\n }\n /**\n * Gets the current class name\n * @returns the class name\n */\n getClassName() {\n return \"NormalizeVectorBlock\";\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 this.output._storedFunction = null;\n if (!this.input.isConnected) {\n this.output._storedValue = null;\n return;\n }\n this.output._storedFunction = state => this.input.getConnectedValue(state).normalize();\n }\n}\nRegisterClass(\"BABYLON.NormalizeVectorBlock\", NormalizeVectorBlock);","map":{"version":3,"names":["RegisterClass","NodeGeometryBlockConnectionPointTypes","NodeGeometryBlock","NormalizeVectorBlock","constructor","name","registerInput","AutoDetect","registerOutput","BasedOnInput","_inputs","excludedConnectionPointTypes","push","Float","Matrix","Geometry","Texture","_outputs","_typeConnectionSource","getClassName","input","output","_buildBlock","state","_storedFunction","isConnected","_storedValue","getConnectedValue","normalize"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@babylonjs/core/Meshes/Node/Blocks/normalizeVectorBlock.js"],"sourcesContent":["import { RegisterClass } from \"../../../Misc/typeStore.js\";\nimport { NodeGeometryBlockConnectionPointTypes } from \"../Enums/nodeGeometryConnectionPointTypes.js\";\nimport { NodeGeometryBlock } from \"../nodeGeometryBlock.js\";\n/**\n * Block used to normalize vectors\n */\nexport class NormalizeVectorBlock extends NodeGeometryBlock {\n /**\n * Creates a new NormalizeVectorBlock\n * @param name defines the block name\n */\n constructor(name) {\n super(name);\n this.registerInput(\"input\", NodeGeometryBlockConnectionPointTypes.AutoDetect);\n this.registerOutput(\"output\", NodeGeometryBlockConnectionPointTypes.BasedOnInput);\n this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Float);\n this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Matrix);\n this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Geometry);\n this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Texture);\n this._outputs[0]._typeConnectionSource = this._inputs[0];\n }\n /**\n * Gets the current class name\n * @returns the class name\n */\n getClassName() {\n return \"NormalizeVectorBlock\";\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 this.output._storedFunction = null;\n if (!this.input.isConnected) {\n this.output._storedValue = null;\n return;\n }\n this.output._storedFunction = (state) => this.input.getConnectedValue(state).normalize();\n }\n}\nRegisterClass(\"BABYLON.NormalizeVectorBlock\", NormalizeVectorBlock);\n"],"mappings":"AAAA,SAASA,aAAa,QAAQ,4BAA4B;AAC1D,SAASC,qCAAqC,QAAQ,8CAA8C;AACpG,SAASC,iBAAiB,QAAQ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