Skip to main content

Module camera

Module camera 

Source
Expand description

The shared L0 camera — the seam where the two domain skins (map + graph) meet one navigation model. It is the superset of the two cameras that exist in the skins today:

  • graphview’s 2D pan/zoom (facett-graphview::model::Camera): a world point projects as p * zoom + pan. The arch/dep/release boards drive this.
  • map3d’s 3D OrbitCamera view math (view_proj / view_space / project_view / NEAR_PLANE): a turntable orbit with a real perspective transform.

Both are reproduced here bit-for-bit (the camera_seam test goldens the moved math against the originals) so a future renderer can drive map and graph through one camera and a shared z-ordered layer stack. The skins keep their own camera types this milestone (zero behavior change); this is the additive seam the render kernel will consume.

InputFeel (the per-OS FEEL: orbit/pan/dolly sensitivity + damping) lives here now — it was in facett-map3d::camera; that module re-exports it back, so map3d’s public API and all its tests are unchanged.

Structs§

Camera
The shared camera — the superset of the 2D pan/zoom and 3D orbit cameras.
InputFeel
How the camera should feel for this OS / input device — derived from facett-core’s look presets so a macOS trackpad orbits/pinches naturally while a Windows wheel zooms in discrete steps.
Pos
A 2D point in world space (caller-owned layout coordinates). Mirrors facett-graphview::model::Pos.
Projected
A point projected into screen space + its camera-space depth (for sorting + near-plane clipping). Mirrors facett-map3d::camera::Projected.
V3
A 3-vector helper (no heavy linear-algebra dep — this is all the math the camera needs and keeps the crate lean / deterministic). Mirrors facett-map3d::camera::V3.