@korial29/tiny-fps 0.192.0 → 0.192.2

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.
@@ -61,10 +61,15 @@ export declare const POST_FRAG = "#version 300 es\nprecision highp float;uniform
61
61
  export declare const SPEC: number[][];
62
62
  export declare const FRAG: string;
63
63
  /**
64
- * The scene's fragment shader for a map: the moon's globe, stars, craters and orbit fade only where
65
- * the map has them. Left in on another map, never run, they still cost Highline 2.4 ms of GPU a frame.
64
+ * The scene's fragment shader for a map and for what it draws: the moon's globe, stars, craters and
65
+ * orbit fade only where the map has them, the ninja's quilting, cloth, boots and brushed metal only
66
+ * where he is offered (rolesOf()). `LAND` is the map and the sky
67
+ * (the regolith, no skin, armour, hair or chitin), `FLESH` the runners, the vehicles and the
68
+ * effects (no regolith), `ORB` the globe alone; with none, all of it. Left in where it never runs,
69
+ * code still costs every pixel through the shader's registers: the moon 2.4 ms of GPU a frame on
70
+ * Highline, the ninja's 1.9 ms on three astronauts at 3 m on the moon.
66
71
  */
67
- export declare const fragOf: (def: Pick<WorldDef, "scenery" | "seam" | "relief">) => string;
72
+ export declare const fragOf: (def: Pick<WorldDef, "scenery" | "seam" | "relief" | "helmets">, kind?: string) => string;
68
73
  /**
69
74
  * Column-major view-projection matrix of basis(yaw, pitch, roll) at eye. t is the tangent of half the
70
75
  * vertical field of view (70° by default), [N, F] the near and far clip distances.
@@ -72,6 +77,18 @@ export declare const fragOf: (def: Pick<WorldDef, "scenery" | "seam" | "relief">
72
77
  export declare const viewProj: (eye: Vec3, yaw: number, pitch: number, aspect: number, roll?: number, t?: number, [N, F]?: [number, number]) => Float32Array<ArrayBuffer>;
73
78
  /** A world point on screen, in [0, 1] from the top left; undefined behind the camera. */
74
79
  export declare const project: (m: Float32Array, x: number, y: number, z: number) => [number, number] | undefined;
80
+ /**
81
+ * Whether a sphere reaches into the view of `m`, by its left, right, bottom, top and near planes (the
82
+ * last row plus or minus another). A point light out of it lights no pixel drawn, and the GPU pays
83
+ * for every light on every fragment, hidden ones too.
84
+ */
85
+ export declare const inView: (m: Float32Array, p: Vec3, r: number) => boolean;
86
+ /**
87
+ * The pixels [x, y, width, height] (from the bottom left) the quads cover on a `w` by `h` target seen
88
+ * through `m`, cut at the near plane, a pixel wider each side; undefined when none. Each quad's box
89
+ * is clamped alone: two mouths off either side of the view are none.
90
+ */
91
+ export declare const cover: (m: Float32Array, quads: Vec3[][], w: number, h: number) => [number, number, number, number] | undefined;
75
92
  /**
76
93
  * The view-projection of a spot's shadow map: from its position along its axis, a square window
77
94
  * just wide enough for the cone, clipped from 0.3 m (a flashlight sits inside its player's head)
@@ -37,6 +37,10 @@ export declare const STATION: {
37
37
  export declare const reaches: ({ post: [min, max] }: StationDef, { x, y, z }: PlayerState) => boolean;
38
38
  /** True when (x, y, z) is inside the station. */
39
39
  export declare const inside: ({ hall: [min, max] }: StationDef, x: number, y: number, z: number) => boolean;
40
+ /** The hangar and the command room, each [min, max]: shut but for the hangar's mouths (station()). */
41
+ export declare const rooms: ({ hull: [x, , z], post: [[, Y]] }: StationDef) => [Vec3, Vec3][];
42
+ /** The hangar's two mouths, between its side walls and under the lintels: four corners each. */
43
+ export declare const mouths: ({ hull: [x, , z], post: [[, Y]] }: StationDef) => Vec3[][];
40
44
  export declare class Station {
41
45
  phase: number;
42
46
  /** The team that armed the mission (ARMED, STRUCK). */
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.192.0",
5
+ "version": "0.192.2",
6
6
  "type": "module",
7
7
  "files": [
8
8
  "dist"