Guest User

Untitled

a guest
Oct 22nd, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.30 KB | None | 0 0
  1. if (this.Target != null)
  2. {
  3.     Vector3 distance = (this.Target.Position.Translation - this.Position.Translation);
  4.         Vector2 flatdistance = new Vector2(distance.X, distance.Z);
  5.         Elevation = (float)Math.Atan2(-distance.Y, flatdistance.Length());
  6.     Rotation = (float)Math.Atan2(distance.X, distance.Z);
  7. }
Add Comment
Please, Sign In to add comment