@korial29/tiny-fps 0.94.0 → 0.96.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/README.md +4 -4
- package/dist/index.js +13 -13
- package/dist/local.js +1 -1
- package/dist/server.js +413 -71
- package/dist/types/client/moonbase.d.ts +14 -0
- package/dist/types/client/moonscape.d.ts +5 -0
- package/dist/types/client/render.d.ts +2 -0
- package/dist/types/shared/moon.d.ts +6 -7
- package/dist/types/shared/moonbase.d.ts +17 -0
- package/dist/types/shared/physics.d.ts +11 -0
- package/dist/types/shared/relief.d.ts +55 -0
- package/dist/types/shared/rover.d.ts +71 -0
- package/dist/types/shared/types.d.ts +38 -1
- package/dist/types/shared/world.d.ts +10 -6
- package/package.json +1 -1
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Vec3 } from './mesh';
|
|
2
|
+
/** A model whose length runs up (y): the frame place() takes. */
|
|
3
|
+
export declare const UP: Vec3[];
|
|
4
|
+
export declare const cross: (u: Vec3, v: Vec3) => Vec3;
|
|
5
|
+
/** A convex polygon of one colour, wound so that it faces away from `away` when given. */
|
|
6
|
+
export declare const face: (o: number[], p: Vec3[], rgb: number[], away?: Vec3) => void;
|
|
7
|
+
/** A box of one colour between two corners, its faces outward. */
|
|
8
|
+
export declare const box: (o: number[], lo: Vec3, hi: Vec3, rgb: number[]) => void;
|
|
9
|
+
/** Carries a model's vertices to (x, y, z), turned by `yaw` about y. */
|
|
10
|
+
export declare const put: (o: number[], v: number[], [x, y, z]: Vec3, yaw?: number) => void;
|
|
11
|
+
/** What `make` adds to `o` glows, k times its colour. */
|
|
12
|
+
export declare const lit: (o: number[], k: number, make: () => void) => void;
|
|
13
|
+
/** Red's half of the base: the dome, the tubes and the modules' windows. */
|
|
14
|
+
export declare const moonbase: (o: number[]) => void;
|
|
@@ -1,3 +1,8 @@
|
|
|
1
1
|
import type { WorldDef } from '../shared/world';
|
|
2
|
+
/**
|
|
3
|
+
* Radius of the star dome and the Earth's distance, metres: past the crater wall (drawn to 1.65
|
|
4
|
+
* of the bound) and, at most 360 m more from a spot on the bound, inside the far clip (FAR).
|
|
5
|
+
*/
|
|
6
|
+
export declare const SKY = 800;
|
|
2
7
|
/** The moon's scenery vertices, in the renderer's format. */
|
|
3
8
|
export declare const moonscape: (def: WorldDef) => number[];
|
|
@@ -23,6 +23,8 @@ export declare const HAZE = 0.6;
|
|
|
23
23
|
*/
|
|
24
24
|
export declare const FOG_LAYER = 0.02;
|
|
25
25
|
export declare const FOG_RISE = 0.05;
|
|
26
|
+
/** The far clip, metres: the moon's stars (moonscape.ts SKY) seen from the far end of its crater, the widest view of any map. */
|
|
27
|
+
export declare const FAR = 1200;
|
|
26
28
|
/** The vertical field of view at rest, degrees, and the tangent of its half. */
|
|
27
29
|
export declare const FOV_DEG = 70;
|
|
28
30
|
export declare const FOV: number;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import type { Bx } from './moonbase';
|
|
1
2
|
import type { WorldDef } from './world';
|
|
2
|
-
type Vec3 = [number, number, number];
|
|
3
3
|
/** The crater is 280 m long: a point at z has its twin at ZED - z. */
|
|
4
4
|
export declare const ZED = 280;
|
|
5
5
|
/**
|
|
@@ -8,12 +8,12 @@ export declare const ZED = 280;
|
|
|
8
8
|
* a sprint 12.6 m, a dash adds about 1.2 m and more. At full gravity those are 4.2 and 6.3 m.
|
|
9
9
|
*/
|
|
10
10
|
export declare const WEST_GAP = 13.5;
|
|
11
|
-
/** A box by its corners. */
|
|
12
|
-
interface Bx {
|
|
13
|
-
min: Vec3;
|
|
14
|
-
max: Vec3;
|
|
15
|
-
}
|
|
16
11
|
export declare const LAYOUT: {
|
|
12
|
+
/** Outside the arena: the boulders (x, z, radius), the dishes, the ramps (the middle of the lip and the unit way up it), the wreck. */
|
|
13
|
+
rocks: number[][];
|
|
14
|
+
dishes: number[][];
|
|
15
|
+
ramps: number[][];
|
|
16
|
+
wreck: number[];
|
|
17
17
|
domes: number[][];
|
|
18
18
|
pads: number[][];
|
|
19
19
|
shuttles: Bx[];
|
|
@@ -22,4 +22,3 @@ export declare const LAYOUT: {
|
|
|
22
22
|
masts: number[][];
|
|
23
23
|
};
|
|
24
24
|
export declare const MOON: WorldDef;
|
|
25
|
-
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Brush } from './world';
|
|
2
|
+
export type Vec3 = [number, number, number];
|
|
3
|
+
/** A box, corners (x0, y0, z0) and (x1, y1, z1), tops and sides, a tint. */
|
|
4
|
+
export declare const box: (x0: number, y0: number, z0: number, x1: number, y1: number, z1: number, top: number, side?: number, tint?: Vec3) => Brush;
|
|
5
|
+
export declare const fromBx: ({ min, max }: Bx, top: number, side?: number) => Brush;
|
|
6
|
+
/** A box by its corners. */
|
|
7
|
+
export interface Bx {
|
|
8
|
+
min: Vec3;
|
|
9
|
+
max: Vec3;
|
|
10
|
+
}
|
|
11
|
+
export declare const bx: (x0: number, y0: number, z0: number, x1: number, y1: number, z1: number) => Bx;
|
|
12
|
+
/** Red's dome (its centre: x, z), modules and tubes: what the scenery draws on. */
|
|
13
|
+
export declare const DOME: number[];
|
|
14
|
+
export declare const MODULES: Bx[];
|
|
15
|
+
export declare const TUBES: Bx[];
|
|
16
|
+
/** Red's half of the base. */
|
|
17
|
+
export declare const BASE: Brush[];
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Input, PlayerState } from './types';
|
|
2
2
|
import type { World } from './world';
|
|
3
|
+
type Pos = Pick<PlayerState, 'x' | 'y' | 'z'>;
|
|
3
4
|
export declare const TAU: number;
|
|
4
5
|
/** An angle in [0, 2π). */
|
|
5
6
|
export declare const norm: (a: number) => number;
|
|
@@ -65,6 +66,15 @@ export declare const eyeHeight: (p: Pick<PlayerState, "mode">) => number;
|
|
|
65
66
|
export declare const speedOf: (p: Pick<PlayerState, "vx" | "vz">) => number;
|
|
66
67
|
/** Running faster than a walk on the ground: the sprint, for the animation to pump the arms. */
|
|
67
68
|
export declare const sprinting: (p: Pick<PlayerState, "mode" | "vx" | "vz">) => boolean;
|
|
69
|
+
/** push() for a circle of radius r: a rover's body is a few of them. */
|
|
70
|
+
export declare const shove: (p: Pos, w: World, h: number, r: number) => [x: number, z: number];
|
|
71
|
+
/**
|
|
72
|
+
* The highest floor under the point (x, z) at most as high as y: the ground of the relief, or the
|
|
73
|
+
* top of a brush the point is over. For a rover's wheel.
|
|
74
|
+
*/
|
|
75
|
+
export declare const floorAt: (w: World, x: number, z: number, y: number) => number;
|
|
76
|
+
/** The world's gravity: GRAVITY times the map's share (the moon's half gravity, the user, 2026-11-09). */
|
|
77
|
+
export declare const gravity: (w: World) => number;
|
|
68
78
|
/** Whether an arc of energy floored `p` (FLOOR_TICKS): he lies down for the stun's ticks over SHOCK_TICKS, and does not move. */
|
|
69
79
|
export declare const floored: (p: Pick<PlayerState, "zap" | "stun">) => boolean;
|
|
70
80
|
/**
|
|
@@ -80,3 +90,4 @@ export declare const stumble: (p: PlayerState, dx: number, dz: number, ticks?: n
|
|
|
80
90
|
* kill floor put the player back at a spawn of his `team` (EV.RESPAWN).
|
|
81
91
|
*/
|
|
82
92
|
export declare const move: (p: PlayerState, i: Input, w: World, team?: number) => void;
|
|
93
|
+
export {};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { World } from './world';
|
|
2
|
+
type Vec3 = [number, number, number];
|
|
3
|
+
type Quad = [number, number, number, number];
|
|
4
|
+
export interface ReliefDef {
|
|
5
|
+
/** The arena, x0, z0, x1, z1: no relief inside, the brushes are the floor there and a gap between them stays open. */
|
|
6
|
+
hole: Quad;
|
|
7
|
+
/** The edge nobody crosses, an ellipse: its centre x, z and its half axes along x and z. */
|
|
8
|
+
bound: Quad;
|
|
9
|
+
/** Metres between two nodes. */
|
|
10
|
+
cell: number;
|
|
11
|
+
/**
|
|
12
|
+
* The height of the ground at a node. Only + - * /, Math.sqrt and integer hashes: Math.sin and **
|
|
13
|
+
* round differently from one engine to the next, and every side must build the same lattice.
|
|
14
|
+
*/
|
|
15
|
+
at: (x: number, z: number) => number;
|
|
16
|
+
}
|
|
17
|
+
/** The lattice built from a ReliefDef: node (i, j) is at (x0 + i * cell, z0 + j * cell), its height h[i + j * nx]. */
|
|
18
|
+
export interface Relief {
|
|
19
|
+
x0: number;
|
|
20
|
+
z0: number;
|
|
21
|
+
cell: number;
|
|
22
|
+
nx: number;
|
|
23
|
+
nz: number;
|
|
24
|
+
h: Float32Array;
|
|
25
|
+
hole: Quad;
|
|
26
|
+
bound: Quad;
|
|
27
|
+
/** The highest node: a ray above it meets no ground. */
|
|
28
|
+
top: number;
|
|
29
|
+
}
|
|
30
|
+
/** Integer hash of a lattice point to [0, 1): the same on every engine. */
|
|
31
|
+
export declare const hash: (x: number, y: number, s: number) => number;
|
|
32
|
+
/** Smooth value noise on the integer lattice, in [0, 1): flat across every lattice line, so a fold along one leaves no crease. */
|
|
33
|
+
export declare const noise: (x: number, y: number, s: number) => number;
|
|
34
|
+
/** Builds the lattice over the box of the bound, once per definition. */
|
|
35
|
+
export declare const raise: (def: ReliefDef) => Relief;
|
|
36
|
+
/**
|
|
37
|
+
* The height of the ground at (x, z), or -Infinity where there is none: a world without relief,
|
|
38
|
+
* and inside the hole. Each lattice square is two triangles split from node (i, j) to (i + 1, j + 1).
|
|
39
|
+
*/
|
|
40
|
+
export declare const ground: (w: World, x: number, z: number) => number;
|
|
41
|
+
/** Keeps a body inside the bound: put back on the ellipse, its speed out of it taken away. */
|
|
42
|
+
export declare const bound: (p: {
|
|
43
|
+
x: number;
|
|
44
|
+
z: number;
|
|
45
|
+
vx: number;
|
|
46
|
+
vz: number;
|
|
47
|
+
}, w: World) => void;
|
|
48
|
+
/**
|
|
49
|
+
* Distance along the ray from o in the unit direction d to the ground, at most max: for ray(),
|
|
50
|
+
* after the brushes. A ray that starts under the ground hits at 0. With `grow`, the path of a
|
|
51
|
+
* sphere of that radius. Sampled every MARCH metres: a crest thinner than that is missed. The
|
|
52
|
+
* stretch over the hole is skipped: a ray that stays in the arena costs no sample.
|
|
53
|
+
*/
|
|
54
|
+
export declare const trace: (w: World, o: Vec3, d: Vec3, max: number, grow?: number) => number;
|
|
55
|
+
export {};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import type { Input, PlayerState, Rover } from './types';
|
|
2
|
+
import type { World } from './world';
|
|
3
|
+
/** The rover's sizes and its handling (docs/MOON.md). Lengths in metres, per wheel rates for a body of mass 1. */
|
|
4
|
+
export declare const ROVER: {
|
|
5
|
+
/** Half the wheelbase, half the track, the wheel's radius. */
|
|
6
|
+
readonly A: 1.25;
|
|
7
|
+
readonly B: 1;
|
|
8
|
+
readonly WR: 0.5;
|
|
9
|
+
/** The spring's length at rest from the body's centre down to the hub, and its travel. */
|
|
10
|
+
readonly L0: 0.6;
|
|
11
|
+
readonly CMAX: 0.5;
|
|
12
|
+
/** Stiffness (1/s²) and damping (1/s) of a spring. */
|
|
13
|
+
readonly K: 30;
|
|
14
|
+
readonly D: 2;
|
|
15
|
+
/** Squared radii of gyration in pitch and roll, and the height of the centre the tyre forces lever on. */
|
|
16
|
+
readonly KP2: 1.2;
|
|
17
|
+
readonly KR2: 0.7;
|
|
18
|
+
readonly HC: 0.7;
|
|
19
|
+
/** Engine and brake (m/s²), the top speed forward and in reverse, rolling drag and the handbrake's. */
|
|
20
|
+
readonly ENGINE: 12;
|
|
21
|
+
readonly VMAX: 23.2;
|
|
22
|
+
readonly VREV: 8;
|
|
23
|
+
readonly BRAKE: 14;
|
|
24
|
+
readonly ROLL: 0.6;
|
|
25
|
+
readonly HB: 6;
|
|
26
|
+
/** Grip sideways and in traction, as shares of the load, and the share left sideways under the handbrake. */
|
|
27
|
+
readonly MU: 1.1;
|
|
28
|
+
readonly MUL: 1.2;
|
|
29
|
+
readonly HBG: 0.35;
|
|
30
|
+
/** Steering toward the driver's look: gain, the speed that halves it, the lock, its rate, and the yaw rate's cap and response. */
|
|
31
|
+
readonly SK: 2.5;
|
|
32
|
+
readonly SV: 10;
|
|
33
|
+
readonly SMAX: 0.55;
|
|
34
|
+
readonly SRATE: 3.5;
|
|
35
|
+
readonly YMAX: 2.4;
|
|
36
|
+
readonly YRESP: 10;
|
|
37
|
+
/** In the air: the pull back to level, its damping, the rates' decay, and the tilt nothing passes. */
|
|
38
|
+
readonly AK: 5;
|
|
39
|
+
readonly AC: 3;
|
|
40
|
+
readonly AD: 0.5;
|
|
41
|
+
readonly TILT: 0.9;
|
|
42
|
+
/** The body against the brushes: circles of radius RB at BODY along the nose, BODY_H tall; a wheel climbs WHEEL_STEP. */
|
|
43
|
+
readonly RB: 1.05;
|
|
44
|
+
readonly BODY: readonly [1.15, 0, -1.15];
|
|
45
|
+
readonly BODY_H: 1.5;
|
|
46
|
+
readonly WHEEL_STEP: 0.6;
|
|
47
|
+
/** A player this close to a rover's centre gets in; a rover this fast hurts an enemy, and this fast puts him down. */
|
|
48
|
+
readonly ENTER_R: 3;
|
|
49
|
+
readonly SPLAT_MIN: 6;
|
|
50
|
+
readonly SPLAT_KILL: 12;
|
|
51
|
+
};
|
|
52
|
+
/** The map's rovers at rest on their spawns, nobody aboard. */
|
|
53
|
+
export declare const park: (w: World) => Rover[];
|
|
54
|
+
/**
|
|
55
|
+
* One step of 1 / TICK_HZ s, in place. `i` is the driver's input as the wire rounds it (FORWARD and
|
|
56
|
+
* BACK the throttle, JUMP the handbrake, its yaw where the nose is steered to), or undefined with
|
|
57
|
+
* nobody at the wheel: the brake is on. Reads only the rover, the input and the world. Returns
|
|
58
|
+
* whether it fell under the world's kill floor: the caller parks it again.
|
|
59
|
+
*/
|
|
60
|
+
export declare const drive: (r: Rover, i: Input | undefined, w: World) => boolean;
|
|
61
|
+
/** Puts the body of a player on seat `s` (0 the driver's, 1 the rider's) of the rover, with its speed. */
|
|
62
|
+
export declare const seat: (p: PlayerState, r: Rover, s: 0 | 1) => void;
|
|
63
|
+
/** The player takes seat `s`: he rides (MODE.RIDE) from the next step on. */
|
|
64
|
+
export declare const board: (p: PlayerState, r: Rover, s: 0 | 1) => void;
|
|
65
|
+
/** The player gets out of seat `s`: in the air beside the rover, with its speed. */
|
|
66
|
+
export declare const leave: (p: PlayerState, r: Rover, s: 0 | 1, w: World) => void;
|
|
67
|
+
/**
|
|
68
|
+
* The driver's whole step, on the host and in the predictor alike: the rover is driven by his
|
|
69
|
+
* input, he follows on his seat, and a press of USE gets him out. Returns drive()'s answer.
|
|
70
|
+
*/
|
|
71
|
+
export declare const ride: (p: PlayerState, r: Rover, i: Input, w: World, team: number) => boolean;
|
|
@@ -51,6 +51,8 @@ export declare const KEY: {
|
|
|
51
51
|
readonly RELOAD: 4096;
|
|
52
52
|
/** Set while the player wants the laser rifle in hand (4 or the wheel), with BLADE and RAIL clear. Ignored without it. */
|
|
53
53
|
readonly RIFLE: 8192;
|
|
54
|
+
/** Press to get into the rover at hand, or out of the one he rides. */
|
|
55
|
+
readonly USE: 16384;
|
|
54
56
|
};
|
|
55
57
|
/**
|
|
56
58
|
* The katana's cuts (PlayerState.cut, constants CUTS), chosen by the keys held when FIRE starts
|
|
@@ -100,6 +102,8 @@ export declare const MODE: {
|
|
|
100
102
|
readonly SLIDE: 5;
|
|
101
103
|
/** Walking low. */
|
|
102
104
|
readonly CROUCH: 6;
|
|
105
|
+
/** Seated in a rover (rover.ts): the body follows the seat, move() leaves it there. */
|
|
106
|
+
readonly RIDE: 7;
|
|
103
107
|
};
|
|
104
108
|
/**
|
|
105
109
|
* Which side of the player a wall or a ledge is on (PlayerState.wall). In the air it is the side
|
|
@@ -183,7 +187,7 @@ export interface PlayerState {
|
|
|
183
187
|
/** Ticks left in which a jump still works after walking off an edge, and in which a press is kept. */
|
|
184
188
|
coyote: number;
|
|
185
189
|
buffer: number;
|
|
186
|
-
/** KEY.JUMP and KEY.
|
|
190
|
+
/** KEY.JUMP, KEY.DASH and KEY.USE as held in the last step, to tell a press from a hold. */
|
|
187
191
|
held: number;
|
|
188
192
|
/** Health, 0 to HP_MAX. */
|
|
189
193
|
hp: number;
|
|
@@ -322,6 +326,37 @@ export interface FlagState {
|
|
|
322
326
|
z: number;
|
|
323
327
|
left: number;
|
|
324
328
|
}
|
|
329
|
+
/** A seat nobody is in (Rover.driver, Rover.rider). */
|
|
330
|
+
export declare const NOBODY = 255;
|
|
331
|
+
/**
|
|
332
|
+
* A rover (rover.ts): thirteen float32 and its two seats, all a drive() needs to carry on from, so
|
|
333
|
+
* a snapshot is enough and the driver's replay is exact. Nothing is kept per wheel.
|
|
334
|
+
*/
|
|
335
|
+
export interface Rover {
|
|
336
|
+
/** The body's centre at hub height: metres. */
|
|
337
|
+
x: number;
|
|
338
|
+
y: number;
|
|
339
|
+
z: number;
|
|
340
|
+
/** m/s. */
|
|
341
|
+
vx: number;
|
|
342
|
+
vy: number;
|
|
343
|
+
vz: number;
|
|
344
|
+
/** Where the nose points, as a player's yaw, radians in [0, 2π). */
|
|
345
|
+
yaw: number;
|
|
346
|
+
/** Nose up is positive, radians. */
|
|
347
|
+
pitch: number;
|
|
348
|
+
/** Right side down is positive, radians. */
|
|
349
|
+
roll: number;
|
|
350
|
+
/** The rates of yaw, pitch and roll, rad/s. */
|
|
351
|
+
wy: number;
|
|
352
|
+
wp: number;
|
|
353
|
+
wr: number;
|
|
354
|
+
/** The front wheels' angle, radians, positive to the right. */
|
|
355
|
+
steer: number;
|
|
356
|
+
/** The player ids at the wheel and beside it, or NOBODY. */
|
|
357
|
+
driver: number;
|
|
358
|
+
rider: number;
|
|
359
|
+
}
|
|
325
360
|
export interface Snapshot {
|
|
326
361
|
/** Host tick, u16, wraps. */
|
|
327
362
|
tick: number;
|
|
@@ -343,6 +378,8 @@ export interface Snapshot {
|
|
|
343
378
|
packs?: number;
|
|
344
379
|
/** The plasma balls in flight, and those that burst since the last snapshot. Absent: none. */
|
|
345
380
|
balls?: Ball[];
|
|
381
|
+
/** The map's rovers, in the order of WorldDef.rovers. Absent: none. */
|
|
382
|
+
rovers?: Rover[];
|
|
346
383
|
}
|
|
347
384
|
/** Room rules, set by the host. Defaults in constants.ts (RULES). */
|
|
348
385
|
export interface Rules {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Relief, ReliefDef } from './relief';
|
|
1
2
|
type Vec3 = [number, number, number];
|
|
2
3
|
/** One solid box. */
|
|
3
4
|
export interface Brush {
|
|
@@ -58,6 +59,10 @@ export interface WorldDef {
|
|
|
58
59
|
scenery?: 'city' | 'moon';
|
|
59
60
|
/** Whether the runners wear space helmets. */
|
|
60
61
|
helmets?: boolean;
|
|
62
|
+
/** Ground that is not flat (relief.ts), round the brushes: the moon's crater floor. Absent: none. */
|
|
63
|
+
relief?: ReliefDef;
|
|
64
|
+
/** Where the rovers (rover.ts) are parked, each as a spawn: the middle of its wheels on the ground and the yaw of its nose. Absent: none. */
|
|
65
|
+
rovers?: Spawn[];
|
|
61
66
|
}
|
|
62
67
|
/** A world ready for physics and drawing: the definition and a grid of brushes on the floor plane. */
|
|
63
68
|
export interface World {
|
|
@@ -66,6 +71,8 @@ export interface World {
|
|
|
66
71
|
cell: number;
|
|
67
72
|
/** Cell key (see key()) to the indices of the brushes overlapping it. */
|
|
68
73
|
grid: Map<number, number[]>;
|
|
74
|
+
/** The lattice of WorldDef.relief. */
|
|
75
|
+
relief?: Relief;
|
|
69
76
|
}
|
|
70
77
|
/** The key of the cell with integer coordinates (cx, cz). */
|
|
71
78
|
export declare const key: (cx: number, cz: number) => number;
|
|
@@ -77,14 +84,11 @@ export declare const build: (def: WorldDef, cell?: number) => World;
|
|
|
77
84
|
*/
|
|
78
85
|
export declare const near: (w: World, x: number, z: number, r: number) => number[];
|
|
79
86
|
/**
|
|
80
|
-
* Distance along the ray from o in the unit direction d to the first brush face
|
|
81
|
-
* that starts inside a brush hits at 0; one that starts on a face
|
|
87
|
+
* Distance along the ray from o in the unit direction d to the first brush face or to the ground of
|
|
88
|
+
* the relief, at most max. A ray that starts inside a brush hits at 0; one that starts on a face
|
|
89
|
+
* and moves away from it does not hit it.
|
|
82
90
|
* With `grow`, every brush is that much bigger on each side: the path of a sphere of that radius
|
|
83
91
|
* (its corners square, and a brush is only found in the cells the ray crosses).
|
|
84
|
-
*
|
|
85
|
-
* Walks the grid cells the ray crosses (Amanatides and Woo), testing the brushes of each against
|
|
86
|
-
* the exact slab test, and stops once the next cell starts beyond the best hit or max. A brush
|
|
87
|
-
* spanning several cells is tested in each: the hit is the same, and lists are short.
|
|
88
92
|
*/
|
|
89
93
|
export declare const ray: (w: World, o: Vec3, d: Vec3, max: number, grow?: number) => number;
|
|
90
94
|
/** Whether a brush hides b from a. */
|
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.96.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"files": [
|
|
8
8
|
"dist"
|