handle visible/invisible items
This commit is contained in:
@@ -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" />
|
||||
|
||||
Reference in New Issue
Block a user