Add 3D object viewers with r3f stack

Add per-class 3D viewers for tiles, tokens, cards, and custom models
using React Three Fiber, drei, and postprocessing. Viewers are
lazy-loaded and registered through the existing viewer registry, with a
shared scene wrapper for lighting, orbit controls, and subtle effects.

Add a CORS-safe /asset proxy route so three.js loaders can fetch
Workshop-hosted textures and models, and extend TTSObject with the
CustomMesh and CustomTile/CustomToken fields the viewers read.
This commit is contained in:
2026-08-08 12:56:46 +08:00
parent f390f170da
commit 001d5eeb54
18 changed files with 1037 additions and 14 deletions
+25
View File
@@ -31,6 +31,31 @@ export interface TTSObject {
CustomImage?: {
ImageURL: string;
ImageSecondaryURL: string;
ImageScalar?: number;
WidthScale?: number;
CustomTile?: {
Type: number;
Thickness: number;
Stackable: boolean;
Stretch: boolean;
};
CustomToken?: {
Thickness: number;
MergeDistancePixels: number;
StandUp: boolean;
Stackable: boolean;
};
};
/** A custom 3D model, e.g. `Custom_Model`, `Custom_Model_Bag`. */
CustomMesh?: {
MeshURL: string;
DiffuseURL: string;
NormalURL: string;
ColliderURL: string;
Convex: boolean;
MaterialIndex: number;
TypeIndex: number;
CastShadows: boolean;
};
}