@korial29/tiny-fps 0.147.3 → 0.148.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.
@@ -5,12 +5,13 @@ import type { Vec3 } from './mesh';
5
5
  /** Texels a skin vertex takes (then its face's records, two each), a corner, an armour vertex. */
6
6
  export declare const VERT: number, CORN: number, PLATE: number;
7
7
  /**
8
- * A skin's data, made once. A vertex: its place at rest and its weight, its normal and its shade,
9
- * its two joints and where its face's records start and how many (each: the channel's shift of
10
- * its place and of its normal, by channel). A corner: its vertex, its colour, the colour it fades
11
- * to and how far.
8
+ * Where the skin `s` is in `data`, made once: its vertices and its corners (a corner: its vertex, its
9
+ * colour, the colour it fades to and how far). With `hood`, the ninja's (build and face): dress() at
10
+ * rest on the skin his face's traits have shaped, its pressed places taken as the rest's, and only
11
+ * the face's expressions left for the shader, none under the guard (hidden there, and the jaw would
12
+ * push the face through it).
12
13
  */
13
- export declare const skinOf: (s: Skin) => [number, number];
14
+ export declare const skinOf: (s: Skin, hood?: [number, ArrayLike<number>]) => [number, number];
14
15
  /**
15
16
  * The armour armor() cuts out of the skin `s`, made once into `data`, its vertices of PLATE texels:
16
17
  * [its skin triangle, its corner in its triangle, the triangle's kind, its layer], each corner's
@@ -19,8 +20,9 @@ export declare const skinOf: (s: Skin) => [number, number];
19
20
  */
20
21
  export declare const armourOf: (s: Skin, fine: boolean, ninja: boolean, astro: boolean, bare: boolean) => [number, number];
21
22
  /**
22
- * Draws the skin `s` in the pose `pose` and, `plated`, the armour cut out of it, posed by the
23
- * shader: into `list`, as skin() and armor() would into the frame's vertices.
23
+ * Draws the skin `s` in the pose `pose` and, with `armour`, the armour cut out of it, posed by the
24
+ * shader: into `list`, as skin(), dress() (`hood`: the ninja's build) and armor() would into the
25
+ * frame's vertices.
24
26
  */
25
27
  export declare const flesh: (list: Pieces, s: Skin, pose: {
26
28
  pos: Vec3[];
@@ -29,4 +31,6 @@ export declare const flesh: (list: Pieces, s: Skin, pose: {
29
31
  fine: boolean;
30
32
  plate?: number[];
31
33
  accent: number[];
32
- }) => void;
34
+ ninja?: boolean;
35
+ bare?: boolean;
36
+ }, hood?: number) => void;
@@ -22,6 +22,8 @@ export declare const MOUTH: {
22
22
  * the face under the guard pressed in behind it.
23
23
  */
24
24
  export declare const dress: (out: Out, from: number, s: Skin, at: Vec3, q: Quat, build?: number) => void;
25
+ /** What the last dress() made of each of the `n` vertices of its skin: its bare share (-1: none), where it was pressed in (NaN: not). */
26
+ export declare const dressedOf: (n: number) => [Float64Array, Float64Array];
25
27
  /** Appends the guard and the ideograms on the head joint at `at` turned by `q` (see solve()), on the woman's smaller head with `build`, in the team's `color`. */
26
28
  export declare const mask: (out: Out, at: Vec3, q: Quat, build?: number, color?: number[],
27
29
  /** A far runner's: fewer quads. */
@@ -44,6 +44,8 @@ export interface Runner {
44
44
  seat?: Seat;
45
45
  /** The head of the runner he looks at (watched()), and how far his own is turned to it, eased: to his right and up, radians. */
46
46
  watch?: Vec3;
47
+ /** The id of the runner he looks at, kept while he can be followed. */
48
+ watching?: number;
47
49
  gaze?: number[];
48
50
  /** The muzzle of the long gun in his hands as last drawn, from his feet: where its shots are seen to leave (combat.ts). */
49
51
  tip?: Vec3;
@@ -78,15 +80,23 @@ export declare const createRunner: (p: PlayerState, seat?: Seat, build?: number,
78
80
  * The head turns to the runner one looks at (the user, 2026-11-12): the nearest within `far`
79
81
  * metres and `cone` radians of his aim. It turns no further than `turn` (to a side, up or down)
80
82
  * from where it points, the eyes going the rest of their travel; `rate` is how fast, per second.
83
+ * The one looked at is followed as he goes by (the user, 2026-11-14): kept, over a nearer one,
84
+ * until he is `hold` radians off the aim (the head's 80 degrees and the eyes' travel, REACH_X)
85
+ * or `keep` metres away.
81
86
  */
82
87
  export declare const WATCH: {
83
88
  far: number;
89
+ keep: number;
84
90
  cone: number;
91
+ hold: number;
85
92
  turn: number[];
86
93
  rate: number;
87
94
  };
88
- /** Where the head of the runner `p` looks at is, among `crowd`: nothing when he looks at no one, or is down. */
89
- export declare const watched: (p: PlayerState, crowd: PlayerState[]) => Vec3 | undefined;
95
+ /** The runner `p` looks at among `crowd`, and where his head is: none when he looks at no one, or is down. `held` is the one he looked at last. */
96
+ export declare const watched: (p: PlayerState, crowd: PlayerState[], held?: number) => {
97
+ id: number;
98
+ at: Vec3;
99
+ } | undefined;
90
100
  export declare const animate: (book: Map<number, Runner>, others: PlayerState[], dt: number, world?: World, tracer?: Pick<Tracer, "shock" | "spit">, rovers?: Rover[], builds?: ReadonlyMap<number, number>, looks?: ReadonlyMap<number, Choice>) => void;
91
101
  /**
92
102
  * A long gun's butt plate in the hollow of the right shoulder: from the shoulder joint, in the
@@ -40,7 +40,7 @@ export declare let stored: Float32Array<ArrayBuffer>;
40
40
  /** The floats of `stored` written: a renderer uploads what it has not yet. */
41
41
  export declare let filled: number;
42
42
  /** The piece `key`, made by `make` (into an empty array, at the origin) the first time it is asked for. */
43
- export declare const mesh: (key: string, make: (out: number[]) => void) => Mesh;
43
+ export declare const mesh: (key: string, make: (out: Out) => void) => Mesh;
44
44
  /** The frame's pieces, drawn after its other vertices. */
45
45
  export type Pieces = Draw[];
46
46
  /** The turn and the place of no move: a rigid piece made with them is at the origin. */
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.147.3",
5
+ "version": "0.148.0",
6
6
  "type": "module",
7
7
  "files": [
8
8
  "dist"