6e11cee5fd10c144aa0561aa1342094c6a3ca00c1b2b5f8539115cd77fef74dd.json 5.3 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 get the length of a vector\n */\nexport class GeometryLengthBlock extends NodeGeometryBlock {\n /**\n * Creates a new GeometryLengthBlock\n * @param name defines the block name\n */\n constructor(name) {\n super(name);\n this.registerInput(\"value\", NodeGeometryBlockConnectionPointTypes.AutoDetect);\n this.registerOutput(\"output\", NodeGeometryBlockConnectionPointTypes.Float);\n this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Int);\n this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Float);\n this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Matrix);\n }\n /**\n * Gets the current class name\n * @returns the class name\n */\n getClassName() {\n return \"GeometryLengthBlock\";\n }\n /**\n * Gets the value input component\n */\n get value() {\n return this._inputs[0];\n }\n /**\n * Gets the output component\n */\n get output() {\n return this._outputs[0];\n }\n _buildBlock() {\n if (!this.value.isConnected) {\n this.output._storedFunction = null;\n this.output._storedValue = null;\n return;\n }\n this.output._storedFunction = state => {\n const value = this.value.getConnectedValue(state);\n return value.length();\n };\n return this;\n }\n}\nRegisterClass(\"BABYLON.GeometryLengthBlock\", GeometryLengthBlock);","map":{"version":3,"names":["RegisterClass","NodeGeometryBlockConnectionPointTypes","NodeGeometryBlock","GeometryLengthBlock","constructor","name","registerInput","AutoDetect","registerOutput","Float","_inputs","excludedConnectionPointTypes","push","Int","Matrix","getClassName","value","output","_outputs","_buildBlock","isConnected","_storedFunction","_storedValue","state","getConnectedValue","length"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@babylonjs/core/Meshes/Node/Blocks/geometryLengthBlock.js"],"sourcesContent":["import { RegisterClass } from \"../../../Misc/typeStore.js\";\nimport { NodeGeometryBlockConnectionPointTypes } from \"../Enums/nodeGeometryConnectionPointTypes.js\";\nimport { NodeGeometryBlock } from \"../nodeGeometryBlock.js\";\n/**\n * Block used to get the length of a vector\n */\nexport class GeometryLengthBlock extends NodeGeometryBlock {\n /**\n * Creates a new GeometryLengthBlock\n * @param name defines the block name\n */\n constructor(name) {\n super(name);\n this.registerInput(\"value\", NodeGeometryBlockConnectionPointTypes.AutoDetect);\n this.registerOutput(\"output\", NodeGeometryBlockConnectionPointTypes.Float);\n this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Int);\n this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Float);\n this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Matrix);\n }\n /**\n * Gets the current class name\n * @returns the class name\n */\n getClassName() {\n return \"GeometryLengthBlock\";\n }\n /**\n * Gets the value input component\n */\n get value() {\n return this._inputs[0];\n }\n /**\n * Gets the output component\n */\n get output() {\n return this._outputs[0];\n }\n _buildBlock() {\n if (!this.value.isConnected) {\n this.output._storedFunction = null;\n this.output._storedValue = null;\n return;\n }\n this.output._storedFunction = (state) => {\n const value = this.value.getConnectedValue(state);\n return value.length();\n };\n return this;\n }\n}\nRegisterClass(\"BABYLON.GeometryLengthBlock\", GeometryLengthBlock);\n"],"mappings":"AAAA,SAASA,aAAa,QAAQ,4BAA4B;AAC1D,SAASC,qCAAqC,QAAQ,8CAA8C;AACpG,SAASC,iBAAiB,QAAQ,yBAAyB;AAC3D;AACA;AACA;AACA,OAAO,MAAMC,mBAAmB,SAASD,iBAAiB,CAAC;EACvD;AACJ;AACA;AACA;EACIE,WAAWA,CAACC,IAAI,EAAE;IACd,KAAK,CAACA,IAAI,CAAC;IACX,IAAI,CAACC,aAAa,CAAC,OAAO,EAAEL,qCAAqC,CAACM,UAAU,CAAC;IAC7E,IAA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