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 apply a dot product between 2 vectors\n */\nexport class GeometryDotBlock extends NodeGeometryBlock {\n /**\n * Creates a new GeometryDotBlock\n * @param name defines the block name\n */\n constructor(name) {\n super(name);\n this.registerInput(\"left\", NodeGeometryBlockConnectionPointTypes.AutoDetect);\n this.registerInput(\"right\", NodeGeometryBlockConnectionPointTypes.AutoDetect);\n this.registerOutput(\"output\", NodeGeometryBlockConnectionPointTypes.Float);\n this._linkConnectionTypes(0, 1);\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 this._inputs[1].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Float);\n this._inputs[1].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Matrix);\n }\n /**\n * Gets the current class name\n * @returns the class name\n */\n getClassName() {\n return \"GeometryDotBlock\";\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() {\n if (!this.left.isConnected || !this.right.isConnected) {\n this.output._storedFunction = null;\n this.output._storedValue = null;\n return;\n }\n this.output._storedFunction = state => {\n const left = this.left.getConnectedValue(state);\n const right = this.right.getConnectedValue(state);\n return left.dot(right);\n };\n return this;\n }\n}\nRegisterClass(\"BABYLON.GeometryDotBlock\", GeometryDotBlock);","map":{"version":3,"names":["RegisterClass","NodeGeometryBlockConnectionPointTypes","NodeGeometryBlock","GeometryDotBlock","constructor","name","registerInput","AutoDetect","registerOutput","Float","_linkConnectionTypes","_inputs","excludedConnectionPointTypes","push","Int","Matrix","getClassName","left","right","output","_outputs","_buildBlock","isConnected","_storedFunction","_storedValue","state","getConnectedValue","dot"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@babylonjs/core/Meshes/Node/Blocks/geometryDotBlock.js"],"sourcesContent":["import { RegisterClass } from \"../../../Misc/typeStore.js\";\nimport { NodeGeometryBlockConnectionPointTypes } from \"../Enums/nodeGeometryConnectionPointTypes.js\";\nimport { NodeGeometryBlock } from \"../nodeGeometryBlock.js\";\n/**\n * Block used to apply a dot product between 2 vectors\n */\nexport class GeometryDotBlock extends NodeGeometryBlock {\n /**\n * Creates a new GeometryDotBlock\n * @param name defines the block name\n */\n constructor(name) {\n super(name);\n this.registerInput(\"left\", NodeGeometryBlockConnectionPointTypes.AutoDetect);\n this.registerInput(\"right\", NodeGeometryBlockConnectionPointTypes.AutoDetect);\n this.registerOutput(\"output\", NodeGeometryBlockConnectionPointTypes.Float);\n this._linkConnectionTypes(0, 1);\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 this._inputs[1].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Float);\n this._inputs[1].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Matrix);\n }\n /**\n * Gets the current class name\n * @returns the class name\n */\n getClassName() {\n return \"GeometryDotBlock\";\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() {\n if (!this.left.isConnected || !this.right.isConnected) {\n this.output._storedFunction = null;\n this.output._storedValue = null;\n return;\n }\n this.output._storedFunction = (state) => {\n const left = this.left.getConnectedValue(state);\n const right = this.right.getConnectedValue(state);\n return left.dot(right);\n };\n return this;\n }\n}\nRegisterClass(\"BABYLON.GeometryDotBlock\", GeometryDotBlock);\n"],"mappings":"AAAA,SAASA,aAAa,QAAQ,4BAA4B;AAC1D,SAASC,qCAAqC,QAAQ,8CAA8C;AACpG,SAASC,iBAAiB,QAAQ,yBAAyB;AAC3D;AACA;AACA;AACA,OAAO,MAAMC,gBAAgB,SAASD,iBAAiB,CAAC;EACpD;AACJ;AACA;AACA;EACIE,WAAWA,CAACC,IAAI,EAAE;IACd,KAAK,CAACA,IAAI,CAAC;IACX,IAAI,CAACC,aAAa,CAAC,MAAM,EAAEL,qCAAqC,CAACM,UAAU,CAAC;IAC5E,IAAI,CAACD,aAAa,CAAC,OAAO,EAAEL,qCAAqC,CAACM,UAAU,CAAC;IAC7E,IAAI,CAACC,cAAc,CAAC,QAAQ,EAAEP,qCAAqC,CAACQ,KAAK,CAAC;IAC1E,IAAI,CAACC,oBAAoB,CAAC,CAAC,EAAE,CAAC,CAAC;IAC/B,IAAI,CAACC,OAAO,CAAC,CAAC,CAAC,CAACC,4BAA4B,CAACC,IAAI,CAACZ,qCAAqC,CAACa,GAAG,CAAC;IAC5F,IAAI,CAACH,OAAO,CAAC,CAAC,CAAC,CAACC,4BAA4B,CAACC,IAAI,CAACZ,qCAAqC,CAACQ,KAAK,CAAC;IAC9F,IAAI,CAACE,OAAO,CAAC,CAAC,CAAC,CAACC,4BAA4B,CAACC,IAAI,CAACZ,qCAAqC,CAACc,MAAM,CAAC;IAC/F,IAAI,CAACJ,OAAO,CAAC,CAAC,CAAC,CAACC,4BAA4B,CAACC,IAAI,CAACZ,qCAAqC,CAACQ,KAAK,CAAC;IAC9F,IAAI,CAACE,OAAO,CAAC,CAAC,CAAC,CAACC,4BAA4B,CAACC,IAAI,CAACZ,qCAAqC,CAACc,MAAM,CAAC;EACnG;EACA;AAC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