fix: [rd] 벽체 개구부 통과 구조로 변경

- 뒷벽을 좌/우 분리 + 상부 인방으로 3조각 구성
- 개구부(셔터 영역)는 뚫려서 통과 가능
- 셔터 열렸을 때 실제 건물처럼 통행 가능한 구조
This commit is contained in:
김보곤
2026-03-08 21:37:10 +09:00
parent 5444c956a9
commit 755375ddda

View File

@@ -1280,28 +1280,45 @@ function fs3dBuild() {
meshes.bottomBar.position.set(0, H - shutterH - 20, 0);
scene.add(meshes.bottomBar);
// === WALL (3면 벽체: 좌날개 + 우날개 + 뒷벽) ===
// === WALL (개구부 뚫린 벽체: 좌 + 우벽 + 상부 인방 + 좌/우 날개벽) ===
const wl = S.wall;
const wallH = H + b.height + wl.topMargin; // 전체 벽 높이
const wallColor = new THREE.Color(wl.color);
const wallMat = new THREE.MeshStandardMaterial({ color: wallColor, transparent: true, opacity: wl.opacity / 100, side: THREE.DoubleSide });
meshes.wall = new THREE.Group();
// 뒷벽 (전체 폭 커버: 날개벽 포함)
const totalW = W1 + wl.wing * 2;
const backGeo = new THREE.BoxGeometry(totalW, wallH, wl.thick);
const backMesh = new THREE.Mesh(backGeo, wallMat);
backMesh.position.set(0, wallH / 2, -wl.thick / 2);
meshes.wall.add(backMesh);
// 뒷벽: 개구부(W1 x H) 부분을 제외하고 3조각으로 구성
// 1) 좌측 뒷벽 (날개벽 폭만큼)
if (wl.wing > 0) {
const backLGeo = new THREE.BoxGeometry(wl.wing, wallH, wl.thick);
const backL = new THREE.Mesh(backLGeo, wallMat);
backL.position.set(-W1 / 2 - wl.wing / 2, wallH / 2, -wl.thick / 2);
meshes.wall.add(backL);
// 좌측 날개
// 2) 우측 뒷
const backR = new THREE.Mesh(backLGeo.clone(), wallMat);
backR.position.set(W1 / 2 + wl.wing / 2, wallH / 2, -wl.thick / 2);
meshes.wall.add(backR);
}
// 3) 상부 인방 (개구부 위, 셔터박스+상단여유 높이)
const lintelH = b.height + wl.topMargin;
if (lintelH > 0) {
const totalW = W1 + wl.wing * 2;
const lintelGeo = new THREE.BoxGeometry(totalW, lintelH, wl.thick);
const lintel = new THREE.Mesh(lintelGeo, wallMat);
lintel.position.set(0, H + lintelH / 2, -wl.thick / 2);
meshes.wall.add(lintel);
}
// 좌/우 날개벽 (앞쪽으로 돌출, 가이드레일 옆)
if (wl.wing > 0) {
const wingGeo = new THREE.BoxGeometry(wl.wing, wallH, wl.thick);
const leftWing = new THREE.Mesh(wingGeo, wallMat);
leftWing.position.set(-W1 / 2 - wl.wing / 2, wallH / 2, wl.thick / 2);
meshes.wall.add(leftWing);
const rightWing = new THREE.Mesh(wingGeo, wallMat);
const rightWing = new THREE.Mesh(wingGeo.clone(), wallMat);
rightWing.position.set(W1 / 2 + wl.wing / 2, wallH / 2, wl.thick / 2);
meshes.wall.add(rightWing);
}