09027ca7fc66388ea0a406f5bd7d716af6d87e52cec354f8ea8bfc31e15411b5.json 5.3 KB

1
  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 scaling matrix\n */\nexport class ScalingBlock extends NodeGeometryBlock {\n /**\n * Create a new ScalingBlock\n * @param name defines the block name\n */\n constructor(name) {\n super(name);\n this.registerInput(\"scale\", NodeGeometryBlockConnectionPointTypes.Vector3, false, Vector3.One());\n this.registerOutput(\"matrix\", NodeGeometryBlockConnectionPointTypes.Matrix);\n }\n /**\n * Gets the current class name\n * @returns the class name\n */\n getClassName() {\n return \"ScalingBlock\";\n }\n /**\n * Gets the scale input component\n */\n get scale() {\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.scale.isConnected) {\n const scaleInput = new GeometryInputBlock(\"Scale\");\n scaleInput.value = new Vector3(1, 1, 1);\n scaleInput.output.connectTo(this.scale);\n }\n }\n _buildBlock(state) {\n super._buildBlock(state);\n this.matrix._storedFunction = state => {\n const value = this.scale.getConnectedValue(state);\n return Matrix.Scaling(value.x, value.y, value.z);\n };\n }\n}\nRegisterClass(\"BABYLON.ScalingBlock\", ScalingBlock);","map":{"version":3,"names":["NodeGeometryBlock","RegisterClass","NodeGeometryBlockConnectionPointTypes","GeometryInputBlock","Matrix","Vector3","ScalingBlock","constructor","name","registerInput","One","registerOutput","getClassName","scale","_inputs","matrix","_outputs","autoConfigure","isConnected","scaleInput","value","output","connectTo","_buildBlock","state","_storedFunction","getConnectedValue","Scaling","x","y","z"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@babylonjs/core/Meshes/Node/Blocks/Matrices/scalingBlock.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 scaling matrix\n */\nexport class ScalingBlock extends NodeGeometryBlock {\n /**\n * Create a new ScalingBlock\n * @param name defines the block name\n */\n constructor(name) {\n super(name);\n this.registerInput(\"scale\", NodeGeometryBlockConnectionPointTypes.Vector3, false, Vector3.One());\n this.registerOutput(\"matrix\", NodeGeometryBlockConnectionPointTypes.Matrix);\n }\n /**\n * Gets the current class name\n * @returns the class name\n */\n getClassName() {\n return \"ScalingBlock\";\n }\n /**\n * Gets the scale input component\n */\n get scale() {\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.scale.isConnected) {\n const scaleInput = new GeometryInputBlock(\"Scale\");\n scaleInput.value = new Vector3(1, 1, 1);\n scaleInput.output.connectTo(this.scale);\n }\n }\n _buildBlock(state) {\n super._buildBlock(state);\n this.matrix._storedFunction = (state) => {\n const value = this.scale.getConnectedValue(state);\n return Matrix.Scaling(value.x, value.y, value.z);\n };\n }\n}\nRegisterClass(\"BABYLON.ScalingBlock\", ScalingBlock);\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,YAAY,SAASN,iBAAiB,CAAC;EAChD;AACJ;AACA;AACA;EACIO,WAAWA,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