mirror of
https://github.com/orange-cpp/omath.git
synced 2026-02-13 15:03:27 +00:00
bugfix
This commit is contained in:
@@ -134,14 +134,14 @@ namespace omath
|
||||
return len > 0.f ? *this / len : *this;
|
||||
}
|
||||
#else
|
||||
[[nodiscard]] Type Length() const
|
||||
[[nodiscard]] Type length() const
|
||||
{
|
||||
return std::hypot(x, y);
|
||||
}
|
||||
|
||||
[[nodiscard]] Vector2 Normalized() const
|
||||
[[nodiscard]] Vector2 normalized() const
|
||||
{
|
||||
const Type len = Length();
|
||||
const Type len = length();
|
||||
return len > 0.f ? *this / len : *this;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -149,19 +149,19 @@ namespace omath
|
||||
|
||||
[[nodiscard]] Vector3 normalized() const
|
||||
{
|
||||
const Type length = this->Length();
|
||||
const Type len = this->length();
|
||||
|
||||
return length != 0 ? *this / length : *this;
|
||||
return len != 0 ? *this / len : *this;
|
||||
}
|
||||
|
||||
[[nodiscard]] Type length_2d() const
|
||||
{
|
||||
return Vector2<Type>::Length();
|
||||
return Vector2<Type>::length();
|
||||
}
|
||||
|
||||
[[nodiscard]] Type distance_to(const Vector3& vOther) const
|
||||
{
|
||||
return (*this - vOther).Length();
|
||||
return (*this - vOther).length();
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user