add map on bike

This commit is contained in:
math-pixel
2026-05-22 18:28:05 +02:00
parent 246da0019a
commit 970253801a
5 changed files with 74 additions and 21 deletions
+1 -1
View File
@@ -42,7 +42,7 @@ function CameraManager({
boundsTextRef
}: {
autoBounds: any,
boundsTextRef: React.RefObject<HTMLPreElement>
boundsTextRef: React.RefObject<HTMLPreElement | null>
}) {
const { camera, gl, scene } = useThree();
const controlsRef = useRef<any>(null);
+3 -2
View File
@@ -63,6 +63,7 @@ const EditorScene: React.FC<EditorSceneProps> = ({
const { raycaster, pointer, camera } = useThree();
const groupRef = useRef<THREE.Group>(null);
const rubberLineRef = useRef<THREE.Line>(null);
const rubberLineInstance = React.useMemo(() => new THREE.Line(), []);
// Mirror reactive props inside Refs to guarantee useFrame loop never closes over stale state
const hoveredNodeIdRef = useRef<number | null>(null);
@@ -151,7 +152,7 @@ const EditorScene: React.FC<EditorSceneProps> = ({
/>
{/* 2. Drag Rubber Band Preview Line (WebGL optimized) */}
<line ref={rubberLineRef} visible={false}>
<primitive object={rubberLineInstance} ref={rubberLineRef} visible={false}>
<bufferGeometry attach="geometry" />
<lineBasicMaterial
attach="material"
@@ -161,7 +162,7 @@ const EditorScene: React.FC<EditorSceneProps> = ({
transparent
opacity={0.9}
/>
</line>
</primitive>
{/* 3. Render Established Connections */}
<ConnectionLines