@korial29/tiny-fps 0.204.3 → 0.205.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.
|
@@ -4,6 +4,7 @@ import type { Vec3 } from './mesh';
|
|
|
4
4
|
import { solve } from './rig';
|
|
5
5
|
import type { Pose, Quat } from './rig';
|
|
6
6
|
import type { Out } from './verts';
|
|
7
|
+
import type { Pieces } from './store';
|
|
7
8
|
export type Solved = ReturnType<typeof solve>;
|
|
8
9
|
export interface Body {
|
|
9
10
|
/** The own player's id, -1 before the first snapshot. */
|
|
@@ -26,8 +27,12 @@ export interface Body {
|
|
|
26
27
|
readonly phase: number;
|
|
27
28
|
/** The joints for a camera at `eye`; undefined without a player, or with the camera away from the body. */
|
|
28
29
|
pose(eye: Vec3, yaw: number, pitch: number, roll?: number): Solved | undefined;
|
|
29
|
-
/**
|
|
30
|
-
|
|
30
|
+
/**
|
|
31
|
+
* Appends the body's vertices (see STRIDE) in the jacket `color`; nothing when pose() has none.
|
|
32
|
+
* Its rigid pieces go to `pieces` when given (the Hunter's armour and harpoon): kept on the GPU,
|
|
33
|
+
* they carry their rest place, which their textures need, where the frame's vertices have none.
|
|
34
|
+
*/
|
|
35
|
+
draw(out: Out, eye: Vec3, yaw: number, pitch: number, roll?: number, color?: number[], pieces?: Pieces): void;
|
|
31
36
|
/** The own player's character (BUILD in rig.ts, PlayerInfo.body): the woman's arms are slimmer and her hands smaller, on the same grips; `tone` the skin he picked (the default's when absent). */
|
|
32
37
|
wear(build: number, tone?: number[], ninja?: boolean, xeno?: boolean, hunter?: boolean): void;
|
|
33
38
|
}
|
|
@@ -16,7 +16,7 @@ export interface Gait {
|
|
|
16
16
|
* Moves to the state `p` after dt seconds. Without `floor` the feet stand on y = p.y. `seat` is
|
|
17
17
|
* where a player who rides sits: without it he sits level, a rider, facing his look.
|
|
18
18
|
*/
|
|
19
|
-
update(p: PlayerState, dt: number, floor?: Floor, seat?: Seat
|
|
19
|
+
update(p: PlayerState, dt: number, floor?: Floor, seat?: Seat): void;
|
|
20
20
|
/** The pose now: one object, rewritten by each call. */
|
|
21
21
|
pose(): Pose;
|
|
22
22
|
/** Stride phase, in cycles: the left foot lands at 0 and the right one at a half. */
|
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
import type { Vec3 } from './mesh';
|
|
2
2
|
import type { Out } from './verts';
|
|
3
|
+
import type { Pieces } from './store';
|
|
3
4
|
export declare function hunter(lod: 0 | 1 | 2): Record<string, number[]>;
|
|
4
5
|
/** Model-space cut trail on the same scaled mount as the baked blades. */
|
|
5
6
|
export declare const hunterWristEnds: () => Vec3[];
|
|
6
|
-
/**
|
|
7
|
-
|
|
7
|
+
/**
|
|
8
|
+
* Slide and stock travel in opposite directions as the compact back-mounted rifle opens. With
|
|
9
|
+
* `pieces`, its shell, slide and stock are kept on the GPU (store.ts) and only placed, so their
|
|
10
|
+
* brushed metal lies on their rest place; the bolt, shortened as it folds, stays in `out`.
|
|
11
|
+
*/
|
|
12
|
+
export declare const drawHarpoon: (out: Out, lod: 0 | 1 | 2, at: Vec3, axes: Vec3[], scale: number, open: number, loaded?: boolean,
|
|
13
|
+
/** 0 just after a shot to 1: the next bolt slides forward from the stock into its seat. */
|
|
14
|
+
feed?: number, pieces?: Pieces) => void;
|
|
8
15
|
export declare const hunterHarpoon: (lod: 0 | 1 | 2) => number[];
|
|
9
16
|
/**
|
|
10
17
|
* The Hunter's own rest skeleton in model space: the rig's joints on his 1.2 m stature, the arms
|
|
@@ -17,7 +17,18 @@ export declare const S: number, C: number;
|
|
|
17
17
|
export declare const katana: (lod: number) => number[];
|
|
18
18
|
/** Right wrist space: +x over the knuckles, -y along the fingers, z across the hand. */
|
|
19
19
|
export declare const wristBlade: (lod: number) => number[];
|
|
20
|
-
|
|
20
|
+
/** The time (s) the blades take to slide out of their housing when they are taken in hand. */
|
|
21
|
+
export declare const BLADE_EXTEND = 0.3;
|
|
22
|
+
/**
|
|
23
|
+
* The right wrist's housing at `pos`, turned as the forearm `q`: always on the bracer. Into `list`
|
|
24
|
+
* (kept on the GPU, its brushed metal holding still) when given.
|
|
25
|
+
*/
|
|
26
|
+
export declare const wristHousing: (out: Out, pos: Vec3, q: Quat, lod: number, list?: Pieces) => void;
|
|
27
|
+
/**
|
|
28
|
+
* The two blades `out` of the housing by `extend` (0 in it, 1 out): they slide out of its nose,
|
|
29
|
+
* drawn along the fingers from a stub hidden under its crown to their full length.
|
|
30
|
+
*/
|
|
31
|
+
export declare const wristBlades: (out: Out, pos: Vec3, q: Quat, lod: number, extend?: number, list?: Pieces) => void;
|
|
21
32
|
export declare const wristEnds: (pos: Vec3, q: Quat) => Vec3[];
|
|
22
33
|
/** Appends arcs of lightning flickering along the blade at the clock `t` (s): a few zigzags of thin crossed ribbons, each new every 70 ms. */
|
|
23
34
|
export declare const arcs: (out: Out, at: Vec3, [r, u, f]: Vec3[], t: number, lod: number, k?: number) => 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.
|
|
5
|
+
"version": "0.205.1",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"files": [
|
|
8
8
|
"dist"
|