import * as THREE from 'three' import { EffectComposer, N8AO, Outline } from '@react-three/postprocessing' import { BlendFunction } from 'postprocessing' import { useDeletableFloorItem, useSelectedActionSphere, useSelectedPath, useSelectedWallItem, useselectedFloorItem } from '../../../store/store'; import * as Types from '../../../types/world/worldTypes' import * as CONSTANTS from '../../../types/world/worldConstants'; export default function PostProcessing() { const { deletableFloorItem, setDeletableFloorItem } = useDeletableFloorItem(); const { selectedWallItem, setSelectedWallItem } = useSelectedWallItem(); const { selectedFloorItem, setselectedFloorItem } = useselectedFloorItem(); const { selectedActionSphere } = useSelectedActionSphere(); const { selectedPath } = useSelectedPath(); function flattenChildren(children: any[]) { const allChildren: any[] = []; children.forEach(child => { allChildren.push(child); if (child.children && child.children.length > 0) { allChildren.push(...flattenChildren(child.children)); } }); return allChildren; } return ( <> {deletableFloorItem && } {selectedWallItem && child.name !== "CSG_REF" ) } selectionLayer={10} width={3000} blendFunction={BlendFunction.ALPHA} edgeStrength={5} resolutionScale={2} pulseSpeed={0} visibleEdgeColor={CONSTANTS.outlineConfig.assetSelectColor} hiddenEdgeColor={CONSTANTS.outlineConfig.assetSelectColor} blur={true} xRay={true} />} {selectedFloorItem && } {selectedActionSphere && } {selectedPath && } ) }