@zylem/behaviors 0.5.2 → 0.5.7
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/dist/{behavior-system-CldqNUgr.d.ts → behavior-system-HEt67el5.d.ts} +14 -1
- package/dist/{chunk-EIWQM6U3.js → chunk-2HKY6WF7.js} +0 -1
- package/dist/{chunk-IZJFUAXB.js → chunk-2HLZBWGD.js} +0 -1
- package/dist/{chunk-LL4FLHIY.js → chunk-2YF7J3H4.js} +0 -1
- package/dist/{chunk-SGHIGTVZ.js → chunk-3X3CL24Z.js} +0 -1
- package/dist/{chunk-HZMY3TT4.js → chunk-4DVDFCVY.js} +0 -1
- package/dist/{chunk-QVCMJ4Q2.js → chunk-4EWASZHB.js} +0 -1
- package/dist/{chunk-4LLK2FJI.js → chunk-55CFXXZH.js} +3 -4
- package/dist/{chunk-4MZ57HPD.js → chunk-57GLKGEX.js} +3 -4
- package/dist/{chunk-QS3VXWVO.js → chunk-7GGR26YA.js} +3 -4
- package/dist/{chunk-Y4PHT2HG.js → chunk-7LHXAEOZ.js} +4 -5
- package/dist/{chunk-PLIXVF7B.js → chunk-7TIIRJKF.js} +3 -4
- package/dist/{chunk-LZIHSJZR.js → chunk-CB3C7CRD.js} +4 -5
- package/dist/{chunk-G2KUXVU6.js → chunk-CTSYM56P.js} +30 -12
- package/dist/{chunk-2PAHQZZD.js → chunk-CVRN7YAI.js} +3 -4
- package/dist/{chunk-NW4SE5XW.js → chunk-DD4U42FG.js} +2 -3
- package/dist/{chunk-BAXJ7XHJ.js → chunk-E2MOFIDH.js} +3 -4
- package/dist/{chunk-WOMHL23C.js → chunk-ERS6SNA5.js} +1 -2
- package/dist/{chunk-4WH2ZN7P.js → chunk-F7E23E26.js} +0 -1
- package/dist/{chunk-DZ4LLQON.js → chunk-GZ3DQIIZ.js} +23 -2
- package/dist/{chunk-5WRI5ZAA.js → chunk-JSBRDJBE.js} +0 -1
- package/dist/{chunk-5A5AYP2C.js → chunk-K6CWKFHL.js} +0 -1
- package/dist/{chunk-52FJIDGL.js → chunk-LAN7U3AK.js} +1 -2
- package/dist/{chunk-WU6XXL3D.js → chunk-LLDLVVG4.js} +4 -5
- package/dist/{chunk-M3QDKKDF.js → chunk-LWM346FW.js} +0 -1
- package/dist/{chunk-7DGXUAPV.js → chunk-M25QJBDN.js} +4 -5
- package/dist/{chunk-7JLWZXPA.js → chunk-NDJO56BB.js} +3 -4
- package/dist/{chunk-AS3HR7AS.js → chunk-OBF6BIA2.js} +1 -2
- package/dist/{chunk-KIYUUSPK.js → chunk-OSPQFWQF.js} +2 -3
- package/dist/{chunk-4CEW64HO.js → chunk-OU2SW4U5.js} +3 -4
- package/dist/{chunk-H4TJ7X4O.js → chunk-QU6GQ657.js} +2 -3
- package/dist/{chunk-KFFETUAL.js → chunk-RR3XNDKG.js} +2 -3
- package/dist/{chunk-JVADRLWX.js → chunk-SHZZ2QRV.js} +2 -3
- package/dist/{chunk-7W3KY55G.js → chunk-TK3AXXXI.js} +3 -4
- package/dist/{chunk-OPZ2LVS2.js → chunk-TZQQYJYK.js} +0 -1
- package/dist/{chunk-7JJEIADR.js → chunk-UF7QPYUX.js} +299 -157
- package/dist/{chunk-NQPYMUDF.js → chunk-UKGBQTHL.js} +3 -4
- package/dist/{chunk-5XPPLTC7.js → chunk-UUMH3DC3.js} +1 -2
- package/dist/{chunk-TBUKJKY6.js → chunk-VJ3UA6OD.js} +1 -2
- package/dist/{chunk-OHCPV2NT.js → chunk-WHKPWIQO.js} +0 -1
- package/dist/{chunk-EZNCCO4L.js → chunk-YDLO5M7S.js} +0 -1
- package/dist/{components-BmievOxF.d.ts → components-JZQoO2sU.d.ts} +1 -1
- package/dist/cooldown.d.ts +1 -1
- package/dist/cooldown.js +3 -4
- package/dist/coordinators/boundary-ricochet-3d.d.ts +2 -2
- package/dist/coordinators/boundary-ricochet-3d.js +4 -5
- package/dist/coordinators/boundary-ricochet.d.ts +2 -2
- package/dist/coordinators/boundary-ricochet.js +4 -5
- package/dist/coordinators/first-person-shooter.js +4 -5
- package/dist/coordinators/multidirectional-space-shooter.d.ts +1 -1
- package/dist/coordinators/multidirectional-space-shooter.js +6 -7
- package/dist/coordinators/top-down-shooter.d.ts +1 -1
- package/dist/coordinators/top-down-shooter.js +6 -7
- package/dist/core.d.ts +21 -6
- package/dist/core.js +29 -7
- package/dist/destructible-3d.d.ts +1 -1
- package/dist/destructible-3d.js +4 -5
- package/dist/destructible-prebake.js +2 -3
- package/dist/{first-person-perspective-C9Mptl0-.d.ts → first-person-perspective-BxFHgFln.d.ts} +2 -0
- package/dist/first-person.d.ts +12 -3
- package/dist/first-person.js +7 -8
- package/dist/index.d.ts +5 -5
- package/dist/index.js +40 -41
- package/dist/jumper-2d.d.ts +1 -1
- package/dist/jumper-2d.js +5 -6
- package/dist/jumper-3d.d.ts +1 -1
- package/dist/jumper-3d.js +6 -7
- package/dist/{moveable-rdIvWiak.d.ts → moveable-BdFmI3s1.d.ts} +1 -1
- package/dist/particle-emitter/presets.d.ts +1 -1
- package/dist/particle-emitter/presets.js +2 -3
- package/dist/particle-emitter.d.ts +3 -3
- package/dist/particle-emitter.js +5 -6
- package/dist/platformer-2d.d.ts +1 -1
- package/dist/platformer-2d.js +5 -6
- package/dist/platformer-3d.d.ts +1 -1
- package/dist/platformer-3d.js +5 -6
- package/dist/ricochet-2d.d.ts +1 -1
- package/dist/ricochet-2d.js +5 -6
- package/dist/ricochet-3d.d.ts +1 -1
- package/dist/ricochet-3d.js +5 -6
- package/dist/runtime-2d.d.ts +1 -1
- package/dist/runtime-2d.js +2 -3
- package/dist/screen-visibility.d.ts +1 -1
- package/dist/screen-visibility.js +3 -4
- package/dist/screen-wrap.d.ts +1 -1
- package/dist/screen-wrap.js +5 -6
- package/dist/shooter-2d.d.ts +1 -1
- package/dist/shooter-2d.js +5 -6
- package/dist/{spark-Dx3cJbTW.d.ts → spark-C4Tp-52_.d.ts} +4 -2
- package/dist/thruster.d.ts +1 -1
- package/dist/thruster.js +5 -6
- package/dist/top-down-movement.d.ts +1 -1
- package/dist/top-down-movement.js +7 -8
- package/dist/world-boundary-2d.d.ts +1 -1
- package/dist/world-boundary-2d.js +6 -7
- package/dist/world-boundary-3d.d.ts +1 -1
- package/dist/world-boundary-3d.js +6 -7
- package/package.json +159 -161
- package/dist/chunk-2PAHQZZD.js.map +0 -1
- package/dist/chunk-4CEW64HO.js.map +0 -1
- package/dist/chunk-4LLK2FJI.js.map +0 -1
- package/dist/chunk-4MZ57HPD.js.map +0 -1
- package/dist/chunk-4WH2ZN7P.js.map +0 -1
- package/dist/chunk-52FJIDGL.js.map +0 -1
- package/dist/chunk-5A5AYP2C.js.map +0 -1
- package/dist/chunk-5WRI5ZAA.js.map +0 -1
- package/dist/chunk-5XPPLTC7.js.map +0 -1
- package/dist/chunk-7DGXUAPV.js.map +0 -1
- package/dist/chunk-7JJEIADR.js.map +0 -1
- package/dist/chunk-7JLWZXPA.js.map +0 -1
- package/dist/chunk-7W3KY55G.js.map +0 -1
- package/dist/chunk-AS3HR7AS.js.map +0 -1
- package/dist/chunk-BAXJ7XHJ.js.map +0 -1
- package/dist/chunk-DZ4LLQON.js.map +0 -1
- package/dist/chunk-EIWQM6U3.js.map +0 -1
- package/dist/chunk-EZNCCO4L.js.map +0 -1
- package/dist/chunk-G2KUXVU6.js.map +0 -1
- package/dist/chunk-H4TJ7X4O.js.map +0 -1
- package/dist/chunk-HZMY3TT4.js.map +0 -1
- package/dist/chunk-IZJFUAXB.js.map +0 -1
- package/dist/chunk-JVADRLWX.js.map +0 -1
- package/dist/chunk-KFFETUAL.js.map +0 -1
- package/dist/chunk-KIYUUSPK.js.map +0 -1
- package/dist/chunk-LL4FLHIY.js.map +0 -1
- package/dist/chunk-LZIHSJZR.js.map +0 -1
- package/dist/chunk-M3QDKKDF.js.map +0 -1
- package/dist/chunk-NQPYMUDF.js.map +0 -1
- package/dist/chunk-NW4SE5XW.js.map +0 -1
- package/dist/chunk-OHCPV2NT.js.map +0 -1
- package/dist/chunk-OPZ2LVS2.js.map +0 -1
- package/dist/chunk-PLIXVF7B.js.map +0 -1
- package/dist/chunk-QS3VXWVO.js.map +0 -1
- package/dist/chunk-QVCMJ4Q2.js.map +0 -1
- package/dist/chunk-SGHIGTVZ.js.map +0 -1
- package/dist/chunk-TBUKJKY6.js.map +0 -1
- package/dist/chunk-WOMHL23C.js.map +0 -1
- package/dist/chunk-WU6XXL3D.js.map +0 -1
- package/dist/chunk-Y4PHT2HG.js.map +0 -1
- package/dist/cooldown.js.map +0 -1
- package/dist/coordinators/boundary-ricochet-3d.js.map +0 -1
- package/dist/coordinators/boundary-ricochet.js.map +0 -1
- package/dist/coordinators/first-person-shooter.js.map +0 -1
- package/dist/coordinators/multidirectional-space-shooter.js.map +0 -1
- package/dist/coordinators/top-down-shooter.js.map +0 -1
- package/dist/core.js.map +0 -1
- package/dist/destructible-3d.js.map +0 -1
- package/dist/destructible-prebake.js.map +0 -1
- package/dist/first-person.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/jumper-2d.js.map +0 -1
- package/dist/jumper-3d.js.map +0 -1
- package/dist/particle-emitter/presets.js.map +0 -1
- package/dist/particle-emitter.js.map +0 -1
- package/dist/platformer-2d.js.map +0 -1
- package/dist/platformer-3d.js.map +0 -1
- package/dist/ricochet-2d.js.map +0 -1
- package/dist/ricochet-3d.js.map +0 -1
- package/dist/runtime-2d.js.map +0 -1
- package/dist/screen-visibility.js.map +0 -1
- package/dist/screen-wrap.js.map +0 -1
- package/dist/shooter-2d.js.map +0 -1
- package/dist/thruster.js.map +0 -1
- package/dist/top-down-movement.js.map +0 -1
- package/dist/world-boundary-2d.js.map +0 -1
- package/dist/world-boundary-3d.js.map +0 -1
|
@@ -542,13 +542,16 @@ interface StageEvent {
|
|
|
542
542
|
* Mirrors the `STAGE_RENDER_STRIDE` (12-float) packing documented in
|
|
543
543
|
* `runtime/stage/render.rs`:
|
|
544
544
|
* `[0..3]` position, `[3..7]` rotation xyzw, `[7]` uniform scale,
|
|
545
|
-
* `[8..
|
|
545
|
+
* `[8..11]` custom0..custom2 (shading hints), `[11]` custom3 sleeping flag
|
|
546
|
+
* (1.0 = sleeping).
|
|
546
547
|
*/
|
|
547
548
|
interface StageRenderSlot {
|
|
548
549
|
position: [number, number, number];
|
|
549
550
|
rotation: [number, number, number, number];
|
|
550
551
|
scale: number;
|
|
551
552
|
custom: [number, number, number, number];
|
|
553
|
+
/** True when custom[3] indicates the body is sleeping. */
|
|
554
|
+
isSleeping: boolean;
|
|
552
555
|
}
|
|
553
556
|
/**
|
|
554
557
|
* Read a single entity slot out of a unified-Stage render buffer view.
|
|
@@ -666,6 +669,16 @@ declare class WasmStageRuntime implements BehaviorRuntime {
|
|
|
666
669
|
* fraction of `step()`.
|
|
667
670
|
*/
|
|
668
671
|
setEventsEnabled(enabled: boolean): void;
|
|
672
|
+
/** Cap Rapier contact solver iterations (default 4). */
|
|
673
|
+
setSolverIterations(iterations: number): void;
|
|
674
|
+
/**
|
|
675
|
+
* Override sleep activation thresholds for sleep-capable dynamic bodies.
|
|
676
|
+
* Higher velocity thresholds / lower `timeUntilSleep` put piles to sleep
|
|
677
|
+
* sooner.
|
|
678
|
+
*/
|
|
679
|
+
setSleepThresholds(normalizedLinearThreshold: number, angularThreshold: number, timeUntilSleep: number): void;
|
|
680
|
+
/** Number of awake (non-sleeping) dynamic rigid bodies. */
|
|
681
|
+
awakeDynamicCount(): number;
|
|
669
682
|
createEntity(): number;
|
|
670
683
|
destroyEntity(slot: number): boolean;
|
|
671
684
|
attachBody(slot: number, config: StageBodyConfig): boolean;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SyncStateMachine,
|
|
3
3
|
import_typescript_fsm
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-OBF6BIA2.js";
|
|
5
5
|
import {
|
|
6
6
|
STAGE_INPUT_BUTTON_JUMP,
|
|
7
7
|
STAGE_INPUT_BUTTON_RUN,
|
|
8
8
|
StagePlatformerShapeSource,
|
|
9
9
|
readBehaviorSnapshot
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-GZ3DQIIZ.js";
|
|
11
11
|
import {
|
|
12
12
|
defineBehavior
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-YDLO5M7S.js";
|
|
14
14
|
|
|
15
15
|
// src/lib/behaviors/platformer-3d/components.ts
|
|
16
16
|
function createPlatformer3DMovementComponent(options = {}) {
|
|
@@ -341,4 +341,3 @@ export {
|
|
|
341
341
|
Platformer3DFSM,
|
|
342
342
|
Platformer3DBehavior
|
|
343
343
|
};
|
|
344
|
-
//# sourceMappingURL=chunk-4LLK2FJI.js.map
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SyncStateMachine,
|
|
3
3
|
import_typescript_fsm
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-OBF6BIA2.js";
|
|
5
5
|
import {
|
|
6
6
|
STAGE_INPUT_BUTTON_JUMP,
|
|
7
7
|
STAGE_INPUT_BUTTON_RUN,
|
|
8
8
|
StagePlatformerShapeSource,
|
|
9
9
|
readBehaviorSnapshot
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-GZ3DQIIZ.js";
|
|
11
11
|
import {
|
|
12
12
|
defineBehavior
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-YDLO5M7S.js";
|
|
14
14
|
|
|
15
15
|
// src/lib/behaviors/platformer-2d/components.ts
|
|
16
16
|
function createPlatformer2DMovementComponent(options = {}) {
|
|
@@ -320,4 +320,3 @@ export {
|
|
|
320
320
|
Platformer2DFSM,
|
|
321
321
|
Platformer2DBehavior
|
|
322
322
|
};
|
|
323
|
-
//# sourceMappingURL=chunk-4MZ57HPD.js.map
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SyncStateMachine,
|
|
3
3
|
import_typescript_fsm
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-OBF6BIA2.js";
|
|
5
5
|
import {
|
|
6
6
|
StageRicochetDim,
|
|
7
7
|
StageRicochetReflection
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-GZ3DQIIZ.js";
|
|
9
9
|
import {
|
|
10
10
|
defineBehavior
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-YDLO5M7S.js";
|
|
12
12
|
|
|
13
13
|
// src/lib/behaviors/ricochet-3d/ricochet-3d-fsm.ts
|
|
14
14
|
var Ricochet3DState = /* @__PURE__ */ ((Ricochet3DState2) => {
|
|
@@ -437,4 +437,3 @@ export {
|
|
|
437
437
|
Ricochet3DFSM,
|
|
438
438
|
Ricochet3DBehavior
|
|
439
439
|
};
|
|
440
|
-
//# sourceMappingURL=chunk-QS3VXWVO.js.map
|
|
@@ -2,16 +2,16 @@ import {
|
|
|
2
2
|
createTopDownMovementComponent,
|
|
3
3
|
createTopDownMovementInputComponent,
|
|
4
4
|
createTopDownMovementStateComponent
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-2HKY6WF7.js";
|
|
6
6
|
import {
|
|
7
7
|
resolveAim2D
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-VJ3UA6OD.js";
|
|
9
9
|
import {
|
|
10
10
|
StageTopDownPlane
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-GZ3DQIIZ.js";
|
|
12
12
|
import {
|
|
13
13
|
defineBehavior
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-YDLO5M7S.js";
|
|
15
15
|
|
|
16
16
|
// src/lib/behaviors/top-down-movement/top-down-movement.descriptor.ts
|
|
17
17
|
var defaultOptions = {
|
|
@@ -95,4 +95,3 @@ var TopDownMovementBehavior = defineBehavior({
|
|
|
95
95
|
export {
|
|
96
96
|
TopDownMovementBehavior
|
|
97
97
|
};
|
|
98
|
-
//# sourceMappingURL=chunk-Y4PHT2HG.js.map
|
|
@@ -4,13 +4,13 @@ import {
|
|
|
4
4
|
getRotationAngle2D,
|
|
5
5
|
normalizeDirection2D,
|
|
6
6
|
rotateLocalOffset2D
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-3X3CL24Z.js";
|
|
8
8
|
import {
|
|
9
9
|
normalizeVec3
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-LWM346FW.js";
|
|
11
11
|
import {
|
|
12
12
|
defineBehavior
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-YDLO5M7S.js";
|
|
14
14
|
|
|
15
15
|
// src/lib/behaviors/shooter-2d/components.ts
|
|
16
16
|
function createShooter2DStateComponent() {
|
|
@@ -159,4 +159,3 @@ export {
|
|
|
159
159
|
createShooter2DStateComponent,
|
|
160
160
|
Shooter2DBehavior
|
|
161
161
|
};
|
|
162
|
-
//# sourceMappingURL=chunk-PLIXVF7B.js.map
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createJumpInput3D
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-F7E23E26.js";
|
|
4
4
|
import {
|
|
5
5
|
SyncStateMachine,
|
|
6
6
|
import_typescript_fsm
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-OBF6BIA2.js";
|
|
8
8
|
import {
|
|
9
9
|
STAGE_INPUT_BUTTON_JUMP,
|
|
10
10
|
readBehaviorSnapshot
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-GZ3DQIIZ.js";
|
|
12
12
|
import {
|
|
13
13
|
defineBehavior
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-YDLO5M7S.js";
|
|
15
15
|
|
|
16
16
|
// src/lib/behaviors/jumper-3d/jumper-3d-fsm.ts
|
|
17
17
|
var Jumper3DState = /* @__PURE__ */ ((Jumper3DState2) => {
|
|
@@ -188,4 +188,3 @@ export {
|
|
|
188
188
|
Jumper3DFSM,
|
|
189
189
|
Jumper3DBehavior
|
|
190
190
|
};
|
|
191
|
-
//# sourceMappingURL=chunk-LZIHSJZR.js.map
|
|
@@ -2,22 +2,22 @@ import {
|
|
|
2
2
|
createFirstPersonInputComponent,
|
|
3
3
|
createFirstPersonMovementComponent,
|
|
4
4
|
createFirstPersonStateComponent
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-4EWASZHB.js";
|
|
6
6
|
import {
|
|
7
7
|
VEC3_ZERO,
|
|
8
8
|
toThreeVector3
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-LWM346FW.js";
|
|
10
10
|
import {
|
|
11
11
|
SyncStateMachine,
|
|
12
12
|
import_typescript_fsm
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-OBF6BIA2.js";
|
|
14
14
|
import {
|
|
15
15
|
STAGE_INPUT_BUTTON_RUN,
|
|
16
16
|
readBehaviorSnapshot
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-GZ3DQIIZ.js";
|
|
18
18
|
import {
|
|
19
19
|
defineBehavior
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-YDLO5M7S.js";
|
|
21
21
|
|
|
22
22
|
// src/lib/behaviors/first-person/first-person-fsm.ts
|
|
23
23
|
var FirstPersonState = /* @__PURE__ */ ((FirstPersonState2) => {
|
|
@@ -146,28 +146,45 @@ var FirstPersonPresentation = class {
|
|
|
146
146
|
);
|
|
147
147
|
}
|
|
148
148
|
const vm = this.viewmodels.get(entityUuid);
|
|
149
|
-
if (vm && perspective?.initialPosition
|
|
149
|
+
if (vm && state && (vm.cameraObject || perspective?.initialPosition)) {
|
|
150
150
|
this.positionViewmodel(vm, perspective, state, runtime);
|
|
151
151
|
}
|
|
152
152
|
}
|
|
153
153
|
/**
|
|
154
154
|
* Position a viewmodel entity relative to the camera's eye position and rotation.
|
|
155
|
+
* Prefer `cameraObject` parenting for jitter-free follow during movement.
|
|
155
156
|
*/
|
|
156
157
|
positionViewmodel(vm, perspective, state, runtime) {
|
|
158
|
+
const entity = vm.entity;
|
|
159
|
+
const group = entity?.group;
|
|
160
|
+
if (vm.cameraObject && group) {
|
|
161
|
+
if (entity) {
|
|
162
|
+
entity.skipRenderPoseSync = true;
|
|
163
|
+
}
|
|
164
|
+
if (group.parent !== vm.cameraObject) {
|
|
165
|
+
vm.cameraObject.add(group);
|
|
166
|
+
}
|
|
167
|
+
group.position.copy(vm.offset);
|
|
168
|
+
if (vm.rotation) {
|
|
169
|
+
group.rotation.copy(vm.rotation);
|
|
170
|
+
} else {
|
|
171
|
+
group.rotation.set(0, 0, 0);
|
|
172
|
+
}
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
157
175
|
const eyePos = perspective.initialPosition;
|
|
158
176
|
if (!eyePos) return;
|
|
159
177
|
_viewmodelQuat.setFromEuler(
|
|
160
178
|
_viewmodelEuler.set(state.pitch, state.yaw, 0, "YXZ")
|
|
161
179
|
);
|
|
180
|
+
_offset.copy(vm.offset).applyQuaternion(_viewmodelQuat);
|
|
162
181
|
if (vm.rotation) {
|
|
163
182
|
_viewmodelLocalQuat.setFromEuler(vm.rotation);
|
|
164
183
|
_viewmodelQuat.multiply(_viewmodelLocalQuat);
|
|
165
184
|
}
|
|
166
|
-
_offset.copy(vm.offset).applyQuaternion(_viewmodelQuat);
|
|
167
185
|
const wx = eyePos.x + _offset.x;
|
|
168
186
|
const wy = eyePos.y + _offset.y;
|
|
169
187
|
const wz = eyePos.z + _offset.z;
|
|
170
|
-
const entity = vm.entity;
|
|
171
188
|
const handle = entity?.runtimeHandle ?? -1;
|
|
172
189
|
if (handle >= 0) {
|
|
173
190
|
runtime.setPosition(handle, wx, wy, wz);
|
|
@@ -179,9 +196,9 @@ var FirstPersonPresentation = class {
|
|
|
179
196
|
_viewmodelQuat.w
|
|
180
197
|
);
|
|
181
198
|
}
|
|
182
|
-
if (
|
|
183
|
-
|
|
184
|
-
|
|
199
|
+
if (group) {
|
|
200
|
+
group.position.set(wx, wy, wz);
|
|
201
|
+
group.quaternion.copy(_viewmodelQuat);
|
|
185
202
|
}
|
|
186
203
|
}
|
|
187
204
|
/** Cleanup */
|
|
@@ -227,6 +244,8 @@ var FirstPersonBehaviorSystem = class {
|
|
|
227
244
|
gameEntity.firstPersonState = createFirstPersonStateComponent();
|
|
228
245
|
}
|
|
229
246
|
if (options.perspective && !this.presentation.hasPerspective(gameEntity.uuid)) {
|
|
247
|
+
const eyeHeight = options.eyeHeight ?? defaultOptions.eyeHeight;
|
|
248
|
+
options.perspective.setEyeHeight?.(eyeHeight);
|
|
230
249
|
this.presentation.setPerspective(gameEntity.uuid, options.perspective);
|
|
231
250
|
}
|
|
232
251
|
if (options.viewmodel && !this.presentation.hasViewmodel(gameEntity.uuid)) {
|
|
@@ -301,4 +320,3 @@ export {
|
|
|
301
320
|
FirstPersonPresentation,
|
|
302
321
|
FirstPersonBehavior
|
|
303
322
|
};
|
|
304
|
-
//# sourceMappingURL=chunk-G2KUXVU6.js.map
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createBounds2DRect
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-TZQQYJYK.js";
|
|
4
4
|
import {
|
|
5
5
|
SyncStateMachine,
|
|
6
6
|
import_typescript_fsm
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-OBF6BIA2.js";
|
|
8
8
|
import {
|
|
9
9
|
defineBehavior
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-YDLO5M7S.js";
|
|
11
11
|
|
|
12
12
|
// src/lib/behaviors/screen-wrap/screen-wrap-fsm.ts
|
|
13
13
|
var ScreenWrapState = /* @__PURE__ */ ((ScreenWrapState2) => {
|
|
@@ -176,4 +176,3 @@ export {
|
|
|
176
176
|
ScreenWrapFSM,
|
|
177
177
|
ScreenWrapBehavior
|
|
178
178
|
};
|
|
179
|
-
//# sourceMappingURL=chunk-2PAHQZZD.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getBounds2DNormalFromHits
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-TZQQYJYK.js";
|
|
4
4
|
import {
|
|
5
5
|
updateBoundaryRicochet
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-2YF7J3H4.js";
|
|
7
7
|
|
|
8
8
|
// src/lib/coordinators/boundary-ricochet.coordinator.ts
|
|
9
9
|
var BoundaryRicochetCoordinator = class {
|
|
@@ -37,4 +37,3 @@ var BoundaryRicochetCoordinator = class {
|
|
|
37
37
|
export {
|
|
38
38
|
BoundaryRicochetCoordinator
|
|
39
39
|
};
|
|
40
|
-
//# sourceMappingURL=chunk-NW4SE5XW.js.map
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createThrusterInputComponent,
|
|
3
3
|
createThrusterMovementComponent
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-2HLZBWGD.js";
|
|
5
5
|
import {
|
|
6
6
|
SyncStateMachine,
|
|
7
7
|
import_typescript_fsm
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-OBF6BIA2.js";
|
|
9
9
|
import {
|
|
10
10
|
defineBehavior
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-YDLO5M7S.js";
|
|
12
12
|
|
|
13
13
|
// src/lib/behaviors/thruster/thruster-fsm.ts
|
|
14
14
|
var ThrusterState = /* @__PURE__ */ ((ThrusterState2) => {
|
|
@@ -152,4 +152,3 @@ export {
|
|
|
152
152
|
ThrusterFSM,
|
|
153
153
|
ThrusterBehavior
|
|
154
154
|
};
|
|
155
|
-
//# sourceMappingURL=chunk-BAXJ7XHJ.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
defineBehavior
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-YDLO5M7S.js";
|
|
4
4
|
|
|
5
5
|
// src/lib/behaviors/screen-visibility/screen-visibility.descriptor.ts
|
|
6
6
|
import {
|
|
@@ -366,4 +366,3 @@ export {
|
|
|
366
366
|
ScreenVisibilityFSM,
|
|
367
367
|
ScreenVisibilityBehavior
|
|
368
368
|
};
|
|
369
|
-
//# sourceMappingURL=chunk-WOMHL23C.js.map
|
|
@@ -62,7 +62,8 @@ function readStageRenderSlot(view, slot, out) {
|
|
|
62
62
|
position: [0, 0, 0],
|
|
63
63
|
rotation: [0, 0, 0, 1],
|
|
64
64
|
scale: 1,
|
|
65
|
-
custom: [0, 0, 0, 0]
|
|
65
|
+
custom: [0, 0, 0, 0],
|
|
66
|
+
isSleeping: false
|
|
66
67
|
};
|
|
67
68
|
result.position[0] = view[base];
|
|
68
69
|
result.position[1] = view[base + 1];
|
|
@@ -77,6 +78,7 @@ function readStageRenderSlot(view, slot, out) {
|
|
|
77
78
|
result.custom[1] = view[base + 9];
|
|
78
79
|
result.custom[2] = view[base + 10];
|
|
79
80
|
result.custom[3] = view[base + 11];
|
|
81
|
+
result.isSleeping = result.custom[3] > 0.5;
|
|
80
82
|
return result;
|
|
81
83
|
}
|
|
82
84
|
var WasmStageRuntime = class {
|
|
@@ -158,6 +160,26 @@ var WasmStageRuntime = class {
|
|
|
158
160
|
setEventsEnabled(enabled) {
|
|
159
161
|
this.exports.zylem_stage_set_events_enabled(enabled ? 1 : 0);
|
|
160
162
|
}
|
|
163
|
+
/** Cap Rapier contact solver iterations (default 4). */
|
|
164
|
+
setSolverIterations(iterations) {
|
|
165
|
+
this.exports.zylem_stage_set_solver_iterations(Math.max(1, iterations | 0));
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Override sleep activation thresholds for sleep-capable dynamic bodies.
|
|
169
|
+
* Higher velocity thresholds / lower `timeUntilSleep` put piles to sleep
|
|
170
|
+
* sooner.
|
|
171
|
+
*/
|
|
172
|
+
setSleepThresholds(normalizedLinearThreshold, angularThreshold, timeUntilSleep) {
|
|
173
|
+
this.exports.zylem_stage_set_sleep_thresholds(
|
|
174
|
+
normalizedLinearThreshold,
|
|
175
|
+
angularThreshold,
|
|
176
|
+
timeUntilSleep
|
|
177
|
+
);
|
|
178
|
+
}
|
|
179
|
+
/** Number of awake (non-sleeping) dynamic rigid bodies. */
|
|
180
|
+
awakeDynamicCount() {
|
|
181
|
+
return this.exports.zylem_stage_awake_dynamic_count();
|
|
182
|
+
}
|
|
161
183
|
// ─── Entity lifecycle ───────────────────────────────────────────────
|
|
162
184
|
createEntity() {
|
|
163
185
|
const slot = this.exports.zylem_stage_create_entity() >>> 0;
|
|
@@ -864,4 +886,3 @@ export {
|
|
|
864
886
|
WasmStageRuntime,
|
|
865
887
|
createWasmStageRuntime
|
|
866
888
|
};
|
|
867
|
-
//# sourceMappingURL=chunk-DZ4LLQON.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getEntityFacingAngle2D,
|
|
3
3
|
resolveAim2D
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-VJ3UA6OD.js";
|
|
5
5
|
|
|
6
6
|
// src/lib/coordinators/shared/shooter-fire.ts
|
|
7
7
|
function fireShooter2DIfRequested(entity, shooter, stage, input, aim) {
|
|
@@ -27,4 +27,3 @@ function fireShooter2DIfRequested(entity, shooter, stage, input, aim) {
|
|
|
27
27
|
export {
|
|
28
28
|
fireShooter2DIfRequested
|
|
29
29
|
};
|
|
30
|
-
//# sourceMappingURL=chunk-52FJIDGL.js.map
|
|
@@ -4,17 +4,17 @@ import {
|
|
|
4
4
|
constrainMovementToBounds3D,
|
|
5
5
|
hasAnyBounds3DHit,
|
|
6
6
|
insetBounds3D
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-WHKPWIQO.js";
|
|
8
8
|
import {
|
|
9
9
|
SyncStateMachine,
|
|
10
10
|
import_typescript_fsm
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-OBF6BIA2.js";
|
|
12
12
|
import {
|
|
13
13
|
StageBoundaryDim
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-GZ3DQIIZ.js";
|
|
15
15
|
import {
|
|
16
16
|
defineBehavior
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-YDLO5M7S.js";
|
|
18
18
|
|
|
19
19
|
// src/lib/behaviors/world-boundary-3d/world-boundary-3d-fsm.ts
|
|
20
20
|
var WorldBoundary3DState = /* @__PURE__ */ ((WorldBoundary3DState2) => {
|
|
@@ -198,4 +198,3 @@ export {
|
|
|
198
198
|
WorldBoundary3DFSM,
|
|
199
199
|
WorldBoundary3DBehavior
|
|
200
200
|
};
|
|
201
|
-
//# sourceMappingURL=chunk-WU6XXL3D.js.map
|
|
@@ -2,17 +2,17 @@ import {
|
|
|
2
2
|
computeBounds2DHits,
|
|
3
3
|
constrainMovementToBounds2D,
|
|
4
4
|
hasAnyBounds2DHit
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-TZQQYJYK.js";
|
|
6
6
|
import {
|
|
7
7
|
SyncStateMachine,
|
|
8
8
|
import_typescript_fsm
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-OBF6BIA2.js";
|
|
10
10
|
import {
|
|
11
11
|
StageBoundaryDim
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-GZ3DQIIZ.js";
|
|
13
13
|
import {
|
|
14
14
|
defineBehavior
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-YDLO5M7S.js";
|
|
16
16
|
|
|
17
17
|
// src/lib/behaviors/world-boundary-2d/world-boundary-2d-fsm.ts
|
|
18
18
|
var WorldBoundary2DState = /* @__PURE__ */ ((WorldBoundary2DState2) => {
|
|
@@ -190,4 +190,3 @@ export {
|
|
|
190
190
|
WorldBoundary2DFSM,
|
|
191
191
|
WorldBoundary2DBehavior
|
|
192
192
|
};
|
|
193
|
-
//# sourceMappingURL=chunk-7DGXUAPV.js.map
|
|
@@ -6,14 +6,14 @@ import {
|
|
|
6
6
|
magicPresets,
|
|
7
7
|
particleEffect,
|
|
8
8
|
waterPresets
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-UF7QPYUX.js";
|
|
10
10
|
import {
|
|
11
11
|
VEC3_ZERO,
|
|
12
12
|
normalizeVec3
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-LWM346FW.js";
|
|
14
14
|
import {
|
|
15
15
|
defineBehavior
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-YDLO5M7S.js";
|
|
17
17
|
|
|
18
18
|
// src/lib/behaviors/particle-emitter/particle-emitter.descriptor.ts
|
|
19
19
|
import { Group, Quaternion, Vector3 } from "three";
|
|
@@ -410,4 +410,3 @@ export {
|
|
|
410
410
|
ParticleEmitterBehavior,
|
|
411
411
|
particlePresets
|
|
412
412
|
};
|
|
413
|
-
//# sourceMappingURL=chunk-7JLWZXPA.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
__commonJS,
|
|
3
3
|
__toESM
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-JSBRDJBE.js";
|
|
5
5
|
|
|
6
6
|
// node_modules/.pnpm/typescript-fsm@1.6.0/node_modules/typescript-fsm/dist/stateMachine.js
|
|
7
7
|
var require_stateMachine = __commonJS({
|
|
@@ -185,4 +185,3 @@ export {
|
|
|
185
185
|
SyncStateMachine,
|
|
186
186
|
import_typescript_fsm2 as import_typescript_fsm
|
|
187
187
|
};
|
|
188
|
-
//# sourceMappingURL=chunk-AS3HR7AS.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
fireShooter2DIfRequested
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-LAN7U3AK.js";
|
|
4
4
|
import {
|
|
5
5
|
createTopDownMovementInputComponent
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-2HKY6WF7.js";
|
|
7
7
|
|
|
8
8
|
// src/lib/coordinators/top-down-shooter.coordinator.ts
|
|
9
9
|
var TopDownShooterCoordinator = class {
|
|
@@ -30,4 +30,3 @@ var TopDownShooterCoordinator = class {
|
|
|
30
30
|
export {
|
|
31
31
|
TopDownShooterCoordinator
|
|
32
32
|
};
|
|
33
|
-
//# sourceMappingURL=chunk-KIYUUSPK.js.map
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SyncStateMachine,
|
|
3
3
|
import_typescript_fsm
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-OBF6BIA2.js";
|
|
5
5
|
import {
|
|
6
6
|
STAGE_INPUT_BUTTON_JUMP,
|
|
7
7
|
readBehaviorSnapshot
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-GZ3DQIIZ.js";
|
|
9
9
|
import {
|
|
10
10
|
defineBehavior
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-YDLO5M7S.js";
|
|
12
12
|
|
|
13
13
|
// src/lib/behaviors/jumper-2d/components.ts
|
|
14
14
|
function createJumpConfig2D(options = {}) {
|
|
@@ -207,4 +207,3 @@ export {
|
|
|
207
207
|
Jumper2DFSM,
|
|
208
208
|
Jumper2DBehavior
|
|
209
209
|
};
|
|
210
|
-
//# sourceMappingURL=chunk-4CEW64HO.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createFirstPersonInputComponent
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-4EWASZHB.js";
|
|
4
4
|
import {
|
|
5
5
|
createJumpInput3D
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-F7E23E26.js";
|
|
7
7
|
|
|
8
8
|
// src/lib/coordinators/first-person-shooter.coordinator.ts
|
|
9
9
|
var FirstPersonShooterCoordinator = class {
|
|
@@ -61,4 +61,3 @@ var FirstPersonShooterCoordinator = class {
|
|
|
61
61
|
export {
|
|
62
62
|
FirstPersonShooterCoordinator
|
|
63
63
|
};
|
|
64
|
-
//# sourceMappingURL=chunk-H4TJ7X4O.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getBounds3DNormalFromHits
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-WHKPWIQO.js";
|
|
4
4
|
import {
|
|
5
5
|
updateBoundaryRicochet
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-2YF7J3H4.js";
|
|
7
7
|
|
|
8
8
|
// src/lib/coordinators/boundary-ricochet-3d.coordinator.ts
|
|
9
9
|
var BoundaryRicochet3DCoordinator = class {
|
|
@@ -37,4 +37,3 @@ var BoundaryRicochet3DCoordinator = class {
|
|
|
37
37
|
export {
|
|
38
38
|
BoundaryRicochet3DCoordinator
|
|
39
39
|
};
|
|
40
|
-
//# sourceMappingURL=chunk-KFFETUAL.js.map
|