added some nodiscards

This commit is contained in:
2024-05-18 13:40:29 +03:00
parent 4e01f3ee09
commit 7ea5cecff0
7 changed files with 53 additions and 18 deletions

View File

@@ -12,10 +12,13 @@ namespace uml
public:
float w = 0.f;
Vector4(float x = 0.f, float y = 0.f, float z = 0.f, float w = 0.f) : Vector3(x, y, z), w(w) {}
Vector4(const float x = 0.f, const float y = 0.f, const float z = 0.f, const float w = 0.f) : Vector3(x, y, z), w(w) {}
Vector4() = default;
[[nodiscard]]
bool operator==(const Vector4& src) const;
[[nodiscard]]
bool operator!=(const Vector4& src) const;
Vector4& operator+=(const Vector4& v);
@@ -28,15 +31,32 @@ namespace uml
[[nodiscard]] float Length() const;
[[nodiscard]] float LengthSqr() const;
[[nodiscard]] float Dot(const Vector4& vOther) const;
Vector4& Abs();
Vector4& Clamp(float min, float max);
[[nodiscard]]
Vector4 operator-() const;
[[nodiscard]]
Vector4 operator+(const Vector4& v) const;
[[nodiscard]]
Vector4 operator-(const Vector4& v) const;
[[nodiscard]]
Vector4 operator*(float scalar) const;
[[nodiscard]]
Vector4 operator*(const Vector4& v) const;
[[nodiscard]]
Vector4 operator/(float scalar) const;
[[nodiscard]]
Vector4 operator/(const Vector4& v) const;
[[nodiscard]] float Sum() const;
[[nodiscard]]
float Sum() const;
};
}