8b4ac6c2f1014d882eac552e27c210c4d99a04e8d2904a1fd9355ca9bca94b45.json 12 KB

1
  1. {"ast":null,"code":"import { RegisterClass } from \"../../../../Misc/typeStore.js\";\nimport { NodeMaterialBlock } from \"../../nodeMaterialBlock.js\";\nimport { NodeMaterialBlockConnectionPointTypes } from \"../../Enums/nodeMaterialBlockConnectionPointTypes.js\";\nimport { NodeMaterialBlockTargets } from \"../../Enums/nodeMaterialBlockTargets.js\";\n/**\n * Defines a block used to receive a value from a teleport entry point\n */\nexport class NodeMaterialTeleportOutBlock extends NodeMaterialBlock {\n /**\n * Create a new TeleportOutBlock\n * @param name defines the block name\n */\n constructor(name) {\n super(name, NodeMaterialBlockTargets.Neutral);\n /** @internal */\n this._entryPoint = null;\n /** @internal */\n this._tempEntryPointUniqueId = null;\n this.registerOutput(\"output\", NodeMaterialBlockConnectionPointTypes.BasedOnInput);\n }\n /**\n * Gets the entry point\n */\n get entryPoint() {\n return this._entryPoint;\n }\n /**\n * Gets the current class name\n * @returns the class name\n */\n getClassName() {\n return \"NodeMaterialTeleportOutBlock\";\n }\n /**\n * Gets the output component\n */\n get output() {\n return this._outputs[0];\n }\n /**\n * Gets or sets the target of the block\n */\n get target() {\n return this._entryPoint ? this._entryPoint.target : this._target;\n }\n set target(value) {\n if ((this._target & value) !== 0) {\n return;\n }\n this._target = value;\n }\n /** Detach from entry point */\n detach() {\n if (!this._entryPoint) {\n return;\n }\n this._entryPoint.detachFromEndpoint(this);\n }\n _buildBlock(state) {\n super._buildBlock(state);\n if (this.entryPoint) {\n state.compilationString += state._declareOutput(this.output) + ` = ${this.entryPoint.input.associatedVariableName};\\n`;\n }\n }\n /**\n * Clone the current block to a new identical block\n * @param scene defines the hosting scene\n * @param rootUrl defines the root URL to use to load textures and relative dependencies\n * @returns a copy of the current block\n */\n clone(scene, rootUrl = \"\") {\n const clone = super.clone(scene, rootUrl);\n if (this.entryPoint) {\n this.entryPoint.attachToEndpoint(clone);\n }\n return clone;\n }\n _customBuildStep(state, activeBlocks) {\n if (this.entryPoint) {\n this.entryPoint.build(state, activeBlocks);\n }\n }\n _dumpCode(uniqueNames, alreadyDumped) {\n let codeString = \"\";\n if (this.entryPoint) {\n if (alreadyDumped.indexOf(this.entryPoint) === -1) {\n codeString += this.entryPoint._dumpCode(uniqueNames, alreadyDumped);\n }\n }\n return codeString + super._dumpCode(uniqueNames, alreadyDumped);\n }\n _dumpCodeForOutputConnections(alreadyDumped) {\n let codeString = super._dumpCodeForOutputConnections(alreadyDumped);\n if (this.entryPoint) {\n codeString += this.entryPoint._dumpCodeForOutputConnections(alreadyDumped);\n }\n return codeString;\n }\n _dumpPropertiesCode() {\n let codeString = super._dumpPropertiesCode();\n if (this.entryPoint) {\n codeString += `${this.entryPoint._codeVariableName}.attachToEndpoint(${this._codeVariableName});\\n`;\n }\n return codeString;\n }\n /**\n * Serializes this block in a JSON representation\n * @returns the serialized block object\n */\n serialize() {\n var _this$entryPoint$uniq, _this$entryPoint;\n const serializationObject = super.serialize();\n serializationObject.entryPoint = (_this$entryPoint$uniq = (_this$entryPoint = this.entryPoint) === null || _this$entryPoint === void 0 ? void 0 : _this$entryPoint.uniqueId) !== null && _this$entryPoint$uniq !== void 0 ? _this$entryPoint$uniq : \"\";\n return serializationObject;\n }\n _deserialize(serializationObject, scene, rootUrl) {\n super._deserialize(serializationObject, scene, rootUrl);\n this._tempEntryPointUniqueId = serializationObject.entryPoint;\n }\n}\nRegisterClass(\"BABYLON.NodeMaterialTeleportOutBlock\", NodeMaterialTeleportOutBlock);","map":{"version":3,"names":["RegisterClass","NodeMaterialBlock","NodeMaterialBlockConnectionPointTypes","NodeMaterialBlockTargets","NodeMaterialTeleportOutBlock","constructor","name","Neutral","_entryPoint","_tempEntryPointUniqueId","registerOutput","BasedOnInput","entryPoint","getClassName","output","_outputs","target","_target","value","detach","detachFromEndpoint","_buildBlock","state","compilationString","_declareOutput","input","associatedVariableName","clone","scene","rootUrl","attachToEndpoint","_customBuildStep","activeBlocks","build","_dumpCode","uniqueNames","alreadyDumped","codeString","indexOf","_dumpCodeForOutputConnections","_dumpPropertiesCode","_codeVariableName","serialize","_this$entryPoint$uniq","_this$entryPoint","serializationObject","uniqueId","_deserialize"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@babylonjs/core/Materials/Node/Blocks/Teleport/teleportOutBlock.js"],"sourcesContent":["import { RegisterClass } from \"../../../../Misc/typeStore.js\";\nimport { NodeMaterialBlock } from \"../../nodeMaterialBlock.js\";\nimport { NodeMaterialBlockConnectionPointTypes } from \"../../Enums/nodeMaterialBlockConnectionPointTypes.js\";\nimport { NodeMaterialBlockTargets } from \"../../Enums/nodeMaterialBlockTargets.js\";\n/**\n * Defines a block used to receive a value from a teleport entry point\n */\nexport class NodeMaterialTeleportOutBlock extends NodeMaterialBlock {\n /**\n * Create a new TeleportOutBlock\n * @param name defines the block name\n */\n constructor(name) {\n super(name, NodeMaterialBlockTargets.Neutral);\n /** @internal */\n this._entryPoint = null;\n /** @internal */\n this._tempEntryPointUniqueId = null;\n this.registerOutput(\"output\", NodeMaterialBlockConnectionPointTypes.BasedOnInput);\n }\n /**\n * Gets the entry point\n */\n get entryPoint() {\n return this._entryPoint;\n }\n /**\n * Gets the current class name\n * @returns the class name\n */\n getClassName() {\n return \"NodeMaterialTeleportOutBlock\";\n }\n /**\n * Gets the output component\n */\n get output() {\n return this._outputs[0];\n }\n /**\n * Gets or sets the target of the block\n */\n get target() {\n return this._entryPoint ? this._entryPoint.target : this._target;\n }\n set target(value) {\n if ((this._target & value) !== 0) {\n return;\n }\n this._target = value;\n }\n /** Detach from entry point */\n detach() {\n if (!this._entryPoint) {\n return;\n }\n this._entryPoint.detachFromEndpoint(this);\n }\n _buildBlock(state) {\n super._buildBlock(state);\n if (this.entryPoint) {\n state.compilationString += state._declareOutput(this.output) + ` = ${this.entryPoint.input.associatedVariableName};\\n`;\n }\n }\n /**\n * Clone the current block to a new identical block\n * @param scene defines the hosting scene\n * @param rootUrl defines the root URL to use to load textures and relative dependencies\n * @returns a copy of the current block\n */\n clone(scene, rootUrl = \"\") {\n const clone = super.clone(scene, rootUrl);\n if (this.entryPoint) {\n this.entryPoint.attachToEndpoint(clone);\n }\n return clone;\n }\n _customBuildStep(state, activeBlocks) {\n if (this.entryPoint) {\n this.entryPoint.build(state, activeBlocks);\n }\n }\n _dumpCode(uniqueNames, alreadyDumped) {\n let codeString = \"\";\n if (this.entryPoint) {\n if (alreadyDumped.indexOf(this.entryPoint) === -1) {\n codeString += this.entryPoint._dumpCode(uniqueNames, alreadyDumped);\n }\n }\n return codeString + super._dumpCode(uniqueNames, alreadyDumped);\n }\n _dumpCodeForOutputConnections(alreadyDumped) {\n let codeString = super._dumpCodeForOutputConnections(alreadyDumped);\n if (this.entryPoint) {\n codeString += this.entryPoint._dumpCodeForOutputConnections(alreadyDumped);\n }\n return codeString;\n }\n _dumpPropertiesCode() {\n let codeString = super._dumpPropertiesCode();\n if (this.entryPoint) {\n codeString += `${this.entryPoint._codeVariableName}.attachToEndpoint(${this._codeVariableName});\\n`;\n }\n return codeString;\n }\n /**\n * Serializes this block in a JSON representation\n * @returns the serialized block object\n */\n serialize() {\n const serializationObject = super.serialize();\n serializationObject.entryPoint = this.entryPoint?.uniqueId ?? \"\";\n return serializationObject;\n }\n _deserialize(serializationObject, scene, rootUrl) {\n super._deserialize(serializationObject, scene, rootUrl);\n this._tempEntryPointUniqueId = serializationObject.entryPoint;\n }\n}\nRegisterClass(\"BABYLON.NodeMaterialTeleportOutBlock\", NodeMaterialTeleportOutBlock);\n"],"mappings":"AAAA,SAASA,aAAa,QAAQ,+BAA+B;AAC7D,SAASC,iBAAiB,QAAQ,4BAA4B;AAC9D,SAASC,qCAAqC,QAAQ,sDAAsD;AAC5G,SAASC,wBAAwB,QAAQ,yCAAyC;AAClF;AACA;AACA;AACA,OAAO,MAAMC,4BAA4B,SAASH,iBAAiB,CAAC;EAChE;AACJ;AACA;AACA;EACII,WAAWA,CAACC,IAAI,EAAE;IACd,KAAK,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