Fix: beams overlap

This commit is contained in:
Dejvino 2025-11-19 23:25:44 +01:00
parent e23b4109f8
commit a98c058f3d

View File

@ -83,8 +83,8 @@ export function createSceneObjects() {
const beamDepth = 0.2; const beamDepth = 0.2;
// Ceiling Beams // Ceiling Beams
const ceilingBeamGeoX = new THREE.BoxGeometry(state.roomSize, beamDepth, beamThickness); const ceilingBeamGeoX = new THREE.BoxGeometry(state.roomSize, beamDepth * 1.3, beamThickness);
const ceilingBeamGeoZ = new THREE.BoxGeometry(beamThickness, beamDepth, state.roomSize); const ceilingBeamGeoZ = new THREE.BoxGeometry(beamThickness, beamDepth * 0.8, state.roomSize);
const createBeam = (geo, pos, rotY = 0) => { const createBeam = (geo, pos, rotY = 0) => {
const beam = new THREE.Mesh(geo, woodMaterial); const beam = new THREE.Mesh(geo, woodMaterial);
@ -121,8 +121,8 @@ export function createSceneObjects() {
createBeam(wallBeamGeo, new THREE.Vector3(state.roomSize / 2 - beamDepth / 2, state.roomHeight / 2, 1.5), -Math.PI / 2); createBeam(wallBeamGeo, new THREE.Vector3(state.roomSize / 2 - beamDepth / 2, state.roomHeight / 2, 1.5), -Math.PI / 2);
// Wall Beams (Horizontal) // Wall Beams (Horizontal)
const wallBeamGeoX = new THREE.BoxGeometry(state.roomSize, beamThickness, beamDepth); const wallBeamGeoX = new THREE.BoxGeometry(state.roomSize, beamThickness, beamDepth * 1.3);
const wallBeamGeoZ = new THREE.BoxGeometry(beamDepth, beamThickness, state.roomSize); const wallBeamGeoZ = new THREE.BoxGeometry(beamDepth * 1.3, beamThickness, state.roomSize);
// Back Wall // Back Wall
createBeam(wallBeamGeoX, new THREE.Vector3(0, state.roomHeight - 0.5, -state.roomSize / 2 + beamDepth / 2)); createBeam(wallBeamGeoX, new THREE.Vector3(0, state.roomHeight - 0.5, -state.roomSize / 2 + beamDepth / 2));