mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 16:03:29 +00:00
Improve IsNormalized()
This commit is contained in:
parent
0dd9178269
commit
cbc7dac0d5
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