@zylem/game-lib 0.8.0 → 0.8.3

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 (81) hide show
  1. package/dist/actions.d.ts +6 -6
  2. package/dist/api/game-lib.api.json +3105 -1223
  3. package/dist/api/game-lib.api.md +197 -96
  4. package/dist/api/game-lib.d.ts +448 -96
  5. package/dist/api/game-lib.typedoc.json +134986 -201814
  6. package/dist/{base-node-life-cycle-D2NuN1VB.d.ts → base-node-life-cycle-BK9xebT9.d.ts} +6 -0
  7. package/dist/bridge.d.ts +97 -0
  8. package/dist/bridge.js +1 -0
  9. package/dist/chunk-2VSVOPQN.js +19 -0
  10. package/dist/chunk-3I537JFL.js +1 -0
  11. package/dist/chunk-47DG7I7M.js +1 -0
  12. package/dist/chunk-7QF6YTEZ.js +1 -0
  13. package/dist/chunk-AIQ6IVT5.js +1 -0
  14. package/dist/chunk-C5NEGC3S.js +1 -0
  15. package/dist/chunk-CV75NSES.js +1 -0
  16. package/dist/chunk-EVYHPR3J.js +1 -0
  17. package/dist/chunk-GKHAJ3MW.js +1 -0
  18. package/dist/chunk-HNCTOJP7.js +1 -0
  19. package/dist/{chunk-M3XNO56P.js → chunk-JNFFTNMH.js} +1 -1
  20. package/dist/{chunk-XNDS4YFR.js → chunk-LGS5N5M4.js} +1 -1
  21. package/dist/chunk-LKFF6XJC.js +1 -0
  22. package/dist/{chunk-RXDTAWI2.js → chunk-PCFF4LLO.js} +1 -1
  23. package/dist/chunk-Q27ULMXY.js +24 -0
  24. package/dist/chunk-TV3AZKT4.js +9 -0
  25. package/dist/chunk-UG22Z42P.js +1 -0
  26. package/dist/chunk-W5SXED5T.js +1 -0
  27. package/dist/chunk-WVSYUWTT.js +1 -0
  28. package/dist/chunk-YAOXFYOD.js +1 -0
  29. package/dist/{collision-builder-jF-toPIl.d.ts → collision-builder-B_tm8OVy.d.ts} +13 -2
  30. package/dist/core.d.ts +15 -15
  31. package/dist/core.js +1 -1
  32. package/dist/debug-state-Dp9CQQZ4.d.ts +49 -0
  33. package/dist/debug.d.ts +27 -8
  34. package/dist/debug.js +1 -1
  35. package/dist/{default-controls-0-vCnli7.d.ts → default-controls-CAKJ5zlo.d.ts} +2 -2
  36. package/dist/{entity-DZbFQ1Wg.d.ts → entity-B9yZeBm4.d.ts} +7 -1
  37. package/dist/{entity-BdSI8CL3.d.ts → entity-BGEq1yfC.d.ts} +32 -4
  38. package/dist/{entity-type-map-Bd69SpAS.d.ts → entity-type-map-CW6RHQkx.d.ts} +5 -5
  39. package/dist/entity.d.ts +12 -10
  40. package/dist/entity.js +1 -1
  41. package/dist/events.d.ts +2 -65
  42. package/dist/events.js +1 -1
  43. package/dist/{game-C1FHVqXl.d.ts → game-NHkubIfI.d.ts} +89 -32
  44. package/dist/game-default-5TB3T5N7.js +1 -0
  45. package/dist/{game-interfaces-mchNYSZE.d.ts → game-interfaces-vF5sRi1n.d.ts} +7 -1
  46. package/dist/globals.d.ts +1 -1
  47. package/dist/graphics.d.ts +5 -5
  48. package/dist/input-ui.d.ts +4 -4
  49. package/dist/input-ui.js +1 -1
  50. package/dist/input.d.ts +47 -4
  51. package/dist/input.js +1 -1
  52. package/dist/{material-9vJ6SZaI.d.ts → material-DbSuZBbP.d.ts} +1 -1
  53. package/dist/public.d.ts +16 -14
  54. package/dist/public.js +1 -1
  55. package/dist/runtime.d.ts +3 -3
  56. package/dist/runtime.js +1 -1
  57. package/dist/schema/game-config.schema.json +18 -0
  58. package/dist/schema/input-config.schema.json +18 -0
  59. package/dist/schema.d.ts +12 -0
  60. package/dist/schema.js +1 -1
  61. package/dist/{vector-CiSHbivc.d.ts → vector-DN6zlPoE.d.ts} +28 -0
  62. package/dist/web-components.d.ts +12 -12
  63. package/dist/web-components.js +1 -1
  64. package/dist/{zylem-camera-C3bn6BTI.d.ts → zylem-camera-Du2UPW9O.d.ts} +13 -1
  65. package/package.json +8 -3
  66. package/dist/chunk-7FR5JSQ2.js +0 -1
  67. package/dist/chunk-COM6HJ2L.js +0 -1
  68. package/dist/chunk-E3UBSUPX.js +0 -1
  69. package/dist/chunk-FKIKN7RP.js +0 -24
  70. package/dist/chunk-G4HONLWC.js +0 -1
  71. package/dist/chunk-IKWE2W6L.js +0 -1
  72. package/dist/chunk-JEHFHUH4.js +0 -0
  73. package/dist/chunk-JNKPTL77.js +0 -1
  74. package/dist/chunk-JQKS42G4.js +0 -1
  75. package/dist/chunk-MSC2BEO5.js +0 -1
  76. package/dist/chunk-TAUWDQZF.js +0 -9
  77. package/dist/chunk-VS2D4B3W.js +0 -1
  78. package/dist/chunk-XNHVRFAK.js +0 -1
  79. package/dist/chunk-YHEWKN7N.js +0 -1
  80. package/dist/debug-state-BPT6jEog.d.ts +0 -17
  81. package/dist/game-default-QHROHW2O.js +0 -1
package/dist/debug.d.ts CHANGED
@@ -1,12 +1,12 @@
1
- export { D as DebugTools, d as debugState, s as setDebugTool, a as setPaused, b as setSelectedEntity } from './debug-state-BPT6jEog.js';
1
+ export { k as DebugEntityResolver, D as DebugTools, d as debugState, i as getHoveredEntity, h as getHoveredEntityId, e as getSelectedEntity, g as getSelectedEntityId, r as registerDebugEntityResolver, j as resolveDebugEntity, s as setDebugTool, f as setHoveredEntityId, a as setPaused, b as setSelectedEntity, c as setSelectedEntityId } from './debug-state-Dp9CQQZ4.js';
2
2
  import { Object3D, Vector3 } from 'three';
3
- import { G as GameEntity } from './entity-BdSI8CL3.js';
3
+ import { G as GameEntity } from './entity-BGEq1yfC.js';
4
4
  import { WebGPURenderer } from 'three/webgpu';
5
5
  import '@zylem/behaviors/core';
6
- import './vector-CiSHbivc.js';
7
- import './material-9vJ6SZaI.js';
8
- import './collision-builder-jF-toPIl.js';
9
- import './base-node-life-cycle-D2NuN1VB.js';
6
+ import './vector-DN6zlPoE.js';
7
+ import './material-DbSuZBbP.js';
8
+ import './collision-builder-B_tm8OVy.js';
9
+ import './base-node-life-cycle-BK9xebT9.js';
10
10
  import './stage-transition-CmGpV4tc.js';
11
11
  import './events.js';
12
12
  import 'mitt';
@@ -44,6 +44,10 @@ interface ObjectBounds {
44
44
  }
45
45
 
46
46
  interface EntityThumbnailResult {
47
+ /**
48
+ * Preview image URL. Blob URL when the payload worker is available
49
+ * (encoded off-thread), PNG data URL on the synchronous fallback path.
50
+ */
47
51
  dataUrl: string;
48
52
  bounds: Pick<ObjectBounds, 'width' | 'height' | 'depth'>;
49
53
  }
@@ -59,15 +63,30 @@ declare class EntityThumbnailCache {
59
63
  private inFlight;
60
64
  private renderer;
61
65
  private size;
62
- constructor(size?: number);
66
+ private maxEntries;
67
+ private queue;
68
+ private activeRenders;
69
+ constructor(size?: number, maxEntries?: number);
63
70
  setRenderer(renderer: WebGPURenderer | null): void;
64
71
  get(uuid: string): EntityThumbnailCacheEntry | null;
65
72
  invalidate(uuid: string): void;
66
73
  clear(): void;
74
+ /** Number of thumbnails currently cached. */
75
+ get cacheSize(): number;
76
+ /** Entities waiting for a render slot. */
77
+ get pendingCount(): number;
67
78
  /**
68
- * Return a cached thumbnail or generate one asynchronously.
79
+ * Return a cached thumbnail, or schedule one. Renders are throttled to
80
+ * {@link MAX_CONCURRENT_RENDERS} at a time behind a bounded queue, so a
81
+ * burst of spawns cannot flood the renderer with pixel readbacks.
69
82
  */
70
83
  ensure(uuid: string, object: Object3D | null | undefined): Promise<EntityThumbnailCacheEntry | null>;
84
+ /** Start queued renders until the concurrency budget is spent. */
85
+ private drainQueue;
86
+ /** Move an entry to the end of the Map so it is evicted last. */
87
+ private touch;
88
+ /** Evict least-recently-used entries down to the cap. */
89
+ private evictOverflow;
71
90
  private render;
72
91
  }
73
92
  /** Shared cache used by the running game to feed editor entity payloads. */
package/dist/debug.js CHANGED
@@ -1 +1 @@
1
- import"./chunk-DFLI7ICU.js";import{a as e,b as f}from"./chunk-COM6HJ2L.js";import{c as g,d as h}from"./chunk-VS2D4B3W.js";import{a,c as b,e as c,f as d}from"./chunk-JQKS42G4.js";export{e as EntityThumbnailCache,a as debugState,f as entityThumbnailCache,h as focusEntity,g as registerEntityFocusContext,c as setDebugTool,b as setPaused,d as setSelectedEntity};
1
+ import"./chunk-DFLI7ICU.js";import{a as m,b as n}from"./chunk-2VSVOPQN.js";import"./chunk-C5NEGC3S.js";import{a as o,b as p}from"./chunk-LKFF6XJC.js";import{a,b,c,e as d,g as e,h as f,i as g,j as h,k as i,m as j,n as k,o as l}from"./chunk-W5SXED5T.js";export{m as EntityThumbnailCache,a as debugState,n as entityThumbnailCache,p as focusEntity,k as getHoveredEntity,h as getHoveredEntityId,j as getSelectedEntity,f as getSelectedEntityId,b as registerDebugEntityResolver,o as registerEntityFocusContext,c as resolveDebugEntity,e as setDebugTool,i as setHoveredEntityId,d as setPaused,l as setSelectedEntity,g as setSelectedEntityId};
@@ -1,5 +1,5 @@
1
- import { b as InputPlayer } from './base-node-life-cycle-D2NuN1VB.js';
2
- import { d as VirtualTouchButtonSlot, e as VirtualTouchConfig, G as GameInputConfig } from './game-interfaces-mchNYSZE.js';
1
+ import { b as InputPlayer } from './base-node-life-cycle-BK9xebT9.js';
2
+ import { d as VirtualTouchButtonSlot, e as VirtualTouchConfig, G as GameInputConfig } from './game-interfaces-vF5sRi1n.js';
3
3
 
4
4
  /**
5
5
  * Color tokens consumed by the SVG factories in `svg-assets.ts` and the
@@ -1,5 +1,5 @@
1
1
  import { Group, Mesh } from 'three';
2
- import { l as SimulationBody } from './vector-CiSHbivc.js';
2
+ import { l as SimulationBody } from './vector-DN6zlPoE.js';
3
3
 
4
4
  type LifecycleFunction<T> = (params?: any) => void;
5
5
  interface Entity<T = any> {
@@ -20,6 +20,12 @@ interface StageEntity extends Entity {
20
20
  instanceId: number;
21
21
  isInstanced?: boolean;
22
22
  isBundled?: boolean;
23
+ /**
24
+ * When true, `syncRenderPoses` leaves the entity's Three.js transform alone.
25
+ * Used for camera-parented viewmodels so physics pose sync cannot overwrite
26
+ * the local offset.
27
+ */
28
+ skipRenderPoseSync?: boolean;
23
29
  controlledRotation: boolean;
24
30
  name: string;
25
31
  markedForRemoval: boolean;
@@ -1,9 +1,9 @@
1
1
  import { BufferGeometry, Material, Mesh, Group, Vector3, Color, ShaderMaterial } from 'three';
2
2
  import { SimulationColliderDefinition, TransformState, SimulationBodyDefinition, MoveableEntity, BehaviorRuntime, Vector, BehaviorDescriptor, BehaviorHandle, BehaviorRef } from '@zylem/behaviors/core';
3
- import { c as Vec3, e as Vec3Input, b as Vec2Input, l as SimulationBody } from './vector-CiSHbivc.js';
4
- import { M as MaterialBuilder, e as MaterialOptions } from './material-9vJ6SZaI.js';
5
- import { C as CollisionBuilder, a as CollisionOptions } from './collision-builder-jF-toPIl.js';
6
- import { a as SetupContext, U as UpdateContext, D as DestroyContext, h as SetupFunction, i as LoadedFunction, g as UpdateFunction, j as DestroyFunction, C as CleanupFunction, k as LoadedContext, l as CleanupContext } from './base-node-life-cycle-D2NuN1VB.js';
3
+ import { c as Vec3, e as Vec3Input, b as Vec2Input, l as SimulationBody } from './vector-DN6zlPoE.js';
4
+ import { M as MaterialBuilder, e as MaterialOptions } from './material-DbSuZBbP.js';
5
+ import { C as CollisionBuilder, L as LockAxesInput, a as CollisionOptions } from './collision-builder-B_tm8OVy.js';
6
+ import { a as SetupContext, U as UpdateContext, D as DestroyContext, h as SetupFunction, i as LoadedFunction, g as UpdateFunction, j as DestroyFunction, C as CleanupFunction, k as LoadedContext, l as CleanupContext } from './base-node-life-cycle-BK9xebT9.js';
7
7
  import { EventEmitterDelegate, EntityEvents } from './events.js';
8
8
 
9
9
  interface NodeInterface {
@@ -252,6 +252,12 @@ interface BaseCollisionOptions {
252
252
  collisionType?: string;
253
253
  /** Allowed collision types for filtering */
254
254
  collisionFilter?: string[];
255
+ /** Gravity scale applied at body spawn (no live setter FFI; default 1). */
256
+ gravityScale?: number;
257
+ /** Lock rotation axes at body spawn: `true` for all, or per-axis tuple. */
258
+ lockRotations?: LockAxesInput;
259
+ /** Lock translation axes at body spawn: `true` for all, or per-axis tuple. */
260
+ lockTranslations?: LockAxesInput;
255
261
  }
256
262
  interface BoxCollisionOptions extends BaseCollisionOptions {
257
263
  /** Box dimensions (default: 1x1x1) */
@@ -402,6 +408,17 @@ type GameEntityOptions = {
402
408
  color?: Color;
403
409
  size?: Vec3Input;
404
410
  position?: Vec3Input;
411
+ /**
412
+ * Spawn visibility behavior:
413
+ * - `undefined` (default): hidden while `spawnEntity` runs, revealed once
414
+ * the spawn finalizes — even if no position was assigned.
415
+ * - `true` (strict): stays hidden until the first `setPosition`/`setPose`,
416
+ * for spawner patterns that place the entity frames after spawn.
417
+ * - `false`: never hidden during spawn.
418
+ */
419
+ hideUntilPositioned?: boolean;
420
+ /** Explicit render visibility. When false, entity stays hidden until {@link GameEntity.reveal}. */
421
+ visible?: boolean;
405
422
  /** Render path: `environment` (bundle), `pack` (instanced), or `none` (default). */
406
423
  category?: RenderCategory;
407
424
  runtime?: RuntimeEntityOptions;
@@ -482,6 +499,14 @@ declare class GameEntity<O extends GameEntityOptions> extends BaseNode<O> implem
482
499
  private trackAddedComponents;
483
500
  private trackedComponents;
484
501
  transformStore: TransformState;
502
+ /** Hide render target until spawn placement is confirmed. */
503
+ _spawnPlacementPending: boolean;
504
+ /** Author passed `position` in create options. */
505
+ _spawnPositionExplicit: boolean;
506
+ /** setPosition / setPose assigned a spawn placement during this spawn. */
507
+ _spawnPlacementReady: boolean;
508
+ /** True while {@link StageEntityDelegate.spawnEntity} is running for this entity. */
509
+ _spawnInProgress: boolean;
485
510
  moveX: (delta: number) => void;
486
511
  moveY: (delta: number) => void;
487
512
  moveZ: (delta: number) => void;
@@ -514,6 +539,9 @@ declare class GameEntity<O extends GameEntityOptions> extends BaseNode<O> implem
514
539
  setRotation: (x: number, y: number, z: number) => void;
515
540
  getRotation: () => any;
516
541
  constructor();
542
+ private wrapSpawnPlacementMutators;
543
+ /** Make the entity visible, clearing spawn placement pending state. */
544
+ reveal(): void;
517
545
  /**
518
546
  * Read the entity's pose from the wasm simulation. Returns `null` when
519
547
  * the entity has not been spawned into the runtime yet.
@@ -1,10 +1,10 @@
1
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';
2
+ import { G as GameEntity, a as GameEntityOptions, B as BaseNode } from './entity-BGEq1yfC.js';
3
+ import { d as Vec3Components, e as Vec3Input, b as Vec2Input } from './vector-DN6zlPoE.js';
4
+ import { U as UpdateContext, a as SetupContext, D as DestroyContext, l as CleanupContext } from './base-node-life-cycle-BK9xebT9.js';
5
+ import { T as TexturePath, e as MaterialOptions } from './material-DbSuZBbP.js';
6
6
  import { Simulation } from '@zylem/behaviors/core';
7
- import { E as Entity } from './entity-DZbFQ1Wg.js';
7
+ import { E as Entity } from './entity-B9yZeBm4.js';
8
8
  import { ParticleEmitterBehaviorOptions, ParticleEffectDefinition, ParticleEmitterHandle } from '@zylem/behaviors/particle-emitter';
9
9
  import { Line2 } from 'three/addons/lines/webgpu/Line2.js';
10
10
 
package/dist/entity.d.ts CHANGED
@@ -1,16 +1,16 @@
1
- export { A as ACTOR_TYPE, $ as AmbientLightOptions, B as BOX_TYPE, z as CONE_TYPE, J as CYLINDER_TYPE, C as CollisionShapeType, D as DISK_TYPE, a1 as DirectionalLightOptions, aj as EntityForType, ai as EntityTypeMap, a7 as FOG_TYPE, a0 as HemisphereLightOptions, Y as LIGHT_TYPE, aa as LINE_TYPE, a4 as LightShadowOptions, ad as LinePickResult, n as OnEnterParams, o as OnExitParams, O as OnHeldParams, U as PARTICLE_SYSTEM_TYPE, M as PILL_TYPE, P as PLANE_TYPE, G as PYRAMID_TYPE, a2 as PointLightOptions, R as RECT_TYPE, S as SPHERE_TYPE, f as SPRITE_TYPE, a3 as SpotLightOptions, h as SpriteAnimation, g as SpriteImage, T as TEXT_TYPE, m as ZONE_TYPE, q as ZylemActor, Z as ZylemBox, y as ZylemCone, I as ZylemCylinder, w as ZylemDisk, a6 as ZylemFog, ag as ZylemFogHeightOptions, ah as ZylemFogNoiseOptions, ae as ZylemFogOptions, af as ZylemFogType, X as ZylemLight, _ as ZylemLightOptions, a9 as ZylemLine, ac as ZylemLineOptions, Q as ZylemParticleSystem, V as ZylemParticleSystemOptions, L as ZylemPill, j as ZylemPlane, F as ZylemPyramid, u as ZylemRect, b as ZylemSphere, e as ZylemSprite, s as ZylemText, l as ZylemZone, p as createActor, c as createBox, x as createCone, H as createCylinder, v as createDisk, a5 as createFog, W as createLight, a8 as createLine, N as createParticleSystem, K as createPill, i as createPlane, E as createPyramid, t as createRect, a as createSphere, d as createSprite, r as createText, k as createZone, ab as pickZylemLine } from './entity-type-map-Bd69SpAS.js';
2
- import { G as GameEntity, a as GameEntityOptions, E as EntityBuilder, D as EntityMeshBuilder, F as EntityCollisionBuilder, B as BaseNode } from './entity-BdSI8CL3.js';
3
- export { C as CollisionComponent, b as boxCollision, d as coneCollision, c as create, e as cylinderCollision, f as pillCollision, g as planeCollision, p as pyramidCollision, s as sphereCollision, z as zoneCollision } from './entity-BdSI8CL3.js';
1
+ export { A as ACTOR_TYPE, $ as AmbientLightOptions, B as BOX_TYPE, z as CONE_TYPE, J as CYLINDER_TYPE, C as CollisionShapeType, D as DISK_TYPE, a1 as DirectionalLightOptions, aj as EntityForType, ai as EntityTypeMap, a7 as FOG_TYPE, a0 as HemisphereLightOptions, Y as LIGHT_TYPE, aa as LINE_TYPE, a4 as LightShadowOptions, ad as LinePickResult, n as OnEnterParams, o as OnExitParams, O as OnHeldParams, U as PARTICLE_SYSTEM_TYPE, M as PILL_TYPE, P as PLANE_TYPE, G as PYRAMID_TYPE, a2 as PointLightOptions, R as RECT_TYPE, S as SPHERE_TYPE, f as SPRITE_TYPE, a3 as SpotLightOptions, h as SpriteAnimation, g as SpriteImage, T as TEXT_TYPE, m as ZONE_TYPE, q as ZylemActor, Z as ZylemBox, y as ZylemCone, I as ZylemCylinder, w as ZylemDisk, a6 as ZylemFog, ag as ZylemFogHeightOptions, ah as ZylemFogNoiseOptions, ae as ZylemFogOptions, af as ZylemFogType, X as ZylemLight, _ as ZylemLightOptions, a9 as ZylemLine, ac as ZylemLineOptions, Q as ZylemParticleSystem, V as ZylemParticleSystemOptions, L as ZylemPill, j as ZylemPlane, F as ZylemPyramid, u as ZylemRect, b as ZylemSphere, e as ZylemSprite, s as ZylemText, l as ZylemZone, p as createActor, c as createBox, x as createCone, H as createCylinder, v as createDisk, a5 as createFog, W as createLight, a8 as createLine, N as createParticleSystem, K as createPill, i as createPlane, E as createPyramid, t as createRect, a as createSphere, d as createSprite, r as createText, k as createZone, ab as pickZylemLine } from './entity-type-map-CW6RHQkx.js';
2
+ import { G as GameEntity, a as GameEntityOptions, E as EntityBuilder, D as EntityMeshBuilder, F as EntityCollisionBuilder, B as BaseNode } from './entity-BGEq1yfC.js';
3
+ export { C as CollisionComponent, b as boxCollision, d as coneCollision, c as create, e as cylinderCollision, f as pillCollision, g as planeCollision, p as pyramidCollision, s as sphereCollision, z as zoneCollision } from './entity-BGEq1yfC.js';
4
4
  import { Color, Mesh } from 'three';
5
- import { b as Vec2Input, e as Vec3Input } from './vector-CiSHbivc.js';
6
- import { e as MaterialOptions } from './material-9vJ6SZaI.js';
7
- import './base-node-life-cycle-D2NuN1VB.js';
5
+ import { b as Vec2Input, e as Vec3Input } from './vector-DN6zlPoE.js';
6
+ import { e as MaterialOptions } from './material-DbSuZBbP.js';
7
+ import './base-node-life-cycle-BK9xebT9.js';
8
8
  import './stage-transition-CmGpV4tc.js';
9
9
  import '@zylem/behaviors/core';
10
- import './entity-DZbFQ1Wg.js';
10
+ import './entity-B9yZeBm4.js';
11
11
  import '@zylem/behaviors/particle-emitter';
12
12
  import 'three/addons/lines/webgpu/Line2.js';
13
- import './collision-builder-jF-toPIl.js';
13
+ import './collision-builder-B_tm8OVy.js';
14
14
  import './events.js';
15
15
  import 'mitt';
16
16
  import 'three/webgpu';
@@ -52,8 +52,10 @@ interface TemplateFactory<E extends GameEntity<O>, O extends GameEntityOptions =
52
52
  * const asteroidFactory = createEntityFactory(asteroidTemplate);
53
53
  * const asteroids = asteroidFactory.generate(10);
54
54
  *
55
- * asteroids.forEach((asteroid, i) => {
56
- * asteroid.setPosition(Math.random() * 20 - 10, Math.random() * 15 - 7.5, 0);
55
+ * asteroids.forEach((asteroid) => {
56
+ * asteroid.onSetup(({ me }) => {
57
+ * me.setPosition(Math.random() * 20 - 10, Math.random() * 15 - 7.5, 0);
58
+ * });
57
59
  * stage.add(asteroid);
58
60
  * });
59
61
  * ```
package/dist/entity.js CHANGED
@@ -1 +1 @@
1
- import{A as $,B as aa,C as ba,D as ca,E as da,F as ea,G as fa,H as ga,I as ha,J as ia,K as ja,L as ka,M as la,N as ma,O as na,P as oa,Q as pa,R as qa,a as B,b as C,c as D,d as E,e as F,f as G,g as H,h as I,i as J,j as K,k as L,l as M,m as N,n as O,o as P,p as Q,q as R,r as S,s as T,t as U,u as V,v as W,w as X,x as Y,y as Z,z as _}from"./chunk-7FR5JSQ2.js";import{b as q,c as r,d as s,e as t,f as u,g as v,h as w,i as x,j as y,k as z,m as A}from"./chunk-XNDS4YFR.js";import{c as a,d as b,e as c,f as d,g as e,h as f,i as g,j as h,n as i,p as j,t as k,u as l,v as m,w as n,x as o,y as p}from"./chunk-XNHVRFAK.js";import"./chunk-CM5YRNBJ.js";import"./chunk-YHEWKN7N.js";import"./chunk-QXVH6POE.js";import"./chunk-E3UBSUPX.js";import"./chunk-4QLJUQSJ.js";import"./chunk-7WRQ2UAN.js";import"./chunk-XRP4JJXL.js";export{k as ACTOR_TYPE,H as BOX_TYPE,Z as CONE_TYPE,da as CYLINDER_TYPE,W as DISK_TYPE,n as FOG_TYPE,ma as LIGHT_TYPE,w as LINE_TYPE,ja as PARTICLE_SYSTEM_TYPE,ga as PILL_TYPE,N as PLANE_TYPE,aa as PYRAMID_TYPE,T as RECT_TYPE,K as SPHERE_TYPE,t as SPRITE_TYPE,q as TEXT_TYPE,Q as ZONE_TYPE,l as ZylemActor,I as ZylemBox,_ as ZylemCone,ea as ZylemCylinder,X as ZylemDisk,o as ZylemFog,na as ZylemLight,y as ZylemLine,ka as ZylemParticleSystem,ha as ZylemPill,O as ZylemPlane,ba as ZylemPyramid,U as ZylemRect,L as ZylemSphere,u as ZylemSprite,r as ZylemText,R as ZylemZone,a as boxCollision,B as boxMesh,c as coneCollision,D as coneMesh,i as create,m as createActor,J as createBox,$ as createCone,pa as createCooldownIcon,fa as createCylinder,Y as createDisk,j as createEntity,A as createEntityFactory,p as createFog,oa as createLight,z as createLine,la as createParticleSystem,ia as createPill,P as createPlane,ca as createPyramid,V as createRect,M as createSphere,v as createSprite,s as createText,S as createZone,e as cylinderCollision,F as cylinderMesh,qa as destroy,x as pickZylemLine,f as pillCollision,G as pillMesh,g as planeCollision,d as pyramidCollision,E as pyramidMesh,b as sphereCollision,C as sphereMesh,h as zoneCollision};
1
+ import{A as $,B as aa,C as ba,D as ca,E as da,F as ea,G as fa,H as ga,I as ha,J as ia,K as ja,L as ka,M as la,N as ma,O as na,P as oa,Q as pa,R as qa,a as B,b as C,c as D,d as E,e as F,f as G,g as H,h as I,i as J,j as K,k as L,l as M,m as N,n as O,o as P,p as Q,q as R,r as S,s as T,t as U,u as V,v as W,w as X,x as Y,y as Z,z as _}from"./chunk-CV75NSES.js";import{b as q,c as r,d as s,e as t,f as u,g as v,h as w,i as x,j as y,k as z,m as A}from"./chunk-LGS5N5M4.js";import{A as m,B as n,C as o,D as p,c as a,d as b,e as c,f as d,g as e,h as f,i as g,j as h,s as i,u as j,y as k,z as l}from"./chunk-3I537JFL.js";import"./chunk-CM5YRNBJ.js";import"./chunk-AIQ6IVT5.js";import"./chunk-QXVH6POE.js";import"./chunk-EVYHPR3J.js";import"./chunk-4QLJUQSJ.js";import"./chunk-7WRQ2UAN.js";import"./chunk-XRP4JJXL.js";export{k as ACTOR_TYPE,H as BOX_TYPE,Z as CONE_TYPE,da as CYLINDER_TYPE,W as DISK_TYPE,n as FOG_TYPE,ma as LIGHT_TYPE,w as LINE_TYPE,ja as PARTICLE_SYSTEM_TYPE,ga as PILL_TYPE,N as PLANE_TYPE,aa as PYRAMID_TYPE,T as RECT_TYPE,K as SPHERE_TYPE,t as SPRITE_TYPE,q as TEXT_TYPE,Q as ZONE_TYPE,l as ZylemActor,I as ZylemBox,_ as ZylemCone,ea as ZylemCylinder,X as ZylemDisk,o as ZylemFog,na as ZylemLight,y as ZylemLine,ka as ZylemParticleSystem,ha as ZylemPill,O as ZylemPlane,ba as ZylemPyramid,U as ZylemRect,L as ZylemSphere,u as ZylemSprite,r as ZylemText,R as ZylemZone,a as boxCollision,B as boxMesh,c as coneCollision,D as coneMesh,i as create,m as createActor,J as createBox,$ as createCone,pa as createCooldownIcon,fa as createCylinder,Y as createDisk,j as createEntity,A as createEntityFactory,p as createFog,oa as createLight,z as createLine,la as createParticleSystem,ia as createPill,P as createPlane,ca as createPyramid,V as createRect,M as createSphere,v as createSprite,s as createText,S as createZone,e as cylinderCollision,F as cylinderMesh,qa as destroy,x as pickZylemLine,f as pillCollision,G as pillMesh,g as planeCollision,d as pyramidCollision,E as pyramidMesh,b as sphereCollision,C as sphereMesh,h as zoneCollision};
package/dist/events.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as mitt from 'mitt';
2
- import { L as LoadingEvent } from './base-node-life-cycle-D2NuN1VB.js';
2
+ import { L as LoadingEvent } from './base-node-life-cycle-BK9xebT9.js';
3
3
  import 'three';
4
4
  import './stage-transition-CmGpV4tc.js';
5
5
 
@@ -45,68 +45,6 @@ interface GameLoadingPayload extends LoadingEvent {
45
45
  stageName?: string;
46
46
  stageIndex?: number;
47
47
  }
48
- /** Payload for stage configuration sent to editor. */
49
- interface StageConfigPayload {
50
- id: string;
51
- backgroundColor: string;
52
- backgroundImage: string | null;
53
- gravity: {
54
- x: number;
55
- y: number;
56
- z: number;
57
- };
58
- inputs: Record<string, string[]>;
59
- variables: Record<string, unknown>;
60
- }
61
- /** Payload for entity configuration sent to editor. */
62
- interface EntityConfigPayload {
63
- uuid: string;
64
- name: string;
65
- type: string;
66
- position: {
67
- x: number;
68
- y: number;
69
- z: number;
70
- };
71
- rotation: {
72
- x: number;
73
- y: number;
74
- z: number;
75
- };
76
- scale: {
77
- x: number;
78
- y: number;
79
- z: number;
80
- };
81
- /** PNG data URL of a framed entity preview, when available. */
82
- thumbnail?: string | null;
83
- /** World-space AABB size used for thumbnail rulers. */
84
- bounds?: {
85
- width: number;
86
- height: number;
87
- depth: number;
88
- };
89
- }
90
- /** Payload for state dispatch events from game to editor. */
91
- interface StateDispatchPayload {
92
- scope: 'game' | 'stage' | 'entity';
93
- path: string;
94
- value: unknown;
95
- previousValue?: unknown;
96
- config?: {
97
- id: string;
98
- aspectRatio: number;
99
- fullscreen: boolean;
100
- bodyBackground: string | undefined;
101
- internalResolution: {
102
- width: number;
103
- height: number;
104
- } | undefined;
105
- debug: boolean;
106
- } | null;
107
- stageConfig?: StageConfigPayload | null;
108
- entities?: EntityConfigPayload[] | null;
109
- }
110
48
  type GameEvents = {
111
49
  'loading:start': GameLoadingPayload;
112
50
  'loading:progress': GameLoadingPayload;
@@ -117,7 +55,6 @@ type GameEvents = {
117
55
  'debug': {
118
56
  enabled: boolean;
119
57
  };
120
- 'state:dispatch': StateDispatchPayload;
121
58
  };
122
59
  type StageEvents = {
123
60
  'stage:loaded': {
@@ -178,4 +115,4 @@ type ZylemEvents = GameEvents & StageEvents & EntityEvents;
178
115
  */
179
116
  declare const zylemEventBus: mitt.Emitter<ZylemEvents>;
180
117
 
181
- export { type EntityConfigPayload, type EntityEvents, EventEmitterDelegate, type GameEvents, type GameLoadingPayload, type StageConfigPayload, type StageEvents, type StateDispatchPayload, type ZylemEvents, zylemEventBus };
118
+ export { type EntityEvents, EventEmitterDelegate, type GameEvents, type GameLoadingPayload, type StageEvents, type ZylemEvents, zylemEventBus };
package/dist/events.js CHANGED
@@ -1 +1 @@
1
- import"./chunk-BIGH6D34.js";import{a,b}from"./chunk-YHEWKN7N.js";import"./chunk-QXVH6POE.js";export{a as EventEmitterDelegate,b as zylemEventBus};
1
+ import"./chunk-BIGH6D34.js";import{a,b}from"./chunk-AIQ6IVT5.js";import"./chunk-QXVH6POE.js";export{a as EventEmitterDelegate,b as zylemEventBus};
@@ -1,15 +1,15 @@
1
- import { e as InputPlayerNumber, f as InputProvider, I as Inputs, h as SetupFunction, g as UpdateFunction, j as DestroyFunction, a as SetupContext, U as UpdateContext, D as DestroyContext, L as LoadingEvent, m as IGame, S as StageNavigationOptions } from './base-node-life-cycle-D2NuN1VB.js';
2
- import { G as GameInputConfig, B as BaseGlobals, Z as ZylemGameConfig } from './game-interfaces-mchNYSZE.js';
3
- import { G as GameEntity, a as GameEntityOptions, B as BaseNode, y as GameEntityLifeCycle } from './entity-BdSI8CL3.js';
1
+ import { e as InputPlayerNumber, f as InputProvider, I as Inputs, h as SetupFunction, g as UpdateFunction, j as DestroyFunction, a as SetupContext, U as UpdateContext, D as DestroyContext, L as LoadingEvent, m as IGame, S as StageNavigationOptions } from './base-node-life-cycle-BK9xebT9.js';
2
+ import { G as GameInputConfig, B as BaseGlobals, Z as ZylemGameConfig } from './game-interfaces-vF5sRi1n.js';
3
+ import { G as GameEntity, a as GameEntityOptions, B as BaseNode, y as GameEntityLifeCycle } from './entity-BGEq1yfC.js';
4
4
  import { Scene, Color, Object3D, Vector3, BufferGeometry, Material, Group, Texture } from 'three';
5
- import { ak as ZylemWorld, ai as EntityTypeMap } from './entity-type-map-Bd69SpAS.js';
6
- import { E as Entity, L as LifecycleFunction, S as StageEntity } from './entity-DZbFQ1Wg.js';
7
- import { k as ZylemCamera, R as RendererManager, e as CameraPerspective, d as CameraContext, C as CameraPose, P as PerspectiveType, f as CameraBehavior, g as CameraAction, h as CameraPipelineState, V as Viewport, Z as ZylemPostEffect } from './zylem-camera-C3bn6BTI.js';
8
- import { d as ZylemShader } from './material-9vJ6SZaI.js';
9
- import { l as SimulationBody, e as Vec3Input, b as Vec2Input, d as Vec3Components } from './vector-CiSHbivc.js';
5
+ import { ak as ZylemWorld, ai as EntityTypeMap } from './entity-type-map-CW6RHQkx.js';
6
+ import { E as Entity, L as LifecycleFunction, S as StageEntity } from './entity-B9yZeBm4.js';
7
+ import { k as ZylemCamera, R as RendererManager, e as CameraPerspective, d as CameraContext, C as CameraPose, P as PerspectiveType, f as CameraBehavior, g as CameraAction, h as CameraPipelineState, V as Viewport, Z as ZylemPostEffect } from './zylem-camera-Du2UPW9O.js';
8
+ import { d as ZylemShader } from './material-DbSuZBbP.js';
9
+ import { l as SimulationBody, e as Vec3Input, b as Vec2Input, d as Vec3Components } from './vector-DN6zlPoE.js';
10
10
  import { BehaviorSystem, BehaviorEntityLink, BehaviorRuntime, BehaviorSystemFactory, Simulation } from '@zylem/behaviors/core';
11
11
  import { StageEvents, GameEvents } from './events.js';
12
- import { D as DefaultTouchControlsOptions } from './default-controls-0-vCnli7.js';
12
+ import { D as DefaultTouchControlsOptions } from './default-controls-CAKJ5zlo.js';
13
13
  import { S as StageTransitionConfig } from './stage-transition-CmGpV4tc.js';
14
14
 
15
15
  declare class InputManager {
@@ -144,6 +144,10 @@ declare class CameraManager {
144
144
  private _activeCameras;
145
145
  /** Auto-created debug camera with orbit controls */
146
146
  private _debugCamera;
147
+ /** Gameplay primary camera saved while the debug camera is active. */
148
+ private _preDebugPrimary;
149
+ /** Scene anchor at world origin for debug orbit when nothing is selected. */
150
+ private _debugOrbitTargetAnchor;
147
151
  /** Reference to the shared renderer manager */
148
152
  private _rendererManager;
149
153
  /** Scene reference */
@@ -163,6 +167,10 @@ declare class CameraManager {
163
167
  * Get the debug camera.
164
168
  */
165
169
  get debugCamera(): ZylemCamera | null;
170
+ /**
171
+ * Gameplay primary camera that was active before debug mode was enabled.
172
+ */
173
+ get preDebugPrimary(): ZylemCamera | null;
166
174
  /**
167
175
  * Get all registered cameras.
168
176
  */
@@ -206,6 +214,16 @@ declare class CameraManager {
206
214
  * Also creates the debug camera.
207
215
  */
208
216
  setup(scene: Scene, rendererManager: RendererManager): Promise<void>;
217
+ /**
218
+ * Switch the primary viewport to the debug orbit camera, remembering the
219
+ * previous primary so gameplay cameras (e.g. first-person) can be restored.
220
+ */
221
+ activateDebugCamera(): boolean;
222
+ /**
223
+ * Restore the gameplay primary camera that was active before
224
+ * {@link activateDebugCamera}.
225
+ */
226
+ deactivateDebugCamera(): boolean;
209
227
  /**
210
228
  * Update all active cameras' controllers.
211
229
  */
@@ -227,8 +245,14 @@ declare class CameraManager {
227
245
  dispose(): void;
228
246
  /**
229
247
  * Create the always-available debug camera with orbit controls.
248
+ * Registered for lookup/activation, but not added to the active list.
230
249
  */
231
250
  private createDebugCamera;
251
+ /**
252
+ * Seed the debug camera orbit pose on first activation, framing the origin
253
+ * or offsetting from the saved gameplay primary.
254
+ */
255
+ private seedDebugCameraPose;
232
256
  /**
233
257
  * Resolve a camera from a name or reference.
234
258
  */
@@ -630,6 +654,8 @@ declare class FirstPersonPerspective implements CameraPerspective {
630
654
  look(deltaYaw: number, deltaPitch: number): void;
631
655
  /** Set absolute yaw and pitch. Pitch is clamped to the configured limit. */
632
656
  setLook(yaw: number, pitch: number): void;
657
+ /** Set eye height above the followed target (used when syncing from FirstPersonBehavior). */
658
+ setEyeHeight(height: number): void;
633
659
  /** Current yaw in radians. */
634
660
  get yaw(): number;
635
661
  /** Current pitch in radians. */
@@ -857,16 +883,33 @@ declare class StageDebugDelegate {
857
883
  private cameraDebugDelegate;
858
884
  private debugStateUnsubscribe;
859
885
  private focusContextUnregister;
886
+ private entityResolverUnregister;
887
+ private lastDebugEnabled;
888
+ private warnedMissingAddFactory;
860
889
  constructor(stage: ZylemStage, options?: StageDebugDelegateOptions);
890
+ /**
891
+ * Supply the factory the `add` tool uses to spawn entities at the clicked
892
+ * point. Without one the tool warns instead of silently doing nothing.
893
+ */
894
+ setAddEntityFactory(factory: AddEntityFactory | null): void;
895
+ /** Camera used for debug orbit / raycasts (active primary, usually `__debug__`). */
896
+ private getDebugViewCamera;
861
897
  private resolveEntity;
862
898
  /** Copy all stage children into debugMap so raycast/select tools work after enabling debug mid-session. */
863
899
  private populateDebugMap;
864
900
  private ensureCameraDebugDelegate;
901
+ /**
902
+ * Activate/deactivate only when `debugState.enabled` actually flips.
903
+ * Hover and selection write to `debugState` every frame, and `activate()`
904
+ * rebuilds post-processing, so reacting to every notification would
905
+ * rebuild the render pipeline once per frame.
906
+ */
865
907
  private syncWithDebugState;
866
- /** Initialize DOM listeners and camera debug delegate when debug is turned on. */
908
+ /** Initialize DOM listeners and switch rendering to the debug orbit camera. */
867
909
  private activate;
868
- /** Tear down visuals and camera debug delegate when debug is turned off. */
910
+ /** Tear down visuals and restore the gameplay primary camera. */
869
911
  private deactivate;
912
+ private rebindPostProcessing;
870
913
  private initDebugVisuals;
871
914
  private disposeDebugVisuals;
872
915
  update(): void;
@@ -1665,16 +1708,10 @@ declare class ZylemGame<TGlobals extends BaseGlobals> {
1665
1708
  private rendererObserver;
1666
1709
  private eventBusUnsubscribes;
1667
1710
  private thumbnailUnsubscribes;
1668
- /**
1669
- * Trailing-debounce timer for entity-driven state dispatches. Building a
1670
- * `state:dispatch` payload is O(entities) (and downstream editor stores
1671
- * re-proxy/reconcile every entity), so bursts of thumbnail/destroy events
1672
- * must coalesce into a single dispatch instead of one per entity.
1673
- */
1674
- private entityDispatchTimer;
1675
- private pendingEntityDispatchPath;
1676
- /** Debounce window (ms) for coalescing entity-driven state dispatches. */
1677
- private static readonly ENTITY_DISPATCH_DEBOUNCE_MS;
1711
+ /** Serialized last-published game config, for dirty-checking resize churn. */
1712
+ private lastPublishedGameConfig;
1713
+ /** Editor ↔ game bridge adapter (RAF-coalesced publishes, command intake). */
1714
+ private gameBridge;
1678
1715
  private readonly gameUpdateParams;
1679
1716
  private readonly stageSetupParams;
1680
1717
  private readonly stageUpdateParams;
@@ -1728,27 +1765,47 @@ declare class ZylemGame<TGlobals extends BaseGlobals> {
1728
1765
  */
1729
1766
  private buildStageConfigPayload;
1730
1767
  /**
1731
- * Build the entities payload for the current stage.
1768
+ * Build a bridge entity summary for one entity, or null for entities on
1769
+ * the managed render path (instanced packs/bundles), which can number in
1770
+ * the thousands and are not useful in the editor panel.
1771
+ */
1772
+ private buildEntitySummary;
1773
+ /**
1774
+ * Build the full entities payload for the current stage.
1732
1775
  */
1733
1776
  private buildEntitiesPayload;
1734
1777
  /**
1735
- * Generate entity thumbnails as entities become available, then refresh editor state.
1778
+ * Generate entity thumbnails as entities become available, streaming
1779
+ * upserts/thumbnails/removals to the editor through the bridge
1780
+ * (RAF-coalesced, merged by uuid).
1781
+ *
1782
+ * All of this work exists only to feed the editor, and thumbnails in
1783
+ * particular cost an offscreen render plus a pixel readback on the shared
1784
+ * renderer. Each publisher therefore checks the bridge for a live listener
1785
+ * first, and a late-connecting editor is backfilled from
1786
+ * {@link wireEditorBackfill}.
1736
1787
  */
1737
1788
  private wireEntityThumbnails;
1738
- private clearEntityThumbnailWiring;
1739
1789
  /**
1740
- * Coalesce entity-driven state dispatches (thumbnail resolutions, entity
1741
- * destruction) into one trailing `emitStateDispatch` per burst.
1790
+ * Republish the current stage when an editor subscribes after the game
1791
+ * started. Without this, entities added while nothing was listening would
1792
+ * never appear, since the per-entity publishers were skipped.
1742
1793
  */
1743
- private queueEntityStateDispatch;
1794
+ private wireEditorBackfill;
1795
+ private clearEntityThumbnailWiring;
1796
+ private buildGameConfigPayload;
1797
+ /** Publish the resolved display config over the bridge. */
1744
1798
  /**
1745
- * Emit a state:dispatch event to the zylemEventBus.
1746
- * Called after stage load and on global state changes.
1799
+ * Publish the display config, skipping unchanged payloads. The
1800
+ * `ResizeObserver` on `<zylem-game>` funnels into `setDisplayRuntime`, which
1801
+ * fires on every layout tick even when nothing about the config moved.
1747
1802
  */
1748
- private emitStateDispatch;
1803
+ private publishGameConfig;
1804
+ /** Publish a full stage snapshot (config + entity list) over the bridge. */
1805
+ private publishStageSnapshot;
1749
1806
  /**
1750
- * Subscribe to the game event bus for stage loading and state events.
1751
- * Emits events to zylemEventBus for cross-package communication.
1807
+ * Subscribe to the game event bus for stage loading and state events,
1808
+ * mirroring global-variable updates to the editor over the bridge.
1752
1809
  */
1753
1810
  private subscribeToEventBus;
1754
1811
  }
@@ -0,0 +1 @@
1
+ import{v as e}from"./chunk-WVSYUWTT.js";import"./chunk-C5NEGC3S.js";import"./chunk-GKHAJ3MW.js";import"./chunk-LKFF6XJC.js";import"./chunk-W5SXED5T.js";import"./chunk-YAOXFYOD.js";import"./chunk-3I537JFL.js";import"./chunk-CM5YRNBJ.js";import"./chunk-AIQ6IVT5.js";import"./chunk-QXVH6POE.js";import"./chunk-EVYHPR3J.js";import"./chunk-D2PATZCC.js";import"./chunk-4QLJUQSJ.js";import"./chunk-7WRQ2UAN.js";import"./chunk-BH53MBAZ.js";import"./chunk-XRP4JJXL.js";import"./chunk-UG22Z42P.js";import{proxy as t}from"valtio/vanilla";var s=()=>({id:"zylem",globals:{},stages:[e()],debug:!1,time:0,input:void 0}),a=t({...s()});function o(){return{id:a.id??"zylem",globals:a.globals??{},stages:a.stages??[e()],debug:a.debug,time:a.time,input:a.input}}export{o as getGameDefaultConfig};
@@ -1,4 +1,4 @@
1
- import { g as UpdateFunction } from './base-node-life-cycle-D2NuN1VB.js';
1
+ import { g as UpdateFunction } from './base-node-life-cycle-BK9xebT9.js';
2
2
 
3
3
  type BasicTypes = number | string | boolean;
4
4
  type BaseGlobals = Record<string, BasicTypes>;
@@ -60,6 +60,12 @@ interface MouseConfig {
60
60
  pointerLock?: boolean;
61
61
  /** Sensitivity multiplier for mouse movement (default 0.002). */
62
62
  sensitivity?: number;
63
+ /** How mouse position drives look: delta (movement) or screenCenter (cursor offset from viewport center). */
64
+ lookMode?: 'delta' | 'screenCenter';
65
+ /** Max yaw/pitch in degrees when `lookMode` is `screenCenter` (default 45). */
66
+ maxLookDegrees?: number;
67
+ /** Screen-center follow rate toward cursor-mapped target (lower = snappier; default 2). */
68
+ lookSensitivity?: number;
63
69
  }
64
70
  interface GameInputPlayerConfig {
65
71
  key?: KeyboardMapping;
package/dist/globals.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { U as UpdateContext } from './base-node-life-cycle-D2NuN1VB.js';
1
+ import { U as UpdateContext } from './base-node-life-cycle-BK9xebT9.js';
2
2
  import 'three';
3
3
  import './stage-transition-CmGpV4tc.js';
4
4
 
@@ -1,13 +1,13 @@
1
- import { b as ZylemTSLShader } from './material-9vJ6SZaI.js';
2
- export { d as ZylemShader, Z as ZylemShaderObject, c as createNodeMaterialFromTSL, a as isGLSLShader, i as isTSLShader } from './material-9vJ6SZaI.js';
3
- export { Z as ZylemPostEffect } from './zylem-camera-C3bn6BTI.js';
1
+ import { b as ZylemTSLShader } from './material-DbSuZBbP.js';
2
+ export { d as ZylemShader, Z as ZylemShaderObject, c as createNodeMaterialFromTSL, a as isGLSLShader, i as isTSLShader } from './material-DbSuZBbP.js';
3
+ export { Z as ZylemPostEffect } from './zylem-camera-Du2UPW9O.js';
4
4
  export { S as StageTransitionConfig, a as StageTransitionEasing, Z as ZylemTransitionShader, c as crossfadeTransitionShader } from './stage-transition-CmGpV4tc.js';
5
5
  export { Fn, abs, asin, atan, clamp, cos, dot, exp, float, floor, fract, length, max, min, mix, mod, normalize, positionWorld, positionWorldDirection, pow, sin, smoothstep, step, time, uniform, uv, vec2, vec3, vec4 } from 'three/tsl';
6
6
  import 'three';
7
7
  import 'three/webgpu';
8
- import './vector-CiSHbivc.js';
8
+ import './vector-DN6zlPoE.js';
9
9
  import '@zylem/behaviors/core';
10
- import './entity-DZbFQ1Wg.js';
10
+ import './entity-B9yZeBm4.js';
11
11
 
12
12
  declare const standardShader: {
13
13
  vertex: string;
@@ -1,9 +1,9 @@
1
- import { T as TouchTheme, b as TouchThemeName } from './default-controls-0-vCnli7.js';
2
- export { D as DefaultTouchControlsOptions, J as JoystickSelection, d as defaultTouchControls, a as resolveButtonAccent, r as resolveTouchTheme, t as touchThemes } from './default-controls-0-vCnli7.js';
3
- import './base-node-life-cycle-D2NuN1VB.js';
1
+ import { T as TouchTheme, b as TouchThemeName } from './default-controls-CAKJ5zlo.js';
2
+ export { D as DefaultTouchControlsOptions, J as JoystickSelection, d as defaultTouchControls, a as resolveButtonAccent, r as resolveTouchTheme, t as touchThemes } from './default-controls-CAKJ5zlo.js';
3
+ import './base-node-life-cycle-BK9xebT9.js';
4
4
  import 'three';
5
5
  import './stage-transition-CmGpV4tc.js';
6
- import './game-interfaces-mchNYSZE.js';
6
+ import './game-interfaces-vF5sRi1n.js';
7
7
 
8
8
  type TouchThemeInput = TouchTheme | TouchThemeName;
9
9
  interface TouchButtonSvgOptions {
package/dist/input-ui.js CHANGED
@@ -1 +1 @@
1
- import"./chunk-ORIDWL3T.js";import{a,b,c,d,e,f,g}from"./chunk-RXDTAWI2.js";import"./chunk-MSC2BEO5.js";export{g as defaultTouchControls,d as joystickBaseSvg,e as joystickThumbSvg,c as resolveButtonAccent,b as resolveTouchTheme,f as touchButtonSvg,a as touchThemes};
1
+ import"./chunk-ORIDWL3T.js";import{a,b,c,d,e,f,g}from"./chunk-PCFF4LLO.js";import"./chunk-UG22Z42P.js";export{g as defaultTouchControls,d as joystickBaseSvg,e as joystickThumbSvg,c as resolveButtonAccent,b as resolveTouchTheme,f as touchButtonSvg,a as touchThemes};