Finish slicing box and UI

This commit is contained in:
Fuhrmann 2025-03-07 10:09:38 +01:00
parent 8227b4141a
commit 213537508c
19 changed files with 965 additions and 1361 deletions

View file

@ -1,15 +1,15 @@
"use client";
import { useContext, useEffect, useRef } from "react";
import { MapScene } from "../three/MapScene";
import { SceneView } from "../three/SceneView";
import {
MapSceneContext,
MapSceneContextType,
} from "../providers/map-scene-provider";
SceneViewContext,
SceneViewContextType,
} from "../providers/scene-view-provider";
export function Map() {
const divRef = useRef<HTMLDivElement>(null);
const { setMapScene } = useContext(MapSceneContext) as MapSceneContextType;
const { setSceneView } = useContext(SceneViewContext) as SceneViewContextType;
useEffect(() => {
let ignore = false;
@ -17,9 +17,9 @@ export function Map() {
async function loadScene() {
if (divRef.current) {
const _mapScene = await MapScene.create(divRef.current, "20");
if (_mapScene) {
setMapScene(_mapScene);
const _sceneView = await SceneView.create(divRef.current, "20");
if (_sceneView) {
setSceneView(_sceneView);
}
}
}