1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

Merge pull request #108974 from Joy-less/Improve-IsNormalized()

Improve `IsNormalized()` in C#
This commit is contained in:
Thaddeus Crews
2025-09-22 08:50:06 -05:00
4 changed files with 4 additions and 4 deletions

View File

@@ -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()

View File

@@ -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>

View File

@@ -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>

View File

@@ -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>