@hackbuild/cameras 0.1.0 → 0.1.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/README.md +1 -1
- package/how.ts +25 -0
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -79,7 +79,7 @@ defines `HackbuildCameras`.
|
|
|
79
79
|
| `dist/index.js` (main entry, imports external) | 3,265 bytes | 3,428 bytes |
|
|
80
80
|
| `dist/cameras.iife.js` (single file build) | 3,378 bytes | 3,546 bytes |
|
|
81
81
|
|
|
82
|
-
Measured 2026-11-
|
|
82
|
+
Measured 2026-11-24 by `node tools/lint-packages.mjs` (gzip level 9) from the packed
|
|
83
83
|
tarball. Generated from `tools/size-budget.json`; CI fails when a file moves more than
|
|
84
84
|
5 percent from its row.
|
|
85
85
|
|
package/how.ts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// how this works: the fold of the package page and of the suite tool. Plain data, no imports;
|
|
2
|
+
// checked by tsconfig.how.json, shipped in the tarball, never imported by the runtime entry.
|
|
3
|
+
const how: HowDoc = {
|
|
4
|
+
what: "gameplay cameras with shared damping, seeded shake and occlusion pull in. they drive a three camera without importing three.",
|
|
5
|
+
how: [
|
|
6
|
+
"each camera writes `position.set`, `lookAt`, `fov` and `aspect` on the camera you pass, so a three PerspectiveCamera fits and the package imports nothing at runtime.",
|
|
7
|
+
"follow sits behind a heading with a damped target and yaw. you pass a `clear` callback, your raycast; when something blocks the view the camera pulls in at once and eases back out.",
|
|
8
|
+
"group keeps every point on screen at a fixed pitch and yaw: the centre is pulled toward the arena centre, then the distance is solved so every corner of the padded box round the points projects inside the screen band.",
|
|
9
|
+
"orbit takes rotate, zoom and pan deltas and leaves input binding to the app. first person scales the agent's head to 0.001 for its own render only. shake draws seeded value noise with decaying trauma from an rng stream of its own. `splitViewports` gives one to four views.",
|
|
10
|
+
],
|
|
11
|
+
packages: ["@hackbuild/cameras"],
|
|
12
|
+
install: "npm install @hackbuild/cameras",
|
|
13
|
+
today: `git clone https://github.com/hackbuild/hackbuild-agents
|
|
14
|
+
cd hackbuild-agents && npm ci && npm run build -w @hackbuild/cameras`,
|
|
15
|
+
lang: "ts",
|
|
16
|
+
code: `import { Follow, Shake } from "@hackbuild/cameras";
|
|
17
|
+
|
|
18
|
+
const follow = new Follow(camera, { distance: 4, clear: (from, dir, max) => raycast(from, dir, max) });
|
|
19
|
+
const shake = new Shake(shakeRng); // a stream of its own, never the sim rng
|
|
20
|
+
follow.update(dog.position, dog.yaw, dt);
|
|
21
|
+
const s = shake.step(dt);
|
|
22
|
+
camera.position.x += s.x;`,
|
|
23
|
+
links: { page: "https://hackbuild.github.io/hackbuild-agents/cameras/", source: "https://github.com/hackbuild/hackbuild-agents/tree/main/packages/cameras" },
|
|
24
|
+
};
|
|
25
|
+
export default how;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hackbuild/cameras",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Follow, group framing, free orbit, first person eye and split view cameras with shared damping, seeded shake and occlusion backoff. Drives a three camera without importing three.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -24,7 +24,8 @@
|
|
|
24
24
|
"files": [
|
|
25
25
|
"dist",
|
|
26
26
|
"README.md",
|
|
27
|
-
"LICENSE"
|
|
27
|
+
"LICENSE",
|
|
28
|
+
"how.ts"
|
|
28
29
|
],
|
|
29
30
|
"unpkg": "./dist/cameras.iife.js",
|
|
30
31
|
"jsdelivr": "./dist/cameras.iife.js",
|