diff --git a/src/Vector3D.cpp b/src/Vector3D.cpp index 350851a..d34daa4 100644 --- a/src/Vector3D.cpp +++ b/src/Vector3D.cpp @@ -47,7 +47,7 @@ V3D::V3D(const V3D &other) } template -std::array V3D::ToArray() +std::array V3D::ToArray() const { return {this->x, this->y, this->z}; } @@ -61,19 +61,19 @@ void V3D::operator=(const V3D &other) } template -V3D V3D::operator+(const V3D &other) +V3D V3D::operator+(const V3D &other) const { return V3D{this->x + other.x, this->y + other.y, this->z + other.z}; } template -V3D V3D::operator-(const V3D &other) +V3D V3D::operator-(const V3D &other) const { return V3D{this->x - other.x, this->y - other.y, this->z - other.z}; } template -V3D V3D::operator*(Type scalar) +V3D V3D::operator*(Type scalar) const { return V3D{this->x * scalar, this->y * scalar, this->z * scalar}; } diff --git a/src/Vector3D.hpp b/src/Vector3D.hpp index 818a565..f0c36ce 100644 --- a/src/Vector3D.hpp +++ b/src/Vector3D.hpp @@ -18,13 +18,13 @@ public: template V3D(const V3D &other); - std::array ToArray(); + std::array ToArray() const; - V3D operator+(const V3D &other); + V3D operator+(const V3D &other) const; - V3D operator-(const V3D &other); + V3D operator-(const V3D &other) const; - V3D operator*(Type scalar); + V3D operator*(Type scalar) const; void operator=(const V3D &other);