@korial29/tiny-fps 1.8.0 → 1.9.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.
Files changed (102) hide show
  1. package/dist/cast-art-DbwsToaQ.js +1 -0
  2. package/dist/index.js +8 -7
  3. package/dist/landfall-CSZGx2iA.js +21 -0
  4. package/dist/types/client/armor/clip.d.ts +22 -0
  5. package/dist/types/client/armor/cooking.d.ts +14 -0
  6. package/dist/types/client/armor/details.d.ts +65 -0
  7. package/dist/types/client/armor/fit.d.ts +8 -0
  8. package/dist/types/client/armor/regions.d.ts +304 -0
  9. package/dist/types/client/armor/scratches.d.ts +4 -0
  10. package/dist/types/client/armor/shell.d.ts +46 -0
  11. package/dist/types/client/armor/types.d.ts +37 -0
  12. package/dist/types/client/armor/wear.d.ts +22 -0
  13. package/dist/types/client/armor.d.ts +9 -393
  14. package/dist/types/client/body/constants.d.ts +35 -0
  15. package/dist/types/client/body/create.d.ts +3 -0
  16. package/dist/types/client/body/fingers.d.ts +112 -0
  17. package/dist/types/client/body/glove.d.ts +27 -0
  18. package/dist/types/client/body/hands.d.ts +28 -0
  19. package/dist/types/client/body/hunter.d.ts +26 -0
  20. package/dist/types/client/body/motion.d.ts +42 -0
  21. package/dist/types/client/body/reach.d.ts +65 -0
  22. package/dist/types/client/body/types.d.ts +39 -0
  23. package/dist/types/client/body/wield.d.ts +30 -0
  24. package/dist/types/client/body.d.ts +10 -207
  25. package/dist/types/client/cast-art.d.ts +2 -0
  26. package/dist/types/client/gait/constants.d.ts +34 -0
  27. package/dist/types/client/gait/create.d.ts +3 -0
  28. package/dist/types/client/gait/fists.d.ts +55 -0
  29. package/dist/types/client/gait/maths.d.ts +38 -0
  30. package/dist/types/client/gait/moves.d.ts +129 -0
  31. package/dist/types/client/gait/types.d.ts +59 -0
  32. package/dist/types/client/gait.d.ts +6 -146
  33. package/dist/types/client/gun/ammo.d.ts +21 -0
  34. package/dist/types/client/gun/display.d.ts +32 -0
  35. package/dist/types/client/gun/held.d.ts +75 -0
  36. package/dist/types/client/gun/kinds.d.ts +12 -0
  37. package/dist/types/client/gun/loft.d.ts +16 -0
  38. package/dist/types/client/gun/paint.d.ts +30 -0
  39. package/dist/types/client/gun/railgun.d.ts +34 -0
  40. package/dist/types/client/gun/reload.d.ts +112 -0
  41. package/dist/types/client/gun/rifle.d.ts +54 -0
  42. package/dist/types/client/gun/sidearm.d.ts +32 -0
  43. package/dist/types/client/gun.d.ts +10 -308
  44. package/dist/types/client/hulk/cabin.d.ts +36 -0
  45. package/dist/types/client/hulk/common.d.ts +55 -0
  46. package/dist/types/client/hulk/debris.d.ts +16 -0
  47. package/dist/types/client/hulk/hull.d.ts +81 -0
  48. package/dist/types/client/hulk/inside.d.ts +5 -0
  49. package/dist/types/client/hulk/parts.d.ts +16 -0
  50. package/dist/types/client/hulk/types.d.ts +7 -0
  51. package/dist/types/client/hulk/wings.d.ts +4 -0
  52. package/dist/types/client/hulk.d.ts +8 -18
  53. package/dist/types/client/hunter/animation.d.ts +113 -0
  54. package/dist/types/client/hunter/constants.d.ts +53 -0
  55. package/dist/types/client/hunter/disc.d.ts +33 -0
  56. package/dist/types/client/hunter/harpoon.d.ts +68 -0
  57. package/dist/types/client/hunter/marine.d.ts +14 -0
  58. package/dist/types/client/hunter/model.d.ts +4 -0
  59. package/dist/types/client/hunter/rest.d.ts +7 -0
  60. package/dist/types/client/hunter.d.ts +7 -164
  61. package/dist/types/client/render/camera.d.ts +58 -0
  62. package/dist/types/client/render/constants.d.ts +63 -0
  63. package/dist/types/client/render/scene.d.ts +58 -0
  64. package/dist/types/client/render/shader.d.ts +69 -0
  65. package/dist/types/client/render/shots.d.ts +61 -0
  66. package/dist/types/client/render/types.d.ts +74 -0
  67. package/dist/types/client/render.d.ts +9 -277
  68. package/dist/types/client/sfx/air.d.ts +46 -0
  69. package/dist/types/client/sfx/anthem.d.ts +27 -0
  70. package/dist/types/client/sfx/layers.d.ts +6 -0
  71. package/dist/types/client/sfx/music.d.ts +96 -0
  72. package/dist/types/client/sfx/render.d.ts +10 -0
  73. package/dist/types/client/sfx/sounds.d.ts +180 -0
  74. package/dist/types/client/sfx/synth.d.ts +24 -0
  75. package/dist/types/client/sfx/voices.d.ts +59 -0
  76. package/dist/types/client/sfx.d.ts +8 -325
  77. package/dist/types/client/skin/head.d.ts +120 -0
  78. package/dist/types/client/skin/lofts.d.ts +145 -0
  79. package/dist/types/client/skin/pose.d.ts +102 -0
  80. package/dist/types/client/skin/shape.d.ts +2 -0
  81. package/dist/types/client/skin.d.ts +4 -179
  82. package/dist/types/client/soldier/animate.d.ts +12 -0
  83. package/dist/types/client/soldier/carry.d.ts +28 -0
  84. package/dist/types/client/soldier/common.d.ts +8 -0
  85. package/dist/types/client/soldier/draw.d.ts +12 -0
  86. package/dist/types/client/soldier/grasp.d.ts +28 -0
  87. package/dist/types/client/soldier/hunter.d.ts +38 -0
  88. package/dist/types/client/soldier/runner.d.ts +58 -0
  89. package/dist/types/client/soldier/stance.d.ts +20 -0
  90. package/dist/types/client/soldier/types.d.ts +107 -0
  91. package/dist/types/client/soldier.d.ts +9 -236
  92. package/dist/types/client/xeno/back.d.ts +113 -0
  93. package/dist/types/client/xeno/body.d.ts +63 -0
  94. package/dist/types/client/xeno/common.d.ts +28 -0
  95. package/dist/types/client/xeno/head.d.ts +109 -0
  96. package/dist/types/client/xeno/limbs.d.ts +62 -0
  97. package/dist/types/client/xeno/mouth.d.ts +23 -0
  98. package/dist/types/client/xeno/parts.d.ts +40 -0
  99. package/dist/types/client/xeno/tail.d.ts +107 -0
  100. package/dist/types/client/xeno.d.ts +8 -246
  101. package/package.json +1 -1
  102. package/dist/landfall-CXJnap8w.js +0 -21
@@ -0,0 +1,112 @@
1
+ import type { PlayerState } from '../../shared/types';
2
+ import type { Vec3 } from '../mesh';
3
+ import type { Quat } from '../rig';
4
+ import type { Out } from '../verts';
5
+ export declare const ease: (t: number) => number;
6
+ /** `t` from `a` to `b` as 0 to 1. */
7
+ export declare const span: (t: number, a: number, b: number) => number;
8
+ /** How far through the swap of the gun in hand `p` is, 0 to 1; -1 when it is not swapping. */
9
+ export declare const swapOf: (p: Pick<PlayerState, "reload" | "railed" | "rifled">) => number;
10
+ /**
11
+ * The glow of a weapon `t` seconds after it came to hand: dark as it rises, then flickering up to
12
+ * full at `end` (0.6 s; the gun's 1.4 s).
13
+ */
14
+ export declare const power: (t: number, end?: number) => number;
15
+ /** The gun's boot `t` seconds after its button is pressed (PRESS): its light up by `lit`, its counter fading in from `from` to `up`, with the BOOT sound's whine, full at its beep (the user, 2026-11-09); the rifle's digits show at `digits`. */
16
+ export declare const GUN_ON: {
17
+ lit: number;
18
+ from: number;
19
+ up: number;
20
+ digits: number;
21
+ };
22
+ /**
23
+ * Seconds after a weapon comes to hand, or a swap puts its new battery in, that its button is
24
+ * pressed, by the left index on a gun's left flank, by the right thumb on the katana's grip: it
25
+ * powers on then, light and sound (the user, 2026-11-09). The rail gun's boot plays 1.4 times as
26
+ * fast (combat.ts), so its press comes sooner.
27
+ */
28
+ export declare const PRESS = 0.45;
29
+ export declare const pressAt: (kind: number) => number;
30
+ /**
31
+ * The selected weapon slot, or -1 when bare-handed or down: 0 the gun, which is also the Hunter's
32
+ * pistol (`sided`) beside his harpoon.
33
+ */
34
+ export declare const handOf: (p: Pick<PlayerState, "down" | "fists" | "wield" | "rifled" | "railed" | "ammo" | "sided">) => number;
35
+ /**
36
+ * A tracker of the weapons each player has had in hand since taking them: true when the weapon in
37
+ * `p`'s hand comes to it for the first time, the only time it is switched on (the user,
38
+ * 2026-11-09). A weapon the player no longer carries (lost going down) is forgotten.
39
+ */
40
+ export declare const firsts: () => (p: Pick<PlayerState, "id" | "ammo" | "fists" | "blade" | "rail" | "rifle" | "down" | "wield" | "rifled" | "railed">) => boolean;
41
+ /**
42
+ * The rail gun's capsule `t` after the gun came to hand, the left hand on it at `at`: turned a
43
+ * quarter of a turn to tune it on (the user, 2026-11-09), radians, as the screw turns it.
44
+ */
45
+ export declare const tune: (t: number, at?: number) => number;
46
+ /** The pressing finger `t` after a weapon came to hand, its press at `at`: where it was (0), on the button (1) by `at`, then back. */
47
+ export declare const poke: (t: number, at?: number) => number;
48
+ /**
49
+ * Each weapon's button by kind (the gun, the katana, the rail gun, the rifle), in its model space,
50
+ * on its left flank, in sight, for the left index: its foot, the way it faces, how far it stands
51
+ * out. The katana's on the top of its grip, under the right thumb.
52
+ */
53
+ export declare const BUTTONS: [Vec3, Vec3, number][];
54
+ /** The way, in the hand (x toward the thumb, y its back, z the fingers), from the right thumb's middle joint to weapon `kind`'s button: the katana's. */
55
+ export declare const thumbTo: (kind: number) => Vec3;
56
+ /** Weapon `kind`'s button for a model at `at` with axes [right, up, forward] (model -z forward): its top, and the way it faces. */
57
+ export declare const buttonAt: (kind: number, at: Vec3, [r, u, f]: Vec3[]) => Vec3[];
58
+ /** 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`. */
59
+ export declare const button: (out: Out, kind: number, push: number, light: number, rgb: number[]) => void;
60
+ /** When, in the swap of the gun or the rifle, the palm slaps the new battery home: it clicks then. */
61
+ export declare const TAP = 0.76;
62
+ /**
63
+ * The swap's moments (the user, 2026-11-09: let the battery fall to the floor, take a new one out
64
+ * of a pouch on the belt and put it in): the old battery or cell let go and thrown out (the rail
65
+ * gun's capsule, off its socket); the left hand at the pouch, holding the new one, and with it
66
+ * under the grip, where it goes in.
67
+ */
68
+ export declare const RELEASE: number, RAIL_RELEASE: number, AT_POUCH: number, TAKEN: number, BROUGHT: number;
69
+ /** What each player's gun was last drawn at in its swap: the drop is thrown as it passes RELEASE. */
70
+ export declare const swaps: Map<number, number>;
71
+ /**
72
+ * Where the battery or the capsule is at `s` of a swap (0 to 1; -1 none): how far out of its seat
73
+ * along its axis (metres), how far round its axis (radians, the capsule's screw), and how far it
74
+ * tumbles (radians). The old one comes out and goes, the new one comes in, the left hand bringing it.
75
+ */
76
+ export declare const swapped: (s: number, kind: boolean | number) => number[];
77
+ /**
78
+ * The screwing of a new capsule at `s` of a swap: how far round it still is (radians, to 0 when it
79
+ * is in), and how far the wrist has turned from where it took hold: with it through each stroke,
80
+ * then back while the fingers let go.
81
+ */
82
+ export declare const screwed: (s: number) => number[];
83
+ /** The moments of a swap that sound, as shares of it: the battery let go and clicked home; the capsule jumping off and each turn of the screw. */
84
+ export declare const CUES: number[][];
85
+ /**
86
+ * The frame of the battery (the capsule when `rail`) of a gun whose grip is at `at` and whose axes
87
+ * are `ax`, `k` times its size, at `s` of a swap: its foot (base) and its axes, its forward along
88
+ * the grip (up).
89
+ */
90
+ export declare const loadFrame: (at: Vec3, ax: Vec3[], kind: boolean | number, s?: number, k?: number, i?: number, tuned?: number) => [Vec3, Vec3[]];
91
+ /**
92
+ * The spark between the electrodes' tips at the time `t` (s), in model space: a thin glowing line
93
+ * through four jagged points, a new shape 30 times a second.
94
+ */
95
+ export declare const arc: (t: number) => number[];
96
+ /**
97
+ * Where the left hand holds a rail gun whose grip is at `at` and whose axes are [right, up,
98
+ * forward]: the middle of its front grip, and the way the grip runs from its foot up to the barrel,
99
+ * which the thumb points along (see wield() in body.ts). For the laser rifle (`kind` 3): under its
100
+ * handguard, the thumb along it, and the way the hand goes, across under it to its right.
101
+ */
102
+ export declare const fore: (at: Vec3, [r, u, f]: Vec3[], kind?: boolean | number) => [Vec3, Vec3, Vec3?];
103
+ /** fore() for the hand at `pos` turned by `q`, which holds the grip. */
104
+ export declare const foregrip: (pos: Vec3, q: Quat, kind?: boolean | number) => [Vec3, Vec3, (Vec3 | undefined)?];
105
+ /** The rail gun's lightning left as the counters show it: 99 when full (of `max`, a load by default), 0 when spent. */
106
+ export declare const charge: (rail: number, max?: number) => number;
107
+ /** The electrodes' tips of a gun whose grip is at `at` and whose axes are [right, up, forward]. */
108
+ export declare const electrodes: (at: Vec3, [, u, f]: Vec3[]) => Vec3[];
109
+ /** The gun's axes [right, up, forward] for a hand turned by `q` (see body.ts: its thumb is the hand's -z, the back of the hand its x, its fingers its -y), the grip tilted in it as a weapon of `kind` is (tiltOf()). */
110
+ export declare const axes: (q: Quat, kind?: boolean | number) => Vec3[];
111
+ /** The middle of the grip, for a wrist at `pos`: 8 cm along the fingers and 2 cm toward the palm, or as a weapon of `kind` is held (holdOf()). */
112
+ export declare const grip: (pos: Vec3, q: Quat, kind?: boolean | number) => Vec3;
@@ -0,0 +1,54 @@
1
+ import type { Vec3 } from '../mesh';
2
+ import type { Out } from '../verts';
3
+ import type { Paint } from './loft';
4
+ export declare const HOUSING_FOOT: number, HOUSING_BACK: number, HOUSING_SLOPE: number;
5
+ /** Appends the housing: its sides, its top and its two ends, in polished grey metal, the normals smooth round the top corners. */
6
+ export declare const housing: (out: Out, lod: number) => void;
7
+ /** The laser rifle's muzzle, the lens at the end of its shroud, and the middle of its handguard, the block under its body that the left hand carries. */
8
+ export declare const RIFLE_MUZZLE: Vec3;
9
+ export declare const RIFLE_GRIP: Vec3;
10
+ /** The handguard's half width and half height, and how much it rises forward, as the body's underside does. */
11
+ export declare const GUARD: [number, number];
12
+ export declare const RIFLE_RISE = 0.096;
13
+ /** The mouth of the grenade launcher, out of the front of the handguard: in the gun's space like RIFLE_MUZZLE. */
14
+ export declare const NADE_MUZZLE: Vec3;
15
+ /**
16
+ * How the left hand carries the handguard (the user, 2026-11-10: the fist closed beside it): where
17
+ * the block's middle is from the wrist, along the fingers and toward the palm (FIST's, in body.ts),
18
+ * so that the block lies in the palm and the fingers stand up its right side; the fingers
19
+ * square across it, as [sin, cos] of their lean; and how closed they are, a cup, not a fist.
20
+ */
21
+ export declare const RIFLE_HOLD: number[];
22
+ export declare const RIFLE_TILT: number[];
23
+ export declare const RIFLE_CURL = 0.45;
24
+ /** The red of the laser, which blooms. */
25
+ export declare const LASER: number[];
26
+ export declare const red: Paint;
27
+ /** Dark olive gunmetal, lighter on its top faces. */
28
+ export declare const olive: Paint;
29
+ export declare const rifled: number[][];
30
+ /** Linear between the rows of `rows` (sorted by their first column) at `f`. */
31
+ export declare const along: (rows: number[][], f: number) => number[];
32
+ /** Near-black for the grooves and slots, a bright lip under them, and three LEDs that bloom. */
33
+ export declare const slot: Paint;
34
+ export declare const lip: Paint;
35
+ /**
36
+ * The rifle's small details (the user, 2026-11-09: grooves along it, screw heads, a little
37
+ * electronics), on the near model only: two grooves along the top of the housing and one along each
38
+ * side with a bright lip under it, cross-head screws on the housing and the body, a dark panel of
39
+ * three LEDs on each side of the housing at the back, and a vent of five slots on each side of the butt.
40
+ */
41
+ /** A flat quad `q` facing `n`, painted. */
42
+ export declare const flat: (out: Out, q: Vec3[], n: Vec3, paint: Paint) => void;
43
+ /** A rectangle on a surface: `at(u, v)` the point `u` along and `v` across it. */
44
+ export declare const rect: (out: Out, at: (u: number, v: number) => Vec3, u0: number, u1: number, v0: number, v1: number, n: Vec3, paint: Paint) => void;
45
+ /** A cross-head screw at `c` on a surface of normal `n`, `e` and `w` across it, `k` times the rifle's. */
46
+ export declare const screw: (out: Out, c: Vec3, e: Vec3, w: Vec3, n: Vec3, k?: number) => void;
47
+ export declare const details: (out: Out) => void;
48
+ /**
49
+ * The laser rifle (the user, 2026-11-08), built once like gun(), after Halo's assault rifle held in
50
+ * both hands: a long angular body from the butt at the shoulder past the grip (a bullpup), a tall
51
+ * housing over the grip whose sloped back carries the counter (scope()), a square shroud to a red
52
+ * lens, held from under it by the left hand, and a strip of red light along each side.
53
+ */
54
+ export declare const rifle: (lod: number) => number[];
@@ -0,0 +1,32 @@
1
+ import type { Vec3 } from '../mesh';
2
+ /**
3
+ * The back of the body and the muzzle, the tip of the nose, in model space (the tail and the front of
4
+ * the emitter): the line through them is the gun's long axis, the way it points and the way the
5
+ * beam leaves. The grip's tilt: its lower end goes back by TILT[0] for each TILT[1] down.
6
+ */
7
+ export declare const REAR: Vec3;
8
+ export declare const MUZZLE: Vec3;
9
+ export declare const TILT: number[];
10
+ export declare const built: number[][];
11
+ /**
12
+ * The pistol's back (the user, 2026-11-09: like the rifle's counter, the top of the gun in one
13
+ * piece, cut by a straight leaning face): the face through BACK, facing BACK_N, back and up toward
14
+ * the player. The counter's support, a glossy black rounded trapezoid, sits on it (readout()).
15
+ */
16
+ export declare const BACK: Vec3;
17
+ export declare const BACK_N: Vec3;
18
+ /** The smooth outline over the cut: its middle up the face from BACK, its half width and half height, holding the cut's polygon. */
19
+ export declare const FACE: number[];
20
+ /**
21
+ * The gun at a level of detail (0 far, 1 near), built once, in the vertex format of mesh.ts, after
22
+ * the Halo plasma pistol: a smooth bulbous upper body tapering to a glowing emitter on its nose, a
23
+ * chunky lower shell under the hand, a short thick grip between them, and cyan strips along the
24
+ * sides.
25
+ */
26
+ export declare const gun: (lod: number) => number[];
27
+ /**
28
+ * The pistol's printed circuit on each flank of its body, mirrored: runs of [forward, up round from
29
+ * the side's middle] points (metres along the surface), a pad at each end. Above and under the
30
+ * light strip, clear of the cut back.
31
+ */
32
+ export declare const CIRCUIT: number[][][];
@@ -1,308 +1,10 @@
1
- import type { PlayerState } from '../shared/types';
2
- import type { World } from '../shared/world';
3
- import type { Vec3 } from './mesh';
4
- import type { Quat } from './rig';
5
- import type { Out } from './verts';
6
- import type { Pieces } from './store';
7
- /**
8
- * The back of the body and the muzzle, the tip of the nose, in model space (the tail and the front of
9
- * the emitter): the line through them is the gun's long axis, the way it points and the way the
10
- * beam leaves. The grip's tilt: its lower end goes back by TILT[0] for each TILT[1] down.
11
- */
12
- export declare const REAR: Vec3;
13
- export declare const MUZZLE: Vec3;
14
- export declare const TILT: number[];
15
- /**
16
- * The pistol's back (the user, 2026-11-09: like the rifle's counter, the top of the gun in one
17
- * piece, cut by a straight leaning face): the face through BACK, facing BACK_N, back and up toward
18
- * the player. The counter's support, a glossy black rounded trapezoid, sits on it (readout()).
19
- */
20
- export declare const BACK: Vec3;
21
- export declare const BACK_N: Vec3;
22
- /**
23
- * The gun at a level of detail (0 far, 1 near), built once, in the vertex format of mesh.ts, after
24
- * the Halo plasma pistol: a smooth bulbous upper body tapering to a glowing emitter on its nose, a
25
- * chunky lower shell under the hand, a short thick grip between them, and cyan strips along the
26
- * sides.
27
- */
28
- export declare const gun: (lod: number) => number[];
29
- /**
30
- * The pistol's printed circuit on each flank of its body, mirrored: runs of [forward, up round from
31
- * the side's middle] points (metres along the surface), a pad at each end. Above and under the
32
- * light strip, clear of the cut back.
33
- */
34
- export declare const CIRCUIT: number[][][];
35
- /** The rail gun's muzzle, between its electrodes' tips: on the gun's long axis (REAR to MUZZLE), 36 cm further out. */
36
- export declare const RAIL_MUZZLE: Vec3;
37
- /** The middle of the rail gun's front grip, under the barrel, where the left hand holds it. */
38
- export declare const FOREGRIP: Vec3;
39
- /** The violet white of a Tesla arc, which blooms. */
40
- export declare const ARC: number[];
41
- /**
42
- * The rail gun at a level of detail (0 far, 1 near), built once like gun(), after a Tesla gun held
43
- * in both hands: a stock to the shoulder, a gunmetal receiver over the same grip, a front grip under
44
- * a barrel in three copper coils, and two electrodes forking out of its end, up and down, each
45
- * tipped with a glowing ball. arc() is the spark between them.
46
- */
47
- export declare const railgun: (lod: number) => number[];
48
- /**
49
- * The rail gun's two ceramic insulators standing on its barrel, stacks of four ribbed discs, built
50
- * once for each of 5 steps of `heat` (0 to 1): from grey green to orange as the gun heats, glowing
51
- * in its last quarter.
52
- */
53
- export declare const insulators: (lod: number, heat?: number) => number[];
54
- /** The Hunter's pistol: its own model (pistol.ts), on the gun's marks. */
55
- export declare const hunterGun: (lod: number) => number[];
56
- /** The weapon a gun model is, from a player or a flag: 0 the gun, 2 the rail gun (or true), 3 the laser rifle. */
57
- export declare const kindOf: (p: Pick<PlayerState, "railed" | "rifled"> | boolean | number) => number;
58
- export declare const LONG_TILT: number[];
59
- export declare const LONG_HOLD: number[];
60
- export declare const LONG_CURL = 0.72;
61
- /** The hold of a weapon of `kind` (kindOf()) in the hand that has its grip. */
62
- export declare const holdOf: (kind?: boolean | number) => number[];
63
- /** The grip's tilt in the hand for a weapon of `kind` (kindOf()): the pistol's, or a long gun's. */
64
- export declare const tiltOf: (kind?: boolean | number) => number[];
65
- /** The laser rifle's muzzle, the lens at the end of its shroud, and the middle of its handguard, the block under its body that the left hand carries. */
66
- export declare const RIFLE_MUZZLE: Vec3;
67
- export declare const RIFLE_GRIP: Vec3;
68
- /** The handguard's half width and half height, and how much it rises forward, as the body's underside does. */
69
- export declare const GUARD: [number, number];
70
- export declare const RIFLE_RISE = 0.096;
71
- /** The mouth of the grenade launcher, out of the front of the handguard: in the gun's space like RIFLE_MUZZLE. */
72
- export declare const NADE_MUZZLE: Vec3;
73
- /**
74
- * How the left hand carries the handguard (the user, 2026-11-10: the fist closed beside it): where
75
- * the block's middle is from the wrist, along the fingers and toward the palm (FIST's, in body.ts),
76
- * so that the block lies in the palm and the fingers stand up its right side; the fingers
77
- * square across it, as [sin, cos] of their lean; and how closed they are, a cup, not a fist.
78
- */
79
- export declare const RIFLE_HOLD: number[];
80
- export declare const RIFLE_TILT: number[];
81
- export declare const RIFLE_CURL = 0.45;
82
- /** The red of the laser, which blooms. */
83
- export declare const LASER: number[];
84
- /**
85
- * The laser rifle (the user, 2026-11-08), built once like gun(), after Halo's assault rifle held in
86
- * both hands: a long angular body from the butt at the shoulder past the grip (a bullpup), a tall
87
- * housing over the grip whose sloped back carries the counter (scope()), a square shroud to a red
88
- * lens, held from under it by the left hand, and a strip of red light along each side.
89
- */
90
- export declare const rifle: (lod: number) => number[];
91
- /** The rifle's power cell, built once: a box of olive metal along its own forward from its foot, a red band near the foot. */
92
- export declare const cell: (lod: number) => number[];
93
- /**
94
- * The gun's battery (the user, 2026-11-08), built once: a gunmetal cell in the grip, along its own
95
- * forward from its foot, which stands out under the lower shell with a band of glow round it.
96
- */
97
- export declare const battery: (lod: number) => number[];
98
- /**
99
- * The rail gun's cell (the user, 2026-11-08: its batteries in view), built once for each of 9 steps
100
- * of `level` (0 to 1): a threaded copper base (it screws into the socket on the gun), a column of
101
- * violet lightning as high as the level in a dark glass tube, in a cage of three steel posts, and a
102
- * cap with its terminal, standing along its own forward from its base.
103
- */
104
- export declare const capsule: (lod: number, level?: number) => number[];
105
- export declare const ease: (t: number) => number;
106
- /** `t` from `a` to `b` as 0 to 1. */
107
- export declare const span: (t: number, a: number, b: number) => number;
108
- /** How far through the swap of the gun in hand `p` is, 0 to 1; -1 when it is not swapping. */
109
- export declare const swapOf: (p: Pick<PlayerState, "reload" | "railed" | "rifled">) => number;
110
- /**
111
- * The glow of a weapon `t` seconds after it came to hand: dark as it rises, then flickering up to
112
- * full at `end` (0.6 s; the gun's 1.4 s).
113
- */
114
- export declare const power: (t: number, end?: number) => number;
115
- /** The gun's boot `t` seconds after its button is pressed (PRESS): its light up by `lit`, its counter fading in from `from` to `up`, with the BOOT sound's whine, full at its beep (the user, 2026-11-09); the rifle's digits show at `digits`. */
116
- export declare const GUN_ON: {
117
- lit: number;
118
- from: number;
119
- up: number;
120
- digits: number;
121
- };
122
- /**
123
- * Seconds after a weapon comes to hand, or a swap puts its new battery in, that its button is
124
- * pressed, by the left index on a gun's left flank, by the right thumb on the katana's grip: it
125
- * powers on then, light and sound (the user, 2026-11-09). The rail gun's boot plays 1.4 times as
126
- * fast (combat.ts), so its press comes sooner.
127
- */
128
- export declare const PRESS = 0.45;
129
- export declare const pressAt: (kind: number) => number;
130
- /**
131
- * The selected weapon slot, or -1 when bare-handed or down: 0 the gun, which is also the Hunter's
132
- * pistol (`sided`) beside his harpoon.
133
- */
134
- export declare const handOf: (p: Pick<PlayerState, "down" | "fists" | "wield" | "rifled" | "railed" | "ammo" | "sided">) => number;
135
- /**
136
- * A tracker of the weapons each player has had in hand since taking them: true when the weapon in
137
- * `p`'s hand comes to it for the first time, the only time it is switched on (the user,
138
- * 2026-11-09). A weapon the player no longer carries (lost going down) is forgotten.
139
- */
140
- export declare const firsts: () => (p: Pick<PlayerState, "id" | "ammo" | "fists" | "blade" | "rail" | "rifle" | "down" | "wield" | "rifled" | "railed">) => boolean;
141
- /**
142
- * The rail gun's capsule `t` after the gun came to hand, the left hand on it at `at`: turned a
143
- * quarter of a turn to tune it on (the user, 2026-11-09), radians, as the screw turns it.
144
- */
145
- export declare const tune: (t: number, at?: number) => number;
146
- /** The pressing finger `t` after a weapon came to hand, its press at `at`: where it was (0), on the button (1) by `at`, then back. */
147
- export declare const poke: (t: number, at?: number) => number;
148
- /**
149
- * Each weapon's button by kind (the gun, the katana, the rail gun, the rifle), in its model space,
150
- * on its left flank, in sight, for the left index: its foot, the way it faces, how far it stands
151
- * out. The katana's on the top of its grip, under the right thumb.
152
- */
153
- export declare const BUTTONS: [Vec3, Vec3, number][];
154
- /** The way, in the hand (x toward the thumb, y its back, z the fingers), from the right thumb's middle joint to weapon `kind`'s button: the katana's. */
155
- export declare const thumbTo: (kind: number) => Vec3;
156
- /** Weapon `kind`'s button for a model at `at` with axes [right, up, forward] (model -z forward): its top, and the way it faces. */
157
- export declare const buttonAt: (kind: number, at: Vec3, [r, u, f]: Vec3[]) => Vec3[];
158
- /** 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`. */
159
- export declare const button: (out: Out, kind: number, push: number, light: number, rgb: number[]) => void;
160
- /** When, in the swap of the gun or the rifle, the palm slaps the new battery home: it clicks then. */
161
- export declare const TAP = 0.76;
162
- /**
163
- * The swap's moments (the user, 2026-11-09: let the battery fall to the floor, take a new one out
164
- * of a pouch on the belt and put it in): the old battery or cell let go and thrown out (the rail
165
- * gun's capsule, off its socket); the left hand at the pouch, holding the new one, and with it
166
- * under the grip, where it goes in.
167
- */
168
- export declare const RELEASE: number, RAIL_RELEASE: number, AT_POUCH: number, TAKEN: number, BROUGHT: number;
169
- /**
170
- * Where the battery or the capsule is at `s` of a swap (0 to 1; -1 none): how far out of its seat
171
- * along its axis (metres), how far round its axis (radians, the capsule's screw), and how far it
172
- * tumbles (radians). The old one comes out and goes, the new one comes in, the left hand bringing it.
173
- */
174
- export declare const swapped: (s: number, kind: boolean | number) => number[];
175
- /**
176
- * The screwing of a new capsule at `s` of a swap: how far round it still is (radians, to 0 when it
177
- * is in), and how far the wrist has turned from where it took hold: with it through each stroke,
178
- * then back while the fingers let go.
179
- */
180
- export declare const screwed: (s: number) => number[];
181
- /** The moments of a swap that sound, as shares of it: the battery let go and clicked home; the capsule jumping off and each turn of the screw. */
182
- export declare const CUES: number[][];
183
- /**
184
- * The frame of the battery (the capsule when `rail`) of a gun whose grip is at `at` and whose axes
185
- * are `ax`, `k` times its size, at `s` of a swap: its foot (base) and its axes, its forward along
186
- * the grip (up).
187
- */
188
- export declare const loadFrame: (at: Vec3, ax: Vec3[], kind: boolean | number, s?: number, k?: number, i?: number, tuned?: number) => [Vec3, Vec3[]];
189
- /**
190
- * The spark between the electrodes' tips at the time `t` (s), in model space: a thin glowing line
191
- * through four jagged points, a new shape 30 times a second.
192
- */
193
- export declare const arc: (t: number) => number[];
194
- /**
195
- * Where the left hand holds a rail gun whose grip is at `at` and whose axes are [right, up,
196
- * forward]: the middle of its front grip, and the way the grip runs from its foot up to the barrel,
197
- * which the thumb points along (see wield() in body.ts). For the laser rifle (`kind` 3): under its
198
- * handguard, the thumb along it, and the way the hand goes, across under it to its right.
199
- */
200
- export declare const fore: (at: Vec3, [r, u, f]: Vec3[], kind?: boolean | number) => [Vec3, Vec3, Vec3?];
201
- /** fore() for the hand at `pos` turned by `q`, which holds the grip. */
202
- export declare const foregrip: (pos: Vec3, q: Quat, kind?: boolean | number) => [Vec3, Vec3, (Vec3 | undefined)?];
203
- /** The rail gun's lightning left as the counters show it: 99 when full (of `max`, a load by default), 0 when spent. */
204
- export declare const charge: (rail: number, max?: number) => number;
205
- /** The electrodes' tips of a gun whose grip is at `at` and whose axes are [right, up, forward]. */
206
- export declare const electrodes: (at: Vec3, [, u, f]: Vec3[]) => Vec3[];
207
- /** The gun's axes [right, up, forward] for a hand turned by `q` (see body.ts: its thumb is the hand's -z, the back of the hand its x, its fingers its -y), the grip tilted in it as a weapon of `kind` is (tiltOf()). */
208
- export declare const axes: (q: Quat, kind?: boolean | number) => Vec3[];
209
- /** The middle of the grip, for a wrist at `pos`: 8 cm along the fingers and 2 cm toward the palm, or as a weapon of `kind` is held (holdOf()). */
210
- export declare const grip: (pos: Vec3, q: Quat, kind?: boolean | number) => Vec3;
211
- /**
212
- * Printed circuit tracks round the digits, inside the frame (the user, 2026-11-09): the right
213
- * half's, mirrored to the left, each a run of [across, up from the middle] points ending in a pad.
214
- */
215
- export declare const TRACKS: number[][][];
216
- /**
217
- * The shots in the battery as two glowing seven-segment digits on a dark screen set in the back of
218
- * a small block on top of the body, in model space: cyan, red at 4 or fewer, thick segments that bloom only a
219
- * little, the screen framed in a line of their colour. The block is part of the readout, so only a gun that shows the ammo carries it. 99 at most.
220
- * While the gun charges, a gauge of CHARGE_MAX cells under the digits lights `level` of them, the
221
- * strength the shot would have; all orange at the full charge. Not `shown`: the block and the dark
222
- * screen only, the gun still booting.
223
- */
224
- export declare const readout: (ammo: number, level?: number, shown?: boolean, glyphs?: boolean) => number[];
225
- /**
226
- * The rail gun's counter, a small LCD out of the left of its receiver turned to the player, in model space
227
- * (the user, 2026-11-08: like the screen on the back of a digital camera), in a dark case: neon like
228
- * the others' (the user, 2026-11-08), two glowing violet digits on a dark screen framed in a line of
229
- * their colour, red at 5 or less. It counts as the HUD does (charge()): a full capsule is 33.
230
- */
231
- export declare const lcd: (ammo: number) => number[];
232
- /**
233
- * The laser rifle's counter (`n` rounds in its cell), in model space: a trapezoid screen, narrow at
234
- * the top, set in the sloped back of the housing and turned to the eye, ringed in a line of the
235
- * digits' colour (cyan, red at 7 or fewer), with the two digits once `shown`; under them, when
236
- * `nades` is given, NADE_MAX orange pips for the launcher's grenades, dim for the spent ones (the
237
- * user, 2026-11-10). All glow but the dark screen.
238
- */
239
- export declare const scope: (n: number, shown?: boolean, nades?: number) => number[];
240
- /**
241
- * How a gun is drawn beyond its place: its glow from 0 (off) to 1, the swap under way (0 to 1, -1
242
- * none), whether its battery or capsule holds any, how far the gun's counter has faded in (0 dark,
243
- * 1 lit) and whether the rifle's digits show; for the rail gun the level of its three cells (the
244
- * one in use, then the two in reserve), its heat (0 to 1) and whether it overheated.
245
- */
246
- export interface Lit {
247
- /** The frame's pieces of the store: the gun's body, lit, goes there (store.ts). */
248
- list?: Pieces;
249
- /** The gun in the Hunter's bronze (hunterGun()): his pistol. */
250
- skin?: boolean;
251
- light?: number;
252
- swap?: number;
253
- empty?: boolean;
254
- screen?: number;
255
- digits?: boolean;
256
- cells?: number[];
257
- heat?: number;
258
- hot?: boolean;
259
- /** The laser rifle's grenades left, shown under its rounds; none shown when absent. */
260
- nades?: number;
261
- /** How far the thumb has its button in, 0 to 1. */
262
- press?: number;
263
- /** How far the rail gun's capsule is turned on (radians, tune()). */
264
- tune?: number;
265
- /**
266
- * The player whose gun it is, the floor under him and his speed: the spent battery, cell or
267
- * capsule is thrown out to fall there as the swap passes RELEASE (drops.ts).
268
- */
269
- id?: number;
270
- floor?: number;
271
- vel?: Vec3;
272
- /** Where the hand holds the new battery or cell while it brings it from the pouch (its foot and axes, as loadFrame()). */
273
- carry?: [Vec3, Vec3[]];
274
- }
275
- /** The levels of the rail gun's three cells for `p` (0 to 1): the capsule in use, then what it carries beside, a capsule's worth to each. */
276
- export declare const cellsOf: (p: Pick<PlayerState, "rail" | "cap">) => number[];
277
- /**
278
- * Appends the gun (the rail gun or the laser rifle by `kind`, the rail gun's spark at the time `t`) held in the hand at `pos`
279
- * with the world rotation `q`, `k` times its size about the grip, with the ammo on its back when
280
- * given, and the charge gauge at `level`; its battery (capsule) where the swap has it, its glow and
281
- * its counter dimmed with `light`, and the spark only when it is all on.
282
- */
283
- 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, list, skin, }?: Lit) => void;
284
- /** 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]. */
285
- export declare const tip: (at: Vec3, [, u, f]: Vec3[], kind?: boolean | number) => Vec3;
286
- /**
287
- * The axes [right, up, forward] of a gun held with its grip at `at` so that its long axis, from the
288
- * back of the body to the emitter, points at `to`: the beam leaves the emitter along it. `side` is
289
- * where the right axis points, `up` where up is. The emitter is off the grip, so the axes are found
290
- * in three rounds.
291
- */
292
- export declare const pointed: (at: Vec3, to: Vec3, side: Vec3, up: Vec3, sag?: number) => Vec3[];
293
- /** The middle of the butt plate of the rail gun and of the laser rifle, in model space: what the shoulder takes. */
294
- export declare const BUTTS: Vec3[];
295
- /**
296
- * A long gun (`kind` 2 the rail gun, 3 the rifle) shouldered: its grip and its axes [right, up,
297
- * forward] when its butt plate is at `butt` and its barrel points at `to`. The rail gun's barrel
298
- * lies on the gun's long axis, the rifle's is level in its model.
299
- */
300
- export declare const shouldered: (butt: Vec3, to: Vec3, side: Vec3, up: Vec3, kind: number) => [Vec3, Vec3[]];
301
- /** Where a runner's shots end: the first wall along its look from the eye, or the range. */
302
- export declare const focus: (p: PlayerState, world: World) => [Vec3, boolean];
303
- /**
304
- * Where a runner holds the gun when it fires at `to`: the grip, a little right of and below the eye,
305
- * and the gun's axes. The rail gun, in both hands like a rifle, is nearer the chest, so that the
306
- * left hand reaches its front grip.
307
- */
308
- export declare const aimed: (p: PlayerState, to: Vec3) => [Vec3, Vec3[]];
1
+ export * from './gun/loft';
2
+ export * from './gun/paint';
3
+ export * from './gun/sidearm';
4
+ export * from './gun/railgun';
5
+ export * from './gun/kinds';
6
+ export * from './gun/rifle';
7
+ export * from './gun/ammo';
8
+ export * from './gun/reload';
9
+ export * from './gun/display';
10
+ export * from './gun/held';
@@ -0,0 +1,36 @@
1
+ import type { V, Mat } from './types';
2
+ /** Olive drab canvas, its webbing darker, the seats' tubes dark grey. */
3
+ export declare const CANVAS: Mat;
4
+ export declare const WEB: Mat;
5
+ export declare const TUBE: Mat;
6
+ /** The flight deck: its consoles and seats, their cushions, and the instruments' faces, dim (a glow) or dead. */
7
+ export declare const CONSOLE: Mat;
8
+ export declare const CUSHION: Mat;
9
+ export declare const DIAL: Mat;
10
+ export declare const AMBER: Mat;
11
+ export declare const DEAD: Mat;
12
+ /** A tube from a to b, w across: three sides and no ends, enough at arm's length. */
13
+ export declare const rod: (a: V, b: V, w: number, m: Mat) => void;
14
+ /** A box in the frame of `o` and its axes `ax`, from `lo` to `hi` along them: its six faces, the top (+ax[1]) in `top`. */
15
+ export declare const cube: (o: V, ax: V[], lo: V, hi: V, m: Mat, top?: Mat) => void;
16
+ /** The axes `ax` turned by `t` round the unit axis `a` (Rodrigues). */
17
+ export declare const turn: (ax: V[], a: V, t: number) => number[][];
18
+ /**
19
+ * A row of fold-down troop seats along a flank, facing in: a canvas pan and a webbed back on each,
20
+ * slung from three tubes that run the row, legs every other seat. From xa to xb on the floor at y,
21
+ * the lining at `w` from the line on the side sg. A seat is down, folded up, hanging broken or
22
+ * gone, a strap of its belt dangling now and then.
23
+ */
24
+ export declare const troops: (xa: number, xb: number, y: number, w: number, sg: number) => void;
25
+ /**
26
+ * Where the troops sat: rows along both flanks of the middle section's hold and deck and of the
27
+ * nose's, each section, its floor (-1 the lowest, else the index in DECKS) and x0, x1. The rows leave the doors, the tears,
28
+ * the holes across a deck and the broken ends free, and stop short of the wall in the trees.
29
+ */
30
+ export declare const ROWS_OF_SEATS: number[][];
31
+ /** The flight deck behind the canopy: two pilots' seats, the instrument panel under the windscreen, the pedestal with its throttles, the overhead panel, and what the crash threw about. */
32
+ export declare const cockpit: () => void;
33
+ /** The canopy's glass, apart from the hull: its panes, and the shards round the broken ones. */
34
+ export declare const canopy: () => number[];
35
+ /** Inside the hull: the troops' seats in rows on its flanks and the flight deck. */
36
+ export declare const cabin: () => void;
@@ -0,0 +1,55 @@
1
+ import type { Piece } from '../../shared/beach';
2
+ import type { V, Mat } from './types';
3
+ export declare const tex: (l: number, k?: number, s?: number) => Mat;
4
+ export declare const ink: (c: V, k?: number, l?: number) => Mat;
5
+ export declare const MID: number;
6
+ export declare const WHITE: Mat;
7
+ export declare const SKIN: Mat;
8
+ export declare const GIRDER: Mat;
9
+ export declare const PLATE: Mat;
10
+ export declare const SOOT: Mat;
11
+ export declare const IRON: Mat;
12
+ export declare const STRIPE: number[];
13
+ export declare const BELT: Mat;
14
+ export declare const GLASS: Mat;
15
+ /** The canopy's glass: the shader's own layer, drawn blended (paint.ts); no colour of its own here. */
16
+ export declare const PANE: Mat;
17
+ /** Dry sand, as shore.ts paints it. */
18
+ export declare const DUNE: Mat;
19
+ /** An emergency lamp's glow. */
20
+ export declare const LAMP: Mat;
21
+ export declare const DOWN: number[];
22
+ export declare const sm: (t: number) => number;
23
+ export declare const sub: (a: V, b: V) => number[];
24
+ export declare const cross: (a: V, b: V) => number[];
25
+ export declare const unit: (a: V) => number[];
26
+ export declare const mid: (a: V, b: V) => number[];
27
+ /** `a` moved by k times `d`. */
28
+ export declare const off: (a: V, d: V, k?: number) => number[];
29
+ /** A rectangle across two axes: corner `i` of 4 picks a or b on each. */
30
+ export declare const QUAD: number[];
31
+ /** What is being drawn. */
32
+ export declare let o: number[];
33
+ /** The sand's height. */
34
+ export declare let gy: (_x: number, _z: number) => number;
35
+ export declare const put: (p: V, n: V, m: Mat, k: number) => void;
36
+ /** A flat face, a fan from its first corner, turned away from the point `c`; `k` dims it, or each corner. */
37
+ export declare const face: (q: V[], m: Mat, c: V, k?: number | number[]) => void;
38
+ /** The skin between two lines of as many points, away from `c` (toward it with `inv`): `m` each strip's material, or none; ka and kb the points' light. */
39
+ export declare const loft: (a: V[], b: V[], m: (j: number) => Mat | undefined, c: V, ka?: number[], kb?: number[] | undefined, inv?: boolean) => void;
40
+ /** A box's faces, less those of `skip` (a bit each: 1 and 2 across x, 4 the bottom, 8 the top, 16 and 32 across z). */
41
+ export declare const box: (a: V, b: V, m: Mat, top?: Mat, skip?: number) => void;
42
+ /** A beam from a to b, w across and h deep. */
43
+ export declare const bar: (a: V, b: V, w: number, m: Mat, h?: number) => void;
44
+ /** Torn metal: n teeth on the edge a to b, each reaching as far as `d` at most, turned away from `c`. */
45
+ export declare const teeth: (a: V, b: V, d: V, n: number, m: Mat, k?: number, c?: number[]) => void;
46
+ /** A box with its upright edges cut by `cut`, grown by `grow`: its sides, lit `k` at the foot and at the top, and its top in `top`. */
47
+ export declare const prism: (a: V, b: V, cut: number, m: Mat, top?: Mat, grow?: number, k?: number[]) => void;
48
+ /** Sand blown against the foot of a box that stands in the dry beach. */
49
+ export declare const drift: ({ min: a, max: b }: Piece) => void;
50
+ /** A model of mesh.ts set at `at`, its length (-z) along `f`, level: `k` its scale across, up and along. */
51
+ export declare const stand: (src: number[], at: V, f: V, k?: V) => void;
52
+ /** A module cannot reassign another's `let`: what is being drawn. */
53
+ export declare const setO: (v: number[]) => void;
54
+ /** The sand's height. */
55
+ export declare const setGy: (v: (x: number, z: number) => number) => void;
@@ -0,0 +1,16 @@
1
+ import type { V } from './types';
2
+ /** A wheel lying along -z from its hub's back: 0.6 m in radius, 1 m wide. */
3
+ export declare const WHEEL: number[];
4
+ /** The fallen engine's nacelle, its tail at the origin: 19 m to the intake's lip, dark inside it and scorched toward the bell. */
5
+ export declare const POD: number[];
6
+ /** A line of points [across, up] carried to (x + across, y + up, z), then its mirror across x. */
7
+ export declare const arch: (pts: number[][], x: number, y: number, z: number) => number[][];
8
+ /** Each kind of piece, drawn on its box: `t` its tint in the map, `s` 1 in red's half and -1 in blue's. */
9
+ export declare const KIND: Record<string, (p: {
10
+ min: V;
11
+ max: V;
12
+ }, t: V | undefined, s: number, d?: number) => void>;
13
+ /** The kinds of the camps: the rest is debris. */
14
+ export declare const CAMP: string[];
15
+ /** The kinds no sand lies against: afloat, or cloth, or the flag's step, or drawn off their boxes. */
16
+ export declare const BARE: string[];