c++
float RampValue = VelocityRamp(length(m_Vel) * 50, m_Tuning.m_VelrampStart, m_Tuning.m_VelrampRange, m_Tuning.m_VelrampCurvature);
m_Vel.x = m_Vel.x * RampValue;
(edited)c++
// clamp the velocity to something sane
if(length(m_Vel) > 6000)
m_Vel = normalize(m_Vel) * 6000;