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