improvement

This commit is contained in:
2026-05-22 12:35:05 +03:00
parent a04bceaeb6
commit 39d0d0683d
6 changed files with 123 additions and 0 deletions
+5
View File
@@ -171,6 +171,11 @@ namespace omath
y = y < static_cast<Type>(0) ? -y : y;
return *this;
}
[[nodiscard("You must use absed vector")]]
constexpr Vector2 abs() const noexcept
{
return Vector2{*this}.abs();
}
[[nodiscard("You must use negated vector")]]
constexpr Vector2 operator-() const noexcept
+5
View File
@@ -121,6 +121,11 @@ namespace omath
return *this;
}
[[nodiscard("You must use absed vector")]]
constexpr Vector3 abs() const noexcept
{
return Vector3{*this}.abs();
}
[[nodiscard("You must use squared distance")]]
constexpr Type distance_to_sqr(const Vector3& other) const noexcept
+5
View File
@@ -113,6 +113,11 @@ namespace omath
return *this;
}
[[nodiscard("You must use absed vector")]]
constexpr Vector4 abs() const noexcept
{
return Vector4{*this}.abs();
}
constexpr Vector4& clamp(const Type& min, const Type& max) noexcept
{
this->x = std::clamp(this->x, min, max);