fix: a pb with octree

This commit is contained in:
Tom Boullay
2026-05-11 16:43:02 +02:00
parent 6f5137229d
commit ff21b80d57
3 changed files with 28 additions and 8 deletions
+6 -2
View File
@@ -62,13 +62,17 @@ class ModelErrorBoundary extends Component<
interface GameMapProps {
onOctreeReady: OctreeReadyHandler;
buildOctree?: boolean;
}
export function GameMap({ onOctreeReady }: GameMapProps): React.JSX.Element {
export function GameMap({
onOctreeReady,
buildOctree = true,
}: GameMapProps): React.JSX.Element {
const [mapNodes, setMapNodes] = useState<LoadedMapNode[]>([]);
const groupRef = useRef<THREE.Group>(null);
useOctreeGraphNode(groupRef, onOctreeReady, mapNodes.length);
useOctreeGraphNode(groupRef, onOctreeReady, mapNodes.length, buildOctree);
useEffect(() => {
const loadMap = async () => {