1 |
- {"ast":null,"code":"import { RegisterClass } from \"../../../../Misc/typeStore.js\";\nimport { NodeGeometryBlockConnectionPointTypes } from \"../../Enums/nodeGeometryConnectionPointTypes.js\";\nimport { NodeGeometryBlock } from \"../../nodeGeometryBlock.js\";\n/**\n * Defines a block used to teleport a value to an endpoint\n */\nexport class TeleportInBlock extends NodeGeometryBlock {\n /** Gets the list of attached endpoints */\n get endpoints() {\n return this._endpoints;\n }\n /**\n * Create a new TeleportInBlock\n * @param name defines the block name\n */\n constructor(name) {\n super(name);\n this._endpoints = [];\n this._isTeleportIn = true;\n this.registerInput(\"input\", NodeGeometryBlockConnectionPointTypes.AutoDetect);\n }\n /**\n * Gets the current class name\n * @returns the class name\n */\n getClassName() {\n return \"TeleportInBlock\";\n }\n /**\n * Gets the input component\n */\n get input() {\n return this._inputs[0];\n }\n _dumpCode(uniqueNames, alreadyDumped) {\n let codeString = super._dumpCode(uniqueNames, alreadyDumped);\n for (const endpoint of this.endpoints) {\n if (alreadyDumped.indexOf(endpoint) === -1) {\n codeString += endpoint._dumpCode(uniqueNames, alreadyDumped);\n }\n }\n return codeString;\n }\n /**\n * Checks if the current block is an ancestor of a given type\n * @param type defines the potential type to check\n * @returns true if block is a descendant\n */\n isAnAncestorOfType(type) {\n if (this.getClassName() === type) {\n return true;\n }\n for (const endpoint of this.endpoints) {\n if (endpoint.isAnAncestorOfType(type)) {\n return true;\n }\n }\n return false;\n }\n /**\n * Checks if the current block is an ancestor of a given block\n * @param block defines the potential descendant block to check\n * @returns true if block is a descendant\n */\n isAnAncestorOf(block) {\n for (const endpoint of this.endpoints) {\n if (endpoint === block) {\n return true;\n }\n if (endpoint.isAnAncestorOf(block)) {\n return true;\n }\n }\n return false;\n }\n /**\n * Get the first descendant using a predicate\n * @param predicate defines the predicate to check\n * @returns descendant or null if none found\n */\n getDescendantOfPredicate(predicate) {\n if (predicate(this)) {\n return this;\n }\n for (const endpoint of this.endpoints) {\n const descendant = endpoint.getDescendantOfPredicate(predicate);\n if (descendant) {\n return descendant;\n }\n }\n return null;\n }\n /**\n * Add an enpoint to this block\n * @param endpoint define the endpoint to attach to\n */\n attachToEndpoint(endpoint) {\n endpoint.detach();\n this._endpoints.push(endpoint);\n endpoint._entryPoint = this;\n endpoint._outputs[0]._typeConnectionSource = this._inputs[0];\n endpoint._tempEntryPointUniqueId = null;\n endpoint.name = \"> \" + this.name;\n }\n /**\n * Remove enpoint from this block\n * @param endpoint define the endpoint to remove\n */\n detachFromEndpoint(endpoint) {\n const index = this._endpoints.indexOf(endpoint);\n if (index !== -1) {\n this._endpoints.splice(index, 1);\n endpoint._outputs[0]._typeConnectionSource = null;\n endpoint._entryPoint = null;\n }\n }\n _buildBlock() {\n for (const endpoint of this._endpoints) {\n endpoint.output._storedFunction = state => {\n return this.input.getConnectedValue(state);\n };\n }\n }\n}\nRegisterClass(\"BABYLON.TeleportInBlock\", TeleportInBlock);","map":{"version":3,"names":["RegisterClass","NodeGeometryBlockConnectionPointTypes","NodeGeometryBlock","TeleportInBlock","endpoints","_endpoints","constructor","name","_isTeleportIn","registerInput","AutoDetect","getClassName","input","_inputs","_dumpCode","uniqueNames","alreadyDumped","codeString","endpoint","indexOf","isAnAncestorOfType","type","isAnAncestorOf","block","getDescendantOfPredicate","predicate","descendant","attachToEndpoint","detach","push","_entryPoint","_outputs","_typeConnectionSource","_tempEntryPointUniqueId","detachFromEndpoint","index","splice","_buildBlock","output","_storedFunction","state","getConnectedValue"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@babylonjs/core/Meshes/Node/Blocks/Teleport/teleportInBlock.js"],"sourcesContent":["import { RegisterClass } from \"../../../../Misc/typeStore.js\";\nimport { NodeGeometryBlockConnectionPointTypes } from \"../../Enums/nodeGeometryConnectionPointTypes.js\";\nimport { NodeGeometryBlock } from \"../../nodeGeometryBlock.js\";\n/**\n * Defines a block used to teleport a value to an endpoint\n */\nexport class TeleportInBlock extends NodeGeometryBlock {\n /** Gets the list of attached endpoints */\n get endpoints() {\n return this._endpoints;\n }\n /**\n * Create a new TeleportInBlock\n * @param name defines the block name\n */\n constructor(name) {\n super(name);\n this._endpoints = [];\n this._isTeleportIn = true;\n this.registerInput(\"input\", NodeGeometryBlockConnectionPointTypes.AutoDetect);\n }\n /**\n * Gets the current class name\n * @returns the class name\n */\n getClassName() {\n return \"TeleportInBlock\";\n }\n /**\n * Gets the input component\n */\n get input() {\n return this._inputs[0];\n }\n _dumpCode(uniqueNames, alreadyDumped) {\n let codeString = super._dumpCode(uniqueNames, alreadyDumped);\n for (const endpoint of this.endpoints) {\n if (alreadyDumped.indexOf(endpoint) === -1) {\n codeString += endpoint._dumpCode(uniqueNames, alreadyDumped);\n }\n }\n return codeString;\n }\n /**\n * Checks if the current block is an ancestor of a given type\n * @param type defines the potential type to check\n * @returns true if block is a descendant\n */\n isAnAncestorOfType(type) {\n if (this.getClassName() === type) {\n return true;\n }\n for (const endpoint of this.endpoints) {\n if (endpoint.isAnAncestorOfType(type)) {\n return true;\n }\n }\n return false;\n }\n /**\n * Checks if the current block is an ancestor of a given block\n * @param block defines the potential descendant block to check\n * @returns true if block is a descendant\n */\n isAnAncestorOf(block) {\n for (const endpoint of this.endpoints) {\n if (endpoint === block) {\n return true;\n }\n if (endpoint.isAnAncestorOf(block)) {\n return true;\n }\n }\n return false;\n }\n /**\n * Get the first descendant using a predicate\n * @param predicate defines the predicate to check\n * @returns descendant or null if none found\n */\n getDescendantOfPredicate(predicate) {\n if (predicate(this)) {\n return this;\n }\n for (const endpoint of this.endpoints) {\n const descendant = endpoint.getDescendantOfPredicate(predicate);\n if (descendant) {\n return descendant;\n }\n }\n return null;\n }\n /**\n * Add an enpoint to this block\n * @param endpoint define the endpoint to attach to\n */\n attachToEndpoint(endpoint) {\n endpoint.detach();\n this._endpoints.push(endpoint);\n endpoint._entryPoint = this;\n endpoint._outputs[0]._typeConnectionSource = this._inputs[0];\n endpoint._tempEntryPointUniqueId = null;\n endpoint.name = \"> \" + this.name;\n }\n /**\n * Remove enpoint from this block\n * @param endpoint define the endpoint to remove\n */\n detachFromEndpoint(endpoint) {\n const index = this._endpoints.indexOf(endpoint);\n if (index !== -1) {\n this._endpoints.splice(index, 1);\n endpoint._outputs[0]._typeConnectionSource = null;\n endpoint._entryPoint = null;\n }\n }\n _buildBlock() {\n for (const endpoint of this._endpoints) {\n endpoint.output._storedFunction = (state) => {\n return this.input.getConnectedValue(state);\n };\n }\n }\n}\nRegisterClass(\"BABYLON.TeleportInBlock\", TeleportInBlock);\n"],"mappings":"AAAA,SAASA,aAAa,QAAQ,+BAA+B;AAC7D,SAASC,qCAAqC,QAAQ,iDAAiD;AACvG,SAASC,iBAAiB,QAAQ,4BAA4B;AAC9D;AACA;AACA;AACA,OAAO,MAAMC,eAAe,SAASD,iBAAiB,CAAC;EACnD;EACA,IAAIE,SAASA,CAAA,EAAG;IACZ,OAAO,IAAI,CAACC,UAAU;EAC1B;EACA;AACJ;AACA;AACA;EACIC,WAAWA,CAACC,IAAI,EAAE;IACd,KAAK,CAACA,IAAI,CAAC;IACX,IAAI,CAACF,UAAU,GAAG,EAAE;IACpB,IAAI,CAACG,aAAa,GAAG,IAAI;IACzB,IAAI,CAACC,aAAa,CAAC,OAAO,EAAER,qCAAqC,CAACS,UAAU,CAAC;EACjF;EACA;AACJ;AACA;AACA;EACIC,YAAYA,CAAA,EAAG;IACX,OAAO,iBAAiB;EAC5B;EACA;AACJ;AACA;EACI,IAAIC,KAAKA,CAAA,EAAG;IACR,OAAO,IAAI,CAACC,OAAO,CAAC,CAAC,CAAC;EAC1B;EACAC,SAASA,CAACC,WAAW,EAAEC,aAAa,EAAE;IAClC,IAAIC,UAAU,GAAG,KAAK,CAACH,SAAS,CAACC,WAAW,EAAEC,aAAa,CAAC;IAC5D,KAAK,MAAME,QAAQ,IAAI,IAAI,CAACd,SAAS,EAAE;MACnC,IAAIY,aAAa,CAACG,OAAO,CAACD,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE;QACxCD,UAAU,IAAIC,QAAQ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