@zylem/game-lib 0.6.4 → 0.8.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.
Files changed (156) hide show
  1. package/README.md +18 -2
  2. package/dist/actions.d.ts +321 -11
  3. package/dist/actions.js +1 -936
  4. package/dist/api/game-lib.api.json +54074 -0
  5. package/dist/api/game-lib.api.md +4544 -0
  6. package/dist/api/game-lib.d.ts +8258 -0
  7. package/dist/api/game-lib.typedoc.json +345421 -0
  8. package/dist/audio.d.ts +13 -0
  9. package/dist/audio.js +1 -0
  10. package/dist/base-node-life-cycle-D2NuN1VB.d.ts +151 -0
  11. package/dist/behavior.d.ts +2 -0
  12. package/dist/behavior.js +1 -0
  13. package/dist/blueprints-TbGY-h53.d.ts +162 -0
  14. package/dist/chunk-4QLJUQSJ.js +1 -0
  15. package/dist/chunk-7FR5JSQ2.js +1 -0
  16. package/dist/chunk-7GYFZKK7.js +1 -0
  17. package/dist/chunk-7WRQ2UAN.js +1 -0
  18. package/dist/chunk-BH53MBAZ.js +1 -0
  19. package/dist/chunk-BIGH6D34.js +0 -0
  20. package/dist/chunk-CM5YRNBJ.js +19 -0
  21. package/dist/chunk-COM6HJ2L.js +1 -0
  22. package/dist/chunk-D2PATZCC.js +1 -0
  23. package/dist/chunk-DFLI7ICU.js +0 -0
  24. package/dist/chunk-E3UBSUPX.js +1 -0
  25. package/dist/chunk-FKIKN7RP.js +24 -0
  26. package/dist/chunk-G4HONLWC.js +1 -0
  27. package/dist/chunk-IKWE2W6L.js +1 -0
  28. package/dist/chunk-IPWUDOV5.js +1 -0
  29. package/dist/chunk-JEHFHUH4.js +0 -0
  30. package/dist/chunk-JNKPTL77.js +1 -0
  31. package/dist/chunk-JQKS42G4.js +1 -0
  32. package/dist/chunk-M3XNO56P.js +1 -0
  33. package/dist/chunk-MSC2BEO5.js +1 -0
  34. package/dist/chunk-ORIDWL3T.js +0 -0
  35. package/dist/chunk-QB3NL7VQ.js +1 -0
  36. package/dist/chunk-QXVH6POE.js +1 -0
  37. package/dist/chunk-RXDTAWI2.js +29 -0
  38. package/dist/chunk-TAUWDQZF.js +9 -0
  39. package/dist/chunk-VS2D4B3W.js +1 -0
  40. package/dist/chunk-WQ3WMMZD.js +1 -0
  41. package/dist/chunk-XK63E4SX.js +1 -0
  42. package/dist/chunk-XNDS4YFR.js +1 -0
  43. package/dist/chunk-XNHVRFAK.js +1 -0
  44. package/dist/chunk-XRP4JJXL.js +1 -0
  45. package/dist/chunk-YHEWKN7N.js +1 -0
  46. package/dist/chunk-ZRT3ZQVH.js +1 -0
  47. package/dist/collision-builder-jF-toPIl.d.ts +38 -0
  48. package/dist/core.d.ts +223 -16
  49. package/dist/core.js +1 -12424
  50. package/dist/debug-state-BPT6jEog.d.ts +17 -0
  51. package/dist/debug.d.ts +76 -0
  52. package/dist/debug.js +1 -0
  53. package/dist/default-controls-0-vCnli7.d.ts +111 -0
  54. package/dist/{entity-vj-HTjzU.d.ts → entity-BdSI8CL3.d.ts} +119 -626
  55. package/dist/{entity-Bq_eNEDI.d.ts → entity-DZbFQ1Wg.d.ts} +4 -4
  56. package/dist/entity-type-map-Bd69SpAS.d.ts +928 -0
  57. package/dist/entity.d.ts +268 -0
  58. package/dist/entity.js +1 -0
  59. package/dist/events.d.ts +181 -0
  60. package/dist/events.js +1 -0
  61. package/dist/game-C1FHVqXl.d.ts +1886 -0
  62. package/dist/game-default-QHROHW2O.js +1 -0
  63. package/dist/game-interfaces-mchNYSZE.d.ts +90 -0
  64. package/dist/globals.d.ts +115 -0
  65. package/dist/globals.js +1 -0
  66. package/dist/graphics.d.ts +53 -0
  67. package/dist/graphics.js +1 -0
  68. package/dist/input-ui.d.ts +35 -0
  69. package/dist/input-ui.js +1 -0
  70. package/dist/input.d.ts +73 -0
  71. package/dist/input.js +1 -0
  72. package/dist/material-9vJ6SZaI.d.ts +126 -0
  73. package/dist/public.d.ts +38 -0
  74. package/dist/public.js +1 -0
  75. package/dist/runtime.d.ts +59 -0
  76. package/dist/runtime.js +1 -0
  77. package/dist/schema/entity.schema.json +244 -0
  78. package/dist/schema/game-config.schema.json +625 -0
  79. package/dist/schema/input-config.schema.json +499 -0
  80. package/dist/schema/stage-config.schema.json +93 -0
  81. package/dist/schema/stage.schema.json +271 -0
  82. package/dist/schema.d.ts +538 -0
  83. package/dist/schema.js +1 -0
  84. package/dist/stage-transition-CmGpV4tc.d.ts +46 -0
  85. package/dist/vector-CiSHbivc.d.ts +133 -0
  86. package/dist/web-components.d.ts +70 -0
  87. package/dist/web-components.js +1 -0
  88. package/dist/zylem-camera-C3bn6BTI.d.ts +575 -0
  89. package/package.json +70 -73
  90. package/dist/actions.js.map +0 -1
  91. package/dist/behavior/jumper-2d.d.ts +0 -114
  92. package/dist/behavior/jumper-2d.js +0 -711
  93. package/dist/behavior/jumper-2d.js.map +0 -1
  94. package/dist/behavior/platformer-3d.d.ts +0 -296
  95. package/dist/behavior/platformer-3d.js +0 -761
  96. package/dist/behavior/platformer-3d.js.map +0 -1
  97. package/dist/behavior/ricochet-2d.d.ts +0 -275
  98. package/dist/behavior/ricochet-2d.js +0 -425
  99. package/dist/behavior/ricochet-2d.js.map +0 -1
  100. package/dist/behavior/ricochet-3d.d.ts +0 -117
  101. package/dist/behavior/ricochet-3d.js +0 -443
  102. package/dist/behavior/ricochet-3d.js.map +0 -1
  103. package/dist/behavior/screen-visibility.d.ts +0 -79
  104. package/dist/behavior/screen-visibility.js +0 -358
  105. package/dist/behavior/screen-visibility.js.map +0 -1
  106. package/dist/behavior/screen-wrap.d.ts +0 -87
  107. package/dist/behavior/screen-wrap.js +0 -246
  108. package/dist/behavior/screen-wrap.js.map +0 -1
  109. package/dist/behavior/shooter-2d.d.ts +0 -79
  110. package/dist/behavior/shooter-2d.js +0 -180
  111. package/dist/behavior/shooter-2d.js.map +0 -1
  112. package/dist/behavior/thruster.d.ts +0 -11
  113. package/dist/behavior/thruster.js +0 -292
  114. package/dist/behavior/thruster.js.map +0 -1
  115. package/dist/behavior/top-down-movement.d.ts +0 -56
  116. package/dist/behavior/top-down-movement.js +0 -125
  117. package/dist/behavior/top-down-movement.js.map +0 -1
  118. package/dist/behavior/world-boundary-2d.d.ts +0 -142
  119. package/dist/behavior/world-boundary-2d.js +0 -235
  120. package/dist/behavior/world-boundary-2d.js.map +0 -1
  121. package/dist/behavior/world-boundary-3d.d.ts +0 -76
  122. package/dist/behavior/world-boundary-3d.js +0 -274
  123. package/dist/behavior/world-boundary-3d.js.map +0 -1
  124. package/dist/behavior-descriptor-BXnVR8Ki.d.ts +0 -159
  125. package/dist/blueprints-DmbK2dki.d.ts +0 -26
  126. package/dist/camera-4XO5gbQH.d.ts +0 -905
  127. package/dist/camera.d.ts +0 -6
  128. package/dist/camera.js +0 -1993
  129. package/dist/camera.js.map +0 -1
  130. package/dist/composition-BASvMKrW.d.ts +0 -218
  131. package/dist/core-CARRaS55.d.ts +0 -541
  132. package/dist/core.js.map +0 -1
  133. package/dist/entities-ChFirVL9.d.ts +0 -410
  134. package/dist/entities.d.ts +0 -9
  135. package/dist/entities.js +0 -4986
  136. package/dist/entities.js.map +0 -1
  137. package/dist/entity-types-DAu8sGJH.d.ts +0 -26
  138. package/dist/global-change-2JvMaz44.d.ts +0 -25
  139. package/dist/main.d.ts +0 -1353
  140. package/dist/main.js +0 -19525
  141. package/dist/main.js.map +0 -1
  142. package/dist/physics-pose-DCc4oE44.d.ts +0 -25
  143. package/dist/physics-protocol-BDD3P5W2.d.ts +0 -200
  144. package/dist/physics-worker.d.ts +0 -21
  145. package/dist/physics-worker.js +0 -306
  146. package/dist/physics-worker.js.map +0 -1
  147. package/dist/physics.d.ts +0 -205
  148. package/dist/physics.js +0 -577
  149. package/dist/physics.js.map +0 -1
  150. package/dist/stage-types-C19IhuzA.d.ts +0 -731
  151. package/dist/stage.d.ts +0 -52
  152. package/dist/stage.js +0 -8479
  153. package/dist/stage.js.map +0 -1
  154. package/dist/sync-state-machine-CZyspBpj.d.ts +0 -16
  155. package/dist/thruster-23lzoPZd.d.ts +0 -180
  156. package/dist/world-DfgxoNMt.d.ts +0 -105
@@ -0,0 +1,928 @@
1
+ import { Vector3, Sprite, Color, Object3D, ColorRepresentation, Light, Fog, FogExp2, Scene, Raycaster } from 'three';
2
+ import { G as GameEntity, a as GameEntityOptions, B as BaseNode } from './entity-BdSI8CL3.js';
3
+ import { d as Vec3Components, e as Vec3Input, b as Vec2Input } from './vector-CiSHbivc.js';
4
+ import { U as UpdateContext, a as SetupContext, D as DestroyContext, l as CleanupContext } from './base-node-life-cycle-D2NuN1VB.js';
5
+ import { T as TexturePath, e as MaterialOptions } from './material-9vJ6SZaI.js';
6
+ import { Simulation } from '@zylem/behaviors/core';
7
+ import { E as Entity } from './entity-DZbFQ1Wg.js';
8
+ import { ParticleEmitterBehaviorOptions, ParticleEffectDefinition, ParticleEmitterHandle } from '@zylem/behaviors/particle-emitter';
9
+ import { Line2 } from 'three/addons/lines/webgpu/Line2.js';
10
+
11
+ /**
12
+ * Interface for entities that handle collision events.
13
+ */
14
+ interface CollisionHandlerDelegate {
15
+ handlePostCollision(params: any): boolean;
16
+ handleIntersectionEvent(params: any): void;
17
+ }
18
+ /**
19
+ * Physics world wrapper.
20
+ *
21
+ * Owns a `@zylem/behaviors` {@link Simulation} (wasm ECS + physics) and
22
+ * translates its handle-based API into game-lib's uuid/entity world model:
23
+ * spawning entities from their body/collider definitions, tracking live
24
+ * collision pairs from simulation events, and dispatching game collision
25
+ * callbacks each frame.
26
+ */
27
+ declare class ZylemWorld implements Entity<ZylemWorld> {
28
+ type: string;
29
+ readonly simulation: Simulation;
30
+ collisionMap: Map<string, GameEntity<any>>;
31
+ collisionBehaviorMap: Map<string, GameEntity<any>>;
32
+ _removalMap: Map<string, GameEntity<any>>;
33
+ private activeCollisionPairs;
34
+ private livePairs;
35
+ private handleIdToUuid;
36
+ private currentCollisionTimeMs;
37
+ private readonly zeroGravity;
38
+ /** Fixed timestep in seconds used for each physics step. */
39
+ readonly fixedTimestep: number;
40
+ /**
41
+ * Interpolation alpha (0..1) representing the fraction of an unprocessed
42
+ * timestep remaining after the last physics step. Used to interpolate
43
+ * rendering transforms between the previous and current physics state.
44
+ */
45
+ interpolationAlpha: number;
46
+ /** Shared step counter handed to every {@link SimulationBody}. */
47
+ private readonly stepClock;
48
+ /**
49
+ * Create the wasm-backed physics world for a stage.
50
+ * @param gravity World gravity.
51
+ * @param physicsRate Physics update rate in Hz (default 60).
52
+ */
53
+ static create(gravity: Vector3 | Vec3Components, physicsRate?: number): Promise<ZylemWorld>;
54
+ constructor(simulation: Simulation, physicsRate?: number, zeroGravity?: boolean);
55
+ addEntity(entity: any): void;
56
+ setForRemoval(entity: any): void;
57
+ destroyEntity(entity: GameEntity<any>): void;
58
+ setup(): void;
59
+ /**
60
+ * Advance the physics simulation. The fixed-timestep accumulator lives
61
+ * inside the Simulation; this method translates its events into game
62
+ * collision dispatch.
63
+ */
64
+ update(params: UpdateContext<any>): void;
65
+ private hasCollisionPhaseListeners;
66
+ private applyCollisionEvents;
67
+ private snapshotLivePairs;
68
+ updatePostCollisionBehaviors(delta: number): void;
69
+ private processPendingRemovals;
70
+ private removeEntityFromTracking;
71
+ private pruneActiveCollisionPairs;
72
+ private entityHasCollisionPhaseListener;
73
+ private processCollisionPairs;
74
+ private dispatchCollisionPhase;
75
+ private dispatchIntersectionDelegates;
76
+ /**
77
+ * Physics raycast resolved to game entities. Used by debug tooling
78
+ * (hover/select/delete picking).
79
+ */
80
+ raycast(origin: {
81
+ x: number;
82
+ y: number;
83
+ z: number;
84
+ }, direction: {
85
+ x: number;
86
+ y: number;
87
+ z: number;
88
+ }, maxDistance: number): {
89
+ uuid: string | null;
90
+ distance: number;
91
+ normal: [number, number, number];
92
+ } | null;
93
+ destroy(): void;
94
+ private clearEntityPhysicsState;
95
+ }
96
+
97
+ type SpriteImage = {
98
+ name: string;
99
+ file: string;
100
+ };
101
+ type SpriteAnimation = {
102
+ name: string;
103
+ frames: string[];
104
+ speed: number | number[];
105
+ loop: boolean;
106
+ };
107
+ type ZylemSpriteOptions = GameEntityOptions & {
108
+ images?: SpriteImage[];
109
+ animations?: SpriteAnimation[];
110
+ size?: Vec3Input;
111
+ collisionSize?: Vec3Input;
112
+ };
113
+ declare const SPRITE_TYPE: unique symbol;
114
+ declare class ZylemSprite extends GameEntity<ZylemSpriteOptions> {
115
+ static type: symbol;
116
+ protected sprites: Sprite[];
117
+ protected spriteMap: Map<string, number>;
118
+ protected currentSpriteIndex: number;
119
+ protected animations: Map<string, any>;
120
+ protected currentAnimation: any;
121
+ protected currentAnimationFrame: string;
122
+ protected currentAnimationIndex: number;
123
+ protected currentAnimationTime: number;
124
+ constructor(options?: ZylemSpriteOptions);
125
+ create(): this;
126
+ protected createSpritesFromImages(images: SpriteImage[]): void;
127
+ protected createAnimations(animations: SpriteAnimation[]): void;
128
+ setSprite(key: string): void;
129
+ setAnimation(name: string, delta: number): void;
130
+ private getCurrentRotationQuaternion;
131
+ private syncSpriteMaterials;
132
+ spriteSetup(_params: SetupContext<ZylemSpriteOptions>): void;
133
+ spriteUpdate(params: UpdateContext<ZylemSpriteOptions>): void;
134
+ spriteDestroy(params: DestroyContext<ZylemSpriteOptions>): void;
135
+ buildInfo(): Record<string, any>;
136
+ }
137
+ type SpriteOptions = BaseNode | Partial<ZylemSpriteOptions>;
138
+ declare function createSprite(...args: Array<SpriteOptions>): ZylemSprite;
139
+
140
+ type ZylemSphereOptions = GameEntityOptions & {
141
+ radius?: number;
142
+ };
143
+ declare const SPHERE_TYPE: unique symbol;
144
+ declare class ZylemSphere extends GameEntity<ZylemSphereOptions> {
145
+ static type: symbol;
146
+ constructor(options?: ZylemSphereOptions);
147
+ buildInfo(): Record<string, any>;
148
+ }
149
+ type SphereOptions = BaseNode | Partial<ZylemSphereOptions>;
150
+ declare function createSphere(...args: Array<SphereOptions>): ZylemSphere;
151
+
152
+ type ZylemRectOptions = GameEntityOptions & {
153
+ width?: number;
154
+ height?: number;
155
+ fillColor?: Color | string | null;
156
+ strokeColor?: Color | string | null;
157
+ strokeWidth?: number;
158
+ radius?: number;
159
+ padding?: number;
160
+ stickToViewport?: boolean;
161
+ screenPosition?: Vec2Input;
162
+ zDistance?: number;
163
+ anchor?: Vec2Input;
164
+ bounds?: {
165
+ screen?: {
166
+ x: number;
167
+ y: number;
168
+ width: number;
169
+ height: number;
170
+ };
171
+ world?: {
172
+ left: number;
173
+ right: number;
174
+ top: number;
175
+ bottom: number;
176
+ z?: number;
177
+ };
178
+ };
179
+ };
180
+ declare const RECT_TYPE: unique symbol;
181
+ declare class ZylemRect extends GameEntity<ZylemRectOptions> {
182
+ static type: symbol;
183
+ private _sprite;
184
+ private _mesh;
185
+ private _texture;
186
+ private _canvas;
187
+ private _ctx;
188
+ private _cameraRef;
189
+ private _lastCanvasW;
190
+ private _lastCanvasH;
191
+ constructor(options?: ZylemRectOptions);
192
+ private createSprite;
193
+ private redrawRect;
194
+ getWidth(): number;
195
+ getHeight(): number;
196
+ private roundedRectPath;
197
+ private toCssColor;
198
+ /**
199
+ * Get the viewport resolution from the renderer DOM element,
200
+ * falling back to the camera's screenResolution if the renderer
201
+ * is not available (e.g. when using the new RendererManager path).
202
+ */
203
+ private getResolution;
204
+ private rectSetup;
205
+ private rectUpdate;
206
+ private updateStickyTransform;
207
+ private worldToScreen;
208
+ private computeScreenBoundsFromOptions;
209
+ updateRect(options?: Partial<Pick<ZylemRectOptions, 'width' | 'height' | 'fillColor' | 'strokeColor' | 'strokeWidth' | 'radius'>>): void;
210
+ buildInfo(): Record<string, any>;
211
+ }
212
+ type RectOptions = BaseNode | Partial<ZylemRectOptions>;
213
+ declare function createRect(...args: Array<RectOptions>): ZylemRect;
214
+
215
+ type ZylemTextOptions = GameEntityOptions & {
216
+ text?: string;
217
+ fontFamily?: string;
218
+ fontSize?: number;
219
+ fontColor?: Color | string;
220
+ backgroundColor?: Color | string | null;
221
+ padding?: number;
222
+ stickToViewport?: boolean;
223
+ screenPosition?: Vec2Input;
224
+ zDistance?: number;
225
+ };
226
+ declare const TEXT_TYPE: unique symbol;
227
+ declare class ZylemText extends GameEntity<ZylemTextOptions> {
228
+ static type: symbol;
229
+ private _sprite;
230
+ private _texture;
231
+ private _canvas;
232
+ private _ctx;
233
+ private _cameraRef;
234
+ private _lastCanvasW;
235
+ private _lastCanvasH;
236
+ constructor(options?: ZylemTextOptions);
237
+ create(): this;
238
+ private createSprite;
239
+ private measureAndResizeCanvas;
240
+ private drawCenteredText;
241
+ private updateTexture;
242
+ private redrawText;
243
+ private toCssColor;
244
+ private textSetup;
245
+ private textUpdate;
246
+ private getResolution;
247
+ private getScreenPixels;
248
+ private computeWorldExtents;
249
+ private updateSpriteScale;
250
+ private updateWorldSpriteScale;
251
+ private updateStickyTransform;
252
+ updateText(_text: string): void;
253
+ buildInfo(): Record<string, any>;
254
+ /**
255
+ * Dispose of Three.js resources when the entity is destroyed.
256
+ */
257
+ private textDestroy;
258
+ }
259
+ type TextOptions = BaseNode | Partial<ZylemTextOptions>;
260
+ declare function createText(...args: Array<TextOptions>): ZylemText;
261
+
262
+ type ZylemBoxOptions = GameEntityOptions;
263
+ declare const BOX_TYPE: unique symbol;
264
+ declare class ZylemBox extends GameEntity<ZylemBoxOptions> {
265
+ static type: symbol;
266
+ constructor(options?: ZylemBoxOptions);
267
+ buildInfo(): Record<string, any>;
268
+ }
269
+ type BoxOptions = BaseNode | Partial<ZylemBoxOptions>;
270
+ declare function createBox(...args: Array<BoxOptions>): ZylemBox;
271
+
272
+ type ZylemPlaneOptions = GameEntityOptions & {
273
+ tile?: Vec2Input;
274
+ repeat?: Vec2Input;
275
+ texture?: TexturePath;
276
+ /**
277
+ * Number of subdivisions per axis. Used for both X and Z unless
278
+ * `subdivisionsX` / `subdivisionsZ` are set, or a `heightMap` /
279
+ * `heightMap2D` is provided (in which case subdivisions are derived
280
+ * from the height data).
281
+ */
282
+ subdivisions?: number;
283
+ /** Subdivisions along the X axis (overrides `subdivisions`). */
284
+ subdivisionsX?: number;
285
+ /** Subdivisions along the Z axis (overrides `subdivisions`). */
286
+ subdivisionsZ?: number;
287
+ /**
288
+ * If true and no explicit heightmap is provided, each vertex gets a
289
+ * random height in `[0, 4 * heightScale]`.
290
+ */
291
+ randomizeHeight?: boolean;
292
+ /**
293
+ * Absolute heights along the X axis, one value per vertex-column
294
+ * (constant along Z). `length` defines the X vertex count, so
295
+ * `subdivisionsX` becomes `length - 1`. Values are absolute world-space
296
+ * heights above/below the plane (multiplied by `heightScale`, default 1).
297
+ *
298
+ * Example: `heightMap: [10, 1, -1, 10]` produces 4 X-columns with those
299
+ * absolute heights, forming ridges parallel to the Z axis.
300
+ *
301
+ * Takes precedence over `randomizeHeight`.
302
+ */
303
+ heightMap?: number[];
304
+ /**
305
+ * Absolute heights as a 2D grid, indexed `heightMap2D[z][x]`. The outer
306
+ * array's length defines the Z vertex count and each inner array's
307
+ * length defines the X vertex count (all rows must share the same X
308
+ * length). Values are absolute (multiplied by `heightScale`).
309
+ *
310
+ * Takes precedence over `heightMap` and `randomizeHeight`.
311
+ */
312
+ heightMap2D?: number[][];
313
+ /** Multiplier applied to heightmap / random heights (default 1). */
314
+ heightScale?: number;
315
+ };
316
+ declare const PLANE_TYPE: unique symbol;
317
+ declare class ZylemPlane extends GameEntity<ZylemPlaneOptions> {
318
+ static type: symbol;
319
+ constructor(options?: ZylemPlaneOptions);
320
+ }
321
+ type PlaneOptions = BaseNode | Partial<ZylemPlaneOptions>;
322
+ declare function createPlane(...args: Array<PlaneOptions>): ZylemPlane;
323
+
324
+ type OnHeldParams = {
325
+ delta: number;
326
+ self: ZylemZone;
327
+ visitor: GameEntity<any>;
328
+ heldTime: number;
329
+ globals: any;
330
+ };
331
+ type OnEnterParams = Pick<OnHeldParams, 'self' | 'visitor' | 'globals'>;
332
+ type OnExitParams = Pick<OnHeldParams, 'self' | 'visitor' | 'globals'>;
333
+ type ZylemZoneOptions = GameEntityOptions & {
334
+ size?: Vec3Input;
335
+ static?: boolean;
336
+ onEnter?: (params: OnEnterParams) => void;
337
+ onHeld?: (params: OnHeldParams) => void;
338
+ onExit?: (params: OnExitParams) => void;
339
+ };
340
+ declare const ZONE_TYPE: unique symbol;
341
+ declare class ZylemZone extends GameEntity<ZylemZoneOptions> implements CollisionHandlerDelegate {
342
+ static type: symbol;
343
+ private _enteredZone;
344
+ private _exitedZone;
345
+ private _zoneEntities;
346
+ constructor(options?: ZylemZoneOptions);
347
+ handlePostCollision({ delta }: {
348
+ delta: number;
349
+ }): boolean;
350
+ handleIntersectionEvent({ other, delta, }: {
351
+ other: any;
352
+ delta: number;
353
+ }): void;
354
+ onEnter(callback: (params: OnEnterParams) => void): this;
355
+ onHeld(callback: (params: OnHeldParams) => void): this;
356
+ onExit(callback: (params: OnExitParams) => void): this;
357
+ entered(other: any): void;
358
+ exited(delta: number, key: string): void;
359
+ held(delta: number, other: any): void;
360
+ }
361
+ type ZoneOptions = BaseNode | Partial<ZylemZoneOptions>;
362
+ declare function createZone(...args: Array<ZoneOptions>): ZylemZone;
363
+
364
+ interface EntityLoaderDelegate {
365
+ /** Initiates loading (may be async internally, but call returns immediately) */
366
+ load(): void;
367
+ /** Returns data synchronously (may be null if still loading) */
368
+ data(): any;
369
+ }
370
+
371
+ type AnimationOptions = {
372
+ key: string;
373
+ pauseAtEnd?: boolean;
374
+ pauseAtPercentage?: number;
375
+ fadeToKey?: string;
376
+ fadeDuration?: number;
377
+ };
378
+
379
+ /**
380
+ * Interface for entities that provide custom debug information
381
+ */
382
+ interface DebugInfoProvider {
383
+ getDebugInfo(): Record<string, any>;
384
+ }
385
+
386
+ type AnimationObject = {
387
+ key?: string;
388
+ path: string;
389
+ };
390
+ type CollisionShapeType = 'capsule' | 'bounds' | 'trimesh' | 'model';
391
+ type ZylemActorOptions = GameEntityOptions & {
392
+ static?: boolean;
393
+ animations?: AnimationObject[];
394
+ models?: string[];
395
+ scale?: Vec3Input;
396
+ material?: MaterialOptions;
397
+ collisionShape?: CollisionShapeType;
398
+ /**
399
+ * Opt-in: also strip the root bone's Y translation track so the
400
+ * mixer never overrides the bind-pose hip Y. Useful when the
401
+ * actor is shown statically (e.g. a lobby preview) and you want
402
+ * to suppress the bind→animation Y "snap" at load time. Defaults
403
+ * to false because most FBX exports use the Y track as a
404
+ * hip-height calibration that the renderer needs to keep feet on
405
+ * the ground.
406
+ */
407
+ stripRootMotionY?: boolean;
408
+ };
409
+ declare const ACTOR_TYPE: unique symbol;
410
+ declare class ZylemActor extends GameEntity<ZylemActorOptions> implements EntityLoaderDelegate, DebugInfoProvider {
411
+ static type: symbol;
412
+ private _object;
413
+ private _collisionSource;
414
+ private _animationDelegate;
415
+ private _modelFileNames;
416
+ private _assetLoader;
417
+ private _loadGeneration;
418
+ private _loadStatus;
419
+ controlledRotation: boolean;
420
+ hasWarnedDynamicTrimesh: boolean;
421
+ constructor(options?: ZylemActorOptions);
422
+ create(): this;
423
+ load(): void;
424
+ data(): any;
425
+ needsDeferredModelCollision(): boolean;
426
+ synchronizeRuntimeCollider(): void;
427
+ actorUpdate(params: UpdateContext<ZylemActorOptions>): void;
428
+ actorDestroy(): void;
429
+ _cleanup(params: CleanupContext<this>): void;
430
+ playAnimation(animationOptions: AnimationOptions): void;
431
+ get object(): Object3D | null;
432
+ get collisionSource(): Object3D | null;
433
+ getDebugInfo(): Record<string, any>;
434
+ private getResolvedCollisionShape;
435
+ private requiresLoadedCollisionSource;
436
+ private getRuntimeCollisionSource;
437
+ private getCollisionSourceSelection;
438
+ private disposeRuntimeState;
439
+ private loadModelsDeferred;
440
+ /**
441
+ * Shift the visible model so its feet sit at the group origin (y = 0).
442
+ * The physics body / render slot stay at the feet anchor; only `_object`
443
+ * is offset so Mixamo-style hip calibration does not float the mesh.
444
+ */
445
+ private alignVisualModelToGround;
446
+ private applyMaterialOverrides;
447
+ /**
448
+ * Produce a cloned material with the requested color/opacity applied.
449
+ *
450
+ * Cloning preserves any textures (`map`, `normalMap`, `roughnessMap`, …)
451
+ * that came with the loaded model — colour acts as a multiplicative tint on
452
+ * top of them, matching standard PBR behaviour. We fall back to a fresh
453
+ * `MeshStandardMaterial` only when the source material has no `.color`
454
+ * field (e.g. custom `ShaderMaterial`).
455
+ */
456
+ private tintMaterial;
457
+ }
458
+ type ActorOptions = BaseNode | ZylemActorOptions;
459
+ declare function createActor(...args: Array<ActorOptions>): ZylemActor;
460
+
461
+ type ZylemDiskOptions = GameEntityOptions & {
462
+ innerRadius?: number;
463
+ outerRadius?: number;
464
+ thetaSegments?: number;
465
+ };
466
+ declare const DISK_TYPE: unique symbol;
467
+ declare class ZylemDisk extends GameEntity<ZylemDiskOptions> {
468
+ static type: symbol;
469
+ constructor(options?: ZylemDiskOptions);
470
+ buildInfo(): Record<string, any>;
471
+ }
472
+ type DiskOptions = BaseNode | Partial<ZylemDiskOptions>;
473
+ declare function createDisk(...args: Array<DiskOptions>): ZylemDisk;
474
+
475
+ type ZylemConeOptions = GameEntityOptions & {
476
+ /** Base radius of the cone */
477
+ radius?: number;
478
+ /** Height of the cone */
479
+ height?: number;
480
+ /** Number of radial segments (higher = smoother) */
481
+ radialSegments?: number;
482
+ };
483
+ declare const CONE_TYPE: unique symbol;
484
+ /**
485
+ * A cone entity with configurable radius, height, and radial segments.
486
+ * Uses a Rapier cone collider for physics.
487
+ */
488
+ declare class ZylemCone extends GameEntity<ZylemConeOptions> {
489
+ static type: symbol;
490
+ constructor(options?: ZylemConeOptions);
491
+ buildInfo(): Record<string, any>;
492
+ }
493
+ type ConeOptions = BaseNode | Partial<ZylemConeOptions>;
494
+ /**
495
+ * Create a cone entity.
496
+ * @param args Options or child nodes
497
+ */
498
+ declare function createCone(...args: Array<ConeOptions>): ZylemCone;
499
+
500
+ type ZylemPyramidOptions = GameEntityOptions & {
501
+ /** Base radius of the pyramid */
502
+ radius?: number;
503
+ /** Height of the pyramid */
504
+ height?: number;
505
+ };
506
+ declare const PYRAMID_TYPE: unique symbol;
507
+ /**
508
+ * A pyramid entity (4-sided cone).
509
+ * Uses ConeGeometry with 4 radial segments for the visual mesh
510
+ * and a Rapier cone collider for physics.
511
+ */
512
+ declare class ZylemPyramid extends GameEntity<ZylemPyramidOptions> {
513
+ static type: symbol;
514
+ constructor(options?: ZylemPyramidOptions);
515
+ buildInfo(): Record<string, any>;
516
+ }
517
+ type PyramidOptions = BaseNode | Partial<ZylemPyramidOptions>;
518
+ /**
519
+ * Create a pyramid entity.
520
+ * @param args Options or child nodes
521
+ */
522
+ declare function createPyramid(...args: Array<PyramidOptions>): ZylemPyramid;
523
+
524
+ type ZylemCylinderOptions = GameEntityOptions & {
525
+ /** Top radius of the cylinder */
526
+ radiusTop?: number;
527
+ /** Bottom radius of the cylinder */
528
+ radiusBottom?: number;
529
+ /** Height of the cylinder */
530
+ height?: number;
531
+ /** Number of radial segments (higher = smoother) */
532
+ radialSegments?: number;
533
+ };
534
+ declare const CYLINDER_TYPE: unique symbol;
535
+ /**
536
+ * A cylinder entity with configurable top/bottom radii, height, and segments.
537
+ * Uses a Rapier cylinder collider for physics.
538
+ */
539
+ declare class ZylemCylinder extends GameEntity<ZylemCylinderOptions> {
540
+ static type: symbol;
541
+ constructor(options?: ZylemCylinderOptions);
542
+ buildInfo(): Record<string, any>;
543
+ }
544
+ type CylinderOptions = BaseNode | Partial<ZylemCylinderOptions>;
545
+ /**
546
+ * Create a cylinder entity.
547
+ * @param args Options or child nodes
548
+ */
549
+ declare function createCylinder(...args: Array<CylinderOptions>): ZylemCylinder;
550
+
551
+ type ZylemPillOptions = GameEntityOptions & {
552
+ /** Radius of the capsule hemispheres */
553
+ radius?: number;
554
+ /** Length of the cylindrical middle section */
555
+ length?: number;
556
+ /** Number of cap segments (higher = smoother) */
557
+ capSegments?: number;
558
+ /** Number of radial segments (higher = smoother) */
559
+ radialSegments?: number;
560
+ };
561
+ declare const PILL_TYPE: unique symbol;
562
+ /**
563
+ * A pill/capsule entity with configurable radius and cylindrical length.
564
+ * Uses Three.js CapsuleGeometry for rendering and Rapier capsule collider for physics.
565
+ */
566
+ declare class ZylemPill extends GameEntity<ZylemPillOptions> {
567
+ static type: symbol;
568
+ constructor(options?: ZylemPillOptions);
569
+ buildInfo(): Record<string, any>;
570
+ }
571
+ type PillOptions = BaseNode | Partial<ZylemPillOptions>;
572
+ /**
573
+ * Create a pill (capsule) entity.
574
+ * @param args Options or child nodes
575
+ */
576
+ declare function createPill(...args: Array<PillOptions>): ZylemPill;
577
+
578
+ type ZylemParticleSystemOptions = GameEntityOptions & ParticleEmitterBehaviorOptions & {
579
+ preset?: ParticleEffectDefinition;
580
+ };
581
+ declare const PARTICLE_SYSTEM_TYPE: unique symbol;
582
+ declare class ZylemParticleSystem extends GameEntity<ZylemParticleSystemOptions> {
583
+ static type: symbol;
584
+ __zylemParticleSystemEntity: true;
585
+ private particleHandle;
586
+ constructor(options?: Partial<ZylemParticleSystemOptions>, initializeBehavior?: boolean);
587
+ private bindStandaloneTransforms;
588
+ private resolveParticleHandle;
589
+ play(): void;
590
+ stop(): void;
591
+ pause(): void;
592
+ restart(): void;
593
+ burst(): void;
594
+ isPlaying(): boolean;
595
+ getSystem(): ParticleEmitterHandle['getSystem'] extends () => infer T ? T : null;
596
+ buildInfo(): Record<string, string>;
597
+ }
598
+ declare function createParticleSystem(options?: Partial<ZylemParticleSystemOptions>): ZylemParticleSystem;
599
+
600
+ type Vec3 = {
601
+ x: number;
602
+ y: number;
603
+ z: number;
604
+ };
605
+ /**
606
+ * Shadow-camera / shadow-map options shared across the light types that
607
+ * support casting shadows (directional, point, spot).
608
+ *
609
+ * The orthographic frustum fields (`left` / `right` / `top` / `bottom`) only
610
+ * apply to directional lights -- TypeScript enforces this via the tagged
611
+ * union below -- but we keep a single shape for ergonomic reuse.
612
+ */
613
+ interface LightShadowOptions {
614
+ /** Shadow map resolution (square). Defaults: directional 2048, point/spot 1024. */
615
+ mapSize?: number;
616
+ /** Shadow camera near plane. Default 0.1. */
617
+ near?: number;
618
+ /** Shadow camera far plane. Default 500. */
619
+ far?: number;
620
+ /** Shadow bias (negative values can help acne). */
621
+ bias?: number;
622
+ /** PCF blur radius. */
623
+ radius?: number;
624
+ /** Directional-only: orthographic frustum left bound. Default -100. */
625
+ left?: number;
626
+ /** Directional-only: orthographic frustum right bound. Default 100. */
627
+ right?: number;
628
+ /** Directional-only: orthographic frustum top bound. Default 100. */
629
+ top?: number;
630
+ /** Directional-only: orthographic frustum bottom bound. Default -100. */
631
+ bottom?: number;
632
+ }
633
+ interface BaseLightOptions {
634
+ name?: string;
635
+ /** Light colour. Default `#ffffff`. */
636
+ color?: ColorRepresentation;
637
+ /** Scalar intensity multiplier. Default `1`. */
638
+ intensity?: number;
639
+ /** World-space position. Default `{0,0,0}`. Not meaningful for ambient. */
640
+ position?: Vec3;
641
+ }
642
+ interface AmbientLightOptions extends BaseLightOptions {
643
+ type: 'ambient';
644
+ }
645
+ interface HemisphereLightOptions extends BaseLightOptions {
646
+ type: 'hemisphere';
647
+ /** Sky colour. Falls back to `color` if omitted, else `#ffffff`. */
648
+ skyColor?: ColorRepresentation;
649
+ /** Ground colour. Default `#000000`. */
650
+ groundColor?: ColorRepresentation;
651
+ }
652
+ interface DirectionalLightOptions extends BaseLightOptions {
653
+ type: 'directional';
654
+ /** World-space point the light aims at. Default origin. */
655
+ target?: Vec3;
656
+ /** Enable shadow casting. Default `false`. */
657
+ castShadow?: boolean;
658
+ /** Shadow camera / map tuning. */
659
+ shadow?: LightShadowOptions;
660
+ }
661
+ interface PointLightOptions extends BaseLightOptions {
662
+ type: 'point';
663
+ /** Maximum range of the light (0 = infinite). */
664
+ distance?: number;
665
+ /** Physical falloff exponent. Default `2` (three.js default). */
666
+ decay?: number;
667
+ castShadow?: boolean;
668
+ /** Shadow options (directional-only frustum fields are ignored). */
669
+ shadow?: Omit<LightShadowOptions, 'left' | 'right' | 'top' | 'bottom'>;
670
+ }
671
+ interface SpotLightOptions extends BaseLightOptions {
672
+ type: 'spot';
673
+ /** World-space point the cone aims at. Default origin. */
674
+ target?: Vec3;
675
+ /** Maximum range of the light (0 = infinite). */
676
+ distance?: number;
677
+ /** Physical falloff exponent. Default `2`. */
678
+ decay?: number;
679
+ /** Cone angle in radians. Default `Math.PI / 3`. */
680
+ angle?: number;
681
+ /** Penumbra softness in `[0, 1]`. Default `0`. */
682
+ penumbra?: number;
683
+ castShadow?: boolean;
684
+ /** Shadow options (directional-only frustum fields are ignored). */
685
+ shadow?: Omit<LightShadowOptions, 'left' | 'right' | 'top' | 'bottom'>;
686
+ }
687
+ type ZylemLightOptions = AmbientLightOptions | HemisphereLightOptions | DirectionalLightOptions | PointLightOptions | SpotLightOptions;
688
+ declare const LIGHT_TYPE: unique symbol;
689
+ type ZylemLightGameOptions = ZylemLightOptions & GameEntityOptions;
690
+ /**
691
+ * `GameEntity` wrapper around a `THREE.Light` (plus its optional target) so
692
+ * lights can be added to a stage via the standard `stage.add(...)` pipeline.
693
+ *
694
+ * The underlying light lives inside `this.group` at the group's local origin,
695
+ * and the group's world position is set to `options.position` when the stage
696
+ * attaches the entity to the scene. For directional and spot lights, an
697
+ * optional target `Object3D` is added as a sibling inside the same group at a
698
+ * local offset of `target - position`, so moving the group also moves the
699
+ * aim point.
700
+ */
701
+ declare class ZylemLight extends GameEntity<ZylemLightGameOptions> {
702
+ static type: symbol;
703
+ /** The underlying THREE.js light instance. Populated in `create()`. */
704
+ light: Light | null;
705
+ /** The target `Object3D` for directional / spot lights, when configured. */
706
+ lightTarget: Object3D | null;
707
+ constructor(options: ZylemLightOptions);
708
+ create(): this;
709
+ /**
710
+ * Dispose the shadow map render target before delegating to the engine's
711
+ * standard cleanup (which removes the group from its parent scene).
712
+ */
713
+ protected _cleanup(params: CleanupContext<this>): void;
714
+ }
715
+ /**
716
+ * Create a light entity that can be added to a stage with `stage.add(...)`.
717
+ *
718
+ * The `type` discriminant narrows the accepted option keys, so TypeScript
719
+ * surfaces an error if you try to set, say, `angle` on an ambient light.
720
+ *
721
+ * @example
722
+ * ```ts
723
+ * stage.add(createLight({ type: 'ambient', intensity: 1.5 }));
724
+ * stage.add(createLight({
725
+ * type: 'directional',
726
+ * position: { x: 8, y: 12, z: 6 },
727
+ * target: { x: 0, y: 0, z: 0 },
728
+ * castShadow: true,
729
+ * }));
730
+ * ```
731
+ */
732
+ declare function createLight(options: ZylemLightOptions): ZylemLight;
733
+
734
+ /** Three.js fog model. Linear uses start/end; exp² uses density. */
735
+ type ZylemFogType = 'linear' | 'exp2';
736
+ /** Optional vertical falloff (a.k.a. ground/height fog). */
737
+ interface ZylemFogHeightOptions {
738
+ /** Master toggle. Defaults to `false`. */
739
+ enabled?: boolean;
740
+ /** World-space Y at which fog stops attenuating (becomes fully clear). */
741
+ level?: number;
742
+ /**
743
+ * Density falloff per world-unit beneath `level`. Higher values produce
744
+ * sharper transitions; values <= 0 disable the height contribution.
745
+ */
746
+ falloff?: number;
747
+ }
748
+ /**
749
+ * Optional 3D animated noise applied to fog density.
750
+ *
751
+ * Specifying a `noise` block enables noise modulation; omit it to disable.
752
+ */
753
+ interface ZylemFogNoiseOptions {
754
+ /** Spatial scale of the noise; lower = larger pockets of clearer / denser fog. */
755
+ scale?: number;
756
+ /** Modulation strength in `[0, 1]`. 0 = no effect, 1 = full ±100% modulation. */
757
+ strength?: number;
758
+ /** Animation speed (world-units per second of advect). */
759
+ speed?: number;
760
+ }
761
+ interface ZylemFogOptions {
762
+ /** Fog model. Default `'linear'`. */
763
+ type?: ZylemFogType;
764
+ /** Fog colour. Default `'#9aa3ad'` (neutral grey). */
765
+ color?: ColorRepresentation;
766
+ /** Exp² density coefficient. Only used when `type === 'exp2'`. Default `0.015`. */
767
+ density?: number;
768
+ /** Linear-fog start distance. Only used when `type === 'linear'`. Default `10`. */
769
+ start?: number;
770
+ /** Linear-fog end distance. Only used when `type === 'linear'`. Default `250`. */
771
+ end?: number;
772
+ /** Optional vertical falloff. Disabled by default. */
773
+ height?: ZylemFogHeightOptions;
774
+ /** Optional 3D animated noise. Disabled by default. */
775
+ noise?: ZylemFogNoiseOptions;
776
+ /** Display name (mostly for debug overlays). */
777
+ name?: string;
778
+ }
779
+ declare const FOG_TYPE: unique symbol;
780
+ type ZylemFogGameOptions = ZylemFogOptions & GameEntityOptions;
781
+ /**
782
+ * `GameEntity` that owns a Three.js fog instance plus optional height /
783
+ * noise modulators.
784
+ *
785
+ * Why not just expose `scene.fog` directly? Modelling fog as an entity:
786
+ * - Keeps stage authoring uniform with lights, particles, etc.
787
+ * - Gives a natural hook for cleanup when the stage tears down.
788
+ * - Allows multiple stages / loads to swap fog cleanly via the existing
789
+ * entity lifecycle, including the wasm-runtime-managed stages.
790
+ *
791
+ * The entity attaches a tiny empty {@link Group} to the scene so that the
792
+ * standard {@link GameEntity#_cleanup} pathway removes it from its parent
793
+ * during destroy; the actual fog effect is wired up via
794
+ * {@link attachToScene} which is invoked by `ZylemScene.addEntityGroup`.
795
+ */
796
+ declare class ZylemFog extends GameEntity<ZylemFogGameOptions> {
797
+ static type: symbol;
798
+ /** The underlying Three.js fog instance. Populated in `create()`. */
799
+ threeFog: Fog | FogExp2 | null;
800
+ /** Scene the fog is currently attached to (null when detached). */
801
+ private attachedScene;
802
+ private readonly patcher;
803
+ private patcherEnabled;
804
+ constructor(options?: ZylemFogOptions);
805
+ create(): this;
806
+ /**
807
+ * Hook into the host scene: stamp `scene.fog` and -- if height / noise
808
+ * are enabled -- start patching the scene's materials.
809
+ *
810
+ * Called by `ZylemScene.addEntityGroup` once it has identified this
811
+ * entity as a fog entity.
812
+ *
813
+ * @param scene The Three.js scene that will host the fog.
814
+ */
815
+ attachToScene(scene: Scene): void;
816
+ /**
817
+ * Per-frame tick. The base `GameEntity._update` is invoked first (so
818
+ * user `onUpdate` callbacks still run), then the patcher advances its
819
+ * time uniform and picks up any newly-spawned materials.
820
+ */
821
+ _update(params: UpdateContext<this>): void;
822
+ protected _cleanup(params: CleanupContext<this>): void;
823
+ private resolveUniformValues;
824
+ }
825
+ /**
826
+ * Create a fog entity that can be added to a stage with `stage.add(...)`.
827
+ *
828
+ * @example
829
+ * Default greyish fog -- no arguments needed:
830
+ * ```ts
831
+ * stage.add(createFog());
832
+ * ```
833
+ *
834
+ * @example
835
+ * Exp² fog with animated, ground-hugging haze:
836
+ * ```ts
837
+ * stage.add(createFog({
838
+ * type: 'exp2',
839
+ * color: '#aabbcc',
840
+ * density: 0.015,
841
+ * height: { enabled: true, level: 5, falloff: 0.2 },
842
+ * noise: { scale: 0.05, strength: 0.15, speed: 0.1 },
843
+ * }));
844
+ * ```
845
+ */
846
+ declare function createFog(options?: ZylemFogOptions): ZylemFog;
847
+
848
+ interface LinePickResult {
849
+ point: Vector3;
850
+ pointOnLine: Vector3;
851
+ faceIndex: number;
852
+ distance: number;
853
+ }
854
+ type ZylemLineOptions = GameEntityOptions & {
855
+ /** Polyline vertices in world space (minimum 2). */
856
+ points: Vec3Input[];
857
+ /** Optional per-vertex colors (enables `vertexColors` on the material). */
858
+ colors?: ColorRepresentation[];
859
+ linewidth?: number;
860
+ worldUnits?: boolean;
861
+ alphaToCoverage?: boolean;
862
+ opacity?: number;
863
+ transparent?: boolean;
864
+ dashed?: boolean;
865
+ dashSize?: number;
866
+ gapSize?: number;
867
+ /** Default Raycaster threshold for {@link pickFromRaycaster}. */
868
+ pickThreshold?: number;
869
+ };
870
+ declare const LINE_TYPE: unique symbol;
871
+ /**
872
+ * Raycast against a {@link ZylemLine} using Three.js `Line2` picking rules.
873
+ */
874
+ declare function pickZylemLine(raycaster: Raycaster, line: ZylemLine, options?: {
875
+ threshold?: number;
876
+ }): LinePickResult | null;
877
+ declare class ZylemLine extends GameEntity<ZylemLineOptions> {
878
+ static type: symbol;
879
+ private _line;
880
+ private _geometry;
881
+ private _material;
882
+ constructor(options?: Partial<ZylemLineOptions>);
883
+ create(): this;
884
+ /** Replace the polyline vertices at runtime. */
885
+ setPoints(points: Vec3Input[], colors?: ColorRepresentation[]): this;
886
+ getLineObject(): Line2 | null;
887
+ pickFromRaycaster(raycaster: Raycaster, options?: {
888
+ threshold?: number;
889
+ }): LinePickResult | null;
890
+ buildInfo(): Record<string, any>;
891
+ private rebuildLine;
892
+ private applyGroupPosition;
893
+ protected _cleanup(_params: CleanupContext<this>): void;
894
+ private disposeLineResources;
895
+ }
896
+ type LineOptions = BaseNode | Partial<ZylemLineOptions>;
897
+ declare function createLine(...args: Array<LineOptions>): ZylemLine;
898
+
899
+ /**
900
+ * Maps entity type symbols to their class types.
901
+ * Used by getEntityByName to infer return types.
902
+ */
903
+ interface EntityTypeMap {
904
+ [SPRITE_TYPE]: ZylemSprite;
905
+ [SPHERE_TYPE]: ZylemSphere;
906
+ [RECT_TYPE]: ZylemRect;
907
+ [TEXT_TYPE]: ZylemText;
908
+ [BOX_TYPE]: ZylemBox;
909
+ [PLANE_TYPE]: ZylemPlane;
910
+ [ZONE_TYPE]: ZylemZone;
911
+ [ACTOR_TYPE]: ZylemActor;
912
+ [DISK_TYPE]: ZylemDisk;
913
+ [CONE_TYPE]: ZylemCone;
914
+ [PYRAMID_TYPE]: ZylemPyramid;
915
+ [CYLINDER_TYPE]: ZylemCylinder;
916
+ [PILL_TYPE]: ZylemPill;
917
+ [PARTICLE_SYSTEM_TYPE]: ZylemParticleSystem;
918
+ [LIGHT_TYPE]: ZylemLight;
919
+ [FOG_TYPE]: ZylemFog;
920
+ [LINE_TYPE]: ZylemLine;
921
+ }
922
+ /**
923
+ * Type helper: if T is a known type symbol, return the mapped entity type.
924
+ * Otherwise return BaseNode.
925
+ */
926
+ type EntityForType<T> = T extends keyof EntityTypeMap ? EntityTypeMap[T] : BaseNode;
927
+
928
+ export { type AmbientLightOptions as $, ACTOR_TYPE as A, BOX_TYPE as B, type CollisionShapeType as C, DISK_TYPE as D, createPyramid as E, ZylemPyramid as F, PYRAMID_TYPE as G, createCylinder as H, ZylemCylinder as I, CYLINDER_TYPE as J, createPill as K, ZylemPill as L, PILL_TYPE as M, createParticleSystem as N, type OnHeldParams as O, PLANE_TYPE as P, ZylemParticleSystem as Q, RECT_TYPE as R, SPHERE_TYPE as S, TEXT_TYPE as T, PARTICLE_SYSTEM_TYPE as U, type ZylemParticleSystemOptions as V, createLight as W, ZylemLight as X, LIGHT_TYPE as Y, ZylemBox as Z, type ZylemLightOptions as _, createSphere as a, type HemisphereLightOptions as a0, type DirectionalLightOptions as a1, type PointLightOptions as a2, type SpotLightOptions as a3, type LightShadowOptions as a4, createFog as a5, ZylemFog as a6, FOG_TYPE as a7, createLine as a8, ZylemLine as a9, LINE_TYPE as aa, pickZylemLine as ab, type ZylemLineOptions as ac, type LinePickResult as ad, type ZylemFogOptions as ae, type ZylemFogType as af, type ZylemFogHeightOptions as ag, type ZylemFogNoiseOptions as ah, type EntityTypeMap as ai, type EntityForType as aj, ZylemWorld as ak, ZylemSphere as b, createBox as c, createSprite as d, ZylemSprite as e, SPRITE_TYPE as f, type SpriteImage as g, type SpriteAnimation as h, createPlane as i, ZylemPlane as j, createZone as k, ZylemZone as l, ZONE_TYPE as m, type OnEnterParams as n, type OnExitParams as o, createActor as p, ZylemActor as q, createText as r, ZylemText as s, createRect as t, ZylemRect as u, createDisk as v, ZylemDisk as w, createCone as x, ZylemCone as y, CONE_TYPE as z };