Refactor: Use explicit loop for filtering and mapping foliage render LODs

This commit is contained in:
2026-05-02 10:50:40 +02:00
parent 2c09c4c3e1
commit a53de8a33d

View File

@@ -85,15 +85,22 @@ function cloneChunkBounds(
export function getFoliagePrototypeRenderLods( export function getFoliagePrototypeRenderLods(
prototype: FoliagePrototype prototype: FoliagePrototype
): FoliageRenderLod[] { ): FoliageRenderLod[] {
return prototype.lods const renderLods: FoliageRenderLod[] = [];
.filter((lod) => lod.source === "bundled")
.map((lod) => ({ for (const lod of prototype.lods) {
if (lod.source !== "bundled") {
continue;
}
renderLods.push({
level: lod.level, level: lod.level,
bundledPath: lod.bundledPath, bundledPath: lod.bundledPath,
maxDistance: lod.maxDistance, maxDistance: lod.maxDistance,
castShadow: lod.castShadow castShadow: lod.castShadow
})) });
.sort((left, right) => left.level - right.level); }
return renderLods.sort((left, right) => left.level - right.level);
} }
export function resolveFoliageRenderLod(options: { export function resolveFoliageRenderLod(options: {