Extension
Adjusts the lens and the shot the Body and Aim build.
Extensions tweak a shot once the Body and Aim are done. You can add as many as you like to one virtual camera, and they run in the order they were added. Three are the exception. Lens runs first, so the Body and Aim frame with its lens. FollowZoom and Confiner run right after the Body, so the Aim frames with their field of view and from where they let the camera go. addExtension returns a function that removes one.
Which one?
Usage
import { GroupFramingExtension, LensExtension } from '@pmndrs/klipp';
camera.addExtension(new GroupFramingExtension(members, { padding: 1 }));
const removeLens = camera.addExtension(new LensExtension({ fov: 40, fovDamping: 0.5 }));
import { LensExtension } from '@pmndrs/klipp';
import { GroupFramingExtensionThree, TargetGroup } from '@pmndrs/klipp/three';
camera.addExtension(new GroupFramingExtensionThree(new TargetGroup([{ target: a }, { target: b }]), { padding: 1 }));
const removeLens = camera.addExtension(new LensExtension({ fov: 40, fovDamping: 0.5 }));
import { Extension } from '@pmndrs/klipp/react';
<VirtualCamera name="party" priority={10}>
<Body.Follow target={leaderRef} offset={[0, 4, 10]} />
<Aim.HardLookAt target={leaderRef} />
<Extension.GroupFraming members={[{ target: aRef }, { target: bRef }]} padding={1} />
<Extension.Lens fov={40} fovDamping={0.5} />
</VirtualCamera>