1 |
- {"ast":null,"code":"import { Vector2ToFixed, Vector3ToFixed, Vector4ToFixed } from \"../../../Maths/math.vector.functions.js\";\nimport { RegisterClass } from \"../../../Misc/typeStore.js\";\nimport { NodeGeometryBlockConnectionPointTypes } from \"../Enums/nodeGeometryConnectionPointTypes.js\";\nimport { NodeGeometryBlock } from \"../nodeGeometryBlock.js\";\n/**\n * Defines a block used to debug values going through it\n */\nexport class DebugBlock extends NodeGeometryBlock {\n /**\n * Create a new DebugBlock\n * @param name defines the block name\n */\n constructor(name) {\n super(name);\n /**\n * Gets the log entries\n */\n this.log = [];\n this._isDebug = true;\n this.registerInput(\"input\", NodeGeometryBlockConnectionPointTypes.AutoDetect);\n this.registerOutput(\"output\", NodeGeometryBlockConnectionPointTypes.BasedOnInput);\n this._outputs[0]._typeConnectionSource = this._inputs[0];\n this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Geometry);\n this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Texture);\n }\n /**\n * Gets the time spent to build this block (in ms)\n */\n get buildExecutionTime() {\n return -1;\n }\n /**\n * Gets the current class name\n * @returns the class name\n */\n getClassName() {\n return \"DebugBlock\";\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 if (!this.input.isConnected) {\n this.output._storedFunction = null;\n this.output._storedValue = null;\n return;\n }\n this.log = [];\n const func = state => {\n const input = this.input.getConnectedValue(state);\n if (input === null || input === undefined) {\n this.log.push([\"null\", \"\"]);\n return input;\n }\n switch (this.input.type) {\n case NodeGeometryBlockConnectionPointTypes.Vector2:\n this.log.push([Vector2ToFixed(input, 4), input.toString()]);\n break;\n case NodeGeometryBlockConnectionPointTypes.Vector3:\n this.log.push([Vector3ToFixed(input, 4), input.toString()]);\n break;\n case NodeGeometryBlockConnectionPointTypes.Vector4:\n this.log.push([Vector4ToFixed(input, 4), input.toString()]);\n break;\n default:\n this.log.push([input.toString(), input.toString()]);\n break;\n }\n return input;\n };\n if (this.output.isConnected) {\n this.output._storedFunction = func;\n } else {\n this.output._storedValue = func(state);\n }\n }\n}\nRegisterClass(\"BABYLON.DebugBlock\", DebugBlock);","map":{"version":3,"names":["Vector2ToFixed","Vector3ToFixed","Vector4ToFixed","RegisterClass","NodeGeometryBlockConnectionPointTypes","NodeGeometryBlock","DebugBlock","constructor","name","log","_isDebug","registerInput","AutoDetect","registerOutput","BasedOnInput","_outputs","_typeConnectionSource","_inputs","excludedConnectionPointTypes","push","Geometry","Texture","buildExecutionTime","getClassName","input","output","_buildBlock","state","isConnected","_storedFunction","_storedValue","func","getConnectedValue","undefined","type","Vector2","toString","Vector3","Vector4"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@babylonjs/core/Meshes/Node/Blocks/debugBlock.js"],"sourcesContent":["import { Vector2ToFixed, Vector3ToFixed, Vector4ToFixed } from \"../../../Maths/math.vector.functions.js\";\nimport { RegisterClass } from \"../../../Misc/typeStore.js\";\nimport { NodeGeometryBlockConnectionPointTypes } from \"../Enums/nodeGeometryConnectionPointTypes.js\";\nimport { NodeGeometryBlock } from \"../nodeGeometryBlock.js\";\n/**\n * Defines a block used to debug values going through it\n */\nexport class DebugBlock extends NodeGeometryBlock {\n /**\n * Create a new DebugBlock\n * @param name defines the block name\n */\n constructor(name) {\n super(name);\n /**\n * Gets the log entries\n */\n this.log = [];\n this._isDebug = true;\n this.registerInput(\"input\", NodeGeometryBlockConnectionPointTypes.AutoDetect);\n this.registerOutput(\"output\", NodeGeometryBlockConnectionPointTypes.BasedOnInput);\n this._outputs[0]._typeConnectionSource = this._inputs[0];\n this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Geometry);\n this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Texture);\n }\n /**\n * Gets the time spent to build this block (in ms)\n */\n get buildExecutionTime() {\n return -1;\n }\n /**\n * Gets the current class name\n * @returns the class name\n */\n getClassName() {\n return \"DebugBlock\";\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 if (!this.input.isConnected) {\n this.output._storedFunction = null;\n this.output._storedValue = null;\n return;\n }\n this.log = [];\n const func = (state) => {\n const input = this.input.getConnectedValue(state);\n if (input === null || input === undefined) {\n this.log.push([\"null\", \"\"]);\n return input;\n }\n switch (this.input.type) {\n case NodeGeometryBlockConnectionPointTypes.Vector2:\n this.log.push([Vector2ToFixed(input, 4), input.toString()]);\n break;\n case NodeGeometryBlockConnectionPointTypes.Vector3:\n this.log.push([Vector3ToFixed(input, 4), input.toString()]);\n break;\n case NodeGeometryBlockConnectionPointTypes.Vector4:\n this.log.push([Vector4ToFixed(input, 4), input.toString()]);\n break;\n default:\n this.log.push([input.toString(), input.toString()]);\n break;\n }\n return input;\n };\n if (this.output.isConnected) {\n this.output._storedFunction = func;\n }\n else {\n this.output._storedValue = func(state);\n }\n }\n}\nRegisterClass(\"BABYLON.DebugBlock\", DebugBlock);\n"],"mappings":"AAAA,SAASA,cAAc,EAAEC,cAAc,EAAEC,cAAc,QAAQ,yCAAyC;AACxG,SAASC,aAAa,QAAQ,4BAA4B;AAC1D,SAASC,qCAAqC,QAAQ,8CAA8C;AACpG,SAASC,iBAAiB,QAAQ,yBAAyB;AAC3D;AACA;AACA;AACA,OAAO,MAAMC,UAAU,SAASD,iBAAiB,CAAC;EAC9C;AACJ;AACA;AACA;EACIE,WAAWA,CAACC,IAAI,EAAE;IACd,KAAK,CAACA,IAAI,CAAC;IACX;AACR;AACA;IACQ,IAAI,CAACC,GAAG,GAAG,EAAE;IACb,IAAI,CAACC,QAAQ,GAAG,IAAI;IACpB,IAAI,CAACC,aAAa,CAAC,OAAO,EAAEP,qCAAqC,CAACQ,UAAU,CAAC;IAC7E,IAAI,CAACC,cAAc,CAAC,QAAQ,EA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