window building

This commit is contained in:
wass08
2026-02-18 10:41:12 +09:00
parent 9a2c89547b
commit 076faae7df
6 changed files with 374 additions and 21 deletions
@@ -1,11 +1,13 @@
import { useRegistry, type WindowNode } from '@pascal-app/core'
import { useRef } from 'react'
import type { Mesh } from 'three'
import { useNodeEvents } from '../../../hooks/use-node-events'
export const WindowRenderer = ({ node }: { node: WindowNode }) => {
const ref = useRef<Mesh>(null!)
useRegistry(node.id, 'window', ref)
const handlers = useNodeEvents(node, 'window')
return (
<mesh
@@ -15,6 +17,7 @@ export const WindowRenderer = ({ node }: { node: WindowNode }) => {
visible={node.visible}
position={node.position}
rotation={node.rotation}
{...handlers}
>
{/* WindowSystem replaces this geometry each time the node is dirty */}
<boxGeometry args={[0, 0, 0]} />