@korial29/tiny-fps 0.147.0 → 0.147.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.
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Vec3 } from './mesh';
|
|
2
2
|
import type { Quat } from './rig';
|
|
3
|
+
import type { Pieces } from './store';
|
|
3
4
|
import type { Out } from './verts';
|
|
4
5
|
/**
|
|
5
6
|
* A lame, from the arm's joint at rest (metres, +x out): where it starts and ends across, its half
|
|
@@ -84,4 +85,6 @@ export declare const pads: (out: Out, s: {
|
|
|
84
85
|
rot: Quat[];
|
|
85
86
|
}, build?: number, color?: number[], marine?: boolean, band?: number[],
|
|
86
87
|
/** A far runner's: fewer quads. */
|
|
87
|
-
far?: boolean
|
|
88
|
+
far?: boolean,
|
|
89
|
+
/** The frame's pieces of the store: each pad and the collar go there, built once (store.ts). */
|
|
90
|
+
list?: Pieces) => void;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import type { Choice, PlayerState, Rover } from '../shared/types';
|
|
2
2
|
import type { World } from '../shared/world';
|
|
3
3
|
import type { Gait, Seat } from './gait';
|
|
4
|
+
import type { Pieces } from './store';
|
|
4
5
|
import type { Tracer } from './beams';
|
|
5
6
|
import type { Piece } from './limbs';
|
|
6
7
|
import type { Vec3 } from './mesh';
|
|
7
|
-
import type { Pose } from './rig';
|
|
8
|
+
import type { Pose, Quat } from './rig';
|
|
8
9
|
import type { Face } from './expression';
|
|
9
10
|
import type { Trail } from './trail';
|
|
10
11
|
import type { Out } from './verts';
|
|
@@ -127,7 +128,7 @@ export declare const dissolve: (out: Out, from: number, k: number) => void;
|
|
|
127
128
|
export declare const stance: (r: Runner) => {
|
|
128
129
|
s: {
|
|
129
130
|
pos: Vec3[];
|
|
130
|
-
rot:
|
|
131
|
+
rot: Quat[];
|
|
131
132
|
};
|
|
132
133
|
sink: number;
|
|
133
134
|
yaw: number;
|
|
@@ -135,14 +136,16 @@ export declare const stance: (r: Runner) => {
|
|
|
135
136
|
} | {
|
|
136
137
|
s: {
|
|
137
138
|
pos: Vec3[];
|
|
138
|
-
rot:
|
|
139
|
+
rot: Quat[];
|
|
139
140
|
};
|
|
140
141
|
sink: number;
|
|
141
142
|
yaw: number;
|
|
142
143
|
carry: [Vec3, Vec3[]] | undefined;
|
|
143
144
|
};
|
|
144
145
|
/** Draws the runner and gives back its solved skeleton, or nothing once a bolt has burnt it away. */
|
|
145
|
-
export declare const soldier: (out: Out, r: Runner, color: number[], lod?: number, helmets?: boolean, armored?: boolean
|
|
146
|
+
export declare const soldier: (out: Out, r: Runner, color: number[], lod?: number, helmets?: boolean, armored?: boolean,
|
|
147
|
+
/** The frame's pieces of the store: the rigid ones go there (store.ts), but on one coming apart. */
|
|
148
|
+
list?: Pieces) => {
|
|
146
149
|
pos: Vec3[];
|
|
147
|
-
rot:
|
|
150
|
+
rot: Quat[];
|
|
148
151
|
} | undefined;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { Vec3 } from './mesh';
|
|
2
|
+
import type { Quat } from './rig';
|
|
3
|
+
import type { Out } from './verts';
|
|
4
|
+
/** A piece built once: where its vertices start in the store and how many there are. */
|
|
5
|
+
export interface Mesh {
|
|
6
|
+
first: number;
|
|
7
|
+
count: number;
|
|
8
|
+
}
|
|
9
|
+
/** One piece drawn: `m` turned by `q`, scaled by `k`, moved to `t`. */
|
|
10
|
+
export interface Draw {
|
|
11
|
+
m: Mesh;
|
|
12
|
+
q: Quat;
|
|
13
|
+
t: Vec3;
|
|
14
|
+
k: number;
|
|
15
|
+
}
|
|
16
|
+
/** Every piece's vertices one after the other, in the renderer's vertex format: what the GPU gets. */
|
|
17
|
+
export declare let stored: Float32Array<ArrayBuffer>;
|
|
18
|
+
/** The floats of `stored` written: a renderer uploads what it has not yet. */
|
|
19
|
+
export declare let filled: number;
|
|
20
|
+
/** The piece `key`, made by `make` (into an empty array, at the origin) the first time it is asked for. */
|
|
21
|
+
export declare const mesh: (key: string, make: (out: number[]) => void) => Mesh;
|
|
22
|
+
/** The frame's pieces, drawn after its other vertices. */
|
|
23
|
+
export type Pieces = Draw[];
|
|
24
|
+
/** The turn and the place of no move: a rigid piece made with them is at the origin. */
|
|
25
|
+
export declare const ID: Quat;
|
|
26
|
+
export declare const ORIGIN: Vec3;
|
|
27
|
+
/**
|
|
28
|
+
* Appends the vertices of a drawn piece to `out` as the vertex shader places them (the tests'
|
|
29
|
+
* eyes): position turned and scaled then moved, normal turned, colour as is.
|
|
30
|
+
*/
|
|
31
|
+
export declare const expand: (out: Out, { m, q, t, k }: Draw) => void;
|
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.147.
|
|
5
|
+
"version": "0.147.1",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"files": [
|
|
8
8
|
"dist"
|