Parallelize model loading
This commit is contained in:
parent
5a5656109e
commit
ec68fccaa3
1 changed files with 5 additions and 3 deletions
|
@ -22,14 +22,16 @@ export async function buildMeshes(
|
|||
mappedFeatures: MappedFeature[],
|
||||
model: Group
|
||||
) {
|
||||
for (let i = 0; i < mappedFeatures.length; i++) {
|
||||
const layerData = mappedFeatures[i];
|
||||
const meshPromises = mappedFeatures.map(async (layerData) => {
|
||||
const mesh = await buildMesh(layerData);
|
||||
if (layerData.name === "Topography") {
|
||||
mesh.visible = false;
|
||||
}
|
||||
|
||||
model.add(mesh);
|
||||
}
|
||||
});
|
||||
|
||||
await Promise.all(meshPromises);
|
||||
}
|
||||
|
||||
async function buildMesh(layerData: MappedFeature) {
|
||||
|
|
Loading…
Add table
editor.link_modal.header
Reference in a new issue