Advertisement
KiLLerBoy_001

GTA5 - [C#] static Vector3 GetCoordsInfrontOfCam(float range

May 12th, 2015
858
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.69 KB | None | 0 0
  1.         public static Vector3 GetCoordsInfrontOfCam(float range)
  2.         {
  3.             Vector3 GameplayCamRot = Function.Call<Vector3>(Hash.GET_GAMEPLAY_CAM_ROT, 2);
  4.             Vector3 GameplayCamCoord = Function.Call<Vector3>(Hash.GET_GAMEPLAY_CAM_COORD);
  5.  
  6.             float tan = (float)(Math.Cos(GameplayCamRot.X) * range);
  7.             float xPlane = (float)((Math.Sin(GameplayCamRot.Z * -1.0f) * tan) + GameplayCamCoord.X);
  8.             float yPlane = (float)((Math.Cos(GameplayCamRot.Z * -1.0f) * tan) + GameplayCamCoord.Y);
  9.             float zPlane = (float)((Math.Sin(GameplayCamRot.X) * range) + GameplayCamCoord.Z);
  10.  
  11.             return new Vector3(xPlane, yPlane, zPlane);
  12.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement