# V2 Camera Soft Lock-On

The camera soft lock-on layer biases the current camera rotation toward an
eligible target without forcing a full lock. It selects targets from
deterministic candidate data, applies strength and blend alpha, clamps yaw and
pitch bias, and exports the adjusted camera-manager mode.

## Runtime Surface

- `FV2CameraSoftLockOnConfig` configures bias strength, target distance and
  angle gates, yaw and pitch clamp limits, blend speed, line-of-sight
  requirement, and mode blend time.
- `FV2CameraSoftLockOnState` carries the current camera pose, base camera mode
  type, FOV, current target id, and current bias alpha.
- `FV2CameraSoftLockOnInput` carries delta seconds and whether soft lock is
  enabled.
- `FV2CameraSoftLockOnTarget` carries target id, location, priority,
  eligibility, and line-of-sight state.
- `FV2CameraSoftLockOnEvaluation` returns selected target data, desired target
  rotation, biased rotation, yaw and pitch bias, bias alpha, target score, mode
  spec, and validation issues.

## Bias Rules

1. Invalid config, state, or input is blocking.
2. Invalid target entries are skipped and reported as non-blocking issues.
3. Targets must be eligible, within distance, within angle, and line-of-sight
   visible when line-of-sight is required.
4. Target score combines priority, distance score, and angle score.
5. Bias alpha ramps by `BiasBlendSpeed * DeltaSeconds`.
6. Rotation bias is `target delta * BiasStrength * BiasAlpha`.
7. Yaw and pitch bias are clamped independently so the camera never becomes a
   hard lock-on camera.

## Camera Manager Export

`EvaluateCameraSoftLockOn` fills `ModeSpec` with the state base mode type using
id `camera.soft_lock_on`. `BuildCameraSoftLockOnMode` can export a custom id,
priority, and active flag for a camera manager stack.

## Validation Commands

Run these targeted checks when touching soft lock-on:

```bash
python3 V2/ue/Tools/check-v2-camera-soft-lock-on.py
python3 V2/ue/Tools/check-v2-camera-manager.py
python3 V2/ue/Tools/check-v2-ci-workflow.py
python3 -m json.tool V2/ue/Content/V2/Gameplay/Camera/CameraSoftLockOn_V2_Contract.json
python3 -m py_compile V2/ue/Tools/check-v2-camera-soft-lock-on.py
```
