add angle helper method
This commit is contained in:
parent
421ecc9f43
commit
d06cba8263
|
@ -86,6 +86,19 @@ namespace Blarg.GameFramework
|
|||
return angle - MathConstants.Radians90;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 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.
|
||||
/// </summary>
|
||||
/// <returns>The angle of rotation (in radians) around the Y axis between the two points</returns>
|
||||
/// <param name="a">The first point</param>
|
||||
/// <param name="b">The second point</param>
|
||||
public static float GetYAngleBetweenPoints(Vector3 a, Vector3 b)
|
||||
{
|
||||
return GetAngleBetweenPoints(a.X, a.Z, b.X, b.Z);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Solves a quadratic equation and returns the lowest root.
|
||||
/// </summary>
|
||||
|
|
Reference in a new issue