소스 검색

C#: reverse Vector2.AngleToPoint

Alexey Kim 2 년 전
부모
커밋
e9ace71c88
2개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 1 1
      modules/mono/glue/GodotSharp/GodotSharp/Core/Vector2.cs
  2. 1 1
      modules/mono/glue/GodotSharp/GodotSharp/Core/Vector2i.cs

+ 1 - 1
modules/mono/glue/GodotSharp/GodotSharp/Core/Vector2.cs

@@ -139,7 +139,7 @@ namespace Godot
         /// <returns>The angle between the two vectors, in radians.</returns>
         public readonly real_t AngleToPoint(Vector2 to)
         {
-            return Mathf.Atan2(y - to.y, x - to.x);
+            return Mathf.Atan2(to.y - y, to.x - x);
         }
 
         /// <summary>

+ 1 - 1
modules/mono/glue/GodotSharp/GodotSharp/Core/Vector2i.cs

@@ -123,7 +123,7 @@ namespace Godot
         /// <returns>The angle between the two vectors, in radians.</returns>
         public readonly real_t AngleToPoint(Vector2i to)
         {
-            return Mathf.Atan2(y - to.y, x - to.x);
+            return Mathf.Atan2(to.y - y, to.x - x);
         }
 
         /// <summary>