Simplify math codebase

This commit is contained in:
Wojtek Figat
2024-02-20 17:52:51 +01:00
parent 8fa8eeb094
commit e5cfd872b2
7 changed files with 245 additions and 202 deletions

View File

@@ -90,18 +90,12 @@ public:
/// <summary>
/// Checks if transform is an identity transformation.
/// </summary>
bool IsIdentity() const
{
return Translation.IsZero() && Orientation.IsIdentity() && Scale.IsOne();
}
bool IsIdentity() const;
/// <summary>
/// Returns true if transform has one or more components equal to +/- infinity or NaN.
/// </summary>
bool IsNanOrInfinity() const
{
return Translation.IsNanOrInfinity() || Orientation.IsNanOrInfinity() || Scale.IsNanOrInfinity();
}
bool IsNanOrInfinity() const;
/// <summary>
/// Calculates the determinant of this transformation.
@@ -278,6 +272,25 @@ public:
return result;
}
/// <summary>
/// Performs transformation of the given rotation in world space to the local space of this transform.
/// </summary>
/// <param name="rotation">The world space rotation.</param>
/// <param name="result">The local space rotation.</param>
void WorldToLocal(const Quaternion& rotation, Quaternion& result) const;
/// <summary>
/// Performs transformation of the given rotation in world space to the local space of this transform.
/// </summary>
/// <param name="rotation">The world space rotation.</param>
/// <returns>The local space rotation.</returns>
Quaternion WorldToLocal(const Quaternion& rotation) const
{
Quaternion result;
WorldToLocal(rotation, result);
return result;
}
public:
FORCE_INLINE Transform operator*(const Transform& other) const
{