effect-motion 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/Camera.d.ts +186 -49
- package/dist/Camera.js +343 -76
- package/dist/Color.d.ts +101 -1
- package/dist/Color.js +101 -1
- package/dist/EffectMotionError.d.ts +17 -0
- package/dist/EffectMotionError.js +17 -0
- package/dist/Entity.d.ts +682 -38
- package/dist/Entity.js +271 -27
- package/dist/Font.d.ts +108 -0
- package/dist/Font.js +95 -0
- package/dist/Image.d.ts +71 -0
- package/dist/Image.js +50 -0
- package/dist/Instance.d.ts +73 -11
- package/dist/Instance.js +44 -11
- package/dist/Motion.d.ts +328 -53
- package/dist/Motion.js +278 -46
- package/dist/Physics.d.ts +154 -20
- package/dist/Physics.js +92 -11
- package/dist/Projection.d.ts +37 -132
- package/dist/Projection.js +33 -292
- package/dist/Resource.d.ts +26 -0
- package/dist/Resource.js +41 -0
- package/dist/Runner.d.ts +639 -350
- package/dist/Runner.js +197 -150
- package/dist/Scene.d.ts +603 -175
- package/dist/Scene.js +596 -112
- package/dist/Timing.d.ts +170 -13
- package/dist/Timing.js +124 -6
- package/dist/Tree.d.ts +39 -0
- package/dist/Tree.js +127 -0
- package/dist/index.d.ts +54 -5
- package/dist/index.js +56 -5
- package/dist/particles/Particle.d.ts +2 -2
- package/dist/particles/ParticleField.d.ts +8 -6
- package/dist/particles/ParticleField.js +8 -9
- package/dist/particles/constructors.d.ts +5 -6
- package/dist/particles/constructors.js +8 -3
- package/dist/particles/legacy.d.ts +58 -0
- package/dist/particles/legacy.js +46 -0
- package/dist/particles/simulate.js +11 -3
- package/dist/particles/step.js +14 -10
- package/dist/types.d.ts +5 -0
- package/dist/types.js +1 -0
- package/package.json +2 -4
- package/dist/CameraHelpers.d.ts +0 -70
- package/dist/CameraHelpers.js +0 -239
- package/dist/CanvasExporter.d.ts +0 -12
- package/dist/CanvasExporter.js +0 -40
- package/dist/Fonts.d.ts +0 -41
- package/dist/Fonts.js +0 -27
- package/dist/Images.d.ts +0 -33
- package/dist/Images.js +0 -24
- package/dist/PngExporter.d.ts +0 -6
- package/dist/PngExporter.js +0 -85
- package/dist/Renderer.d.ts +0 -118
- package/dist/Renderer.js +0 -508
- package/dist/Shapes.d.ts +0 -11
- package/dist/Shapes.js +0 -11
- package/dist/demo.d.ts +0 -3
- package/dist/demo.js +0 -71
- package/dist/render/dof.d.ts +0 -27
- package/dist/render/dof.js +0 -37
- package/dist/render/paint.d.ts +0 -30
- package/dist/render/paint.js +0 -36
- package/dist/render/shapes.d.ts +0 -42
- package/dist/render/shapes.js +0 -310
- package/dist/shapes/Circle.d.ts +0 -32
- package/dist/shapes/Circle.js +0 -9
- package/dist/shapes/Ellipse.d.ts +0 -35
- package/dist/shapes/Ellipse.js +0 -10
- package/dist/shapes/Group.d.ts +0 -126
- package/dist/shapes/Group.js +0 -89
- package/dist/shapes/Hud.d.ts +0 -38
- package/dist/shapes/Hud.js +0 -35
- package/dist/shapes/Image.d.ts +0 -45
- package/dist/shapes/Image.js +0 -28
- package/dist/shapes/Line.d.ts +0 -47
- package/dist/shapes/Line.js +0 -35
- package/dist/shapes/Path.d.ts +0 -107
- package/dist/shapes/Path.js +0 -32
- package/dist/shapes/Rect.d.ts +0 -51
- package/dist/shapes/Rect.js +0 -22
- package/dist/shapes/Shape2D.d.ts +0 -49
- package/dist/shapes/Shape2D.js +0 -52
- package/dist/shapes/Shapes.d.ts +0 -11
- package/dist/shapes/Shapes.js +0 -11
- package/dist/shapes/Square.d.ts +0 -32
- package/dist/shapes/Square.js +0 -11
- package/dist/shapes/Text.d.ts +0 -51
- package/dist/shapes/Text.js +0 -24
package/dist/Entity.d.ts
CHANGED
|
@@ -1,41 +1,685 @@
|
|
|
1
1
|
import * as Schema from "effect/Schema";
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
2
|
+
import * as Color from "./Color.js";
|
|
3
|
+
/**
|
|
4
|
+
* The closed entity world.
|
|
5
|
+
*
|
|
6
|
+
* Every entity the library knows is a member of one tagged union, declared
|
|
7
|
+
* here. There is deliberately no way to define an entity outside this module:
|
|
8
|
+
* an entity's complete field set is derivable from its `_tag` alone, which
|
|
9
|
+
* is what lets the runner, the animators, and the renderer narrow instead
|
|
10
|
+
* of casting.
|
|
11
|
+
*
|
|
12
|
+
* Shared fields come from mixins, never from per-entity declarations, so no
|
|
13
|
+
* entity can quietly omit or rename one. An `Instance` is a REFERENCE to a
|
|
14
|
+
* live entity in the runner tree — see `Instance.ts`.
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* A point or offset in 3D space.
|
|
18
|
+
*
|
|
19
|
+
* @remarks
|
|
20
|
+
* Scene coordinates with depth: `x` right, `y` UP (the mathematical
|
|
21
|
+
* convention), `z` toward the viewer, origin at the viewport center — a
|
|
22
|
+
* right-handed frame. Every axis defaults to 0, so `vec3({ x: 100 })` is a
|
|
23
|
+
* valid horizontal offset.
|
|
24
|
+
*
|
|
25
|
+
* At `z = 0` content renders exactly as flat 2D. Non-zero `z` is only
|
|
26
|
+
* meaningful under a perspective camera, where it changes apparent size and
|
|
27
|
+
* parallax.
|
|
28
|
+
*/
|
|
29
|
+
export declare const Vec3: Schema.TaggedStruct<"Vec3", {
|
|
30
|
+
readonly x: Schema.withConstructorDefault<Schema.Number>;
|
|
31
|
+
readonly y: Schema.withConstructorDefault<Schema.Number>;
|
|
32
|
+
readonly z: Schema.withConstructorDefault<Schema.Number>;
|
|
33
|
+
}>;
|
|
34
|
+
export type Vec3 = typeof Vec3.Type;
|
|
35
|
+
/**
|
|
36
|
+
* Build a {@link Vec3}; omitted axes are 0.
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* ```typescript
|
|
40
|
+
* Entity.vec3({ x: 100, y: 50 })
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
export declare const vec3: (input: {
|
|
44
|
+
readonly _tag?: "Vec3";
|
|
45
|
+
readonly x?: number;
|
|
46
|
+
readonly y?: number;
|
|
47
|
+
readonly z?: number;
|
|
48
|
+
}, options?: Schema.MakeOptions) => Schema.Struct.ReadonlySide<{
|
|
49
|
+
readonly _tag: Schema.tag<"Vec3">;
|
|
50
|
+
readonly x: Schema.withConstructorDefault<Schema.Number>;
|
|
51
|
+
readonly y: Schema.withConstructorDefault<Schema.Number>;
|
|
52
|
+
readonly z: Schema.withConstructorDefault<Schema.Number>;
|
|
53
|
+
}, "Type">;
|
|
54
|
+
export declare const PathCommand: Schema.TaggedUnion<{
|
|
55
|
+
readonly L: Schema.TaggedStruct<"L", {
|
|
56
|
+
x: Schema.Number;
|
|
57
|
+
y: Schema.Number;
|
|
58
|
+
z: Schema.optionalKey<Schema.Number>;
|
|
59
|
+
}>;
|
|
60
|
+
readonly M: Schema.TaggedStruct<"M", {
|
|
61
|
+
x: Schema.Number;
|
|
62
|
+
y: Schema.Number;
|
|
63
|
+
z: Schema.optionalKey<Schema.Number>;
|
|
64
|
+
}>;
|
|
65
|
+
readonly Z: Schema.TaggedStruct<"Z", {}>;
|
|
66
|
+
}>;
|
|
67
|
+
export type PathCommand = typeof PathCommand.Type;
|
|
68
|
+
/**
|
|
69
|
+
* A segment. `start`/`end` are offsets from `position`, so moving the line
|
|
70
|
+
* translates it rigidly — no endpoint compensation anywhere in the system.
|
|
71
|
+
* Skeletal: parametrized by its endpoints, never by an anchor plus size.
|
|
72
|
+
*/
|
|
73
|
+
export declare const Line: Schema.TaggedStruct<"Line", {
|
|
74
|
+
readonly position: Schema.withConstructorDefault<Schema.TaggedStruct<"Vec3", {
|
|
75
|
+
readonly x: Schema.withConstructorDefault<Schema.Number>;
|
|
76
|
+
readonly y: Schema.withConstructorDefault<Schema.Number>;
|
|
77
|
+
readonly z: Schema.withConstructorDefault<Schema.Number>;
|
|
78
|
+
}>>;
|
|
79
|
+
readonly rotation: Schema.withConstructorDefault<Schema.TaggedStruct<"Vec3", {
|
|
80
|
+
readonly x: Schema.withConstructorDefault<Schema.Number>;
|
|
81
|
+
readonly y: Schema.withConstructorDefault<Schema.Number>;
|
|
82
|
+
readonly z: Schema.withConstructorDefault<Schema.Number>;
|
|
83
|
+
}>>;
|
|
84
|
+
readonly scale: Schema.withConstructorDefault<Schema.TaggedStruct<"Vec3", {
|
|
85
|
+
readonly x: Schema.withConstructorDefault<Schema.Number>;
|
|
86
|
+
readonly y: Schema.withConstructorDefault<Schema.Number>;
|
|
87
|
+
readonly z: Schema.withConstructorDefault<Schema.Number>;
|
|
88
|
+
}>>;
|
|
89
|
+
readonly opacity: Schema.withConstructorDefault<Schema.Number>;
|
|
90
|
+
readonly visible: Schema.withConstructorDefault<Schema.Boolean>;
|
|
91
|
+
readonly strokeWidth: Schema.withConstructorDefault<Schema.Number>;
|
|
92
|
+
readonly strokeColor: Schema.withConstructorDefault<typeof Color.Color>;
|
|
93
|
+
readonly start: Schema.withConstructorDefault<Schema.TaggedStruct<"Vec3", {
|
|
94
|
+
readonly x: Schema.withConstructorDefault<Schema.Number>;
|
|
95
|
+
readonly y: Schema.withConstructorDefault<Schema.Number>;
|
|
96
|
+
readonly z: Schema.withConstructorDefault<Schema.Number>;
|
|
97
|
+
}>>;
|
|
98
|
+
readonly end: Schema.withConstructorDefault<Schema.TaggedStruct<"Vec3", {
|
|
99
|
+
readonly x: Schema.withConstructorDefault<Schema.Number>;
|
|
100
|
+
readonly y: Schema.withConstructorDefault<Schema.Number>;
|
|
101
|
+
readonly z: Schema.withConstructorDefault<Schema.Number>;
|
|
102
|
+
}>>;
|
|
103
|
+
}>;
|
|
104
|
+
/**
|
|
105
|
+
* A polyline/polygon. Command points are relative to `position` (see
|
|
106
|
+
* `point`). The first command must be `M` — an open vocabulary of M/L/Z;
|
|
107
|
+
* curves and arcs arrive later via deterministic flattening.
|
|
108
|
+
*/
|
|
109
|
+
export declare const Path: Schema.TaggedStruct<"Path", {
|
|
110
|
+
readonly position: Schema.withConstructorDefault<Schema.TaggedStruct<"Vec3", {
|
|
111
|
+
readonly x: Schema.withConstructorDefault<Schema.Number>;
|
|
112
|
+
readonly y: Schema.withConstructorDefault<Schema.Number>;
|
|
113
|
+
readonly z: Schema.withConstructorDefault<Schema.Number>;
|
|
114
|
+
}>>;
|
|
115
|
+
readonly rotation: Schema.withConstructorDefault<Schema.TaggedStruct<"Vec3", {
|
|
116
|
+
readonly x: Schema.withConstructorDefault<Schema.Number>;
|
|
117
|
+
readonly y: Schema.withConstructorDefault<Schema.Number>;
|
|
118
|
+
readonly z: Schema.withConstructorDefault<Schema.Number>;
|
|
119
|
+
}>>;
|
|
120
|
+
readonly scale: Schema.withConstructorDefault<Schema.TaggedStruct<"Vec3", {
|
|
121
|
+
readonly x: Schema.withConstructorDefault<Schema.Number>;
|
|
122
|
+
readonly y: Schema.withConstructorDefault<Schema.Number>;
|
|
123
|
+
readonly z: Schema.withConstructorDefault<Schema.Number>;
|
|
124
|
+
}>>;
|
|
125
|
+
readonly opacity: Schema.withConstructorDefault<Schema.Number>;
|
|
126
|
+
readonly visible: Schema.withConstructorDefault<Schema.Boolean>;
|
|
127
|
+
readonly strokeWidth: Schema.withConstructorDefault<Schema.Number>;
|
|
128
|
+
readonly strokeColor: Schema.withConstructorDefault<typeof Color.Color>;
|
|
129
|
+
readonly fillColor: Schema.withConstructorDefault<typeof Color.Color>;
|
|
130
|
+
readonly commands: Schema.NonEmptyArray<Schema.TaggedUnion<{
|
|
131
|
+
readonly L: Schema.TaggedStruct<"L", {
|
|
132
|
+
x: Schema.Number;
|
|
133
|
+
y: Schema.Number;
|
|
134
|
+
z: Schema.optionalKey<Schema.Number>;
|
|
135
|
+
}>;
|
|
136
|
+
readonly M: Schema.TaggedStruct<"M", {
|
|
137
|
+
x: Schema.Number;
|
|
138
|
+
y: Schema.Number;
|
|
139
|
+
z: Schema.optionalKey<Schema.Number>;
|
|
140
|
+
}>;
|
|
141
|
+
readonly Z: Schema.TaggedStruct<"Z", {}>;
|
|
142
|
+
}>>;
|
|
143
|
+
}>;
|
|
144
|
+
/**
|
|
145
|
+
* The canonical 2.5D plane. All-zero rotation is a camera-facing billboard;
|
|
146
|
+
* non-zero tilts it as a real plane in 3D.
|
|
147
|
+
*/
|
|
148
|
+
export declare const Rect: Schema.TaggedStruct<"Rect", {
|
|
149
|
+
readonly position: Schema.withConstructorDefault<Schema.TaggedStruct<"Vec3", {
|
|
150
|
+
readonly x: Schema.withConstructorDefault<Schema.Number>;
|
|
151
|
+
readonly y: Schema.withConstructorDefault<Schema.Number>;
|
|
152
|
+
readonly z: Schema.withConstructorDefault<Schema.Number>;
|
|
153
|
+
}>>;
|
|
154
|
+
readonly rotation: Schema.withConstructorDefault<Schema.TaggedStruct<"Vec3", {
|
|
155
|
+
readonly x: Schema.withConstructorDefault<Schema.Number>;
|
|
156
|
+
readonly y: Schema.withConstructorDefault<Schema.Number>;
|
|
157
|
+
readonly z: Schema.withConstructorDefault<Schema.Number>;
|
|
158
|
+
}>>;
|
|
159
|
+
readonly scale: Schema.withConstructorDefault<Schema.TaggedStruct<"Vec3", {
|
|
160
|
+
readonly x: Schema.withConstructorDefault<Schema.Number>;
|
|
161
|
+
readonly y: Schema.withConstructorDefault<Schema.Number>;
|
|
162
|
+
readonly z: Schema.withConstructorDefault<Schema.Number>;
|
|
163
|
+
}>>;
|
|
164
|
+
readonly opacity: Schema.withConstructorDefault<Schema.Number>;
|
|
165
|
+
readonly visible: Schema.withConstructorDefault<Schema.Boolean>;
|
|
166
|
+
readonly strokeWidth: Schema.withConstructorDefault<Schema.Number>;
|
|
167
|
+
readonly strokeColor: Schema.withConstructorDefault<typeof Color.Color>;
|
|
168
|
+
readonly fillColor: Schema.withConstructorDefault<typeof Color.Color>;
|
|
169
|
+
readonly width: Schema.withConstructorDefault<Schema.Number>;
|
|
170
|
+
readonly height: Schema.withConstructorDefault<Schema.Number>;
|
|
171
|
+
}>;
|
|
172
|
+
/** A filled circle of a given `radius`, centered on its `position`. */
|
|
173
|
+
export declare const Circle: Schema.TaggedStruct<"Circle", {
|
|
174
|
+
readonly position: Schema.withConstructorDefault<Schema.TaggedStruct<"Vec3", {
|
|
175
|
+
readonly x: Schema.withConstructorDefault<Schema.Number>;
|
|
176
|
+
readonly y: Schema.withConstructorDefault<Schema.Number>;
|
|
177
|
+
readonly z: Schema.withConstructorDefault<Schema.Number>;
|
|
178
|
+
}>>;
|
|
179
|
+
readonly rotation: Schema.withConstructorDefault<Schema.TaggedStruct<"Vec3", {
|
|
180
|
+
readonly x: Schema.withConstructorDefault<Schema.Number>;
|
|
181
|
+
readonly y: Schema.withConstructorDefault<Schema.Number>;
|
|
182
|
+
readonly z: Schema.withConstructorDefault<Schema.Number>;
|
|
183
|
+
}>>;
|
|
184
|
+
readonly scale: Schema.withConstructorDefault<Schema.TaggedStruct<"Vec3", {
|
|
185
|
+
readonly x: Schema.withConstructorDefault<Schema.Number>;
|
|
186
|
+
readonly y: Schema.withConstructorDefault<Schema.Number>;
|
|
187
|
+
readonly z: Schema.withConstructorDefault<Schema.Number>;
|
|
188
|
+
}>>;
|
|
189
|
+
readonly opacity: Schema.withConstructorDefault<Schema.Number>;
|
|
190
|
+
readonly visible: Schema.withConstructorDefault<Schema.Boolean>;
|
|
191
|
+
readonly strokeWidth: Schema.withConstructorDefault<Schema.Number>;
|
|
192
|
+
readonly strokeColor: Schema.withConstructorDefault<typeof Color.Color>;
|
|
193
|
+
readonly fillColor: Schema.withConstructorDefault<typeof Color.Color>;
|
|
194
|
+
readonly radius: Schema.withConstructorDefault<Schema.Number>;
|
|
195
|
+
}>;
|
|
196
|
+
/** An ellipse with independent `radiusX` and `radiusY`. */
|
|
197
|
+
export declare const Ellipse: Schema.TaggedStruct<"Ellipse", {
|
|
198
|
+
readonly position: Schema.withConstructorDefault<Schema.TaggedStruct<"Vec3", {
|
|
199
|
+
readonly x: Schema.withConstructorDefault<Schema.Number>;
|
|
200
|
+
readonly y: Schema.withConstructorDefault<Schema.Number>;
|
|
201
|
+
readonly z: Schema.withConstructorDefault<Schema.Number>;
|
|
202
|
+
}>>;
|
|
203
|
+
readonly rotation: Schema.withConstructorDefault<Schema.TaggedStruct<"Vec3", {
|
|
204
|
+
readonly x: Schema.withConstructorDefault<Schema.Number>;
|
|
205
|
+
readonly y: Schema.withConstructorDefault<Schema.Number>;
|
|
206
|
+
readonly z: Schema.withConstructorDefault<Schema.Number>;
|
|
207
|
+
}>>;
|
|
208
|
+
readonly scale: Schema.withConstructorDefault<Schema.TaggedStruct<"Vec3", {
|
|
209
|
+
readonly x: Schema.withConstructorDefault<Schema.Number>;
|
|
210
|
+
readonly y: Schema.withConstructorDefault<Schema.Number>;
|
|
211
|
+
readonly z: Schema.withConstructorDefault<Schema.Number>;
|
|
212
|
+
}>>;
|
|
213
|
+
readonly opacity: Schema.withConstructorDefault<Schema.Number>;
|
|
214
|
+
readonly visible: Schema.withConstructorDefault<Schema.Boolean>;
|
|
215
|
+
readonly strokeWidth: Schema.withConstructorDefault<Schema.Number>;
|
|
216
|
+
readonly strokeColor: Schema.withConstructorDefault<typeof Color.Color>;
|
|
217
|
+
readonly fillColor: Schema.withConstructorDefault<typeof Color.Color>;
|
|
218
|
+
readonly radiusX: Schema.withConstructorDefault<Schema.Number>;
|
|
219
|
+
readonly radiusY: Schema.withConstructorDefault<Schema.Number>;
|
|
220
|
+
}>;
|
|
221
|
+
/**
|
|
222
|
+
* A plain-string text leaf. The engine cannot measure text, so `text` has
|
|
223
|
+
* no dimensional fields — layout is the renderer's business. Inline
|
|
224
|
+
* formatting is expressed by composing several Texts, not by a rich tree.
|
|
225
|
+
*/
|
|
226
|
+
export declare const Text: Schema.TaggedStruct<"Text", {
|
|
227
|
+
readonly position: Schema.withConstructorDefault<Schema.TaggedStruct<"Vec3", {
|
|
228
|
+
readonly x: Schema.withConstructorDefault<Schema.Number>;
|
|
229
|
+
readonly y: Schema.withConstructorDefault<Schema.Number>;
|
|
230
|
+
readonly z: Schema.withConstructorDefault<Schema.Number>;
|
|
231
|
+
}>>;
|
|
232
|
+
readonly rotation: Schema.withConstructorDefault<Schema.TaggedStruct<"Vec3", {
|
|
233
|
+
readonly x: Schema.withConstructorDefault<Schema.Number>;
|
|
234
|
+
readonly y: Schema.withConstructorDefault<Schema.Number>;
|
|
235
|
+
readonly z: Schema.withConstructorDefault<Schema.Number>;
|
|
236
|
+
}>>;
|
|
237
|
+
readonly scale: Schema.withConstructorDefault<Schema.TaggedStruct<"Vec3", {
|
|
238
|
+
readonly x: Schema.withConstructorDefault<Schema.Number>;
|
|
239
|
+
readonly y: Schema.withConstructorDefault<Schema.Number>;
|
|
240
|
+
readonly z: Schema.withConstructorDefault<Schema.Number>;
|
|
241
|
+
}>>;
|
|
242
|
+
readonly opacity: Schema.withConstructorDefault<Schema.Number>;
|
|
243
|
+
readonly visible: Schema.withConstructorDefault<Schema.Boolean>;
|
|
244
|
+
readonly fillColor: Schema.withConstructorDefault<typeof Color.Color>;
|
|
245
|
+
readonly text: Schema.String;
|
|
246
|
+
readonly fontSize: Schema.withConstructorDefault<Schema.Number>;
|
|
247
|
+
readonly fontFamily: Schema.withConstructorDefault<Schema.TaggedStruct<"effect-motion/Resources/Font", {
|
|
248
|
+
readonly id: Schema.String;
|
|
249
|
+
}>>;
|
|
250
|
+
readonly textAnchor: Schema.optionalKey<Schema.Literals<readonly ["start", "middle", "end"]>>;
|
|
251
|
+
readonly baseline: Schema.optionalKey<Schema.Literals<readonly ["auto", "middle", "hanging"]>>;
|
|
252
|
+
}>;
|
|
253
|
+
/**
|
|
254
|
+
* A container: positions and structures its children, paints nothing
|
|
255
|
+
* itself. Its transform composes down the subtree like any entity's.
|
|
256
|
+
*
|
|
257
|
+
* It carries no composition bounds. `width`/`height`/`backgroundColor` used
|
|
258
|
+
* to live here so `Scene.play` could copy a nested scene's dimensions onto
|
|
259
|
+
* the mount group; a Scene owns those itself, and a render-to-texture
|
|
260
|
+
* boundary is `Scene.play`'s business, not a field on every group.
|
|
261
|
+
*/
|
|
262
|
+
export declare const Group: Schema.TaggedStruct<"Group", {
|
|
263
|
+
readonly position: Schema.withConstructorDefault<Schema.TaggedStruct<"Vec3", {
|
|
264
|
+
readonly x: Schema.withConstructorDefault<Schema.Number>;
|
|
265
|
+
readonly y: Schema.withConstructorDefault<Schema.Number>;
|
|
266
|
+
readonly z: Schema.withConstructorDefault<Schema.Number>;
|
|
267
|
+
}>>;
|
|
268
|
+
readonly rotation: Schema.withConstructorDefault<Schema.TaggedStruct<"Vec3", {
|
|
269
|
+
readonly x: Schema.withConstructorDefault<Schema.Number>;
|
|
270
|
+
readonly y: Schema.withConstructorDefault<Schema.Number>;
|
|
271
|
+
readonly z: Schema.withConstructorDefault<Schema.Number>;
|
|
272
|
+
}>>;
|
|
273
|
+
readonly scale: Schema.withConstructorDefault<Schema.TaggedStruct<"Vec3", {
|
|
274
|
+
readonly x: Schema.withConstructorDefault<Schema.Number>;
|
|
275
|
+
readonly y: Schema.withConstructorDefault<Schema.Number>;
|
|
276
|
+
readonly z: Schema.withConstructorDefault<Schema.Number>;
|
|
277
|
+
}>>;
|
|
278
|
+
readonly opacity: Schema.withConstructorDefault<Schema.Number>;
|
|
279
|
+
readonly visible: Schema.withConstructorDefault<Schema.Boolean>;
|
|
280
|
+
readonly children: Schema.withConstructorDefault<Schema.$Array<Schema.String>>;
|
|
281
|
+
}>;
|
|
282
|
+
/**
|
|
283
|
+
* A screen-space container: its subtree is projected through the identity
|
|
284
|
+
* camera rather than the active one, so HUD content ignores camera
|
|
285
|
+
* movement, zoom, and shake, and always paints on top.
|
|
286
|
+
*
|
|
287
|
+
* `position.z` is depth WITHIN the HUD tier — z consistently means depth in
|
|
288
|
+
* the entity's own coordinate space, world for world content and screen for
|
|
289
|
+
* HUD content. A Hud must be a top-level child of the root (or of another
|
|
290
|
+
* Hud); nesting one inside world content is a loud defect.
|
|
291
|
+
*/
|
|
292
|
+
export declare const Hud: Schema.TaggedStruct<"Hud", {
|
|
293
|
+
readonly position: Schema.withConstructorDefault<Schema.TaggedStruct<"Vec3", {
|
|
294
|
+
readonly x: Schema.withConstructorDefault<Schema.Number>;
|
|
295
|
+
readonly y: Schema.withConstructorDefault<Schema.Number>;
|
|
296
|
+
readonly z: Schema.withConstructorDefault<Schema.Number>;
|
|
297
|
+
}>>;
|
|
298
|
+
readonly rotation: Schema.withConstructorDefault<Schema.TaggedStruct<"Vec3", {
|
|
299
|
+
readonly x: Schema.withConstructorDefault<Schema.Number>;
|
|
300
|
+
readonly y: Schema.withConstructorDefault<Schema.Number>;
|
|
301
|
+
readonly z: Schema.withConstructorDefault<Schema.Number>;
|
|
302
|
+
}>>;
|
|
303
|
+
readonly scale: Schema.withConstructorDefault<Schema.TaggedStruct<"Vec3", {
|
|
304
|
+
readonly x: Schema.withConstructorDefault<Schema.Number>;
|
|
305
|
+
readonly y: Schema.withConstructorDefault<Schema.Number>;
|
|
306
|
+
readonly z: Schema.withConstructorDefault<Schema.Number>;
|
|
307
|
+
}>>;
|
|
308
|
+
readonly opacity: Schema.withConstructorDefault<Schema.Number>;
|
|
309
|
+
readonly visible: Schema.withConstructorDefault<Schema.Boolean>;
|
|
310
|
+
readonly children: Schema.withConstructorDefault<Schema.$Array<Schema.String>>;
|
|
311
|
+
}>;
|
|
312
|
+
/**
|
|
313
|
+
* A raster/vector image leaf. `image` is an Image resource reference; the
|
|
314
|
+
* bytes live in the scene's requirements, never in frame data.
|
|
315
|
+
*
|
|
316
|
+
* `width`/`height` are optional and undefaulted: set BOTH to draw at that
|
|
317
|
+
* size (numeric, so they tween), leave both absent for the source's natural
|
|
318
|
+
* size. A lone dimension is ignored — aspect math needs the natural size,
|
|
319
|
+
* which frame data never sees.
|
|
320
|
+
*/
|
|
321
|
+
export declare const Image: Schema.TaggedStruct<"Image", {
|
|
322
|
+
readonly position: Schema.withConstructorDefault<Schema.TaggedStruct<"Vec3", {
|
|
323
|
+
readonly x: Schema.withConstructorDefault<Schema.Number>;
|
|
324
|
+
readonly y: Schema.withConstructorDefault<Schema.Number>;
|
|
325
|
+
readonly z: Schema.withConstructorDefault<Schema.Number>;
|
|
326
|
+
}>>;
|
|
327
|
+
readonly rotation: Schema.withConstructorDefault<Schema.TaggedStruct<"Vec3", {
|
|
328
|
+
readonly x: Schema.withConstructorDefault<Schema.Number>;
|
|
329
|
+
readonly y: Schema.withConstructorDefault<Schema.Number>;
|
|
330
|
+
readonly z: Schema.withConstructorDefault<Schema.Number>;
|
|
331
|
+
}>>;
|
|
332
|
+
readonly scale: Schema.withConstructorDefault<Schema.TaggedStruct<"Vec3", {
|
|
333
|
+
readonly x: Schema.withConstructorDefault<Schema.Number>;
|
|
334
|
+
readonly y: Schema.withConstructorDefault<Schema.Number>;
|
|
335
|
+
readonly z: Schema.withConstructorDefault<Schema.Number>;
|
|
336
|
+
}>>;
|
|
337
|
+
readonly opacity: Schema.withConstructorDefault<Schema.Number>;
|
|
338
|
+
readonly visible: Schema.withConstructorDefault<Schema.Boolean>;
|
|
339
|
+
readonly image: Schema.TaggedStruct<"effect-motion/Resources/Image", {
|
|
340
|
+
readonly id: Schema.String;
|
|
341
|
+
}>;
|
|
342
|
+
readonly width: Schema.optionalKey<Schema.Number>;
|
|
343
|
+
readonly height: Schema.optionalKey<Schema.Number>;
|
|
344
|
+
}>;
|
|
345
|
+
/**
|
|
346
|
+
* The viewpoint — the one entity that is never drawn.
|
|
347
|
+
*
|
|
348
|
+
* @remarks
|
|
349
|
+
* A camera is view state rather than content, so it carries `position` and
|
|
350
|
+
* `rotation` but no `scale`, `opacity`, or `visible`, and is absent from the
|
|
351
|
+
* frame's instance map. Every scene has one already; reach for it with
|
|
352
|
+
* `Scene.camera`.
|
|
353
|
+
*
|
|
354
|
+
* `focalLength` sets the perspective strength — a longer lens flattens
|
|
355
|
+
* depth, a shorter one exaggerates it. It and the resting `z` are
|
|
356
|
+
* width-relative and filled in by the runner at instantiate time (only the
|
|
357
|
+
* runner knows the composition width), so the zero defaults here are
|
|
358
|
+
* placeholders that are always overwritten. The resting values are chosen so
|
|
359
|
+
* content at `z = 0` renders exactly as flat 2D.
|
|
360
|
+
*
|
|
361
|
+
* `poi` is an optional point of interest: when set, the camera auto-aims at
|
|
362
|
+
* that world point and any explicit `rotation` composes on top of the aim.
|
|
363
|
+
* The `Camera` module's helpers are the ergonomic way to drive it.
|
|
364
|
+
*
|
|
365
|
+
* `aperture` and `focusDistance` describe depth of field. They are carried
|
|
366
|
+
* on the frame but currently have NO visual effect — depth-of-field
|
|
367
|
+
* rendering is not implemented, and every frame renders sharp.
|
|
368
|
+
*/
|
|
369
|
+
export declare const Camera: Schema.TaggedStruct<"Camera", {
|
|
370
|
+
readonly position: Schema.withConstructorDefault<Schema.TaggedStruct<"Vec3", {
|
|
371
|
+
readonly x: Schema.withConstructorDefault<Schema.Number>;
|
|
372
|
+
readonly y: Schema.withConstructorDefault<Schema.Number>;
|
|
373
|
+
readonly z: Schema.withConstructorDefault<Schema.Number>;
|
|
374
|
+
}>>;
|
|
375
|
+
readonly rotation: Schema.withConstructorDefault<Schema.TaggedStruct<"Vec3", {
|
|
376
|
+
readonly x: Schema.withConstructorDefault<Schema.Number>;
|
|
377
|
+
readonly y: Schema.withConstructorDefault<Schema.Number>;
|
|
378
|
+
readonly z: Schema.withConstructorDefault<Schema.Number>;
|
|
379
|
+
}>>;
|
|
380
|
+
readonly focalLength: Schema.withConstructorDefault<Schema.Number>;
|
|
381
|
+
readonly focusDistance: Schema.withConstructorDefault<Schema.Number>;
|
|
382
|
+
readonly aperture: Schema.withConstructorDefault<Schema.Number>;
|
|
383
|
+
readonly poi: Schema.withConstructorDefault<Schema.NullOr<Schema.TaggedStruct<"Vec3", {
|
|
384
|
+
readonly x: Schema.withConstructorDefault<Schema.Number>;
|
|
385
|
+
readonly y: Schema.withConstructorDefault<Schema.Number>;
|
|
386
|
+
readonly z: Schema.withConstructorDefault<Schema.Number>;
|
|
387
|
+
}>>>;
|
|
388
|
+
}>;
|
|
389
|
+
export declare const EntityMap: {
|
|
390
|
+
readonly Line: Schema.TaggedStruct<"Line", {
|
|
391
|
+
readonly position: Schema.withConstructorDefault<Schema.TaggedStruct<"Vec3", {
|
|
392
|
+
readonly x: Schema.withConstructorDefault<Schema.Number>;
|
|
393
|
+
readonly y: Schema.withConstructorDefault<Schema.Number>;
|
|
394
|
+
readonly z: Schema.withConstructorDefault<Schema.Number>;
|
|
395
|
+
}>>;
|
|
396
|
+
readonly rotation: Schema.withConstructorDefault<Schema.TaggedStruct<"Vec3", {
|
|
397
|
+
readonly x: Schema.withConstructorDefault<Schema.Number>;
|
|
398
|
+
readonly y: Schema.withConstructorDefault<Schema.Number>;
|
|
399
|
+
readonly z: Schema.withConstructorDefault<Schema.Number>;
|
|
400
|
+
}>>;
|
|
401
|
+
readonly scale: Schema.withConstructorDefault<Schema.TaggedStruct<"Vec3", {
|
|
402
|
+
readonly x: Schema.withConstructorDefault<Schema.Number>;
|
|
403
|
+
readonly y: Schema.withConstructorDefault<Schema.Number>;
|
|
404
|
+
readonly z: Schema.withConstructorDefault<Schema.Number>;
|
|
405
|
+
}>>;
|
|
406
|
+
readonly opacity: Schema.withConstructorDefault<Schema.Number>;
|
|
407
|
+
readonly visible: Schema.withConstructorDefault<Schema.Boolean>;
|
|
408
|
+
readonly strokeWidth: Schema.withConstructorDefault<Schema.Number>;
|
|
409
|
+
readonly strokeColor: Schema.withConstructorDefault<typeof Color.Color>;
|
|
410
|
+
readonly start: Schema.withConstructorDefault<Schema.TaggedStruct<"Vec3", {
|
|
411
|
+
readonly x: Schema.withConstructorDefault<Schema.Number>;
|
|
412
|
+
readonly y: Schema.withConstructorDefault<Schema.Number>;
|
|
413
|
+
readonly z: Schema.withConstructorDefault<Schema.Number>;
|
|
414
|
+
}>>;
|
|
415
|
+
readonly end: Schema.withConstructorDefault<Schema.TaggedStruct<"Vec3", {
|
|
416
|
+
readonly x: Schema.withConstructorDefault<Schema.Number>;
|
|
417
|
+
readonly y: Schema.withConstructorDefault<Schema.Number>;
|
|
418
|
+
readonly z: Schema.withConstructorDefault<Schema.Number>;
|
|
419
|
+
}>>;
|
|
420
|
+
}>;
|
|
421
|
+
readonly Path: Schema.TaggedStruct<"Path", {
|
|
422
|
+
readonly position: Schema.withConstructorDefault<Schema.TaggedStruct<"Vec3", {
|
|
423
|
+
readonly x: Schema.withConstructorDefault<Schema.Number>;
|
|
424
|
+
readonly y: Schema.withConstructorDefault<Schema.Number>;
|
|
425
|
+
readonly z: Schema.withConstructorDefault<Schema.Number>;
|
|
426
|
+
}>>;
|
|
427
|
+
readonly rotation: Schema.withConstructorDefault<Schema.TaggedStruct<"Vec3", {
|
|
428
|
+
readonly x: Schema.withConstructorDefault<Schema.Number>;
|
|
429
|
+
readonly y: Schema.withConstructorDefault<Schema.Number>;
|
|
430
|
+
readonly z: Schema.withConstructorDefault<Schema.Number>;
|
|
431
|
+
}>>;
|
|
432
|
+
readonly scale: Schema.withConstructorDefault<Schema.TaggedStruct<"Vec3", {
|
|
433
|
+
readonly x: Schema.withConstructorDefault<Schema.Number>;
|
|
434
|
+
readonly y: Schema.withConstructorDefault<Schema.Number>;
|
|
435
|
+
readonly z: Schema.withConstructorDefault<Schema.Number>;
|
|
436
|
+
}>>;
|
|
437
|
+
readonly opacity: Schema.withConstructorDefault<Schema.Number>;
|
|
438
|
+
readonly visible: Schema.withConstructorDefault<Schema.Boolean>;
|
|
439
|
+
readonly strokeWidth: Schema.withConstructorDefault<Schema.Number>;
|
|
440
|
+
readonly strokeColor: Schema.withConstructorDefault<typeof Color.Color>;
|
|
441
|
+
readonly fillColor: Schema.withConstructorDefault<typeof Color.Color>;
|
|
442
|
+
readonly commands: Schema.NonEmptyArray<Schema.TaggedUnion<{
|
|
443
|
+
readonly L: Schema.TaggedStruct<"L", {
|
|
444
|
+
x: Schema.Number;
|
|
445
|
+
y: Schema.Number;
|
|
446
|
+
z: Schema.optionalKey<Schema.Number>;
|
|
447
|
+
}>;
|
|
448
|
+
readonly M: Schema.TaggedStruct<"M", {
|
|
449
|
+
x: Schema.Number;
|
|
450
|
+
y: Schema.Number;
|
|
451
|
+
z: Schema.optionalKey<Schema.Number>;
|
|
452
|
+
}>;
|
|
453
|
+
readonly Z: Schema.TaggedStruct<"Z", {}>;
|
|
454
|
+
}>>;
|
|
455
|
+
}>;
|
|
456
|
+
readonly Rect: Schema.TaggedStruct<"Rect", {
|
|
457
|
+
readonly position: Schema.withConstructorDefault<Schema.TaggedStruct<"Vec3", {
|
|
458
|
+
readonly x: Schema.withConstructorDefault<Schema.Number>;
|
|
459
|
+
readonly y: Schema.withConstructorDefault<Schema.Number>;
|
|
460
|
+
readonly z: Schema.withConstructorDefault<Schema.Number>;
|
|
461
|
+
}>>;
|
|
462
|
+
readonly rotation: Schema.withConstructorDefault<Schema.TaggedStruct<"Vec3", {
|
|
463
|
+
readonly x: Schema.withConstructorDefault<Schema.Number>;
|
|
464
|
+
readonly y: Schema.withConstructorDefault<Schema.Number>;
|
|
465
|
+
readonly z: Schema.withConstructorDefault<Schema.Number>;
|
|
466
|
+
}>>;
|
|
467
|
+
readonly scale: Schema.withConstructorDefault<Schema.TaggedStruct<"Vec3", {
|
|
468
|
+
readonly x: Schema.withConstructorDefault<Schema.Number>;
|
|
469
|
+
readonly y: Schema.withConstructorDefault<Schema.Number>;
|
|
470
|
+
readonly z: Schema.withConstructorDefault<Schema.Number>;
|
|
471
|
+
}>>;
|
|
472
|
+
readonly opacity: Schema.withConstructorDefault<Schema.Number>;
|
|
473
|
+
readonly visible: Schema.withConstructorDefault<Schema.Boolean>;
|
|
474
|
+
readonly strokeWidth: Schema.withConstructorDefault<Schema.Number>;
|
|
475
|
+
readonly strokeColor: Schema.withConstructorDefault<typeof Color.Color>;
|
|
476
|
+
readonly fillColor: Schema.withConstructorDefault<typeof Color.Color>;
|
|
477
|
+
readonly width: Schema.withConstructorDefault<Schema.Number>;
|
|
478
|
+
readonly height: Schema.withConstructorDefault<Schema.Number>;
|
|
479
|
+
}>;
|
|
480
|
+
readonly Circle: Schema.TaggedStruct<"Circle", {
|
|
481
|
+
readonly position: Schema.withConstructorDefault<Schema.TaggedStruct<"Vec3", {
|
|
482
|
+
readonly x: Schema.withConstructorDefault<Schema.Number>;
|
|
483
|
+
readonly y: Schema.withConstructorDefault<Schema.Number>;
|
|
484
|
+
readonly z: Schema.withConstructorDefault<Schema.Number>;
|
|
485
|
+
}>>;
|
|
486
|
+
readonly rotation: Schema.withConstructorDefault<Schema.TaggedStruct<"Vec3", {
|
|
487
|
+
readonly x: Schema.withConstructorDefault<Schema.Number>;
|
|
488
|
+
readonly y: Schema.withConstructorDefault<Schema.Number>;
|
|
489
|
+
readonly z: Schema.withConstructorDefault<Schema.Number>;
|
|
490
|
+
}>>;
|
|
491
|
+
readonly scale: Schema.withConstructorDefault<Schema.TaggedStruct<"Vec3", {
|
|
492
|
+
readonly x: Schema.withConstructorDefault<Schema.Number>;
|
|
493
|
+
readonly y: Schema.withConstructorDefault<Schema.Number>;
|
|
494
|
+
readonly z: Schema.withConstructorDefault<Schema.Number>;
|
|
495
|
+
}>>;
|
|
496
|
+
readonly opacity: Schema.withConstructorDefault<Schema.Number>;
|
|
497
|
+
readonly visible: Schema.withConstructorDefault<Schema.Boolean>;
|
|
498
|
+
readonly strokeWidth: Schema.withConstructorDefault<Schema.Number>;
|
|
499
|
+
readonly strokeColor: Schema.withConstructorDefault<typeof Color.Color>;
|
|
500
|
+
readonly fillColor: Schema.withConstructorDefault<typeof Color.Color>;
|
|
501
|
+
readonly radius: Schema.withConstructorDefault<Schema.Number>;
|
|
502
|
+
}>;
|
|
503
|
+
readonly Ellipse: Schema.TaggedStruct<"Ellipse", {
|
|
504
|
+
readonly position: Schema.withConstructorDefault<Schema.TaggedStruct<"Vec3", {
|
|
505
|
+
readonly x: Schema.withConstructorDefault<Schema.Number>;
|
|
506
|
+
readonly y: Schema.withConstructorDefault<Schema.Number>;
|
|
507
|
+
readonly z: Schema.withConstructorDefault<Schema.Number>;
|
|
508
|
+
}>>;
|
|
509
|
+
readonly rotation: Schema.withConstructorDefault<Schema.TaggedStruct<"Vec3", {
|
|
510
|
+
readonly x: Schema.withConstructorDefault<Schema.Number>;
|
|
511
|
+
readonly y: Schema.withConstructorDefault<Schema.Number>;
|
|
512
|
+
readonly z: Schema.withConstructorDefault<Schema.Number>;
|
|
513
|
+
}>>;
|
|
514
|
+
readonly scale: Schema.withConstructorDefault<Schema.TaggedStruct<"Vec3", {
|
|
515
|
+
readonly x: Schema.withConstructorDefault<Schema.Number>;
|
|
516
|
+
readonly y: Schema.withConstructorDefault<Schema.Number>;
|
|
517
|
+
readonly z: Schema.withConstructorDefault<Schema.Number>;
|
|
518
|
+
}>>;
|
|
519
|
+
readonly opacity: Schema.withConstructorDefault<Schema.Number>;
|
|
520
|
+
readonly visible: Schema.withConstructorDefault<Schema.Boolean>;
|
|
521
|
+
readonly strokeWidth: Schema.withConstructorDefault<Schema.Number>;
|
|
522
|
+
readonly strokeColor: Schema.withConstructorDefault<typeof Color.Color>;
|
|
523
|
+
readonly fillColor: Schema.withConstructorDefault<typeof Color.Color>;
|
|
524
|
+
readonly radiusX: Schema.withConstructorDefault<Schema.Number>;
|
|
525
|
+
readonly radiusY: Schema.withConstructorDefault<Schema.Number>;
|
|
526
|
+
}>;
|
|
527
|
+
readonly Text: Schema.TaggedStruct<"Text", {
|
|
528
|
+
readonly position: Schema.withConstructorDefault<Schema.TaggedStruct<"Vec3", {
|
|
529
|
+
readonly x: Schema.withConstructorDefault<Schema.Number>;
|
|
530
|
+
readonly y: Schema.withConstructorDefault<Schema.Number>;
|
|
531
|
+
readonly z: Schema.withConstructorDefault<Schema.Number>;
|
|
532
|
+
}>>;
|
|
533
|
+
readonly rotation: Schema.withConstructorDefault<Schema.TaggedStruct<"Vec3", {
|
|
534
|
+
readonly x: Schema.withConstructorDefault<Schema.Number>;
|
|
535
|
+
readonly y: Schema.withConstructorDefault<Schema.Number>;
|
|
536
|
+
readonly z: Schema.withConstructorDefault<Schema.Number>;
|
|
537
|
+
}>>;
|
|
538
|
+
readonly scale: Schema.withConstructorDefault<Schema.TaggedStruct<"Vec3", {
|
|
539
|
+
readonly x: Schema.withConstructorDefault<Schema.Number>;
|
|
540
|
+
readonly y: Schema.withConstructorDefault<Schema.Number>;
|
|
541
|
+
readonly z: Schema.withConstructorDefault<Schema.Number>;
|
|
542
|
+
}>>;
|
|
543
|
+
readonly opacity: Schema.withConstructorDefault<Schema.Number>;
|
|
544
|
+
readonly visible: Schema.withConstructorDefault<Schema.Boolean>;
|
|
545
|
+
readonly fillColor: Schema.withConstructorDefault<typeof Color.Color>;
|
|
546
|
+
readonly text: Schema.String;
|
|
547
|
+
readonly fontSize: Schema.withConstructorDefault<Schema.Number>;
|
|
548
|
+
readonly fontFamily: Schema.withConstructorDefault<Schema.TaggedStruct<"effect-motion/Resources/Font", {
|
|
549
|
+
readonly id: Schema.String;
|
|
550
|
+
}>>;
|
|
551
|
+
readonly textAnchor: Schema.optionalKey<Schema.Literals<readonly ["start", "middle", "end"]>>;
|
|
552
|
+
readonly baseline: Schema.optionalKey<Schema.Literals<readonly ["auto", "middle", "hanging"]>>;
|
|
553
|
+
}>;
|
|
554
|
+
readonly Group: Schema.TaggedStruct<"Group", {
|
|
555
|
+
readonly position: Schema.withConstructorDefault<Schema.TaggedStruct<"Vec3", {
|
|
556
|
+
readonly x: Schema.withConstructorDefault<Schema.Number>;
|
|
557
|
+
readonly y: Schema.withConstructorDefault<Schema.Number>;
|
|
558
|
+
readonly z: Schema.withConstructorDefault<Schema.Number>;
|
|
559
|
+
}>>;
|
|
560
|
+
readonly rotation: Schema.withConstructorDefault<Schema.TaggedStruct<"Vec3", {
|
|
561
|
+
readonly x: Schema.withConstructorDefault<Schema.Number>;
|
|
562
|
+
readonly y: Schema.withConstructorDefault<Schema.Number>;
|
|
563
|
+
readonly z: Schema.withConstructorDefault<Schema.Number>;
|
|
564
|
+
}>>;
|
|
565
|
+
readonly scale: Schema.withConstructorDefault<Schema.TaggedStruct<"Vec3", {
|
|
566
|
+
readonly x: Schema.withConstructorDefault<Schema.Number>;
|
|
567
|
+
readonly y: Schema.withConstructorDefault<Schema.Number>;
|
|
568
|
+
readonly z: Schema.withConstructorDefault<Schema.Number>;
|
|
569
|
+
}>>;
|
|
570
|
+
readonly opacity: Schema.withConstructorDefault<Schema.Number>;
|
|
571
|
+
readonly visible: Schema.withConstructorDefault<Schema.Boolean>;
|
|
572
|
+
readonly children: Schema.withConstructorDefault<Schema.$Array<Schema.String>>;
|
|
573
|
+
}>;
|
|
574
|
+
readonly Hud: Schema.TaggedStruct<"Hud", {
|
|
575
|
+
readonly position: Schema.withConstructorDefault<Schema.TaggedStruct<"Vec3", {
|
|
576
|
+
readonly x: Schema.withConstructorDefault<Schema.Number>;
|
|
577
|
+
readonly y: Schema.withConstructorDefault<Schema.Number>;
|
|
578
|
+
readonly z: Schema.withConstructorDefault<Schema.Number>;
|
|
579
|
+
}>>;
|
|
580
|
+
readonly rotation: Schema.withConstructorDefault<Schema.TaggedStruct<"Vec3", {
|
|
581
|
+
readonly x: Schema.withConstructorDefault<Schema.Number>;
|
|
582
|
+
readonly y: Schema.withConstructorDefault<Schema.Number>;
|
|
583
|
+
readonly z: Schema.withConstructorDefault<Schema.Number>;
|
|
584
|
+
}>>;
|
|
585
|
+
readonly scale: Schema.withConstructorDefault<Schema.TaggedStruct<"Vec3", {
|
|
586
|
+
readonly x: Schema.withConstructorDefault<Schema.Number>;
|
|
587
|
+
readonly y: Schema.withConstructorDefault<Schema.Number>;
|
|
588
|
+
readonly z: Schema.withConstructorDefault<Schema.Number>;
|
|
589
|
+
}>>;
|
|
590
|
+
readonly opacity: Schema.withConstructorDefault<Schema.Number>;
|
|
591
|
+
readonly visible: Schema.withConstructorDefault<Schema.Boolean>;
|
|
592
|
+
readonly children: Schema.withConstructorDefault<Schema.$Array<Schema.String>>;
|
|
593
|
+
}>;
|
|
594
|
+
readonly Image: Schema.TaggedStruct<"Image", {
|
|
595
|
+
readonly position: Schema.withConstructorDefault<Schema.TaggedStruct<"Vec3", {
|
|
596
|
+
readonly x: Schema.withConstructorDefault<Schema.Number>;
|
|
597
|
+
readonly y: Schema.withConstructorDefault<Schema.Number>;
|
|
598
|
+
readonly z: Schema.withConstructorDefault<Schema.Number>;
|
|
599
|
+
}>>;
|
|
600
|
+
readonly rotation: Schema.withConstructorDefault<Schema.TaggedStruct<"Vec3", {
|
|
601
|
+
readonly x: Schema.withConstructorDefault<Schema.Number>;
|
|
602
|
+
readonly y: Schema.withConstructorDefault<Schema.Number>;
|
|
603
|
+
readonly z: Schema.withConstructorDefault<Schema.Number>;
|
|
604
|
+
}>>;
|
|
605
|
+
readonly scale: Schema.withConstructorDefault<Schema.TaggedStruct<"Vec3", {
|
|
606
|
+
readonly x: Schema.withConstructorDefault<Schema.Number>;
|
|
607
|
+
readonly y: Schema.withConstructorDefault<Schema.Number>;
|
|
608
|
+
readonly z: Schema.withConstructorDefault<Schema.Number>;
|
|
609
|
+
}>>;
|
|
610
|
+
readonly opacity: Schema.withConstructorDefault<Schema.Number>;
|
|
611
|
+
readonly visible: Schema.withConstructorDefault<Schema.Boolean>;
|
|
612
|
+
readonly image: Schema.TaggedStruct<"effect-motion/Resources/Image", {
|
|
613
|
+
readonly id: Schema.String;
|
|
614
|
+
}>;
|
|
615
|
+
readonly width: Schema.optionalKey<Schema.Number>;
|
|
616
|
+
readonly height: Schema.optionalKey<Schema.Number>;
|
|
617
|
+
}>;
|
|
618
|
+
readonly Camera: Schema.TaggedStruct<"Camera", {
|
|
619
|
+
readonly position: Schema.withConstructorDefault<Schema.TaggedStruct<"Vec3", {
|
|
620
|
+
readonly x: Schema.withConstructorDefault<Schema.Number>;
|
|
621
|
+
readonly y: Schema.withConstructorDefault<Schema.Number>;
|
|
622
|
+
readonly z: Schema.withConstructorDefault<Schema.Number>;
|
|
623
|
+
}>>;
|
|
624
|
+
readonly rotation: Schema.withConstructorDefault<Schema.TaggedStruct<"Vec3", {
|
|
625
|
+
readonly x: Schema.withConstructorDefault<Schema.Number>;
|
|
626
|
+
readonly y: Schema.withConstructorDefault<Schema.Number>;
|
|
627
|
+
readonly z: Schema.withConstructorDefault<Schema.Number>;
|
|
628
|
+
}>>;
|
|
629
|
+
readonly focalLength: Schema.withConstructorDefault<Schema.Number>;
|
|
630
|
+
readonly focusDistance: Schema.withConstructorDefault<Schema.Number>;
|
|
631
|
+
readonly aperture: Schema.withConstructorDefault<Schema.Number>;
|
|
632
|
+
readonly poi: Schema.withConstructorDefault<Schema.NullOr<Schema.TaggedStruct<"Vec3", {
|
|
633
|
+
readonly x: Schema.withConstructorDefault<Schema.Number>;
|
|
634
|
+
readonly y: Schema.withConstructorDefault<Schema.Number>;
|
|
635
|
+
readonly z: Schema.withConstructorDefault<Schema.Number>;
|
|
636
|
+
}>>>;
|
|
637
|
+
}>;
|
|
28
638
|
};
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
639
|
+
/**
|
|
640
|
+
* Any entity's data — the union of every kind the library knows.
|
|
641
|
+
*
|
|
642
|
+
* @remarks
|
|
643
|
+
* Closed by design: `_tag` identifies the member, so the runner, the
|
|
644
|
+
* animators, and renderers all narrow on it instead of casting. Consumers
|
|
645
|
+
* switch on `_tag` and get the exact field set for that entity.
|
|
646
|
+
*/
|
|
647
|
+
export type Entity = (typeof EntityMap)[keyof typeof EntityMap]["Type"];
|
|
648
|
+
/**
|
|
649
|
+
* Every entity kind's name — `"Circle"`, `"Rect"`, `"Text"`, and the rest.
|
|
650
|
+
* This is what you pass to `Scene.instantiate`.
|
|
651
|
+
*/
|
|
652
|
+
export type EntityTag = Entity["_tag"];
|
|
653
|
+
/** The data type of one entity kind, selected by its tag. */
|
|
654
|
+
export type EntityByTag<Tag extends EntityTag> = Extract<Entity, {
|
|
655
|
+
_tag: Tag;
|
|
656
|
+
}>;
|
|
657
|
+
/** the definition (schema) of one entity, by tag */
|
|
658
|
+
type EntityDefinitionByTag<Tag extends EntityTag> = (typeof EntityMap)[Tag];
|
|
659
|
+
export declare const getEntityDefinitionByTag: <Tag extends EntityTag>(tag: Tag) => EntityDefinitionByTag<Tag>;
|
|
660
|
+
/**
|
|
661
|
+
* The constructor input for one entity: what `make` accepts, with defaulted
|
|
662
|
+
* fields optional. This is the authoring surface — `instantiate` widens
|
|
663
|
+
* `children` on top of it (see Runner.InstantiateProps).
|
|
664
|
+
*/
|
|
665
|
+
export type MakeInput<Tag extends EntityTag> = EntityDefinitionByTag<Tag>["~type.make.in"];
|
|
666
|
+
/**
|
|
667
|
+
* Tags whose entity carries a given field — how animators state their
|
|
668
|
+
* requirements now that traits are gone. `TagsWith<"opacity">` is every
|
|
669
|
+
* paintable entity; `fade` constrains on it, so fading a Camera is a
|
|
670
|
+
* compile error naming the missing field rather than a runtime defect.
|
|
671
|
+
*/
|
|
672
|
+
export type TagsWith<Field extends string> = Extract<Entity, Record<Field, unknown>>["_tag"];
|
|
673
|
+
/** The entity kinds that can hold children: `Group` and `Hud`. */
|
|
674
|
+
export type ContainerTag = TagsWith<"children">;
|
|
675
|
+
/** entity data narrowed to a container */
|
|
676
|
+
type ContainerEntity = Extract<Entity, {
|
|
677
|
+
children: ReadonlyArray<string>;
|
|
678
|
+
}>;
|
|
679
|
+
/**
|
|
680
|
+
* Whether an entity can hold children. Previously this was "does its data
|
|
681
|
+
* have a `children` field", answerable only at runtime because entity shapes
|
|
682
|
+
* were unknowable; now it is a property of the tag.
|
|
683
|
+
*/
|
|
684
|
+
export declare const isContainer: (entity: Entity) => entity is ContainerEntity;
|
|
41
685
|
export {};
|