Refactor: Use explicit loop for filtering and mapping foliage render LODs
This commit is contained in:
@@ -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: {
|
||||||
|
|||||||
Reference in New Issue
Block a user