Add Vector3.SignedAngle utility method

Merge 072f7c7e45 and c1bd42ff7e
This commit is contained in:
Wojtek Figat
2024-10-29 23:55:42 +01:00
parent 8a52fa257b
commit 34dcbc0445
3 changed files with 55 additions and 7 deletions

View File

@@ -812,13 +812,22 @@ public:
static FLAXENGINE_API T TriangleArea(const Vector3Base& v0, const Vector3Base& v1, const Vector3Base& v2);
/// <summary>
/// Calculates the angle (in radians) between from and to. This is always the smallest value.
/// Calculates the angle (in degrees) between from and to. This is always the smallest value.
/// </summary>
/// <param name="from">The first vector.</param>
/// <param name="to">The second vector.</param>
/// <returns>The angle (in radians).</returns>
/// <returns>The angle (in degrees).</returns>
static FLAXENGINE_API T Angle(const Vector3Base& from, const Vector3Base& to);
/// <summary>
/// Calculates the signed angle (in degrees) between from and to vectors. This is always the smallest value. The sign of the result depends on: the order of input vectors, and the direction of the axis vector.
/// </summary>
/// <param name="from">The first vector.</param>
/// <param name="to">The second vector.</param>
/// <param name="axis">The axis around which the vectors are rotated.</param>
/// <returns>The angle (in degrees).</returns>
static FLAXENGINE_API T SignedAngle(const Vector3Base& from, const Vector3Base& to, const Vector3Base& axis);
/// <summary>
/// Snaps the input position onto the grid.
/// </summary>