slab rendering + select

This commit is contained in:
wass08
2026-01-27 07:37:06 +09:00
parent 8940f70117
commit 0e3130bd60
6 changed files with 84 additions and 7 deletions
@@ -1,14 +1,17 @@
import { useRegistry, type SlabNode } from '@pascal-app/core'
import { type SlabNode, useRegistry } from '@pascal-app/core'
import { useRef } from 'react'
import type { Mesh } from 'three'
import { useNodeEvents } from '../../../hooks/use-node-events'
export const SlabRenderer = ({ node }: { node: SlabNode }) => {
const ref = useRef<Mesh>(null!)
useRegistry(node.id, 'slab', ref)
const handlers = useNodeEvents(node, 'slab')
return (
<mesh ref={ref} castShadow receiveShadow>
<mesh ref={ref} castShadow receiveShadow {...handlers}>
{/* SlabSystem will replace this geometry in the next frame */}
<boxGeometry args={[0, 0, 0]} />
<meshStandardMaterial color="#e5e5e5" />
@@ -5,6 +5,8 @@ import {
emitter,
type ItemEvent,
type ItemNode,
type SlabEvent,
type SlabNode,
type WallEvent,
type WallNode,
type ZoneEvent,
@@ -17,6 +19,7 @@ type NodeConfig = {
wall: { node: WallNode; event: WallEvent }
building: { node: BuildingNode; event: BuildingEvent }
zone: { node: ZoneNode; event: ZoneEvent }
slab: { node: SlabNode; event: SlabEvent }
}
type NodeType = keyof NodeConfig