From 792f7801bb915d1cfb332e619ab65756991cf3b6 Mon Sep 17 00:00:00 2001 From: josh Date: Thu, 1 Feb 2024 20:47:44 -0500 Subject: [PATCH] Implement Vector4 operator= --- include/J3ML/LinearAlgebra/Vector4.h | 2 ++ src/J3ML/LinearAlgebra/Vector4.cpp | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/include/J3ML/LinearAlgebra/Vector4.h b/include/J3ML/LinearAlgebra/Vector4.h index 6eba284..0d9c12a 100644 --- a/include/J3ML/LinearAlgebra/Vector4.h +++ b/include/J3ML/LinearAlgebra/Vector4.h @@ -81,6 +81,8 @@ namespace LinearAlgebra { Vector4 operator+() const; // Unary + Operator Vector4 operator-() const; // Unary - Operator (Negation) + + public: #if MUTABLE float x; diff --git a/src/J3ML/LinearAlgebra/Vector4.cpp b/src/J3ML/LinearAlgebra/Vector4.cpp index eefec41..fb735dc 100644 --- a/src/J3ML/LinearAlgebra/Vector4.cpp +++ b/src/J3ML/LinearAlgebra/Vector4.cpp @@ -141,6 +141,15 @@ Vector4 Vector4::operator-(const Vector4& rhs) const } + Vector4 &Vector4::operator=(const Vector4 &rhs) { + x = rhs.x; + y = rhs.y; + z = rhs.z; + w = rhs.w; + + return *this; + } + } #pragma endregion \ No newline at end of file