Assets/WatsonCore/Utilities/Utility.cs
/// <summary>
/// Approximately Quaternion with the specified a, b and tolerance.
/// </summary>
/// <param name="a">The first component.</param>
/// <param name="b">The second component.</param>
/// <param name="tolerance">Tolerance.</param>
Approximately Quaternion with the specified a, b and tolerance.
Approximately Quaternion with the specified a b and tolerance .
public static bool Approximately(Quaternion a, Quaternion b, float tolerance = 0.0001f)
        {
            return
                (Approximately(a.eulerAngles.x, b.eulerAngles.x, tolerance) || Approximately((a.eulerAngles.x < 0 ? a.eulerAngles.x + 360.0f : a.eulerAngles.x), (b.eulerAngles.x < 0 ? b.eulerAngles.x + 360.0f : b.eulerAngles.x), tolerance)) &&
                    (Approximately(a.eulerAngles.y, b.eulerAngles.y, tolerance) || Approximately((a.eulerAngles.y < 0 ? a.eulerAngles.y + 360.0f : a.eulerAngles.y), (b.eulerAngles.y < 0 ? b.eulerAngles.y + 360.0f : b.eulerAngles.y), tolerance)) &&
                    (Approximately(a.eulerAngles.z, b.eulerAngles.z, tolerance) || Approximately((a.eulerAngles.z < 0 ? a.eulerAngles.z + 360.0f : a.eulerAngles.z), (b.eulerAngles.z < 0 ? b.eulerAngles.z + 360.0f : b.eulerAngles.z), tolerance));
        }
public static bool Approximately ( Quaternion a , Quaternion b , float tolerance = 0.0001f ) { return ( Approximately ( a . eulerAngles . x , b . eulerAngles . x , tolerance ) || Approximately ( ( a . eulerAngles . x < 0 ? a . eulerAngles . x + 360.0f : a . eulerAngles . x ) , ( b . eulerAngles . x < 0 ? b . eulerAngles . x + 360.0f : b . eulerAngles . x ) , tolerance ) ) && ( Approximately ( a . eulerAngles . y , b . eulerAngles . y , tolerance ) || Approximately ( ( a . eulerAngles . y < 0 ? a . eulerAngles . y + 360.0f : a . eulerAngles . y ) , ( b . eulerAngles . y < 0 ? b . eulerAngles . y + 360.0f : b . eulerAngles . y ) , tolerance ) ) && ( Approximately ( a . eulerAngles . z , b . eulerAngles . z , tolerance ) || Approximately ( ( a . eulerAngles . z < 0 ? a . eulerAngles . z + 360.0f : a . eulerAngles . z ) , ( b . eulerAngles . z < 0 ? b . eulerAngles . z + 360.0f : b . eulerAngles . z ) , tolerance ) ) ; }
Approximately Quaternion with the specified a, b and tolerance.
Approximately Quaternion with the specified a b and tolerance .
a
Quaternion
The first component.
The first component .
b
Quaternion
The second component.
The second component .
tolerance
float
None