@korial29/tiny-fps 0.152.0 → 0.153.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.
@@ -0,0 +1,11 @@
1
+ import type { Quat } from './rig';
2
+ import type { Vec3 } from './mesh';
3
+ import type { Out } from './verts';
4
+ /** Where the lips hold it, metres across from the mouth's middle (to his right), and the way it points. */
5
+ export declare const HOLD_X = 0.013;
6
+ /** What is left of it out of the mouth, half smoked, and its radius. */
7
+ export declare const LEN: number, R: number;
8
+ /** The ember: unlit (layer -2), it blooms. */
9
+ export declare const EMBER: number[];
10
+ /** Appends the cigar on the head joint at `at` turned by `q` (see solve()); `fine`: a close runner's. */
11
+ export declare const cigar: (out: Out, at: Vec3, q: Quat, fine?: boolean) => void;
@@ -13,6 +13,8 @@ export interface Mood {
13
13
  shout: number;
14
14
  /** A capture, a foe put down. */
15
15
  grin: number;
16
+ /** Hit, tackled or punched by a foe: it lingers once the wince is gone. */
17
+ anger: number;
16
18
  /** Where he aims from where his head points: radians to his right, and up. */
17
19
  gx: number;
18
20
  gy: number;
@@ -26,6 +28,13 @@ export declare const POSE: {
26
28
  FOCUS: number[][];
27
29
  GRIN: number[][];
28
30
  SHOUT: number[][];
31
+ /**
32
+ * Anger, the mouth shut: the brows down and drawn together, their outer ends left up (a V); the
33
+ * upper lids up and the lower ones tight (a glare); the nose wrinkled; the lips pressed thin.
34
+ */
35
+ ANGER: number[][];
36
+ /** Anger let out: the same glare, a snarl, the teeth bared and the jaw a little open. */
37
+ RAGE: number[][];
29
38
  WINCE: number[][];
30
39
  DOWN: number[][];
31
40
  };
@@ -36,6 +45,10 @@ export declare const BLINK: number;
36
45
  export declare const blink: (t: number) => number;
37
46
  /** The face's channels for an expression alone, on the face of `id` (or on the plain one). */
38
47
  export declare const expression: (pose: number[][], id?: number) => Float32Array;
48
+ /** A pose every face holds at once, whatever its mood: the demo's shots of the expressions. */
49
+ export declare const HOLD: {
50
+ pose?: number[][];
51
+ };
39
52
  export interface Face {
40
53
  /** The channels' weights now (CH): what skin() takes. */
41
54
  w: Float32Array;
@@ -9,6 +9,8 @@ export declare const KIND: {
9
9
  readonly EAR: 6;
10
10
  /** Far, where the face is not carved: the marks that stand for the eyes, the brows and the mouth, and the nose. */
11
11
  readonly MARK: 7;
12
+ /** The teeth, close only: the upper row on the skull, the lower one on the jaw (its uv's first is the jaw's weight). */
13
+ readonly TEETH: 8;
12
14
  };
13
15
  /** The channels: expressions first, then (from `TRAITS` on) a runner's own traits. */
14
16
  export declare const CH: {
@@ -35,21 +37,31 @@ export declare const CH: {
35
37
  readonly PUCKER: 13;
36
38
  /** The irises back with the ball's curve as they leave its middle: lookIn() is its weight. */
37
39
  readonly LOOK_IN: 14;
40
+ /**
41
+ * Anger's: the fold beside the nose deeper and the upper lip drawn up at its sides (a snarl); the
42
+ * lips pressed thin and rolled in; the lower lids up and straight, the cheeks
43
+ * left where they are (a glare, with WIDE). FLUSH moves nothing: mouthed() (skin.ts) reddens the
44
+ * cheeks and the nose by it.
45
+ */
46
+ readonly SNEER: 15;
47
+ readonly PRESS: 16;
48
+ readonly TENSE: 17;
49
+ readonly FLUSH: 18;
38
50
  /** A wider head, a longer lower face, a wider jaw, fuller cheeks. */
39
- readonly WIDTH: 15;
40
- readonly CHIN: 16;
41
- readonly JOWL: 17;
42
- readonly CHEEK: 18;
51
+ readonly WIDTH: 19;
52
+ readonly CHIN: 20;
53
+ readonly JOWL: 21;
54
+ readonly CHEEK: 22;
43
55
  /** A wider nose, a longer one, a heavier brow ridge, fuller lips, ears standing out. */
44
- readonly NOSE_W: 19;
45
- readonly NOSE_L: 20;
46
- readonly RIDGE: 21;
47
- readonly LIPS: 22;
48
- readonly EARS: 23;
56
+ readonly NOSE_W: 23;
57
+ readonly NOSE_L: 24;
58
+ readonly RIDGE: 25;
59
+ readonly LIPS: 26;
60
+ readonly EARS: 27;
49
61
  /** Longer hair (0 to 1), heavier lids, and what is not the same on both sides of a face. */
50
- readonly HAIR: 24;
51
- readonly LIDS: 25;
52
- readonly ASYM: 26;
62
+ readonly HAIR: 28;
63
+ readonly LIDS: 29;
64
+ readonly ASYM: 30;
53
65
  };
54
66
  export declare const TRAITS: number, CHANNELS: number;
55
67
  /** The middle of the right eye (x, y); the left is its mirror. */
@@ -60,6 +72,8 @@ export declare const eyes: (k?: number) => void;
60
72
  export declare const IRIS_R: number, PUPIL_R: number, GAZE_X: number, GAZE_Y: number;
61
73
  /** The mouth: the height of the line between the lips at the middle, how it falls to the corners (per m2), and the corners. */
62
74
  export declare const MOUTH_Y: number, MOUTH_K: number, MOUTH_X: number;
75
+ /** How far back the line between the lips goes as the mouth opens (JAW, GRIT at full): behind the teeth. */
76
+ export declare const POCKET = 0.02;
63
77
  /** The line between the lips at `ax` across. */
64
78
  export declare const lipLine: (ax: number) => number;
65
79
  /** The front of the eye's ball at `ax` across (a right eye's), height y: its rim's plane outside it. */
@@ -93,6 +93,8 @@ export interface Skin {
93
93
  t: Uint32Array;
94
94
  };
95
95
  }
96
+ /** How far out the face is (its z) at x across, height y: the carved surface, found by halving. */
97
+ export declare const onHead: (x: number, y: number) => number;
96
98
  /** How far out the woman's bust stands at its fullest, on the man's rest mesh, metres. */
97
99
  export declare const BUST = 0.028;
98
100
  /** Where it is fullest, metres up (the user, 2026-11-11: a little higher; it was 1.345). */
@@ -118,7 +120,7 @@ export declare const duals: (s: Skin, { pos, rot }: {
118
120
  pos: Vec3[];
119
121
  rot: Quat[];
120
122
  }) => Float64Array<ArrayBuffer>;
121
- /** The palette `colors` as the face `face` shows it: the line between the lips, the mouth's dark as the jaw opens, the teeth when the lips are drawn off them. */
123
+ /** The palette `colors` as the face `face` shows it: the line between the lips dark as the mouth opens (the teeth are pieces of their own, close). */
122
124
  export declare const mouthed: (colors: number[][], face?: ArrayLike<number>) => number[][];
123
125
  /**
124
126
  * Appends the skin in the pose `solved` (see solve()) to `out` as triangles in the renderer's
@@ -30,6 +30,8 @@ export interface Runner {
30
30
  /** Seconds left of the grimace a hit puts on his face, and of the grin of a capture or of a foe put down. */
31
31
  hurt: number;
32
32
  grin: number;
33
+ /** Seconds left of his anger: a hit, a tackle or a punch from a foe. */
34
+ mad: number;
33
35
  /** How far out the fist of a punch is, 0 to 1, eased, and its blow (BLOW). */
34
36
  jab: number;
35
37
  /** How closed his hands are, left then right, eased toward grasp(). */
@@ -63,6 +65,8 @@ export declare const LENGTHS: number[];
63
65
  export declare const seatOf: (p: PlayerState, rovers?: Rover[]) => Seat | undefined;
64
66
  /** Seconds a hit's wince lasts, and the grin of a capture or of a foe put down. */
65
67
  export declare const HURT: number, GRIN: number;
68
+ /** Seconds the anger of a hit, a tackle or a punch lasts; it fades over the second half. */
69
+ export declare const MAD = 4;
66
70
  /**
67
71
  * A woman's traits on the face of her id: never the heavy brow ridge, the wide jaw or the long
68
72
  * lower face of the draw, fuller lips, and the scalp's hair flat under her style (hair.ts).
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.152.0",
5
+ "version": "0.153.0",
6
6
  "type": "module",
7
7
  "files": [
8
8
  "dist"