Skip to content

Commit

Permalink
Reduce slam shake when highway is tilted
Browse files Browse the repository at this point in the history
  • Loading branch information
ASleepyCat committed Jul 17, 2020
1 parent 362ee33 commit 83d87d5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Main/src/Camera.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,8 @@ void Camera::Tick(float deltaTime, class BeatmapPlayback& playback)
m_totalOffset = (pLaneOffset * (5 * 100) / (6 * 116)) / 2.0f + m_spinBounceOffset;

// Update camera shake effects
m_shakeOffset = m_shakeEffect.amplitude;
// Reduce slam shake when highway is tilted horizontally to minimise slams having too much impact
m_shakeOffset = m_shakeEffect.amplitude * (1 - fabsf(sinf(m_actualRoll * 360 * Math::degToRad)));
if (fabsf(m_shakeEffect.amplitude) > 0)
{
float shakeDecrement = SHAKE_AMOUNT * 0.2 * (deltaTime / (1 / 60.f)); // Reduce shake by constant amount
Expand Down

0 comments on commit 83d87d5

Please sign in to comment.