feat(debug): add map performance visibility controls
This commit is contained in:
@@ -1,4 +1,8 @@
|
||||
import { Suspense } from "react";
|
||||
import {
|
||||
isMapModelVisible,
|
||||
useMapPerformanceStore,
|
||||
} from "@/managers/stores/useMapPerformanceStore";
|
||||
import { InstancedVegetation } from "@/world/vegetation/InstancedVegetation";
|
||||
import { useVegetationData } from "@/world/vegetation/useVegetationData";
|
||||
import {
|
||||
@@ -7,6 +11,8 @@ import {
|
||||
} from "@/world/vegetation/vegetationConfig";
|
||||
|
||||
export function VegetationSystem(): React.JSX.Element | null {
|
||||
const groups = useMapPerformanceStore((state) => state.groups);
|
||||
const models = useMapPerformanceStore((state) => state.models);
|
||||
const { data, isLoading } = useVegetationData();
|
||||
|
||||
if (isLoading || !data) {
|
||||
@@ -14,7 +20,8 @@ export function VegetationSystem(): React.JSX.Element | null {
|
||||
}
|
||||
|
||||
const enabledTypes = Object.entries(VEGETATION_TYPES).filter(
|
||||
([, config]) => config.enabled,
|
||||
([, config]) =>
|
||||
config.enabled && isMapModelVisible(config.mapName, { groups, models }),
|
||||
);
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user