1 line
3.2 KiB
Plaintext
1 line
3.2 KiB
Plaintext
|
{"version":3,"file":"createGeometry.js","sources":["../../../../Source/WorkersES6/createGeometry.js"],"sourcesContent":["/* global require */\nimport defined from \"../Core/defined.js\";\nimport PrimitivePipeline from \"../Scene/PrimitivePipeline.js\";\nimport when from \"../ThirdParty/when.js\";\nimport createTaskProcessorWorker from \"./createTaskProcessorWorker.js\";\n\nconst moduleCache = {};\n\nfunction getModule(moduleName) {\n let module = moduleCache[moduleName];\n if (!defined(module)) {\n if (typeof exports === \"object\") {\n // Use CommonJS-style require.\n moduleCache[module] = module = require(`Workers/${moduleName}`);\n } else {\n // Use AMD-style require.\n // in web workers, require is synchronous\n require([`Workers/${moduleName}`], function (f) {\n module = f;\n moduleCache[module] = f;\n });\n }\n }\n return module;\n}\n\nfunction createGeometry(parameters, transferableObjects) {\n const subTasks = parameters.subTasks;\n const length = subTasks.length;\n const resultsOrPromises = new Array(length);\n\n for (let i = 0; i < length; i++) {\n const task = subTasks[i];\n const geometry = task.geometry;\n const moduleName = task.moduleName;\n\n if (defined(moduleName)) {\n const createFunction = getModule(moduleName);\n resultsOrPromises[i] = createFunction(geometry, task.offset);\n } else {\n //Already created geometry\n resultsOrPromises[i] = geometry;\n }\n }\n\n return when.all(resultsOrPromises, function (results) {\n return PrimitivePipeline.packCreateGeometryResults(\n results,\n transferableObjects\n );\n });\n}\nexport default createTaskProcessorWorker(createGeometry);\n"],"names":["defined","when","PrimitivePipeline"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;EAAA;AAKA;EACA,MAAM,WAAW,GAAG,EAAE,CAAC;AACvB;EACA,SAAS,SAAS,CAAC,UAAU,EAAE;EAC/B,EAAE,IAAI,MAAM,GAAG,WAAW,CAAC,UAAU,CAAC,CAAC;EACvC,EAAE,IAAI,CAACA,YAAO,CAAC,MAAM,CAAC,EAAE;EACxB,IAAI,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE;EACrC;EACA,MAAM,WAAW,CAAC,MAA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