@korial29/tiny-fps 0.105.0 → 0.106.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.
@@ -46,5 +46,7 @@ export declare const swung: (a?: Blade, b?: Blade) => number;
46
46
  export declare const struck: (a?: Blade, b?: Blade) => boolean;
47
47
  export declare const createCombat: (world: World, audio: Pick<Audio, "play"> & Partial<Pick<Audio, "loop">>, hud: Pick<Hud, "vitals" | "hit" | "down">, fx: Pick<Effects, "fire" | "cut" | "wound" | "lie" | "quake">, tracer: Pick<Tracer, "flash" | "burst" | "blast" | "orbs" | "update" | "mount" | "crackle" | "charging" | "lightning">, ctl: {
48
48
  pitch: number;
49
- }, balls: Pick<Balls, "fire" | "frame">) => Combat;
49
+ }, balls: Pick<Balls, "fire" | "frame">,
50
+ /** The muzzle of a runner's long gun as last drawn, from his feet (Renderer.muzzle()). */
51
+ drawn?: (id: number) => Vec3 | undefined) => Combat;
50
52
  export {};
@@ -258,7 +258,15 @@ export declare const tip: (at: Vec3, [, u, f]: Vec3[], kind?: boolean | number)
258
258
  * where the right axis points, `up` where up is. The emitter is off the grip, so the axes are found
259
259
  * in three rounds.
260
260
  */
261
- export declare const pointed: (at: Vec3, to: Vec3, side: Vec3, up: Vec3) => Vec3[];
261
+ export declare const pointed: (at: Vec3, to: Vec3, side: Vec3, up: Vec3, sag?: number) => Vec3[];
262
+ /** The middle of the butt plate of the rail gun and of the laser rifle, in model space: what the shoulder takes. */
263
+ export declare const BUTTS: Vec3[];
264
+ /**
265
+ * A long gun (`kind` 2 the rail gun, 3 the rifle) shouldered: its grip and its axes [right, up,
266
+ * forward] when its butt plate is at `butt` and its barrel points at `to`. The rail gun's barrel
267
+ * lies on the gun's long axis, the rifle's is level in its model.
268
+ */
269
+ export declare const shouldered: (butt: Vec3, to: Vec3, side: Vec3, up: Vec3, kind: number) => [Vec3, Vec3[]];
262
270
  /** Where a runner's shots end: the first wall along its look from the eye, or the range. */
263
271
  export declare const focus: (p: PlayerState, world: World) => [Vec3, boolean];
264
272
  /**
@@ -5,8 +5,8 @@ export declare const UP: Vec3[];
5
5
  export declare const cross: (u: Vec3, v: Vec3) => Vec3;
6
6
  /** A convex polygon of one colour, wound so that it faces away from `away` when given. */
7
7
  export declare const face: (o: number[], p: Vec3[], rgb: number[], away?: Vec3) => void;
8
- /** A box of one colour between two corners, its faces outward. */
9
- export declare const box: (o: number[], lo: Vec3, hi: Vec3, rgb: number[]) => void;
8
+ /** 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
10
  /** Carries a model's vertices to (x, y, z), turned by `yaw` about y. */
11
11
  export declare const put: (o: number[], v: number[], [x, y, z]: Vec3, yaw?: number) => void;
12
12
  /** What `make` adds to `o` glows, k times its colour. */
@@ -20,6 +20,8 @@ export declare const LINTELS: Brush[];
20
20
  * three axes: the shader's relief needs a normal out of the face's plane.
21
21
  */
22
22
  export declare const INDOORS: number[];
23
+ /** 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
+ export declare const GAPS: number[][];
23
25
  /** 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. */
24
26
  export declare const moonbase: (o: number[]) => void;
25
27
  /**
@@ -0,0 +1,10 @@
1
+ /** How high the beacon of the dome's aerial is. */
2
+ export declare const TIP = 25.4;
3
+ /**
4
+ * The portholes: the middle (x, y, z), the way out (x, z), the radius, and whether the wall is one
5
+ * to see through (a module's: it gets a pane inside too). On the drum over every other window but
6
+ * at its openings, two on each end wall of a module but where a tube comes in.
7
+ */
8
+ export declare const PORTHOLES: number[][];
9
+ /** The outside of red's half of the base, on what moonbase() draws. */
10
+ export declare const hull: (o: number[]) => void;
@@ -130,6 +130,8 @@ export interface Renderer {
130
130
  project(x: number, y: number, z: number): [number, number] | undefined;
131
131
  /** The footsteps of the player `id`'s runner so far (Gait.steps), undefined before it is drawn. */
132
132
  steps(id: number): number | undefined;
133
+ /** The muzzle of the long gun of the player `id`'s runner as last drawn, from his feet (Runner.tip). */
134
+ muzzle(id: number): Vec3 | undefined;
133
135
  destroy(): void;
134
136
  }
135
137
  /** Pixels drawn at most (1080p): every one is lit per light and shadow map, so a 4K screen at a pixel ratio of 2 would pay for 8 million. */
@@ -28,6 +28,8 @@ export interface Runner {
28
28
  hurt: number;
29
29
  /** The seat he rides in, when he does and his rover is known. */
30
30
  seat?: Seat;
31
+ /** The muzzle of the long gun in his hands as last drawn, from his feet: where its shots are seen to leave (combat.ts). */
32
+ tip?: Vec3;
31
33
  }
32
34
  /**
33
35
  * The seat of a player who rides: the rover whose `driver` or `rider` he is. Nothing for one on
@@ -42,6 +44,14 @@ export declare const createRunner: (p: PlayerState, seat?: Seat) => Runner;
42
44
  * under them. The `tracer` gets the sparks of a limb cut off.
43
45
  */
44
46
  export declare const animate: (book: Map<number, Runner>, others: PlayerState[], dt: number, world?: World, tracer?: Pick<Tracer, "shock" | "spit">, rovers?: Rover[]) => void;
47
+ /**
48
+ * A long gun's butt plate in the hollow of the right shoulder: from the shoulder joint, in the
49
+ * chest's frame (to its right, up, back). The gun goes from there along the look, so it is
50
+ * shouldered whatever the pitch (the user, 2026-11-10: it hung across the belly).
51
+ */
52
+ export declare const POCKET: Vec3;
53
+ /** How far a runner has his long gun down to the low ready, 0 to 1: in a sprint, when he is not firing. */
54
+ export declare const lowered: (r: Runner) => number;
45
55
  /**
46
56
  * The pose with the katana in both hands: carried, or in a cut, which is the first person's cut
47
57
  * seen from the runner's eye (the share `e` of it, so that it is drawn from the carry and back to
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@korial29/tiny-fps",
3
3
  "description": "Tiny multiplayer first-person rooftop game for the browser: raw WebGL, zero runtime dependencies, WebSocket or same-browser multi-tab play.",
4
4
  "license": "Apache-2.0",
5
- "version": "0.105.0",
5
+ "version": "0.106.1",
6
6
  "type": "module",
7
7
  "files": [
8
8
  "dist"