Advertisement
Wolfrost

CSGO NormalizeVector

May 7th, 2017
284
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. void NormalizeVector(Vector& v)
  2. {
  3.     if (v.x > 89.0f && v.x <= 180.0f)
  4.         v.x = 89.0f;
  5.     while (v.x > 180.f)
  6.         v.x -= 360.f;
  7.     while (v.x < -89.0f)
  8.         v.x = -89.0f;
  9.     while (v.y > 180.f)
  10.         v.y -= 360.f;
  11.     while (v.y < -180.f)
  12.     v.y += 360.f;
  13.  
  14.     v.z = 0;
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement