handle visible/invisible items

This commit is contained in:
wass08
2026-02-02 10:33:36 +09:00
parent f98ead4585
commit 549bfb3f29
10 changed files with 13 additions and 4 deletions
@@ -37,7 +37,7 @@ export const ItemRenderer = ({ node }: { node: ItemNode }) => {
useRegistry(node.id, node.type, ref)
return (
<group position={node.position} rotation={node.rotation} ref={ref}>
<group position={node.position} rotation={node.rotation} ref={ref} visible={node.visible}>
<Suspense>
<ModelRenderer node={node} />
</Suspense>
@@ -17,6 +17,7 @@ export const RoofRenderer = ({ node }: { node: RoofNode }) => {
receiveShadow
position={node.position}
rotation-y={node.rotation}
visible={node.visible}
{...handlers}
>
{/* RoofSystem will replace this geometry in the next frame */}
@@ -11,7 +11,7 @@ export const SlabRenderer = ({ node }: { node: SlabNode }) => {
const handlers = useNodeEvents(node, 'slab')
return (
<mesh ref={ref} castShadow receiveShadow {...handlers}>
<mesh ref={ref} castShadow receiveShadow {...handlers} visible={node.visible}>
{/* SlabSystem will replace this geometry in the next frame */}
<boxGeometry args={[0, 0, 0]} />
<meshStandardMaterial color="#e5e5e5" />
@@ -12,7 +12,7 @@ export const WallRenderer = ({ node }: { node: WallNode }) => {
const handlers = useNodeEvents(node, 'wall')
return (
<mesh ref={ref} castShadow receiveShadow>
<mesh ref={ref} castShadow receiveShadow visible={node.visible}>
{/* WallSystem will replace this geometry in the next frame */}
<boxGeometry args={[0, 0, 0]} />
<meshStandardMaterial color="lightgray" />