feat(web): place full setup objects at their real transforms
Model TTSObjectTransform in shared types and convert each object's position, rotation, and scale into three.js placement, with per-class base-size corrections and a lay-flat rotation for extruded meshes.
This commit is contained in:
@@ -1,3 +1,20 @@
|
||||
/**
|
||||
* An object's placement in the TTS world: position, rotation (degrees), and
|
||||
* scale. TTS uses a left-handed system with Y up; `posZ` points toward the
|
||||
* player. Present on every object in a save.
|
||||
*/
|
||||
export interface TTSObjectTransform {
|
||||
posX: number;
|
||||
posY: number;
|
||||
posZ: number;
|
||||
rotX: number;
|
||||
rotY: number;
|
||||
rotZ: number;
|
||||
scaleX: number;
|
||||
scaleY: number;
|
||||
scaleZ: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* A single object inside a Tabletop Simulator save file.
|
||||
* Mirrors the structure produced by BSON-deserializing a TTS save.
|
||||
@@ -11,6 +28,8 @@ export interface TTSObject {
|
||||
Description: string;
|
||||
/** Set by `markParent` during traversal; not present in the raw save. */
|
||||
Parent?: TTSObject;
|
||||
/** Placement in the TTS world (position, rotation, scale). */
|
||||
Transform?: TTSObjectTransform;
|
||||
|
||||
CustomPDF?: {
|
||||
PDFUrl: string;
|
||||
|
||||
Reference in New Issue
Block a user