SHOW:
|
|
- or go back to the newest paste.
| 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 | } |