@adatechnology/game-player 0.13.5 → 0.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -109,6 +109,18 @@ The walk with the piece speeds up and brakes like a person's (`accel`: the force
109
109
 
110
110
  `createDoorUse(rules?)` is the logic of working a door, lid or drawer by hand: `begin({ opening, massKg, locked })` answers where the leaf goes (1 open, 0 closed; a second `begin` in the middle of a swing turns it round) or null for a locked leaf, which only rattles. `step(dt, isFree, hand?)` then goes through `reach` (the hand to the handle), `swing` (the leaf follows the hand, a little at a time so it stops at the first thing in its way, `block: 'obstacle'`) and `release`. The player does not follow the leaf: when `hand.reaches()` says the handle left the arm (`DOOR_ARM_REACH` from the shoulder), a leaf that goes away gets a shove (`push`, `hand.pull` false) and one that comes toward the body is let go (`release`), and the leaf finishes on its own to its goal. A heavier leaf swings slower (`swingSecondsFor`); every number is in `DoorUseRules` (`DOOR_USE_DEFAULTS`).
111
111
 
112
+ ## Getting into a vehicle and driving it
113
+
114
+ `createVehicleBoarding(ports)` is the body getting into a vehicle and out of it: the hand to the door's handle, the door open, the body seated, the door
115
+ pulled shut, and only then `driving`; `leave()` runs it backwards (the door opened from the seat, the body up at the sill, the door shut from outside). A
116
+ locked door is only shaken (`refused`), a hand that cannot get to the handle grips nothing, an exit with nowhere to stand brings the door back shut, and a
117
+ vehicle without a door is sat on and got off. `takeSeat()` puts the body at the seat without the door. The host owns the door, the seat and the hand
118
+ (`VehicleBoardingPorts`).
119
+
120
+ `createDrivingHands()` is the driver's hands: both on the rim, going round with the wheel; the hand that goes down the rim lets go first and takes it again
121
+ ahead of its place, the other after it, never both off the wheel; `shift(hand)` sends the hand on the lever's side to the knob, moves the lever
122
+ (`leverThrow`) and brings it back. Angles on the rim and shares of the way to the lever: the host turns them into places in its world.
123
+
112
124
  ## The hands and the weapon
113
125
 
114
126
  `planHands({ hands, weapons: { R, L }, slots })` is the owner's rule (2026-11-24): an interaction of one hand (a small thing picked up, a door, a switch) takes the free hand, not the
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { a as PlayerCollider, b as PlayerController, c as PlayerMessageId, K as KnownDeathCause } from './player-D2QiWWBg.js';
2
2
  export { A as AttributeId, d as Attributes, B as BodyVitals, e as BodyVitalsOptions, f as BodyVitalsState, D as DeathCause, g as Derived, h as DerivedFormulas, i as DerivedId, I as InfectionRule, j as ItemEffect, k as ItemEffectResult, L as LinearFormula, M as MeleeItem, N as NEEDS_DEFAULTS, l as NeedsRules, m as NeedsState, n as Nourishment, o as PLAYER_DEFAULTS, P as Player, p as PlayerAction, q as PlayerCrowd, r as PlayerEvent, s as PlayerEventMap, t as PlayerEventName, u as PlayerInput, v as PlayerNumbers, w as PlayerOptions, x as PlayerSave, y as PlayerSoundId, z as PlayerState, C as PlayerWorld, V as VitalsBody, W as WoundRule, E as WoundTable, F as advanceNeeds, G as applyItemEffect, H as createBodyVitals, J as createNeedsState, O as createPlayer, Q as deriveVitals, R as drawWound, S as isStarving, T as needsHoursOf, U as nourish } from './player-D2QiWWBg.js';
3
3
  import { Vec3, CharacterId, PhysicsWorld, Layer, PhysicsServices } from '@adatechnology/game-physics';
4
- import { SurfaceId } from '@adatechnology/game-contracts';
4
+ import { SurfaceId, BodyGesture, Vec3 as Vec3$1, HandTargets } from '@adatechnology/game-contracts';
5
5
  export { PlayerTestModule, PlayerTestModuleOptions, createPlayerTestModule } from './testing.js';
6
6
 
7
7
  /** The part of the physics contract the player's body uses: any `PhysicsWorld` (or the loop's `SeamWorld`) has it. */
@@ -321,7 +321,18 @@ interface HandsRules {
321
321
  readonly maxKg: number;
322
322
  readonly maxLength: number;
323
323
  };
324
+ /**
325
+ * A thing with a carry handle (a bucket of water, a jerrycan, a toolbox) hangs from one hand by it up to `maxKg`, whatever its size. Optional, so rules written
326
+ * before it keep working: without it the default (`HANDS_BY_HANDLE`) holds.
327
+ */
328
+ readonly byHandle?: {
329
+ readonly maxKg: number;
330
+ };
324
331
  }
332
+ /** How much a hand carries by a handle when the rules say nothing of it: a 20 L jerrycan full, a bucket of water. */
333
+ declare const HANDS_BY_HANDLE: {
334
+ readonly maxKg: 25;
335
+ };
325
336
  declare const HANDS_DEFAULTS: HandsRules;
326
337
  /** The slot a weapon goes to when the body wears none of its own (or it is taken): a long gun with no sling goes across the back, a second handgun or knife into the belt. */
327
338
  declare const SLOT_FALLBACKS: Readonly<Record<string, readonly string[]>>;
@@ -359,10 +370,11 @@ interface PlanHandsParams {
359
370
  /** The slots tried when a weapon's own is not worn; default `SLOT_FALLBACKS`. */
360
371
  readonly fallbacks?: Readonly<Record<string, readonly string[]>>;
361
372
  }
362
- /** How many hands it takes to carry a thing of `massKg` and `size` (metres, any order). */
373
+ /** How many hands it takes to carry a thing of `massKg` and `size` (metres, any order); by its carry handle (`handle`), one up to `byHandle.maxKg`. */
363
374
  declare function interactionHandsFor(thing: {
364
375
  readonly massKg: number;
365
376
  readonly size?: readonly number[];
377
+ readonly handle?: boolean;
366
378
  }, rules?: HandsRules): 1 | 2;
367
379
  /** Which hand acts and what happens to each weapon in the way. */
368
380
  declare function planHands(params: PlanHandsParams): HandsPlan;
@@ -451,9 +463,16 @@ interface ItemGrip {
451
463
  readonly local: Pose;
452
464
  /** How closed the fingers are on it (`HandTargets.grip`). */
453
465
  readonly grip: number;
466
+ /** The hand holds it by a carry handle (a bucket's bail) and it hangs under the hand, upright: carried with the arm down at the side, not in front of the chest. */
467
+ readonly hanging?: boolean;
454
468
  }
455
- /** The grip of a hand on a thing of box `size` (its own frame, metres). */
456
- declare function gripOfItem(size: readonly number[], hand: BodyHand): ItemGrip;
469
+ /**
470
+ * The grip of a hand on the carry handle of a thing (a bucket's bail, a jerrycan's or a toolbox's handle), `handle` the middle of the handle in the thing's own frame (metres from its
471
+ * middle): the fist closes round the handle, the thing upright (its +y up, along the thumb) and hanging under the hand, its handle along the fingers.
472
+ */
473
+ declare function gripOnHandle(handle: readonly number[], hand: BodyHand): ItemGrip;
474
+ /** The grip of a hand on a thing of box `size` (its own frame, metres); by its carry handle when it has one (`gripOnHandle`). */
475
+ declare function gripOfItem(size: readonly number[], hand: BodyHand, handle?: readonly number[] | null): ItemGrip;
457
476
  /** Where the thing is with the hand at `hand` holding it by `grip`. */
458
477
  declare function itemPoseInHand(hand: Pose, grip: ItemGrip): Pose;
459
478
  /** Where the hand goes to take the thing where it lies (`item`, its middle and turn) by `grip`. */
@@ -541,4 +560,268 @@ declare const STEP_POSE_DEFAULTS: {
541
560
  };
542
561
  declare function createStepPose(start: StepPosition, options?: StepPoseOptions): StepPose;
543
562
 
544
- export { BELT_SLOT, type BodyHand, DOOR_ARM_REACH, DOOR_SHOULDER_HEIGHT, DOOR_USE_DEFAULTS, type DoorUse, type DoorUseBlock, type DoorUseHand, type DoorUsePhase, type DoorUseRules, type DoorUseStep, type DoorUseTarget, type DragMark, FURNITURE_PUSH_DEFAULTS, type FurniturePush, type FurniturePushBlock, type FurniturePushInput, type FurniturePushLoad, type FurniturePushPhase, type FurniturePushRules, type FurniturePushStep, type FurniturePushTarget, HANDS_DEFAULTS, HANDS_TIMING, type HandWeapon, type HandsMove, type HandsMoveKind, type HandsPlan, type HandsRules, type HandsTiming, ITEM_GRIP, type ItemGrip, KnownDeathCause, LIFT_DEFAULTS, type LiftCheck, type LiftRules, type LiftVerdict, PLAYER_MASS_KG, PLAYER_PUSH_STRENGTH_NEWTONS, PLAYER_TEXT, PLAYER_WALK_PUSH_NEWTONS, type PhysicsControllerOptions, type PhysicsPlayerController, type PlanHandsParams, PlayerCollider, PlayerController, PlayerMessageId, type PlayerPhysicsWorld, type PlayerText, type Pose, type QuatTuple, SLING_SLOT, SLOT_FALLBACKS, STEP_POSE_DEFAULTS, type StepPose, type StepPoseOptions, type StepPosition, type TakeProgress, type TakeSequence, type TakeStep, type TakeStepKind, type TakeTimeline, type Vec3Tuple, WALKER_JUMP_SPEED, type Walker, type WalkerOptions, type WalkerServices, type WalkerStance, blendPoses, canPush, composePose, conjugateQuaternion, createDoorUse, createFurniturePush, createPhysicsController, createRng, createStepPose, createTakeTimeline, createWalker, dragMarkFor, drawBackOf, easeInOut, footRestHeight, frictionFor, gripOfItem, gripSecondsFor, handPoseOnItem, interactionHandsFor, itemPoseInHand, liftCheckFor, multiplyQuaternions, planDrawSequence, planHands, planTakeSequence, playerTextOf, poseHolding, pushAccelerationFor, pushSpeedFor, quaternionOfBasis, rotateVector, slipsOnTop, swingSecondsFor };
563
+ /**
564
+ * Getting into a vehicle and out of it, as a body does it: the hand goes to the door's handle, the door opens, the body sits, the hand on the door's side
565
+ * pulls the door shut; out, the same backwards (the door opened from inside, the body up at the sill, the door pushed shut). A locked door is only shaken.
566
+ * A vehicle without a door (a motorcycle, an open tractor) is sat on and got off. Engine-agnostic: the host owns the door, the seat and the hand
567
+ * (`VehicleBoardingPorts`); this says what happens next and when the driver is in.
568
+ */
569
+ /**
570
+ * `out` on its feet; `reach` the hand going to the handle; `refused` shaking a locked door; `open` the door swinging open; `sit` the body going to the seat;
571
+ * `shut` seated, pulling the door shut; `in` seated with the door shut (the driver drives); `unlatch` seated, pushing the door open; `stand` getting up at the
572
+ * sill; `close` on its feet, the hand shutting the door.
573
+ */
574
+ type VehicleBoardingPhase = 'out' | 'reach' | 'refused' | 'open' | 'sit' | 'shut' | 'in' | 'unlatch' | 'stand' | 'close';
575
+ type VehicleBoardingEvent = {
576
+ readonly type: 'in';
577
+ } | {
578
+ readonly type: 'out';
579
+ } | {
580
+ readonly type: 'refused';
581
+ readonly reason: 'locked' | 'no_seat' | 'blocked';
582
+ };
583
+ /** What the hand asks of the host at a door's outer handle: `pull` the door comes to the body (opening) or goes away (shutting); `onGrip` once the hand is on it. */
584
+ interface VehicleHandleReach {
585
+ readonly pull: boolean;
586
+ readonly locked: boolean;
587
+ onGrip(): void;
588
+ /** The body could not get to the handle: nothing was gripped. */
589
+ onMiss(): void;
590
+ }
591
+ interface VehicleBoardingPorts {
592
+ /** The seat is entered by a door (false: sat on from outside, as a motorcycle). */
593
+ readonly hasDoor: boolean;
594
+ doorLocked(): boolean;
595
+ /** 0 shut to 1 open. */
596
+ doorOpenness(): number;
597
+ /** Starts the door swinging to open (true) or shut (false). */
598
+ swingDoor(open: boolean): void;
599
+ /** Sends the hand to the outer handle; a host without a hand calls `onGrip` at once. */
600
+ reachHandle(reach: VehicleHandleReach): void;
601
+ /** Starts the body sitting down on the seat; false when it cannot. */
602
+ sit(): boolean;
603
+ /** Starts the body getting up at the seat's exit; false when the exit is blocked. */
604
+ stand(): boolean;
605
+ /** How far into the seat the body is: 0 on its feet, 1 seated. */
606
+ seated(): number;
607
+ }
608
+ interface VehicleBoardingRules {
609
+ /** How long a locked door is shaken before the hand gives up, seconds. */
610
+ readonly rattleSeconds: number;
611
+ /** Within this of shut or open the door counts as there. */
612
+ readonly endTolerance: number;
613
+ }
614
+ declare const VEHICLE_BOARDING_DEFAULTS: VehicleBoardingRules;
615
+ interface VehicleBoarding {
616
+ readonly phase: VehicleBoardingPhase;
617
+ /** The driver is seated with the door shut: the controls are the driver's. */
618
+ readonly driving: boolean;
619
+ /** The hand on the door's side is on the door's inner pull (shutting it from the seat, or opening it to get out). */
620
+ readonly handOnDoor: boolean;
621
+ /** Starts getting in; false when not on its feet outside. */
622
+ enter(): boolean;
623
+ /**
624
+ * Sits without going to the door: the body is put at the seat (a bench's shortcut, a driver who starts inside, a door the body has no clear way to).
625
+ * False when not on its feet outside or the seat refuses.
626
+ */
627
+ takeSeat(): boolean;
628
+ /** Starts getting out; false when not driving. */
629
+ leave(): boolean;
630
+ /** The body left the seat by another way (the host got it up, the seat is gone): on its feet, the door as it is. */
631
+ dropped(): void;
632
+ update(dt: number): VehicleBoardingEvent[];
633
+ }
634
+ declare function createVehicleBoarding(ports: VehicleBoardingPorts, rules?: Partial<VehicleBoardingRules>): VehicleBoarding;
635
+
636
+ /**
637
+ * The hands of a driver: both on the rim of the steering wheel, turning with it; a hand carried too far round lets go, comes back to its own side and holds
638
+ * again (one hand at a time, the other keeps the wheel); to change gear the hand on the lever's side leaves the rim, takes the knob, moves it and comes back.
639
+ * Engine-agnostic: the host gives the wheel's turn and says when a gear changes; this says where each hand is, as angles on the rim and shares of the way to
640
+ * the lever, and the host turns that into places in its world.
641
+ */
642
+ interface DrivingHandsRules {
643
+ /** A hand carried this far round from its own place lets go to hold again, radians (a quarter turn and a little). */
644
+ readonly regripAt: number;
645
+ /** The hand on the side the wheel turns to goes down the rim and lets go sooner, radians: it is the one that reaches back up for more wheel. */
646
+ readonly firstAt: number;
647
+ /** While the wheel keeps turning, a hand takes the rim again this far before its own place, radians, so it has wheel to pull. */
648
+ readonly lead: number;
649
+ /** Under this the wheel is held still, radians a second: a hand left off its own place goes back to it. */
650
+ readonly stillRate: number;
651
+ /** A hand at rest this far from its own place goes back to it, radians. */
652
+ readonly settleAt: number;
653
+ /** Past this a hand cannot stay on the rim whatever the other one does, radians. */
654
+ readonly reachLimit: number;
655
+ /** Letting go, coming back and holding again, seconds. */
656
+ readonly regripSeconds: number;
657
+ /** The hand from the rim to the knob, and back, seconds each way. */
658
+ readonly leverReachSeconds: number;
659
+ /** The hand on the knob while the lever moves, seconds. */
660
+ readonly leverHoldSeconds: number;
661
+ }
662
+ declare const DRIVING_HANDS_DEFAULTS: DrivingHandsRules;
663
+ interface DrivingHand {
664
+ /** Where on the rim the hand is, radians from its own place at rest, the way the wheel turns (positive to the left). */
665
+ readonly at: number;
666
+ /** 1 holding the rim, down to 0 off it (coming back to hold again, or gone to the lever). */
667
+ readonly hold: number;
668
+ /** Share of the way from the rim to the gear lever's knob, 0 on the rim to 1 on the knob. */
669
+ readonly toLever: number;
670
+ }
671
+ interface DrivingHands {
672
+ readonly left: DrivingHand;
673
+ readonly right: DrivingHand;
674
+ /** Share of the lever's throw done in the gear change going on, 0 before the hand moves it to 1 moved; 1 when no change is going on. */
675
+ readonly leverThrow: number;
676
+ /** A gear change starts: `hand` the hand on the lever's side. Ignored while one is going on. */
677
+ shift(hand: 'left' | 'right'): void;
678
+ /** `wheel`: the steering wheel's turn now, radians, positive to the left. */
679
+ update(dt: number, wheel: number): void;
680
+ /** Both hands back on the rim at rest (the driver got in). */
681
+ reset(wheel: number): void;
682
+ }
683
+ declare function createDrivingHands(rules?: Partial<DrivingHandsRules>): DrivingHands;
684
+
685
+ /**
686
+ * The body works a control with one hand (CLAUDE.md §18, owner 2026-11-30: every action has a body animation): the free hand `reach`es the point, does the `act` of the gesture
687
+ * (presses a button, turns a knob, flips a rocker, strikes a match, pours, lets go inside, tips over, closes on the thing to stow it, holds the paper up to read) and goes `back`.
688
+ * The thing reacts at the act's moment (`GestureProgress.acted`), so the TV goes on when the finger is on the button. One gesture serves every control of its kind: a press is
689
+ * the TV, the microwave and the radio alike. Pure and clock-free: the host advances it by its own frame's `dt`, says where the shoulder, the hand at rest and the point are,
690
+ * and puts the hand where `gestureHandPose` says.
691
+ */
692
+
693
+ type GesturePhase = 'reach' | 'act' | 'back';
694
+ interface GestureTiming {
695
+ readonly reach: number;
696
+ readonly back: number;
697
+ /** Seconds the act of each gesture takes. */
698
+ readonly act: Readonly<Record<BodyGesture, number>>;
699
+ }
700
+ declare const GESTURE_TIMING: GestureTiming;
701
+ /** How far a hand reaches from its shoulder, metres: a point farther than that is touched at the end of the arm, never with the arm stretched past it. */
702
+ declare const GESTURE_ARM_REACH = 0.62;
703
+ interface GestureProgress {
704
+ readonly phase: GesturePhase;
705
+ /** How far into the phase, 0..1, eased. */
706
+ readonly progress: number;
707
+ /** True on the advance during which the hand got to the act's moment: the host works the thing now. */
708
+ readonly acted: boolean;
709
+ readonly done: boolean;
710
+ }
711
+ interface GestureTimeline {
712
+ readonly gesture: BodyGesture;
713
+ readonly duration: number;
714
+ /** Moves it on by `dt` seconds (the host's frame). */
715
+ advance(dt: number): GestureProgress;
716
+ }
717
+ declare function createGestureTimeline(gesture: BodyGesture, timing?: GestureTiming): GestureTimeline;
718
+ /** The free hand: the weapon hand only when it holds nothing, else the off hand; null when both hold something (a pistol in one, a torch in the other). */
719
+ declare function freeHandOf(busy: {
720
+ readonly R: boolean;
721
+ readonly L: boolean;
722
+ }): BodyHand | null;
723
+ interface GestureHandChoice {
724
+ /** Whether each hand holds something (a weapon, a carried thing). */
725
+ readonly busy: {
726
+ readonly R: boolean;
727
+ readonly L: boolean;
728
+ };
729
+ readonly gesture: BodyGesture;
730
+ /** The hand that carries the thing a `put_in` or a `pour` is done with, null when none does. */
731
+ readonly carrying?: BodyHand | null;
732
+ }
733
+ /** The hand that works a control: the one that carries the thing for a gesture done with it, the free one for the rest; null when no hand can (the hands are full). */
734
+ declare function gestureHandOf(choice: GestureHandChoice): BodyHand | null;
735
+ interface GestureHandParams {
736
+ readonly gesture: BodyGesture;
737
+ readonly phase: GesturePhase;
738
+ readonly progress: number;
739
+ /** The hand that works (`gestureHandOf`): a left hand is turned the other way round, its thumb on the other side. */
740
+ readonly hand: BodyHand;
741
+ /** The shoulder of the hand that works, world space. */
742
+ readonly shoulder: Vec3Tuple;
743
+ /** Where the hand is when it does nothing of this (by the chest, or on the weapon's forend). */
744
+ readonly rest: Pose;
745
+ /** The point the hand works, world space. */
746
+ readonly at: Vec3Tuple;
747
+ /** The body's facing about the vertical (radians, 0 looks down -z): the way the hand goes when the point is right over the shoulder. */
748
+ readonly yaw: number;
749
+ }
750
+ interface GestureHand {
751
+ readonly pose: Pose;
752
+ /** How closed the fingers are, 0 open to 1 closed. */
753
+ readonly grip: number;
754
+ /** The index finger alone, 0 straight (a finger that presses) to 1 curled. */
755
+ readonly index: number;
756
+ }
757
+ /** The hand of a gesture now: its pose (world space, HandPose of game-contracts: +x to the knuckles, +z to the little finger) and its fingers. */
758
+ declare function gestureHandPose(params: GestureHandParams): GestureHand;
759
+
760
+ /**
761
+ * The body working a control (CLAUDE.md §18): one gesture at a time, by the hand the gesture calls for (`gestureHandOf`: the free one for a button, the one that holds the
762
+ * thing to put in or pour), played over whatever the hands do already (the weapon's targets, a carried thing); the body steps up to the point, stoops for a low one, and the
763
+ * thing is worked when the hand gets there. Any host with a body plays it (the test room, a game): it says where the shoulders, the hands at rest and the feet are, and puts
764
+ * the hands where `targets` says. The timing and the pose are `createGestureTimeline` and `gestureHandPose`.
765
+ */
766
+
767
+ interface GestureBody {
768
+ /** Where the body's middle stands, metres on the floor (x, z). */
769
+ at(): readonly [number, number];
770
+ /** Steps by (dx, dz) metres, stopped by what is in the way. */
771
+ moveBy(dx: number, dz: number): void;
772
+ /** Turns the head and the body a share `k` (0..1) of the way toward the point. */
773
+ face(point: Vec3$1, k: number): void;
774
+ /** Stoops while `on`: the hand reaches something lower than the arm reaches standing (a stove's knob). */
775
+ stoop?(on: boolean): void;
776
+ /** The body is on its feet and can work a thing (false once it is knocked down or falls): a gesture going on stops without working the thing. */
777
+ able?(): boolean;
778
+ }
779
+ interface GestureHandDeps {
780
+ /** The shoulder of a hand, world space; null for a body without one. */
781
+ shoulder(hand: BodyHand): Vec3$1 | null;
782
+ /** Where a hand rests when the frame's targets have nothing for it (by the chest), world space. */
783
+ restOf(hand: BodyHand): Pose;
784
+ /** Whether each hand holds something (a weapon, a carried thing). */
785
+ holding(): {
786
+ readonly R: boolean;
787
+ readonly L: boolean;
788
+ };
789
+ /** The hand that carries the thing a `put_in` puts in or a `pour` pours (not a weapon), or null when no hand carries one. */
790
+ carrying?(): BodyHand | null;
791
+ /** The body's facing about the vertical, radians. */
792
+ yaw(): number;
793
+ /** The body on the floor, for the steps up to a point out of the arm's reach; without it the hand goes from where the body stands. */
794
+ readonly body?: GestureBody;
795
+ }
796
+ interface GestureStart {
797
+ readonly gesture: BodyGesture;
798
+ /** The point the hand works, world space, asked every frame (a thing that moves is followed). */
799
+ at(): Vec3$1;
800
+ /** The hand got there: the thing is worked now. */
801
+ onAct(): void;
802
+ }
803
+ /** Why a gesture did not start: another one goes on, no hand can do it (both hold something, or none holds the thing to put in), or the body has no arm for it. */
804
+ type GestureRefusal = 'busy' | 'hands_full' | 'no_body';
805
+ type GestureStartResult = {
806
+ readonly ok: true;
807
+ readonly hand: BodyHand;
808
+ } | {
809
+ readonly ok: false;
810
+ readonly reason: GestureRefusal;
811
+ };
812
+ interface GestureHands {
813
+ /** A gesture is going on. */
814
+ readonly busy: boolean;
815
+ /** The hand of the gesture going on. */
816
+ readonly hand: BodyHand | null;
817
+ /** Starts a gesture; nothing is done when it is refused (the reason says why). */
818
+ start(start: GestureStart): GestureStartResult;
819
+ step(dt: number): void;
820
+ /** The frame's targets with the working hand put on the gesture; the other hand keeps what it had. */
821
+ targets(base: HandTargets | null): HandTargets | null;
822
+ /** Stops the gesture going on, without working the thing. */
823
+ cancel(): void;
824
+ }
825
+ declare function createGestureHands(deps: GestureHandDeps): GestureHands;
826
+
827
+ export { BELT_SLOT, type BodyHand, DOOR_ARM_REACH, DOOR_SHOULDER_HEIGHT, DOOR_USE_DEFAULTS, DRIVING_HANDS_DEFAULTS, type DoorUse, type DoorUseBlock, type DoorUseHand, type DoorUsePhase, type DoorUseRules, type DoorUseStep, type DoorUseTarget, type DragMark, type DrivingHand, type DrivingHands, type DrivingHandsRules, FURNITURE_PUSH_DEFAULTS, type FurniturePush, type FurniturePushBlock, type FurniturePushInput, type FurniturePushLoad, type FurniturePushPhase, type FurniturePushRules, type FurniturePushStep, type FurniturePushTarget, GESTURE_ARM_REACH, GESTURE_TIMING, type GestureBody, type GestureHand, type GestureHandChoice, type GestureHandDeps, type GestureHandParams, type GestureHands, type GesturePhase, type GestureProgress, type GestureRefusal, type GestureStart, type GestureStartResult, type GestureTimeline, type GestureTiming, HANDS_BY_HANDLE, HANDS_DEFAULTS, HANDS_TIMING, type HandWeapon, type HandsMove, type HandsMoveKind, type HandsPlan, type HandsRules, type HandsTiming, ITEM_GRIP, type ItemGrip, KnownDeathCause, LIFT_DEFAULTS, type LiftCheck, type LiftRules, type LiftVerdict, PLAYER_MASS_KG, PLAYER_PUSH_STRENGTH_NEWTONS, PLAYER_TEXT, PLAYER_WALK_PUSH_NEWTONS, type PhysicsControllerOptions, type PhysicsPlayerController, type PlanHandsParams, PlayerCollider, PlayerController, PlayerMessageId, type PlayerPhysicsWorld, type PlayerText, type Pose, type QuatTuple, SLING_SLOT, SLOT_FALLBACKS, STEP_POSE_DEFAULTS, type StepPose, type StepPoseOptions, type StepPosition, type TakeProgress, type TakeSequence, type TakeStep, type TakeStepKind, type TakeTimeline, VEHICLE_BOARDING_DEFAULTS, type Vec3Tuple, type VehicleBoarding, type VehicleBoardingEvent, type VehicleBoardingPhase, type VehicleBoardingPorts, type VehicleBoardingRules, type VehicleHandleReach, WALKER_JUMP_SPEED, type Walker, type WalkerOptions, type WalkerServices, type WalkerStance, blendPoses, canPush, composePose, conjugateQuaternion, createDoorUse, createDrivingHands, createFurniturePush, createGestureHands, createGestureTimeline, createPhysicsController, createRng, createStepPose, createTakeTimeline, createVehicleBoarding, createWalker, dragMarkFor, drawBackOf, easeInOut, footRestHeight, freeHandOf, frictionFor, gestureHandOf, gestureHandPose, gripOfItem, gripOnHandle, gripSecondsFor, handPoseOnItem, interactionHandsFor, itemPoseInHand, liftCheckFor, multiplyQuaternions, planDrawSequence, planHands, planTakeSequence, playerTextOf, poseHolding, pushAccelerationFor, pushSpeedFor, quaternionOfBasis, rotateVector, slipsOnTop, swingSecondsFor };