From fdf03349cf17b4e0f54602bb058c173c853abb06 Mon Sep 17 00:00:00 2001 From: Tom Boullay Date: Thu, 14 May 2026 00:16:09 +0200 Subject: [PATCH] fix: enable terrain loading for collision octree build --- src/world/GameMap.tsx | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/world/GameMap.tsx b/src/world/GameMap.tsx index dba6662..66b9327 100644 --- a/src/world/GameMap.tsx +++ b/src/world/GameMap.tsx @@ -7,9 +7,12 @@ import { useRef, useState, } from "react"; +import * as THREE from "three"; import { useClonedObject } from "@/hooks/three/useClonedObject"; import { useLoggedGLTF } from "@/hooks/three/useLoggedGLTF"; +import { TerrainModel } from "@/components/three/world/TerrainModel"; import { GameMapCollision } from "@/world/GameMapCollision"; +import { VegetationSystem } from "@/world/vegetation/VegetationSystem"; import type { SceneLoadingChangeHandler } from "@/types/world/sceneLoading"; import { logger } from "@/utils/core/Logger"; import { loadMapSceneData } from "@/utils/map/loadMapSceneData"; @@ -222,6 +225,8 @@ export function GameMap({ ))} + + { + sceneInstance.traverse((child) => { + if (child instanceof THREE.Mesh) { + child.castShadow = true; + child.receiveShadow = true; + } + }); onLoaded(); - }, [onLoaded]); + }, [onLoaded, sceneInstance]); return (