diff --git a/Blarg.GameFramework/Math/MathHelpers.cs b/Blarg.GameFramework/Math/MathHelpers.cs index 15fbf32..e40f4e8 100644 --- a/Blarg.GameFramework/Math/MathHelpers.cs +++ b/Blarg.GameFramework/Math/MathHelpers.cs @@ -86,6 +86,19 @@ namespace Blarg.GameFramework return angle - MathConstants.Radians90; } + /// + /// Returns the angle of rotation around the Y axis between the two + /// 3D points. This is calculated by only looking at the X and Z + /// components of each point. + /// + /// The angle of rotation (in radians) around the Y axis between the two points + /// The first point + /// The second point + public static float GetYAngleBetweenPoints(Vector3 a, Vector3 b) + { + return GetAngleBetweenPoints(a.X, a.Z, b.X, b.Z); + } + /// /// Solves a quadratic equation and returns the lowest root. ///