diff --git a/client/src/components/Map3D.jsx b/client/src/components/Map3D.jsx index e64e585..deb3092 100644 --- a/client/src/components/Map3D.jsx +++ b/client/src/components/Map3D.jsx @@ -983,8 +983,119 @@ function PlayerMarker({ player }) { ); } +// Move target preview (ghost block showing where turtle will go) +function MoveTargetPreview({ position }) { + const meshRef = useRef(); + + useFrame((state) => { + if (meshRef.current) { + meshRef.current.position.y = position.y + Math.sin(state.clock.elapsedTime * 3) * 0.1; + meshRef.current.material.opacity = 0.3 + Math.sin(state.clock.elapsedTime * 2) * 0.15; + } + }); + + return ( + + + + + + + MOVE HERE + + + ); +} + +// Build preview (ghost block showing where block will be placed) +function BuildPreview({ position }) { + const meshRef = useRef(); + + useFrame((state) => { + if (meshRef.current) { + meshRef.current.material.opacity = 0.3 + Math.sin(state.clock.elapsedTime * 2) * 0.15; + } + }); + + return ( + + + + + ); +} + +// Area selection wireframe for SELECT mode +function SelectionArea({ start, end }) { + if (!start || !end) return null; + + const minX = Math.min(start.x, end.x); + const minY = Math.min(start.y, end.y); + const minZ = Math.min(start.z, end.z); + const maxX = Math.max(start.x, end.x); + const maxY = Math.max(start.y, end.y); + const maxZ = Math.max(start.z, end.z); + + const width = maxX - minX + 1; + const height = maxY - minY + 1; + const depth = maxZ - minZ + 1; + const centerX = (minX + maxX) / 2; + const centerY = (minY + maxY) / 2; + const centerZ = (minZ + maxZ) / 2; + + return ( + + + + + + + + + + + {`${width}×${height}×${depth} Selection`} + + + ); +} + // Main scene component -function Scene() { +function Scene({ interactionMode, onInteraction }) { const turtles = useTurtleStore((state) => state.getTurtleArray()); const players = useTurtleStore((state) => Object.values(state.players || {})); const selectedTurtleId = useTurtleStore((state) => state.selectedTurtleId);