Advertisement
DevMarmot

Untitled

Jan 22nd, 2020
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.17 KB | None | 0 0
  1. float SpeedCoef(float elevationDif, float distance)
  2. {
  3.     float coef = abs(elevationDif/distance);
  4.     if (coef > 2.f)
  5.         coef = 2.f;
  6.     return (elevationDif < 0) ? -coef : coef;
  7. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement