{"ast":null,"code":"import { NodeGeometryBlock } from \"../../nodeGeometryBlock.js\";\nimport { RegisterClass } from \"../../../../Misc/typeStore.js\";\nimport { NodeGeometryBlockConnectionPointTypes } from \"../../Enums/nodeGeometryConnectionPointTypes.js\";\nimport { Matrix, Vector3 } from \"../../../../Maths/math.vector.js\";\n/**\n * Block used to get a align matrix\n */\nexport class AlignBlock extends NodeGeometryBlock {\n /**\n * Create a new AlignBlock\n * @param name defines the block name\n */\n constructor(name) {\n super(name);\n this.registerInput(\"source\", NodeGeometryBlockConnectionPointTypes.Vector3, true, Vector3.Up());\n this.registerInput(\"target\", NodeGeometryBlockConnectionPointTypes.Vector3, true, Vector3.Left());\n this.registerOutput(\"matrix\", NodeGeometryBlockConnectionPointTypes.Matrix);\n }\n /**\n * Gets the current class name\n * @returns the class name\n */\n getClassName() {\n return \"AlignBlock\";\n }\n /**\n * Gets the source input component\n */\n get source() {\n return this._inputs[0];\n }\n /**\n * Gets the target input component\n */\n get target() {\n return this._inputs[1];\n }\n /**\n * Gets the matrix output component\n */\n get matrix() {\n return this._outputs[0];\n }\n _buildBlock(state) {\n super._buildBlock(state);\n this.matrix._storedFunction = state => {\n const source = this.source.getConnectedValue(state).clone();\n const target = this.target.getConnectedValue(state).clone();\n const result = new Matrix();\n source.normalize();\n target.normalize();\n Matrix.RotationAlignToRef(source, target, result, true);\n return result;\n };\n }\n}\nRegisterClass(\"BABYLON.AlignBlock\", AlignBlock);","map":{"version":3,"names":["NodeGeometryBlock","RegisterClass","NodeGeometryBlockConnectionPointTypes","Matrix","Vector3","AlignBlock","constructor","name","registerInput","Up","Left","registerOutput","getClassName","source","_inputs","target","matrix","_outputs","_buildBlock","state","_storedFunction","getConnectedValue","clone","result","normalize","RotationAlignToRef"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@babylonjs/core/Meshes/Node/Blocks/Matrices/alignBlock.js"],"sourcesContent":["import { NodeGeometryBlock } from \"../../nodeGeometryBlock.js\";\nimport { RegisterClass } from \"../../../../Misc/typeStore.js\";\nimport { NodeGeometryBlockConnectionPointTypes } from \"../../Enums/nodeGeometryConnectionPointTypes.js\";\nimport { Matrix, Vector3 } from \"../../../../Maths/math.vector.js\";\n/**\n * Block used to get a align matrix\n */\nexport class AlignBlock extends NodeGeometryBlock {\n /**\n * Create a new AlignBlock\n * @param name defines the block name\n */\n constructor(name) {\n super(name);\n this.registerInput(\"source\", NodeGeometryBlockConnectionPointTypes.Vector3, true, Vector3.Up());\n this.registerInput(\"target\", NodeGeometryBlockConnectionPointTypes.Vector3, true, Vector3.Left());\n this.registerOutput(\"matrix\", NodeGeometryBlockConnectionPointTypes.Matrix);\n }\n /**\n * Gets the current class name\n * @returns the class name\n */\n getClassName() {\n return \"AlignBlock\";\n }\n /**\n * Gets the source input component\n */\n get source() {\n return this._inputs[0];\n }\n /**\n * Gets the target input component\n */\n get target() {\n return this._inputs[1];\n }\n /**\n * Gets the matrix output component\n */\n get matrix() {\n return this._outputs[0];\n }\n _buildBlock(state) {\n super._buildBlock(state);\n this.matrix._storedFunction = (state) => {\n const source = this.source.getConnectedValue(state).clone();\n const target = this.target.getConnectedValue(state).clone();\n const result = new Matrix();\n source.normalize();\n target.normalize();\n Matrix.RotationAlignToRef(source, target, result, true);\n return result;\n };\n }\n}\nRegisterClass(\"BABYLON.AlignBlock\", AlignBlock);\n"],"mappings":"AAAA,SAASA,iBAAiB,QAAQ,4BAA4B;AAC9D,SAASC,aAAa,QAAQ,+BAA+B;AAC7D,SAASC,qCAAqC,QAAQ,iDAAiD;AACvG,SAASC,MAAM,EAAEC,OAAO,QAAQ,kCAAkC;AAClE;AACA;AACA;AACA,OAAO,MAAMC,UAAU,SAASL,iBAAiB,CAAC;EAC9C;AACJ;AACA;AACA;EACIM,WAAWA,CAACC,IAAI,EAAE;IACd,KAAK,CAACA,IAAI,CAAC;IACX,IAAI,CAACC,aAAa,CAAC,QAAQ,EAAEN,qCAAqC,CAACE,OAAO,EAAE,IAAI,EAAEA,OAAO,CAACK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