@korial29/tiny-fps 1.0.2 → 1.0.4
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 +6 -6
- package/dist/types/client/cells.d.ts +24 -0
- package/package.json +1 -1
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/** Metres a run spans at most, unless one of its triangles is bigger. */
|
|
2
|
+
export declare const CELL = 48;
|
|
3
|
+
/** Vertices of hidden runs drawn through rather than starting a new draw: a draw costs more than they do. */
|
|
4
|
+
export declare const GAP = 3000;
|
|
5
|
+
/** Runs of whole triangles in buffer order: the first vertex and count of each, and its bounds (min then max). */
|
|
6
|
+
export interface Cells {
|
|
7
|
+
n: number;
|
|
8
|
+
first: Int32Array;
|
|
9
|
+
count: Int32Array;
|
|
10
|
+
box: Float32Array;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Cuts the vertices [0, end) of `v` (STRIDE floats each, positions first) into runs. A triangle joins
|
|
14
|
+
* the run before it while their bounds together span no more than `limit`, or than a little more
|
|
15
|
+
* than the smaller of the two: the halves of a big face stay together, but a ground two kilometres
|
|
16
|
+
* wide does not swallow every small triangle after it.
|
|
17
|
+
*/
|
|
18
|
+
export declare const cells: (v: ArrayLike<number>, end: number, limit?: number) => Cells;
|
|
19
|
+
/**
|
|
20
|
+
* Puts in `out` the draws (first vertex, count) that cover the runs of `c` reaching into the
|
|
21
|
+
* frustum of `m`, hidden runs of up to `gap` vertices between two seen ones drawn through. Returns
|
|
22
|
+
* the number of draws.
|
|
23
|
+
*/
|
|
24
|
+
export declare const seen: (c: Cells, m: Float32Array, out: Int32Array, gap?: number) => number;
|
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": "1.0.
|
|
5
|
+
"version": "1.0.4",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"files": [
|
|
8
8
|
"dist"
|