@korial29/tiny-fps 0.164.0 → 0.165.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.
- package/dist/index.js +24 -24
- package/dist/types/client/body.d.ts +3 -1
- package/dist/types/client/skin.d.ts +10 -0
- package/dist/types/client/store.d.ts +2 -0
- package/dist/types/client/xeno.d.ts +88 -18
- package/package.json +1 -1
|
@@ -135,7 +135,9 @@ lite?: boolean,
|
|
|
135
135
|
/** The marine's: lit buttons on the strap round the wrist (WRIST_LIGHTS). */
|
|
136
136
|
lights?: boolean,
|
|
137
137
|
/** The xenomorph's claws on the fingertips (Grip). */
|
|
138
|
-
claws?: boolean
|
|
138
|
+
claws?: boolean,
|
|
139
|
+
/** Its size: the xenomorph's grows from the wrist over 4 cm, hers is smaller (hands()). */
|
|
140
|
+
grow?: number) => void;
|
|
139
141
|
/** What a hand does besides closing (hand()): the left index pointing, the right thumb pushing toward `to`, the left thumb cupped. */
|
|
140
142
|
export interface Grip {
|
|
141
143
|
point?: number;
|
|
@@ -100,6 +100,11 @@ export interface Skin {
|
|
|
100
100
|
}
|
|
101
101
|
/** How far out the face is (its z) at x across, height y: the carved surface, found by halving. */
|
|
102
102
|
export declare const onHead: (x: number, y: number) => number;
|
|
103
|
+
/**
|
|
104
|
+
* The dome's section `z` behind the face's edge (0 to PROFILE[0]), in the rest pose: its centre's
|
|
105
|
+
* height, half width and half height (an ellipse). xeno.ts lays its veins on it.
|
|
106
|
+
*/
|
|
107
|
+
export declare const domeAt: (z: number) => [number, number, number];
|
|
103
108
|
/** How far out the woman's bust stands at its fullest, on the man's rest mesh, metres. */
|
|
104
109
|
export declare const BUST = 0.028;
|
|
105
110
|
/** Where it is fullest, metres up (the user, 2026-11-11: a little higher; it was 1.345). */
|
|
@@ -119,6 +124,11 @@ export declare const beast: (lod: number) => Skin;
|
|
|
119
124
|
export declare const cut: (lod: number, limb: number, build?: number) => Skin[];
|
|
120
125
|
/** A build's joints at rest (solve() of its rest pose), for what is placed on its body. */
|
|
121
126
|
export declare const bindOf: (build?: number) => Vec3[];
|
|
127
|
+
/**
|
|
128
|
+
* The upper arm of shoulder joint `j` in the world without its turn about itself: the swing of
|
|
129
|
+
* its rotation from the collarbone's, about the bone's rest axis, on the collarbone's.
|
|
130
|
+
*/
|
|
131
|
+
export declare const swing: (rot: Quat[], j: number, build?: number) => Quat;
|
|
122
132
|
/** The palette regions that are bare skin: the shader's skin pass (SKIN_LAYER) takes them. */
|
|
123
133
|
export declare const BARE_REGIONS: number[];
|
|
124
134
|
/**
|
|
@@ -15,6 +15,8 @@ export interface Draw {
|
|
|
15
15
|
f?: Flesh;
|
|
16
16
|
/** Worn: armour, which the shader scuffs (grime, chipped paint, scratches) on its glossy and gold parts. */
|
|
17
17
|
w?: boolean;
|
|
18
|
+
/** Thin: too fine for a shadow, left out of the depth passes (the xenomorph's veins, teeth and eyes). */
|
|
19
|
+
s?: boolean;
|
|
18
20
|
/** Close hair (hair.ts), coloured `rgb`, swung by `sw` in the head's frame at the time `t`: the shader sways it (swayOf()). */
|
|
19
21
|
h?: {
|
|
20
22
|
rgb: number[];
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import type { Vec3 } from './mesh';
|
|
2
2
|
import type { Quat } from './rig';
|
|
3
3
|
import type { Out } from './verts';
|
|
4
|
-
/**
|
|
4
|
+
/**
|
|
5
|
+
* Its chitin: a near black with a cold sheen, one colour from the skull to the tail: a lighter head
|
|
6
|
+
* drew a collar's line round the neck.
|
|
7
|
+
*/
|
|
5
8
|
export declare const CHITIN_X: number[];
|
|
6
9
|
/** Metres: the tail's length, its root's radius and its tip's, the stinger's length. */
|
|
7
10
|
export declare const TAIL: {
|
|
@@ -16,15 +19,44 @@ interface Solved {
|
|
|
16
19
|
rot: Quat[];
|
|
17
20
|
}
|
|
18
21
|
/**
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
* Geometry baked into the beast's skin (shape() in skin.ts), posed with it by flesh() at no cost a
|
|
23
|
+
* frame: places and normals at rest, six numbers a vertex, its two joints and its weight on the
|
|
24
|
+
* second, three vertex indices a triangle and the palette region of each corner.
|
|
25
|
+
*/
|
|
26
|
+
export interface Baked {
|
|
27
|
+
v: number[];
|
|
28
|
+
j: number[];
|
|
29
|
+
w: number[];
|
|
30
|
+
t: number[];
|
|
31
|
+
c: number[];
|
|
32
|
+
}
|
|
33
|
+
/** The back's part of the column at a level of detail: baked, how many vertebrae, and the ring the tail goes on from, on the pelvis. */
|
|
34
|
+
interface Back {
|
|
35
|
+
baked: Baked;
|
|
36
|
+
n: number;
|
|
37
|
+
/** The last ring's middle in the pelvis' frame, its way, its radius. */
|
|
38
|
+
c: Vec3;
|
|
39
|
+
tan: Vec3;
|
|
40
|
+
r: number;
|
|
41
|
+
}
|
|
42
|
+
/** The pipes' colour: a very dark grey, lighter than the chitin. */
|
|
43
|
+
export declare const PIPE: number[];
|
|
44
|
+
/**
|
|
45
|
+
* The back's half of its spine, sunk in the skin, and the pipes up its neck, baked into the skin of
|
|
46
|
+
* `lod` (shape() in skin.ts): they only follow the joints, so the shader poses them with the rest
|
|
47
|
+
* of it. The vertebrae lie at rest as column() spaced them; each point hangs on the joints of the
|
|
48
|
+
* two bones it lies between, the last ring on the pelvis alone, where tail() takes the column on.
|
|
49
|
+
*/
|
|
50
|
+
export declare const backOf: (lod: number) => Back;
|
|
51
|
+
/**
|
|
52
|
+
* Its tail, in the world, from the solved skeleton `s`: the column's free part, from the pelvis
|
|
53
|
+
* on (the back's is in the skin, backOf()), each vertebra a bead pinched at its joints with a spine
|
|
54
|
+
* standing out of it but near the tip, as bonesOf() bends and sways it; the stinger at its end, a
|
|
55
|
+
* blade swelling to a barb, then a point, glowing in the team's `color`. Written straight into
|
|
56
|
+
* `out`. `lod` 0 far, 1 near, 3 close.
|
|
25
57
|
*/
|
|
26
|
-
export declare const
|
|
27
|
-
/** Bone: its claws. */
|
|
58
|
+
export declare const tail: (out: Out, s: Solved, t: number, run: number, sting: number, color: number[], lod: number) => void;
|
|
59
|
+
/** Bone: its claws and teeth, nothing else. */
|
|
28
60
|
export declare const BONE: number[];
|
|
29
61
|
/** Where the metatarsal (the foot) ends, from the ankle, in the foot joint's frame: longer than the rig's foot. */
|
|
30
62
|
export declare const FOOT_TIP: Vec3;
|
|
@@ -57,13 +89,6 @@ export declare const ribs: (out: Out, at: Vec3, q: Quat, lod: number, low?: bool
|
|
|
57
89
|
* shoulder.
|
|
58
90
|
*/
|
|
59
91
|
export declare const clavicles: (out: Out, at: Vec3, q: Quat, lod: number) => void;
|
|
60
|
-
/**
|
|
61
|
-
* Thin pipes up its neck (the user, 2026-11-15: following the neck, in curves, many): six each side,
|
|
62
|
-
* from the top of the chest round the neck's sides into the underside of the skull, each through
|
|
63
|
-
* points carried by the chest, the neck and the head, so it bends with them, on a smooth curve
|
|
64
|
-
* that snakes round the neck. In the world, from the solved skeleton `s`.
|
|
65
|
-
*/
|
|
66
|
-
export declare const pipes: (out: Out, s: Solved, lod: number) => void;
|
|
67
92
|
/**
|
|
68
93
|
* Curved horns out of its back (the user, 2026-11-15): a pair on a joint, each from beside the spine
|
|
69
94
|
* out of the back near square to it and well out to the side, clear of the head, curling up a little, `len` long and `r` thick at its root, at `base` (the right
|
|
@@ -75,7 +100,14 @@ export declare const HORNS: [number, Vec3, number, number][];
|
|
|
75
100
|
/** Its spurs: one out of the back of each elbow (a forearm joint), one out of the back of each ankle (a shin joint). */
|
|
76
101
|
export declare const elbow: (out: Out, at: Vec3, q: Quat, lod: number) => void;
|
|
77
102
|
export declare const heel: (out: Out, at: Vec3, q: Quat, lod: number) => void;
|
|
78
|
-
/**
|
|
103
|
+
/**
|
|
104
|
+
* The disc at the top of its arm (the user, 2026-11-16: where the shoulder ends and the arm
|
|
105
|
+
* begins), on the arm's swing (its joint without its twist, as the skin's top is), `s` 1 the right
|
|
106
|
+
* arm: a full disc slanting through the shoulder, thin with a rounded rim and low domed faces,
|
|
107
|
+
* its rim fading into the skin toward the armpit.
|
|
108
|
+
*/
|
|
109
|
+
export declare const cuff: (out: Out, at: Vec3, q: Quat, lod: number, s: number) => void;
|
|
110
|
+
/** Its head's chitin: the dome's (the skin's TRIM, soldier.ts) and its face's, the body's own. */
|
|
79
111
|
export declare const HEAD: number[];
|
|
80
112
|
/**
|
|
81
113
|
* The head's front (the user, 2026-11-15: one smooth block with the back): an ellipsoid round the
|
|
@@ -94,6 +126,44 @@ export declare const HEAD_UP = 0.065;
|
|
|
94
126
|
* with grey teeth, the fangs longest. A grid over the face, finer the closer.
|
|
95
127
|
*/
|
|
96
128
|
export declare const skull: (out: Out, head: Vec3, q: Quat, lod: number) => void;
|
|
129
|
+
/**
|
|
130
|
+
* The fine parts of its face, too thin for a shadow (soldier.ts keeps them out of the depth passes):
|
|
131
|
+
* its steel teeth and the cords of sinew beside its mouth. Not far.
|
|
132
|
+
*/
|
|
133
|
+
export declare const teeth: (out: Out, head: Vec3, q: Quat, lod: number) => void;
|
|
134
|
+
/**
|
|
135
|
+
* Veins along its dome (the user, 2026-11-16), on the head joint: on each side three running back
|
|
136
|
+
* from the face's edge along the banana, wandering a little up and down its side, thinning toward
|
|
137
|
+
* the back, with a short branch off each; one along each side of the top. Half sunk in the skin.
|
|
138
|
+
*/
|
|
139
|
+
export declare const veins: (out: Out, head: Vec3, q: Quat, lod: number) => void;
|
|
97
140
|
/** Its eyes, glowing slits at the back of the orbits in the team's `color`. */
|
|
98
|
-
export declare const eyes: (out: Out, head: Vec3, q: Quat, color: number[]) => void;
|
|
141
|
+
export declare const eyes: (out: Out, head: Vec3, q: Quat, color: number[], lod?: number) => void;
|
|
142
|
+
/** A rigid piece made at the origin of its joint's frame, then only placed (store.ts). */
|
|
143
|
+
type Make = (o: Out, at: Vec3, q: Quat) => void;
|
|
144
|
+
/**
|
|
145
|
+
* A rigid piece of the xenomorph at a level of detail: its key in the store (all its vertices
|
|
146
|
+
* depend on), how it is made, and whether it is `thin`, too fine for a shadow: left out of the
|
|
147
|
+
* depth passes.
|
|
148
|
+
*/
|
|
149
|
+
export interface Part {
|
|
150
|
+
key: string;
|
|
151
|
+
make: Make;
|
|
152
|
+
thin?: boolean;
|
|
153
|
+
}
|
|
154
|
+
/** Its pieces by the joint they go on (partsOf()), those on one joint merged: one draw each a pass. */
|
|
155
|
+
export declare const PART: {
|
|
156
|
+
SHIN: number;
|
|
157
|
+
FOOT: number;
|
|
158
|
+
TOES: number;
|
|
159
|
+
CHEST: number;
|
|
160
|
+
SPINE: number;
|
|
161
|
+
ELBOW: number;
|
|
162
|
+
CUFF_L: number;
|
|
163
|
+
CUFF_R: number;
|
|
164
|
+
HEAD: number;
|
|
165
|
+
FINE: number;
|
|
166
|
+
};
|
|
167
|
+
/** The xenomorph's rigid pieces at `lod`, in PART's order; render.ts makes them all at the map's load. */
|
|
168
|
+
export declare const partsOf: (lod: number) => Part[];
|
|
99
169
|
export {};
|
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.165.1",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"files": [
|
|
8
8
|
"dist"
|