Merge pull request #108974 from Joy-less/Improve-IsNormalized()
Improve `IsNormalized()` in C#
This commit is contained in:
commit
d8b057d06d
4 changed files with 4 additions and 4 deletions
|
|
@ -338,7 +338,7 @@ namespace Godot
|
|||
/// <returns>A <see langword="bool"/> for whether the quaternion is normalized or not.</returns>
|
||||
public readonly bool IsNormalized()
|
||||
{
|
||||
return Mathf.Abs(LengthSquared() - 1) <= Mathf.Epsilon;
|
||||
return Mathf.IsEqualApprox(LengthSquared(), 1, Mathf.Epsilon);
|
||||
}
|
||||
|
||||
public readonly Quaternion Log()
|
||||
|
|
|
|||
|
|
@ -370,7 +370,7 @@ namespace Godot
|
|||
/// <returns>A <see langword="bool"/> indicating whether or not the vector is normalized.</returns>
|
||||
public readonly bool IsNormalized()
|
||||
{
|
||||
return Mathf.Abs(LengthSquared() - 1.0f) < Mathf.Epsilon;
|
||||
return Mathf.IsEqualApprox(LengthSquared(), 1, Mathf.Epsilon);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
|
|
@ -368,7 +368,7 @@ namespace Godot
|
|||
/// <returns>A <see langword="bool"/> indicating whether or not the vector is normalized.</returns>
|
||||
public readonly bool IsNormalized()
|
||||
{
|
||||
return Mathf.Abs(LengthSquared() - 1.0f) < Mathf.Epsilon;
|
||||
return Mathf.IsEqualApprox(LengthSquared(), 1, Mathf.Epsilon);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
|
|
@ -318,7 +318,7 @@ namespace Godot
|
|||
/// <returns>A <see langword="bool"/> indicating whether or not the vector is normalized.</returns>
|
||||
public readonly bool IsNormalized()
|
||||
{
|
||||
return Mathf.Abs(LengthSquared() - 1.0f) < Mathf.Epsilon;
|
||||
return Mathf.IsEqualApprox(LengthSquared(), 1, Mathf.Epsilon);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue