registry / systems / renderer

This commit is contained in:
wass08
2026-01-15 10:43:32 +09:00
parent 7a4d6e397d
commit 0c07c482a5
93 changed files with 440 additions and 75 deletions
+3 -1
View File
@@ -13,7 +13,9 @@ export const ItemNode = BaseNode.extend({
.object({
category: z.string(),
src: z.string(),
dimensions: z.tuple([z.number(), z.number(), z.number()]), // [w, h, d]
dimensions: z
.tuple([z.number(), z.number(), z.number()])
.default([1, 1, 1]), // [w, h, d]
attachTo: z.enum(["wall", "wall-side", "ceiling"]).optional(),
// These are "Corrective" transforms to normalize the GLB
offset: z.tuple([z.number(), z.number(), z.number()]).default([0, 0, 0]),
+2 -5
View File
@@ -1,6 +1,7 @@
import dedent from "dedent";
import { z } from "zod";
import { BaseNode, nodeType, objectId } from "../base";
import { ItemNode } from "./item";
// import { DoorNode } from "./door";
// import { ItemNode } from "./item";
// import { WindowNode } from "./window";
@@ -8,11 +9,7 @@ import { BaseNode, nodeType, objectId } from "../base";
export const WallNode = BaseNode.extend({
id: objectId("wall"),
type: nodeType("wall"),
// get children() {
// return z
// .array(z.discriminatedUnion("type", [DoorNode, WindowNode, ItemNode]))
// .default([]);
// },
children: z.array(ItemNode.shape.id).default([]),
// Specific props
thickness: z.number().optional(),
height: z.number().optional(),
+2
View File
@@ -1,5 +1,6 @@
import z from "zod";
import { BuildingNode } from "./nodes/building";
import { ItemNode } from "./nodes/item";
import { LevelNode } from "./nodes/level";
import { SiteNode } from "./nodes/site";
import { WallNode } from "./nodes/wall";
@@ -9,6 +10,7 @@ export const AnyNode = z.discriminatedUnion("type", [
BuildingNode,
LevelNode,
WallNode,
ItemNode,
]);
export type AnyNode = z.infer<typeof AnyNode>;