@zylem/game-lib 0.7.0 → 0.8.2
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 +15 -1
- package/dist/actions.d.ts +71 -8
- package/dist/actions.js +1 -1
- package/dist/api/game-lib.api.json +55350 -0
- package/dist/api/game-lib.api.md +4608 -0
- package/dist/api/game-lib.d.ts +8447 -0
- package/dist/api/game-lib.typedoc.json +352456 -0
- package/dist/audio.js +1 -1
- package/dist/{base-node-life-cycle-CnJ-7zX-.d.ts → base-node-life-cycle-BK9xebT9.d.ts} +18 -4
- package/dist/behavior.d.ts +2 -3
- package/dist/behavior.js +1 -1
- package/dist/blueprints-TbGY-h53.d.ts +162 -0
- package/dist/chunk-3PRBSSTS.js +24 -0
- package/dist/chunk-47DG7I7M.js +1 -0
- package/dist/chunk-7GYFZKK7.js +1 -0
- package/dist/chunk-7QF6YTEZ.js +1 -0
- package/dist/chunk-7WRQ2UAN.js +1 -0
- package/dist/chunk-BH53MBAZ.js +1 -0
- package/dist/chunk-BIGH6D34.js +0 -0
- package/dist/chunk-CD7ZOZ35.js +1 -0
- package/dist/chunk-CFVRRRZZ.js +1 -0
- package/dist/chunk-CM5YRNBJ.js +19 -0
- package/dist/chunk-COM6HJ2L.js +1 -0
- package/dist/chunk-D2PATZCC.js +1 -0
- package/dist/chunk-DFLI7ICU.js +0 -0
- package/dist/chunk-EVYHPR3J.js +1 -0
- package/dist/chunk-IPWUDOV5.js +1 -0
- package/dist/chunk-JNFFTNMH.js +1 -0
- package/dist/chunk-JQKS42G4.js +1 -0
- package/dist/chunk-KVSJE4XD.js +1 -0
- package/dist/chunk-MZZCDXFB.js +1 -0
- package/dist/chunk-ORIDWL3T.js +0 -0
- package/dist/{chunk-RXDTAWI2.js → chunk-PCFF4LLO.js} +1 -1
- package/dist/chunk-QB3NL7VQ.js +1 -0
- package/dist/chunk-TAUWDQZF.js +9 -0
- package/dist/chunk-UG22Z42P.js +1 -0
- package/dist/chunk-VS2D4B3W.js +1 -0
- package/dist/chunk-WQ3WMMZD.js +1 -0
- package/dist/chunk-XK63E4SX.js +1 -0
- package/dist/chunk-YAOXFYOD.js +1 -0
- package/dist/chunk-ZRT3ZQVH.js +1 -0
- package/dist/collision-builder-B_tm8OVy.d.ts +49 -0
- package/dist/core.d.ts +45 -30
- package/dist/core.js +1 -24
- package/dist/debug-state-DRoeasG2.d.ts +17 -0
- package/dist/debug.d.ts +71 -19
- package/dist/debug.js +1 -1
- package/dist/{default-controls-BGc61yYl.d.ts → default-controls-CAKJ5zlo.d.ts} +3 -3
- package/dist/entity-B9yZeBm4.d.ts +34 -0
- package/dist/{entity-DNkYKfdp.d.ts → entity-BGEq1yfC.d.ts} +91 -444
- package/dist/{entity-type-map-C94h2TDW.d.ts → entity-type-map-CW6RHQkx.d.ts} +153 -6
- package/dist/entity.d.ts +15 -10
- package/dist/entity.js +1 -1
- package/dist/events.d.ts +10 -1
- package/dist/events.js +1 -1
- package/dist/{game-Cuj5gy7U.d.ts → game-DbqBQiFC.d.ts} +460 -135
- package/dist/game-default-6AZZCNST.js +1 -0
- package/dist/{game-interfaces-tfpM5NBk.d.ts → game-interfaces-vF5sRi1n.d.ts} +8 -2
- package/dist/globals.d.ts +12 -1
- package/dist/globals.js +1 -1
- package/dist/graphics.d.ts +16 -46
- package/dist/graphics.js +1 -1
- package/dist/input-ui.d.ts +5 -4
- package/dist/input-ui.js +1 -1
- package/dist/input.d.ts +48 -4
- package/dist/input.js +1 -1
- package/dist/{material-Wz83vTTp.d.ts → material-DbSuZBbP.d.ts} +25 -50
- package/dist/public.d.ts +38 -0
- package/dist/public.js +1 -0
- package/dist/runtime.d.ts +7 -381
- package/dist/runtime.js +1 -1
- package/dist/schema/entity.schema.json +244 -0
- package/dist/schema/game-config.schema.json +643 -0
- package/dist/schema/input-config.schema.json +517 -0
- package/dist/schema/stage-config.schema.json +93 -0
- package/dist/schema/stage.schema.json +271 -0
- package/dist/schema.d.ts +550 -0
- package/dist/schema.js +1 -0
- package/dist/stage-transition-CmGpV4tc.d.ts +46 -0
- package/dist/vector-DN6zlPoE.d.ts +161 -0
- package/dist/web-components.d.ts +15 -12
- package/dist/web-components.js +1 -9
- package/dist/{zylem-stage-runtime-Cs-UDEVU.d.ts → zylem-camera-Du2UPW9O.d.ts} +74 -264
- package/package.json +28 -20
- package/dist/chunk-73VZQZUL.js +0 -1
- package/dist/chunk-A34ZG3L4.js +0 -1
- package/dist/chunk-CDPY4VOQ.js +0 -1
- package/dist/chunk-DR6XXZE7.js +0 -19
- package/dist/chunk-FM5TBEPO.js +0 -1
- package/dist/chunk-G2IIMSUH.js +0 -1
- package/dist/chunk-MSC2BEO5.js +0 -1
- package/dist/chunk-NIH5CONO.js +0 -1
- package/dist/chunk-ONWXGBWB.js +0 -1
- package/dist/chunk-QEDQDR27.js +0 -1
- package/dist/chunk-WKHW2QO2.js +0 -1
- package/dist/chunk-YHKXQ2ZN.js +0 -1
- package/dist/game-default-PZLLHYL7.js +0 -1
- package/dist/world-C9zdyl5d.d.ts +0 -103
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{v as e}from"./chunk-CFVRRRZZ.js";import"./chunk-VS2D4B3W.js";import"./chunk-JQKS42G4.js";import"./chunk-YAOXFYOD.js";import"./chunk-KVSJE4XD.js";import"./chunk-CM5YRNBJ.js";import"./chunk-YHEWKN7N.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 {
|
|
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;
|
|
@@ -87,4 +93,4 @@ interface ZylemGameConfig<StageInterface, GameInterface, TGlobals extends BaseGl
|
|
|
87
93
|
input?: GameInputConfig;
|
|
88
94
|
}
|
|
89
95
|
|
|
90
|
-
export type { BaseGlobals as B, GameInputConfig as G, KeyboardMapping as K, MouseConfig as M,
|
|
96
|
+
export type { BaseGlobals as B, GameInputConfig as G, KeyboardMapping as K, MouseConfig as M, VirtualTouchButtonConfig as V, ZylemGameConfig as Z, GameInputPlayerConfig as a, MouseMapping as b, VirtualTouchButtonsConfig as c, VirtualTouchButtonSlot as d, VirtualTouchConfig as e, VirtualTouchJoystickConfig as f, VirtualTouchJoysticksConfig as g, VirtualTouchPosition as h, VirtualTouchStyle as i };
|
package/dist/globals.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { U as UpdateContext } from './base-node-life-cycle-BK9xebT9.js';
|
|
2
2
|
import 'three';
|
|
3
|
+
import './stage-transition-CmGpV4tc.js';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* Set a global value by path.
|
|
@@ -46,6 +47,16 @@ declare function getGlobals<T = Record<string, unknown>>(): T;
|
|
|
46
47
|
*/
|
|
47
48
|
declare function clearGlobalSubscriptions(): void;
|
|
48
49
|
|
|
50
|
+
/**
|
|
51
|
+
* Reactive state for the active stage plus per-object variable storage.
|
|
52
|
+
*
|
|
53
|
+
* Provides the valtio `stageState` proxy (background, inputs, gravity, live
|
|
54
|
+
* entity list) with internal setters, and a WeakMap/proxy-backed variable store
|
|
55
|
+
* with public `get/set/create/subscribe/clear` helpers for attaching reactive
|
|
56
|
+
* key/value data to any stage or entity by path. Exists as the central reactive
|
|
57
|
+
* data layer the rest of the stage subsystem reads from and writes to.
|
|
58
|
+
*/
|
|
59
|
+
|
|
49
60
|
/**
|
|
50
61
|
* Set a variable on an object by path.
|
|
51
62
|
* @example setVariable(stage1, 'totalAngle', 0.5)
|
package/dist/globals.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{a as m,b as n,c as o,d as p}from"./chunk-WQ3WMMZD.js";import{h,i,j,k,l}from"./chunk-D2PATZCC.js";import{e as a,f as b,g as c,h as d,i as e,j as f,m as g}from"./chunk-4QLJUQSJ.js";import"./chunk-7WRQ2UAN.js";export{g as clearGlobalSubscriptions,b as createGlobal,i as createVariable,c as getGlobal,f as getGlobals,j as getVariable,m as globalChange,n as globalChanges,d as onGlobalChange,e as onGlobalChanges,k as onVariableChange,l as onVariableChanges,a as setGlobal,h as setVariable,o as variableChange,p as variableChanges};
|
package/dist/graphics.d.ts
CHANGED
|
@@ -1,44 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
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
|
+
export { S as StageTransitionConfig, a as StageTransitionEasing, Z as ZylemTransitionShader, c as crossfadeTransitionShader } from './stage-transition-CmGpV4tc.js';
|
|
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';
|
|
4
6
|
import 'three';
|
|
5
7
|
import 'three/webgpu';
|
|
6
|
-
import '
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
* TSL fire shader for WebGPU.
|
|
10
|
-
*/
|
|
11
|
-
declare const fireTSL: ZylemTSLShader;
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* TSL star shader for WebGPU.
|
|
15
|
-
*/
|
|
16
|
-
declare const starTSL: ZylemTSLShader;
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* TSL debug wireframe shader for WebGPU.
|
|
20
|
-
*/
|
|
21
|
-
declare const debugTSL: ZylemTSLShader;
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Create a gradient sky shader with custom colors.
|
|
25
|
-
*
|
|
26
|
-
* @param groundColor Color below the horizon (default: dark ground)
|
|
27
|
-
* @param horizonColor Color at the horizon line (default: warm orange)
|
|
28
|
-
* @param zenithColor Color directly above (default: deep blue/black)
|
|
29
|
-
*/
|
|
30
|
-
declare function createGradientSky(groundColor?: [number, number, number], horizonColor?: [number, number, number], zenithColor?: [number, number, number]): ZylemTSLShader;
|
|
31
|
-
/**
|
|
32
|
-
* Default gradient sky: dark space above, warm horizon glow, dark ground below.
|
|
33
|
-
* Suitable as a general-purpose game skybox.
|
|
34
|
-
*/
|
|
35
|
-
declare const gradientSkyTSL: ZylemTSLShader;
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* TSL starfield skybox shader for WebGPU.
|
|
39
|
-
* Uses world-space position for proper 3D skybox rendering.
|
|
40
|
-
*/
|
|
41
|
-
declare const starfieldSkyTSL: ZylemTSLShader;
|
|
8
|
+
import './vector-DN6zlPoE.js';
|
|
9
|
+
import '@zylem/behaviors/core';
|
|
10
|
+
import './entity-B9yZeBm4.js';
|
|
42
11
|
|
|
43
12
|
declare const standardShader: {
|
|
44
13
|
vertex: string;
|
|
@@ -55,11 +24,11 @@ declare const objectVertexShader = "\nuniform vec2 uvScale;\nvarying vec2 vUv;\n
|
|
|
55
24
|
*
|
|
56
25
|
* @example
|
|
57
26
|
* ```ts
|
|
58
|
-
* import { createBackgroundShader, Fn,
|
|
27
|
+
* import { createBackgroundShader, Fn, positionWorldDirection, vec4 } from '@zylem/game-lib/graphics';
|
|
59
28
|
*
|
|
60
29
|
* const myShader = createBackgroundShader(
|
|
61
30
|
* Fn(() => {
|
|
62
|
-
* const dir =
|
|
31
|
+
* const dir = positionWorldDirection; // per-pixel view direction
|
|
63
32
|
* return vec4(dir.x, dir.y, dir.z, 1.0);
|
|
64
33
|
* })()
|
|
65
34
|
* );
|
|
@@ -69,10 +38,11 @@ declare const objectVertexShader = "\nuniform vec2 uvScale;\nvarying vec2 vUv;\n
|
|
|
69
38
|
/**
|
|
70
39
|
* Create a background shader from a TSL color node.
|
|
71
40
|
*
|
|
72
|
-
* The
|
|
73
|
-
*
|
|
74
|
-
*
|
|
75
|
-
*
|
|
41
|
+
* The node is rendered via the WebGPU renderer's `scene.backgroundNode` — a
|
|
42
|
+
* true skybox pass evaluated per background pixel at infinite depth — and
|
|
43
|
+
* should produce a `vec4` color output. Use `positionWorldDirection` (from
|
|
44
|
+
* `three/tsl`), which in this context is the normalized per-pixel view
|
|
45
|
+
* direction, to compute colors in spherical coordinates.
|
|
76
46
|
*
|
|
77
47
|
* @param colorNode - A TSL node expression that evaluates to a vec4 color
|
|
78
48
|
* @param transparent - Whether the background should be transparent (default: false)
|
|
@@ -80,4 +50,4 @@ declare const objectVertexShader = "\nuniform vec2 uvScale;\nvarying vec2 vUv;\n
|
|
|
80
50
|
*/
|
|
81
51
|
declare function createBackgroundShader(colorNode: any, transparent?: boolean): ZylemTSLShader;
|
|
82
52
|
|
|
83
|
-
export { ZylemTSLShader, createBackgroundShader,
|
|
53
|
+
export { ZylemTSLShader, createBackgroundShader, objectVertexShader, standardShader };
|
package/dist/graphics.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as n,b as o,c as p,d as q,e as r,f as s,g as t,h as u,i as v,j as w,k as x,l as y,m as z,n as A,o as B,p as C,q as D,r as E,s as F,t as G,u as H,v as I,w as J}from"./chunk-QB3NL7VQ.js";import{a}from"./chunk-7GYFZKK7.js";import{a as b,b as c,h as d,i as e,k as f,l as g,m as h,n as i,o as j,p as k,q as l,r as m}from"./chunk-CM5YRNBJ.js";import"./chunk-QXVH6POE.js";import"./chunk-7WRQ2UAN.js";export{m as Fn,y as abs,x as asin,w as atan,t as clamp,v as cos,n as createBackgroundShader,f as createNodeMaterialFromTSL,a as crossfadeTransitionShader,G as dot,z as exp,l as float,E as floor,F as fract,e as isGLSLShader,d as isTSLShader,H as length,C as max,D as min,r as mix,J as mod,q as normalize,b as objectVertexShader,p as positionWorld,o as positionWorldDirection,A as pow,u as sin,s as smoothstep,c as standardShader,B as step,i as time,g as uniform,h as uv,I as vec2,j as vec3,k as vec4};
|
package/dist/input-ui.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { T as TouchTheme,
|
|
2
|
-
export { D as DefaultTouchControlsOptions, J as JoystickSelection, d as defaultTouchControls,
|
|
3
|
-
import './base-node-life-cycle-
|
|
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
|
-
import './
|
|
5
|
+
import './stage-transition-CmGpV4tc.js';
|
|
6
|
+
import './game-interfaces-vF5sRi1n.js';
|
|
6
7
|
|
|
7
8
|
type TouchThemeInput = TouchTheme | TouchThemeName;
|
|
8
9
|
interface TouchButtonSvgOptions {
|
package/dist/input-ui.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a
|
|
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};
|
package/dist/input.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { A as AnalogState,
|
|
3
|
-
import { G as GameInputConfig,
|
|
1
|
+
import { b as InputPlayer } from './base-node-life-cycle-BK9xebT9.js';
|
|
2
|
+
export { A as AnalogState, d as ButtonName, B as ButtonState, c as InputGamepad, e as InputPlayerNumber, f as InputProvider, I as Inputs } from './base-node-life-cycle-BK9xebT9.js';
|
|
3
|
+
import { G as GameInputConfig, e as VirtualTouchConfig } from './game-interfaces-vF5sRi1n.js';
|
|
4
4
|
import 'three';
|
|
5
|
+
import './stage-transition-CmGpV4tc.js';
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* Maps arrow keys to axes (Horizontal/Vertical) for the given player.
|
|
@@ -48,6 +49,15 @@ declare function useIJKLForDirections(player: InputPlayer): GameInputConfig;
|
|
|
48
49
|
declare function useMouseLook(player: InputPlayer, options?: {
|
|
49
50
|
sensitivity?: number;
|
|
50
51
|
}): GameInputConfig;
|
|
52
|
+
/**
|
|
53
|
+
* Enables screen-center mouse look (free cursor, no pointer lock).
|
|
54
|
+
* Cursor offset from the game canvas center maps to yaw/pitch up to `maxLookDegrees`.
|
|
55
|
+
* @example stage.setInputConfiguration(useScreenCenterLook('p1'));
|
|
56
|
+
*/
|
|
57
|
+
declare function useScreenCenterLook(player: InputPlayer, options?: {
|
|
58
|
+
maxLookDegrees?: number;
|
|
59
|
+
lookSensitivity?: number;
|
|
60
|
+
}): GameInputConfig;
|
|
51
61
|
/**
|
|
52
62
|
* Enables basic mouse input (no pointer lock) for the given player.
|
|
53
63
|
* @example stage.setInputConfiguration(useMouse('p1'));
|
|
@@ -69,4 +79,38 @@ declare function useVirtualControls(player: InputPlayer, options?: VirtualTouchC
|
|
|
69
79
|
*/
|
|
70
80
|
declare function mergeInputConfigs(...configs: GameInputConfig[]): GameInputConfig;
|
|
71
81
|
|
|
72
|
-
|
|
82
|
+
/**
|
|
83
|
+
* Maps canvas-center-relative pointer offset to absolute yaw/pitch targets.
|
|
84
|
+
* Used with screen-center mouse look (free cursor, no pointer lock).
|
|
85
|
+
*/
|
|
86
|
+
interface ScreenCenterLookTargets {
|
|
87
|
+
targetYaw: number;
|
|
88
|
+
targetPitch: number;
|
|
89
|
+
}
|
|
90
|
+
interface ScreenCenterLookOptions {
|
|
91
|
+
maxLookDegrees?: number;
|
|
92
|
+
/** How fast cursor position pulls yaw/pitch toward target (lower = snappier). @default 2 */
|
|
93
|
+
lookSensitivity?: number;
|
|
94
|
+
}
|
|
95
|
+
/** Shortest signed angle from `from` to `to` in radians. */
|
|
96
|
+
declare function shortestAngleDelta(from: number, to: number): number;
|
|
97
|
+
/**
|
|
98
|
+
* Converts normalized pointer offset from viewport center to look angles.
|
|
99
|
+
*
|
|
100
|
+
* @param nx Horizontal offset from center (−1 = left edge, +1 = right edge).
|
|
101
|
+
* @param ny Vertical offset from center (−1 = top edge, +1 = bottom edge).
|
|
102
|
+
* @param maxDegrees Maximum yaw/pitch at viewport edges (default 45).
|
|
103
|
+
*/
|
|
104
|
+
declare function screenCenterLookTargets(nx: number, ny: number, maxDegrees?: number): ScreenCenterLookTargets;
|
|
105
|
+
/**
|
|
106
|
+
* Computes WASM look deltas that drive current yaw/pitch toward screen-center targets.
|
|
107
|
+
*
|
|
108
|
+
* `lookSensitivity` controls follow rate toward the cursor-mapped target (lower = snappier).
|
|
109
|
+
* WASM applies its own `look_sensitivity` multiplier to these deltas.
|
|
110
|
+
*/
|
|
111
|
+
declare function screenCenterLookDeltas(nx: number, ny: number, currentYaw: number, currentPitch: number, options?: ScreenCenterLookOptions): {
|
|
112
|
+
lookX: number;
|
|
113
|
+
lookY: number;
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
export { InputPlayer, type ScreenCenterLookOptions, type ScreenCenterLookTargets, mergeInputConfigs, screenCenterLookDeltas, screenCenterLookTargets, shortestAngleDelta, useArrowsForAxes, useArrowsForDirections, useArrowsForSecondaryAxes, useIJKLForAxes, useIJKLForDirections, useMouse, useMouseLook, useScreenCenterLook, useVirtualControls, useWASDForAxes, useWASDForDirections };
|
package/dist/input.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as m,b as n,c as o}from"./chunk-7QF6YTEZ.js";import{a,b,c,d,e,f,g,h,i,j,k,l}from"./chunk-UG22Z42P.js";export{l as mergeInputConfigs,o as screenCenterLookDeltas,n as screenCenterLookTargets,m as shortestAngleDelta,a as useArrowsForAxes,c as useArrowsForDirections,b as useArrowsForSecondaryAxes,f as useIJKLForAxes,g as useIJKLForDirections,j as useMouse,h as useMouseLook,i as useScreenCenterLook,k as useVirtualControls,e as useWASDForAxes,d as useWASDForDirections};
|
|
@@ -1,45 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Blending, Side, Color, Material } from 'three';
|
|
2
2
|
import { MeshBasicNodeMaterial } from 'three/webgpu';
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
type Vec2 = Vector2;
|
|
6
|
-
type Vec3 = Vector3 | Vector3$1;
|
|
7
|
-
type Vec2Components = {
|
|
8
|
-
x: number;
|
|
9
|
-
y: number;
|
|
10
|
-
};
|
|
11
|
-
type Vec3Components = {
|
|
12
|
-
x: number;
|
|
13
|
-
y: number;
|
|
14
|
-
z: number;
|
|
15
|
-
};
|
|
16
|
-
type Vec2Tuple = readonly [number?, number?] & {
|
|
17
|
-
x?: number;
|
|
18
|
-
y?: number;
|
|
19
|
-
};
|
|
20
|
-
type Vec3Tuple = readonly [number?, number?, number?] & {
|
|
21
|
-
x?: number;
|
|
22
|
-
y?: number;
|
|
23
|
-
z?: number;
|
|
24
|
-
};
|
|
25
|
-
type Vec2Input = Vec2 | {
|
|
26
|
-
x?: number;
|
|
27
|
-
y?: number;
|
|
28
|
-
} | Vec2Tuple;
|
|
29
|
-
type Vec3Input = Vec3 | {
|
|
30
|
-
x?: number;
|
|
31
|
-
y?: number;
|
|
32
|
-
z?: number;
|
|
33
|
-
} | Vec3Tuple;
|
|
34
|
-
declare const VEC2_ZERO: Readonly<Vec2Components>;
|
|
35
|
-
declare const VEC2_ONE: Readonly<Vec2Components>;
|
|
36
|
-
declare const VEC3_ZERO: Readonly<Vec3Components>;
|
|
37
|
-
declare const VEC3_ONE: Readonly<Vec3Components>;
|
|
38
|
-
declare function normalizeVec2(input?: Vec2Input | null, defaults?: Vec2Input | Partial<Vec2Components>): Vec2Components;
|
|
39
|
-
declare function normalizeVec3(input?: Vec3Input | null, defaults?: Vec3Input | Partial<Vec3Components>): Vec3Components;
|
|
40
|
-
declare function toThreeVector2(input?: Vec2Input | null, defaults?: Vec2Input | Partial<Vec2Components>): Vector2;
|
|
41
|
-
declare function toThreeVector3(input?: Vec3Input | null, defaults?: Vec3Input | Partial<Vec3Components>): Vector3;
|
|
42
|
-
declare function toRapierVector3(input?: Vec3Input | null, defaults?: Vec3Input | Partial<Vec3Components>): Vector3$1;
|
|
3
|
+
import { b as Vec2Input } from './vector-DN6zlPoE.js';
|
|
43
4
|
|
|
44
5
|
declare function shortHash(objString: string): string;
|
|
45
6
|
|
|
@@ -61,7 +22,21 @@ type ZylemShaderObject = {
|
|
|
61
22
|
*/
|
|
62
23
|
type ZylemTSLShader = {
|
|
63
24
|
colorNode: any;
|
|
25
|
+
/**
|
|
26
|
+
* Optional TSL node overriding vertex positions (e.g. wave displacement).
|
|
27
|
+
* Requires geometry with enough vertices to displace (e.g. a subdivided
|
|
28
|
+
* plane).
|
|
29
|
+
*/
|
|
30
|
+
positionNode?: any;
|
|
31
|
+
/** Optional TSL node overriding the surface normal. */
|
|
32
|
+
normalNode?: any;
|
|
64
33
|
transparent?: boolean;
|
|
34
|
+
/** Optional three.js blending mode (e.g. `AdditiveBlending`). */
|
|
35
|
+
blending?: Blending;
|
|
36
|
+
/** Optional three.js render side (e.g. `DoubleSide`). */
|
|
37
|
+
side?: Side;
|
|
38
|
+
/** Optional depth test override (e.g. `false` for overlay holograms). */
|
|
39
|
+
depthTest?: boolean;
|
|
65
40
|
};
|
|
66
41
|
/**
|
|
67
42
|
* Combined shader type supporting both GLSL and TSL
|
|
@@ -89,21 +64,21 @@ interface MaterialOptions {
|
|
|
89
64
|
*/
|
|
90
65
|
useTSL?: boolean;
|
|
91
66
|
}
|
|
92
|
-
type
|
|
93
|
-
interface
|
|
94
|
-
geometryMap:
|
|
67
|
+
type SharedGeometryMap = Map<symbol, number>;
|
|
68
|
+
interface SharedMaterialMapEntry {
|
|
69
|
+
geometryMap: SharedGeometryMap;
|
|
95
70
|
material: Material;
|
|
96
71
|
}
|
|
97
|
-
type
|
|
72
|
+
type MaterialCacheKey = ReturnType<typeof shortHash>;
|
|
98
73
|
type TexturePath = string | null;
|
|
99
74
|
declare class MaterialBuilder {
|
|
100
|
-
static
|
|
75
|
+
static sharedMaterialMap: Map<MaterialCacheKey, SharedMaterialMapEntry>;
|
|
101
76
|
/**
|
|
102
|
-
* Clear the static
|
|
77
|
+
* Clear the static shared material cache.
|
|
103
78
|
* Should be called during game disposal to prevent stale material references
|
|
104
79
|
* from persisting across demo/stage switches.
|
|
105
80
|
*/
|
|
106
|
-
static
|
|
81
|
+
static clearSharedMaterialCache(): void;
|
|
107
82
|
materials: Material[];
|
|
108
83
|
/**
|
|
109
84
|
* Retained for backward compatibility. game-lib is WebGPU-only and always
|
|
@@ -113,7 +88,7 @@ declare class MaterialBuilder {
|
|
|
113
88
|
*/
|
|
114
89
|
private useTSL;
|
|
115
90
|
constructor(useTSL?: boolean);
|
|
116
|
-
|
|
91
|
+
trackSharedMaterial(options: Partial<MaterialOptions>, entityType: symbol): void;
|
|
117
92
|
build(options: Partial<MaterialOptions>, entityType: symbol): void;
|
|
118
93
|
withColor(color: Color, useTSL?: boolean, opacity?: number): this;
|
|
119
94
|
withShader(shader: ZylemShaderObject, opacity?: number): this;
|
|
@@ -148,4 +123,4 @@ declare class MaterialBuilder {
|
|
|
148
123
|
*/
|
|
149
124
|
declare function createNodeMaterialFromTSL(tslShader: ZylemTSLShader, opacity?: number): MeshBasicNodeMaterial;
|
|
150
125
|
|
|
151
|
-
export {
|
|
126
|
+
export { MaterialBuilder as M, type TexturePath as T, type ZylemShaderObject as Z, isGLSLShader as a, type ZylemTSLShader as b, createNodeMaterialFromTSL as c, type ZylemShader as d, type MaterialOptions as e, isTSLShader as i };
|
package/dist/public.d.ts
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export { A as AspectRatio, q as AspectRatioValue, k as CameraManager, j as CameraOptions, C as CameraWrapper, D as DeviceProfile, p as FirstPersonOptions, l as FirstPersonPerspective, o as Fixed2DOptions, F as Fixed2DPerspective, G as Game, b as GameConfigLike, d as GameDeviceConfig, a as GameLoadingEvent, P as PerspectiveOptions, y as RenderBundleManager, z as RenderStrategyManager, R as ResolutionInput, e as ResolveGameConfigRuntime, v as RetroPreset, w as RetroPresetKey, x as RetroResolution, S as StageConfigLike, h as StageOptions, n as ThirdPersonOptions, T as ThirdPersonPerspective, i as createCamera, c as createGame, m as createPerspective, f as createStage, g as gameConfig, r as getDisplayAspect, t as getPresetResolution, u as parseResolution, s as stageConfig } from './game-DbqBQiFC.js';
|
|
2
|
+
export { G as GameInputConfig, a as GameInputPlayerConfig, K as KeyboardMapping, M as MouseConfig, b as MouseMapping, V as VirtualTouchButtonConfig, d as VirtualTouchButtonSlot, c as VirtualTouchButtonsConfig, e as VirtualTouchConfig, f as VirtualTouchJoystickConfig, g as VirtualTouchJoysticksConfig, h as VirtualTouchPosition, i as VirtualTouchStyle, Z as ZylemGameConfig } from './game-interfaces-vF5sRi1n.js';
|
|
3
|
+
export { CameraFeedOptions, FollowTargetOptions, RenderCategory, STAGE_STATE_CHANGE, StageManager, StageStateChangeEvent, Vect3, createFollowTarget, dispatchStageState, entitySpawner, initStageStateDispatcher, isManagedRenderEntity, resolveRenderCategory, setCameraFeed, setStageFrameProfilerEnabled, stageState, usesManagedRenderPath, vessel } from './core.js';
|
|
4
|
+
export { f as EntityBlueprint, j as EntityJson, d as EntityJsonSchema, E as EntitySchema, i as LineEntityData, L as LineEntityDataSchema, h as SpriteEntityData, b as SpriteEntityDataSchema, S as StageBlueprint, k as StageJson, e as StageJsonSchema, c as StageSchema, g as TextEntityData, T as TextEntityDataSchema, V as Vector2Schema, a as Vector3TupleSchema } from './blueprints-TbGY-h53.js';
|
|
5
|
+
export { A as AnalogState, d as ButtonName, B as ButtonState, c as InputGamepad, b as InputPlayer, e as InputPlayerNumber, f as InputProvider, I as Inputs, L as LoadingEvent, a as SetupContext, S as StageNavigationOptions, U as UpdateContext } from './base-node-life-cycle-BK9xebT9.js';
|
|
6
|
+
export { S as StageTransitionConfig, a as StageTransitionEasing, Z as ZylemTransitionShader, c as crossfadeTransitionShader } from './stage-transition-CmGpV4tc.js';
|
|
7
|
+
export { g as CameraAction, f as CameraBehavior, d as CameraContext, e as CameraPerspective, j as CameraPipeline, h as CameraPipelineState, C as CameraPose, P as PerspectiveType, a as Perspectives, c as PoseDelta, T as TransformLike, V as Viewport, Z as ZylemPostEffect, b as ZylemRenderer, i as isWebGPUSupported } from './zylem-camera-Du2UPW9O.js';
|
|
8
|
+
export { S as StageEntity } from './entity-B9yZeBm4.js';
|
|
9
|
+
export { l as SimulationBody, S as SimulationStepClock, f as VEC2_ONE, g as VEC2_ZERO, h as VEC3_ONE, i as VEC3_ZERO, V as Vec2, a as Vec2Components, b as Vec2Input, c as Vec3, d as Vec3Components, e as Vec3Input, n as normalizeVec2, j as normalizeVec3, t as toThreeVector2, k as toThreeVector3 } from './vector-DN6zlPoE.js';
|
|
10
|
+
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';
|
|
11
|
+
export { A as Action, C as CollisionComponent, G as GameEntity, a as GameEntityOptions, b as boxCollision, d as coneCollision, c as create, e as cylinderCollision, x as getRotation, f as pillCollision, g as planeCollision, p as pyramidCollision, i as rotateEuler, r as rotateInDirection, j as rotateX, k as rotateY, h as rotateYEuler, l as rotateZ, w as setRotation, q as setRotationDegrees, u as setRotationDegreesX, t as setRotationDegreesY, v as setRotationDegreesZ, n as setRotationX, m as setRotationY, o as setRotationZ, s as sphereCollision, z as zoneCollision } from './entity-BGEq1yfC.js';
|
|
12
|
+
export { IconSize, IconSizePreset, ScreenAnchor, TemplateFactory, boxMesh, coneMesh, createCooldownIcon, createEntity, createEntityFactory, cylinderMesh, destroy, pillMesh, pyramidMesh, sphereMesh } from './entity.js';
|
|
13
|
+
export { BehaviorDescriptor, BehaviorHandle, BehaviorRef, BehaviorSystem, BehaviorSystemFactory, BoundaryRicochet3DCoordinator, BoundaryRicochet3DEntity, BoundaryRicochetCoordinator, BoundaryRicochetEntity, BoundaryRicochetUpdate, BurstParticlePresetOptions, CooldownBehavior, CooldownConfig, CooldownEntry, CooldownHandle, CooldownOptions, DefineBehaviorConfig, Destructible3DBehavior, Destructible3DBehaviorOptions, Destructible3DColliderOptions, Destructible3DFragmentColliderShape, Destructible3DFragmentPhysicsOptions, Destructible3DHandle, DestructibleMesh, DestructiblePrebakeWorkerAPI, FacingAngle2DEntity, FirstPersonBehavior, FirstPersonBehaviorOptions, FirstPersonContext, FirstPersonEntity, FirstPersonEvent, FirstPersonFSM, FirstPersonInputComponent, FirstPersonMovementComponent, FirstPersonPresentation, FirstPersonShooterCoordinator, FirstPersonShooterEntity, FirstPersonShooterInput, FirstPersonState, FirstPersonStateComponent, FractureOptions, FractureOptionsInput, JumpConfig2D, JumpConfig3D, JumpContext2D, JumpContext3D, JumpInput2D, JumpInput3D, JumpState2D, JumpState3D, Jumper2DBehavior, Jumper2DBehaviorOptions, Jumper2DEntity, Jumper2DEvent, Jumper2DFSM, Jumper2DState, Jumper3DBehavior, Jumper3DBehaviorOptions, Jumper3DEntity, Jumper3DEvent, Jumper3DFSM, Jumper3DState, MultidirectionalSpaceShooterCoordinator, MultidirectionalSpaceShooterEntity, MultidirectionalSpaceShooterInput, ParticleEffectDefinition, ParticleEmitterBehavior, ParticleEmitterBehaviorOptions, ParticleEmitterHandle, ParticleMagicAgency, ParticleMagicAlignment, ParticleMagicModifierInput, ParticleMagicModifierOptions, ParticleMagicOrder, ParticleMagicRealityEffect, ParticleMagicTemperament, ParticlePresetMaterialOptions, PhysicsBodyComponent, PlainBufferGeometryPayload, PlainFractureOptions, Platformer2DBehavior, Platformer2DBehaviorOptions, Platformer2DCollisionContext, Platformer2DContext, Platformer2DEntity, Platformer2DEvent, Platformer2DFSM, Platformer2DInputComponent, Platformer2DMovementComponent, Platformer2DState, Platformer2DStateComponent, Platformer3DBehavior, Platformer3DBehaviorOptions, Platformer3DContext, Platformer3DEntity, Platformer3DEvent, Platformer3DFSM, Platformer3DInputComponent, Platformer3DMovementComponent, Platformer3DState, Platformer3DStateComponent, PlatformerCollisionContext, PlayerInput, PrebakeWorkerRequest, PrebakeWorkerResponse, ResolvedAim2D, Ricochet2DBehavior, Ricochet2DCollisionContext, Ricochet2DEvent, Ricochet2DFSM, Ricochet2DHandle, Ricochet2DOptions, Ricochet2DResult, Ricochet2DState, Ricochet3DBehavior, Ricochet3DCallback, Ricochet3DCollisionContext, Ricochet3DEvent, Ricochet3DFSM, Ricochet3DHandle, Ricochet3DOptions, Ricochet3DResult, Ricochet3DState, RicochetCallback, ScreenVisibilityBehavior, ScreenVisibilityChangeContext, ScreenVisibilityFSM, ScreenVisibilityHandle, ScreenVisibilityOptions, ScreenVisibilitySize, ScreenVisibilitySnapshot, ScreenWrapBehavior, ScreenWrapEvent, ScreenWrapFSM, ScreenWrapOptions, ScreenWrapState, SemanticParticlePresetOptions, Shooter2DAimFireInput, Shooter2DBehavior, Shooter2DBehaviorOptions, Shooter2DFireArgs, Shooter2DHandle, Shooter2DProjectileFactory, Shooter2DSourceEntity, Shooter2DStageLike, Shooter2DStateComponent, Shooter2DTarget, ThrusterBehavior, ThrusterBehaviorOptions, ThrusterEntity, ThrusterEvent, ThrusterFSM, ThrusterFSMContext, ThrusterInputComponent, ThrusterMovementComponent, ThrusterState, ThrusterStateComponent, TopDownMovementBehavior, TopDownMovementBehaviorOptions, TopDownMovementComponent, TopDownMovementEntity, TopDownMovementHandle, TopDownMovementInputComponent, TopDownMovementStateComponent, TopDownShooterCoordinator, TopDownShooterEntity, TopDownShooterInput, TransformComponent, Vec3Like, ViewmodelConfig, VoronoiOptions, WorldBoundary2DBehavior, WorldBoundary2DBounds, WorldBoundary2DEvent, WorldBoundary2DFSM, WorldBoundary2DHandle, WorldBoundary2DHit, WorldBoundary2DHits, WorldBoundary2DOptions, WorldBoundary2DPosition, WorldBoundary2DState, WorldBoundary3DBehavior, WorldBoundary3DBounds, WorldBoundary3DEvent, WorldBoundary3DFSM, WorldBoundary3DHandle, WorldBoundary3DHit, WorldBoundary3DHits, WorldBoundary3DOptions, WorldBoundary3DPosition, WorldBoundary3DState, computeWorldBoundary2DHits, computeWorldBoundary3DHits, createFirstPersonInputComponent, createFirstPersonMovementComponent, createFirstPersonStateComponent, createJumpConfig2D, createJumpConfig3D, createJumpInput2D, createJumpInput3D, createJumpState2D, createJumpState3D, createPhysicsBodyComponent, createPlatformer2DInputComponent, createPlatformer2DMovementComponent, createPlatformer2DStateComponent, createPlatformer3DInputComponent, createPlatformer3DMovementComponent, createPlatformer3DStateComponent, createShooter2DStateComponent, createThrusterInputComponent, createThrusterMovementComponent, createThrusterStateComponent, createTopDownMovementComponent, createTopDownMovementInputComponent, createTopDownMovementStateComponent, createTransformComponent, defineBehavior, fireCooldown, fireShooter2DIfRequested, getCooldown, getCooldownStore, getEntityFacingAngle2D, hasAnyWorldBoundary2DHit, hasAnyWorldBoundary3DHit, particleEffect, particlePresets, registerCooldown, resetCooldown, resolveAim2D, tickCooldowns, updateBoundaryRicochet, useBehavior } from '@zylem/behaviors';
|
|
14
|
+
export { RUNTIME_BOUNDARY_2D_BEHAVIOR_KEY, RUNTIME_DYNAMIC_CIRCLE_BODY_2D_BEHAVIOR_KEY, RUNTIME_GOAL_ZONE_2D_BEHAVIOR_KEY, RUNTIME_PLAYER_INPUT_2D_BEHAVIOR_KEY, RUNTIME_RICOCHET_2D_BEHAVIOR_KEY, RUNTIME_TRIGGER_REGION_2D_BEHAVIOR_KEY, RuntimeBoundary2DBehavior, RuntimeBoundary2DOptions, RuntimeDynamicCircleBody2DBehavior, RuntimeDynamicCircleBody2DHandle, RuntimeDynamicCircleBody2DOptions, RuntimeGoalZone2DBehavior, RuntimeGoalZone2DEvent, RuntimeGoalZone2DHandle, RuntimeGoalZone2DOptions, RuntimePlayerInput2DBehavior, RuntimePlayerInput2DOptions, RuntimeRicochet2DBehavior, RuntimeRicochet2DEvent, RuntimeRicochet2DHandle, RuntimeRicochet2DOptions, RuntimeTriggerRegion2DBehavior, RuntimeTriggerRegion2DEvent, RuntimeTriggerRegion2DHandle, RuntimeTriggerRegion2DOptions, bindRuntimeDynamicCircleBody2DHandle, emitRuntimeGoal, emitRuntimeRicochet, emitRuntimeTriggerRegionEnter } from '@zylem/behaviors/runtime-2d';
|
|
15
|
+
export { FadeOpacityOptions, MoveByOptions, MoveToOptions, OpacityEntity, RotateByOptions, ThrottleOptions, applyTransformChanges, callFunc, delay, fadeOpacity, moveBy, moveTo, onPress, onRelease, parallel, repeat, repeatForever, resetEntityOpacity, rotateBy, sequence, throttle } from './actions.js';
|
|
16
|
+
export { BehaviorRuntime, EntityDefinition, EntityHandle, Simulation, SimulationBodyDefinition, SimulationColliderDefinition, SimulationEvent, SimulationFrame, SimulationOptions, StageBodyConfig, StageBodyInfo, StageBodyKind, StageBodyKindValue, StageBoundaryDim, StageColliderConfig, StageColliderShape, StageDebugRender, StageEvent, StageEventType, StagePose, StageRaycastHit, StageRenderSlot, StageRicochetDim, StageRicochetReflection, StageTopDownPlane, TransformState, createSimulation, createTransformStore, getPosition, getVelocity, move, moveForwardXY, moveX, moveXY, moveXZ, moveY, moveZ, resetVelocity, setPosition, setPositionX, setPositionY, setPositionZ, wrapAround3D, wrapAroundXY } from '@zylem/behaviors/core';
|
|
17
|
+
export { ScreenCenterLookOptions, ScreenCenterLookTargets, mergeInputConfigs, screenCenterLookDeltas, screenCenterLookTargets, shortestAngleDelta, useArrowsForAxes, useArrowsForDirections, useArrowsForSecondaryAxes, useIJKLForAxes, useIJKLForDirections, useMouse, useMouseLook, useScreenCenterLook, useVirtualControls, useWASDForAxes, useWASDForDirections } from './input.js';
|
|
18
|
+
export { D as DefaultTouchControlsOptions, J as JoystickSelection, T as TouchTheme, b as TouchThemeName, d as defaultTouchControls, a as resolveButtonAccent, r as resolveTouchTheme, t as touchThemes } from './default-controls-CAKJ5zlo.js';
|
|
19
|
+
export { TouchButtonSvgOptions, TouchThemeInput, joystickBaseSvg, joystickThumbSvg, touchButtonSvg } from './input-ui.js';
|
|
20
|
+
export { EntityConfigPayload, EntityEvents, EventEmitterDelegate, GameEvents, GameLoadingPayload, StageConfigPayload, StageEvents, StateDispatchPayload, ZylemEvents, zylemEventBus } from './events.js';
|
|
21
|
+
export { clearGlobalSubscriptions, createGlobal, createVariable, getGlobal, getGlobals, getVariable, globalChange, globalChanges, onGlobalChange, onGlobalChanges, onVariableChange, onVariableChanges, setGlobal, setVariable, variableChange, variableChanges } from './globals.js';
|
|
22
|
+
export { pingPongBeep, ricochetSound } from './audio.js';
|
|
23
|
+
export { Howl } from 'howler';
|
|
24
|
+
export { D as DebugTools, d as debugState, s as setDebugTool, a as setPaused, b as setSelectedEntity } from './debug-state-DRoeasG2.js';
|
|
25
|
+
export { EntityFocusContext, EntityThumbnailCache, EntityThumbnailCacheEntry, EntityThumbnailResult, entityThumbnailCache, focusEntity, registerEntityFocusContext } from './debug.js';
|
|
26
|
+
export { ZylemGameElement, ZylemGameState } from './web-components.js';
|
|
27
|
+
export { RuntimeBodyOptions, RuntimeColliderOptions, RuntimeCollisionBundle, buildBoxCollider, buildCapsuleCollider, buildConvexHullCollider, buildCylinderCollider, buildHeightfieldCollider, buildRuntimeBody, buildSphereCollider, buildTrimeshCollider, bundleRuntimeCollision } from './runtime.js';
|
|
28
|
+
export { ColorJsonSchema, GameConfigJson, GameConfigJsonSchema, GameDeviceConfigJson, GameDeviceConfigJsonSchema, GameInputConfigJson, GameInputConfigSchema, GameInputPlayerConfigSchema, KeyboardMappingSchema, MouseConfigSchema, MouseMappingSchema, ResolutionInputSchema, StageAssetLoaderConfigSchema, StageConfigJson, StageConfigJsonSchema, StageGLTFAssetLoaderConfigSchema, Vec3ComponentsSchema, VirtualTouchButtonConfigSchema, VirtualTouchButtonsConfigSchema, VirtualTouchConfigSchema, VirtualTouchJoystickConfigSchema, VirtualTouchJoysticksConfigSchema, VirtualTouchPositionSchema, VirtualTouchStyleSchema } from './schema.js';
|
|
29
|
+
export { createBackgroundShader, objectVertexShader, standardShader } from './graphics.js';
|
|
30
|
+
export { d as ZylemShader, Z as ZylemShaderObject, b as ZylemTSLShader, c as createNodeMaterialFromTSL, a as isGLSLShader, i as isTSLShader } from './material-DbSuZBbP.js';
|
|
31
|
+
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';
|
|
32
|
+
export { p as packCollisionGroups } from './collision-builder-B_tm8OVy.js';
|
|
33
|
+
import 'three';
|
|
34
|
+
import '@sinclair/typebox';
|
|
35
|
+
import 'three/webgpu';
|
|
36
|
+
import '@zylem/behaviors/particle-emitter';
|
|
37
|
+
import 'three/addons/lines/webgpu/Line2.js';
|
|
38
|
+
import 'mitt';
|
package/dist/public.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as s,b as n,c as l,d as S,e as h,f as y,g as L,h as v,i as Z,j as b,k as g,l as u,m as T,n as j,o as F,p as W,q as k,r as w,s as z,t as B,u as D,v as E,w as G}from"./chunk-QB3NL7VQ.js";import"./chunk-BIGH6D34.js";import"./chunk-DFLI7ICU.js";import{a as Ha}from"./chunk-TAUWDQZF.js";import{a as Ia,b as Ja,c as Ka,d as Qa,e as Ra,f as Ua,g as Xa,h as Ya,i as _a,j as $a,k as op,l as rp,m as ep,n as tp,o as mp,p as ap}from"./chunk-47DG7I7M.js";import{A as Dp,B as Ep,C as Gp,a as pp,b as fp,c as xp,d as ip,e as dp,f as cp,g as sp,h as np,i as lp,j as Sp,k as hp,l as yp,m as Lp,n as vp,o as Zp,p as bp,q as gp,r as up,s as Tp,t as jp,u as Fp,v as Wp,w as kp,x as wp,y as zp,z as Bp}from"./chunk-JNFFTNMH.js";import{a as fo,b as xo,c as io,d as co,e as vo,f as Nr,g as Or,h as Ur,i as Xr,j as Yr,k as _r,l as $r,m as oe,n as re,o as ee}from"./chunk-3PRBSSTS.js";import{a as go}from"./chunk-7GYFZKK7.js";import{a as K,b as Q}from"./chunk-COM6HJ2L.js";import{a as po,c as uo,d as To,e as jo,f as nr,g as lr,h as gr,i as ur,k as Tr,l as jr,m as Fr,n as Wr,o as kr,p as wr,q as zr,r as Br,s as Dr,t as Gr,v as Mr}from"./chunk-CFVRRRZZ.js";import{c as Zr,d as br}from"./chunk-VS2D4B3W.js";import{a as C,c as H,e as I,f as J}from"./chunk-JQKS42G4.js";import{b as ir}from"./chunk-YAOXFYOD.js";import{A as we,B as ze,C as Be,D as De,E as Ee,F as Ge,G as Me,H as Ne,I as Oe,J as Pe,K as Ve,L as qe,M as Ae,N as Ce,O as He,P as Ie,Q as Je,R as Ke,a as te,b as me,c as ae,d as pe,e as fe,f as xe,g as ie,h as de,i as ce,j as se,k as ne,l as le,m as Se,n as he,o as ye,p as Le,q as ve,r as Ze,s as be,t as ge,u as ue,v as Te,w as je,x as Fe,y as We,z as ke}from"./chunk-CD7ZOZ35.js";import{b as Pr,c as Vr,d as qr,e as Ar,f as Cr,g as Hr,h as Ir,i as Jr,j as Kr,k as Qr,m as Rr}from"./chunk-MZZCDXFB.js";import{A as xr,B as dr,C as cr,D as sr,c as Xo,d as Yo,e as _o,f as $o,g as or,h as rr,i as er,j as tr,s as mr,u as ar,y as pr,z as fr}from"./chunk-KVSJE4XD.js";import{a as o,b as r,h as e,i as t,k as m,l as a,m as p,n as f,o as x,p as i,q as d,r as c}from"./chunk-CM5YRNBJ.js";import{a as Zo,b as bo}from"./chunk-YHEWKN7N.js";import"./chunk-QXVH6POE.js";import{b as Uo}from"./chunk-EVYHPR3J.js";import{$ as Kt,$a as Km,A as vt,Aa as vm,B as Zt,Ba as Zm,C as bt,Ca as bm,D as gt,Da as gm,E as ut,Ea as um,F as Tt,Fa as Tm,G as jt,Ga as jm,H as Ft,Ha as Fm,I as Wt,Ia as Wm,J as kt,Ja as km,K as wt,Ka as wm,L as zt,La as zm,M as Bt,Ma as Bm,N as Dt,Na as Dm,O as Et,Oa as Em,P as Gt,Pa as Gm,Q as Mt,Qa as Mm,R as Nt,Ra as Nm,S as Ot,Sa as Om,T as Pt,Ta as Pm,U as Vt,Ua as Vm,V as qt,Va as qm,W as At,Wa as Am,X as Ct,Xa as Cm,Y as Ht,Ya as Hm,Z as It,Za as Im,_ as Jt,_a as Jm,a as Qe,aa as Qt,ab as Qm,b as Re,ba as Rt,bb as Rm,c as Ue,ca as Ut,cb as Um,d as Xe,da as Xt,db as Xm,e as Ye,ea as Yt,eb as Ym,f as _e,fa as _t,fb as _m,g as $e,ga as $t,gb as $m,h as ot,ha as om,hb as oa,i as rt,ia as rm,ib as ra,j as et,ja as em,k as tt,ka as tm,l as mt,la as mm,m as at,ma as am,n as pt,na as pm,o as ft,oa as fm,p as xt,pa as xm,q as it,qa as im,r as dt,ra as dm,s as ct,sa as cm,t as st,ta as sm,u as nt,ua as nm,v as lt,va as lm,w as St,wa as Sm,x as ht,xa as hm,y as yt,ya as ym,z as Lt,za as Lm}from"./chunk-XK63E4SX.js";import{a as ea,b as ta,c as ma}from"./chunk-ZRT3ZQVH.js";import{a as aa,b as pa,c as fa,d as xa}from"./chunk-WQ3WMMZD.js";import{h as Sr,i as hr,j as yr,k as Lr,l as vr}from"./chunk-D2PATZCC.js";import{e as M,f as N,g as O,h as P,i as V,j as q,m as A}from"./chunk-4QLJUQSJ.js";import{a as Fo,b as Wo,c as ko,d as wo,g as zo,h as Bo,i as Do,j as Eo}from"./chunk-7WRQ2UAN.js";import{A as Ma,B as Na,C as Oa,D as Pa,E as Va,a as ia,b as da,c as ca,d as sa,e as na,f as la,g as Sa,h as ha,i as ya,j as La,k as va,l as Za,m as ba,n as ga,o as ua,p as Ta,q as ja,r as Fa,s as Wa,t as ka,u as wa,v as za,w as Ba,x as Da,y as Ea,z as Ga}from"./chunk-IPWUDOV5.js";import{a as Er}from"./chunk-BH53MBAZ.js";import{a as Go,b as Mo,c as No,d as Oo,e as Po,f as Vo,g as qo,h as Ao,i as Co,j as Ho,k as Io,l as Jo,m as Ko,n as Qo,o as Ro}from"./chunk-XRP4JJXL.js";import{a as qa,b as Aa,c as Ca}from"./chunk-7QF6YTEZ.js";import"./chunk-ORIDWL3T.js";import{a as so,b as no,c as lo,d as So,e as ho,f as yo,g as Lo}from"./chunk-PCFF4LLO.js";import{a as R,b as U,c as X,d as Y,e as _,f as $,g as oo,h as ro,i as eo,j as to,k as mo,l as ao}from"./chunk-UG22Z42P.js";export{pr as ACTOR_TYPE,fo as AspectRatio,ie as BOX_TYPE,Qe as BoundaryRicochet3DCoordinator,Re as BoundaryRicochetCoordinator,We as CONE_TYPE,Ee as CYLINDER_TYPE,wr as CameraManager,Tr as CameraPipeline,zr as CameraWrapper,Wp as ColorJsonSchema,Ue as CooldownBehavior,Te as DISK_TYPE,Xe as Destructible3DBehavior,Ye as DestructibleMesh,np as EntityJsonSchema,fp as EntitySchema,K as EntityThumbnailCache,Zo as EventEmitterDelegate,dr as FOG_TYPE,_e as FirstPersonBehavior,$e as FirstPersonEvent,ot as FirstPersonFSM,Wr as FirstPersonPerspective,tt as FirstPersonPresentation,rt as FirstPersonShooterCoordinator,et as FirstPersonState,Fr as Fixed2DPerspective,c as Fn,mt as FractureOptions,Ur as Game,Gp as GameConfigJsonSchema,Ep as GameDeviceConfigJsonSchema,Fp as GameInputConfigSchema,jp as GameInputPlayerConfigSchema,ma as Howl,at as Jumper2DBehavior,pt as Jumper2DEvent,ft as Jumper2DFSM,xt as Jumper2DState,it as Jumper3DBehavior,dt as Jumper3DEvent,ct as Jumper3DFSM,st as Jumper3DState,Sp as KeyboardMappingSchema,Ce as LIGHT_TYPE,Ir as LINE_TYPE,cp as LineEntityDataSchema,Tp as MouseConfigSchema,hp as MouseMappingSchema,nt as MultidirectionalSpaceShooterCoordinator,Ve as PARTICLE_SYSTEM_TYPE,Ne as PILL_TYPE,Se as PLANE_TYPE,ze as PYRAMID_TYPE,lt as ParticleEmitterBehavior,ur as Perspectives,St as Platformer2DBehavior,ht as Platformer2DEvent,yt as Platformer2DFSM,Lt as Platformer2DState,vt as Platformer3DBehavior,Zt as Platformer3DEvent,bt as Platformer3DFSM,gt as Platformer3DState,be as RECT_TYPE,Km as RUNTIME_BOUNDARY_2D_BEHAVIOR_KEY,Qm as RUNTIME_DYNAMIC_CIRCLE_BODY_2D_BEHAVIOR_KEY,Rm as RUNTIME_GOAL_ZONE_2D_BEHAVIOR_KEY,Um as RUNTIME_PLAYER_INPUT_2D_BEHAVIOR_KEY,Xm as RUNTIME_RICOCHET_2D_BEHAVIOR_KEY,Ym as RUNTIME_TRIGGER_REGION_2D_BEHAVIOR_KEY,nr as RenderBundleManager,lr as RenderStrategyManager,Dp as ResolutionInputSchema,ut as Ricochet2DBehavior,Tt as Ricochet2DEvent,jt as Ricochet2DFSM,Ft as Ricochet2DState,Wt as Ricochet3DBehavior,kt as Ricochet3DEvent,wt as Ricochet3DFSM,zt as Ricochet3DState,qm as RuntimeBoundary2DBehavior,Am as RuntimeDynamicCircleBody2DBehavior,Cm as RuntimeGoalZone2DBehavior,Hm as RuntimePlayerInput2DBehavior,Im as RuntimeRicochet2DBehavior,Jm as RuntimeTriggerRegion2DBehavior,se as SPHERE_TYPE,Ar as SPRITE_TYPE,_r as STAGE_STATE_CHANGE,Bt as ScreenVisibilityBehavior,Dt as ScreenVisibilityFSM,Et as ScreenWrapBehavior,Gt as ScreenWrapEvent,Mt as ScreenWrapFSM,Nt as ScreenWrapState,Ot as Shooter2DBehavior,ir as SimulationBody,sp as SpriteEntityDataSchema,zp as StageAssetLoaderConfigSchema,$a as StageBodyKind,op as StageBoundaryDim,Bp as StageConfigJsonSchema,rp as StageEventType,wp as StageGLTFAssetLoaderConfigSchema,lp as StageJsonSchema,Or as StageManager,ep as StageRicochetDim,tp as StageRicochetReflection,xp as StageSchema,mp as StageTopDownPlane,Pr as TEXT_TYPE,ip as TextEntityDataSchema,jr as ThirdPersonPerspective,Pt as ThrusterBehavior,Vt as ThrusterEvent,qt as ThrusterFSM,At as ThrusterState,Ct as TopDownMovementBehavior,Ht as TopDownShooterCoordinator,Wo as VEC2_ONE,Fo as VEC2_ZERO,wo as VEC3_ONE,ko as VEC3_ZERO,kp as Vec3ComponentsSchema,pp as Vector2Schema,dp as Vector3TupleSchema,vp as VirtualTouchButtonConfigSchema,bp as VirtualTouchButtonsConfigSchema,up as VirtualTouchConfigSchema,Zp as VirtualTouchJoystickConfigSchema,gp as VirtualTouchJoysticksConfigSchema,Lp as VirtualTouchPositionSchema,yp as VirtualTouchStyleSchema,It as WorldBoundary2DBehavior,Jt as WorldBoundary2DEvent,Kt as WorldBoundary2DFSM,Qt as WorldBoundary2DState,Rt as WorldBoundary3DBehavior,Ut as WorldBoundary3DEvent,Xt as WorldBoundary3DFSM,Yt as WorldBoundary3DState,Le as ZONE_TYPE,fr as ZylemActor,de as ZylemBox,ke as ZylemCone,Ge as ZylemCylinder,je as ZylemDisk,cr as ZylemFog,Ha as ZylemGameElement,He as ZylemLight,Kr as ZylemLine,qe as ZylemParticleSystem,Oe as ZylemPill,he as ZylemPlane,Be as ZylemPyramid,ge as ZylemRect,ne as ZylemSphere,Cr as ZylemSprite,Vr as ZylemText,ve as ZylemZone,u as abs,Er as applyTransformChanges,g as asin,b as atan,_m as bindRuntimeDynamicCircleBody2DHandle,Xo as boxCollision,te as boxMesh,Ja as buildBoxCollider,Qa as buildCapsuleCollider,Ua as buildConvexHullCollider,Ra as buildCylinderCollider,Ya as buildHeightfieldCollider,Ia as buildRuntimeBody,Ka as buildSphereCollider,Xa as buildTrimeshCollider,_a as bundleRuntimeCollision,la as callFunc,L as clamp,A as clearGlobalSubscriptions,_t as computeWorldBoundary2DHits,$t as computeWorldBoundary3DHits,_o as coneCollision,ae as coneMesh,Z as cos,mr as create,xr as createActor,s as createBackgroundShader,ce as createBox,Br as createCamera,we as createCone,Je as createCooldownIcon,Me as createCylinder,Fe as createDisk,ar as createEntity,Rr as createEntityFactory,om as createFirstPersonInputComponent,rm as createFirstPersonMovementComponent,em as createFirstPersonStateComponent,sr as createFog,re as createFollowTarget,Xr as createGame,N as createGlobal,tm as createJumpConfig2D,mm as createJumpConfig3D,am as createJumpInput2D,pm as createJumpInput3D,fm as createJumpState2D,xm as createJumpState3D,Ie as createLight,Qr as createLine,m as createNodeMaterialFromTSL,Ae as createParticleSystem,kr as createPerspective,im as createPhysicsBodyComponent,Pe as createPill,ye as createPlane,dm as createPlatformer2DInputComponent,cm as createPlatformer2DMovementComponent,sm as createPlatformer2DStateComponent,nm as createPlatformer3DInputComponent,lm as createPlatformer3DMovementComponent,Sm as createPlatformer3DStateComponent,De as createPyramid,ue as createRect,hm as createShooter2DStateComponent,ap as createSimulation,le as createSphere,Hr as createSprite,Mr as createStage,qr as createText,ym as createThrusterInputComponent,Lm as createThrusterMovementComponent,vm as createThrusterStateComponent,Zm as createTopDownMovementComponent,bm as createTopDownMovementInputComponent,gm as createTopDownMovementStateComponent,um as createTransformComponent,ua as createTransformStore,hr as createVariable,Ze as createZone,go as crossfadeTransitionShader,or as cylinderCollision,fe as cylinderMesh,C as debugState,Lo as defaultTouchControls,Tm as defineBehavior,na as delay,Ke as destroy,oe as dispatchStageState,B as dot,$m as emitRuntimeGoal,oa as emitRuntimeRicochet,ra as emitRuntimeTriggerRegionEnter,Yr as entitySpawner,Q as entityThumbnailCache,T as exp,Sa as fadeOpacity,jm as fireCooldown,Fm as fireShooter2DIfRequested,d as float,w as floor,br as focusEntity,z as fract,vo as gameConfig,Wm as getCooldown,km as getCooldownStore,xo as getDisplayAspect,wm as getEntityFacingAngle2D,O as getGlobal,q as getGlobals,Da as getPosition,io as getPresetResolution,Ro as getRotation,yr as getVariable,Ea as getVelocity,aa as globalChange,pa as globalChanges,zm as hasAnyWorldBoundary2DHit,Bm as hasAnyWorldBoundary3DHit,$r as initStageStateDispatcher,t as isGLSLShader,jo as isManagedRenderEntity,e as isTSLShader,po as isWebGPUSupported,So as joystickBaseSvg,ho as joystickThumbSvg,D as length,W as max,ao as mergeInputConfigs,k as min,h as mix,G as mod,Ta as move,da as moveBy,Ba as moveForwardXY,ca as moveTo,ja as moveX,ka as moveXY,wa as moveXZ,Fa as moveY,Wa as moveZ,S as normalize,zo as normalizeVec2,Bo as normalizeVec3,o as objectVertexShader,P as onGlobalChange,V as onGlobalChanges,ya as onPress,La as onRelease,Lr as onVariableChange,vr as onVariableChanges,Uo as packCollisionGroups,Za as parallel,co as parseResolution,Dm as particleEffect,Em as particlePresets,Jr as pickZylemLine,rr as pillCollision,xe as pillMesh,ta as pingPongBeep,er as planeCollision,l as positionWorld,n as positionWorldDirection,j as pow,$o as pyramidCollision,pe as pyramidMesh,Gm as registerCooldown,Zr as registerEntityFocusContext,ba as repeat,ga as repeatForever,Mm as resetCooldown,ia as resetEntityOpacity,za as resetVelocity,Nm as resolveAim2D,lo as resolveButtonAccent,uo as resolveRenderCategory,no as resolveTouchTheme,ea as ricochetSound,sa as rotateBy,No as rotateEuler,Go as rotateInDirection,Po as rotateX,Oo as rotateY,Mo as rotateYEuler,Vo as rotateZ,Ca as screenCenterLookDeltas,Aa as screenCenterLookTargets,va as sequence,ee as setCameraFeed,I as setDebugTool,M as setGlobal,H as setPaused,Ga as setPosition,Ma as setPositionX,Na as setPositionY,Oa as setPositionZ,Ko as setRotation,Qo as setRotationDegrees,Ho as setRotationDegreesX,Ao as setRotationDegreesY,Jo as setRotationDegreesZ,Co as setRotationX,qo as setRotationY,Io as setRotationZ,J as setSelectedEntity,gr as setStageFrameProfilerEnabled,Sr as setVariable,qa as shortestAngleDelta,v as sin,y as smoothstep,Yo as sphereCollision,me as sphereMesh,Dr as stageConfig,Nr as stageState,r as standardShader,F as step,ha as throttle,Om as tickCooldowns,f as time,Do as toThreeVector2,Eo as toThreeVector3,yo as touchButtonSvg,so as touchThemes,a as uniform,Pm as updateBoundaryRicochet,R as useArrowsForAxes,X as useArrowsForDirections,U as useArrowsForSecondaryAxes,Vm as useBehavior,$ as useIJKLForAxes,oo as useIJKLForDirections,to as useMouse,ro as useMouseLook,eo as useScreenCenterLook,mo as useVirtualControls,_ as useWASDForAxes,Y as useWASDForDirections,To as usesManagedRenderPath,p as uv,fa as variableChange,xa as variableChanges,E as vec2,x as vec3,i as vec4,Gr as vessel,Va as wrapAround3D,Pa as wrapAroundXY,tr as zoneCollision,bo as zylemEventBus};
|