GeneralizedOrbital
An orbital camera and its mouse/keyboard controls in a single Extension -- the way Orbital combines OrbitalCamera and OrbitalControls, except there's no separate camera/controls pair to wire together here, and the projection matrix comes from generalizedProjection instead of Drawer.perspective/Drawer.ortho.
That swap replaces OrbitalCamera's discrete ProjectionType -- PERSPECTIVE vs ORTHOGONAL, each with its own size field (fov vs a separate ortho magnitude) -- with a single continuous perspective blend (0.0 fully parallel, 1.0 fully perspective) applied to one viewport rectangle, sized by fov at the current orbit radius (the eye-to-lookAt distance) rather than at near. For a full perspective projection that choice of reference distance doesn't matter -- generalizedProjection's perspective divide rescales the rectangle by each point's actual distance regardless of where it was measured, the usual similar-triangles invariance of a frustum -- but it matters a great deal once perspective drops below 1.0: with no such rescaling left, an orthographic projection uses the rectangle's size directly as the visible width of the whole scene, at every depth, so it has to already be in scale with the orbit rather than a sliver measured a fraction of a unit from the eye. One consequence: dolly (mouse wheel) changes what's visible in both modes now, since it changes that reference distance -- there's no separate ortho magnitude/near/far bookkeeping, and no mode where scrolling does nothing.
Properties
Damping factor for camera motion, set to 0 for no damping.
The near clip plane's distance from the eye at perspective = 1.0; the effective near clip distance tapers linearly to 0.0 as perspective drops toward 0.0 -- see beforeDraw.
Shifts generalizedProjection's viewportCenter in x/y, in the same world units as the viewport rectangle itself -- an off-axis (sheared) frustum shift, the way a lens-shift lens or a tiled/CAVE display's off-center screen would, without moving or rotating the eye. Vector2.ZERO is the ordinary on-axis frustum. Damped like the other orbit properties -- set it directly for an instant change, or animate it smoothly with offsetTo.
0.0 = fully parallel (orthographic), 1.0 = fully perspective; see generalizedProjection. Damped like the other orbit properties -- set it directly for an instant change, or animate it smoothly with perspectiveTo.
Functions
Dollies to distance the way DemoGeneralizedPerspective01 establishes a dolly zoom -- compensating fov as the eye moves so whatever sits at lookAt keeps the same apparent size, leaving only the depth-dependent stretch/compression (the Vertigo effect) visible elsewhere in the scene. The demo derives its viewport size from subjectDistance / distance; since fov plays the same role here that viewport size did there (both feed the same 2 * distance * tan(fov / 2) viewport-height formula beforeDraw uses -- see the class doc), the equivalent invariant to hold is distance * tan(fov / 2) = constant. That constant is taken from the current target (sphericalEnd's radius and fovEnd) at the moment this is called, not spherical/fov directly, so chained or repeated calls compose the way dolly/zoom do instead of resetting to whatever framing happened to be on screen.