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

SettingDescriptionDefault
targetWhose rotation to copy. Must have one; a fixed point doesn't. See Targets.
dampingSeconds to catch up with the target's rotation. 0 is instant. See Damping.0
maxSpeedMaximum turn speed, in degrees 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, { damping: 0.1 });

Only head.rotation is read, and only while head.hasRotation is set.