feat: implement SMSG_CAMERA_SHAKE with sinusoidal camera shake effect

- Add triggerShake(magnitude, frequency, duration) to CameraController
- Apply envelope-decaying sinusoidal XYZ offset to camera in update()
- Handle SMSG_CAMERA_SHAKE opcode in GameHandler dispatch
- Translate shakeId to magnitude (minor <50: 0.04, larger: 0.08 world units)
- Wire CameraShakeCallback from GameHandler through to CameraController
- Shake uses 18Hz oscillation with 30% fade-out envelope at end of duration
This commit is contained in:
Kelsi 2026-03-12 19:37:53 -07:00
parent 214c1a9ff8
commit 9aa4b223dc
5 changed files with 70 additions and 0 deletions

View file

@ -646,6 +646,11 @@ void Application::setState(AppState newState) {
renderer->getCameraController()->applyKnockBack(vcos, vsin, hspeed, vspeed);
}
});
gameHandler->setCameraShakeCallback([this](float magnitude, float frequency, float duration) {
if (renderer && renderer->getCameraController()) {
renderer->getCameraController()->triggerShake(magnitude, frequency, duration);
}
});
}
// Load quest marker models
loadQuestMarkerModels();