Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Vector2 A;
- Vector2 B;
- A.X = currentMouseState.X;
- A.Y = currentMouseState.Y;
- B.X = Pg.Position.X;
- B.Y = Pg.Position.Y;
- Vector2 D = A - B;
- double AB = Math.Sqrt((D.X * D.X) + (D.Y * D.Y));
- float angle = (float)(Math.Asin(D.X/AB));
- angle = -(float)Math.Atan2(D.X, D.Y) + MathHelper.Pi;
- poi angle si somma alla rotazione
Add Comment
Please, Sign In to add comment