Lens

Changes fov, orthographic size, near and far, with damping.

Sets the camera's fov, orthographicSize, near and far. Leave one out to keep the current value. Each one can be damped separately, for effects like a speed zoom.

Set lens values through Lens, not on the real camera directly. Klipp writes the lens every time the shot changes, so direct changes get overwritten, for example by the next blend.

Settings

SettingDescriptionDefault
fovField of view, in degrees.
orthographicSizeHalf the view's height in world units, for an orthographic camera.
nearNear clipping plane.
farFar clipping plane.
fovDampingSeconds to reach a new fov. See Damping.0
orthographicSizeDampingSeconds to reach a new orthographicSize.0
nearDampingSeconds to reach a new near.0
farDampingSeconds to reach a new far.0
fovMaxSpeedMaximum fov change, in degrees per second.Infinity
orthographicSizeMaxSpeedMaximum orthographicSize change, in units per second.Infinity
nearMaxSpeedMaximum near change, in units per second.Infinity
farMaxSpeedMaximum far change, in units per second.Infinity

Usage

import { LensExtension } from '@pmndrs/klipp';

const lens = new LensExtension({ fov: 50, fovDamping: 0.4 });
camera.addExtension(lens);

// any time later
lens.fov = boosting ? 75 : 50;