Refactor builder store and related components: update DecalInstance to manage selectedFloor state, enhance FloorInstance with improved material handling and texture application, and modify FloorGroup to remove unnecessary console log. Update Wall component for better shadow handling and adjust useBuilderStore to change default material values.

This commit is contained in:
2025-06-27 11:56:54 +05:30
parent 04c302ea4c
commit 64f0cdb148
6 changed files with 111 additions and 20 deletions

View File

@@ -15,7 +15,7 @@ export default function PostProcessing() {
const { selectedWallItem } = useSelectedWallItem();
const { selectedFloorItem } = useSelectedFloorItem();
const { selectedEventSphere } = useSelectedEventSphere();
const { selectedAisle, selectedWall, selectedDecal } = useBuilderStore();
const { selectedAisle, selectedWall, selectedDecal, selectedFloor } = useBuilderStore();
function flattenChildren(children: any[]) {
const allChildren: any[] = [];
@@ -44,6 +44,10 @@ export default function PostProcessing() {
// console.log('selectedWall: ', selectedWall);
}, [selectedWall])
useEffect(() => {
// console.log('selectedFloor: ', selectedFloor);
}, [selectedFloor])
return (
<EffectComposer autoClear={false}>
<N8AO
@@ -85,6 +89,21 @@ export default function PostProcessing() {
xRay={true}
/>
)}
{selectedFloor && (
<Outline
selection={selectedFloor}
selectionLayer={10}
width={2000}
blendFunction={BlendFunction.ALPHA}
edgeStrength={5}
resolutionScale={2}
pulseSpeed={0}
visibleEdgeColor={CONSTANTS.outlineConfig.assetSelectColor}
hiddenEdgeColor={CONSTANTS.outlineConfig.assetSelectColor}
blur={true}
xRay={true}
/>
)}
{selectedDecal && (
<Outline
selection={selectedDecal}