Advertisement
letsplayordy

[C#] Rotation to direction

Jun 20th, 2015
878
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.44 KB | None | 0 0
  1. public static Vector3 RotationToDirection(Vector3 Rotation)
  2. {
  3.     float z = Rotation.Z;
  4.     float num = z * 0.0174532924f;
  5.     float x = Rotation.X;
  6.     float num2 = x * 0.0174532924f;
  7.     float num3 = Math.Abs((float)Math.Cos((double)num2));
  8.     return new Vector3
  9.     {
  10.         X = (float)((double)((float)(-(float)Math.Sin((double)num))) * (double)num3),
  11.         Y = (float)((double)((float)Math.Cos((double)num)) * (double)num3),
  12.         Z = (float)Math.Sin((double)num2)
  13.     };
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement