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
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);
import { HardLockToTargetBodyThree, RotateWithFollowTargetAimThree } from '@pmndrs/klipp/three';
camera.body = new HardLockToTargetBodyThree(head);
camera.aim = new RotateWithFollowTargetAimThree(head);
<VirtualCamera name="first-person" priority={10}>
<Body.HardLockToTarget target={headRef} />
<Aim.RotateWithFollowTarget target={headRef} />
</VirtualCamera>
ref gives you the HardLockToTargetBodyThree.