Expand description
Orbit camera → column-major view_projection for the Qualia portal (CPU hot path, zero-heap).
Structs§
- Camera
State - Interactive orbit state driven from JS (
set_camera,set_camera_pan,set_camera_target). - FlyCamera
- 6-DOF Free-flight camera with velocity damping for editor, debug, and free inspection.
- Orbit
Camera - Orbit inspection camera around a central pivot point.
- Ray3D
- A 3D ray with origin and normalized direction vector.
- Spring
Chase Camera - 2nd-order spring-damper critically damped pursuit camera.
Constants§
- CAMERA_
FAR_ PLANE - CAMERA_
MAX_ ZOOM - CAMERA_
MIN_ ZOOM - CAMERA_
NEAR_ PLANE - CAMERA_
TAN_ HALF_ FOV - Tangent of the vertical half-FOV used by both projection and AO reconstruction.
Functions§
- extract_
frustum_ planes - Extracts 6 normalized inward-pointing frustum planes
[nx, ny, nz, d]from a column-major view-projection matrix ([0, w]depth convention). - look_
at_ rh - Right-handed look-at view matrix (column-major).
- mat4_
mul_ col - Column-major $4\times 4$ matrix product
a * b. - orbit_
eye_ position - Orbit camera eye position — matches the
look_atused inorbit_view_projection. - orbit_
eye_ position_ target - Orbit camera eye position with pan target center point.
- orbit_
forward - Unit world-space direction from the orbit eye toward its target.
- orbit_
view_ projection - Column-major view×projection (WGSL
mat4x4<f32>compatible) centered at world origin. - orbit_
view_ projection_ target - Column-major view×projection centered at arbitrary world-space target center.
- orbit_
view_ projection_ with_ near - Orbit view-projection with custom near plane.
- painter_
order_ far_ to_ near - Far-to-near index order for a proof canvas tick.
- perspective_
rh_ zo - Right-handed perspective projection matrix with
[0, 1]clip depth (WebGPU convention, column-major). - sphere_
in_ frustum - Returns
trueif a sphere(center, radius)intersects or lies inside all 6 normalized frustum planes. - unproject_
screen_ to_ ray - Unprojects 2D screen coordinates into a 3D world ray using a $4 \times 4$ inverse view-projection matrix.