@kalyptos/narcissus 0.1.2 → 0.2.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 +1 -0
- package/dist/cli/main.js +1 -1
- package/dist/controls/controls.d.ts +10 -2
- package/dist/controls/pose.d.ts +8 -1
- package/dist/controls-Dlxyn7yr.js +3516 -0
- package/dist/element/index.js +1 -1
- package/dist/engine/engine.d.ts +34 -3
- package/dist/engine/gpu/masks.d.ts +26 -0
- package/dist/engine/gpu/overlay.d.ts +21 -0
- package/dist/engine/gpu/pick.d.ts +26 -0
- package/dist/engine/gpu/pool.d.ts +10 -2
- package/dist/engine/gpu/project.d.ts +5 -0
- package/dist/engine/gpu/raster.d.ts +0 -5
- package/dist/engine/gpu/renderer.d.ts +8 -8
- package/dist/engine/index.d.ts +5 -2
- package/dist/engine/layer.d.ts +26 -0
- package/dist/engine/mask.d.ts +18 -0
- package/dist/engine/math/frustum.d.ts +5 -2
- package/dist/engine/math/prism.d.ts +13 -0
- package/dist/engine/overlay.d.ts +28 -0
- package/dist/engine/plan/draw.d.ts +1 -1
- package/dist/engine/stream/feed.d.ts +2 -0
- package/dist/engine/types.d.ts +8 -0
- package/dist/format/encode.d.ts +8 -0
- package/dist/format/idx.d.ts +2 -0
- package/dist/format/index.d.ts +2 -1
- package/dist/format/index.js +1 -1
- package/dist/{format-C3Vn0c2b.js → format-CbtEy9NS.js} +352 -139
- package/dist/index.d.ts +1 -0
- package/dist/index.js +30 -29
- package/dist/synthetic-DO8oIw_x.js +212 -0
- package/dist/tools/index.js +1 -1
- package/dist/tools-DnfuHeoO.js +227 -0
- package/package.json +1 -1
- package/dist/controls-mxyJLzqv.js +0 -2767
- package/dist/synthetic-BeGCzYIv.js +0 -383
- package/dist/tools-NykPVccD.js +0 -242
package/README.md
CHANGED
|
@@ -43,6 +43,7 @@ npx @kalyptos/narcissus publish ./world remote:bucket/world
|
|
|
43
43
|
|
|
44
44
|
- [docs/format.md](docs/format.md): the specification of Guldmund Trees
|
|
45
45
|
- [docs/hosting.md](docs/hosting.md): how to serve, publish and show a world
|
|
46
|
+
- [docs/embedding.md](docs/embedding.md): the hooks for a page that embeds the viewer: layers, masks, picking, graphics and the camera
|
|
46
47
|
- [docs/architecture.md](docs/architecture.md): how the code is built, and how to add a source or a plugin
|
|
47
48
|
- [CONTRIBUTING.md](CONTRIBUTING.md)
|
|
48
49
|
|
package/dist/cli/main.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { t as e } from "../ports-DZRKjdYD.js";
|
|
3
3
|
import { t } from "../http-DL7R39Nc.js";
|
|
4
|
-
import { a as n, r, t as i } from "../tools-
|
|
4
|
+
import { a as n, r, t as i } from "../tools-DnfuHeoO.js";
|
|
5
5
|
import { createWriteStream as a, statSync as o } from "node:fs";
|
|
6
6
|
import { pipeline as s } from "node:stream/promises";
|
|
7
7
|
import { parseArgs as c } from "node:util";
|
|
@@ -10,13 +10,21 @@ export declare function smooth(shown: Pose, target: Pose, dt: number, ground: Gr
|
|
|
10
10
|
/** map camera: left drag orbits, right/middle/shift drag pans the ground, wheel zooms, f flies */
|
|
11
11
|
export declare class Controls {
|
|
12
12
|
#private;
|
|
13
|
+
/** false ignores pointer, wheel and key input; flights still run */
|
|
14
|
+
enabled: boolean;
|
|
13
15
|
constructor(canvas: HTMLCanvasElement, engine: Engine, ground: Ground, pose: Pose, limits?: Limits);
|
|
14
16
|
/** the pose the camera shows now */
|
|
15
17
|
get pose(): Pose;
|
|
16
|
-
/** fires
|
|
17
|
-
onChange(fn: () => void): () => void;
|
|
18
|
+
/** fires with the shown pose each time it changes, from input, flights and jumps */
|
|
19
|
+
onChange(fn: (pose: Pose) => void): () => void;
|
|
18
20
|
/** puts the focus on a ground point; heading and tilt stay, a far view closes in */
|
|
19
21
|
moveTo(e: number, n: number): void;
|
|
22
|
+
/** shows the pose at once; fields left out stay */
|
|
23
|
+
jump(pose: Partial<Pose>): void;
|
|
24
|
+
/** flies to the pose, fields left out staying; false when input, another move, the signal or destroy cuts it short */
|
|
25
|
+
flyTo(pose: Partial<Pose>, options?: {
|
|
26
|
+
signal?: AbortSignal;
|
|
27
|
+
}): Promise<boolean>;
|
|
20
28
|
destroy(): void;
|
|
21
29
|
}
|
|
22
30
|
export {};
|
package/dist/controls/pose.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Camera, World } from '../engine/index.ts';
|
|
1
|
+
import type { Box, Camera, World } from '../engine/index.ts';
|
|
2
2
|
/** easting, northing and height in world coordinates, metres */
|
|
3
3
|
export interface Point {
|
|
4
4
|
e: number;
|
|
@@ -61,5 +61,12 @@ export declare function fly(p: Pose, right: number, forward: number, up: number)
|
|
|
61
61
|
export declare function pan(p: Pose, right: number, forward: number): Pose;
|
|
62
62
|
/** moves a toward b by fraction t: focus linearly, yaw the short way round, dist in log space */
|
|
63
63
|
export declare function blend(a: Pose, b: Pose, t: number): Pose;
|
|
64
|
+
/** a pose that shows all of box: focus at its centre, heading and tilt from pose */
|
|
65
|
+
export declare function fit(box: Box, pose: Pose): Pose;
|
|
66
|
+
/** an eased path from one pose to another over ms; a long hop rises so the view keeps its bearings */
|
|
67
|
+
export declare function flight(from: Pose, to: Pose): {
|
|
68
|
+
ms: number;
|
|
69
|
+
at(t: number): Pose;
|
|
70
|
+
};
|
|
64
71
|
/** close enough that the rest of the way is not visible */
|
|
65
72
|
export declare function settled(a: Pose, b: Pose): boolean;
|