struct
CameraShakeComponent
Trauma-based camera shake (Squirrel Eiserloh GDC pattern). Attach to the camera entity; CameraShakeSystem decays trauma every frame and writes the resulting offsets into the runtime fields, which CameraSystem folds into the camera's view matrix on assembly.
- Module
- Camera
- Header
#include "Camera/Components/CameraShakeComponent.h"- Namespace
Mowo- Reflection
- Reflected by MowoHeaderTool
Properties
| Type | Name | Description |
|---|---|---|
bool | enabled | Default true. |
float | trauma | Current trauma level. 0 = no shake, 1 = max. Decays toward 0 at traumaDecay per second. Gameplay code adds trauma via AddTrauma() — exposed in the inspector so designers can preview the feel. Default 0.0f. |
float | traumaDecay | Default 1.5f. |
float | maxOffsetPosition | Maximum positional amplitude in world units. Effective shake is trauma² × maxOffset so most of the budget kicks in past 0.5. Default 0.3f. |
float | maxRotationAngle | Maximum angular amplitude in degrees (small yaw/pitch/roll perturbations layered on top of the camera's orientation). Default 5.0f. |
float | noiseFrequency | How rapidly the shake direction flips. 25 Hz matches typical hand-held-camera feel; lower for ground-rumble, higher for jitter. Default 25.0f. |
uint32_t | noiseSeed | Deterministic seed. Two shake components with identical seeds produce identical motion — bump for variety across cameras. Default 1u. |
Vec3 | currentPositionOffset | Runtime — written by CameraShakeSystem each frame, read by CameraSystem when assembling the active view matrix. Rotation offsets are stored in radians as (pitch, yaw, roll) for direct composition with the camera basis. Default Vec3(0, 0, 0). |
Vec3 | currentRotationOffsetRad | Default Vec3(0, 0, 0). |
float | elapsedTime | Default 0.0f. |
Public functions
| Returns | Name | Description |
|---|---|---|
void | AddTrauma | Additive — multiple explosions stack until the cap. |
Function details
AddTrauma
C++
void AddTrauma(float delta)Additive — multiple explosions stack until the cap.
Generated from Camera/Components/CameraShakeComponent.h via camera.json · Oct 26, 2026Version 1.0.0