Skip to content
Shapemetry

@huukhanhnguyen/model / lanes/cameras/camera

lanes/cameras/camera

CAMERA_FOV_DEFAULT_DEGREES

const CAMERA_FOV_DEFAULT_DEGREES: 45 = 45

Vertical fov of a camera authored WITHOUT one, in degrees. INHERITED — 45° is already this repo's stated lens everywhere a camera gets a default: ArchetypeCameraOptions.fovDegrees (schema/views.ts) and the fov arg default of both the camera and view3d method tables (schema/vocabulary/). It applies only where the projection is not in question: a cameras[] entry chooses between fov and height, so there an unstated projection is an ERROR, not this.


CAMERA_UP_DEFAULT

const CAMERA_UP_DEFAULT: Vector

Roll reference for a camera whose up was not authored. ABSENT genuinely means this: a camera with no roll stated is level with the world, and +Z is this repo's world up.


assertViewDirection()

assertViewDirection(position, target, subject): void

Reject target === position.

Equal points name no view direction, so the projection basis built from them is NaN in every component — and a NaN basis draws an EMPTY view rather than an error, which is why this throws instead of substituting a direction. subject names the camera in the message (a lane node's key, a view head's method).

This is the standing cost of AUTHORING with a target rather than a direction. A camera stores neither: its 3-DOF pose is folded once into the instance transformation, so the check belongs here, at the fold.

Parameters

position

Point

target

Point

subject

string

Returns

void


lookAtTransformation()

lookAtTransformation(position, target, up): Transformation

Column-major look-at matrix: translation at [12,13,14], −Z toward target. A look-at gesture writes this (then Euler); CameraData itself has no pose.

Parameters

position

Point

target

Point

up

Vector

Returns

Transformation

Last updated: 📖 2 min readEdit on GitHub