HardLockToTarget

Puts the camera exactly where the target is.

Moves the camera to the target's position, with no offset. Good for first-person cameras, cameras attached to a moving object, or a camera at a fixed point.

Settings

SettingDescriptionDefault
targetWhat to lock onto. See Targets.
dampingSeconds to catch up with the target. 0 is instant. See Damping.0
maxSpeedMaximum catch-up speed, in units per second.Infinity

Usage

import { HardLockToTargetBody, RotateWithFollowTargetAim, targetPose } from '@pmndrs/klipp';

const head = targetPose.create(); // keep head.position, head.rotation and hasRotation up to date

camera.body = new HardLockToTargetBody(head);
camera.aim = new RotateWithFollowTargetAim(head);