@zylem/behaviors 0.4.0 → 0.5.1

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 (146) hide show
  1. package/README.md +13 -1
  2. package/dist/behavior-system-CeJXzNvr.d.ts +868 -0
  3. package/dist/{chunk-GFARAJV2.js → chunk-2PAHQZZD.js} +44 -73
  4. package/dist/chunk-2PAHQZZD.js.map +1 -0
  5. package/dist/chunk-52FJIDGL.js +30 -0
  6. package/dist/chunk-52FJIDGL.js.map +1 -0
  7. package/dist/{chunk-UYFOLI2X.js → chunk-5A5AYP2C.js} +1 -1
  8. package/dist/{chunk-UYFOLI2X.js.map → chunk-5A5AYP2C.js.map} +1 -1
  9. package/dist/{chunk-64HKCSXD.js → chunk-5EBIIYZD.js} +25 -45
  10. package/dist/chunk-5EBIIYZD.js.map +1 -0
  11. package/dist/{chunk-WXXXJ22R.js → chunk-5NJGASUJ.js} +87 -129
  12. package/dist/chunk-5NJGASUJ.js.map +1 -0
  13. package/dist/{chunk-XLUJDKCT.js → chunk-5UMCWV5A.js} +24 -15
  14. package/dist/chunk-5UMCWV5A.js.map +1 -0
  15. package/dist/chunk-5WRI5ZAA.js +31 -0
  16. package/dist/chunk-5WRI5ZAA.js.map +1 -0
  17. package/dist/{chunk-5SM5SH5O.js → chunk-7JLWZXPA.js} +2 -2
  18. package/dist/{chunk-HNESASBB.js → chunk-AEBDZWCP.js} +19 -28
  19. package/dist/chunk-AEBDZWCP.js.map +1 -0
  20. package/dist/chunk-AS3HR7AS.js +188 -0
  21. package/dist/chunk-AS3HR7AS.js.map +1 -0
  22. package/dist/chunk-E4X4YJZB.js +841 -0
  23. package/dist/chunk-E4X4YJZB.js.map +1 -0
  24. package/dist/{chunk-PWF757B6.js → chunk-F6ESSHQK.js} +19 -25
  25. package/dist/chunk-F6ESSHQK.js.map +1 -0
  26. package/dist/chunk-GQAPBNGT.js +210 -0
  27. package/dist/chunk-GQAPBNGT.js.map +1 -0
  28. package/dist/chunk-JGXRQUTC.js +191 -0
  29. package/dist/chunk-JGXRQUTC.js.map +1 -0
  30. package/dist/{chunk-BXP4K7RF.js → chunk-JVADRLWX.js} +57 -186
  31. package/dist/chunk-JVADRLWX.js.map +1 -0
  32. package/dist/{chunk-ZA43LPRM.js → chunk-KIYUUSPK.js} +2 -2
  33. package/dist/{chunk-V74N7D6Q.js → chunk-KOWGILCN.js} +24 -15
  34. package/dist/chunk-KOWGILCN.js.map +1 -0
  35. package/dist/{chunk-WWVD5DR5.js → chunk-M3QDKKDF.js} +2 -8
  36. package/dist/chunk-M3QDKKDF.js.map +1 -0
  37. package/dist/{chunk-FTDZAKZW.js → chunk-NQPYMUDF.js} +7 -5
  38. package/dist/{chunk-FTDZAKZW.js.map → chunk-NQPYMUDF.js.map} +1 -1
  39. package/dist/{chunk-XP3ASVGJ.js → chunk-NW4SE5XW.js} +2 -2
  40. package/dist/{chunk-KDY5N6J4.js → chunk-OPZ2LVS2.js} +1 -22
  41. package/dist/{chunk-KDY5N6J4.js.map → chunk-OPZ2LVS2.js.map} +1 -1
  42. package/dist/{chunk-5XZWTFGF.js → chunk-PLIXVF7B.js} +3 -3
  43. package/dist/chunk-PLIXVF7B.js.map +1 -0
  44. package/dist/{chunk-Y7YIAWPW.js → chunk-SGHIGTVZ.js} +1 -11
  45. package/dist/{chunk-Y7YIAWPW.js.map → chunk-SGHIGTVZ.js.map} +1 -1
  46. package/dist/{chunk-UL6Q5HDP.js → chunk-TBUKJKY6.js} +3 -25
  47. package/dist/chunk-TBUKJKY6.js.map +1 -0
  48. package/dist/chunk-VFDUKGRZ.js +155 -0
  49. package/dist/chunk-VFDUKGRZ.js.map +1 -0
  50. package/dist/chunk-VT3H43QA.js +288 -0
  51. package/dist/chunk-VT3H43QA.js.map +1 -0
  52. package/dist/chunk-W26PHBME.js +309 -0
  53. package/dist/chunk-W26PHBME.js.map +1 -0
  54. package/dist/components-BANNjAZP.d.ts +30 -0
  55. package/dist/cooldown.d.ts +2 -2
  56. package/dist/cooldown.js +1 -0
  57. package/dist/coordinators/boundary-ricochet-3d.d.ts +4 -4
  58. package/dist/coordinators/boundary-ricochet-3d.js +1 -0
  59. package/dist/coordinators/boundary-ricochet.d.ts +4 -4
  60. package/dist/coordinators/boundary-ricochet.js +3 -2
  61. package/dist/coordinators/first-person-shooter.js +1 -0
  62. package/dist/coordinators/multidirectional-space-shooter.d.ts +3 -3
  63. package/dist/coordinators/multidirectional-space-shooter.js +5 -3
  64. package/dist/coordinators/top-down-shooter.d.ts +3 -3
  65. package/dist/coordinators/top-down-shooter.js +5 -3
  66. package/dist/core.d.ts +288 -8
  67. package/dist/core.js +492 -19
  68. package/dist/core.js.map +1 -1
  69. package/dist/destructible-3d.d.ts +32 -4
  70. package/dist/destructible-3d.js +2 -1
  71. package/dist/destructible-prebake.js +1 -0
  72. package/dist/{entity-types-CmtQ-IBp.d.ts → entity-types-DhfsZbSK.d.ts} +5 -3
  73. package/dist/first-person.d.ts +27 -38
  74. package/dist/first-person.js +8 -7
  75. package/dist/index.d.ts +14 -15
  76. package/dist/index.js +37 -52
  77. package/dist/jumper-2d.d.ts +3 -17
  78. package/dist/jumper-2d.js +4 -8
  79. package/dist/jumper-3d.d.ts +5 -39
  80. package/dist/jumper-3d.js +5 -9
  81. package/dist/{moveable-BLTHO7Jq.d.ts → moveable-XhzWPAw5.d.ts} +21 -4
  82. package/dist/particle-emitter/presets.js +1 -0
  83. package/dist/particle-emitter.d.ts +3 -3
  84. package/dist/particle-emitter.js +3 -2
  85. package/dist/platformer-2d.d.ts +13 -82
  86. package/dist/platformer-2d.js +4 -4
  87. package/dist/platformer-3d.d.ts +13 -78
  88. package/dist/platformer-3d.js +4 -4
  89. package/dist/ricochet-2d.d.ts +3 -3
  90. package/dist/ricochet-2d.js +4 -3
  91. package/dist/ricochet-3d.d.ts +3 -3
  92. package/dist/ricochet-3d.js +4 -3
  93. package/dist/runtime-2d.d.ts +2 -2
  94. package/dist/runtime-2d.js +1 -0
  95. package/dist/runtime-2d.js.map +1 -1
  96. package/dist/screen-visibility.d.ts +2 -2
  97. package/dist/screen-visibility.js +1 -0
  98. package/dist/screen-wrap.d.ts +2 -2
  99. package/dist/screen-wrap.js +4 -3
  100. package/dist/shooter-2d.d.ts +3 -3
  101. package/dist/shooter-2d.js +4 -3
  102. package/dist/thruster.d.ts +5 -34
  103. package/dist/thruster.js +4 -6
  104. package/dist/top-down-movement.d.ts +9 -27
  105. package/dist/top-down-movement.js +6 -6
  106. package/dist/{vector-Bm65-FOG.d.ts → vector-DjhLUrak.d.ts} +2 -4
  107. package/dist/world-boundary-2d.d.ts +2 -2
  108. package/dist/world-boundary-2d.js +5 -4
  109. package/dist/world-boundary-3d.d.ts +2 -2
  110. package/dist/world-boundary-3d.js +4 -3
  111. package/package.json +4 -3
  112. package/dist/behavior-system-DSNek0W9.d.ts +0 -483
  113. package/dist/chunk-4URF65BR.js +0 -44
  114. package/dist/chunk-4URF65BR.js.map +0 -1
  115. package/dist/chunk-4V7TIRO2.js +0 -44
  116. package/dist/chunk-4V7TIRO2.js.map +0 -1
  117. package/dist/chunk-5XZWTFGF.js.map +0 -1
  118. package/dist/chunk-64HKCSXD.js.map +0 -1
  119. package/dist/chunk-BXP4K7RF.js.map +0 -1
  120. package/dist/chunk-FRJDQM23.js +0 -506
  121. package/dist/chunk-FRJDQM23.js.map +0 -1
  122. package/dist/chunk-GFARAJV2.js.map +0 -1
  123. package/dist/chunk-GTLA6LOJ.js +0 -400
  124. package/dist/chunk-GTLA6LOJ.js.map +0 -1
  125. package/dist/chunk-HNESASBB.js.map +0 -1
  126. package/dist/chunk-JXMF4NUI.js +0 -309
  127. package/dist/chunk-JXMF4NUI.js.map +0 -1
  128. package/dist/chunk-MJFMNRMZ.js +0 -240
  129. package/dist/chunk-MJFMNRMZ.js.map +0 -1
  130. package/dist/chunk-OTLSUYQQ.js +0 -29
  131. package/dist/chunk-OTLSUYQQ.js.map +0 -1
  132. package/dist/chunk-PWF757B6.js.map +0 -1
  133. package/dist/chunk-RONH2KDI.js +0 -455
  134. package/dist/chunk-RONH2KDI.js.map +0 -1
  135. package/dist/chunk-RTRFJVCZ.js +0 -454
  136. package/dist/chunk-RTRFJVCZ.js.map +0 -1
  137. package/dist/chunk-UL6Q5HDP.js.map +0 -1
  138. package/dist/chunk-V74N7D6Q.js.map +0 -1
  139. package/dist/chunk-WWVD5DR5.js.map +0 -1
  140. package/dist/chunk-WXXXJ22R.js.map +0 -1
  141. package/dist/chunk-XLUJDKCT.js.map +0 -1
  142. package/dist/components-BWG1GkZA.d.ts +0 -20
  143. package/dist/use-behavior-h9-T5FSv.d.ts +0 -13
  144. /package/dist/{chunk-5SM5SH5O.js.map → chunk-7JLWZXPA.js.map} +0 -0
  145. /package/dist/{chunk-ZA43LPRM.js.map → chunk-KIYUUSPK.js.map} +0 -0
  146. /package/dist/{chunk-XP3ASVGJ.js.map → chunk-NW4SE5XW.js.map} +0 -0
package/dist/index.js CHANGED
@@ -3,47 +3,47 @@ import {
3
3
  } from "./chunk-H4TJ7X4O.js";
4
4
  import {
5
5
  MultidirectionalSpaceShooterCoordinator
6
- } from "./chunk-FTDZAKZW.js";
6
+ } from "./chunk-NQPYMUDF.js";
7
7
  import {
8
8
  TopDownShooterCoordinator
9
- } from "./chunk-ZA43LPRM.js";
9
+ } from "./chunk-KIYUUSPK.js";
10
10
  import {
11
- fireShooter2DIfRequested,
12
- getEntityFacingAngle2D,
13
- resolveAim2D
14
- } from "./chunk-UL6Q5HDP.js";
11
+ fireShooter2DIfRequested
12
+ } from "./chunk-52FJIDGL.js";
15
13
  import {
16
14
  ScreenWrapBehavior,
17
15
  ScreenWrapEvent,
18
16
  ScreenWrapFSM,
19
17
  ScreenWrapState
20
- } from "./chunk-GFARAJV2.js";
18
+ } from "./chunk-2PAHQZZD.js";
21
19
  import {
22
20
  Shooter2DBehavior,
23
21
  createShooter2DStateComponent
24
- } from "./chunk-5XZWTFGF.js";
22
+ } from "./chunk-PLIXVF7B.js";
25
23
  import {
26
24
  ThrusterBehavior,
27
25
  ThrusterEvent,
28
26
  ThrusterFSM,
29
- ThrusterState,
30
- ThrusterSystem
31
- } from "./chunk-MJFMNRMZ.js";
27
+ ThrusterState
28
+ } from "./chunk-VFDUKGRZ.js";
32
29
  import {
33
30
  createThrusterInputComponent,
34
31
  createThrusterMovementComponent,
35
32
  createThrusterStateComponent
36
33
  } from "./chunk-IZJFUAXB.js";
37
34
  import {
38
- TopDownMovementBehavior,
39
- TopDownMovementSystem
40
- } from "./chunk-64HKCSXD.js";
35
+ TopDownMovementBehavior
36
+ } from "./chunk-5EBIIYZD.js";
41
37
  import {
42
38
  createTopDownMovementComponent,
43
39
  createTopDownMovementInputComponent,
44
40
  createTopDownMovementStateComponent
45
41
  } from "./chunk-EIWQM6U3.js";
46
- import "./chunk-Y7YIAWPW.js";
42
+ import {
43
+ getEntityFacingAngle2D,
44
+ resolveAim2D
45
+ } from "./chunk-TBUKJKY6.js";
46
+ import "./chunk-SGHIGTVZ.js";
47
47
  import {
48
48
  WorldBoundary2DBehavior,
49
49
  WorldBoundary2DEvent,
@@ -51,7 +51,7 @@ import {
51
51
  WorldBoundary2DState,
52
52
  computeWorldBoundary2DHits,
53
53
  hasAnyWorldBoundary2DHit
54
- } from "./chunk-PWF757B6.js";
54
+ } from "./chunk-F6ESSHQK.js";
55
55
  import {
56
56
  WorldBoundary3DBehavior,
57
57
  WorldBoundary3DEvent,
@@ -59,11 +59,11 @@ import {
59
59
  WorldBoundary3DState,
60
60
  computeWorldBoundary3DHits,
61
61
  hasAnyWorldBoundary3DHit
62
- } from "./chunk-HNESASBB.js";
62
+ } from "./chunk-AEBDZWCP.js";
63
63
  import {
64
64
  BoundaryRicochetCoordinator
65
- } from "./chunk-XP3ASVGJ.js";
66
- import "./chunk-KDY5N6J4.js";
65
+ } from "./chunk-NW4SE5XW.js";
66
+ import "./chunk-OPZ2LVS2.js";
67
67
  import {
68
68
  BoundaryRicochet3DCoordinator
69
69
  } from "./chunk-KFFETUAL.js";
@@ -74,7 +74,7 @@ import {
74
74
  import {
75
75
  ParticleEmitterBehavior,
76
76
  particlePresets
77
- } from "./chunk-5SM5SH5O.js";
77
+ } from "./chunk-7JLWZXPA.js";
78
78
  import {
79
79
  particleEffect
80
80
  } from "./chunk-7JJEIADR.js";
@@ -83,33 +83,31 @@ import {
83
83
  Platformer2DEvent,
84
84
  Platformer2DFSM,
85
85
  Platformer2DState,
86
- Platformer2DSystem,
87
86
  createPlatformer2DInputComponent,
88
87
  createPlatformer2DMovementComponent,
89
88
  createPlatformer2DStateComponent
90
- } from "./chunk-RTRFJVCZ.js";
89
+ } from "./chunk-VT3H43QA.js";
91
90
  import {
92
91
  Platformer3DBehavior,
93
92
  Platformer3DEvent,
94
93
  Platformer3DFSM,
95
94
  Platformer3DState,
96
- Platformer3DSystem,
97
95
  createPlatformer3DInputComponent,
98
96
  createPlatformer3DMovementComponent,
99
97
  createPlatformer3DStateComponent
100
- } from "./chunk-FRJDQM23.js";
98
+ } from "./chunk-W26PHBME.js";
101
99
  import {
102
100
  Ricochet2DBehavior,
103
101
  Ricochet2DEvent,
104
102
  Ricochet2DFSM,
105
103
  Ricochet2DState
106
- } from "./chunk-V74N7D6Q.js";
104
+ } from "./chunk-KOWGILCN.js";
107
105
  import {
108
106
  Ricochet3DBehavior,
109
107
  Ricochet3DEvent,
110
108
  Ricochet3DFSM,
111
109
  Ricochet3DState
112
- } from "./chunk-XLUJDKCT.js";
110
+ } from "./chunk-5UMCWV5A.js";
113
111
  import {
114
112
  ScreenVisibilityBehavior,
115
113
  ScreenVisibilityFSM
@@ -118,8 +116,7 @@ import {
118
116
  createPhysicsBodyComponent,
119
117
  createTransformComponent,
120
118
  useBehavior
121
- } from "./chunk-UYFOLI2X.js";
122
- import "./chunk-4V7TIRO2.js";
119
+ } from "./chunk-5A5AYP2C.js";
123
120
  import {
124
121
  CooldownBehavior,
125
122
  fireCooldown,
@@ -133,51 +130,47 @@ import {
133
130
  Destructible3DBehavior,
134
131
  DestructibleMesh,
135
132
  FractureOptions
136
- } from "./chunk-BXP4K7RF.js";
133
+ } from "./chunk-JVADRLWX.js";
137
134
  import "./chunk-HZMY3TT4.js";
138
135
  import {
139
136
  FirstPersonBehavior,
140
137
  FirstPersonEvent,
141
138
  FirstPersonFSM,
142
- FirstPersonState,
143
- FirstPersonSystem
144
- } from "./chunk-WXXXJ22R.js";
139
+ FirstPersonPresentation,
140
+ FirstPersonState
141
+ } from "./chunk-5NJGASUJ.js";
145
142
  import {
146
143
  createFirstPersonInputComponent,
147
144
  createFirstPersonMovementComponent,
148
145
  createFirstPersonStateComponent
149
146
  } from "./chunk-QVCMJ4Q2.js";
150
- import "./chunk-WWVD5DR5.js";
147
+ import "./chunk-M3QDKKDF.js";
151
148
  import {
152
149
  Jumper2DBehavior,
153
150
  Jumper2DEvent,
154
151
  Jumper2DFSM,
155
152
  Jumper2DState,
156
- Jumper2DSystem,
157
- Jumper2DTickEvent,
158
153
  createJumpConfig2D,
159
154
  createJumpInput2D,
160
155
  createJumpState2D
161
- } from "./chunk-GTLA6LOJ.js";
156
+ } from "./chunk-GQAPBNGT.js";
162
157
  import {
163
158
  Jumper3DBehavior,
164
159
  Jumper3DEvent,
165
160
  Jumper3DFSM,
166
- Jumper3DState,
167
- Jumper3DSystem,
168
- JumperTickEvent
169
- } from "./chunk-RONH2KDI.js";
161
+ Jumper3DState
162
+ } from "./chunk-JGXRQUTC.js";
170
163
  import {
171
164
  createJumpConfig3D,
172
165
  createJumpInput3D,
173
166
  createJumpState3D
174
167
  } from "./chunk-4WH2ZN7P.js";
175
- import "./chunk-JXMF4NUI.js";
176
- import "./chunk-OTLSUYQQ.js";
177
- import "./chunk-4URF65BR.js";
168
+ import "./chunk-AS3HR7AS.js";
169
+ import "./chunk-E4X4YJZB.js";
178
170
  import {
179
171
  defineBehavior
180
172
  } from "./chunk-EZNCCO4L.js";
173
+ import "./chunk-5WRI5ZAA.js";
181
174
  export {
182
175
  BoundaryRicochet3DCoordinator,
183
176
  BoundaryRicochetCoordinator,
@@ -187,34 +180,28 @@ export {
187
180
  FirstPersonBehavior,
188
181
  FirstPersonEvent,
189
182
  FirstPersonFSM,
183
+ FirstPersonPresentation,
190
184
  FirstPersonShooterCoordinator,
191
185
  FirstPersonState,
192
- FirstPersonSystem,
193
186
  FractureOptions,
194
187
  Jumper2DBehavior,
195
188
  Jumper2DEvent,
196
189
  Jumper2DFSM,
197
190
  Jumper2DState,
198
- Jumper2DSystem,
199
- Jumper2DTickEvent,
200
191
  Jumper3DBehavior,
201
192
  Jumper3DEvent,
202
193
  Jumper3DFSM,
203
194
  Jumper3DState,
204
- Jumper3DSystem,
205
- JumperTickEvent,
206
195
  MultidirectionalSpaceShooterCoordinator,
207
196
  ParticleEmitterBehavior,
208
197
  Platformer2DBehavior,
209
198
  Platformer2DEvent,
210
199
  Platformer2DFSM,
211
200
  Platformer2DState,
212
- Platformer2DSystem,
213
201
  Platformer3DBehavior,
214
202
  Platformer3DEvent,
215
203
  Platformer3DFSM,
216
204
  Platformer3DState,
217
- Platformer3DSystem,
218
205
  Ricochet2DBehavior,
219
206
  Ricochet2DEvent,
220
207
  Ricochet2DFSM,
@@ -234,9 +221,7 @@ export {
234
221
  ThrusterEvent,
235
222
  ThrusterFSM,
236
223
  ThrusterState,
237
- ThrusterSystem,
238
224
  TopDownMovementBehavior,
239
- TopDownMovementSystem,
240
225
  TopDownShooterCoordinator,
241
226
  WorldBoundary2DBehavior,
242
227
  WorldBoundary2DEvent,
@@ -1,7 +1,7 @@
1
1
  import { S as SyncStateMachine } from './sync-state-machine-CZyspBpj.js';
2
- import * as _dimforge_rapier3d_compat from '@dimforge/rapier3d-compat';
3
- import { a as BehaviorDescriptor, T as TransformState } from './behavior-system-DSNek0W9.js';
2
+ import { a as BehaviorDescriptor, Y as TransformState } from './behavior-system-CeJXzNvr.js';
4
3
  import 'typescript-fsm';
4
+ import '@zylem/runtime';
5
5
 
6
6
  interface JumpConfig2D {
7
7
  jumpHeight: number;
@@ -44,19 +44,6 @@ interface JumpState2D {
44
44
  }
45
45
  declare function createJumpState2D(): JumpState2D;
46
46
 
47
- declare enum Jumper2DTickEvent {
48
- None = "none",
49
- Jump = "jump",
50
- Fall = "fall",
51
- Land = "land"
52
- }
53
- interface Jumper2DTickResult {
54
- event: Jumper2DTickEvent;
55
- }
56
- declare class Jumper2DSystem {
57
- tick(config: JumpConfig2D, input: JumpInput2D, ctx: JumpContext2D, state: JumpState2D): Jumper2DTickResult;
58
- }
59
-
60
47
  declare enum Jumper2DState {
61
48
  Grounded = "grounded",
62
49
  Jumping = "jumping",
@@ -98,7 +85,6 @@ interface Jumper2DBehaviorOptions {
98
85
  }
99
86
  interface Jumper2DEntity {
100
87
  uuid: string;
101
- body: _dimforge_rapier3d_compat.RigidBody | null;
102
88
  transformStore: TransformState;
103
89
  jumper2d: JumpConfig2D;
104
90
  $jumper2d: JumpInput2D;
@@ -111,4 +97,4 @@ declare const Jumper2DBehavior: BehaviorDescriptor<Jumper2DBehaviorOptions, {
111
97
  getJumpsRemaining: () => number;
112
98
  }, Jumper2DEntity>;
113
99
 
114
- export { type JumpConfig2D, type JumpContext2D, type JumpInput2D, type JumpState2D, Jumper2DBehavior, type Jumper2DBehaviorOptions, type Jumper2DEntity, Jumper2DEvent, Jumper2DFSM, Jumper2DState, Jumper2DSystem, Jumper2DTickEvent, type Jumper2DTickResult, createJumpConfig2D, createJumpInput2D, createJumpState2D };
100
+ export { type JumpConfig2D, type JumpContext2D, type JumpInput2D, type JumpState2D, Jumper2DBehavior, type Jumper2DBehaviorOptions, type Jumper2DEntity, Jumper2DEvent, Jumper2DFSM, Jumper2DState, createJumpConfig2D, createJumpInput2D, createJumpState2D };
package/dist/jumper-2d.js CHANGED
@@ -3,23 +3,19 @@ import {
3
3
  Jumper2DEvent,
4
4
  Jumper2DFSM,
5
5
  Jumper2DState,
6
- Jumper2DSystem,
7
- Jumper2DTickEvent,
8
6
  createJumpConfig2D,
9
7
  createJumpInput2D,
10
8
  createJumpState2D
11
- } from "./chunk-GTLA6LOJ.js";
12
- import "./chunk-JXMF4NUI.js";
13
- import "./chunk-OTLSUYQQ.js";
14
- import "./chunk-4URF65BR.js";
9
+ } from "./chunk-GQAPBNGT.js";
10
+ import "./chunk-AS3HR7AS.js";
11
+ import "./chunk-E4X4YJZB.js";
15
12
  import "./chunk-EZNCCO4L.js";
13
+ import "./chunk-5WRI5ZAA.js";
16
14
  export {
17
15
  Jumper2DBehavior,
18
16
  Jumper2DEvent,
19
17
  Jumper2DFSM,
20
18
  Jumper2DState,
21
- Jumper2DSystem,
22
- Jumper2DTickEvent,
23
19
  createJumpConfig2D,
24
20
  createJumpInput2D,
25
21
  createJumpState2D
@@ -1,42 +1,9 @@
1
- import { J as JumpConfig3D, b as JumpInput3D, a as JumpContext3D, c as JumpState3D } from './components--hjBMTnz.js';
2
- export { V as Vec3Like, d as createJumpConfig3D, e as createJumpInput3D, f as createJumpState3D } from './components--hjBMTnz.js';
1
+ import { c as JumpState3D, J as JumpConfig3D, b as JumpInput3D } from './components--hjBMTnz.js';
2
+ export { a as JumpContext3D, V as Vec3Like, d as createJumpConfig3D, e as createJumpInput3D, f as createJumpState3D } from './components--hjBMTnz.js';
3
3
  import { S as SyncStateMachine } from './sync-state-machine-CZyspBpj.js';
4
- import * as _dimforge_rapier3d_compat from '@dimforge/rapier3d-compat';
5
- import { a as BehaviorDescriptor, T as TransformState } from './behavior-system-DSNek0W9.js';
4
+ import { a as BehaviorDescriptor, Y as TransformState } from './behavior-system-CeJXzNvr.js';
6
5
  import 'typescript-fsm';
7
-
8
- /**
9
- * Jumper 3D Behavior — Pure Jump Physics
10
- *
11
- * A stateless tick function that receives configuration, input, context, and
12
- * state, then applies jump physics through the context's velocity helpers.
13
- *
14
- * Vertical velocity (Y) is owned exclusively by this behavior.
15
- * Horizontal velocity (X/Z) is only touched when airborne planar control
16
- * is configured; otherwise the movement controller owns X/Z.
17
- */
18
-
19
- declare class Jumper3DSystem {
20
- /**
21
- * Advance the jump system by one frame.
22
- *
23
- * Call order within a frame:
24
- * 1. Movement controller writes X/Z via transformStore.dirty.velocityX/Z.
25
- * 2. `tick()` writes Y via ctx.setVerticalVelocity().
26
- * (Optionally writes X/Z when airborne planar control is active.)
27
- */
28
- tick(config: JumpConfig3D, input: JumpInput3D, ctx: JumpContext3D, state: JumpState3D): JumperTickResult;
29
- }
30
- /** Events emitted by a single tick (used by FSM). */
31
- declare enum JumperTickEvent {
32
- None = "none",
33
- Jump = "jump",
34
- Fall = "fall",
35
- Land = "land"
36
- }
37
- interface JumperTickResult {
38
- event: JumperTickEvent;
39
- }
6
+ import '@zylem/runtime';
40
7
 
41
8
  /**
42
9
  * Jumper 3D Finite State Machine
@@ -117,7 +84,6 @@ interface Jumper3DBehaviorOptions {
117
84
  }
118
85
  interface Jumper3DEntity {
119
86
  uuid: string;
120
- body: _dimforge_rapier3d_compat.RigidBody | null;
121
87
  transformStore: TransformState;
122
88
  jumper: JumpConfig3D;
123
89
  $jumper: JumpInput3D;
@@ -162,4 +128,4 @@ declare const Jumper3DBehavior: BehaviorDescriptor<Jumper3DBehaviorOptions, {
162
128
  getJumpsRemaining: () => number;
163
129
  }, Jumper3DEntity>;
164
130
 
165
- export { JumpConfig3D, JumpContext3D, JumpInput3D, JumpState3D, Jumper3DBehavior, type Jumper3DBehaviorOptions, type Jumper3DEntity, Jumper3DEvent, Jumper3DFSM, Jumper3DState, Jumper3DSystem, JumperTickEvent, type JumperTickResult };
131
+ export { JumpConfig3D, JumpInput3D, JumpState3D, Jumper3DBehavior, type Jumper3DBehaviorOptions, type Jumper3DEntity, Jumper3DEvent, Jumper3DFSM, Jumper3DState };
package/dist/jumper-3d.js CHANGED
@@ -2,26 +2,22 @@ import {
2
2
  Jumper3DBehavior,
3
3
  Jumper3DEvent,
4
4
  Jumper3DFSM,
5
- Jumper3DState,
6
- Jumper3DSystem,
7
- JumperTickEvent
8
- } from "./chunk-RONH2KDI.js";
5
+ Jumper3DState
6
+ } from "./chunk-JGXRQUTC.js";
9
7
  import {
10
8
  createJumpConfig3D,
11
9
  createJumpInput3D,
12
10
  createJumpState3D
13
11
  } from "./chunk-4WH2ZN7P.js";
14
- import "./chunk-JXMF4NUI.js";
15
- import "./chunk-OTLSUYQQ.js";
16
- import "./chunk-4URF65BR.js";
12
+ import "./chunk-AS3HR7AS.js";
13
+ import "./chunk-E4X4YJZB.js";
17
14
  import "./chunk-EZNCCO4L.js";
15
+ import "./chunk-5WRI5ZAA.js";
18
16
  export {
19
17
  Jumper3DBehavior,
20
18
  Jumper3DEvent,
21
19
  Jumper3DFSM,
22
20
  Jumper3DState,
23
- Jumper3DSystem,
24
- JumperTickEvent,
25
21
  createJumpConfig3D,
26
22
  createJumpInput3D,
27
23
  createJumpState3D
@@ -1,9 +1,26 @@
1
1
  import { Vector3 } from 'three';
2
- import { RigidBody, Vector } from '@dimforge/rapier3d-compat';
3
- import { T as TransformState } from './behavior-system-DSNek0W9.js';
2
+ import { Y as TransformState } from './behavior-system-CeJXzNvr.js';
4
3
 
4
+ /** Plain `{ x, y, z }` vector returned by pose/velocity reads. */
5
+ interface Vector {
6
+ x: number;
7
+ y: number;
8
+ z: number;
9
+ }
10
+ /**
11
+ * Structural slice of the host body reference used by the direct-body helpers
12
+ * below (`getPosition`, `setPosition`, `resetVelocity`, ...). The host's
13
+ * runtime-backed body proxy satisfies this shape.
14
+ */
15
+ interface MoveableBodyLike {
16
+ translation(): Vector;
17
+ linvel(): Vector;
18
+ setTranslation(translation: Vector, wakeUp: boolean): void;
19
+ setLinvel(velocity: Vector, wakeUp: boolean): void;
20
+ setLinearDamping(damping: number): void;
21
+ }
5
22
  interface EntityWithBody {
6
- body: RigidBody | null;
23
+ body: MoveableBodyLike | null;
7
24
  transformStore?: TransformState;
8
25
  }
9
26
  /**
@@ -97,4 +114,4 @@ interface MoveableEntity extends EntityWithBody {
97
114
  */
98
115
  declare function makeMoveable<T extends EntityWithBody>(entity: T): T & MoveableEntity;
99
116
 
100
- export { type EntityWithBody as E, type MoveableEntity as M, getVelocity as a, move as b, moveForwardXY as c, moveX as d, moveXY as e, moveXZ as f, getPosition as g, moveY as h, moveZ as i, setPositionX as j, setPositionY as k, setPositionZ as l, makeMoveable as m, wrapAroundXY as n, resetVelocity as r, setPosition as s, wrapAround3D as w };
117
+ export { type EntityWithBody as E, type MoveableBodyLike as M, type Vector as V, type MoveableEntity as a, getVelocity as b, move as c, moveForwardXY as d, moveX as e, moveXY as f, getPosition as g, moveXZ as h, moveY as i, moveZ as j, setPositionX as k, setPositionY as l, makeMoveable as m, setPositionZ as n, wrapAroundXY as o, resetVelocity as r, setPosition as s, wrapAround3D as w };
@@ -5,6 +5,7 @@ import {
5
5
  magicPresets,
6
6
  waterPresets
7
7
  } from "../chunk-7JJEIADR.js";
8
+ import "../chunk-5WRI5ZAA.js";
8
9
  export {
9
10
  electricityPresets,
10
11
  firePresets,
@@ -1,9 +1,9 @@
1
- import { a as BehaviorDescriptor } from './behavior-system-DSNek0W9.js';
2
- import { i as Vec3Input } from './vector-Bm65-FOG.js';
1
+ import { a as BehaviorDescriptor } from './behavior-system-CeJXzNvr.js';
2
+ import { i as Vec3Input } from './vector-DjhLUrak.js';
3
3
  import { h as ParticlePresetMaterialOptions, P as ParticleEffectDefinition, C as spark, o as ember, p as flamelet, l as blaze, A as smolder, t as mist, E as spray, D as splash, n as drizzle, H as torrent, I as vapor, z as smoke, q as haze, w as plume, s as miasma, B as spark$1, j as arc, G as surge, y as pulse, F as storm, k as arcane, r as holy, m as corrupted, u as nature, J as voidMagic, x as psychic, i as Particles } from './spark-Dx3cJbTW.js';
4
4
  export { a as ParticleMagicAgency, b as ParticleMagicAlignment, c as ParticleMagicModifierInput, d as ParticleMagicModifierOptions, e as ParticleMagicOrder, f as ParticleMagicRealityEffect, g as ParticleMagicTemperament, S as SemanticParticlePresetOptions, v as particleEffect } from './spark-Dx3cJbTW.js';
5
5
  import { ColorRepresentation } from 'three';
6
- import '@dimforge/rapier3d-compat';
6
+ import '@zylem/runtime';
7
7
  import 'three/webgpu';
8
8
 
9
9
  interface BurstParticlePresetOptions extends ParticlePresetMaterialOptions {
@@ -1,12 +1,13 @@
1
1
  import {
2
2
  ParticleEmitterBehavior,
3
3
  particlePresets
4
- } from "./chunk-5SM5SH5O.js";
4
+ } from "./chunk-7JLWZXPA.js";
5
5
  import {
6
6
  particleEffect
7
7
  } from "./chunk-7JJEIADR.js";
8
- import "./chunk-WWVD5DR5.js";
8
+ import "./chunk-M3QDKKDF.js";
9
9
  import "./chunk-EZNCCO4L.js";
10
+ import "./chunk-5WRI5ZAA.js";
10
11
  export {
11
12
  ParticleEmitterBehavior,
12
13
  particleEffect,
@@ -1,7 +1,7 @@
1
1
  import { S as SyncStateMachine } from './sync-state-machine-CZyspBpj.js';
2
- import { RigidBody, Collider } from '@dimforge/rapier3d-compat';
3
- import { Z as ZylemWorld, a as BehaviorDescriptor } from './behavior-system-DSNek0W9.js';
2
+ import { a as BehaviorDescriptor } from './behavior-system-CeJXzNvr.js';
4
3
  import 'typescript-fsm';
4
+ import '@zylem/runtime';
5
5
 
6
6
  /**
7
7
  * Platformer 2D Components
@@ -153,85 +153,6 @@ declare class Platformer2DFSM {
153
153
  update(input: Platformer2DInputComponent, state: Platformer2DStateComponent): void;
154
154
  }
155
155
 
156
- /**
157
- * Platformer 2D System
158
- *
159
- * Kinematic character controller (SNES-style) on the X/Y plane: the
160
- * controller owns all motion and physics is only a collision database.
161
- *
162
- * - The entity's body is converted to `KinematicPositionBased` on first
163
- * update; Rapier never applies forces to it.
164
- * - Each tick, desired displacement (X input + integrated vertical velocity,
165
- * z locked to 0) is run through Rapier's `KinematicCharacterController`
166
- * (collide-and-slide with autostep, slope limits, and snap-to-ground) and
167
- * the corrected movement is applied via `setNextKinematicTranslation`. The
168
- * z coordinate is re-pinned to its first-seen value every tick so slide
169
- * resolution can never drift the entity off the 2D plane.
170
- * - Grounded comes from `controller.computedGrounded()` — no contact-pair or
171
- * raycast probing.
172
- * - Vertical velocity lives in `state.verticalVelocity` (`linvel()` is
173
- * meaningless on kinematic bodies). Jump buffering, coyote time,
174
- * multi-jump, and the jump-cut ramp all operate on that field.
175
- */
176
-
177
- /**
178
- * Entity with 2D platformer components
179
- */
180
- interface Platformer2DEntity {
181
- uuid: string;
182
- body: RigidBody;
183
- collider?: Collider | null;
184
- platformer2D: Platformer2DMovementComponent;
185
- $platformer2D: Platformer2DInputComponent;
186
- platformer2DState: Platformer2DStateComponent;
187
- }
188
- /**
189
- * Platformer 2D movement system.
190
- *
191
- * Core kinematic controller for 2D platformer movement. Requires a live
192
- * `ZylemWorld` with the raw Rapier `World` exposed on `.world` — without it
193
- * the system is a no-op.
194
- */
195
- declare class Platformer2DSystem {
196
- private world;
197
- /** Per-entity character controllers, keyed by entity uuid. */
198
- private controllers;
199
- /** Spawn-time z per entity; re-pinned every tick to hold the 2D plane. */
200
- private planeZ;
201
- constructor(world: ZylemWorld | null);
202
- /**
203
- * One-time per-entity physics setup: convert the body to a
204
- * position-based kinematic body, record the plane z, and create the
205
- * entity's character controller. Done lazily on the first update because
206
- * the body isn't always available at construction time.
207
- */
208
- private ensurePhysicsConfigured;
209
- /**
210
- * Handle jump logic with multi-jump, coyote time, buffering, and jump-cut
211
- * ramp. All vertical motion is written to `state.verticalVelocity`.
212
- */
213
- private handleJump;
214
- /**
215
- * Integrate gravity into `state.verticalVelocity`.
216
- *
217
- * While grounded (and not on the jump frame) vertical velocity is held at
218
- * a small constant downward speed so the controller stays pressed into
219
- * the ground. Skipped entirely on the frame a jump was applied — the
220
- * grounded flag is still stale-true then and would clobber the jump.
221
- */
222
- private applyGravity;
223
- /**
224
- * Update entity state from the controller's grounded result.
225
- */
226
- private updateState;
227
- /**
228
- * Update one platformer entity. Invoked per linked entity by the
229
- * Platformer2DBehaviorSystem adapter.
230
- */
231
- updateEntity(entity: Platformer2DEntity, delta: number): void;
232
- destroy(): void;
233
- }
234
-
235
156
  /**
236
157
  * Platformer 2D behavior options (typed for entity.use() autocomplete)
237
158
  */
@@ -266,6 +187,16 @@ interface Platformer2DBehaviorOptions {
266
187
  /** Character controller collision offset (default: 0.05) */
267
188
  characterOffset?: number;
268
189
  }
190
+ /**
191
+ * Entity with 2D platformer components (input written by the game; the wasm
192
+ * runtime owns the kinematic character controller and FSM).
193
+ */
194
+ interface Platformer2DEntity {
195
+ uuid: string;
196
+ platformer2D: Platformer2DMovementComponent;
197
+ $platformer2D: Platformer2DInputComponent;
198
+ platformer2DState: Platformer2DStateComponent;
199
+ }
269
200
  /**
270
201
  * Platformer2DBehavior - typed descriptor for 2D platformer movement
271
202
  *
@@ -303,4 +234,4 @@ declare const Platformer2DBehavior: BehaviorDescriptor<Platformer2DBehaviorOptio
303
234
  getJumpCount: () => number;
304
235
  }, Platformer2DEntity>;
305
236
 
306
- export { Platformer2DBehavior, type Platformer2DBehaviorOptions, type Platformer2DCollisionContext, type Platformer2DContext, type Platformer2DEntity, Platformer2DEvent, Platformer2DFSM, type Platformer2DInputComponent, type Platformer2DMovementComponent, Platformer2DState, type Platformer2DStateComponent, Platformer2DSystem, createPlatformer2DInputComponent, createPlatformer2DMovementComponent, createPlatformer2DStateComponent };
237
+ export { Platformer2DBehavior, type Platformer2DBehaviorOptions, type Platformer2DCollisionContext, type Platformer2DContext, type Platformer2DEntity, Platformer2DEvent, Platformer2DFSM, type Platformer2DInputComponent, type Platformer2DMovementComponent, Platformer2DState, type Platformer2DStateComponent, createPlatformer2DInputComponent, createPlatformer2DMovementComponent, createPlatformer2DStateComponent };
@@ -3,19 +3,19 @@ import {
3
3
  Platformer2DEvent,
4
4
  Platformer2DFSM,
5
5
  Platformer2DState,
6
- Platformer2DSystem,
7
6
  createPlatformer2DInputComponent,
8
7
  createPlatformer2DMovementComponent,
9
8
  createPlatformer2DStateComponent
10
- } from "./chunk-RTRFJVCZ.js";
11
- import "./chunk-4URF65BR.js";
9
+ } from "./chunk-VT3H43QA.js";
10
+ import "./chunk-AS3HR7AS.js";
11
+ import "./chunk-E4X4YJZB.js";
12
12
  import "./chunk-EZNCCO4L.js";
13
+ import "./chunk-5WRI5ZAA.js";
13
14
  export {
14
15
  Platformer2DBehavior,
15
16
  Platformer2DEvent,
16
17
  Platformer2DFSM,
17
18
  Platformer2DState,
18
- Platformer2DSystem,
19
19
  createPlatformer2DInputComponent,
20
20
  createPlatformer2DMovementComponent,
21
21
  createPlatformer2DStateComponent