@korial29/tiny-fps 0.139.0 → 0.140.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.
@@ -115,7 +115,23 @@ export declare const phalanges: (curl: number, i: number) => [Vec3, Vec3, Vec3];
115
115
  */
116
116
  export declare const hand: (out: number[], end: Vec3, f: Vec3, u: Vec3, th: Vec3, curl: number, tint: number[], point?: number, push?: number, to?: Vec3, bare?: number[],
117
117
  /** 0 to 1: the thumb out of the fist to CUP, up the side of what the palm carries. */
118
- cup?: number) => void;
118
+ cup?: number,
119
+ /** A near runner's hand: fewer sides, on the near sleeve's cuff, and none of the glove's small parts. */
120
+ lite?: boolean) => void;
121
+ /** What a hand does besides closing (hand()): the left index pointing, the right thumb pushing toward `to`, the left thumb cupped. */
122
+ export interface Grip {
123
+ point?: number;
124
+ push?: number;
125
+ to?: Vec3;
126
+ cup?: number;
127
+ }
128
+ /**
129
+ * Both hands of the skeleton `s` on its wrists, left then right, each closed `curls[i]` (hand()), in
130
+ * the glove `glove` with the bare fingertips `bare`; hers smaller about the wrist (HAND_F). The own
131
+ * body and the runners share it, so a runner's fist closes on a grip as the own one does. `lite` is
132
+ * a near runner's hand, `skip` a hand not drawn (the one a cut took off with its arm).
133
+ */
134
+ export declare const hands: (out: number[], s: Solved, build: number, curls: number[], glove: number[], bare: number[], { point, push, to, cup }?: Grip, lite?: boolean, skip?: number) => void;
119
135
  /** On a wall run the rail gun is put away, unless its bolt is going out. */
120
136
  export declare const stowed: (p: PlayerState) => boolean;
121
137
  export declare const createBody: (world?: World) => Body;
@@ -5,6 +5,8 @@ import type { Gait } from './gait';
5
5
  import type { Vec3 } from './mesh';
6
6
  import { solve } from './rig';
7
7
  import type { Quat } from './rig';
8
+ /** How closed the hand of an arm cut off is (hand() in body.ts). */
9
+ export declare const LIMP = 0.35;
8
10
  /** The height of the floor under (x, z) for something whose middle is at height y. */
9
11
  export type Ground = (x: number, y: number, z: number) => number;
10
12
  /** The first top under a point, none (it falls out of sight) off the roofs; without a world, the height `y0`. */
@@ -49,5 +51,8 @@ export declare const track: (r: {
49
51
  cut?: Piece;
50
52
  build?: number;
51
53
  }, dt: number, floor: Ground, fresh: boolean, tracer?: Pick<Tracer, "shock" | "spit">) => void;
52
- /** Appends the piece at level of detail `lod`, in `colors` (see palette()), sunk by `sink` metres with the body. */
53
- export declare const piece: (out: number[], c: Piece, colors: number[][], lod: number, sink: number, face?: ArrayLike<number>) => void;
54
+ /**
55
+ * Appends the piece at level of detail `lod`, in `colors` (see palette()), sunk by `sink` metres with
56
+ * the body; an arm with its hand, limp, in a space suit's glove on `suit`.
57
+ */
58
+ export declare const piece: (out: number[], c: Piece, colors: number[][], lod: number, sink: number, face?: ArrayLike<number>, suit?: boolean) => void;
@@ -29,9 +29,10 @@ export declare const eyesOf: (id: number, c?: Choice) => number[];
29
29
  * the shaved beard is on it, 0 to 1. `fem` (the woman's): redder lips, darker lashes.
30
30
  */
31
31
  export declare const palette: (jacket: number[], hair?: number[], eyes?: number[], suit?: boolean, tone?: number[], beard?: number, fem?: boolean) => number[][];
32
- /** The ring where the eye's sleeve ends in the glove, which body.ts starts the palm on, and its sides: the close ones (the eye's body is close). A thin wrist (3.2 cm until the user, 2026-11-09). */
32
+ /** The ring where a sleeve ends in the glove, which body.ts starts the palm on, and its sides: the close ones (the eye's body is close), and the near ones. A thin wrist (3.2 cm until the user, 2026-11-09). */
33
33
  export declare const CUFF: number[];
34
34
  export declare const CUFF_SIDES: number;
35
+ export declare const CUFF_NEAR: number;
35
36
  /**
36
37
  * A point of the man's skull at rest, `a` radians round it from the front (+ toward +x) at height
37
38
  * `y`, `off` metres out of it along its normal: what hair.ts lays a woman's hair on.
@@ -87,9 +88,9 @@ export declare const BUST = 0.028;
87
88
  /** Where it is fullest, metres up (the user, 2026-11-11: a little higher; it was 1.345). */
88
89
  export declare const BUST_Y = 1.37;
89
90
  /**
90
- * The skin at a level of detail: 0 far, 1 near (see DETAIL in mesh.ts), 2 near, headless and
91
- * handless, for the eye, 3 close (CLOSE in render.ts), twice the rings and half more sides, the
92
- * face carved finest. Built once.
91
+ * The skin at a level of detail: 0 far, 1 near (see DETAIL in mesh.ts), 2 near, headless, for the
92
+ * eye, 3 close (CLOSE in render.ts), twice the rings and half more sides, the face carved finest.
93
+ * Only the far one has hands, mittens: the others end at the wrists, where hands() goes. Built once.
93
94
  */
94
95
  export declare const body: (lod: number, build?: number) => Skin;
95
96
  /**
@@ -30,6 +30,8 @@ export interface Runner {
30
30
  grin: number;
31
31
  /** How far out the fist of a punch is, 0 to 1, eased. */
32
32
  jab: number;
33
+ /** How closed his hands are, left then right, eased toward grasp(). */
34
+ curls: number[];
33
35
  /** His face (expression.ts), and the seconds it has yet to live through: soldier() moves it once drawn, where the head's turn is known. */
34
36
  face: Face;
35
37
  dt: number;
@@ -95,6 +97,13 @@ export declare const lowered: (r: Runner) => number;
95
97
  * it), and the trunk twisting, bending and leaning through it (trunk()).
96
98
  */
97
99
  export declare const brandish: (from: Pose, p: PlayerState, prog: number, ph: number, t?: number) => Pose;
100
+ /**
101
+ * How closed the hands of `p` are, left then right (hand() in body.ts: 0 flat, 0.9 round a grip, 1
102
+ * a fist), as the own body closes its own: round what they hold and on the wheel, fists with
103
+ * nothing in them (the guard), a loose fist on a run, tighter at a sprint, open in the air, flat
104
+ * on a ledge, a wall or the floor, limp lying down.
105
+ */
106
+ export declare const grasp: (p: PlayerState, seat?: Seat) => number[];
98
107
  /** Seconds a runner the rail gun's bolt put down takes to come apart. */
99
108
  export declare const FRY = 0.9;
100
109
  /** How far a runner has come apart, 0 (whole, or not fried) to 1 (gone). */
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@korial29/tiny-fps",
3
3
  "description": "Tiny multiplayer first-person rooftop game for the browser: raw WebGL, zero runtime dependencies, WebSocket or same-browser multi-tab play.",
4
4
  "license": "Apache-2.0",
5
- "version": "0.139.0",
5
+ "version": "0.140.0",
6
6
  "type": "module",
7
7
  "files": [
8
8
  "dist"