RotateWithFollowTarget
Copies the target's rotation.
Gives the camera the same rotation as the target, as if it were glued to it. It doesn't look at the target, it only copies how the target is turned.
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, { damping: 0.1 });
Only head.rotation is read, and only while head.hasRotation is set.
import { HardLockToTargetBodyThree, RotateWithFollowTargetAimThree } from '@pmndrs/klipp/three';
camera.body = new HardLockToTargetBodyThree(head);
camera.aim = new RotateWithFollowTargetAimThree(head, { damping: 0.1 });
<VirtualCamera name="first-person" priority={10}>
<Body.HardLockToTarget target={headRef} />
<Aim.RotateWithFollowTarget target={headRef} damping={0.1} />
</VirtualCamera>
ref gives you the RotateWithFollowTargetAimThree.