feat(world): add map lod graphics presets

This commit is contained in:
Tom Boullay
2026-05-31 19:03:55 +02:00
parent 564a455520
commit 34c198ebfd
13 changed files with 717 additions and 131 deletions
+13 -1
View File
@@ -3,13 +3,25 @@ import {
MergedStaticMapModel,
type MergedStaticMapModelProps,
} from "@/components/three/world/MergedStaticMapModel";
import { getMapLodModelPath } from "@/data/world/mapLodConfig";
import { useMapLodModelPath } from "@/hooks/world/useMapLodModelPath";
const ECOLE_MODEL_PATH = "/models/ecole/model.gltf";
const ECOLE_LOD_MODEL_PATH = getMapLodModelPath("ecole");
type EcoleModelProps = Omit<MergedStaticMapModelProps, "modelPath">;
export function EcoleModel(props: EcoleModelProps): React.JSX.Element {
return <MergedStaticMapModel modelPath={ECOLE_MODEL_PATH} {...props} />;
const modelPath = useMapLodModelPath({
modelName: "ecole",
modelPath: ECOLE_MODEL_PATH,
position: props.position,
});
return <MergedStaticMapModel modelPath={modelPath} {...props} />;
}
useGLTF.preload(ECOLE_MODEL_PATH);
if (ECOLE_LOD_MODEL_PATH) {
useGLTF.preload(ECOLE_LOD_MODEL_PATH);
}