1 |
- {"ast":null,"code":"import { NodeGeometryBlock } from \"../../nodeGeometryBlock.js\";\nimport { RegisterClass } from \"../../../../Misc/typeStore.js\";\nimport { NodeGeometryBlockConnectionPointTypes } from \"../../Enums/nodeGeometryConnectionPointTypes.js\";\nimport { GeometryInputBlock } from \"../geometryInputBlock.js\";\nimport { Matrix, Vector3 } from \"../../../../Maths/math.vector.js\";\n/**\n * Block used to get a translation matrix\n */\nexport class TranslationBlock extends NodeGeometryBlock {\n /**\n * Create a new TranslationBlock\n * @param name defines the block name\n */\n constructor(name) {\n super(name);\n this.registerInput(\"translation\", NodeGeometryBlockConnectionPointTypes.Vector3, false, Vector3.Zero());\n this.registerOutput(\"matrix\", NodeGeometryBlockConnectionPointTypes.Matrix);\n }\n /**\n * Gets the current class name\n * @returns the class name\n */\n getClassName() {\n return \"TranslationBlock\";\n }\n /**\n * Gets the translation input component\n */\n get translation() {\n return this._inputs[0];\n }\n /**\n * Gets the matrix output component\n */\n get matrix() {\n return this._outputs[0];\n }\n autoConfigure() {\n if (!this.translation.isConnected) {\n const translationInput = new GeometryInputBlock(\"Translation\");\n translationInput.value = new Vector3(0, 0, 0);\n translationInput.output.connectTo(this.translation);\n }\n }\n _buildBlock(state) {\n super._buildBlock(state);\n this.matrix._storedFunction = state => {\n const value = this.translation.getConnectedValue(state);\n return Matrix.Translation(value.x, value.y, value.z);\n };\n }\n}\nRegisterClass(\"BABYLON.TranslationBlock\", TranslationBlock);","map":{"version":3,"names":["NodeGeometryBlock","RegisterClass","NodeGeometryBlockConnectionPointTypes","GeometryInputBlock","Matrix","Vector3","TranslationBlock","constructor","name","registerInput","Zero","registerOutput","getClassName","translation","_inputs","matrix","_outputs","autoConfigure","isConnected","translationInput","value","output","connectTo","_buildBlock","state","_storedFunction","getConnectedValue","Translation","x","y","z"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@babylonjs/core/Meshes/Node/Blocks/Matrices/translationBlock.js"],"sourcesContent":["import { NodeGeometryBlock } from \"../../nodeGeometryBlock.js\";\nimport { RegisterClass } from \"../../../../Misc/typeStore.js\";\nimport { NodeGeometryBlockConnectionPointTypes } from \"../../Enums/nodeGeometryConnectionPointTypes.js\";\nimport { GeometryInputBlock } from \"../geometryInputBlock.js\";\nimport { Matrix, Vector3 } from \"../../../../Maths/math.vector.js\";\n/**\n * Block used to get a translation matrix\n */\nexport class TranslationBlock extends NodeGeometryBlock {\n /**\n * Create a new TranslationBlock\n * @param name defines the block name\n */\n constructor(name) {\n super(name);\n this.registerInput(\"translation\", NodeGeometryBlockConnectionPointTypes.Vector3, false, Vector3.Zero());\n this.registerOutput(\"matrix\", NodeGeometryBlockConnectionPointTypes.Matrix);\n }\n /**\n * Gets the current class name\n * @returns the class name\n */\n getClassName() {\n return \"TranslationBlock\";\n }\n /**\n * Gets the translation input component\n */\n get translation() {\n return this._inputs[0];\n }\n /**\n * Gets the matrix output component\n */\n get matrix() {\n return this._outputs[0];\n }\n autoConfigure() {\n if (!this.translation.isConnected) {\n const translationInput = new GeometryInputBlock(\"Translation\");\n translationInput.value = new Vector3(0, 0, 0);\n translationInput.output.connectTo(this.translation);\n }\n }\n _buildBlock(state) {\n super._buildBlock(state);\n this.matrix._storedFunction = (state) => {\n const value = this.translation.getConnectedValue(state);\n return Matrix.Translation(value.x, value.y, value.z);\n };\n }\n}\nRegisterClass(\"BABYLON.TranslationBlock\", TranslationBlock);\n"],"mappings":"AAAA,SAASA,iBAAiB,QAAQ,4BAA4B;AAC9D,SAASC,aAAa,QAAQ,+BAA+B;AAC7D,SAASC,qCAAqC,QAAQ,iDAAiD;AACvG,SAASC,kBAAkB,QAAQ,0BAA0B;AAC7D,SAASC,MAAM,EAAEC,OAAO,QAAQ,kCAAkC;AAClE;AACA;AACA;AACA,OAAO,MAAMC,gBAAgB,SAASN,iBAAiB,CAAC;EACpD;AACJ;AACA;AACA;EACIO,WAAWA,CAACC,IAAI,EAAE;IACd,KAAK,CAACA,IAAI,CAAC;IACX,IAAI,CAACC,aAAa,C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