mirror of
https://github.com/orange-cpp/omath.git
synced 2026-06-09 00:34:34 +00:00
improvement
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user