refactor: clean up code in various components; streamline material properties and improve state management

This commit is contained in:
2025-03-29 18:35:34 +05:30
parent df571e18fb
commit 98eb403b4a
5 changed files with 11 additions and 19 deletions

View File

@@ -17,7 +17,7 @@ function addRoofToScene(
};
const geometry = new THREE.ExtrudeGeometry(shape, extrudeSettings);
const material = new THREE.MeshStandardMaterial({ color: CONSTANTS.roofConfig.defaultColor, side: THREE.DoubleSide, transparent: true, depthWrite: false });
const material = new THREE.MeshStandardMaterial({ color: CONSTANTS.roofConfig.defaultColor, side: THREE.DoubleSide });
const mesh = new THREE.Mesh(geometry, material);
mesh.position.y = CONSTANTS.wallConfig.height + floor;
mesh.castShadow = true;

View File

@@ -22,8 +22,7 @@ function hideRoof(
if (roofChild.material) {
const materials = Array.isArray(roofChild.material) ? roofChild.material : [roofChild.material];
materials.forEach(material => {
// material.visible = v.dot(u) < 0.25;
material.visible = true;
material.visible = v.dot(u) < 0.25;
});
}
}