@korial29/tiny-fps 0.145.0 → 0.145.1

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.
@@ -1,4 +1,5 @@
1
1
  import type { Skin } from './skin';
2
+ import type { Out } from './verts';
2
3
  /**
3
4
  * A plate's region on the body at rest (metres, -z the front, +x the right): the part it is on,
4
5
  * the heights it spans, and the angles round
@@ -235,6 +236,17 @@ export declare const REGIONS: Region[];
235
236
  type Corner = number[];
236
237
  /** The scratches' colours on coloured plates: the white under the paint, and paler. */
237
238
  export declare const SCRATCHED: number[][];
239
+ /**
240
+ * A recipe: triangles of corners, each [skin triangle, its three weights, how far off the skin,
241
+ * the slope of the swell at rest (x, y, z), the normal at rest (x, y, z)], and per triangle its
242
+ * colour, layer, whether it is a wall (its normal its own, flat) and its region (-1: a scratch).
243
+ */
244
+ interface Recipe {
245
+ c: number[];
246
+ t: number[];
247
+ /** The triangles each kind of wearer has (armor()'s `ninja`, astronaut and `bare` bits), listed on first use. */
248
+ k?: Int32Array[];
249
+ }
238
250
  /**
239
251
  * Her breasts on the shell (the user, 2026-11-12: a uniform dome each, a little bigger): a round
240
252
  * dome each side, `h` out at its middle (x, y) and falling to nothing `r` away, smooth at its rim;
@@ -299,6 +311,8 @@ export declare const NINJA_DETAILS: number[][];
299
311
  * down the front of each thigh plate.
300
312
  */
301
313
  export declare const ASTRO_DETAILS: number[][];
314
+ /** The armour's recipe on the skin `s`, `fine` or not (armor()), made now if it is not yet: the close one takes a quarter of a second. */
315
+ export declare const prepare: (s: Skin, fine: boolean) => Recipe;
302
316
  /**
303
317
  * Appends the armour cut out of the skin `s` drawn into `out` from the float `from` on (skin()
304
318
  * writes three vertices per triangle of s.t, in order). Not `fine` (a runner not close by), curved
@@ -306,5 +320,5 @@ export declare const ASTRO_DETAILS: number[][];
306
320
  * plates' colour (their walls a shade darker): white when absent, the astronaut's, who has his own
307
321
  * details in his team's colour `accent` too. The `ninja` wears his own armour.
308
322
  */
309
- export declare const armor: (out: number[], from: number, s: Skin, fine?: boolean, plate?: number[], ninja?: boolean, accent?: number[], bare?: boolean) => void;
323
+ export declare const armor: (out: Out, from: number, s: Skin, fine?: boolean, plate?: number[], ninja?: boolean, accent?: number[], bare?: boolean) => void;
310
324
  export {};
@@ -1,5 +1,6 @@
1
1
  import type { Light } from './lights';
2
2
  import type { Vec3 } from './mesh';
3
+ import type { Out } from './verts';
3
4
  /** A ball as drawn this frame: its centre, its unit direction, and the metres of trail behind it. */
4
5
  export interface Orb {
5
6
  p: Vec3;
@@ -52,7 +53,7 @@ export interface Tracer {
52
53
  /** Ages everything by dt seconds and drops what is over. */
53
54
  update(dt: number): void;
54
55
  /** Appends the balls, the flashes, the bolts and the sparks, turned to the camera at `eye`. */
55
- draw(out: number[], eye: Vec3): void;
56
+ draw(out: Out, eye: Vec3): void;
56
57
  /** The lights of the flashes, the splashes, the bolts and the nearest balls, for gather(). */
57
58
  lights(): Light[];
58
59
  }
@@ -3,6 +3,7 @@ import type { World } from '../shared/world';
3
3
  import type { Vec3 } from './mesh';
4
4
  import { solve } from './rig';
5
5
  import type { Pose, Quat } from './rig';
6
+ import type { Out } from './verts';
6
7
  export type Solved = ReturnType<typeof solve>;
7
8
  export interface Body {
8
9
  /** The own player's id, -1 before the first snapshot. */
@@ -24,7 +25,7 @@ export interface Body {
24
25
  /** The joints for a camera at `eye`; undefined without a player, or with the camera away from the body. */
25
26
  pose(eye: Vec3, yaw: number, pitch: number, roll?: number): Solved | undefined;
26
27
  /** Appends the body's vertices (see STRIDE) in the jacket `color`; nothing when pose() has none. */
27
- draw(out: number[], eye: Vec3, yaw: number, pitch: number, roll?: number, color?: number[]): void;
28
+ draw(out: Out, eye: Vec3, yaw: number, pitch: number, roll?: number, color?: number[]): void;
28
29
  /** The own player's character (BUILD in rig.ts, PlayerInfo.body): the woman's arms are slimmer and her hands smaller, on the same grips; `tone` the skin he picked (the default's when absent). */
29
30
  wear(build: number, tone?: number[], ninja?: boolean): void;
30
31
  }
@@ -113,7 +114,7 @@ export declare const phalanges: (curl: number, i: number) => [Vec3, Vec3, Vec3];
113
114
  * detail): fingerless from halfway along the middle phalanx, the bare tips in `bare` with a nail
114
115
  * each; a hard shell over the knuckles, a padded plate on the back, a strap round the wrist.
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
+ export declare const hand: (out: Out, end: Vec3, f: Vec3, u: Vec3, th: Vec3, curl: number, tint: number[], point?: number, push?: number, to?: Vec3, bare?: number[],
117
118
  /** 0 to 1: the thumb out of the fist to CUP, up the side of what the palm carries. */
118
119
  cup?: number,
119
120
  /** A near runner's hand: fewer sides, on the near sleeve's cuff, and none of the glove's small parts. */
@@ -131,7 +132,7 @@ export interface Grip {
131
132
  * body and the runners share it, so a runner's fist closes on a grip as the own one does. `lite` is
132
133
  * a near runner's hand, `skip` a hand not drawn (the one a cut took off with its arm).
133
134
  */
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;
135
+ export declare const hands: (out: Out, s: Solved, build: number, curls: number[], glove: number[], bare: number[], { point, push, to, cup }?: Grip, lite?: boolean, skip?: number) => void;
135
136
  /** On a wall run the rail gun is put away, unless its bolt is going out. */
136
137
  export declare const stowed: (p: PlayerState) => boolean;
137
138
  export declare const createBody: (world?: World) => Body;
@@ -1,8 +1,9 @@
1
1
  import type { Vec3 } from './mesh';
2
2
  import type { Quat } from './rig';
3
+ import type { Out } from './verts';
3
4
  /** The height of its middle at rest, on the middle of the belt (0.99 to 1.03 m). */
4
5
  export declare const BUCKLE_Y = 1.008;
5
6
  /** Its radius and depth (m). */
6
7
  export declare const BUCKLE: number[];
7
8
  /** Appends the buckle for build b's pelvis at `at` turned by `q`, its middle in `team`. */
8
- export declare const buckle: (out: number[], at: Vec3, q: Quat, b: number, team: number[]) => void;
9
+ export declare const buckle: (out: Out, at: Vec3, q: Quat, b: number, team: number[]) => void;
@@ -1,6 +1,7 @@
1
1
  import type { Rover } from '../shared/types';
2
2
  import { WING } from '../shared/ship';
3
3
  import type { Vec3 } from './mesh';
4
+ import type { Out } from './verts';
4
5
  /**
5
6
  * The ship's lines, metres ahead of the centre: the nose's tip and where its sensor starts, the
6
7
  * foot of the windscreen (the nose ends there), the canopy's two arches, where the spine ends, and
@@ -44,4 +45,4 @@ export declare const legs: (r: Rover) => number;
44
45
  * among the map's vehicles): scorched where it arcs; a wreck on its belly, its legs gone, charred,
45
46
  * no light on it, falling apart at the end.
46
47
  */
47
- export declare const craft: (out: number[], state: Rover, rgb: number[], t: number, lod?: number, n?: number) => void;
48
+ export declare const craft: (out: Out, state: Rover, rgb: number[], t: number, lod?: number, n?: number) => void;
@@ -1,5 +1,6 @@
1
1
  import type { Door, World } from '../shared/world';
2
2
  import type { Vec3 } from './mesh';
3
+ import type { Out } from './verts';
3
4
  /** The strip of light: shut, then opening or open. */
4
5
  export declare const LIGHT: number[][];
5
6
  /**
@@ -7,7 +8,7 @@ export declare const LIGHT: number[][];
7
8
  * a header, proud of the panels on both faces), and the two panels, each slid `open` of its width
8
9
  * into the wall beside it.
9
10
  */
10
- export declare const panels: (o: number[], { min, max }: Door, open: number) => void;
11
+ export declare const panels: (o: Out, { min, max }: Door, open: number) => void;
11
12
  export interface Doors {
12
13
  /**
13
14
  * The doors of a snapshot (Snapshot.doors): kept for the drawing and for the world's ray(), so an
@@ -18,7 +19,7 @@ export interface Doors {
18
19
  at: Vec3;
19
20
  }[];
20
21
  /** The doors near `eye`, `dt` seconds after the last frame: each follows its snapshot's state. */
21
- draw(o: number[], eye: Vec3, dt: number): void;
22
+ draw(o: Out, eye: Vec3, dt: number): void;
22
23
  /** How far each is drawn open. */
23
24
  shown(): number[];
24
25
  }
@@ -1,4 +1,5 @@
1
1
  import type { Vec3 } from './mesh';
2
+ import type { Out } from './verts';
2
3
  /** Seconds a drop lies about, and the last of them it shrinks away in. */
3
4
  export declare const LIFE: number, GONE: number;
4
5
  /** Throws out `model`, its foot at `foot` with axes `ax` (as place() takes them), at speed `v` spinning by `w`, to fall to `floor`. */
@@ -8,6 +9,6 @@ export declare const drops: () => number;
8
9
  /** Moves the drops on by `dt` seconds: falling, spinning, bouncing and settling on their floor. */
9
10
  export declare const fall: (dt: number) => void;
10
11
  /** Appends the drops, each shrinking away in its last GONE seconds. */
11
- export declare const drawDrops: (out: number[]) => void;
12
+ export declare const drawDrops: (out: Out) => void;
12
13
  /** Forgets every drop (a new world). */
13
14
  export declare const clearDrops: () => number;
@@ -1,6 +1,7 @@
1
1
  import type { Rover } from '../shared/types';
2
2
  import type { World } from '../shared/world';
3
3
  import type { Vec3 } from './mesh';
4
+ import type { Out } from './verts';
4
5
  /** Metres a second along the ground from which the wheels raise dust, and across the nose (a slide) from which they do at any speed. */
5
6
  export declare const DUST_SPEED = 6;
6
7
  export declare const DUST_SLIP = 2.5;
@@ -14,7 +15,7 @@ export interface Dust {
14
15
  /** Moves the puffs by dt seconds, then lets the rovers' wheels throw new ones. */
15
16
  update(rovers: Rover[], world: World, dt: number, eye?: Vec3): void;
16
17
  /** Appends the puffs: each swells and thins as it flies. */
17
- draw(out: number[]): void;
18
+ draw(out: Out): void;
18
19
  /** Puffs in flight. */
19
20
  readonly count: number;
20
21
  }
@@ -1,6 +1,7 @@
1
1
  import type { FlagState, PlayerState } from '../shared/types';
2
2
  import type { Vec3 } from './mesh';
3
3
  import type { Quat } from './rig';
4
+ import type { Out } from './verts';
4
5
  /** One flag to draw. */
5
6
  export interface FlagDraw {
6
7
  /** The team the flag belongs to: its colour. */
@@ -44,17 +45,17 @@ export interface CtfScene {
44
45
  /** The flags to draw from a snapshot: each at its base, where it lies, or on the back of its carrier (none if he is not drawn). */
45
46
  export declare const flagDraws: (flags: readonly FlagState[], bases: readonly Vec3[], who: (id: number) => PlayerState | undefined) => FlagDraw[];
46
47
  /** Makes the vertices from `from` on glow: the colour gets brighter by `k` and loses its shading. */
47
- export declare const glow: (out: number[], from: number, k: number) => void;
48
+ export declare const glow: (out: Out, from: number, k: number) => void;
48
49
  /** A triangle with its flat normal, of one colour (r, g, b). */
49
- export declare const tri: (out: number[], a: Vec3, b: Vec3, c: Vec3, [r, g, bl]: number[]) => void;
50
+ export declare const tri: (out: Out, a: Vec3, b: Vec3, c: Vec3, [r, g, bl]: number[]) => void;
50
51
  /** A ring between the radii r0 and r1 on the horizontal at `at`, facing up: SIDES quads. */
51
- export declare const ring: (out: number[], at: Vec3, r0: number, r1: number, rgb: number[]) => void;
52
+ export declare const ring: (out: Out, at: Vec3, r0: number, r1: number, rgb: number[]) => void;
52
53
  /**
53
54
  * A team's base at `at`: a low pad of the team colour under a glowing ring of FLAG_REACH, the
54
55
  * radius within which a flag is touched and a capture counts. `t` is the clock in seconds: the
55
56
  * ring pulses.
56
57
  */
57
- export declare const base: (out: number[], at: Vec3, rgb: number[], t: number) => void;
58
+ export declare const base: (out: Out, at: Vec3, rgb: number[], t: number) => void;
58
59
  /**
59
60
  * A flag. At rest on its base it stands upright with the cloth blowing out to one side. On a
60
61
  * carrier it is strapped to his back, from the belt up over his head, and leans and turns with
@@ -63,4 +64,4 @@ export declare const base: (out: number[], at: Vec3, rgb: number[], t: number) =
63
64
  * Dropped, it lies on the ground, the pole leaning, with a ring on the ground where it is to be
64
65
  * touched. `t` is the clock in seconds.
65
66
  */
66
- export declare const flag: (out: number[], f: FlagDraw, rgb: number[], t: number, chest?: [Vec3, Quat]) => void;
67
+ export declare const flag: (out: Out, f: FlagDraw, rgb: number[], t: number, chest?: [Vec3, Quat]) => void;
@@ -2,6 +2,7 @@ import type { PlayerState } from '../shared/types';
2
2
  import type { World } from '../shared/world';
3
3
  import type { Vec3 } from './mesh';
4
4
  import type { Quat } from './rig';
5
+ import type { Out } from './verts';
5
6
  /**
6
7
  * The back of the body and the muzzle, the tip of the nose, in model space (the tail and the front of
7
8
  * the emitter): the line through them is the gun's long axis, the way it points and the way the
@@ -133,7 +134,7 @@ export declare const thumbTo: (kind: number) => Vec3;
133
134
  /** Weapon `kind`'s button for a model at `at` with axes [right, up, forward] (model -z forward): its top, and the way it faces. */
134
135
  export declare const buttonAt: (kind: number, at: Vec3, [r, u, f]: Vec3[]) => Vec3[];
135
136
  /** Appends weapon `kind`'s button in model space, pushed in by `push` (0 to 1) of 1.5 mm, its glow `rgb` lit by `light`. */
136
- export declare const button: (out: number[], kind: number, push: number, light: number, rgb: number[]) => void;
137
+ export declare const button: (out: Out, kind: number, push: number, light: number, rgb: number[]) => void;
137
138
  /** When, in the swap of the gun or the rifle, the palm slaps the new battery home: it clicks then. */
138
139
  export declare const TAP = 0.76;
139
140
  /**
@@ -253,7 +254,7 @@ export declare const cellsOf: (p: Pick<PlayerState, "rail" | "cap">) => number[]
253
254
  * given, and the charge gauge at `level`; its battery (capsule) where the swap has it, its glow and
254
255
  * its counter dimmed with `light`, and the spark only when it is all on.
255
256
  */
256
- export declare const held: (out: number[], pos: Vec3, q: Quat, lod: number, k?: number, ammo?: number, level?: number, kind?: boolean | number, t?: number, { light, swap, empty, screen, digits, cells, heat, hot, press, tune, nades, id, floor, vel, carry, }?: Lit) => void;
257
+ export declare const held: (out: Out, pos: Vec3, q: Quat, lod: number, k?: number, ammo?: number, level?: number, kind?: boolean | number, t?: number, { light, swap, empty, screen, digits, cells, heat, hot, press, tune, nades, id, floor, vel, carry, }?: Lit) => void;
257
258
  /** The muzzle of a gun (the rail gun's or the rifle's by `kind`) whose grip is at `at` and whose axes are [right, up, forward]. */
258
259
  export declare const tip: (at: Vec3, [, u, f]: Vec3[], kind?: boolean | number) => Vec3;
259
260
  /**
@@ -1,5 +1,6 @@
1
1
  import type { Quat } from './rig';
2
2
  import type { Vec3 } from './mesh';
3
+ import type { Out } from './verts';
3
4
  export declare const STYLE: {
4
5
  readonly PONYTAIL: 0;
5
6
  readonly BOB: 1;
@@ -26,4 +27,4 @@ export declare const sway: (phase: number, speed: number, t: number) => Vec3;
26
27
  * Appends the hair `style` in `rgb` on the woman's head joint at `at` turned by `q` (see solve()),
27
28
  * at level of detail `lod` (0 far), its loose end moved by `swing` (sway()).
28
29
  */
29
- export declare const hair: (out: number[], at: Vec3, q: Quat, style: number, rgb: number[], lod: number, swing?: Vec3) => void;
30
+ export declare const hair: (out: Out, at: Vec3, q: Quat, style: number, rgb: number[], lod: number, swing?: Vec3) => void;
@@ -1,6 +1,7 @@
1
1
  import type { Spot } from './helmet';
2
2
  import type { Vec3 } from './mesh';
3
3
  import type { Quat } from './rig';
4
+ import type { Out } from './verts';
4
5
  /**
5
6
  * The dome: its middle (the widest ring, level with the brow), its half width, height over the
6
7
  * middle and depth, how square it is seen from above, how flat on top, and the height of its lip
@@ -84,4 +85,4 @@ export declare const PIT: {
84
85
  * `at` turned by `q`, the frame of its T in `rgb`, the team's colour (0 to 1). The far one has no
85
86
  * ear caps and no cheek plates.
86
87
  */
87
- export declare const helm: (out: number[], at: Vec3, q: Quat, rgb: number[], lod: number) => void;
88
+ export declare const helm: (out: Out, at: Vec3, q: Quat, rgb: number[], lod: number) => void;
@@ -1,5 +1,6 @@
1
1
  import type { Vec3 } from './mesh';
2
2
  import type { Quat } from './rig';
3
+ import type { Out } from './verts';
3
4
  /**
4
5
  * The shell, a superellipsoid in the head joint's frame: its centre and half width, height and
5
6
  * depth, its exponents across (square seen from above) and up (flat on top), and its rim, the
@@ -47,14 +48,14 @@ export declare const unit: (v: Vec3) => Vec3;
47
48
  /** A signed power: the superellipse's |t|^p keeping t's sign. */
48
49
  export declare const pow: (t: number, p: number) => number;
49
50
  /** A triangle over `p`, wound as its first normal faces, in `col` on `layer`; none if it has no area. */
50
- export declare const face: (out: number[], col: number[], layer: number, p: Spot[]) => void;
51
+ export declare const face: (out: Out, col: number[], layer: number, p: Spot[]) => void;
51
52
  /**
52
53
  * Triangles between the rows of points `rows`, each a closed ring of n (the first and the last may
53
54
  * be one point), in `col` on `layer`; wound as the normals face. Triangles of no area are left out.
54
55
  */
55
- export declare const sheet: (rows: Spot[][], col: number[], layer: number, out?: number[]) => number[];
56
+ export declare const sheet: <T extends Out = number[]>(rows: Spot[][], col: number[], layer: number, out?: T) => T;
56
57
  /** A flat quad over the corners `q` (in turn round it), facing `m`, in `col` on `layer`. */
57
- export declare const quad: (out: number[], q: Vec3[], m: Vec3, col: number[], layer?: number) => void;
58
+ export declare const quad: (out: Out, q: Vec3[], m: Vec3, col: number[], layer?: number) => void;
58
59
  /**
59
60
  * A closed loft: `f(t, s)` the point at the turn t (0 to 1 round) of its ring s (0 to 1 along),
60
61
  * `n` points round and the rows at `along`; the ends closed by a point at `ends` (its first and
@@ -72,4 +73,4 @@ export declare const inside: (u: number, y: number, k?: number) => boolean;
72
73
  * `at` turned by `q` (see solve() in rig.ts), in `rgb`, the team's colour (0 to 1): the strips on
73
74
  * the ear plates, which glow. The far helmet is the shell and the visor.
74
75
  */
75
- export declare const helmet: (out: number[], at: Vec3, q: Quat, rgb: number[], lod: number) => void;
76
+ export declare const helmet: (out: Out, at: Vec3, q: Quat, rgb: number[], lod: number) => void;
@@ -1,6 +1,7 @@
1
1
  import type { PlayerState } from '../shared/types';
2
2
  import type { Vec3 } from './mesh';
3
3
  import type { Quat } from './rig';
4
+ import type { Out } from './verts';
4
5
  /** Where the blade starts and ends along the model's forward axis, metres from the right hand: a metre from the guard to the point. */
5
6
  export declare const BASE: number, TIP: number;
6
7
  /** The left hand grips this far behind the right one: a gap between the two fists. */
@@ -14,12 +15,12 @@ export declare const S: number, C: number;
14
15
  */
15
16
  export declare const katana: (lod: number) => number[];
16
17
  /** Appends arcs of lightning flickering along the blade at the clock `t` (s): a few zigzags of thin crossed ribbons, each new every 70 ms. */
17
- export declare const arcs: (out: number[], at: Vec3, [r, u, f]: Vec3[], t: number, lod: number, k?: number) => void;
18
+ export declare const arcs: (out: Out, at: Vec3, [r, u, f]: Vec3[], t: number, lod: number, k?: number) => void;
18
19
  /**
19
20
  * Appends the katana with its right-hand grip at `at`, axes `[right, up, forward]`, `k` times its
20
21
  * size; with the clock `t` (s) it crackles, once its glow is all on (`light`, 0 off to 1).
21
22
  */
22
- export declare const sword: (out: number[], at: Vec3, ax: Vec3[], lod: number, t?: number, k?: number, light?: number, press?: number) => void;
23
+ export declare const sword: (out: Out, at: Vec3, ax: Vec3[], lod: number, t?: number, k?: number, light?: number, press?: number) => void;
23
24
  /** The sword's axes [right, up, forward] for a hand turned by `q` (see body.ts): the back of the hand to its right, the blade off the thumb toward the fingers. */
24
25
  export declare const axes: (q: Quat) => Vec3[];
25
26
  /** Where the fingers point for a sword with axes `ax`: the inverse of axes(). */
@@ -27,7 +28,7 @@ export declare const fingers: ([, u, f]: Vec3[]) => Vec3;
27
28
  /** The right and the left wrist for a sword with its right-hand grip at `at`: the left hand is BEHIND the right one, mirrored. */
28
29
  export declare const wrists: (at: Vec3, ax: Vec3[]) => Vec3[];
29
30
  /** Appends the katana held in the right hand at `pos` turned by `q`. */
30
- export declare const held: (out: number[], pos: Vec3, q: Quat, lod: number, t?: number, k?: number, light?: number, press?: number) => void;
31
+ export declare const held: (out: Out, pos: Vec3, q: Quat, lod: number, t?: number, k?: number, light?: number, press?: number) => void;
31
32
  /** The root of the blade and its point, in the world, for the hand at `pos` turned by `q`. */
32
33
  export declare const ends: (pos: Vec3, q: Quat) => Vec3[];
33
34
  /**
@@ -5,6 +5,7 @@ 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
+ import type { Out } from './verts';
8
9
  /** How closed the hand of an arm cut off is (hand() in body.ts). */
9
10
  export declare const LIMP = 0.35;
10
11
  /** The height of the floor under (x, z) for something whose middle is at height y. */
@@ -55,4 +56,4 @@ export declare const track: (r: {
55
56
  * Appends the piece at level of detail `lod`, in `colors` (see palette()), sunk by `sink` metres with
56
57
  * the body; an arm with its hand, limp, in a space suit's glove on `suit`.
57
58
  */
58
- export declare const piece: (out: number[], c: Piece, colors: number[][], lod: number, sink: number, face?: ArrayLike<number>, suit?: boolean) => void;
59
+ export declare const piece: (out: Out, c: Piece, colors: number[][], lod: number, sink: number, face?: ArrayLike<number>, suit?: boolean) => void;
@@ -1,6 +1,7 @@
1
1
  import type { Quat } from './rig';
2
2
  import type { Vec3 } from './mesh';
3
3
  import type { Skin } from './skin';
4
+ import type { Out } from './verts';
4
5
  /** The suit's and the hood's black, a touch of blue in it; the guard's rim, a shade lighter; the disc's ink. */
5
6
  export declare const CLOTH: number[];
6
7
  /**
@@ -20,6 +21,8 @@ export declare const MOUTH: {
20
21
  * the neck and the skin at the neck's foot, but the opening round the eyes, soft at its edge), and
21
22
  * the face under the guard pressed in behind it.
22
23
  */
23
- export declare const dress: (out: number[], from: number, s: Skin, at: Vec3, q: Quat, build?: number) => void;
24
+ export declare const dress: (out: Out, from: number, s: Skin, at: Vec3, q: Quat, build?: number) => void;
24
25
  /** 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`. */
25
- export declare const mask: (out: number[], at: Vec3, q: Quat, build?: number, color?: number[]) => void;
26
+ export declare const mask: (out: Out, at: Vec3, q: Quat, build?: number, color?: number[],
27
+ /** A far runner's: fewer quads. */
28
+ far?: boolean) => void;
@@ -1,3 +1,4 @@
1
+ import type { Out } from './verts';
1
2
  export type Vec3 = [number, number, number];
2
3
  export declare const sub: (a: Vec3, b: Vec3) => Vec3;
3
4
  export declare const add: (a: Vec3, b: Vec3) => Vec3;
@@ -67,9 +68,9 @@ export declare const solid: (lod: number, len: number, radii: number[], ends?: [
67
68
  * so an ellipsoid made of a sphere shades like one. Written without allocations: a body is placed
68
69
  * a thousand vertices at a time.
69
70
  */
70
- export declare const place: (out: number[], src: number[], eye: Vec3, [r, u, f]: Vec3[], off: Vec3, k: number | Vec3, tint?: number[]) => void;
71
+ export declare const place: (out: Out, src: number[], eye: Vec3, [r, u, f]: Vec3[], off: Vec3, k: number | Vec3, tint?: number[]) => void;
71
72
  /** Dims by `k` the glow (layer -2) of the vertices of `out` from the float `from` on: a light that is off, or coming on. */
72
- export declare const dim: (out: number[], from: number, k: number) => void;
73
+ export declare const dim: (out: Out, from: number, k: number) => void;
73
74
  /**
74
75
  * Axes [r, u, f] with f along the unit vector `to` and r as near `side` as it can be: the frame of
75
76
  * a bone, which `place` takes. Right-handed like `basis`.
@@ -80,4 +81,4 @@ export declare const aim: (to: Vec3, side: Vec3) => [Vec3, Vec3, Vec3];
80
81
  * them, `k` wide (a number, or across `side` and across the other way), `side` being where
81
82
  * its x axis points as near as it can.
82
83
  */
83
- export declare const segment: (out: number[], src: number[], a: Vec3, b: Vec3, side: Vec3, len: number, k?: number | [number, number], tint?: number[]) => void;
84
+ export declare const segment: (out: Out, src: number[], a: Vec3, b: Vec3, side: Vec3, len: number, k?: number | [number, number], tint?: number[]) => void;
@@ -1,16 +1,17 @@
1
1
  import type { Brush, WorldDef } from '../shared/world';
2
2
  import type { Vec3 } from './mesh';
3
+ import type { Out } from './verts';
3
4
  /** A model whose length runs up (y): the frame place() takes. */
4
5
  export declare const UP: Vec3[];
5
6
  export declare const cross: (u: Vec3, v: Vec3) => Vec3;
6
7
  /** A convex polygon of one colour, wound so that it faces away from `away` when given. */
7
- export declare const face: (o: number[], p: Vec3[], rgb: number[], away?: Vec3) => void;
8
+ export declare const face: (o: Out, p: Vec3[], rgb: number[], away?: Vec3) => void;
8
9
  /** A box of one colour between two corners, its faces outward, less those whose bit is in `skip`: 1 and 2 its low and high z, 4 and 8 y, 16 and 32 x. */
9
- export declare const box: (o: number[], lo: Vec3, hi: Vec3, rgb: number[], skip?: number) => void;
10
+ export declare const box: (o: Out, lo: Vec3, hi: Vec3, rgb: number[], skip?: number) => void;
10
11
  /** Carries a model's vertices to (x, y, z), turned by `yaw` about y. */
11
- export declare const put: (o: number[], v: number[], [x, y, z]: Vec3, yaw?: number) => void;
12
+ export declare const put: (o: Out, v: number[], [x, y, z]: Vec3, yaw?: number) => void;
12
13
  /** What `make` adds to `o` glows, k times its colour. */
13
- export declare const lit: (o: number[], k: number, make: () => void) => void;
14
+ export declare const lit: (o: Out, k: number, make: () => void) => void;
14
15
  /** The beams over the doorways of the modules. */
15
16
  export declare const LINTELS: Brush[];
16
17
  /**
@@ -23,7 +24,7 @@ export declare const INDOORS: number[];
23
24
  /** The openings of the drawn drum, as angles about the centre and a height: the door, and the tubes' boxes where they come through. */
24
25
  export declare const GAPS: number[][];
25
26
  /** Red's half of the base: the dome, its hall, the tubes and the modules, a metal floor in the last two, a lit frame in each of their doorways. */
26
- export declare const moonbase: (o: number[]) => void;
27
+ export declare const moonbase: (o: Out) => void;
27
28
  /**
28
29
  * The base's furnishing, both halves, which render.ts draws beside the scenery: the flags' daises
29
30
  * (the ghosts with a team tint, shared/moon.ts) as the hall's fittings but in their tint, `keys`
@@ -1,5 +1,6 @@
1
1
  import type { Vec3 } from './mesh';
2
2
  import type { Quat } from './rig';
3
+ import type { Out } from './verts';
3
4
  /**
4
5
  * The pack's body in the chest joint's frame (at 1.30 m; the back of the trunk is about 0.12
5
6
  * behind it), its front sunk a little in the back: its centre, half width, height and depth, and how square its corners are.
@@ -20,14 +21,14 @@ export declare const HOSE: {
20
21
  * Appends the pack at level of detail `lod` on the chest joint at `at` turned by `q` (see solve()
21
22
  * in rig.ts); its light strips glow in `rgb`, the team's colour.
22
23
  */
23
- export declare const pack: (out: number[], at: Vec3, q: Quat, rgb: number[], lod: number) => void;
24
+ export declare const pack: (out: Out, at: Vec3, q: Quat, rgb: number[], lod: number) => void;
24
25
  /**
25
26
  * Appends the hose from the helmet on the head joint (`head`, `hq`) to the pack on the chest joint
26
27
  * (`chest`, `cq`), at level of detail `lod`: a Bezier leaving the helmet out and down and entering
27
28
  * the pack's port from above, ribbed close up. None far.
28
29
  */
29
- export declare const hose: (out: number[], head: Vec3, hq: Quat, chest: Vec3, cq: Quat, lod: number) => void;
30
+ export declare const hose: (out: Out, head: Vec3, hq: Quat, chest: Vec3, cq: Quat, lod: number) => void;
30
31
  /** The woman's panel, scaled about its joint: smaller, as far out (her briefs are where his are). */
31
32
  export declare const CUP_F: Vec3;
32
33
  /** Appends the crotch panel on the pelvis joint at `at` turned by `q`, in `plate` (white when absent). */
33
- export declare const crotch: (out: number[], at: Vec3, q: Quat, plate?: number[], scale?: number | Vec3) => void;
34
+ export declare const crotch: (out: Out, at: Vec3, q: Quat, plate?: number[], scale?: number | Vec3) => void;
@@ -1,5 +1,6 @@
1
1
  import type { Vec3 } from './mesh';
2
2
  import type { Quat } from './rig';
3
+ import type { Out } from './verts';
3
4
  /**
4
5
  * A lame, from the arm's joint at rest (metres, +x out): where it starts and ends across, its half
5
6
  * width fore and aft, and its height at its start.
@@ -78,7 +79,9 @@ export declare const COLLAR_CLOTH: number[];
78
79
  * smaller on the woman (`build`). Or the `marine`'s shoulder bells, and no collar, with a band
79
80
  * round them in `band` (the astronaut's team colour on his white bells).
80
81
  */
81
- export declare const pads: (out: number[], s: {
82
+ export declare const pads: (out: Out, s: {
82
83
  pos: Vec3[];
83
84
  rot: Quat[];
84
- }, build?: number, color?: number[], marine?: boolean, band?: number[]) => void;
85
+ }, build?: number, color?: number[], marine?: boolean, band?: number[],
86
+ /** A far runner's: fewer quads. */
87
+ far?: boolean) => void;
@@ -1,12 +1,13 @@
1
1
  import type { Vec3 } from './mesh';
2
2
  import type { Quat } from './rig';
3
+ import type { Out } from './verts';
3
4
  /**
4
5
  * The pouch's mouth for a skeleton with its pelvis at `at` turned by `q`, and its axes: out of the
5
6
  * hip, forward, and down into it.
6
7
  */
7
8
  export declare const pouchAt: (at: Vec3, q: Quat) => [Vec3, Vec3[]];
8
9
  /** Appends the pouch, and the spare's top 8 mm out of it, for the pelvis at `at` turned by `q`. */
9
- export declare const pouch: (out: number[], at: Vec3, q: Quat) => void;
10
+ export declare const pouch: (out: Out, at: Vec3, q: Quat) => void;
10
11
  /**
11
12
  * The left hand fetching a new battery from the pouch at `s` of a swap (the user, 2026-11-09): from
12
13
  * `start` down over the pouch, into it, then up with the battery along an arc to `seat`, where the
@@ -1,4 +1,5 @@
1
1
  import type { Vec3 } from './mesh';
2
+ import type { Out } from './verts';
2
3
  /**
3
4
  * The packs of `all` whose bit is set in `mask`, if any: the ones that are there to take. The bits
4
5
  * count from `from`: the ammo packs come after the health packs.
@@ -9,12 +10,12 @@ export declare const packsOf: (all?: readonly Vec3[], mask?: number, from?: numb
9
10
  * the weapon, and the weapon over it: the gun, or by `kind` the katana (1), crackling, the rail
10
11
  * gun (2) or the laser rifle (3).
11
12
  */
12
- export declare const rack: (out: number[], at: Vec3, rgb: number[], t: number, kind?: number) => void;
13
+ export declare const rack: (out: Out, at: Vec3, rgb: number[], t: number, kind?: number) => void;
13
14
  /** Each team's gun rack, katana rack, rail gun rack and laser rifle rack, where it has them. */
14
- export declare const racks: (out: number[], guns?: readonly (Vec3 | undefined)[], blades?: readonly (Vec3 | undefined)[], t?: number, rails?: readonly (Vec3 | undefined)[], rifles?: readonly (Vec3 | undefined)[]) => void;
15
+ export declare const racks: (out: Out, guns?: readonly (Vec3 | undefined)[], blades?: readonly (Vec3 | undefined)[], t?: number, rails?: readonly (Vec3 | undefined)[], rifles?: readonly (Vec3 | undefined)[]) => void;
15
16
  /** A health pack at `at`: a white box with a glowing green cross on each side. */
16
- export declare const kit: (out: number[], at: Vec3, t: number) => void;
17
+ export declare const kit: (out: Out, at: Vec3, t: number) => void;
17
18
  /** An ammo pack at `at`: a violet box with a glowing cyan cartridge on each side, the gun's colours. */
18
- export declare const cell: (out: number[], at: Vec3, t: number) => void;
19
+ export declare const cell: (out: Out, at: Vec3, t: number) => void;
19
20
  /** A rail cell at `at`: a gunmetal box with a glowing violet-white bolt on each side, the rail gun's colours. */
20
- export declare const battery: (out: number[], at: Vec3, t: number) => void;
21
+ export declare const battery: (out: Out, at: Vec3, t: number) => void;
@@ -6,6 +6,7 @@ import type { Effects } from './effects';
6
6
  import type { CtfScene } from './flag';
7
7
  import type { Light } from './lights';
8
8
  import type { Vec3 } from './mesh';
9
+ import type { Out } from './verts';
9
10
  /** Tints a world can use at once, white included (see palette). */
10
11
  export declare const MAX_TINTS = 16;
11
12
  /** Shadow map side in texels. */
@@ -134,7 +135,7 @@ export interface Renderer {
134
135
  /** The own player when the camera is not in his head (seated in a rover): drawn whole, like the others. */
135
136
  self?: PlayerState,
136
137
  /** Adds what else moves in the map (the doors): drawn lit, casting shadows, with the other players. */
137
- more?: (v: number[]) => void): void;
138
+ more?: (v: Out) => void): void;
138
139
  /** A world point on screen as of the last frame, in [0, 1] from the top left. */
139
140
  project(x: number, y: number, z: number): [number, number] | undefined;
140
141
  /** The footsteps of the player `id`'s runner so far (Gait.steps), undefined before it is drawn. */
@@ -1,6 +1,7 @@
1
1
  import type { Rover } from '../shared/types';
2
2
  import type { World } from '../shared/world';
3
3
  import type { Vec3 } from './mesh';
4
+ import type { Out } from './verts';
4
5
  /** A point of the body's frame: metres right, up and ahead of the centre. */
5
6
  export declare const P: (x: number, y: number, a: number) => Vec3;
6
7
  /** A flat polygon of three or four corners facing `to`; a fourth number of the colour is its layer. */
@@ -11,7 +12,7 @@ export declare const loft: (o: number[], a: Vec3[], b: Vec3[], cols: number[][],
11
12
  export declare const LINK: number[];
12
13
  export declare const TUBE: number[];
13
14
  /** A tube from a to b, r thick. */
14
- export declare const rod: (o: number[], tube: number[], a: Vec3, b: Vec3, r: number, rgb: number[]) => void;
15
+ export declare const rod: (o: Out, tube: number[], a: Vec3, b: Vec3, r: number, rgb: number[]) => void;
15
16
  /**
16
17
  * How far each wheel's spring is squeezed, metres in 0..CMAX, in AT's order: the simulation's own
17
18
  * (wheels() in shared/rover.ts), from the state and the world alone. 0 is a wheel hanging in the air.
@@ -45,4 +46,4 @@ export declare const contacts: (r: Rover, w: World) => Vec3[];
45
46
  * Its damage shows (wreck.ts, `n` its index among the map's vehicles): scorched where it arcs; a
46
47
  * wreck sagged on splayed wheels, charred, falling apart at the end.
47
48
  */
48
- export declare const rover: (out: number[], state: Rover, w: World, spin: number, rgb: number[], lod: number, n?: number) => void;
49
+ export declare const rover: (out: Out, state: Rover, w: World, spin: number, rgb: number[], lod: number, n?: number) => void;
@@ -1,6 +1,7 @@
1
1
  import type { Choice } from '../shared/types';
2
2
  import type { Quat } from './rig';
3
3
  import type { Vec3 } from './mesh';
4
+ import type { Out } from './verts';
4
5
  /** The regions a runner's outfit is recoloured or covered by: the skin, the trousers, the boots, the gloves, the stripes and the belt. */
5
6
  export declare const REGION: {
6
7
  FLESH: number;
@@ -106,7 +107,7 @@ export declare const bindOf: (build?: number) => Vec3[];
106
107
  * carry it, their dual quaternions mixed by the weights (so a bent joint keeps its thickness), its
107
108
  * normal turned the same way.
108
109
  */
109
- export declare const skin: (out: number[], s: Skin, { pos, rot }: {
110
+ export declare const skin: (out: Out, s: Skin, { pos, rot }: {
110
111
  pos: Vec3[];
111
112
  rot: Quat[];
112
113
  }, colors: number[][], face?: ArrayLike<number>) => void;
@@ -7,6 +7,7 @@ import type { Vec3 } from './mesh';
7
7
  import type { Pose } from './rig';
8
8
  import type { Face } from './expression';
9
9
  import type { Trail } from './trail';
10
+ import type { Out } from './verts';
10
11
  /** What a runner keeps between frames. */
11
12
  export interface Runner {
12
13
  /** The player as last seen. */
@@ -116,7 +117,7 @@ export declare const fried: (p: PlayerState) => number;
116
117
  * at once, each drifts up and out on its own, and goes when `k` passes its own share, so the body
117
118
  * thins to nothing.
118
119
  */
119
- export declare const dissolve: (out: number[], from: number, k: number) => void;
120
+ export declare const dissolve: (out: Out, from: number, k: number) => void;
120
121
  /**
121
122
  * Appends a runner at level of detail `lod` (see body(): 0 far, 1 near, 3 close; its weapon is near
122
123
  * when the runner is close): the jacket in `color` (r, g, b), dark
@@ -141,7 +142,7 @@ export declare const stance: (r: Runner) => {
141
142
  carry: [Vec3, Vec3[]] | undefined;
142
143
  };
143
144
  /** Draws the runner and gives back its solved skeleton, or nothing once a bolt has burnt it away. */
144
- export declare const soldier: (out: number[], r: Runner, color: number[], lod?: number, helmets?: boolean, armored?: boolean) => {
145
+ export declare const soldier: (out: Out, r: Runner, color: number[], lod?: number, helmets?: boolean, armored?: boolean) => {
145
146
  pos: Vec3[];
146
147
  rot: import("./rig").Quat[];
147
148
  } | undefined;
@@ -1,5 +1,6 @@
1
1
  import type { WorldDef } from '../shared/world';
2
2
  import type { Vec3 } from './mesh';
3
+ import type { Out } from './verts';
3
4
  /** Cars on the roads round the play area, and on the rest of the grid out to MARKS, fewer to the kilometre. */
4
5
  export declare const CARS = 64;
5
6
  export declare const FAR_CARS = 160;
@@ -42,4 +43,4 @@ export declare const MODEL: {
42
43
  * The drawer of a world's traffic: appends the cars in view (in front of the camera, within FAR) at
43
44
  * time t, each BODY + CABIN + LAMPS vertices, the cabin only up to NEAR_CAR and the lamps up to LIT.
44
45
  */
45
- export declare const traffic: (def: WorldDef) => (out: number[], eye: Vec3, fwd: Vec3, t: number) => void;
46
+ export declare const traffic: (def: WorldDef) => (out: Out, eye: Vec3, fwd: Vec3, t: number) => void;
@@ -1,4 +1,5 @@
1
1
  import type { Vec3 } from './mesh';
2
+ import type { Out } from './verts';
2
3
  /** Seconds a sample of the trail lasts. */
3
4
  export declare const LIFE = 0.15;
4
5
  export interface Trail {
@@ -7,7 +8,7 @@ export interface Trail {
7
8
  /** Ages the samples by dt seconds and drops the ones that are over. */
8
9
  update(dt: number): void;
9
10
  /** Appends the ribbon, in the vertex format of mesh.ts. */
10
- draw(out: number[]): void;
11
+ draw(out: Out): void;
11
12
  /** The samples alive now. */
12
13
  readonly count: number;
13
14
  }