The camera shake layer evaluates deterministic shake events against a base
FV2CameraModeSpec. It supports Perlin noise shake, damped spring shake, and
directional impact shake with configurable amplitude, frequency, duration, and
falloff.
Runtime Surface#
FV2CameraShakeConfigconfigures global amplitude and frequency scales, location and rotation clamps, default falloff distance, allowed duration bounds, and per-pattern enable flags.FV2CameraShakeStatecarries the base camera mode, delta seconds, and global time seconds for deterministic evaluation.FV2CameraShakeEventcarries shake id, pattern, source location, impact direction, amplitude, frequency, duration, elapsed time, falloff distance, spring damping, looping state, and active state.FV2CameraShakeEvaluationreturns accumulated location and rotation offsets, total amplitude, active and completed counts, per-pattern flags, the originalBaseModeSpec, the shakenModeSpec, and validation issues.
Shake Rules#
- Invalid config, state, or event data is blocking.
- Inactive events do not contribute offsets.
- Non-looping events fade by remaining lifetime and report
ShakeExpiredwhen they have completed. - Falloff uses event falloff distance when set, otherwise the config default.
- Perlin noise uses deterministic
FMath::PerlinNoise1Doffsets seeded by shake id. - Spring shake uses a damped sine response.
- Directional impact shake pushes along the normalized impact direction.
- Accumulated offsets are clamped by configured location and rotation limits.
Camera Manager Export#
EvaluateCameraShake stores the unmodified base camera in BaseModeSpec and
the offset camera in ModeSpec. BuildCameraShakeMode uses BaseModeSpec, so
custom exports do not apply shake offsets twice.
Validation Commands#
Run these targeted checks when touching camera shake:
bash
python3 V2/ue/Tools/check-v2-camera-shake.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/CameraShake_V2_Contract.json
python3 -m py_compile V2/ue/Tools/check-v2-camera-shake.py