LEAKlNG

ffff

Feb 10th, 2021
579
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. Vector3 GET_COORDS_INFRONT(float d)
  2. {
  3. Vector3 ro = CAM::GET_GAMEPLAY_CAM_ROT(2, 0);
  4. Vector3 rot;
  5. float x = ro.z + 90;
  6. while (x < 0) x = x + 360;
  7. while (x > 360)
  8. {
  9. x = x - 360;
  10. }
  11. bool fix = false;
  12. if (x > 180)
  13. {
  14. fix = true;
  15. }
  16. rot.x = x;
  17. rot.z = ro.x;
  18. float cosrotz = NewMath::Cos(rot.z);
  19.  
  20. Vector3 _coords;
  21.  
  22. _coords.x = 0.f;
  23. _coords.y = 0.f;
  24. _coords.z = d * NewMath::Sin(rot.z);
  25.  
  26. if (fix == true)
  27. {
  28. rot.x = (rot.x - 180);
  29. _coords.x = -d * NewMath::Cos(rot.x)*cosrotz;
  30. _coords.y = -d * NewMath::Sin(rot.x)*cosrotz;
  31. }
  32. else
  33. {
  34. _coords.x = d * NewMath::Cos(rot.x)*cosrotz;
  35. _coords.y = d * NewMath::Sin(rot.x)*cosrotz;
  36. }
  37. Vector3 ForwardCoords(_coords.x, _coords.y, _coords.z);
  38. return ForwardCoords;
  39. }
Advertisement
Add Comment
Please, Sign In to add comment