コード例 #1
0
        public static float GetHitObjectAngle(this Vector2 target)
        {
            Vector2 offset = new Vector2(256, 192) - target; // Using centre of playfield.

            return((float)MathHelper.RadiansToDegrees(Math.Atan2(offset.X, -offset.Y)) - 90);
        }
コード例 #2
0
        public static float GetDegreesFromPosition(this Vector2 target, Vector2 self)
        {
            Vector2 offset = self - target;

            return((float)MathHelper.RadiansToDegrees(Math.Atan2(-offset.X, offset.Y)));
        }