Aim

Decides where the camera looks.

An Aim rotates the camera. It never moves it, that's the Body's job. Each virtual camera has at most one Aim: setting another replaces it. It always runs after the Body.

Which one?

AimUse it for
HardLookAtAlways looking straight at a target.
RotationComposerLooking at a target smoothly, with a dead zone or off-center framing.
RotateWithFollowTargetCopying a target's rotation: first person, mounted cameras.
PanTiltLetting the user look around with the mouse or touch.

Without an Aim the camera keeps its starting rotation, initialState.

Usage

import { FollowBody, HardLookAtAim, targetPose } from '@pmndrs/klipp';

const player = targetPose.create(); // keep player.position up to date

camera.body = new FollowBody(player, { offset: [0, 3, 8] });
camera.aim = new HardLookAtAim(player);