You've already forked godot
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:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user