registry / systems / renderer
This commit is contained in:
@@ -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]),
|
||||
|
||||
@@ -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(),
|
||||
|
||||
@@ -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>;
|
||||
|
||||
Reference in New Issue
Block a user