@korial29/tiny-fps 0.192.0 → 0.192.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.
@@ -72,6 +72,18 @@ export declare const fragOf: (def: Pick<WorldDef, "scenery" | "seam" | "relief">
72
72
  export declare const viewProj: (eye: Vec3, yaw: number, pitch: number, aspect: number, roll?: number, t?: number, [N, F]?: [number, number]) => Float32Array<ArrayBuffer>;
73
73
  /** A world point on screen, in [0, 1] from the top left; undefined behind the camera. */
74
74
  export declare const project: (m: Float32Array, x: number, y: number, z: number) => [number, number] | undefined;
75
+ /**
76
+ * Whether a sphere reaches into the view of `m`, by its left, right, bottom, top and near planes (the
77
+ * last row plus or minus another). A point light out of it lights no pixel drawn, and the GPU pays
78
+ * for every light on every fragment, hidden ones too.
79
+ */
80
+ export declare const inView: (m: Float32Array, p: Vec3, r: number) => boolean;
81
+ /**
82
+ * The pixels [x, y, width, height] (from the bottom left) the quads cover on a `w` by `h` target seen
83
+ * through `m`, cut at the near plane, a pixel wider each side; undefined when none. Each quad's box
84
+ * is clamped alone: two mouths off either side of the view are none.
85
+ */
86
+ export declare const cover: (m: Float32Array, quads: Vec3[][], w: number, h: number) => [number, number, number, number] | undefined;
75
87
  /**
76
88
  * The view-projection of a spot's shadow map: from its position along its axis, a square window
77
89
  * 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.1",
6
6
  "type": "module",
7
7
  "files": [
8
8
  "dist"