Parallelize model loading

This commit is contained in:
Fuhrmann 2025-05-05 09:58:58 +02:00
parent 5a5656109e
commit ec68fccaa3

View file

@ -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) {