Skip to main content

Module view

Module view 

Source
Expand description

The interactive viewer camera (R21/R25): orthographic default + perspective toggle with state-preserving switch, zoom-to-fit, dynamic depth-range fit, world-per-pixel and world→screen queries. Pure f64 math — shared verbatim by the wasm canvas shell and the winit desktop shell (dual-target directive).

Screen coordinates throughout are CSS pixels with the origin at the canvas top-left, y down (what browser pointer events deliver); the DPR only matters at surface-size time, never in camera math (matching the retired viewer, whose thresholds were CSS-pixel based).

Structs§

Ray
A world-space ray for picking.
ViewCamera

Enums§

Projection
The projection kind (R21): orthographic is the default; the toggle keeps the apparent size at the target plane.

Functions§

add3
cross3
dot3
invert4_columns
Inverse of a column-major 4×4 matrix (index = col*4 + row layout). Returns None if singular. Used to invert the view-projection for the host overlays’ screen→world path.
len3
norm3
rotate3
Rotate v around unit axis by angle (Rodrigues).
scale3
sub3