import { useMemo } from 'react'; import * as THREE from 'three'; import type { MovementInteriorStyle } from '../data/movement-interior-styles'; interface Props { style: MovementInteriorStyle; width: number; depth: number; halfW: number; halfD: number; } function PalazzoDetails({ width, depth, halfW, halfD, trim }: Props & { trim: string }) { const pilasterPositions = useMemo( () => [ [-halfW + 0.35, -halfD + 0.35], [halfW - 0.35, -halfD + 0.35], [-halfW + 0.35, halfD - 0.35], [halfW - 0.35, halfD - 0.35], ] as [number, number][], [halfW, halfD] ); return ( {pilasterPositions.map(([x, z], i) => ( ))} {/* Wainscoting rail */} {[ [0, -halfD + 0.09, width, 0.12] as const, [0, halfD - 0.09, width, 0.12] as const, [-halfW + 0.09, 0, 0.12, depth] as const, [halfW - 0.09, 0, 0.12, depth] as const, ].map(([x, z, w, d], i) => ( ))} {/* Coffered ceiling */} {Array.from({ length: Math.min(6, Math.floor(width / 2.5)) }, (_, col) => Array.from({ length: Math.min(5, Math.floor(depth / 2.8)) }, (_, row) => { const cx = -halfW + 1.4 + col * 2.4; const cz = -halfD + 1.5 + row * 2.6; return ( ); }) )} ); } function BaroqueDetails({ width, depth, halfW, halfD, trim }: Props & { trim: string }) { return ( {/* Gilded cornice ring */} {[ [0, -halfD + 0.06, width, 0.1] as const, [0, halfD - 0.06, width, 0.1] as const, [-halfW + 0.06, 0, 0.1, depth] as const, [halfW - 0.06, 0, 0.1, depth] as const, ].map(([x, z, w, d], i) => ( ))} {/* Wall panels */} {[-halfW + 0.12, halfW - 0.12].map((x, i) => ( ))} ); } function MedievalDetails({ halfW, halfD }: Pick) { const torchPositions = useMemo( () => [ [-halfW + 0.2, -halfD * 0.5], [halfW - 0.2, -halfD * 0.5], [-halfW + 0.2, halfD * 0.3], [halfW - 0.2, halfD * 0.3], ] as [number, number][], [halfW, halfD] ); return ( {torchPositions.map(([x, z], i) => ( ))} {/* Rough stone courses */} {[-halfD + 0.08, halfD - 0.08].map((z, i) => ( ))} ); } function NeoclassicalDetails({ halfW, halfD, trim }: Pick & { trim: string }) { const columns = [ [-halfW + 0.45, -halfD + 0.6], [halfW - 0.45, -halfD + 0.6], [-halfW + 0.45, halfD - 0.6], [halfW - 0.45, halfD - 0.6], ] as [number, number][]; return ( {columns.map(([x, z], i) => ( ))} ); } function ClassicalDetails({ halfW, trim }: Pick & { trim: string }) { return ( {[ [-halfW + 0.5, 0], [halfW - 0.5, 0], ].map(([x, z], i) => ( ))} ); } function SalonDetails({ trim }: { trim: string }) { return ( ); } export default function MovementHallDetails({ style, width, depth, halfW, halfD }: Props) { const trim = style.tints.trim; switch (style.details) { case 'palazzo': return ; case 'baroque': return ; case 'medieval': return ; case 'neoclassical': return ; case 'classical': return ; case 'salon': return ; default: return null; } }