@korial29/tiny-fps 0.144.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.
- package/dist/index.js +16 -15
- package/dist/types/client/armor.d.ts +106 -9
- package/dist/types/client/beams.d.ts +2 -1
- package/dist/types/client/body.d.ts +4 -3
- package/dist/types/client/buckle.d.ts +9 -0
- package/dist/types/client/craft.d.ts +2 -1
- package/dist/types/client/doors.d.ts +3 -2
- package/dist/types/client/drops.d.ts +2 -1
- package/dist/types/client/dust.d.ts +2 -1
- package/dist/types/client/flag.d.ts +6 -5
- package/dist/types/client/gun.d.ts +3 -2
- package/dist/types/client/hair.d.ts +2 -1
- package/dist/types/client/helm.d.ts +2 -1
- package/dist/types/client/helmet.d.ts +5 -4
- package/dist/types/client/katana.d.ts +4 -3
- package/dist/types/client/limbs.d.ts +2 -1
- package/dist/types/client/mask.d.ts +10 -2
- package/dist/types/client/mesh.d.ts +10 -3
- package/dist/types/client/moonbase.d.ts +6 -5
- package/dist/types/client/pack.d.ts +4 -3
- package/dist/types/client/pads.d.ts +29 -4
- package/dist/types/client/pouch.d.ts +2 -1
- package/dist/types/client/props.d.ts +6 -5
- package/dist/types/client/render.d.ts +2 -1
- package/dist/types/client/rover.d.ts +3 -2
- package/dist/types/client/skin.d.ts +2 -1
- package/dist/types/client/soldier.d.ts +3 -2
- package/dist/types/client/traffic.d.ts +2 -1
- package/dist/types/client/trail.d.ts +2 -1
- package/dist/types/client/verts.d.ts +26 -0
- package/dist/types/client/vision.d.ts +2 -1
- package/dist/types/client/wreck.d.ts +3 -2
- package/package.json +1 -1
|
@@ -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
|
|
@@ -33,6 +34,8 @@ interface Region {
|
|
|
33
34
|
legs?: boolean;
|
|
34
35
|
/** No plate: the suit's dark ribbed cloth, a hair off the skin, with no wall (the gusset). */
|
|
35
36
|
thin?: boolean;
|
|
37
|
+
/** No plate: the ninja's belt, cloth in the team's colour a hair off the skin, with no wall. */
|
|
38
|
+
belt?: boolean;
|
|
36
39
|
}
|
|
37
40
|
/**
|
|
38
41
|
* The chest plate's pecs (the user, 2026-11-10: fuller toward the bottom, then the round part too
|
|
@@ -101,6 +104,20 @@ export declare const THIGH: {
|
|
|
101
104
|
back: number;
|
|
102
105
|
at: number[];
|
|
103
106
|
};
|
|
107
|
+
/**
|
|
108
|
+
* The ninja's belt (the user, 2026-11-13: a V on the sides, then deeper, on him and on her): its
|
|
109
|
+
* bottom at the front's middle, under the buckle's middle (buckle.ts), rising `rise` to the hips,
|
|
110
|
+
* then down round the back to `back` from the front's (over it, the back's last lames would meet
|
|
111
|
+
* it); its height, and how far it stands off the skin. Cut as the gusset is, so drawn on every
|
|
112
|
+
* map, armour or none (armor()'s `bare`).
|
|
113
|
+
*/
|
|
114
|
+
export declare const BELT: {
|
|
115
|
+
y: number;
|
|
116
|
+
rise: number;
|
|
117
|
+
back: number;
|
|
118
|
+
h: number;
|
|
119
|
+
off: number;
|
|
120
|
+
};
|
|
104
121
|
/**
|
|
105
122
|
* The chest plate's armholes (the user, 2026-11-12: a triangle came through the plate under the
|
|
106
123
|
* armpit; 2026-11-13: small triangles on its sides): the shoulder's skin stands out of the trunk's
|
|
@@ -147,19 +164,70 @@ export declare const VEST: {
|
|
|
147
164
|
lame: number;
|
|
148
165
|
gap: number;
|
|
149
166
|
};
|
|
167
|
+
/**
|
|
168
|
+
* The last lame's point cut round over the belt's buckle (buckle.ts; the user, 2026-11-13: they met,
|
|
169
|
+
* fix the armour, not the buckle): an arch `clear` over its rim, the angle turned into a place
|
|
170
|
+
* across on the waist's front, `waist` out from the axis.
|
|
171
|
+
*/
|
|
172
|
+
export declare const ARCH: {
|
|
173
|
+
clear: number;
|
|
174
|
+
waist: number;
|
|
175
|
+
};
|
|
150
176
|
/**
|
|
151
177
|
* The vest's armholes (the user, 2026-11-13: a crack in the chest piece by the armpit): over the
|
|
152
178
|
* trunk's split (1.41 m) the skin is the shoulder's and goes with the arm, away from the piece under
|
|
153
|
-
* it. Its top is down to `y`, under the split, at the angle `a
|
|
154
|
-
*
|
|
155
|
-
*
|
|
179
|
+
* it. Its top is down to `y`, under the split, at the angle `a` on him and on her; from the top over
|
|
180
|
+
* the pec it falls there from the angle `fall` (hers sooner, round over each breast); its outer
|
|
181
|
+
* corner rounds off by `corner` between the angles `round`. His holds its height out to the
|
|
182
|
+
* shoulders, over all of the pecs, under the pads (the user, 2026-11-13: it fell from 22 to 42
|
|
183
|
+
* degrees and left their top bare); the skin there is the chest's and the collarbone's, not yet
|
|
184
|
+
* the arm's.
|
|
156
185
|
*/
|
|
157
186
|
export declare const ARMHOLE: {
|
|
158
|
-
a: number;
|
|
187
|
+
a: number[];
|
|
159
188
|
y: number;
|
|
160
189
|
fall: number[];
|
|
161
190
|
corner: number;
|
|
162
|
-
round: number[];
|
|
191
|
+
round: number[][];
|
|
192
|
+
};
|
|
193
|
+
/**
|
|
194
|
+
* The ninja's back (the user, 2026-11-13: one big block, not pretty): two plates on each shoulder
|
|
195
|
+
* blade, from `spine` degrees off the spine (a groove down it) to `a`, parted at the trunk's split
|
|
196
|
+
* (`split`, 1.41 m: one plate across it showed the step between the two rings): the upper one up to
|
|
197
|
+
* `top` by the spine, rising `rise` toward the shoulder and rounding off by `corner` at its outer
|
|
198
|
+
* end; the lower one from `low` by the spine, rising `wing` to its outer end. Under them three lames
|
|
199
|
+
* as the belly's, the first's top at `lames`, each `lame` high, their point `dip` down at the spine.
|
|
200
|
+
*/
|
|
201
|
+
export declare const BACK: {
|
|
202
|
+
spine: number;
|
|
203
|
+
a: number;
|
|
204
|
+
split: number[];
|
|
205
|
+
top: number;
|
|
206
|
+
rise: number;
|
|
207
|
+
corner: number;
|
|
208
|
+
low: number;
|
|
209
|
+
wing: number;
|
|
210
|
+
lames: number;
|
|
211
|
+
lame: number;
|
|
212
|
+
dip: number;
|
|
213
|
+
};
|
|
214
|
+
/**
|
|
215
|
+
* The blocks down the spine, in the back's groove: how many, the first's top, their height and the
|
|
216
|
+
* gap between two (none across the split), their half width (degrees) and how far they stand off
|
|
217
|
+
* the skin.
|
|
218
|
+
*/
|
|
219
|
+
export declare const SPINE: {
|
|
220
|
+
n: number;
|
|
221
|
+
top: number;
|
|
222
|
+
h: number;
|
|
223
|
+
gap: number;
|
|
224
|
+
a: number;
|
|
225
|
+
off: number;
|
|
226
|
+
};
|
|
227
|
+
/** The plates on the flanks: their heights, and the angles round from the front they span. */
|
|
228
|
+
export declare const SIDES: {
|
|
229
|
+
y: number[][];
|
|
230
|
+
a: number[];
|
|
163
231
|
};
|
|
164
232
|
/** How far the ninja's bracers stand off the forearm: half a plate's thickness. */
|
|
165
233
|
export declare const BRACER = 0.006;
|
|
@@ -168,6 +236,17 @@ export declare const REGIONS: Region[];
|
|
|
168
236
|
type Corner = number[];
|
|
169
237
|
/** The scratches' colours on coloured plates: the white under the paint, and paler. */
|
|
170
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
|
+
}
|
|
171
250
|
/**
|
|
172
251
|
* Her breasts on the shell (the user, 2026-11-12: a uniform dome each, a little bigger): a round
|
|
173
252
|
* dome each side, `h` out at its middle (x, y) and falling to nothing `r` away, smooth at its rim;
|
|
@@ -201,11 +280,27 @@ export declare const SWELL: {
|
|
|
201
280
|
* from upright (degrees), its length, its half width, the side it is on (0: both)].
|
|
202
281
|
*/
|
|
203
282
|
export declare const DETAILS: number[][];
|
|
283
|
+
/**
|
|
284
|
+
* 忍 on the left pec of the ninja's chest piece (the user, 2026-11-13: the hood's ideogram on the
|
|
285
|
+
* chest too), dark, over the vents and read from the front, on him and on her: its middle across
|
|
286
|
+
* (m, - the left) and up, its size, and the trunk's half width and depth there that turn a place
|
|
287
|
+
* across into an angle round it. Hers in the middle of her left breast, in place of its vents
|
|
288
|
+
* (VENTS): her piece is moulded over the dome and set where the skin's normal meets it, so a stroke
|
|
289
|
+
* over the top of the breast landed past the piece's top and was dropped.
|
|
290
|
+
*/
|
|
291
|
+
export declare const SIGN: {
|
|
292
|
+
x: number;
|
|
293
|
+
y: number;
|
|
294
|
+
size: number;
|
|
295
|
+
w: number;
|
|
296
|
+
d: number;
|
|
297
|
+
}[];
|
|
204
298
|
/**
|
|
205
299
|
* The ninja's details (the user, 2026-11-13: more detail on his armour), as DETAILS on his own
|
|
206
|
-
* pieces: a seam down the chest piece
|
|
207
|
-
*
|
|
208
|
-
* three slits between them; a groove down each shin guard, a rivet each side of its top.
|
|
300
|
+
* pieces: a seam down the chest piece; a rivet at each end of each lame;
|
|
301
|
+
* a groove down each of the back's blade plates, a rivet at each end of each back lame; a band at each end of the bracers with
|
|
302
|
+
* three slits between them; a groove down each shin guard, a rivet each side of its top. And by
|
|
303
|
+
* build, the vents (VENTS) and 忍 on the left pec (SIGNS).
|
|
209
304
|
*/
|
|
210
305
|
export declare const NINJA_DETAILS: number[][];
|
|
211
306
|
/**
|
|
@@ -216,6 +311,8 @@ export declare const NINJA_DETAILS: number[][];
|
|
|
216
311
|
* down the front of each thigh plate.
|
|
217
312
|
*/
|
|
218
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;
|
|
219
316
|
/**
|
|
220
317
|
* Appends the armour cut out of the skin `s` drawn into `out` from the float `from` on (skin()
|
|
221
318
|
* writes three vertices per triangle of s.t, in order). Not `fine` (a runner not close by), curved
|
|
@@ -223,5 +320,5 @@ export declare const ASTRO_DETAILS: number[][];
|
|
|
223
320
|
* plates' colour (their walls a shade darker): white when absent, the astronaut's, who has his own
|
|
224
321
|
* details in his team's colour `accent` too. The `ninja` wears his own armour.
|
|
225
322
|
*/
|
|
226
|
-
export declare const armor: (out:
|
|
323
|
+
export declare const armor: (out: Out, from: number, s: Skin, fine?: boolean, plate?: number[], ninja?: boolean, accent?: number[], bare?: boolean) => void;
|
|
227
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Vec3 } from './mesh';
|
|
2
|
+
import type { Quat } from './rig';
|
|
3
|
+
import type { Out } from './verts';
|
|
4
|
+
/** The height of its middle at rest, on the middle of the belt (0.99 to 1.03 m). */
|
|
5
|
+
export declare const BUCKLE_Y = 1.008;
|
|
6
|
+
/** Its radius and depth (m). */
|
|
7
|
+
export declare const BUCKLE: number[];
|
|
8
|
+
/** Appends the buckle for build b's pelvis at `at` turned by `q`, its middle in `team`. */
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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?:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
59
|
+
export declare const piece: (out: Out, c: Piece, colors: number[][], lod: number, sink: number, face?: ArrayLike<number>, suit?: boolean) => void;
|
|
@@ -1,8 +1,14 @@
|
|
|
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[];
|
|
7
|
+
/**
|
|
8
|
+
* 忍, its strokes as lines in a unit square, y up: 刃 (the turn and hook, the sweep down to the
|
|
9
|
+
* left, its dot), then 心 (the left dot, the hook along the bottom, the middle and the right dots).
|
|
10
|
+
*/
|
|
11
|
+
export declare const KANJI: number[][];
|
|
6
12
|
/** The grooves at the mouth: their places round (radians), their bottom and top, their width (m). */
|
|
7
13
|
export declare const MOUTH: {
|
|
8
14
|
a: number[];
|
|
@@ -15,6 +21,8 @@ export declare const MOUTH: {
|
|
|
15
21
|
* the neck and the skin at the neck's foot, but the opening round the eyes, soft at its edge), and
|
|
16
22
|
* the face under the guard pressed in behind it.
|
|
17
23
|
*/
|
|
18
|
-
export declare const dress: (out:
|
|
24
|
+
export declare const dress: (out: Out, from: number, s: Skin, at: Vec3, q: Quat, build?: number) => void;
|
|
19
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`. */
|
|
20
|
-
export declare const mask: (out:
|
|
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;
|
|
@@ -20,6 +21,12 @@ export declare const SHINE = -1.25;
|
|
|
20
21
|
* metal's sharp highlight, but none of its sky reflection, which would grey it under a black sky.
|
|
21
22
|
*/
|
|
22
23
|
export declare const GLOSS = -1.12;
|
|
24
|
+
/**
|
|
25
|
+
* The layer of gold (the ninja's shoulder pads, the user, 2026-11-13: it must shine): polished
|
|
26
|
+
* metal's sharp highlight, and the sky reflected in it tinted by its own colour (SHINE's, barely
|
|
27
|
+
* tinted, turned yellow olive under a blue sky).
|
|
28
|
+
*/
|
|
29
|
+
export declare const GILT = -1.42;
|
|
23
30
|
/**
|
|
24
31
|
* Camera axes [right, up, forward]: forward is (-sin yaw cos pitch, sin pitch, -cos yaw cos pitch),
|
|
25
32
|
* y up at roll 0. A positive roll leans the camera right: up tilts toward right.
|
|
@@ -61,9 +68,9 @@ export declare const solid: (lod: number, len: number, radii: number[], ends?: [
|
|
|
61
68
|
* so an ellipsoid made of a sphere shades like one. Written without allocations: a body is placed
|
|
62
69
|
* a thousand vertices at a time.
|
|
63
70
|
*/
|
|
64
|
-
export declare const place: (out:
|
|
71
|
+
export declare const place: (out: Out, src: number[], eye: Vec3, [r, u, f]: Vec3[], off: Vec3, k: number | Vec3, tint?: number[]) => void;
|
|
65
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. */
|
|
66
|
-
export declare const dim: (out:
|
|
73
|
+
export declare const dim: (out: Out, from: number, k: number) => void;
|
|
67
74
|
/**
|
|
68
75
|
* Axes [r, u, f] with f along the unit vector `to` and r as near `side` as it can be: the frame of
|
|
69
76
|
* a bone, which `place` takes. Right-handed like `basis`.
|
|
@@ -74,4 +81,4 @@ export declare const aim: (to: Vec3, side: Vec3) => [Vec3, Vec3, Vec3];
|
|
|
74
81
|
* them, `k` wide (a number, or across `side` and across the other way), `side` being where
|
|
75
82
|
* its x axis points as near as it can.
|
|
76
83
|
*/
|
|
77
|
-
export declare const segment: (out:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
34
|
+
export declare const crotch: (out: Out, at: Vec3, q: Quat, plate?: number[], scale?: number | Vec3) => void;
|