@korial29/tiny-fps 1.8.0 → 1.9.0
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/cast-art-DbwsToaQ.js +1 -0
- package/dist/index.js +7 -7
- package/dist/landfall-CSZGx2iA.js +21 -0
- package/dist/types/client/armor/clip.d.ts +22 -0
- package/dist/types/client/armor/cooking.d.ts +14 -0
- package/dist/types/client/armor/details.d.ts +65 -0
- package/dist/types/client/armor/fit.d.ts +8 -0
- package/dist/types/client/armor/regions.d.ts +304 -0
- package/dist/types/client/armor/scratches.d.ts +4 -0
- package/dist/types/client/armor/shell.d.ts +46 -0
- package/dist/types/client/armor/types.d.ts +37 -0
- package/dist/types/client/armor/wear.d.ts +22 -0
- package/dist/types/client/armor.d.ts +9 -393
- package/dist/types/client/body/constants.d.ts +35 -0
- package/dist/types/client/body/create.d.ts +3 -0
- package/dist/types/client/body/fingers.d.ts +112 -0
- package/dist/types/client/body/glove.d.ts +27 -0
- package/dist/types/client/body/hands.d.ts +28 -0
- package/dist/types/client/body/hunter.d.ts +26 -0
- package/dist/types/client/body/motion.d.ts +42 -0
- package/dist/types/client/body/reach.d.ts +65 -0
- package/dist/types/client/body/types.d.ts +39 -0
- package/dist/types/client/body/wield.d.ts +30 -0
- package/dist/types/client/body.d.ts +10 -207
- package/dist/types/client/cast-art.d.ts +2 -0
- package/dist/types/client/gait/constants.d.ts +34 -0
- package/dist/types/client/gait/create.d.ts +3 -0
- package/dist/types/client/gait/fists.d.ts +55 -0
- package/dist/types/client/gait/maths.d.ts +38 -0
- package/dist/types/client/gait/moves.d.ts +129 -0
- package/dist/types/client/gait/types.d.ts +59 -0
- package/dist/types/client/gait.d.ts +6 -146
- package/dist/types/client/gun/ammo.d.ts +21 -0
- package/dist/types/client/gun/display.d.ts +32 -0
- package/dist/types/client/gun/held.d.ts +75 -0
- package/dist/types/client/gun/kinds.d.ts +12 -0
- package/dist/types/client/gun/loft.d.ts +16 -0
- package/dist/types/client/gun/paint.d.ts +30 -0
- package/dist/types/client/gun/railgun.d.ts +34 -0
- package/dist/types/client/gun/reload.d.ts +112 -0
- package/dist/types/client/gun/rifle.d.ts +54 -0
- package/dist/types/client/gun/sidearm.d.ts +32 -0
- package/dist/types/client/gun.d.ts +10 -308
- package/dist/types/client/hulk/cabin.d.ts +36 -0
- package/dist/types/client/hulk/common.d.ts +55 -0
- package/dist/types/client/hulk/debris.d.ts +16 -0
- package/dist/types/client/hulk/hull.d.ts +81 -0
- package/dist/types/client/hulk/inside.d.ts +5 -0
- package/dist/types/client/hulk/parts.d.ts +16 -0
- package/dist/types/client/hulk/types.d.ts +7 -0
- package/dist/types/client/hulk/wings.d.ts +4 -0
- package/dist/types/client/hulk.d.ts +8 -18
- package/dist/types/client/hunter/animation.d.ts +113 -0
- package/dist/types/client/hunter/constants.d.ts +53 -0
- package/dist/types/client/hunter/disc.d.ts +33 -0
- package/dist/types/client/hunter/harpoon.d.ts +68 -0
- package/dist/types/client/hunter/marine.d.ts +14 -0
- package/dist/types/client/hunter/model.d.ts +4 -0
- package/dist/types/client/hunter/rest.d.ts +7 -0
- package/dist/types/client/hunter.d.ts +7 -164
- package/dist/types/client/render/camera.d.ts +58 -0
- package/dist/types/client/render/constants.d.ts +63 -0
- package/dist/types/client/render/scene.d.ts +58 -0
- package/dist/types/client/render/shader.d.ts +62 -0
- package/dist/types/client/render/shots.d.ts +61 -0
- package/dist/types/client/render/types.d.ts +74 -0
- package/dist/types/client/render.d.ts +9 -277
- package/dist/types/client/sfx/air.d.ts +46 -0
- package/dist/types/client/sfx/anthem.d.ts +27 -0
- package/dist/types/client/sfx/layers.d.ts +6 -0
- package/dist/types/client/sfx/music.d.ts +96 -0
- package/dist/types/client/sfx/render.d.ts +10 -0
- package/dist/types/client/sfx/sounds.d.ts +180 -0
- package/dist/types/client/sfx/synth.d.ts +24 -0
- package/dist/types/client/sfx/voices.d.ts +59 -0
- package/dist/types/client/sfx.d.ts +8 -325
- package/dist/types/client/skin/head.d.ts +120 -0
- package/dist/types/client/skin/lofts.d.ts +145 -0
- package/dist/types/client/skin/pose.d.ts +102 -0
- package/dist/types/client/skin/shape.d.ts +2 -0
- package/dist/types/client/skin.d.ts +4 -179
- package/dist/types/client/soldier/animate.d.ts +12 -0
- package/dist/types/client/soldier/carry.d.ts +28 -0
- package/dist/types/client/soldier/common.d.ts +8 -0
- package/dist/types/client/soldier/draw.d.ts +12 -0
- package/dist/types/client/soldier/grasp.d.ts +28 -0
- package/dist/types/client/soldier/hunter.d.ts +38 -0
- package/dist/types/client/soldier/runner.d.ts +58 -0
- package/dist/types/client/soldier/stance.d.ts +20 -0
- package/dist/types/client/soldier/types.d.ts +107 -0
- package/dist/types/client/soldier.d.ts +9 -236
- package/dist/types/client/xeno/back.d.ts +113 -0
- package/dist/types/client/xeno/body.d.ts +63 -0
- package/dist/types/client/xeno/common.d.ts +28 -0
- package/dist/types/client/xeno/head.d.ts +109 -0
- package/dist/types/client/xeno/limbs.d.ts +62 -0
- package/dist/types/client/xeno/mouth.d.ts +23 -0
- package/dist/types/client/xeno/parts.d.ts +40 -0
- package/dist/types/client/xeno/tail.d.ts +107 -0
- package/dist/types/client/xeno.d.ts +8 -246
- package/package.json +1 -1
- package/dist/landfall-CXJnap8w.js +0 -21
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { PlayerState } from '../../shared/types';
|
|
2
|
+
import type { World } from '../../shared/world';
|
|
3
|
+
import type { Floor } from '../gait';
|
|
4
|
+
import type { Vec3 } from '../mesh';
|
|
5
|
+
/** The floor under a player standing at height `y`: the first top within a step above or below it. */
|
|
6
|
+
export declare const floorOf: (world: World, y: number) => Floor;
|
|
7
|
+
/** On a wall run the rail gun is put away, unless its bolt is going out; a swimmer's hands are free. */
|
|
8
|
+
export declare const stowed: (p: PlayerState) => boolean;
|
|
9
|
+
/** How flat the hand lies (0 open, 1 a fist) and how far it rolls about the forearm (radians, added to the palm down), at the same keys: joined and flat, cupped through the pull, joined again under the chin. */
|
|
10
|
+
export declare const CURLS: number[];
|
|
11
|
+
export declare const ROLLS: number[];
|
|
12
|
+
/** A closed Catmull-Rom curve through `keys` at phase `u`: it never stops at a key. */
|
|
13
|
+
export declare const loop: (keys: number[], u: number) => number;
|
|
14
|
+
/** The hand at phase `u` along PULL; `m` of the way from treading water (each hand sculling in turn) to it. */
|
|
15
|
+
export declare const strokeHand: (u: number, sd: number, m: number) => Vec3;
|
|
16
|
+
/** The blends the animation eases, each toward 0 or 1, and how fast (1 / s). */
|
|
17
|
+
export declare const RATES: {
|
|
18
|
+
amp: number;
|
|
19
|
+
sprint: number;
|
|
20
|
+
air: number;
|
|
21
|
+
rise: number;
|
|
22
|
+
dash: number;
|
|
23
|
+
plant: number;
|
|
24
|
+
wall: number;
|
|
25
|
+
slide: number;
|
|
26
|
+
stun: number;
|
|
27
|
+
gun: number;
|
|
28
|
+
blade: number;
|
|
29
|
+
feast: number;
|
|
30
|
+
swim: number;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Ticks into a glory kill where the head starts back, where it strikes and where the strike is home:
|
|
34
|
+
* GLORY_TICKS takes his head 0.1 s later (the user, 2026-11-16: the head went too long after).
|
|
35
|
+
*/
|
|
36
|
+
export declare const BITE: number[];
|
|
37
|
+
/**
|
|
38
|
+
* The bite of a glory kill (the user, 2026-11-16, after DOOM 2016) at `lock` ticks left of its
|
|
39
|
+
* GLORY_TICKS: once on him (feast.ts) the head drawn slowly back as the claws hold the prey, then
|
|
40
|
+
* driven down into him; the neck's turn for menace().
|
|
41
|
+
*/
|
|
42
|
+
export declare const devour: (lock: number) => number;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import type { Vec3 } from '../mesh';
|
|
2
|
+
import type { Pose, Quat } from '../rig';
|
|
3
|
+
import type { Out } from '../verts';
|
|
4
|
+
import type { Pieces } from '../store';
|
|
5
|
+
import type { Solved } from './types';
|
|
6
|
+
/** Draws `vertices` turned by `q` and moved to `at`: a store piece with `pieces`, else into `out`. */
|
|
7
|
+
export declare const placeRigid: (out: Out, key: string, vertices: number[], q: Quat, at: Vec3, pieces?: Pieces) => void;
|
|
8
|
+
/** The point `k` along the direction `d` from `o`. */
|
|
9
|
+
export declare const along: (o: Vec3, d: Vec3, k: number) => Vec3;
|
|
10
|
+
/** The shortest rotation that turns the direction a into b. */
|
|
11
|
+
export declare const arc: (a: Vec3, b: Vec3) => Quat;
|
|
12
|
+
/**
|
|
13
|
+
* The middle joint of a two-bone limb from `a` toward `b`, bones l1 and l2, bent toward `pole`; and
|
|
14
|
+
* the end it reaches, which is short of `b` when that is out of reach.
|
|
15
|
+
*/
|
|
16
|
+
export declare const ik: (a: Vec3, b: Vec3, pole: Vec3, l1: number, l2: number) => [Vec3, Vec3];
|
|
17
|
+
/**
|
|
18
|
+
* Turns the limb of root joint j (a shoulder, a hip) in `q` so that its end reaches `to`, the
|
|
19
|
+
* middle joint toward `pole`. `s` is q solved: the bones keep their twist and swing the shortest
|
|
20
|
+
* way. The end joint keeps its own turn in the world (a foot stays flat) or follows the bone (a hand).
|
|
21
|
+
*/
|
|
22
|
+
export declare const reach: (q: Pose, s: Solved, j: number, to: Vec3, pole: Vec3, flat?: boolean) => void;
|
|
23
|
+
/** The part of `v` across the unit vector `u`. */
|
|
24
|
+
export declare const across: (v: Vec3, u: Vec3) => Vec3;
|
|
25
|
+
/** The twist of the turn `q` about the unit axis `b`, radians in [-PI, PI]. */
|
|
26
|
+
export declare const twist: (q: Quat, b: Vec3) => number;
|
|
27
|
+
/** The rotation `r` turned the shortest way so that its bone of rest offset `rest` lies along `d`. */
|
|
28
|
+
export declare const lay: (r: Quat, rest: Vec3, d: Vec3) => Quat;
|
|
29
|
+
/** The share of the trunk's twist the hands go round with in the first person, on top of the view's SWAY. */
|
|
30
|
+
export declare const HANDS = 0.3;
|
|
31
|
+
/**
|
|
32
|
+
* How far forward (along the body's front, `yaw`) the point `p` must go to be in sight from `eye`
|
|
33
|
+
* and out of the trunk of `s`: an upright ellipse TRUNK_W by TRUNK_D round the line from under the
|
|
34
|
+
* hips to the neck. Under the chest, the line from the eye over its front hides what is behind it,
|
|
35
|
+
* so a point there must be ahead of that line. 0 when it is clear already, or beside the trunk.
|
|
36
|
+
*/
|
|
37
|
+
export declare const outOf: (s: Solved, yaw: number, eye: Vec3, p: Vec3) => number;
|
|
38
|
+
/** The shoulder of arm `j` of `q` (`s` solved) goes with the hand at `at`: up as it rises over it, forward as it reaches out. */
|
|
39
|
+
export declare const shrug: (q: Pose, s: Solved, j: number, at: Vec3) => void;
|
|
40
|
+
/** The most a clavicle turns for a held hand out of reach (wield()), radians. */
|
|
41
|
+
export declare const REACH = 0.75;
|
|
42
|
+
/** Where a fist holds a handle, from the wrist: along the fingers, and toward the palm. */
|
|
43
|
+
export declare const FIST: number[];
|
|
44
|
+
/**
|
|
45
|
+
* The left hand round the rail gun's capsule, 3.7 cm thick: its axis through the hollow of the
|
|
46
|
+
* hand, further from the palm than a handle's, the fingers less closed (the user, 2026-11-10: the
|
|
47
|
+
* fist closed beside it).
|
|
48
|
+
*/
|
|
49
|
+
export declare const CAPSULE_HOLD: number[];
|
|
50
|
+
export declare const CAPSULE_CURL = 0.6;
|
|
51
|
+
/** How far up the capsule from its foot the middle of the hand is. */
|
|
52
|
+
export declare const CAPSULE_UP = 0.036;
|
|
53
|
+
/**
|
|
54
|
+
* The left fist on the katana's grip: 8 mm further along the fingers and 6 mm nearer the palm than
|
|
55
|
+
* FIST, so the grip runs through its curled fingers (the user, 2026-11-09).
|
|
56
|
+
*/
|
|
57
|
+
export declare const KATANA_LEFT: number[];
|
|
58
|
+
/**
|
|
59
|
+
* How far the left fist's fingers lean toward the blade, as [sin, cos]: less than the right's [S, C]
|
|
60
|
+
* (0.55 rad), so the grip runs along the curl of its fingers, through the fist (the user,
|
|
61
|
+
* 2026-11-09: at 0.9 it left the fist). The arms are still solved for a hand held as the right
|
|
62
|
+
* (clasp()); the left wrist bends slightly by the difference, a set angle.
|
|
63
|
+
*/
|
|
64
|
+
export declare const KATANA_TILT: number[];
|
|
65
|
+
export declare const S0: number, C0: number;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { PlayerState } from '../../shared/types';
|
|
2
|
+
import type { Plant } from '../prints';
|
|
3
|
+
import type { Vec3 } from '../mesh';
|
|
4
|
+
import type { solve } from '../rig';
|
|
5
|
+
import type { Out } from '../verts';
|
|
6
|
+
import type { Pieces } from '../store';
|
|
7
|
+
export type Solved = ReturnType<typeof solve>;
|
|
8
|
+
export interface Body {
|
|
9
|
+
/** The own player's id, -1 before the first snapshot. */
|
|
10
|
+
readonly id: number;
|
|
11
|
+
/** Advances dt seconds: the own player, eased (undefined before the first snapshot), the kick of the gun (0 to 1) and the aspect of the screen, which keeps the gun in a narrow one. */
|
|
12
|
+
update(me: PlayerState | undefined, dt: number, kick?: number, aspect?: number): void;
|
|
13
|
+
/**
|
|
14
|
+
* Where the look ray ends, in the camera's space (right, up, forward), each frame: the gun points
|
|
15
|
+
* at it, at least 3 m out, so that the beam leaves the emitter along its long axis.
|
|
16
|
+
*/
|
|
17
|
+
aim(target: Vec3): void;
|
|
18
|
+
/** The muzzle of the gun in the right hand, in the camera's space (right, up, forward), as of the last update. */
|
|
19
|
+
muzzle(): Vec3;
|
|
20
|
+
/** How far a share of the trunk's twist in a cut has turned the body as of the last update (radians, trunk()): the drawn view turns with it. */
|
|
21
|
+
spun(): number;
|
|
22
|
+
/** The katana in hand just struck a ball back: it snaps into the parry (DEFLECT, katana.ts) and eases back. */
|
|
23
|
+
parried(): void;
|
|
24
|
+
/** Its gait's footsteps so far and stride phase (Gait.steps, Gait.phase): the sounds of its steps and the bob of the view go with its feet. */
|
|
25
|
+
readonly steps: number;
|
|
26
|
+
readonly phase: number;
|
|
27
|
+
/** Its gait's last footfall (Gait.plant), for the prints it leaves. Recreated with the gait. */
|
|
28
|
+
readonly plant: Plant;
|
|
29
|
+
/** The joints for a camera at `eye`; undefined without a player, or with the camera away from the body. */
|
|
30
|
+
pose(eye: Vec3, yaw: number, pitch: number, roll?: number): Solved | undefined;
|
|
31
|
+
/**
|
|
32
|
+
* Appends the body's vertices (see STRIDE) in the jacket `color`; nothing when pose() has none.
|
|
33
|
+
* Its rigid pieces go to `pieces` when given (the Hunter's armour and harpoon): kept on the GPU,
|
|
34
|
+
* they carry their rest place, which their textures need, where the frame's vertices have none.
|
|
35
|
+
*/
|
|
36
|
+
draw(out: Out, eye: Vec3, yaw: number, pitch: number, roll?: number, color?: number[], pieces?: Pieces): void;
|
|
37
|
+
/** 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). */
|
|
38
|
+
wear(build: number, tone?: number[], ninja?: boolean, xeno?: boolean, hunter?: boolean): void;
|
|
39
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { Vec3 } from '../mesh';
|
|
2
|
+
import type { Pose } from '../rig';
|
|
3
|
+
import type { Solved } from './types';
|
|
4
|
+
/**
|
|
5
|
+
* Puts the arm of shoulder joint `j` (ARM_R or ARM_L) of `q` on a handle running along the unit
|
|
6
|
+
* `g`, the hand round the point `at`, the elbow toward `pole`; `solved` is q solved. The shoulder
|
|
7
|
+
* (the clavicle) rises with a hand over it and comes forward with a long reach. The hand comes
|
|
8
|
+
* first: its axis leaves the handle on the shoulder's side, the thumb along the handle (the tilt of
|
|
9
|
+
* katana.ts), and the elbow goes where the forearm carries on that axis, as near as the bones
|
|
10
|
+
* allow. The elbow is a hinge, and the forearm's turn about itself goes half to the elbow and half
|
|
11
|
+
* to the wrist, as a forearm's twist does. Out of reach the hand stops short.
|
|
12
|
+
*/
|
|
13
|
+
export declare const wield: (q: Pose, solved: Solved, j: number, at: Vec3, g: Vec3, pole: Vec3, held?: Vec3, [reach, palm]?: number[], [S, C]?: number[],
|
|
14
|
+
/** The forearm on `held`'s line, not the hand's: the wrist cocked by the hand's own tilt. */
|
|
15
|
+
bent?: boolean,
|
|
16
|
+
/** The shoulder follows a hand out of reach. */
|
|
17
|
+
far?: boolean) => void;
|
|
18
|
+
/** `v` turned by the rotation vector `w` (its length the angle, radians). */
|
|
19
|
+
export declare const rotate: (v: Vec3, w: Vec3) => Vec3;
|
|
20
|
+
/**
|
|
21
|
+
* The katana and both fists as one rigid piece, the wrists straight, so that a cut is the arms'
|
|
22
|
+
* alone (the user, 2026-11-07): the right hand round the grip, the left BEHIND it, each turned a
|
|
23
|
+
* fixed way about the handle (from `at`, `g` and the elbows' `poles`) and its forearm carrying on
|
|
24
|
+
* along its fingers, so that each elbow is a forearm's length back from its wrist. The piece goes
|
|
25
|
+
* the least way from where the cut puts it (a radian of the blade weighs as 3 m of the hands) to
|
|
26
|
+
* where both elbows are an upper arm's length from their shoulders; `turn` is what a radian of the
|
|
27
|
+
* blade weighs against a metre of the hands, as a freedom (a parry holds its line: less). Returns
|
|
28
|
+
* the grip, the blade, and the fingers of the right hand and of the left.
|
|
29
|
+
*/
|
|
30
|
+
export declare const clasp: (s: Solved, at: Vec3, g: Vec3, poles: [Vec3, Vec3], turn?: number) => [Vec3, Vec3, Vec3, Vec3];
|
|
@@ -1,207 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
export
|
|
10
|
-
export
|
|
11
|
-
/** The own player's id, -1 before the first snapshot. */
|
|
12
|
-
readonly id: number;
|
|
13
|
-
/** Advances dt seconds: the own player, eased (undefined before the first snapshot), the kick of the gun (0 to 1) and the aspect of the screen, which keeps the gun in a narrow one. */
|
|
14
|
-
update(me: PlayerState | undefined, dt: number, kick?: number, aspect?: number): void;
|
|
15
|
-
/**
|
|
16
|
-
* Where the look ray ends, in the camera's space (right, up, forward), each frame: the gun points
|
|
17
|
-
* at it, at least 3 m out, so that the beam leaves the emitter along its long axis.
|
|
18
|
-
*/
|
|
19
|
-
aim(target: Vec3): void;
|
|
20
|
-
/** The muzzle of the gun in the right hand, in the camera's space (right, up, forward), as of the last update. */
|
|
21
|
-
muzzle(): Vec3;
|
|
22
|
-
/** How far a share of the trunk's twist in a cut has turned the body as of the last update (radians, trunk()): the drawn view turns with it. */
|
|
23
|
-
spun(): number;
|
|
24
|
-
/** The katana in hand just struck a ball back: it snaps into the parry (DEFLECT, katana.ts) and eases back. */
|
|
25
|
-
parried(): void;
|
|
26
|
-
/** Its gait's footsteps so far and stride phase (Gait.steps, Gait.phase): the sounds of its steps and the bob of the view go with its feet. */
|
|
27
|
-
readonly steps: number;
|
|
28
|
-
readonly phase: number;
|
|
29
|
-
/** Its gait's last footfall (Gait.plant), for the prints it leaves. Recreated with the gait. */
|
|
30
|
-
readonly plant: Plant;
|
|
31
|
-
/** The joints for a camera at `eye`; undefined without a player, or with the camera away from the body. */
|
|
32
|
-
pose(eye: Vec3, yaw: number, pitch: number, roll?: number): Solved | undefined;
|
|
33
|
-
/**
|
|
34
|
-
* Appends the body's vertices (see STRIDE) in the jacket `color`; nothing when pose() has none.
|
|
35
|
-
* Its rigid pieces go to `pieces` when given (the Hunter's armour and harpoon): kept on the GPU,
|
|
36
|
-
* they carry their rest place, which their textures need, where the frame's vertices have none.
|
|
37
|
-
*/
|
|
38
|
-
draw(out: Out, eye: Vec3, yaw: number, pitch: number, roll?: number, color?: number[], pieces?: Pieces): void;
|
|
39
|
-
/** 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). */
|
|
40
|
-
wear(build: number, tone?: number[], ninja?: boolean, xeno?: boolean, hunter?: boolean): void;
|
|
41
|
-
}
|
|
42
|
-
export declare const inv: ([x, y, z, w]: Quat) => Quat;
|
|
43
|
-
/** The shortest rotation that turns the direction a into b. */
|
|
44
|
-
export declare const arc: (a: Vec3, b: Vec3) => Quat;
|
|
45
|
-
/**
|
|
46
|
-
* Turns the limb of root joint j (a shoulder, a hip) in `q` so that its end reaches `to`, the
|
|
47
|
-
* middle joint toward `pole`. `s` is q solved: the bones keep their twist and swing the shortest
|
|
48
|
-
* way. The end joint keeps its own turn in the world (a foot stays flat) or follows the bone (a hand).
|
|
49
|
-
*/
|
|
50
|
-
export declare const reach: (q: Pose, s: Solved, j: number, to: Vec3, pole: Vec3, flat?: boolean) => void;
|
|
51
|
-
/** The shoulder of arm `j` of `q` (`s` solved) goes with the hand at `at`: up as it rises over it, forward as it reaches out. */
|
|
52
|
-
export declare const shrug: (q: Pose, s: Solved, j: number, at: Vec3) => void;
|
|
53
|
-
/** Where a fist holds a handle, from the wrist: along the fingers, and toward the palm. */
|
|
54
|
-
export declare const FIST: number[];
|
|
55
|
-
/**
|
|
56
|
-
* The left hand round the rail gun's capsule, 3.7 cm thick: its axis through the hollow of the
|
|
57
|
-
* hand, further from the palm than a handle's, the fingers less closed (the user, 2026-11-10: the
|
|
58
|
-
* fist closed beside it).
|
|
59
|
-
*/
|
|
60
|
-
export declare const CAPSULE_HOLD: number[];
|
|
61
|
-
export declare const CAPSULE_CURL = 0.6;
|
|
62
|
-
/**
|
|
63
|
-
* The left fist on the katana's grip: 8 mm further along the fingers and 6 mm nearer the palm than
|
|
64
|
-
* FIST, so the grip runs through its curled fingers (the user, 2026-11-09).
|
|
65
|
-
*/
|
|
66
|
-
export declare const KATANA_LEFT: number[];
|
|
67
|
-
/**
|
|
68
|
-
* How far the left fist's fingers lean toward the blade, as [sin, cos]: less than the right's [S, C]
|
|
69
|
-
* (0.55 rad), so the grip runs along the curl of its fingers, through the fist (the user,
|
|
70
|
-
* 2026-11-09: at 0.9 it left the fist). The arms are still solved for a hand held as the right
|
|
71
|
-
* (clasp()); the left wrist bends slightly by the difference, a set angle.
|
|
72
|
-
*/
|
|
73
|
-
export declare const KATANA_TILT: number[];
|
|
74
|
-
/**
|
|
75
|
-
* Puts the arm of shoulder joint `j` (ARM_R or ARM_L) of `q` on a handle running along the unit
|
|
76
|
-
* `g`, the hand round the point `at`, the elbow toward `pole`; `solved` is q solved. The shoulder
|
|
77
|
-
* (the clavicle) rises with a hand over it and comes forward with a long reach. The hand comes
|
|
78
|
-
* first: its axis leaves the handle on the shoulder's side, the thumb along the handle (the tilt of
|
|
79
|
-
* katana.ts), and the elbow goes where the forearm carries on that axis, as near as the bones
|
|
80
|
-
* allow. The elbow is a hinge, and the forearm's turn about itself goes half to the elbow and half
|
|
81
|
-
* to the wrist, as a forearm's twist does. Out of reach the hand stops short.
|
|
82
|
-
*/
|
|
83
|
-
export declare const wield: (q: Pose, solved: Solved, j: number, at: Vec3, g: Vec3, pole: Vec3, held?: Vec3, [reach, palm]?: number[], [S, C]?: number[],
|
|
84
|
-
/** The forearm on `held`'s line, not the hand's: the wrist cocked by the hand's own tilt. */
|
|
85
|
-
bent?: boolean,
|
|
86
|
-
/** The shoulder follows a hand out of reach. */
|
|
87
|
-
far?: boolean) => void;
|
|
88
|
-
/**
|
|
89
|
-
* The katana and both fists as one rigid piece, the wrists straight, so that a cut is the arms'
|
|
90
|
-
* alone (the user, 2026-11-07): the right hand round the grip, the left BEHIND it, each turned a
|
|
91
|
-
* fixed way about the handle (from `at`, `g` and the elbows' `poles`) and its forearm carrying on
|
|
92
|
-
* along its fingers, so that each elbow is a forearm's length back from its wrist. The piece goes
|
|
93
|
-
* the least way from where the cut puts it (a radian of the blade weighs as 3 m of the hands) to
|
|
94
|
-
* where both elbows are an upper arm's length from their shoulders; `turn` is what a radian of the
|
|
95
|
-
* blade weighs against a metre of the hands, as a freedom (a parry holds its line: less). Returns
|
|
96
|
-
* the grip, the blade, and the fingers of the right hand and of the left.
|
|
97
|
-
*/
|
|
98
|
-
export declare const clasp: (s: Solved, at: Vec3, g: Vec3, poles: [Vec3, Vec3], turn?: number) => [Vec3, Vec3, Vec3, Vec3];
|
|
99
|
-
/** The woman's hand to the man's, about the wrist (SCALE in skin.ts has her glove's). */
|
|
100
|
-
export declare const HAND_F = 0.92;
|
|
101
|
-
/** The xenomorph's hands against the man's, about the wrist. */
|
|
102
|
-
export declare const CLAW_HAND = 1.3;
|
|
103
|
-
/** Sides around a finger (6 until the user, 2026-11-09: more detail on the hands). */
|
|
104
|
-
export declare const FINGER_SIDES = 10;
|
|
105
|
-
/** A ring of a tube: its centre and its two half axes. */
|
|
106
|
-
type Ring = [c: Vec3, x: Vec3, y: Vec3];
|
|
107
|
-
/** The curl the xenomorph's fingers close to at most. */
|
|
108
|
-
export declare const RAKE = 0.35;
|
|
109
|
-
export declare const HUNTER_HAND: Vec3;
|
|
110
|
-
/** Where the back of the Hunter's right wrist faces, in the view, with the blades out: up and well over to the right. */
|
|
111
|
-
export declare const CLAW_ROLL: Vec3;
|
|
112
|
-
/** The Hunter's left hand in its guard while the blades are out (view space, mirrored): low left, ahead. */
|
|
113
|
-
export declare const GUARD: Vec3;
|
|
114
|
-
/**
|
|
115
|
-
* The Hunter's left wrist with the shoulder cannon out (view space, mirrored): low on the left,
|
|
116
|
-
* close, the arm bent toward the eye, the computer on the forearm facing up, the view above it
|
|
117
|
-
* clear (the user, 2026-11-24, after a reference shot).
|
|
118
|
-
*/
|
|
119
|
-
export declare const COMPUTER: Vec3;
|
|
120
|
-
/** The guard hand thrown out ahead through a cut's wind-up, and pulled in to the belly on its strike. */
|
|
121
|
-
export declare const LUNGE_L: Vec3;
|
|
122
|
-
export declare const TUCK: Vec3;
|
|
123
|
-
/**
|
|
124
|
-
* How far the Hunter's left hand is out ahead (LUNGE_L) and in at the belly (TUCK), 0 to 1 each, at
|
|
125
|
-
* `prog` of his cut (-1: none): out through the wind-up to the strike, then in within a tenth of
|
|
126
|
-
* the cut, held, and back to the guard over its last quarter.
|
|
127
|
-
*/
|
|
128
|
-
export declare const counter: (p: Pick<PlayerState, "cut">, prog: number) => [number, number];
|
|
129
|
-
type Claws = boolean | 'short';
|
|
130
|
-
/** The ring of a finger from which on it is bare: the glove's fingers end 60 % along the middle phalanx. */
|
|
131
|
-
export declare const BARE = 8;
|
|
132
|
-
export declare const finger: (p: Vec3, d1: Vec3, d2: Vec3, d3: Vec3, l: number, r: number, t: Vec3,
|
|
133
|
-
/** 0 to 1: a skeleton's finger (the xenomorph's), thin bones between swollen knuckles, a fine tip. */
|
|
134
|
-
bony?: number,
|
|
135
|
-
/** How far each joint's curve reaches along the bones, a share of them: less, a sharper joint. */
|
|
136
|
-
knee?: number) => Ring[];
|
|
137
|
-
export declare const phalanges: (curl: number, i: number, spread?: number, hook?: number) => [Vec3, Vec3, Vec3];
|
|
138
|
-
/** The strap round the wrist (the user, 2026-11-14: finer): its width, and how far it stands out of the palm's ring. */
|
|
139
|
-
export declare const STRAP: {
|
|
140
|
-
w: number;
|
|
141
|
-
k: number;
|
|
142
|
-
};
|
|
143
|
-
/** The marine's lit buttons on it, in place of the buckle (the user, 2026-11-14: no black box): across (toward the thumb), and colour. */
|
|
144
|
-
export declare const WRIST_LIGHTS: [number, number[]][];
|
|
145
|
-
/**
|
|
146
|
-
* A gloved hand at the wrist `end`: the fingers along `f`, the back of the hand along `u`, the thumb
|
|
147
|
-
* toward `th` (unit vectors). `curl` runs from 0, a flat open hand with the fingers spread, to 1, a
|
|
148
|
-
* fist. The palm is one tube that starts as the sleeve's cuff ends and spreads to the knuckles,
|
|
149
|
-
* and each finger and the thumb one tube from there, bent at its joints: no solid meets another
|
|
150
|
-
* in a line, and the normals are smooth all over. A tactical glove (the user, 2026-11-09: more
|
|
151
|
-
* detail): fingerless from halfway along the middle phalanx, the bare tips in `bare` with a nail
|
|
152
|
-
* each; a hard shell over the knuckles, a padded plate on the back, a strap round the wrist.
|
|
153
|
-
*/
|
|
154
|
-
export declare const hand: (out: Out, end: Vec3, f: Vec3, u: Vec3, th: Vec3, curl: number, tint: number[], point?: number, push?: number, to?: Vec3, bare?: number[],
|
|
155
|
-
/** 0 to 1: the thumb out of the fist to CUP, up the side of what the palm carries. */
|
|
156
|
-
cup?: number,
|
|
157
|
-
/** A near runner's hand: fewer sides, on the near sleeve's cuff, and none of the glove's small parts. */
|
|
158
|
-
lite?: boolean,
|
|
159
|
-
/** The marine's: lit buttons on the strap round the wrist (WRIST_LIGHTS). */
|
|
160
|
-
lights?: boolean,
|
|
161
|
-
/** The xenomorph's claws on the fingertips (Grip). */
|
|
162
|
-
claws?: Claws,
|
|
163
|
-
/** Its size: the xenomorph's grows from the wrist over 4 cm, hers is smaller (hands()). */
|
|
164
|
-
grow?: number,
|
|
165
|
-
/** How far the fingers fan out, times an open hand's (phalanges()). */
|
|
166
|
-
spread?: number,
|
|
167
|
-
/** How far the fingers' last bones bend further, radians (phalanges()). */
|
|
168
|
-
hook?: number) => void;
|
|
169
|
-
/** What a hand does besides closing (hand()): the left index pointing, the right thumb pushing toward `to`, the left thumb cupped. */
|
|
170
|
-
export interface Grip {
|
|
171
|
-
point?: number;
|
|
172
|
-
push?: number;
|
|
173
|
-
to?: Vec3;
|
|
174
|
-
cup?: number;
|
|
175
|
-
/** The marine's lit buttons on the wrists' straps. */
|
|
176
|
-
lights?: boolean;
|
|
177
|
-
/** The xenomorph's: a hooked claw of bone on each fingertip, for the nail. */
|
|
178
|
-
claws?: Claws;
|
|
179
|
-
/** The right hand's fingers fanned out this many times an open hand's (the Hunter's disc). */
|
|
180
|
-
spread?: number;
|
|
181
|
-
/** The right hand's fingers' last bones bent further, radians: gripping an edge. */
|
|
182
|
-
hook?: number;
|
|
183
|
-
/** The right index straightened out of the fist as `point` the left (the Hunter's wrist computer). */
|
|
184
|
-
poke?: number;
|
|
185
|
-
}
|
|
186
|
-
/**
|
|
187
|
-
* Both hands of the skeleton `s` on its wrists, left then right, each closed `curls[i]` (hand()), in
|
|
188
|
-
* the glove `glove` with the bare fingertips `bare`; hers smaller about the wrist (HAND_F). The own
|
|
189
|
-
* body and the runners share it, so a runner's fist closes on a grip as the own one does. `lite` is
|
|
190
|
-
* a near runner's hand, `skip` a hand not drawn (the one a cut took off with its arm).
|
|
191
|
-
*/
|
|
192
|
-
export declare const hands: (out: Out, s: Solved, build: number, curls: number[], glove: number[], bare: number[], { point, push, to, cup, lights, claws, spread, hook, poke, }?: Grip, lite?: boolean, skip?: number) => void;
|
|
193
|
-
/** On a wall run the rail gun is put away, unless its bolt is going out; a swimmer's hands are free. */
|
|
194
|
-
export declare const stowed: (p: PlayerState) => boolean;
|
|
195
|
-
/**
|
|
196
|
-
* Ticks into a glory kill where the head starts back, where it strikes and where the strike is home:
|
|
197
|
-
* GLORY_TICKS takes his head 0.1 s later (the user, 2026-11-16: the head went too long after).
|
|
198
|
-
*/
|
|
199
|
-
export declare const BITE: number[];
|
|
200
|
-
/**
|
|
201
|
-
* The bite of a glory kill (the user, 2026-11-16, after DOOM 2016) at `lock` ticks left of its
|
|
202
|
-
* GLORY_TICKS: once on him (feast.ts) the head drawn slowly back as the claws hold the prey, then
|
|
203
|
-
* driven down into him; the neck's turn for menace().
|
|
204
|
-
*/
|
|
205
|
-
export declare const devour: (lock: number) => number;
|
|
206
|
-
export declare const createBody: (world?: World) => Body;
|
|
207
|
-
export {};
|
|
1
|
+
export * from './body/types';
|
|
2
|
+
export * from './body/constants';
|
|
3
|
+
export * from './body/hunter';
|
|
4
|
+
export * from './body/reach';
|
|
5
|
+
export * from './body/wield';
|
|
6
|
+
export * from './body/fingers';
|
|
7
|
+
export * from './body/glove';
|
|
8
|
+
export * from './body/hands';
|
|
9
|
+
export * from './body/motion';
|
|
10
|
+
export * from './body/create';
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/** Spring slots, a value and its speed each: lean, bank, yaw offset, landing dip, crouch, the velocity the stride sees, the pelvis height, how far up a ledge the climb is, the knock ahead and to the right, then one per move. */
|
|
2
|
+
export declare const LEAN: number, BANK: number, YAW: number, DIP: number, LOW: number, VX: number, VZ: number, HY: number, UP: number, KA: number, KR: number, W: number;
|
|
3
|
+
/** Metres a respawn moves a player in a frame, at the least. */
|
|
4
|
+
export declare const TELEPORT = 5;
|
|
5
|
+
/** Half of a hip joint's distance from the middle: the feet stand under the hips on the move. */
|
|
6
|
+
export declare const HIP = 0.1;
|
|
7
|
+
/**
|
|
8
|
+
* The guard a still runner stands in, not straight as a post (the user, 2026-11-08): half the
|
|
9
|
+
* feet's spread (metres), how far the right foot stands ahead and the left behind (metres), the
|
|
10
|
+
* trunk's lean forward (radians), and how far the legs give.
|
|
11
|
+
*/
|
|
12
|
+
export declare const WIDE: number, STEP: number, BOW: number, GIVE: number;
|
|
13
|
+
/** How much wider, longer, further forward and lower the guard of one with nothing in his hands is: a fighter's stance (FISTS). */
|
|
14
|
+
export declare const LOW_GUARD: number[];
|
|
15
|
+
/**
|
|
16
|
+
* The guard of one with nothing in his hands (the user, 2026-11-11: the arms out before him as in
|
|
17
|
+
* karate, not along the body, not a boxer's fists by the chin): the lead arm (the right, as the
|
|
18
|
+
* right foot) nearly straight ahead at the chest's height, the rear hand half way out before the
|
|
19
|
+
* solar plexus. Per arm, the lead then the rear: the upper arm's lift forward and out to the side,
|
|
20
|
+
* its turn inward, and the elbow's bend (radians).
|
|
21
|
+
*/
|
|
22
|
+
export declare const FISTS: number[][];
|
|
23
|
+
/**
|
|
24
|
+
* The breath of one standing still (the user, 2026-11-11: see him breathe): breaths a second, the
|
|
25
|
+
* chest's lift (radians), the shoulders' (radians), and the rise of the whole body on its legs (metres).
|
|
26
|
+
*/
|
|
27
|
+
export declare const BREATH: number[];
|
|
28
|
+
/**
|
|
29
|
+
* The guard with the katana in hand, a swordsman's middle guard (the user, 2026-11-10: stand like
|
|
30
|
+
* a samurai): how much further ahead the right foot stands and behind the left (metres), the pitch
|
|
31
|
+
* of the left foot, its heel off the floor (radians), the share of the lean forward that is left,
|
|
32
|
+
* the back straight, and how much more the legs give, the knees soft.
|
|
33
|
+
*/
|
|
34
|
+
export declare const KAMAE: number[];
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { PlayerState } from '../../shared/types';
|
|
2
|
+
import type { Quat } from '../rig';
|
|
3
|
+
/**
|
|
4
|
+
* An arm's pose, the upper arm then the forearm, as the gait builds them: `s` 1 the right, -1 the
|
|
5
|
+
* left; the upper arm's lift forward, out to the side and turn inward, and the elbow's bend.
|
|
6
|
+
*/
|
|
7
|
+
export declare const armOf: (s: number, [lift, out, inward, bend]: number[]) => [Quat, Quat];
|
|
8
|
+
/**
|
|
9
|
+
* A punch from the guard (the user, 2026-11-11), a karate reverse punch: the rear hand (the left)
|
|
10
|
+
* driven straight out at the chest's height, the lead one drawn back to the hip, the chest turned
|
|
11
|
+
* behind the blow (radians, the left shoulder forward).
|
|
12
|
+
*/
|
|
13
|
+
export declare const JAB: {
|
|
14
|
+
out: number[];
|
|
15
|
+
back: number[];
|
|
16
|
+
twist: number;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* The other blows (BLOW, the user 2026-11-13), as JAB's arms: the HOOK's left arm swung round at
|
|
20
|
+
* the shoulder's height, the elbow bent square and out, the chest turned behind it; the LUNGE's right
|
|
21
|
+
* arm driven straight out, further than a jab, the chest turned the other way.
|
|
22
|
+
*/
|
|
23
|
+
export declare const HOOK: {
|
|
24
|
+
out: number[];
|
|
25
|
+
twist: number;
|
|
26
|
+
};
|
|
27
|
+
export declare const LUNGE: {
|
|
28
|
+
out: number[];
|
|
29
|
+
twist: number;
|
|
30
|
+
};
|
|
31
|
+
/** Any strike of the xenomorph's tail, as a blow: none of BLOW's, told apart for its arm and its sound. */
|
|
32
|
+
export declare const TAIL_BLOW = 6;
|
|
33
|
+
/** The striking arm of each blow (BLOW): -1 the left, 1 the right; the xenomorph's claws, and its tail (TAIL_BLOW), which takes no arm (0). */
|
|
34
|
+
export declare const SIDE: number[];
|
|
35
|
+
/** Whether the player has no weapon at all: FIRE punches. */
|
|
36
|
+
export declare const bare: (p: PlayerState) => boolean;
|
|
37
|
+
/**
|
|
38
|
+
* The blow (BLOW) of a bare-handed swing. The xenomorph's (`xeno`) cut reads TAILS: its claws, else
|
|
39
|
+
* its tail's TAIL_BLOW.
|
|
40
|
+
*/
|
|
41
|
+
export declare const blowOf: (p: Pick<PlayerState, "cut">, xeno?: boolean) => number;
|
|
42
|
+
/** The numbers of the swing a bare-handed player is in: the blow's, or the xenomorph's (TAILS, a heavy one's own). */
|
|
43
|
+
export declare const blowing: (p: Pick<PlayerState, "cut" | "heavy">, xeno?: boolean) => {
|
|
44
|
+
ticks: number;
|
|
45
|
+
strike: number;
|
|
46
|
+
reach: number;
|
|
47
|
+
arc: number;
|
|
48
|
+
hp: number;
|
|
49
|
+
hold: number;
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* How far out the fist of a punch is, 0 to 1, by the swing of a player with no weapon at all: out
|
|
53
|
+
* at the strike of its blow, back by the swing's end. None for the xenomorph's tail.
|
|
54
|
+
*/
|
|
55
|
+
export declare const thrown: (p: PlayerState, xeno?: boolean) => number;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { Vec3 } from '../mesh';
|
|
2
|
+
import type { Quat } from '../rig';
|
|
3
|
+
export declare const TAU: number;
|
|
4
|
+
export declare const X: Vec3, Y: Vec3, Z: Vec3;
|
|
5
|
+
/** Thigh and shin, and the ankle above the floor when the foot is flat. */
|
|
6
|
+
export declare const THIGH: number, SHIN: number, SOLE: number;
|
|
7
|
+
/** Upper arm and forearm (the rest offsets of the elbow and the wrist). */
|
|
8
|
+
export declare const ARM_M: number, FORE_M: number;
|
|
9
|
+
export declare const LEG: number;
|
|
10
|
+
export declare const clamp: (v: number, lo?: number, hi?: number) => number;
|
|
11
|
+
export declare const ease: (v: number) => number;
|
|
12
|
+
export declare const arc: (a: number, b: number) => number;
|
|
13
|
+
export declare const inv: (q: Quat) => Quat;
|
|
14
|
+
/** Per player and per number, in [0, 1). */
|
|
15
|
+
export declare const rnd: (id: number, n: number) => number;
|
|
16
|
+
export declare const cross: (a: Vec3, b: Vec3) => Vec3;
|
|
17
|
+
/** p a + q b. */
|
|
18
|
+
export declare const lin: (a: Vec3, p: number, b: Vec3, q?: number) => Vec3;
|
|
19
|
+
export declare const unit: (a: Vec3) => Vec3;
|
|
20
|
+
/** The part of `v` across the unit vector `u`. */
|
|
21
|
+
export declare const perp: (v: Vec3, u: Vec3) => Vec3;
|
|
22
|
+
/** Smooth minimum: the lower of two, rounded over a band of k. */
|
|
23
|
+
export declare const low: (a: number, b: number, k: number) => number;
|
|
24
|
+
/** The rotation whose x axis is `x` and whose y axis points up the bone, opposite to `d`. */
|
|
25
|
+
export declare const frame: (x: Vec3, d: Vec3) => Quat;
|
|
26
|
+
/**
|
|
27
|
+
* The world rotations of the two bones of a limb (lengths `a` and `b`, a leg by default) that put
|
|
28
|
+
* the end at `t` from the root at `h`, the middle joint toward `f`. A knee or an elbow bends about
|
|
29
|
+
* the one axis (`k` -1 for an arm, which folds the other way), so it never turns backward; a target
|
|
30
|
+
* out of reach leaves the limb straight.
|
|
31
|
+
*/
|
|
32
|
+
export declare const limb: (h: Vec3, t: Vec3, f: Vec3, a_?: number, b_?: number, k?: number) => [Quat, Quat];
|
|
33
|
+
/**
|
|
34
|
+
* How far the ankle moves forward and up from where it stands with the foot flat, when the foot
|
|
35
|
+
* is pitched `t` (toes up positive): it turns about the heel, or about the ball once the toes
|
|
36
|
+
* point down. The heel is 7 cm behind the ankle and the ball 13 cm ahead, the sole 6 cm below.
|
|
37
|
+
*/
|
|
38
|
+
export declare const roll: (t: number) => [number, number];
|