fix(world): stabilize lafabrik spawn and vegetation

This commit is contained in:
Tom Boullay
2026-06-01 01:32:21 +02:00
parent 061e0dc677
commit aa2d411b0c
12 changed files with 51 additions and 110 deletions
+1 -3
View File
@@ -3,7 +3,6 @@ import * as THREE from "three";
import { useGLTF } from "@react-three/drei";
import { useThree } from "@react-three/fiber";
import { TERRAIN_MODEL_PATH } from "@/data/world/terrainConfig";
import { flattenLaFabrikTerrainFootprint } from "@/data/world/laFabrikConfig";
import type { Vector3Tuple } from "@/types/three/three";
import { optimizeGLTFSceneTextures } from "@/utils/three/optimizeGLTFScene";
@@ -66,10 +65,9 @@ export function TerrainModel({
const terrainModel = useMemo(() => {
optimizeGLTFSceneTextures(scene, maxAnisotropy);
const model = scene.clone(true);
flattenLaFabrikTerrainFootprint(model, position, rotation, scale);
applyTerrainMaterialSettings(model, receiveShadow);
return model;
}, [maxAnisotropy, position, receiveShadow, rotation, scale, scene]);
}, [maxAnisotropy, scene, receiveShadow]);
useEffect(() => {
onLoaded?.();